12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746 |
- /*!
- * vConsole v3.2.0 (https://github.com/Tencent/vConsole)
- *
- * Tencent is pleased to support the open source community by making vConsole available.
- * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
- * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
- * http://opensource.org/licenses/MIT
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- */
- !(function(e, t) {
- "object" == typeof exports && "object" == typeof module
- ? (module.exports = t())
- : "function" == typeof define && define.amd
- ? define([], t)
- : "object" == typeof exports
- ? (exports.VConsole = t())
- : (e.VConsole = t());
- })(this, function() {
- return (function(e) {
- function t(n) {
- if (o[n]) return o[n].exports;
- var i = (o[n] = { exports: {}, id: n, loaded: !1 });
- return e[n].call(i.exports, i, i.exports, t), (i.loaded = !0), i.exports;
- }
- var o = {};
- return (t.m = e), (t.c = o), (t.p = ""), t(0);
- })([
- function(e, t, o) {
- "use strict";
- function n(e) {
- return e && e.__esModule ? e : { default: e };
- }
- Object.defineProperty(t, "__esModule", { value: !0 }), o(1);
- var i = o(2),
- a = n(i),
- r = o(18),
- l = n(r);
- (a["default"].VConsolePlugin = l["default"]),
- (t["default"] = a["default"]),
- (e.exports = t["default"]);
- },
- function(e, t) {
- "use strict";
- if ("undefined" == typeof Symbol) {
- window.Symbol = function() {};
- var o = "__symbol_iterator_key";
- (window.Symbol.iterator = o),
- (Array.prototype[o] = function() {
- var e = this,
- t = 0;
- return {
- next: function() {
- return {
- done: e.length === t,
- value: e.length === t ? void 0 : e[t++]
- };
- }
- };
- });
- }
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var r = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- l = o(3),
- c = i(l),
- s = o(4),
- d = n(s),
- u = o(5),
- v = i(u);
- o(7);
- var f = o(11),
- p = i(f),
- h = o(12),
- g = i(h),
- b = o(13),
- m = i(b),
- y = o(14),
- _ = i(y),
- w = o(15),
- x = i(w),
- k = o(16),
- C = i(k),
- T = o(24),
- O = i(T),
- E = o(26),
- S = i(E),
- L = o(30),
- j = i(L),
- N = o(37),
- P = i(N),
- M = "#__vconsole",
- A = (function() {
- function e(t) {
- if ((a(this, e), v["default"].one(M)))
- return void console.debug("vConsole is already exists.");
- var o = this;
- if (
- ((this.version = c["default"].version),
- (this.$dom = null),
- (this.isInited = !1),
- (this.option = {
- defaultPlugins: ["system", "network", "element", "storage"]
- }),
- (this.activedTab = ""),
- (this.tabList = []),
- (this.pluginList = {}),
- (this.switchPos = {
- x: 10,
- y: 10,
- startX: 0,
- startY: 0,
- endX: 0,
- endY: 0
- }),
- (this.tool = d),
- (this.$ = v["default"]),
- d.isObject(t))
- )
- for (var n in t) this.option[n] = t[n];
- this._addBuiltInPlugins();
- var i = function() {
- o.isInited ||
- (o._render(), o._mockTap(), o._bindEvent(), o._autoRun());
- };
- void 0 !== document
- ? "complete" == document.readyState
- ? i()
- : v["default"].bind(window, "load", i)
- : !(function() {
- var e = void 0,
- t = function o() {
- document && "complete" == document.readyState
- ? (e && clearTimeout(e), i())
- : (e = setTimeout(o, 1));
- };
- e = setTimeout(t, 1);
- })();
- }
- return (
- r(e, [
- {
- key: "_addBuiltInPlugins",
- value: function() {
- this.addPlugin(new C["default"]("default", "Log"));
- var e = this.option.defaultPlugins,
- t = {
- system: { proto: O["default"], name: "System" },
- network: { proto: S["default"], name: "Network" },
- element: { proto: j["default"], name: "Element" },
- storage: { proto: P["default"], name: "Storage" }
- };
- if (e && d.isArray(e))
- for (var o = 0; o < e.length; o++) {
- var n = t[e[o]];
- n
- ? this.addPlugin(new n.proto(e[o], n.name))
- : console.debug(
- "Unrecognized default plugin ID:",
- e[o]
- );
- }
- }
- },
- {
- key: "_render",
- value: function() {
- if (!v["default"].one(M)) {
- var e = document.createElement("div");
- (e.innerHTML = p["default"]),
- document.documentElement.insertAdjacentElement(
- "beforeend",
- e.children[0]
- );
- }
- this.$dom = v["default"].one(M);
- var t = v["default"].one(".vc-switch", this.$dom),
- o = 1 * d.getStorage("switch_x"),
- n = 1 * d.getStorage("switch_y");
- (o || n) &&
- (o + t.offsetWidth > document.documentElement.offsetWidth &&
- (o =
- document.documentElement.offsetWidth - t.offsetWidth),
- n + t.offsetHeight >
- document.documentElement.offsetHeight &&
- (n =
- document.documentElement.offsetHeight - t.offsetHeight),
- 0 > o && (o = 0),
- 0 > n && (n = 0),
- (this.switchPos.x = o),
- (this.switchPos.y = n),
- (v["default"].one(".vc-switch").style.right = o + "px"),
- (v["default"].one(".vc-switch").style.bottom = n + "px"));
- var i = window.devicePixelRatio || 1,
- a = document.querySelector('[name="viewport"]');
- if (a && a.content) {
- var r = a.content.match(/initial\-scale\=\d+(\.\d+)?/),
- l = r ? parseFloat(r[0].split("=")[1]) : 1;
- 1 > l && (this.$dom.style.fontSize = 13 * i + "px");
- }
- v["default"].one(".vc-mask", this.$dom).style.display =
- "none";
- }
- },
- {
- key: "_mockTap",
- value: function() {
- var e = 700,
- t = 10,
- o = void 0,
- n = void 0,
- i = void 0,
- a = !1,
- r = null;
- this.$dom.addEventListener(
- "touchstart",
- function(e) {
- if (void 0 === o) {
- var t = e.targetTouches[0];
- (n = t.pageX),
- (i = t.pageY),
- (o = e.timeStamp),
- (r =
- e.target.nodeType === Node.TEXT_NODE
- ? e.target.parentNode
- : e.target);
- }
- },
- !1
- ),
- this.$dom.addEventListener("touchmove", function(e) {
- var o = e.changedTouches[0];
- (Math.abs(o.pageX - n) > t ||
- Math.abs(o.pageY - i) > t) &&
- (a = !0);
- }),
- this.$dom.addEventListener(
- "touchend",
- function(t) {
- if (a === !1 && t.timeStamp - o < e && null != r) {
- var n = r.tagName.toLowerCase(),
- i = !1;
- switch (n) {
- case "textarea":
- i = !0;
- break;
- case "input":
- switch (r.type) {
- case "button":
- case "checkbox":
- case "file":
- case "image":
- case "radio":
- case "submit":
- i = !1;
- break;
- default:
- i = !r.disabled && !r.readOnly;
- }
- }
- i ? r.focus() : t.preventDefault();
- var l = t.changedTouches[0],
- c = document.createEvent("MouseEvents");
- c.initMouseEvent(
- "click",
- !0,
- !0,
- window,
- 1,
- l.screenX,
- l.screenY,
- l.clientX,
- l.clientY,
- !1,
- !1,
- !1,
- !1,
- 0,
- null
- ),
- (c.forwardedTouchEvent = !0),
- c.initEvent("click", !0, !0),
- r.dispatchEvent(c);
- }
- (o = void 0), (a = !1), (r = null);
- },
- !1
- );
- }
- },
- {
- key: "_bindEvent",
- value: function() {
- var e = this,
- t = v["default"].one(".vc-switch", e.$dom);
- v["default"].bind(t, "touchstart", function(t) {
- (e.switchPos.startX = t.touches[0].pageX),
- (e.switchPos.startY = t.touches[0].pageY);
- }),
- v["default"].bind(t, "touchend", function(t) {
- (e.switchPos.x = e.switchPos.endX),
- (e.switchPos.y = e.switchPos.endY),
- (e.switchPos.startX = 0),
- (e.switchPos.startY = 0),
- (e.switchPos.endX = 0),
- (e.switchPos.endY = 0),
- d.setStorage("switch_x", e.switchPos.x),
- d.setStorage("switch_y", e.switchPos.y);
- }),
- v["default"].bind(t, "touchmove", function(o) {
- if (o.touches.length > 0) {
- var n = o.touches[0].pageX - e.switchPos.startX,
- i = o.touches[0].pageY - e.switchPos.startY,
- a = e.switchPos.x - n,
- r = e.switchPos.y - i;
- a + t.offsetWidth >
- document.documentElement.offsetWidth &&
- (a =
- document.documentElement.offsetWidth -
- t.offsetWidth),
- r + t.offsetHeight >
- document.documentElement.offsetHeight &&
- (r =
- document.documentElement.offsetHeight -
- t.offsetHeight),
- 0 > a && (a = 0),
- 0 > r && (r = 0),
- (t.style.right = a + "px"),
- (t.style.bottom = r + "px"),
- (e.switchPos.endX = a),
- (e.switchPos.endY = r),
- o.preventDefault();
- }
- }),
- v["default"].bind(
- v["default"].one(".vc-switch", e.$dom),
- "click",
- function() {
- e.show();
- }
- ),
- v["default"].bind(
- v["default"].one(".vc-hide", e.$dom),
- "click",
- function() {
- e.hide();
- }
- ),
- v["default"].bind(
- v["default"].one(".vc-mask", e.$dom),
- "click",
- function(t) {
- return t.target != v["default"].one(".vc-mask")
- ? !1
- : void e.hide();
- }
- ),
- v["default"].delegate(
- v["default"].one(".vc-tabbar", e.$dom),
- "click",
- ".vc-tab",
- function(t) {
- var o = this.dataset.tab;
- o != e.activedTab && e.showTab(o);
- }
- ),
- v["default"].bind(
- v["default"].one(".vc-panel", e.$dom),
- "transitionend webkitTransitionEnd oTransitionEnd otransitionend",
- function(t) {
- return t.target != v["default"].one(".vc-panel")
- ? !1
- : void (
- v["default"].hasClass(e.$dom, "vc-toggle") ||
- (t.target.style.display = "none")
- );
- }
- );
- var o = v["default"].one(".vc-content", e.$dom),
- n = !1;
- v["default"].bind(o, "touchstart", function(e) {
- var t = o.scrollTop,
- i = o.scrollHeight,
- a = t + o.offsetHeight;
- 0 === t
- ? ((o.scrollTop = 1),
- 0 === o.scrollTop &&
- (v["default"].hasClass(e.target, "vc-cmd-input") ||
- (n = !0)))
- : a === i &&
- ((o.scrollTop = t - 1),
- o.scrollTop === t &&
- (v["default"].hasClass(e.target, "vc-cmd-input") ||
- (n = !0)));
- }),
- v["default"].bind(o, "touchmove", function(e) {
- n && e.preventDefault();
- }),
- v["default"].bind(o, "touchend", function(e) {
- n = !1;
- });
- }
- },
- {
- key: "_autoRun",
- value: function() {
- this.isInited = !0;
- for (var e in this.pluginList)
- this._initPlugin(this.pluginList[e]);
- this.tabList.length > 0 && this.showTab(this.tabList[0]),
- this.triggerEvent("ready");
- }
- },
- {
- key: "triggerEvent",
- value: function(e, t) {
- (e = "on" + e.charAt(0).toUpperCase() + e.slice(1)),
- d.isFunction(this.option[e]) &&
- this.option[e].apply(this, t);
- }
- },
- {
- key: "_initPlugin",
- value: function(e) {
- var t = this;
- (e.vConsole = this),
- e.trigger("init"),
- e.trigger("renderTab", function(o) {
- t.tabList.push(e.id);
- var n = v["default"].render(g["default"], {
- id: e.id,
- name: e.name
- });
- v["default"]
- .one(".vc-tabbar", t.$dom)
- .insertAdjacentElement("beforeend", n);
- var i = v["default"].render(m["default"], { id: e.id });
- o &&
- (d.isString(o)
- ? (i.innerHTML += o)
- : d.isFunction(o.appendTo)
- ? o.appendTo(i)
- : d.isElement(o) &&
- i.insertAdjacentElement("beforeend", o)),
- v["default"]
- .one(".vc-content", t.$dom)
- .insertAdjacentElement("beforeend", i);
- }),
- e.trigger("addTopBar", function(o) {
- if (o)
- for (
- var n = v["default"].one(".vc-topbar", t.$dom),
- i = function(t) {
- var i = o[t],
- a = v["default"].render(_["default"], {
- name: i.name || "Undefined",
- className: i.className || "",
- pluginID: e.id
- });
- if (i.data)
- for (var r in i.data) a.dataset[r] = i.data[r];
- d.isFunction(i.onClick) &&
- v["default"].bind(a, "click", function(t) {
- var o = i.onClick.call(a);
- o === !1 ||
- (v["default"].removeClass(
- v["default"].all(".vc-topbar-" + e.id),
- "vc-actived"
- ),
- v["default"].addClass(a, "vc-actived"));
- }),
- n.insertAdjacentElement("beforeend", a);
- },
- a = 0;
- a < o.length;
- a++
- )
- i(a);
- }),
- e.trigger("addTool", function(o) {
- if (o)
- for (
- var n = v["default"].one(".vc-tool-last", t.$dom),
- i = function(t) {
- var i = o[t],
- a = v["default"].render(x["default"], {
- name: i.name || "Undefined",
- pluginID: e.id
- });
- 1 == i.global &&
- v["default"].addClass(a, "vc-global-tool"),
- d.isFunction(i.onClick) &&
- v["default"].bind(a, "click", function(e) {
- i.onClick.call(a);
- }),
- n.parentNode.insertBefore(a, n);
- },
- a = 0;
- a < o.length;
- a++
- )
- i(a);
- }),
- (e.isReady = !0),
- e.trigger("ready");
- }
- },
- {
- key: "_triggerPluginsEvent",
- value: function(e) {
- for (var t in this.pluginList)
- this.pluginList[t].isReady && this.pluginList[t].trigger(e);
- }
- },
- {
- key: "_triggerPluginEvent",
- value: function(e, t) {
- var o = this.pluginList[e];
- o && o.isReady && o.trigger(t);
- }
- },
- {
- key: "addPlugin",
- value: function(e) {
- return void 0 !== this.pluginList[e.id]
- ? (console.debug(
- "Plugin " + e.id + " has already been added."
- ),
- !1)
- : ((this.pluginList[e.id] = e),
- this.isInited &&
- (this._initPlugin(e),
- 1 == this.tabList.length &&
- this.showTab(this.tabList[0])),
- !0);
- }
- },
- {
- key: "removePlugin",
- value: function(e) {
- e = (e + "").toLowerCase();
- var t = this.pluginList[e];
- if (void 0 === t)
- return (
- console.debug("Plugin " + e + " does not exist."), !1
- );
- if ((t.trigger("remove"), this.isInited)) {
- var o = v["default"].one("#__vc_tab_" + e);
- o && o.parentNode.removeChild(o);
- for (
- var n = v["default"].all(".vc-topbar-" + e, this.$dom),
- i = 0;
- i < n.length;
- i++
- )
- n[i].parentNode.removeChild(n[i]);
- var a = v["default"].one("#__vc_log_" + e);
- a && a.parentNode.removeChild(a);
- for (
- var r = v["default"].all(".vc-tool-" + e, this.$dom),
- l = 0;
- l < r.length;
- l++
- )
- r[l].parentNode.removeChild(r[l]);
- }
- var c = this.tabList.indexOf(e);
- c > -1 && this.tabList.splice(c, 1);
- try {
- delete this.pluginList[e];
- } catch (s) {
- this.pluginList[e] = void 0;
- }
- return (
- this.activedTab == e &&
- this.tabList.length > 0 &&
- this.showTab(this.tabList[0]),
- !0
- );
- }
- },
- {
- key: "show",
- value: function() {
- if (this.isInited) {
- var e = this,
- t = v["default"].one(".vc-panel", this.$dom);
- (t.style.display = "block"),
- setTimeout(function() {
- v["default"].addClass(e.$dom, "vc-toggle"),
- e._triggerPluginsEvent("showConsole");
- var t = v["default"].one(".vc-mask", e.$dom);
- t.style.display = "block";
- }, 10);
- }
- }
- },
- {
- key: "hide",
- value: function() {
- if (this.isInited) {
- v["default"].removeClass(this.$dom, "vc-toggle"),
- this._triggerPluginsEvent("hideConsole");
- var e = v["default"].one(".vc-mask", this.$dom),
- t = v["default"].one(".vc-panel", this.$dom);
- v["default"].bind(e, "transitionend", function(o) {
- (e.style.display = "none"), (t.style.display = "none");
- });
- }
- }
- },
- {
- key: "showSwitch",
- value: function() {
- if (this.isInited) {
- var e = v["default"].one(".vc-switch", this.$dom);
- e.style.display = "block";
- }
- }
- },
- {
- key: "hideSwitch",
- value: function() {
- if (this.isInited) {
- var e = v["default"].one(".vc-switch", this.$dom);
- e.style.display = "none";
- }
- }
- },
- {
- key: "showTab",
- value: function(e) {
- if (this.isInited) {
- var t = v["default"].one("#__vc_log_" + e);
- v["default"].removeClass(
- v["default"].all(".vc-tab", this.$dom),
- "vc-actived"
- ),
- v["default"].addClass(
- v["default"].one("#__vc_tab_" + e),
- "vc-actived"
- ),
- v["default"].removeClass(
- v["default"].all(".vc-logbox", this.$dom),
- "vc-actived"
- ),
- v["default"].addClass(t, "vc-actived");
- var o = v["default"].all(".vc-topbar-" + e, this.$dom);
- v["default"].removeClass(
- v["default"].all(".vc-toptab", this.$dom),
- "vc-toggle"
- ),
- v["default"].addClass(o, "vc-toggle"),
- o.length > 0
- ? v["default"].addClass(
- v["default"].one(".vc-content", this.$dom),
- "vc-has-topbar"
- )
- : v["default"].removeClass(
- v["default"].one(".vc-content", this.$dom),
- "vc-has-topbar"
- ),
- v["default"].removeClass(
- v["default"].all(".vc-tool", this.$dom),
- "vc-toggle"
- ),
- v["default"].addClass(
- v["default"].all(".vc-tool-" + e, this.$dom),
- "vc-toggle"
- ),
- this.activedTab &&
- this._triggerPluginEvent(this.activedTab, "hide"),
- (this.activedTab = e),
- this._triggerPluginEvent(this.activedTab, "show");
- }
- }
- },
- {
- key: "setOption",
- value: function(e, t) {
- if (d.isString(e))
- (this.option[e] = t),
- this._triggerPluginsEvent("updateOption");
- else if (d.isObject(e)) {
- for (var o in e) this.option[o] = e[o];
- this._triggerPluginsEvent("updateOption");
- } else
- console.debug(
- "The first parameter of vConsole.setOption() must be a string or an object."
- );
- }
- },
- {
- key: "destroy",
- value: function() {
- if (this.isInited) {
- for (
- var e = Object.keys(this.pluginList), t = e.length - 1;
- t >= 0;
- t--
- )
- this.removePlugin(e[t]);
- this.$dom.parentNode.removeChild(this.$dom);
- }
- }
- }
- ]),
- e
- );
- })();
- (t["default"] = A), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports = {
- name: "vconsole",
- version: "3.2.0",
- description:
- "A lightweight, extendable front-end developer tool for mobile web page.",
- homepage: "https://github.com/Tencent/vConsole",
- main: "dist/vconsole.min.js",
- scripts: { test: "mocha", dist: "webpack" },
- keywords: ["console", "debug", "mobile"],
- repository: {
- type: "git",
- url: "git+https://github.com/Tencent/vConsole.git"
- },
- dependencies: {},
- devDependencies: {
- "babel-core": "^6.7.7",
- "babel-loader": "^6.2.4",
- "babel-plugin-add-module-exports": "^0.1.4",
- "babel-preset-es2015": "^6.6.0",
- "babel-preset-stage-3": "^6.5.0",
- chai: "^3.5.0",
- "css-loader": "^0.23.1",
- "extract-text-webpack-plugin": "^1.0.1",
- "html-loader": "^0.4.3",
- jsdom: "^9.2.1",
- "json-loader": "^0.5.4",
- less: "^2.5.3",
- "less-loader": "^2.2.3",
- mocha: "^2.5.3",
- "style-loader": "^0.13.1",
- webpack: "~1.12.11"
- },
- author: "Tencent",
- license: "MIT"
- };
- },
- function(e, t) {
- "use strict";
- function o(e) {
- var t = e > 0 ? new Date(e) : new Date(),
- o = t.getDate() < 10 ? "0" + t.getDate() : t.getDate(),
- n = t.getMonth() < 9 ? "0" + (t.getMonth() + 1) : t.getMonth() + 1,
- i = t.getFullYear(),
- a = t.getHours() < 10 ? "0" + t.getHours() : t.getHours(),
- r = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes(),
- l = t.getSeconds() < 10 ? "0" + t.getSeconds() : t.getSeconds(),
- c =
- t.getMilliseconds() < 10
- ? "0" + t.getMilliseconds()
- : t.getMilliseconds();
- return (
- 100 > c && (c = "0" + c),
- {
- time: +t,
- year: i,
- month: n,
- day: o,
- hour: a,
- minute: r,
- second: l,
- millisecond: c
- }
- );
- }
- function n(e) {
- return "[object Number]" == Object.prototype.toString.call(e);
- }
- function i(e) {
- return "[object String]" == Object.prototype.toString.call(e);
- }
- function a(e) {
- return "[object Array]" == Object.prototype.toString.call(e);
- }
- function r(e) {
- return "[object Boolean]" == Object.prototype.toString.call(e);
- }
- function l(e) {
- return "[object Undefined]" == Object.prototype.toString.call(e);
- }
- function c(e) {
- return "[object Null]" == Object.prototype.toString.call(e);
- }
- function s(e) {
- return "[object Symbol]" == Object.prototype.toString.call(e);
- }
- function d(e) {
- return !(
- "[object Object]" != Object.prototype.toString.call(e) &&
- (n(e) || i(e) || r(e) || a(e) || c(e) || u(e) || l(e) || s(e))
- );
- }
- function u(e) {
- return "[object Function]" == Object.prototype.toString.call(e);
- }
- function v(e) {
- return "object" ===
- ("undefined" == typeof HTMLElement ? "undefined" : w(HTMLElement))
- ? e instanceof HTMLElement
- : e &&
- "object" === ("undefined" == typeof e ? "undefined" : w(e)) &&
- null !== e &&
- 1 === e.nodeType &&
- "string" == typeof e.nodeName;
- }
- function f(e) {
- var t = Object.prototype.toString.call(e);
- return (
- "[object global]" == t ||
- "[object Window]" == t ||
- "[object DOMWindow]" == t
- );
- }
- function p(e) {
- var t = Object.prototype.hasOwnProperty;
- if (
- !e ||
- "object" !== ("undefined" == typeof e ? "undefined" : w(e)) ||
- e.nodeType ||
- f(e)
- )
- return !1;
- try {
- if (
- e.constructor &&
- !t.call(e, "constructor") &&
- !t.call(e.constructor.prototype, "isPrototypeOf")
- )
- return !1;
- } catch (o) {
- return !1;
- }
- var n = void 0;
- for (n in e);
- return void 0 === n || t.call(e, n);
- }
- function h(e) {
- return document
- .createElement("a")
- .appendChild(document.createTextNode(e)).parentNode.innerHTML;
- }
- function g(e) {
- var t =
- arguments.length <= 1 || void 0 === arguments[1]
- ? " "
- : arguments[1],
- o =
- arguments.length <= 2 || void 0 === arguments[2]
- ? "CIRCULAR_DEPENDECY_OBJECT"
- : arguments[2],
- n = [],
- i = JSON.stringify(
- e,
- function(e, t) {
- if (
- "object" === ("undefined" == typeof t ? "undefined" : w(t)) &&
- null !== t
- ) {
- if (~n.indexOf(t)) return o;
- n.push(t);
- }
- return t;
- },
- t
- );
- return (n = null), i;
- }
- function b(e) {
- if (!d(e) && !a(e)) return [];
- var t = [
- "toString",
- "toLocaleString",
- "valueOf",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "constructor"
- ],
- o = [];
- for (var n in e) t.indexOf(n) < 0 && o.push(n);
- return (o = o.sort());
- }
- function m(e) {
- return Object.prototype.toString
- .call(e)
- .replace("[object ", "")
- .replace("]", "");
- }
- function y(e, t) {
- window.localStorage &&
- ((e = "vConsole_" + e), localStorage.setItem(e, t));
- }
- function _(e) {
- return window.localStorage
- ? ((e = "vConsole_" + e), localStorage.getItem(e))
- : void 0;
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var w =
- "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
- ? function(e) {
- return typeof e;
- }
- : function(e) {
- return e &&
- "function" == typeof Symbol &&
- e.constructor === Symbol
- ? "symbol"
- : typeof e;
- };
- (t.getDate = o),
- (t.isNumber = n),
- (t.isString = i),
- (t.isArray = a),
- (t.isBoolean = r),
- (t.isUndefined = l),
- (t.isNull = c),
- (t.isSymbol = s),
- (t.isObject = d),
- (t.isFunction = u),
- (t.isElement = v),
- (t.isWindow = f),
- (t.isPlainObject = p),
- (t.htmlEncode = h),
- (t.JSONStringify = g),
- (t.getObjAllKeys = b),
- (t.getObjName = m),
- (t.setStorage = y),
- (t.getStorage = _);
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- return e && e.__esModule ? e : { default: e };
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var i = o(4),
- a = o(6),
- r = n(a),
- l = {};
- (l.one = function(e, t) {
- return t ? t.querySelector(e) : document.querySelector(e);
- }),
- (l.all = function(e, t) {
- var o = void 0,
- n = [];
- return (
- (o = t ? t.querySelectorAll(e) : document.querySelectorAll(e)),
- o && o.length > 0 && (n = Array.prototype.slice.call(o)),
- n
- );
- }),
- (l.addClass = function(e, t) {
- if (e) {
- (0, i.isArray)(e) || (e = [e]);
- for (var o = 0; o < e.length; o++) {
- var n = e[o].className || "",
- a = n.split(" ");
- a.indexOf(t) > -1 || (a.push(t), (e[o].className = a.join(" ")));
- }
- }
- }),
- (l.removeClass = function(e, t) {
- if (e) {
- (0, i.isArray)(e) || (e = [e]);
- for (var o = 0; o < e.length; o++) {
- for (var n = e[o].className.split(" "), a = 0; a < n.length; a++)
- n[a] == t && (n[a] = "");
- e[o].className = n.join(" ").trim();
- }
- }
- }),
- (l.hasClass = function(e, t) {
- if (!e) return !1;
- for (var o = e.className.split(" "), n = 0; n < o.length; n++)
- if (o[n] == t) return !0;
- return !1;
- }),
- (l.bind = function(e, t, o, n) {
- if (e) {
- void 0 === n && (n = !1), (0, i.isArray)(e) || (e = [e]);
- for (var a = 0; a < e.length; a++) e[a].addEventListener(t, o, n);
- }
- }),
- (l.delegate = function(e, t, o, n) {
- e &&
- e.addEventListener(
- t,
- function(t) {
- var i = l.all(o, e);
- if (i)
- e: for (var a = 0; a < i.length; a++)
- for (var r = t.target; r; ) {
- if (r == i[a]) {
- n.call(r, t);
- break e;
- }
- if (((r = r.parentNode), r == e)) break;
- }
- },
- !1
- );
- }),
- (l.render = r["default"]),
- (t["default"] = l),
- (e.exports = t["default"]);
- },
- function(e, t) {
- "use strict";
- function o(e, t, o) {
- var n = /\{\{([^\}]+)\}\}/g,
- i = "",
- a = "",
- r = 0,
- l = [],
- c = function(e, t) {
- "" !== e &&
- (i += t
- ? e.match(/^ ?else/g)
- ? "} " + e + " {\n"
- : e.match(/\/(if|for|switch)/g)
- ? "}\n"
- : e.match(/^ ?if|for|switch/g)
- ? e + " {\n"
- : e.match(/^ ?(break|continue) ?$/g)
- ? e + ";\n"
- : e.match(/^ ?(case|default)/g)
- ? e + ":\n"
- : "arr.push(" + e + ");\n"
- : 'arr.push("' + e.replace(/"/g, '\\"') + '");\n');
- };
- for (
- window.__mito_data = t,
- window.__mito_code = "",
- window.__mito_result = "",
- e = e.replace(/(\{\{ ?switch(.+?)\}\})[\r\n\t ]+\{\{/g, "$1{{"),
- e = e
- .replace(/^[\r\n]/, "")
- .replace(/\n/g, "\\\n")
- .replace(/\r/g, "\\\r"),
- a = "(function(){\n",
- i = "var arr = [];\n";
- (l = n.exec(e));
- )
- c(e.slice(r, l.index), !1), c(l[1], !0), (r = l.index + l[0].length);
- c(e.substr(r, e.length - r), !1),
- (i += '__mito_result = arr.join("");'),
- (i = "with (__mito_data) {\n" + i + "\n}"),
- (a += i),
- (a += "})();");
- var s = document.getElementsByTagName("script"),
- d = "";
- s.length > 0 && (d = s[0].getAttribute("nonce") || "");
- var u = document.createElement("SCRIPT");
- (u.innerHTML = a),
- u.setAttribute("nonce", d),
- document.documentElement.appendChild(u);
- var v = __mito_result;
- if ((document.documentElement.removeChild(u), !o)) {
- var f = document.createElement("DIV");
- (f.innerHTML = v), (v = f.children[0]);
- }
- return v;
- }
- Object.defineProperty(t, "__esModule", { value: !0 }),
- (t["default"] = o),
- (e.exports = t["default"]);
- },
- function(e, t, o) {
- var n = o(8);
- "string" == typeof n && (n = [[e.id, n, ""]]);
- o(10)(n, {});
- n.locals && (e.exports = n.locals);
- },
- function(e, t, o) {
- (t = e.exports = o(9)()),
- t.push([
- e.id,
- '#__vconsole{color:#000;font-size:13px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}#__vconsole .vc-max-height{max-height:19.23076923em}#__vconsole .vc-max-height-line{max-height:3.38461538em}#__vconsole .vc-min-height{min-height:3.07692308em}#__vconsole dd,#__vconsole dl,#__vconsole pre{margin:0}#__vconsole .vc-switch{display:block;position:fixed;right:.76923077em;bottom:.76923077em;color:#fff;background-color:#04be02;line-height:1;font-size:1.07692308em;padding:.61538462em 1.23076923em;z-index:10000;border-radius:.30769231em;box-shadow:0 0 .61538462em rgba(0,0,0,.4)}#__vconsole .vc-mask{top:0;background:transparent;z-index:10001;transition:background .3s;-webkit-tap-highlight-color:transparent;overflow-y:scroll}#__vconsole .vc-mask,#__vconsole .vc-panel{display:none;position:fixed;left:0;right:0;bottom:0}#__vconsole .vc-panel{min-height:85%;z-index:10002;background-color:#efeff4;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:translateY(100%);transform:translateY(100%)}#__vconsole .vc-tabbar{border-bottom:1px solid #d9d9d9;overflow-x:auto;height:3em;width:auto;white-space:nowrap}#__vconsole .vc-tabbar .vc-tab{display:inline-block;line-height:3em;padding:0 1.15384615em;border-right:1px solid #d9d9d9;text-decoration:none;color:#000;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}#__vconsole .vc-tabbar .vc-tab:active{background-color:rgba(0,0,0,.15)}#__vconsole .vc-tabbar .vc-tab.vc-actived{background-color:#fff}#__vconsole .vc-content{background-color:#fff;overflow-x:hidden;overflow-y:auto;position:absolute;top:3.07692308em;left:0;right:0;bottom:3.07692308em;-webkit-overflow-scrolling:touch}#__vconsole .vc-content.vc-has-topbar{top:5.46153846em}#__vconsole .vc-topbar{background-color:#fbf9fe;display:flex;display:-webkit-box;flex-direction:row;flex-wrap:wrap;-webkit-box-direction:row;-webkit-flex-wrap:wrap;width:100%}#__vconsole .vc-topbar .vc-toptab{display:none;flex:1;-webkit-box-flex:1;line-height:2.30769231em;padding:0 1.15384615em;border-bottom:1px solid #d9d9d9;text-decoration:none;text-align:center;color:#000;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}#__vconsole .vc-topbar .vc-toptab.vc-toggle{display:block}#__vconsole .vc-topbar .vc-toptab:active{background-color:rgba(0,0,0,.15)}#__vconsole .vc-topbar .vc-toptab.vc-actived{border-bottom:1px solid #3e82f7}#__vconsole .vc-logbox{display:none;position:relative;min-height:100%}#__vconsole .vc-logbox i{font-style:normal}#__vconsole .vc-logbox .vc-log{padding-bottom:3em;-webkit-tap-highlight-color:transparent}#__vconsole .vc-logbox .vc-log:empty:before{content:"Empty";color:#999;position:absolute;top:45%;left:0;right:0;bottom:0;font-size:1.15384615em;text-align:center}#__vconsole .vc-logbox .vc-item{margin:0;padding:.46153846em .61538462em;overflow:hidden;line-height:1.3;border-bottom:1px solid #eee;word-break:break-word}#__vconsole .vc-logbox .vc-item-info{color:#6a5acd}#__vconsole .vc-logbox .vc-item-debug{color:#daa520}#__vconsole .vc-logbox .vc-item-warn{color:orange;border-color:#ffb930;background-color:#fffacd}#__vconsole .vc-logbox .vc-item-error{color:#dc143c;border-color:#f4a0ab;background-color:#ffe4e1}#__vconsole .vc-logbox .vc-log.vc-log-partly .vc-item{display:none}#__vconsole .vc-logbox .vc-log.vc-log-partly-error .vc-item-error,#__vconsole .vc-logbox .vc-log.vc-log-partly-info .vc-item-info,#__vconsole .vc-logbox .vc-log.vc-log-partly-log .vc-item-log,#__vconsole .vc-logbox .vc-log.vc-log-partly-warn .vc-item-warn{display:block}#__vconsole .vc-logbox .vc-item .vc-item-content{margin-right:4.61538462em;display:block}#__vconsole .vc-logbox .vc-item .vc-item-meta{color:#888;float:right;width:4.61538462em;text-align:right}#__vconsole .vc-logbox .vc-item.vc-item-nometa .vc-item-content{margin-right:0}#__vconsole .vc-logbox .vc-item.vc-item-nometa .vc-item-meta{display:none}#__vconsole .vc-logbox .vc-item .vc-item-code{display:block;white-space:pre-wrap;overflow:auto;position:relative}#__vconsole .vc-logbox .vc-item .vc-item-code.vc-item-code-input,#__vconsole .vc-logbox .vc-item .vc-item-code.vc-item-code-output{padding-left:.92307692em}#__vconsole .vc-logbox .vc-item .vc-item-code.vc-item-code-input:before,#__vconsole .vc-logbox .vc-item .vc-item-code.vc-item-code-output:before{content:"\\203A";position:absolute;top:-.23076923em;left:0;font-size:1.23076923em;color:#6a5acd}#__vconsole .vc-logbox .vc-item .vc-item-code.vc-item-code-output:before{content:"\\2039"}#__vconsole .vc-logbox .vc-item .vc-fold{display:block;overflow:auto;-webkit-overflow-scrolling:touch}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-outer{display:block;font-style:italic;padding-left:.76923077em;position:relative}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-outer:active{background-color:#e6e6e6}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-outer:before{content:"";position:absolute;top:.30769231em;left:.15384615em;width:0;height:0;border:.30769231em solid transparent;border-left-color:#000}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-outer.vc-toggle:before{top:.46153846em;left:0;border-top-color:#000;border-left-color:transparent}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-inner{display:none;margin-left:.76923077em}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-inner.vc-toggle{display:block}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-inner .vc-code-key{margin-left:.76923077em}#__vconsole .vc-logbox .vc-item .vc-fold .vc-fold-outer .vc-code-key{margin-left:0}#__vconsole .vc-logbox .vc-code-key{color:#905}#__vconsole .vc-logbox .vc-code-private-key{color:#d391b5}#__vconsole .vc-logbox .vc-code-function{color:#905;font-style:italic}#__vconsole .vc-logbox .vc-code-boolean,#__vconsole .vc-logbox .vc-code-number{color:#0086b3}#__vconsole .vc-logbox .vc-code-string{color:#183691}#__vconsole .vc-logbox .vc-code-null,#__vconsole .vc-logbox .vc-code-undefined{color:#666}#__vconsole .vc-logbox .vc-cmd{position:absolute;height:3.07692308em;left:0;right:0;bottom:0;border-top:1px solid #d9d9d9;display:block!important}#__vconsole .vc-logbox .vc-cmd .vc-cmd-input-wrap{display:block;height:2.15384615em;margin-right:3.07692308em;padding:.46153846em .61538462em}#__vconsole .vc-logbox .vc-cmd .vc-cmd-input{width:100%;border:none;resize:none;outline:none;padding:0;font-size:.92307692em}#__vconsole .vc-logbox .vc-cmd .vc-cmd-input::-webkit-input-placeholder{line-height:2.15384615em}#__vconsole .vc-logbox .vc-cmd .vc-cmd-btn{position:absolute;top:0;right:0;bottom:0;width:3.07692308em;border:none;background-color:#efeff4;outline:none;-webkit-touch-callout:none;font-size:1em}#__vconsole .vc-logbox .vc-cmd .vc-cmd-btn:active{background-color:rgba(0,0,0,.15)}#__vconsole .vc-logbox .vc-group .vc-group-preview{-webkit-touch-callout:none}#__vconsole .vc-logbox .vc-group .vc-group-preview:active{background-color:#e6e6e6}#__vconsole .vc-logbox .vc-group .vc-group-detail{display:none;padding:0 0 .76923077em 1.53846154em;border-bottom:1px solid #eee}#__vconsole .vc-logbox .vc-group.vc-actived .vc-group-detail{display:block;background-color:#fbf9fe}#__vconsole .vc-logbox .vc-group.vc-actived .vc-table-row{background-color:#fff}#__vconsole .vc-logbox .vc-group.vc-actived .vc-group-preview{background-color:#fbf9fe}#__vconsole .vc-logbox .vc-table .vc-table-row{display:flex;display:-webkit-flex;flex-direction:row;flex-wrap:wrap;-webkit-box-direction:row;-webkit-flex-wrap:wrap;overflow:hidden;border-bottom:1px solid #eee}#__vconsole .vc-logbox .vc-table .vc-table-row.vc-left-border{border-left:1px solid #eee}#__vconsole .vc-logbox .vc-table .vc-table-col{flex:1;-webkit-box-flex:1;padding:.23076923em .30769231em;border-left:1px solid #eee;overflow:auto;white-space:pre-wrap;word-break:break-word;-webkit-overflow-scrolling:touch}#__vconsole .vc-logbox .vc-table .vc-table-col:first-child{border:none}#__vconsole .vc-logbox .vc-table .vc-small .vc-table-col{padding:0 .30769231em;font-size:.92307692em}#__vconsole .vc-logbox .vc-table .vc-table-col-2{flex:2;-webkit-box-flex:2}#__vconsole .vc-logbox .vc-table .vc-table-col-3{flex:3;-webkit-box-flex:3}#__vconsole .vc-logbox .vc-table .vc-table-col-4{flex:4;-webkit-box-flex:4}#__vconsole .vc-logbox .vc-table .vc-table-col-5{flex:5;-webkit-box-flex:5}#__vconsole .vc-logbox .vc-table .vc-table-col-6{flex:6;-webkit-box-flex:6}#__vconsole .vc-logbox .vc-table .vc-table-row-error{border-color:#f4a0ab;background-color:#ffe4e1}#__vconsole .vc-logbox .vc-table .vc-table-row-error .vc-table-col{color:#dc143c;border-color:#f4a0ab}#__vconsole .vc-logbox .vc-table .vc-table-col-title{font-weight:700}#__vconsole .vc-logbox.vc-actived{display:block}#__vconsole .vc-toolbar{border-top:1px solid #d9d9d9;line-height:3em;position:absolute;left:0;right:0;bottom:0;display:flex;display:-webkit-box;flex-direction:row;-webkit-box-direction:row}#__vconsole .vc-toolbar .vc-tool{display:none;text-decoration:none;color:#000;width:50%;flex:1;-webkit-box-flex:1;text-align:center;position:relative;-webkit-touch-callout:none}#__vconsole .vc-toolbar .vc-tool.vc-global-tool,#__vconsole .vc-toolbar .vc-tool.vc-toggle{display:block}#__vconsole .vc-toolbar .vc-tool:active{background-color:rgba(0,0,0,.15)}#__vconsole .vc-toolbar .vc-tool:after{content:" ";position:absolute;top:.53846154em;bottom:.53846154em;right:0;border-left:1px solid #d9d9d9}#__vconsole .vc-toolbar .vc-tool-last:after{border:none}#__vconsole.vc-toggle .vc-switch{display:none}#__vconsole.vc-toggle .vc-mask{background:rgba(0,0,0,.6);display:block}#__vconsole.vc-toggle .vc-panel{-webkit-transform:translate(0);transform:translate(0)}',
- ""
- ]);
- },
- function(e, t) {
- "use strict";
- e.exports = function() {
- var e = [];
- return (
- (e.toString = function() {
- for (var e = [], t = 0; t < this.length; t++) {
- var o = this[t];
- o[2] ? e.push("@media " + o[2] + "{" + o[1] + "}") : e.push(o[1]);
- }
- return e.join("");
- }),
- (e.i = function(t, o) {
- "string" == typeof t && (t = [[null, t, ""]]);
- for (var n = {}, i = 0; i < this.length; i++) {
- var a = this[i][0];
- "number" == typeof a && (n[a] = !0);
- }
- for (i = 0; i < t.length; i++) {
- var r = t[i];
- ("number" == typeof r[0] && n[r[0]]) ||
- (o && !r[2]
- ? (r[2] = o)
- : o && (r[2] = "(" + r[2] + ") and (" + o + ")"),
- e.push(r));
- }
- }),
- e
- );
- };
- },
- function(e, t, o) {
- function n(e, t) {
- for (var o = 0; o < e.length; o++) {
- var n = e[o],
- i = f[n.id];
- if (i) {
- i.refs++;
- for (var a = 0; a < i.parts.length; a++) i.parts[a](n.parts[a]);
- for (; a < n.parts.length; a++) i.parts.push(s(n.parts[a], t));
- } else {
- for (var r = [], a = 0; a < n.parts.length; a++)
- r.push(s(n.parts[a], t));
- f[n.id] = { id: n.id, refs: 1, parts: r };
- }
- }
- }
- function i(e) {
- for (var t = [], o = {}, n = 0; n < e.length; n++) {
- var i = e[n],
- a = i[0],
- r = i[1],
- l = i[2],
- c = i[3],
- s = { css: r, media: l, sourceMap: c };
- o[a] ? o[a].parts.push(s) : t.push((o[a] = { id: a, parts: [s] }));
- }
- return t;
- }
- function a(e, t) {
- var o = g(),
- n = y[y.length - 1];
- if ("top" === e.insertAt)
- n
- ? n.nextSibling
- ? o.insertBefore(t, n.nextSibling)
- : o.appendChild(t)
- : o.insertBefore(t, o.firstChild),
- y.push(t);
- else {
- if ("bottom" !== e.insertAt)
- throw new Error(
- "Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."
- );
- o.appendChild(t);
- }
- }
- function r(e) {
- e.parentNode.removeChild(e);
- var t = y.indexOf(e);
- t >= 0 && y.splice(t, 1);
- }
- function l(e) {
- var t = document.createElement("style");
- return (t.type = "text/css"), a(e, t), t;
- }
- function c(e) {
- var t = document.createElement("link");
- return (t.rel = "stylesheet"), a(e, t), t;
- }
- function s(e, t) {
- var o, n, i;
- if (t.singleton) {
- var a = m++;
- (o = b || (b = l(t))),
- (n = d.bind(null, o, a, !1)),
- (i = d.bind(null, o, a, !0));
- } else
- e.sourceMap &&
- "function" == typeof URL &&
- "function" == typeof URL.createObjectURL &&
- "function" == typeof URL.revokeObjectURL &&
- "function" == typeof Blob &&
- "function" == typeof btoa
- ? ((o = c(t)),
- (n = v.bind(null, o)),
- (i = function() {
- r(o), o.href && URL.revokeObjectURL(o.href);
- }))
- : ((o = l(t)),
- (n = u.bind(null, o)),
- (i = function() {
- r(o);
- }));
- return (
- n(e),
- function(t) {
- if (t) {
- if (
- t.css === e.css &&
- t.media === e.media &&
- t.sourceMap === e.sourceMap
- )
- return;
- n((e = t));
- } else i();
- }
- );
- }
- function d(e, t, o, n) {
- var i = o ? "" : n.css;
- if (e.styleSheet) e.styleSheet.cssText = _(t, i);
- else {
- var a = document.createTextNode(i),
- r = e.childNodes;
- r[t] && e.removeChild(r[t]),
- r.length ? e.insertBefore(a, r[t]) : e.appendChild(a);
- }
- }
- function u(e, t) {
- var o = t.css,
- n = t.media;
- if ((n && e.setAttribute("media", n), e.styleSheet))
- e.styleSheet.cssText = o;
- else {
- for (; e.firstChild; ) e.removeChild(e.firstChild);
- e.appendChild(document.createTextNode(o));
- }
- }
- function v(e, t) {
- var o = t.css,
- n = t.sourceMap;
- n &&
- (o +=
- "\n/*# sourceMappingURL=data:application/json;base64," +
- btoa(unescape(encodeURIComponent(JSON.stringify(n)))) +
- " */");
- var i = new Blob([o], {
- type: "text/css"
- }),
- a = e.href;
- (e.href = URL.createObjectURL(i)), a && URL.revokeObjectURL(a);
- }
- var f = {},
- p = function(e) {
- var t;
- return function() {
- return "undefined" == typeof t && (t = e.apply(this, arguments)), t;
- };
- },
- h = p(function() {
- return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
- }),
- g = p(function() {
- return document.head || document.getElementsByTagName("head")[0];
- }),
- b = null,
- m = 0,
- y = [];
- e.exports = function(e, t) {
- (t = t || {}),
- "undefined" == typeof t.singleton && (t.singleton = h()),
- "undefined" == typeof t.insertAt && (t.insertAt = "bottom");
- var o = i(e);
- return (
- n(o, t),
- function(e) {
- for (var a = [], r = 0; r < o.length; r++) {
- var l = o[r],
- c = f[l.id];
- c.refs--, a.push(c);
- }
- if (e) {
- var s = i(e);
- n(s, t);
- }
- for (var r = 0; r < a.length; r++) {
- var c = a[r];
- if (0 === c.refs) {
- for (var d = 0; d < c.parts.length; d++) c.parts[d]();
- delete f[c.id];
- }
- }
- }
- );
- };
- var _ = (function() {
- var e = [];
- return function(t, o) {
- return (e[t] = o), e.filter(Boolean).join("\n");
- };
- })();
- },
- function(e, t) {
- e.exports =
- '<div id="__vconsole" class="">\n <div class="vc-switch">vConsole</div>\n <div class="vc-mask">\n </div>\n <div class="vc-panel">\n <div class="vc-tabbar">\n </div>\n <div class="vc-topbar">\n </div>\n <div class="vc-content">\n </div>\n <div class="vc-toolbar">\n <a class="vc-tool vc-global-tool vc-tool-last vc-hide">Hide</a>\n </div>\n </div>\n</div>';
- },
- function(e, t) {
- e.exports =
- '<a class="vc-tab" data-tab="{{id}}" id="__vc_tab_{{id}}">{{name}}</a>';
- },
- function(e, t) {
- e.exports = '<div class="vc-logbox" id="__vc_log_{{id}}">\n \n</div>';
- },
- function(e, t) {
- e.exports =
- '<a class="vc-toptab vc-topbar-{{pluginID}}{{if (className)}} {{className}}{{/if}}">{{name}}</a>';
- },
- function(e, t) {
- e.exports = '<a class="vc-tool vc-tool-{{pluginID}}">{{name}}</a>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- s = function w(e, t, o) {
- null === e && (e = Function.prototype);
- var n = Object.getOwnPropertyDescriptor(e, t);
- if (void 0 === n) {
- var i = Object.getPrototypeOf(e);
- return null === i ? void 0 : w(i, t, o);
- }
- if ("value" in n) return n.value;
- var a = n.get;
- if (void 0 !== a) return a.call(o);
- },
- d = o(5),
- u = i(d),
- v = o(4),
- f = n(v),
- p = o(17),
- h = i(p),
- g = o(22),
- b = i(g),
- m = o(23),
- y = i(m),
- _ = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- );
- return (l.tplTabbox = b["default"]), (l.windowOnError = null), l;
- }
- return (
- l(t, e),
- c(t, [
- {
- key: "onReady",
- value: function() {
- var e = this;
- s(Object.getPrototypeOf(t.prototype), "onReady", this).call(
- this
- ),
- u["default"].bind(
- u["default"].one(".vc-cmd", this.$tabbox),
- "submit",
- function(t) {
- t.preventDefault();
- var o = u["default"].one(".vc-cmd-input", t.target),
- n = o.value;
- (o.value = ""), "" !== n && e.evalCommand(n);
- }
- );
- var o = "";
- (o += "if (!!window) {"),
- (o += "window.__vConsole_cmd_result = undefined;"),
- (o += "window.__vConsole_cmd_error = false;"),
- (o += "}");
- var n = document.getElementsByTagName("script"),
- i = "";
- n.length > 0 && (i = n[0].getAttribute("nonce") || "");
- var a = document.createElement("SCRIPT");
- (a.innerHTML = o),
- a.setAttribute("nonce", i),
- document.documentElement.appendChild(a),
- document.documentElement.removeChild(a);
- }
- },
- {
- key: "mockConsole",
- value: function() {
- s(
- Object.getPrototypeOf(t.prototype),
- "mockConsole",
- this
- ).call(this);
- var e = this;
- f.isFunction(window.onerror) &&
- (this.windowOnError = window.onerror),
- (window.onerror = function(t, o, n, i, a) {
- var r = t;
- o && (r += "\n" + o.replace(location.origin, "")),
- (n || i) && (r += ":" + n + ":" + i);
- var l = !!a && !!a.stack,
- c = (l && a.stack.toString()) || "";
- e.printLog({
- logType: "error",
- logs: [r, c],
- noOrigin: !0
- }),
- f.isFunction(e.windowOnError) &&
- e.windowOnError.call(window, t, o, n, i, a);
- });
- }
- },
- {
- key: "evalCommand",
- value: function(e) {
- this.printLog({
- logType: "log",
- content: u["default"].render(y["default"], {
- content: e,
- type: "input"
- }),
- noMeta: !0,
- style: ""
- });
- var t = "";
- (t += "try {\n"),
- (t += "window.__vConsole_cmd_result = (function() {\n"),
- (t += "return " + e + ";\n"),
- (t += "})();\n"),
- (t += "window.__vConsole_cmd_error = false;\n"),
- (t += "} catch (e) {\n"),
- (t += "window.__vConsole_cmd_result = e.message;\n"),
- (t += "window.__vConsole_cmd_error = true;\n"),
- (t += "}");
- var o = document.getElementsByTagName("script"),
- n = "";
- o.length > 0 && (n = o[0].getAttribute("nonce") || "");
- var i = document.createElement("SCRIPT");
- (i.innerHTML = t),
- i.setAttribute("nonce", n),
- document.documentElement.appendChild(i);
- var a = window.__vConsole_cmd_result,
- r = window.__vConsole_cmd_error;
- if ((document.documentElement.removeChild(i), 0 == r)) {
- var l = void 0;
- f.isArray(a) || f.isObject(a)
- ? (l = this.getFoldedLine(a))
- : (f.isNull(a)
- ? (a = "null")
- : f.isUndefined(a)
- ? (a = "undefined")
- : f.isFunction(a)
- ? (a = "function()")
- : f.isString(a) && (a = '"' + a + '"'),
- (l = u["default"].render(y["default"], {
- content: a,
- type: "output"
- }))),
- this.printLog({
- logType: "log",
- content: l,
- noMeta: !0,
- style: ""
- });
- } else
- this.printLog({
- logType: "error",
- logs: [a],
- noMeta: !0,
- style: ""
- });
- }
- }
- ]),
- t
- );
- })(h["default"]);
- (t["default"] = _), (e.exports = t["default"]);
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function i(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c =
- "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
- ? function(e) {
- return typeof e;
- }
- : function(e) {
- return e &&
- "function" == typeof Symbol &&
- e.constructor === Symbol
- ? "symbol"
- : typeof e;
- },
- s = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- d = o(4),
- u = i(d),
- v = o(5),
- f = n(v),
- p = o(18),
- h = n(p),
- g = o(19),
- b = n(g),
- m = o(20),
- y = n(m),
- _ = o(21),
- w = n(_),
- x = 1e3,
- k = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- );
- return (
- (l.tplTabbox = ""),
- (l.allowUnformattedLog = !0),
- (l.isReady = !1),
- (l.isShow = !1),
- (l.$tabbox = null),
- (l.console = {}),
- (l.logList = []),
- (l.isInBottom = !0),
- (l.maxLogNumber = x),
- (l.logNumber = 0),
- l.mockConsole(),
- l
- );
- }
- return (
- l(t, e),
- s(t, [
- {
- key: "onInit",
- value: function() {
- (this.$tabbox = f["default"].render(this.tplTabbox, {})),
- this.updateMaxLogNumber();
- }
- },
- {
- key: "onRenderTab",
- value: function(e) {
- e(this.$tabbox);
- }
- },
- {
- key: "onAddTopBar",
- value: function(e) {
- for (
- var t = this,
- o = ["All", "Log", "Info", "Warn", "Error"],
- n = [],
- i = 0;
- i < o.length;
- i++
- )
- n.push({
- name: o[i],
- data: { type: o[i].toLowerCase() },
- className: "",
- onClick: function() {
- return f["default"].hasClass(this, "vc-actived")
- ? !1
- : void t.showLogType(this.dataset.type || "all");
- }
- });
- (n[0].className = "vc-actived"), e(n);
- }
- },
- {
- key: "onAddTool",
- value: function(e) {
- var t = this,
- o = [
- {
- name: "Clear",
- global: !1,
- onClick: function() {
- t.clearLog(), t.vConsole.triggerEvent("clearLog");
- }
- }
- ];
- e(o);
- }
- },
- {
- key: "onReady",
- value: function() {
- var e = this;
- e.isReady = !0;
- var t = f["default"].all(".vc-subtab", e.$tabbox);
- f["default"].bind(t, "click", function(o) {
- if (
- (o.preventDefault(),
- f["default"].hasClass(this, "vc-actived"))
- )
- return !1;
- f["default"].removeClass(t, "vc-actived"),
- f["default"].addClass(this, "vc-actived");
- var n = this.dataset.type,
- i = f["default"].one(".vc-log", e.$tabbox);
- f["default"].removeClass(i, "vc-log-partly-log"),
- f["default"].removeClass(i, "vc-log-partly-info"),
- f["default"].removeClass(i, "vc-log-partly-warn"),
- f["default"].removeClass(i, "vc-log-partly-error"),
- "all" == n
- ? f["default"].removeClass(i, "vc-log-partly")
- : (f["default"].addClass(i, "vc-log-partly"),
- f["default"].addClass(i, "vc-log-partly-" + n));
- });
- var o = f["default"].one(".vc-content");
- f["default"].bind(o, "scroll", function(t) {
- e.isShow &&
- (o.scrollTop + o.offsetHeight >= o.scrollHeight
- ? (e.isInBottom = !0)
- : (e.isInBottom = !1));
- });
- for (var n = 0; n < e.logList.length; n++)
- e.printLog(e.logList[n]);
- e.logList = [];
- }
- },
- {
- key: "onRemove",
- value: function() {
- (window.console.log = this.console.log),
- (window.console.info = this.console.info),
- (window.console.warn = this.console.warn),
- (window.console.debug = this.console.debug),
- (window.console.error = this.console.error),
- (window.console.time = this.console.time),
- (window.console.timeEnd = this.console.timeEnd),
- (window.console.clear = this.console.clear),
- (this.console = {});
- }
- },
- {
- key: "onShow",
- value: function() {
- (this.isShow = !0),
- 1 == this.isInBottom && this.autoScrollToBottom();
- }
- },
- {
- key: "onHide",
- value: function() {
- this.isShow = !1;
- }
- },
- {
- key: "onShowConsole",
- value: function() {
- 1 == this.isInBottom && this.autoScrollToBottom();
- }
- },
- {
- key: "onUpdateOption",
- value: function() {
- this.vConsole.option.maxLogNumber != this.maxLogNumber &&
- (this.updateMaxLogNumber(), this.limitMaxLogs());
- }
- },
- {
- key: "updateMaxLogNumber",
- value: function() {
- (this.maxLogNumber = this.vConsole.option.maxLogNumber || x),
- (this.maxLogNumber = Math.max(1, this.maxLogNumber));
- }
- },
- {
- key: "limitMaxLogs",
- value: function() {
- if (this.isReady)
- for (; this.logNumber > this.maxLogNumber; ) {
- var e = f["default"].one(".vc-item", this.$tabbox);
- if (!e) break;
- e.parentNode.removeChild(e), this.logNumber--;
- }
- }
- },
- {
- key: "showLogType",
- value: function(e) {
- var t = f["default"].one(".vc-log", this.$tabbox);
- f["default"].removeClass(t, "vc-log-partly-log"),
- f["default"].removeClass(t, "vc-log-partly-info"),
- f["default"].removeClass(t, "vc-log-partly-warn"),
- f["default"].removeClass(t, "vc-log-partly-error"),
- "all" == e
- ? f["default"].removeClass(t, "vc-log-partly")
- : (f["default"].addClass(t, "vc-log-partly"),
- f["default"].addClass(t, "vc-log-partly-" + e));
- }
- },
- {
- key: "autoScrollToBottom",
- value: function() {
- this.vConsole.option.disableLogScrolling ||
- this.scrollToBottom();
- }
- },
- {
- key: "scrollToBottom",
- value: function() {
- var e = f["default"].one(".vc-content");
- e && (e.scrollTop = e.scrollHeight - e.offsetHeight);
- }
- },
- {
- key: "mockConsole",
- value: function() {
- var e = this,
- t = this,
- o = ["log", "info", "warn", "debug", "error"];
- window.console
- ? (o.map(function(e) {
- t.console[e] = window.console[e];
- }),
- (t.console.time = window.console.time),
- (t.console.timeEnd = window.console.timeEnd),
- (t.console.clear = window.console.clear))
- : (window.console = {}),
- o.map(function(t) {
- window.console[t] = function() {
- for (
- var o = arguments.length, n = Array(o), i = 0;
- o > i;
- i++
- )
- n[i] = arguments[i];
- e.printLog({ logType: t, logs: n });
- };
- });
- var n = {};
- (window.console.time = function(e) {
- n[e] = Date.now();
- }),
- (window.console.timeEnd = function(e) {
- var t = n[e];
- t
- ? (console.log(e + ":", Date.now() - t + "ms"),
- delete n[e])
- : console.log(e + ": 0ms");
- }),
- (window.console.clear = function() {
- for (
- var e = arguments.length, o = Array(e), n = 0;
- e > n;
- n++
- )
- o[n] = arguments[n];
- t.clearLog(), t.console.clear.apply(window.console, o);
- });
- }
- },
- {
- key: "clearLog",
- value: function() {
- f["default"].one(".vc-log", this.$tabbox).innerHTML = "";
- }
- },
- {
- key: "printOriginLog",
- value: function(e) {
- "function" == typeof this.console[e.logType] &&
- this.console[e.logType].apply(window.console, e.logs);
- }
- },
- {
- key: "printLog",
- value: function(e) {
- var t = e.logs || [];
- if (t.length || e.content) {
- t = [].slice.call(t || []);
- var o = !0,
- n = /^\[(\w+)\]$/i,
- i = "";
- if (u.isString(t[0])) {
- var a = t[0].match(n);
- null !== a && a.length > 0 && (i = a[1].toLowerCase());
- }
- if (
- (i
- ? (o = i == this.id)
- : 0 == this.allowUnformattedLog && (o = !1),
- !o)
- )
- return void (e.noOrigin || this.printOriginLog(e));
- if ((e.date || (e.date = +new Date()), !this.isReady))
- return void this.logList.push(e);
- if (
- (u.isString(t[0]) &&
- ((t[0] = t[0].replace(n, "")),
- "" === t[0] && t.shift()),
- !e.meta)
- ) {
- var r = u.getDate(e.date);
- e.meta = r.hour + ":" + r.minute + ":" + r.second;
- }
- for (
- var l = f["default"].render(b["default"], {
- logType: e.logType,
- noMeta: !!e.noMeta,
- meta: e.meta,
- style: e.style || ""
- }),
- s = f["default"].one(".vc-item-content", l),
- d = 0;
- d < t.length;
- d++
- ) {
- var v = void 0;
- try {
- if ("" === t[d]) continue;
- v = u.isFunction(t[d])
- ? "<span> " + t[d].toString() + "</span>"
- : u.isObject(t[d]) || u.isArray(t[d])
- ? this.getFoldedLine(t[d])
- : "<span> " +
- u.htmlEncode(t[d]).replace(/\n/g, "<br/>") +
- "</span>";
- } catch (p) {
- v = "<span> [" + c(t[d]) + "]</span>";
- }
- v &&
- ("string" == typeof v
- ? s.insertAdjacentHTML("beforeend", v)
- : s.insertAdjacentElement("beforeend", v));
- }
- u.isObject(e.content) &&
- s.insertAdjacentElement("beforeend", e.content),
- f["default"]
- .one(".vc-log", this.$tabbox)
- .insertAdjacentElement("beforeend", l),
- this.logNumber++,
- this.limitMaxLogs(),
- this.isInBottom && this.autoScrollToBottom(),
- e.noOrigin || this.printOriginLog(e);
- }
- }
- },
- {
- key: "getFoldedLine",
- value: function(e, t) {
- var o = this;
- if (!t) {
- var n = u.JSONStringify(e),
- i = n.substr(0, 26);
- (t = u.getObjName(e)),
- n.length > 26 && (i += "..."),
- (t += " " + i);
- }
- var a = f["default"].render(y["default"], {
- outer: t,
- lineType: "obj"
- });
- return (
- f["default"].bind(
- f["default"].one(".vc-fold-outer", a),
- "click",
- function(t) {
- t.preventDefault(),
- t.stopPropagation(),
- f["default"].hasClass(a, "vc-toggle")
- ? (f["default"].removeClass(a, "vc-toggle"),
- f["default"].removeClass(
- f["default"].one(".vc-fold-inner", a),
- "vc-toggle"
- ),
- f["default"].removeClass(
- f["default"].one(".vc-fold-outer", a),
- "vc-toggle"
- ))
- : (f["default"].addClass(a, "vc-toggle"),
- f["default"].addClass(
- f["default"].one(".vc-fold-inner", a),
- "vc-toggle"
- ),
- f["default"].addClass(
- f["default"].one(".vc-fold-outer", a),
- "vc-toggle"
- ));
- var n = f["default"].one(".vc-fold-inner", a);
- if (0 == n.children.length && e) {
- for (
- var i = u.getObjAllKeys(e), r = 0;
- r < i.length;
- r++
- ) {
- var l = e[i[r]],
- c = "undefined",
- s = "";
- u.isString(l)
- ? ((c = "string"), (l = '"' + l + '"'))
- : u.isNumber(l)
- ? (c = "number")
- : u.isBoolean(l)
- ? (c = "boolean")
- : u.isNull(l)
- ? ((c = "null"), (l = "null"))
- : u.isUndefined(l)
- ? ((c = "undefined"), (l = "undefined"))
- : u.isFunction(l)
- ? ((c = "function"), (l = "function()"))
- : u.isSymbol(l) && (c = "symbol");
- var d = void 0;
- if (u.isArray(l)) {
- var v = u.getObjName(l) + "[" + l.length + "]";
- d = o.getFoldedLine(
- l,
- f["default"].render(
- w["default"],
- {
- key: i[r],
- keyType: s,
- value: v,
- valueType: "array"
- },
- !0
- )
- );
- } else if (u.isObject(l)) {
- var p = u.getObjName(l);
- d = o.getFoldedLine(
- l,
- f["default"].render(
- w["default"],
- {
- key: u.htmlEncode(i[r]),
- keyType: s,
- value: p,
- valueType: "object"
- },
- !0
- )
- );
- } else {
- e.hasOwnProperty &&
- !e.hasOwnProperty(i[r]) &&
- (s = "private");
- var h = {
- lineType: "kv",
- key: u.htmlEncode(i[r]),
- keyType: s,
- value: u.htmlEncode(l),
- valueType: c
- };
- d = f["default"].render(y["default"], h);
- }
- n.insertAdjacentElement("beforeend", d);
- }
- if (u.isObject(e)) {
- var g = e.__proto__,
- b = void 0;
- (b = u.isObject(g)
- ? o.getFoldedLine(
- g,
- f["default"].render(
- w["default"],
- {
- key: "__proto__",
- keyType: "private",
- value: u.getObjName(g),
- valueType: "object"
- },
- !0
- )
- )
- : f["default"].render(w["default"], {
- key: "__proto__",
- keyType: "private",
- value: "null",
- valueType: "null"
- })),
- n.insertAdjacentElement("beforeend", b);
- }
- }
- return !1;
- }
- ),
- a
- );
- }
- }
- ]),
- t
- );
- })(h["default"]);
- (t["default"] = k), (e.exports = t["default"]);
- },
- function(e, t) {
- "use strict";
- function o(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var n = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- i = (function() {
- function e(t) {
- var n =
- arguments.length <= 1 || void 0 === arguments[1]
- ? "newPlugin"
- : arguments[1];
- o(this, e),
- (this.id = t),
- (this.name = n),
- (this.isReady = !1),
- (this.eventList = {});
- }
- return (
- n(e, [
- {
- key: "on",
- value: function(e, t) {
- return (this.eventList[e] = t), this;
- }
- },
- {
- key: "trigger",
- value: function(e, t) {
- if ("function" == typeof this.eventList[e])
- this.eventList[e].call(this, t);
- else {
- var o = "on" + e.charAt(0).toUpperCase() + e.slice(1);
- "function" == typeof this[o] && this[o].call(this, t);
- }
- return this;
- }
- },
- {
- key: "id",
- get: function() {
- return this._id;
- },
- set: function(e) {
- if (!e) throw "Plugin ID cannot be empty";
- this._id = e.toLowerCase();
- }
- },
- {
- key: "name",
- get: function() {
- return this._name;
- },
- set: function(e) {
- if (!e) throw "Plugin name cannot be empty";
- this._name = e;
- }
- },
- {
- key: "vConsole",
- get: function() {
- return this._vConsole || void 0;
- },
- set: function(e) {
- if (!e) throw "vConsole cannot be empty";
- this._vConsole = e;
- }
- }
- ]),
- e
- );
- })();
- (t["default"] = i), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports =
- '<div class="vc-item vc-item-{{logType}} {{if (!noMeta)}}vc-item-nometa{{/if}} {{style}}">\n <span class="vc-item-meta">{{if (!noMeta)}}{{meta}}{{/if}}</span>\n <div class="vc-item-content"></div>\n</div>';
- },
- function(e, t) {
- e.exports =
- '<div class="vc-fold">\n {{if (lineType == \'obj\')}}\n <i class="vc-fold-outer">{{outer}}</i>\n <div class="vc-fold-inner"></div>\n {{else if (lineType == \'value\')}}\n <i class="vc-code-{{valueType}}">{{value}}</i>\n {{else if (lineType == \'kv\')}}\n <i class="vc-code-key{{if (keyType)}} vc-code-{{keyType}}-key{{/if}}">{{key}}</i>: <i class="vc-code-{{valueType}}">{{value}}</i>\n {{/if}}\n</div>';
- },
- function(e, t) {
- e.exports =
- '<span>\n <i class="vc-code-key{{if (keyType)}} vc-code-{{keyType}}-key{{/if}}">{{key}}</i>: <i class="vc-code-{{valueType}}">{{value}}</i>\n</span>';
- },
- function(e, t) {
- e.exports =
- '<div>\n <div class="vc-log"></div>\n <form class="vc-cmd">\n <button class="vc-cmd-btn" type="submit">OK</button>\n <div class="vc-cmd-input-wrap">\n <textarea class="vc-cmd-input" placeholder="command..."></textarea>\n </div>\n </form>\n</div>';
- },
- function(e, t) {
- e.exports =
- '<pre class="vc-item-code vc-item-code-{{type}}">{{content}}</pre>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function i(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- s = function g(e, t, o) {
- null === e && (e = Function.prototype);
- var n = Object.getOwnPropertyDescriptor(e, t);
- if (void 0 === n) {
- var i = Object.getPrototypeOf(e);
- return null === i ? void 0 : g(i, t, o);
- }
- if ("value" in n) return n.value;
- var a = n.get;
- if (void 0 !== a) return a.call(o);
- },
- d = o(4),
- u = (i(d), o(17)),
- v = n(u),
- f = o(25),
- p = n(f),
- h = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- );
- return (
- (l.tplTabbox = p["default"]), (l.allowUnformattedLog = !1), l
- );
- }
- return (
- l(t, e),
- c(t, [
- {
- key: "onInit",
- value: function() {
- s(Object.getPrototypeOf(t.prototype), "onInit", this).call(
- this
- ),
- this.printSystemInfo();
- }
- },
- {
- key: "printSystemInfo",
- value: function() {
- var e = navigator.userAgent,
- t = "",
- o = e.match(/(ipod).*\s([\d_]+)/i),
- n = e.match(/(ipad).*\s([\d_]+)/i),
- i = e.match(/(iphone)\sos\s([\d_]+)/i),
- a = e.match(/(android)\s([\d\.]+)/i);
- (t = "Unknown"),
- a
- ? (t = "Android " + a[2])
- : i
- ? (t = "iPhone, iOS " + i[2].replace(/_/g, "."))
- : n
- ? (t = "iPad, iOS " + n[2].replace(/_/g, "."))
- : o && (t = "iPod, iOS " + o[2].replace(/_/g, "."));
- var r = t,
- l = e.match(/MicroMessenger\/([\d\.]+)/i);
- (t = "Unknown"),
- l && l[1]
- ? ((t = l[1]),
- (r += ", WeChat " + t),
- console.info("[system]", "System:", r))
- : console.info("[system]", "System:", r),
- (t = "Unknown"),
- (t =
- "https:" == location.protocol
- ? "HTTPS"
- : "http:" == location.protocol
- ? "HTTP"
- : location.protocol.replace(":", "")),
- (r = t);
- var c = e.toLowerCase().match(/ nettype\/([^ ]+)/g);
- (t = "Unknown"),
- c && c[0]
- ? ((c = c[0].split("/")),
- (t = c[1]),
- (r += ", " + t),
- console.info("[system]", "Network:", r))
- : console.info("[system]", "Protocol:", r),
- console.info("[system]", "UA:", e),
- setTimeout(function() {
- var e =
- window.performance ||
- window.msPerformance ||
- window.webkitPerformance;
- if (e && e.timing) {
- var t = e.timing;
- t.navigationStart &&
- console.info(
- "[system]",
- "navigationStart:",
- t.navigationStart
- ),
- t.navigationStart &&
- t.domainLookupStart &&
- console.info(
- "[system]",
- "navigation:",
- t.domainLookupStart - t.navigationStart + "ms"
- ),
- t.domainLookupEnd &&
- t.domainLookupStart &&
- console.info(
- "[system]",
- "dns:",
- t.domainLookupEnd - t.domainLookupStart + "ms"
- ),
- t.connectEnd &&
- t.connectStart &&
- (t.connectEnd && t.secureConnectionStart
- ? console.info(
- "[system]",
- "tcp (ssl):",
- t.connectEnd -
- t.connectStart +
- "ms (" +
- (t.connectEnd - t.secureConnectionStart) +
- "ms)"
- )
- : console.info(
- "[system]",
- "tcp:",
- t.connectEnd - t.connectStart + "ms"
- )),
- t.responseStart &&
- t.requestStart &&
- console.info(
- "[system]",
- "request:",
- t.responseStart - t.requestStart + "ms"
- ),
- t.responseEnd &&
- t.responseStart &&
- console.info(
- "[system]",
- "response:",
- t.responseEnd - t.responseStart + "ms"
- ),
- t.domComplete &&
- t.domLoading &&
- (t.domContentLoadedEventStart && t.domLoading
- ? console.info(
- "[system]",
- "domComplete (domLoaded):",
- t.domComplete -
- t.domLoading +
- "ms (" +
- (t.domContentLoadedEventStart -
- t.domLoading) +
- "ms)"
- )
- : console.info(
- "[system]",
- "domComplete:",
- t.domComplete - t.domLoading + "ms"
- )),
- t.loadEventEnd &&
- t.loadEventStart &&
- console.info(
- "[system]",
- "loadEvent:",
- t.loadEventEnd - t.loadEventStart + "ms"
- ),
- t.navigationStart &&
- t.loadEventEnd &&
- console.info(
- "[system]",
- "total (DOM):",
- t.loadEventEnd -
- t.navigationStart +
- "ms (" +
- (t.domComplete - t.navigationStart) +
- "ms)"
- );
- }
- }, 0);
- }
- }
- ]),
- t
- );
- })(v["default"]);
- (t["default"] = h), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports = '<div>\n <div class="vc-log"></div>\n</div>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- s = o(5),
- d = i(s),
- u = o(4),
- v = n(u),
- f = o(18),
- p = i(f),
- h = o(27),
- g = i(h),
- b = o(28),
- m = i(b),
- y = o(29),
- _ = i(y),
- w = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- );
- return (
- (l.$tabbox = d["default"].render(g["default"], {})),
- (l.$header = null),
- (l.reqList = {}),
- (l.domList = {}),
- (l.isReady = !1),
- (l.isShow = !1),
- (l.isInBottom = !0),
- (l._open = void 0),
- (l._send = void 0),
- l.mockAjax(),
- l
- );
- }
- return (
- l(t, e),
- c(t, [
- {
- key: "onRenderTab",
- value: function(e) {
- e(this.$tabbox);
- }
- },
- {
- key: "onAddTool",
- value: function(e) {
- var t = this,
- o = [
- {
- name: "Clear",
- global: !1,
- onClick: function(e) {
- t.clearLog();
- }
- }
- ];
- e(o);
- }
- },
- {
- key: "onReady",
- value: function() {
- var e = this;
- (e.isReady = !0),
- this.renderHeader(),
- d["default"].delegate(
- d["default"].one(".vc-log", this.$tabbox),
- "click",
- ".vc-group-preview",
- function(t) {
- var o = this.dataset.reqid,
- n = this.parentNode;
- d["default"].hasClass(n, "vc-actived")
- ? (d["default"].removeClass(n, "vc-actived"),
- e.updateRequest(o, { actived: !1 }))
- : (d["default"].addClass(n, "vc-actived"),
- e.updateRequest(o, { actived: !0 })),
- t.preventDefault();
- }
- );
- var t = d["default"].one(".vc-content");
- d["default"].bind(t, "scroll", function(o) {
- e.isShow &&
- (t.scrollTop + t.offsetHeight >= t.scrollHeight
- ? (e.isInBottom = !0)
- : (e.isInBottom = !1));
- });
- for (var o in e.reqList) e.updateRequest(o, {});
- }
- },
- {
- key: "onRemove",
- value: function() {
- window.XMLHttpRequest &&
- ((window.XMLHttpRequest.prototype.open = this._open),
- (window.XMLHttpRequest.prototype.send = this._send),
- (this._open = void 0),
- (this._send = void 0));
- }
- },
- {
- key: "onShow",
- value: function() {
- (this.isShow = !0),
- 1 == this.isInBottom && this.scrollToBottom();
- }
- },
- {
- key: "onHide",
- value: function() {
- this.isShow = !1;
- }
- },
- {
- key: "onShowConsole",
- value: function() {
- 1 == this.isInBottom && this.scrollToBottom();
- }
- },
- {
- key: "scrollToBottom",
- value: function() {
- var e = d["default"].one(".vc-content");
- e.scrollTop = e.scrollHeight - e.offsetHeight;
- }
- },
- {
- key: "clearLog",
- value: function() {
- this.reqList = {};
- for (var e in this.domList)
- this.domList[e].remove(), (this.domList[e] = void 0);
- (this.domList = {}), this.renderHeader();
- }
- },
- {
- key: "renderHeader",
- value: function() {
- var e = Object.keys(this.reqList).length,
- t = d["default"].render(m["default"], { count: e }),
- o = d["default"].one(".vc-log", this.$tabbox);
- this.$header
- ? this.$header.parentNode.replaceChild(t, this.$header)
- : o.parentNode.insertBefore(t, o),
- (this.$header = t);
- }
- },
- {
- key: "updateRequest",
- value: function(e, t) {
- var o = Object.keys(this.reqList).length,
- n = this.reqList[e] || {};
- for (var i in t) n[i] = t[i];
- if (((this.reqList[e] = n), this.isReady)) {
- var a = {
- id: e,
- url: n.url,
- status: n.status,
- method: n.method || "-",
- costTime: n.costTime > 0 ? n.costTime + "ms" : "-",
- header: n.header || null,
- getData: n.getData || null,
- postData: n.postData || null,
- response: null,
- actived: !!n.actived
- };
- switch (n.responseType) {
- case "":
- case "text":
- if (v.isString(n.response))
- try {
- (a.response = JSON.parse(n.response)),
- (a.response = JSON.stringify(
- a.response,
- null,
- 1
- )),
- (a.response = v.htmlEncode(a.response));
- } catch (r) {
- a.response = v.htmlEncode(n.response);
- }
- else
- "undefined" != typeof n.response &&
- (a.response = Object.prototype.toString.call(
- n.response
- ));
- break;
- case "json":
- "undefined" != typeof n.response &&
- (a.response = JSON.stringify(n.response, null, 1));
- break;
- case "blob":
- case "document":
- case "arraybuffer":
- default:
- "undefined" != typeof n.response &&
- (a.response = Object.prototype.toString.call(
- n.response
- ));
- }
- 0 == n.readyState || 1 == n.readyState
- ? (a.status = "Pending")
- : 2 == n.readyState || 3 == n.readyState
- ? (a.status = "Loading")
- : 4 == n.readyState || (a.status = "Unknown");
- var l = d["default"].render(_["default"], a),
- c = this.domList[e];
- n.status >= 400 &&
- d["default"].addClass(
- d["default"].one(".vc-group-preview", l),
- "vc-table-row-error"
- ),
- c
- ? c.parentNode.replaceChild(l, c)
- : d["default"]
- .one(".vc-log", this.$tabbox)
- .insertAdjacentElement("beforeend", l),
- (this.domList[e] = l);
- var s = Object.keys(this.reqList).length;
- s != o && this.renderHeader(),
- this.isInBottom && this.scrollToBottom();
- }
- }
- },
- {
- key: "mockAjax",
- value: function() {
- var e = window.XMLHttpRequest;
- if (e) {
- var t = this,
- o = window.XMLHttpRequest.prototype.open,
- n = window.XMLHttpRequest.prototype.send;
- (t._open = o),
- (t._send = n),
- (window.XMLHttpRequest.prototype.open = function() {
- var e = this,
- n = [].slice.call(arguments),
- i = n[0],
- a = n[1],
- r = t.getUniqueID(),
- l = null;
- (e._requestID = r), (e._method = i), (e._url = a);
- var c = e.onreadystatechange || function() {},
- s = function() {
- var o = t.reqList[r] || {};
- if (
- ((o.readyState = e.readyState),
- (o.status = 0),
- e.readyState > 1 && (o.status = e.status),
- (o.responseType = e.responseType),
- 0 == e.readyState)
- )
- o.startTime || (o.startTime = +new Date());
- else if (1 == e.readyState)
- o.startTime || (o.startTime = +new Date());
- else if (2 == e.readyState) {
- o.header = {};
- for (
- var n = e.getAllResponseHeaders() || "",
- i = n.split("\n"),
- a = 0;
- a < i.length;
- a++
- ) {
- var s = i[a];
- if (s) {
- var d = s.split(": "),
- u = d[0],
- v = d.slice(1).join(": ");
- o.header[u] = v;
- }
- }
- } else
- 3 == e.readyState ||
- (4 == e.readyState
- ? (clearInterval(l),
- (o.endTime = +new Date()),
- (o.costTime =
- o.endTime - (o.startTime || o.endTime)),
- (o.response = e.response))
- : clearInterval(l));
- return (
- e._noVConsole || t.updateRequest(r, o),
- c.apply(e, arguments)
- );
- };
- e.onreadystatechange = s;
- var d = -1;
- return (
- (l = setInterval(function() {
- d != e.readyState &&
- ((d = e.readyState), s.call(e));
- }, 10)),
- o.apply(e, n)
- );
- }),
- (window.XMLHttpRequest.prototype.send = function() {
- var e = this,
- o = [].slice.call(arguments),
- i = o[0],
- a = t.reqList[e._requestID] || {};
- a.method = e._method.toUpperCase();
- var r = e._url.split("?");
- if (((a.url = r.shift()), r.length > 0)) {
- (a.getData = {}),
- (r = r.join("?")),
- (r = r.split("&"));
- var l = !0,
- c = !1,
- s = void 0;
- try {
- for (
- var d, u = r[Symbol.iterator]();
- !(l = (d = u.next()).done);
- l = !0
- ) {
- var f = d.value;
- (f = f.split("=")), (a.getData[f[0]] = f[1]);
- }
- } catch (p) {
- (c = !0), (s = p);
- } finally {
- try {
- !l && u["return"] && u["return"]();
- } finally {
- if (c) throw s;
- }
- }
- }
- if ("POST" == a.method)
- if (v.isString(i)) {
- var h = i.split("&");
- a.postData = {};
- var g = !0,
- b = !1,
- m = void 0;
- try {
- for (
- var y, _ = h[Symbol.iterator]();
- !(g = (y = _.next()).done);
- g = !0
- ) {
- var w = y.value;
- (w = w.split("=")), (a.postData[w[0]] = w[1]);
- }
- } catch (p) {
- (b = !0), (m = p);
- } finally {
- try {
- !g && _["return"] && _["return"]();
- } finally {
- if (b) throw m;
- }
- }
- } else v.isPlainObject(i) && (a.postData = i);
- return (
- e._noVConsole || t.updateRequest(e._requestID, a),
- n.apply(e, o)
- );
- });
- }
- }
- },
- {
- key: "getUniqueID",
- value: function() {
- var e = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
- /[xy]/g,
- function(e) {
- var t = (16 * Math.random()) | 0,
- o = "x" == e ? t : (3 & t) | 8;
- return o.toString(16);
- }
- );
- return e;
- }
- }
- ]),
- t
- );
- })(p["default"]);
- (t["default"] = w), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports =
- '<div class="vc-table">\n <div class="vc-log"></div>\n</div>';
- },
- function(e, t) {
- e.exports =
- '<dl class="vc-table-row">\n <dd class="vc-table-col vc-table-col-4">Name {{if (count > 0)}}({{count}}){{/if}}</dd>\n <dd class="vc-table-col">Method</dd>\n <dd class="vc-table-col">Status</dd>\n <dd class="vc-table-col">Time</dd>\n</dl>';
- },
- function(e, t) {
- e.exports =
- '<div class="vc-group {{actived ? \'vc-actived\' : \'\'}}">\n <dl class="vc-table-row vc-group-preview" data-reqid="{{id}}">\n <dd class="vc-table-col vc-table-col-4">{{url}}</dd>\n <dd class="vc-table-col">{{method}}</dd>\n <dd class="vc-table-col">{{status}}</dd>\n <dd class="vc-table-col">{{costTime}}</dd>\n </dl>\n <div class="vc-group-detail">\n {{if (header !== null)}}\n <div>\n <dl class="vc-table-row vc-left-border">\n <dt class="vc-table-col vc-table-col-title">Headers</dt>\n </dl>\n {{for (var key in header)}}\n <div class="vc-table-row vc-left-border vc-small">\n <div class="vc-table-col vc-table-col-2">{{key}}</div>\n <div class="vc-table-col vc-table-col-4 vc-max-height-line">{{header[key]}}</div>\n </div>\n {{/for}}\n </div>\n {{/if}}\n {{if (getData !== null)}}\n <div>\n <dl class="vc-table-row vc-left-border">\n <dt class="vc-table-col vc-table-col-title">Query String Parameters</dt>\n </dl>\n {{for (var key in getData)}}\n <div class="vc-table-row vc-left-border vc-small">\n <div class="vc-table-col vc-table-col-2">{{key}}</div>\n <div class="vc-table-col vc-table-col-4 vc-max-height-line">{{getData[key]}}</div>\n </div>\n {{/for}}\n </div>\n {{/if}}\n {{if (postData !== null)}}\n <div>\n <dl class="vc-table-row vc-left-border">\n <dt class="vc-table-col vc-table-col-title">Form Data</dt>\n </dl>\n {{for (var key in postData)}}\n <div class="vc-table-row vc-left-border vc-small">\n <div class="vc-table-col vc-table-col-2">{{key}}</div>\n <div class="vc-table-col vc-table-col-4 vc-max-height-line">{{postData[key]}}</div>\n </div>\n {{/for}}\n </div>\n {{/if}}\n <div>\n <dl class="vc-table-row vc-left-border">\n <dt class="vc-table-col vc-table-col-title">Response</dt>\n </dl>\n <div class="vc-table-row vc-left-border vc-small">\n <pre class="vc-table-col vc-max-height vc-min-height">{{response || \'\'}}</pre>\n </div>\n </div>\n </div>\n</div>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })();
- o(31);
- var s = o(18),
- d = i(s),
- u = o(33),
- v = i(u),
- f = o(34),
- p = i(f),
- h = o(4),
- g = (n(h), o(5)),
- b = i(g),
- m = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- ),
- c = l;
- (c.isInited = !1),
- (c.node = {}),
- (c.$tabbox = b["default"].render(v["default"], {})),
- (c.nodes = []),
- (c.activedElem = {});
- var s =
- window.MutationObserver ||
- window.WebKitMutationObserver ||
- window.MozMutationObserver;
- return (
- (c.observer = new s(function(e) {
- for (var t = 0; t < e.length; t++) {
- var o = e[t];
- c._isInVConsole(o.target) || c.onMutation(o);
- }
- })),
- l
- );
- }
- return (
- l(t, e),
- c(t, [
- {
- key: "onRenderTab",
- value: function(e) {
- e(this.$tabbox);
- }
- },
- {
- key: "onAddTool",
- value: function(e) {
- var t = this,
- o = [
- {
- name: "Expend",
- global: !1,
- onClick: function(e) {
- if (t.activedElem)
- if (
- b["default"].hasClass(t.activedElem, "vc-toggle")
- )
- for (
- var o = 0;
- o < t.activedElem.childNodes.length;
- o++
- ) {
- var n = t.activedElem.childNodes[o];
- if (
- b["default"].hasClass(n, "vcelm-l") &&
- !b["default"].hasClass(n, "vcelm-noc") &&
- !b["default"].hasClass(n, "vc-toggle")
- ) {
- b["default"].one(".vcelm-node", n).click();
- break;
- }
- }
- else
- b["default"]
- .one(".vcelm-node", t.activedElem)
- .click();
- }
- },
- {
- name: "Collapse",
- global: !1,
- onClick: function(e) {
- t.activedElem &&
- (b["default"].hasClass(t.activedElem, "vc-toggle")
- ? b["default"]
- .one(".vcelm-node", t.activedElem)
- .click()
- : t.activedElem.parentNode &&
- b["default"].hasClass(
- t.activedElem.parentNode,
- "vcelm-l"
- ) &&
- b["default"]
- .one(".vcelm-node", t.activedElem.parentNode)
- .click());
- }
- }
- ];
- e(o);
- }
- },
- {
- key: "onShow",
- value: function() {
- if (!this.isInited) {
- (this.isInited = !0),
- (this.node = this.getNode(document.documentElement));
- var e = this.renderView(
- this.node,
- b["default"].one(".vc-log", this.$tabbox)
- ),
- t = b["default"].one(".vcelm-node", e);
- t && t.click();
- var o = {
- attributes: !0,
- childList: !0,
- characterData: !0,
- subtree: !0
- };
- this.observer.observe(document.documentElement, o);
- }
- }
- },
- {
- key: "onRemove",
- value: function() {
- this.observer.disconnect();
- }
- },
- {
- key: "onMutation",
- value: function(e) {
- switch (e.type) {
- case "childList":
- e.removedNodes.length > 0 && this.onChildRemove(e),
- e.addedNodes.length > 0 && this.onChildAdd(e);
- break;
- case "attributes":
- this.onAttributesChange(e);
- break;
- case "characterData":
- this.onCharacterDataChange(e);
- }
- }
- },
- {
- key: "onChildRemove",
- value: function(e) {
- var t = e.target,
- o = t.__vconsole_node;
- if (o) {
- for (var n = 0; n < e.removedNodes.length; n++) {
- var i = e.removedNodes[n],
- a = i.__vconsole_node;
- a && a.view && a.view.parentNode.removeChild(a.view);
- }
- this.getNode(t);
- }
- }
- },
- {
- key: "onChildAdd",
- value: function(e) {
- var t = e.target,
- o = t.__vconsole_node;
- if (o) {
- this.getNode(t),
- o.view && b["default"].removeClass(o.view, "vcelm-noc");
- for (var n = 0; n < e.addedNodes.length; n++) {
- var i = e.addedNodes[n],
- a = i.__vconsole_node;
- if (a)
- if (null !== e.nextSibling) {
- var r = e.nextSibling.__vconsole_node;
- r.view && this.renderView(a, r.view, "insertBefore");
- } else
- o.view &&
- (o.view.lastChild
- ? this.renderView(
- a,
- o.view.lastChild,
- "insertBefore"
- )
- : this.renderView(a, o.view));
- }
- }
- }
- },
- {
- key: "onAttributesChange",
- value: function(e) {
- var t = e.target.__vconsole_node;
- t &&
- ((t = this.getNode(e.target)),
- t.view && this.renderView(t, t.view, !0));
- }
- },
- {
- key: "onCharacterDataChange",
- value: function(e) {
- var t = e.target.__vconsole_node;
- t &&
- ((t = this.getNode(e.target)),
- t.view && this.renderView(t, t.view, !0));
- }
- },
- {
- key: "renderView",
- value: function(e, t, o) {
- var n = this,
- i = new p["default"](e).get();
- switch (
- ((e.view = i),
- b["default"].delegate(i, "click", ".vcelm-node", function(
- t
- ) {
- t.stopPropagation();
- var o = this.parentNode;
- if (!b["default"].hasClass(o, "vcelm-noc")) {
- (n.activedElem = o),
- b["default"].hasClass(o, "vc-toggle")
- ? b["default"].removeClass(o, "vc-toggle")
- : b["default"].addClass(o, "vc-toggle");
- for (var i = -1, a = 0; a < o.children.length; a++) {
- var r = o.children[a];
- b["default"].hasClass(r, "vcelm-l") &&
- (i++,
- r.children.length > 0 ||
- (e.childNodes[i]
- ? n.renderView(e.childNodes[i], r, "replace")
- : (r.style.display = "none")));
- }
- }
- }),
- o)
- ) {
- case "replace":
- t.parentNode.replaceChild(i, t);
- break;
- case "insertBefore":
- t.parentNode.insertBefore(i, t);
- break;
- default:
- t.appendChild(i);
- }
- return i;
- }
- },
- {
- key: "getNode",
- value: function(e) {
- if (!this._isIgnoredElement(e)) {
- var t = e.__vconsole_node || {};
- if (
- ((t.nodeType = e.nodeType),
- (t.nodeName = e.nodeName),
- (t.tagName = e.tagName || ""),
- (t.textContent = ""),
- (t.nodeType != e.TEXT_NODE &&
- t.nodeType != e.DOCUMENT_TYPE_NODE) ||
- (t.textContent = e.textContent),
- (t.id = e.id || ""),
- (t.className = e.className || ""),
- (t.attributes = []),
- e.hasAttributes && e.hasAttributes())
- )
- for (var o = 0; o < e.attributes.length; o++)
- t.attributes.push({
- name: e.attributes[o].name,
- value: e.attributes[o].value || ""
- });
- if (((t.childNodes = []), e.childNodes.length > 0))
- for (var n = 0; n < e.childNodes.length; n++) {
- var i = this.getNode(e.childNodes[n]);
- i && t.childNodes.push(i);
- }
- return (e.__vconsole_node = t), t;
- }
- }
- },
- {
- key: "_isIgnoredElement",
- value: function(e) {
- return (
- e.nodeType == e.TEXT_NODE &&
- "" ==
- e.textContent.replace(
- /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$|\n+/g,
- ""
- )
- );
- }
- },
- {
- key: "_isInVConsole",
- value: function(e) {
- for (var t = e; void 0 != t; ) {
- if ("__vconsole" == t.id) return !0;
- t = t.parentNode || void 0;
- }
- return !1;
- }
- }
- ]),
- t
- );
- })(d["default"]);
- (t["default"] = m), (e.exports = t["default"]);
- },
- function(e, t, o) {
- var n = o(32);
- "string" == typeof n && (n = [[e.id, n, ""]]);
- o(10)(n, {});
- n.locals && (e.exports = n.locals);
- },
- function(e, t, o) {
- (t = e.exports = o(9)()),
- t.push([
- e.id,
- '.vcelm-node{color:#183691}.vcelm-k{color:#0086b3}.vcelm-v{color:#905}.vcelm-l{padding-left:8px;position:relative;word-wrap:break-word;line-height:1}.vcelm-l.vc-toggle>.vcelm-node{display:block}.vcelm-l .vcelm-node:active{background-color:rgba(0,0,0,.15)}.vcelm-l.vcelm-noc .vcelm-node:active{background-color:transparent}.vcelm-t{white-space:pre-wrap;word-wrap:break-word}.vcelm-l .vcelm-l{display:none}.vcelm-l.vc-toggle>.vcelm-l{margin-left:4px;display:block}.vcelm-l:before{content:"";display:block;position:absolute;top:6px;left:3px;width:0;height:0;border:3px solid transparent;border-left-color:#000}.vcelm-l.vc-toggle:before{display:block;top:6px;left:0;border-top-color:#000;border-left-color:transparent}.vcelm-l.vcelm-noc:before{display:none}',
- ""
- ]);
- },
- function(e, t) {
- e.exports = '<div>\n <div class="vc-log"></div>\n</div>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e) {
- var t = ["br", "hr", "img", "input", "link", "meta"];
- return (e = e ? e.toLowerCase() : ""), t.indexOf(e) > -1;
- }
- function l(e) {
- return document.createTextNode(e);
- }
- function c(e) {
- return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var s = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- d = o(35),
- u = i(d),
- v = o(36),
- f = i(v),
- p = o(4),
- h = (n(p), o(5)),
- g = i(h),
- b = (function() {
- function e(t) {
- a(this, e), (this.node = t), (this.view = this._create(this.node));
- }
- return (
- s(e, [
- {
- key: "get",
- value: function() {
- return this.view;
- }
- },
- {
- key: "_create",
- value: function(e, t) {
- var o = document.createElement("DIV");
- switch ((g["default"].addClass(o, "vcelm-l"), e.nodeType)) {
- case o.ELEMENT_NODE:
- this._createElementNode(e, o);
- break;
- case o.TEXT_NODE:
- this._createTextNode(e, o);
- break;
- case o.COMMENT_NODE:
- case o.DOCUMENT_NODE:
- case o.DOCUMENT_TYPE_NODE:
- case o.DOCUMENT_FRAGMENT_NODE:
- }
- return o;
- }
- },
- {
- key: "_createTextNode",
- value: function(e, t) {
- g["default"].addClass(t, "vcelm-t vcelm-noc"),
- e.textContent && t.appendChild(l(c(e.textContent)));
- }
- },
- {
- key: "_createElementNode",
- value: function(e, t) {
- var o = r(e.tagName),
- n = o;
- 0 == e.childNodes.length && (n = !0);
- var i = g["default"].render(u["default"], { node: e }),
- a = g["default"].render(f["default"], { node: e });
- if (n)
- g["default"].addClass(t, "vcelm-noc"),
- t.appendChild(i),
- o || t.appendChild(a);
- else {
- t.appendChild(i);
- for (var l = 0; l < e.childNodes.length; l++) {
- var c = document.createElement("DIV");
- g["default"].addClass(c, "vcelm-l"), t.appendChild(c);
- }
- o || t.appendChild(a);
- }
- }
- }
- ]),
- e
- );
- })();
- (t["default"] = b), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports =
- '<span class="vcelm-node"><{{node.tagName.toLowerCase()}}{{if (node.className || node.attributes.length)}}\n <i class="vcelm-k">\n {{for (var i = 0; i < node.attributes.length; i++)}}\n {{if (node.attributes[i].value !== \'\')}}\n {{node.attributes[i].name}}="<i class="vcelm-v">{{node.attributes[i].value}}</i>"{{else}}\n {{node.attributes[i].name}}{{/if}}{{/for}}</i>{{/if}}></span>';
- },
- function(e, t) {
- e.exports =
- '<span class="vcelm-node"></{{node.tagName.toLowerCase()}}></span>';
- },
- function(e, t, o) {
- "use strict";
- function n(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var o in e)
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return (t["default"] = e), t;
- }
- function i(e) {
- return e && e.__esModule ? e : { default: e };
- }
- function a(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- if (!e)
- throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
- );
- return !t || ("object" != typeof t && "function" != typeof t) ? e : t;
- }
- function l(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError(
- "Super expression must either be null or a function, not " +
- typeof t
- );
- (e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- })),
- t &&
- (Object.setPrototypeOf
- ? Object.setPrototypeOf(e, t)
- : (e.__proto__ = t));
- }
- Object.defineProperty(t, "__esModule", { value: !0 });
- var c = (function() {
- function e(e, t) {
- for (var o = 0; o < t.length; o++) {
- var n = t[o];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- "value" in n && (n.writable = !0),
- Object.defineProperty(e, n.key, n);
- }
- }
- return function(t, o, n) {
- return o && e(t.prototype, o), n && e(t, n), t;
- };
- })(),
- s = o(18),
- d = i(s),
- u = o(38),
- v = i(u),
- f = o(39),
- p = i(f),
- h = o(4),
- g = n(h),
- b = o(5),
- m = i(b),
- y = (function(e) {
- function t() {
- var e;
- a(this, t);
- for (var o = arguments.length, n = Array(o), i = 0; o > i; i++)
- n[i] = arguments[i];
- var l = r(
- this,
- (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(n))
- );
- return (
- (l.$tabbox = m["default"].render(v["default"], {})),
- (l.currentType = ""),
- (l.typeNameMap = {
- cookies: "Cookies",
- localstorage: "LocalStorage"
- }),
- l
- );
- }
- return (
- l(t, e),
- c(t, [
- {
- key: "onRenderTab",
- value: function(e) {
- e(this.$tabbox);
- }
- },
- {
- key: "onAddTopBar",
- value: function(e) {
- for (
- var t = this,
- o = ["Cookies", "LocalStorage"],
- n = [],
- i = 0;
- i < o.length;
- i++
- )
- n.push({
- name: o[i],
- data: { type: o[i].toLowerCase() },
- className: "",
- onClick: function() {
- return m["default"].hasClass(this, "vc-actived")
- ? !1
- : ((t.currentType = this.dataset.type),
- void t.renderStorage());
- }
- });
- (n[0].className = "vc-actived"), e(n);
- }
- },
- {
- key: "onAddTool",
- value: function(e) {
- var t = this,
- o = [
- {
- name: "Refresh",
- global: !1,
- onClick: function(e) {
- t.renderStorage();
- }
- },
- {
- name: "Clear",
- global: !1,
- onClick: function(e) {
- t.clearLog();
- }
- }
- ];
- e(o);
- }
- },
- { key: "onReady", value: function() {} },
- {
- key: "onShow",
- value: function() {
- "" == this.currentType &&
- ((this.currentType = "cookies"), this.renderStorage());
- }
- },
- {
- key: "clearLog",
- value: function() {
- if (this.currentType && window.confirm) {
- var e = window.confirm(
- "Remove all " + this.typeNameMap[this.currentType] + "?"
- );
- if (!e) return !1;
- }
- switch (this.currentType) {
- case "cookies":
- this.clearCookieList();
- break;
- case "localstorage":
- this.clearLocalStorageList();
- break;
- default:
- return !1;
- }
- this.renderStorage();
- }
- },
- {
- key: "renderStorage",
- value: function() {
- var e = [];
- switch (this.currentType) {
- case "cookies":
- e = this.getCookieList();
- break;
- case "localstorage":
- e = this.getLocalStorageList();
- break;
- default:
- return !1;
- }
- var t = m["default"].one(".vc-log", this.$tabbox);
- if (0 == e.length) t.innerHTML = "";
- else {
- for (var o = 0; o < e.length; o++)
- (e[o].name = g.htmlEncode(e[o].name)),
- (e[o].value = g.htmlEncode(e[o].value));
- t.innerHTML = m["default"].render(
- p["default"],
- { list: e },
- !0
- );
- }
- }
- },
- {
- key: "getCookieList",
- value: function() {
- if (!document.cookie || !navigator.cookieEnabled) return [];
- for (
- var e = [], t = document.cookie.split(";"), o = 0;
- o < t.length;
- o++
- ) {
- var n = t[o].split("="),
- i = n.shift().replace(/^ /, ""),
- a = n.join("=");
- e.push({
- name: decodeURIComponent(i),
- value: decodeURIComponent(a)
- });
- }
- return e;
- }
- },
- {
- key: "getLocalStorageList",
- value: function() {
- if (!window.localStorage) return [];
- try {
- for (var e = [], t = 0; t < localStorage.length; t++) {
- var o = localStorage.key(t),
- n = localStorage.getItem(o);
- e.push({ name: o, value: n });
- }
- return e;
- } catch (i) {
- return [];
- }
- }
- },
- {
- key: "clearCookieList",
- value: function() {
- if (document.cookie && navigator.cookieEnabled) {
- for (var e = this.getCookieList(), t = 0; t < e.length; t++)
- document.cookie =
- e[t].name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
- this.renderStorage();
- }
- }
- },
- {
- key: "clearLocalStorageList",
- value: function() {
- if (window.localStorage)
- try {
- localStorage.clear(), this.renderStorage();
- } catch (e) {
- alert("localStorage.clear() fail.");
- }
- }
- }
- ]),
- t
- );
- })(d["default"]);
- (t["default"] = y), (e.exports = t["default"]);
- },
- function(e, t) {
- e.exports =
- '<div class="vc-table">\n <div class="vc-log"></div>\n</div>';
- },
- function(e, t) {
- e.exports =
- '<div>\n <dl class="vc-table-row">\n <dd class="vc-table-col">Name</dd>\n <dd class="vc-table-col vc-table-col-2">Value</dd>\n </dl>\n {{for (var i = 0; i < list.length; i++)}}\n <dl class="vc-table-row">\n <dd class="vc-table-col">{{list[i].name}}</dd>\n <dd class="vc-table-col vc-table-col-2">{{list[i].value}}</dd>\n </dl>\n {{/for}}\n</div>';
- }
- ]);
- });
|