hook.js 111 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959
  1. /******/ (() => { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ var __webpack_modules__ = ({
  4. /***/ "../app-backend-core/lib/hook.js":
  5. /*!***************************************!*\
  6. !*** ../app-backend-core/lib/hook.js ***!
  7. \***************************************/
  8. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  9. // this script is injected into every page.
  10. Object.defineProperty(exports, "__esModule", ({
  11. value: true
  12. }));
  13. exports.installHook = void 0;
  14. /**
  15. * Install the hook on window, which is an event emitter.
  16. * Note because Chrome content scripts cannot directly modify the window object,
  17. * we are evaling this function by inserting a script tag. That's why we have
  18. * to inline the whole event emitter implementation here.
  19. *
  20. * @param {Window|global} target
  21. */
  22. function installHook(target, isIframe = false) {
  23. const devtoolsVersion = '6.0';
  24. let listeners = {};
  25. function injectIframeHook(iframe) {
  26. if (iframe.__vdevtools__injected) return;
  27. try {
  28. iframe.__vdevtools__injected = true;
  29. const inject = () => {
  30. try {
  31. iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
  32. const script = iframe.contentDocument.createElement('script');
  33. script.textContent = ';(' + installHook.toString() + ')(window, true)';
  34. iframe.contentDocument.documentElement.appendChild(script);
  35. script.parentNode.removeChild(script);
  36. } catch (e) {// Ignore
  37. }
  38. };
  39. inject();
  40. iframe.addEventListener('load', () => inject());
  41. } catch (e) {// Ignore
  42. }
  43. }
  44. let iframeChecks = 0;
  45. function injectToIframes() {
  46. if (typeof window === 'undefined') return;
  47. const iframes = document.querySelectorAll('iframe:not([data-vue-devtools-ignore])');
  48. for (const iframe of iframes) {
  49. injectIframeHook(iframe);
  50. }
  51. }
  52. injectToIframes();
  53. const iframeTimer = setInterval(() => {
  54. injectToIframes();
  55. iframeChecks++;
  56. if (iframeChecks >= 5) {
  57. clearInterval(iframeTimer);
  58. }
  59. }, 1000);
  60. if (Object.prototype.hasOwnProperty.call(target, '__VUE_DEVTOOLS_GLOBAL_HOOK__')) {
  61. if (target.__VUE_DEVTOOLS_GLOBAL_HOOK__.devtoolsVersion !== devtoolsVersion) {
  62. console.error(`Another version of Vue Devtools seems to be installed. Please enable only one version at a time.`);
  63. }
  64. return;
  65. }
  66. let hook;
  67. if (isIframe) {
  68. const sendToParent = cb => {
  69. try {
  70. const hook = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  71. if (hook) {
  72. return cb(hook);
  73. } else {
  74. console.warn('[Vue Devtools] No hook in parent window');
  75. }
  76. } catch (e) {
  77. console.warn('[Vue Devtools] Failed to send message to parent window', e);
  78. }
  79. };
  80. hook = {
  81. devtoolsVersion,
  82. // eslint-disable-next-line accessor-pairs
  83. set Vue(value) {
  84. sendToParent(hook => {
  85. hook.Vue = value;
  86. });
  87. },
  88. // eslint-disable-next-line accessor-pairs
  89. set enabled(value) {
  90. sendToParent(hook => {
  91. hook.enabled = value;
  92. });
  93. },
  94. on(event, fn) {
  95. sendToParent(hook => hook.on(event, fn));
  96. },
  97. once(event, fn) {
  98. sendToParent(hook => hook.once(event, fn));
  99. },
  100. off(event, fn) {
  101. sendToParent(hook => hook.off(event, fn));
  102. },
  103. emit(event, ...args) {
  104. sendToParent(hook => hook.emit(event, ...args));
  105. },
  106. cleanupBuffer(matchArg) {
  107. var _a;
  108. return (_a = sendToParent(hook => hook.cleanupBuffer(matchArg))) !== null && _a !== void 0 ? _a : false;
  109. }
  110. };
  111. } else {
  112. hook = {
  113. devtoolsVersion,
  114. Vue: null,
  115. enabled: undefined,
  116. _buffer: [],
  117. store: null,
  118. initialState: null,
  119. storeModules: null,
  120. flushStoreModules: null,
  121. apps: [],
  122. _replayBuffer(event) {
  123. const buffer = this._buffer;
  124. this._buffer = [];
  125. for (let i = 0, l = buffer.length; i < l; i++) {
  126. const allArgs = buffer[i];
  127. allArgs[0] === event // eslint-disable-next-line prefer-spread
  128. ? this.emit.apply(this, allArgs) : this._buffer.push(allArgs);
  129. }
  130. },
  131. on(event, fn) {
  132. const $event = '$' + event;
  133. if (listeners[$event]) {
  134. listeners[$event].push(fn);
  135. } else {
  136. listeners[$event] = [fn];
  137. this._replayBuffer(event);
  138. }
  139. },
  140. once(event, fn) {
  141. const on = (...args) => {
  142. this.off(event, on);
  143. return fn.apply(this, args);
  144. };
  145. this.on(event, on);
  146. },
  147. off(event, fn) {
  148. event = '$' + event;
  149. if (!arguments.length) {
  150. listeners = {};
  151. } else {
  152. const cbs = listeners[event];
  153. if (cbs) {
  154. if (!fn) {
  155. listeners[event] = null;
  156. } else {
  157. for (let i = 0, l = cbs.length; i < l; i++) {
  158. const cb = cbs[i];
  159. if (cb === fn || cb.fn === fn) {
  160. cbs.splice(i, 1);
  161. break;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. },
  168. emit(event, ...args) {
  169. const $event = '$' + event;
  170. let cbs = listeners[$event];
  171. if (cbs) {
  172. cbs = cbs.slice();
  173. for (let i = 0, l = cbs.length; i < l; i++) {
  174. try {
  175. const result = cbs[i].apply(this, args);
  176. if (typeof (result === null || result === void 0 ? void 0 : result.catch) === 'function') {
  177. result.catch(e => {
  178. console.error(`[Hook] Error in async event handler for ${event} with args:`, args);
  179. console.error(e);
  180. });
  181. }
  182. } catch (e) {
  183. console.error(`[Hook] Error in event handler for ${event} with args:`, args);
  184. console.error(e);
  185. }
  186. }
  187. } else {
  188. this._buffer.push([event, ...args]);
  189. }
  190. },
  191. /**
  192. * Remove buffered events with any argument that is equal to the given value.
  193. * @param matchArg Given value to match.
  194. */
  195. cleanupBuffer(matchArg) {
  196. let wasBuffered = false;
  197. this._buffer = this._buffer.filter(item => {
  198. if (item.some(arg => arg === matchArg)) {
  199. wasBuffered = true;
  200. return false;
  201. }
  202. return true;
  203. });
  204. return wasBuffered;
  205. }
  206. };
  207. hook.once('init', Vue => {
  208. hook.Vue = Vue;
  209. if (Vue) {
  210. Vue.prototype.$inspect = function () {
  211. const fn = target.__VUE_DEVTOOLS_INSPECT__;
  212. fn && fn(this);
  213. };
  214. }
  215. });
  216. hook.on('app:init', (app, version, types) => {
  217. const appRecord = {
  218. app,
  219. version,
  220. types
  221. };
  222. hook.apps.push(appRecord);
  223. hook.emit('app:add', appRecord);
  224. });
  225. hook.once('vuex:init', store => {
  226. hook.store = store;
  227. hook.initialState = clone(store.state);
  228. const origReplaceState = store.replaceState.bind(store);
  229. store.replaceState = state => {
  230. hook.initialState = clone(state);
  231. origReplaceState(state);
  232. }; // Dynamic modules
  233. let origRegister, origUnregister;
  234. if (store.registerModule) {
  235. hook.storeModules = [];
  236. origRegister = store.registerModule.bind(store);
  237. store.registerModule = (path, module, options) => {
  238. if (typeof path === 'string') path = [path];
  239. hook.storeModules.push({
  240. path,
  241. module,
  242. options
  243. });
  244. origRegister(path, module, options);
  245. if (true) {
  246. // eslint-disable-next-line no-console
  247. console.log('early register module', path, module, options);
  248. }
  249. };
  250. origUnregister = store.unregisterModule.bind(store);
  251. store.unregisterModule = path => {
  252. if (typeof path === 'string') path = [path];
  253. const key = path.join('/');
  254. const index = hook.storeModules.findIndex(m => m.path.join('/') === key);
  255. if (index !== -1) hook.storeModules.splice(index, 1);
  256. origUnregister(path);
  257. if (true) {
  258. // eslint-disable-next-line no-console
  259. console.log('early unregister module', path);
  260. }
  261. };
  262. }
  263. hook.flushStoreModules = () => {
  264. store.replaceState = origReplaceState;
  265. if (store.registerModule) {
  266. store.registerModule = origRegister;
  267. store.unregisterModule = origUnregister;
  268. }
  269. return hook.storeModules || [];
  270. };
  271. });
  272. }
  273. if (false) {}
  274. Object.defineProperty(target, '__VUE_DEVTOOLS_GLOBAL_HOOK__', {
  275. get() {
  276. return hook;
  277. }
  278. }); // Handle apps initialized before hook injection
  279. if (target.__VUE_DEVTOOLS_HOOK_REPLAY__) {
  280. try {
  281. target.__VUE_DEVTOOLS_HOOK_REPLAY__.forEach(cb => cb(hook));
  282. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = [];
  283. } catch (e) {
  284. console.error('[vue-devtools] Error during hook replay', e);
  285. }
  286. } // Clone deep utility for cloning initial state of the store
  287. // Forked from https://github.com/planttheidea/fast-copy
  288. // Last update: 2019-10-30
  289. // ⚠️ Don't forget to update `./hook.js`
  290. // utils
  291. const {
  292. toString: toStringFunction
  293. } = Function.prototype;
  294. const {
  295. create,
  296. defineProperty,
  297. getOwnPropertyDescriptor,
  298. getOwnPropertyNames,
  299. getOwnPropertySymbols,
  300. getPrototypeOf
  301. } = Object;
  302. const {
  303. hasOwnProperty,
  304. propertyIsEnumerable
  305. } = Object.prototype;
  306. /**
  307. * @enum
  308. *
  309. * @const {Object} SUPPORTS
  310. *
  311. * @property {boolean} SYMBOL_PROPERTIES are symbol properties supported
  312. * @property {boolean} WEAKSET is WeakSet supported
  313. */
  314. const SUPPORTS = {
  315. SYMBOL_PROPERTIES: typeof getOwnPropertySymbols === 'function',
  316. WEAKSET: typeof WeakSet === 'function'
  317. };
  318. /**
  319. * @function createCache
  320. *
  321. * @description
  322. * get a new cache object to prevent circular references
  323. *
  324. * @returns the new cache object
  325. */
  326. const createCache = () => {
  327. if (SUPPORTS.WEAKSET) {
  328. return new WeakSet();
  329. }
  330. const object = create({
  331. add: value => object._values.push(value),
  332. has: value => !!~object._values.indexOf(value)
  333. });
  334. object._values = [];
  335. return object;
  336. };
  337. /**
  338. * @function getCleanClone
  339. *
  340. * @description
  341. * get an empty version of the object with the same prototype it has
  342. *
  343. * @param object the object to build a clean clone from
  344. * @param realm the realm the object resides in
  345. * @returns the empty cloned object
  346. */
  347. const getCleanClone = (object, realm) => {
  348. if (!object.constructor) {
  349. return create(null);
  350. } // eslint-disable-next-line no-proto
  351. const prototype = object.__proto__ || getPrototypeOf(object);
  352. if (object.constructor === realm.Object) {
  353. return prototype === realm.Object.prototype ? {} : create(prototype);
  354. }
  355. if (~toStringFunction.call(object.constructor).indexOf('[native code]')) {
  356. try {
  357. return new object.constructor();
  358. } catch (e) {// Error
  359. }
  360. }
  361. return create(prototype);
  362. };
  363. /**
  364. * @function getObjectCloneLoose
  365. *
  366. * @description
  367. * get a copy of the object based on loose rules, meaning all enumerable keys
  368. * and symbols are copied, but property descriptors are not considered
  369. *
  370. * @param object the object to clone
  371. * @param realm the realm the object resides in
  372. * @param handleCopy the function that handles copying the object
  373. * @returns the copied object
  374. */
  375. const getObjectCloneLoose = (object, realm, handleCopy, cache) => {
  376. const clone = getCleanClone(object, realm);
  377. for (const key in object) {
  378. if (hasOwnProperty.call(object, key)) {
  379. clone[key] = handleCopy(object[key], cache);
  380. }
  381. }
  382. if (SUPPORTS.SYMBOL_PROPERTIES) {
  383. const symbols = getOwnPropertySymbols(object);
  384. if (symbols.length) {
  385. for (let index = 0, symbol; index < symbols.length; index++) {
  386. symbol = symbols[index];
  387. if (propertyIsEnumerable.call(object, symbol)) {
  388. clone[symbol] = handleCopy(object[symbol], cache);
  389. }
  390. }
  391. }
  392. }
  393. return clone;
  394. };
  395. /**
  396. * @function getObjectCloneStrict
  397. *
  398. * @description
  399. * get a copy of the object based on strict rules, meaning all keys and symbols
  400. * are copied based on the original property descriptors
  401. *
  402. * @param object the object to clone
  403. * @param realm the realm the object resides in
  404. * @param handleCopy the function that handles copying the object
  405. * @returns the copied object
  406. */
  407. const getObjectCloneStrict = (object, realm, handleCopy, cache) => {
  408. const clone = getCleanClone(object, realm);
  409. const properties = SUPPORTS.SYMBOL_PROPERTIES ? [].concat(getOwnPropertyNames(object), getOwnPropertySymbols(object)) : getOwnPropertyNames(object);
  410. if (properties.length) {
  411. for (let index = 0, property, descriptor; index < properties.length; index++) {
  412. property = properties[index];
  413. if (property !== 'callee' && property !== 'caller') {
  414. descriptor = getOwnPropertyDescriptor(object, property);
  415. descriptor.value = handleCopy(object[property], cache);
  416. defineProperty(clone, property, descriptor);
  417. }
  418. }
  419. }
  420. return clone;
  421. };
  422. /**
  423. * @function getRegExpFlags
  424. *
  425. * @description
  426. * get the flags to apply to the copied regexp
  427. *
  428. * @param regExp the regexp to get the flags of
  429. * @returns the flags for the regexp
  430. */
  431. const getRegExpFlags = regExp => {
  432. let flags = '';
  433. if (regExp.global) {
  434. flags += 'g';
  435. }
  436. if (regExp.ignoreCase) {
  437. flags += 'i';
  438. }
  439. if (regExp.multiline) {
  440. flags += 'm';
  441. }
  442. if (regExp.unicode) {
  443. flags += 'u';
  444. }
  445. if (regExp.sticky) {
  446. flags += 'y';
  447. }
  448. return flags;
  449. };
  450. const {
  451. isArray
  452. } = Array;
  453. const GLOBAL_THIS = (() => {
  454. if (typeof self !== 'undefined') {
  455. return self;
  456. }
  457. if (typeof window !== 'undefined') {
  458. return window;
  459. }
  460. if (typeof __webpack_require__.g !== 'undefined') {
  461. return __webpack_require__.g;
  462. }
  463. if (console && console.error) {
  464. console.error('Unable to locate global object, returning "this".');
  465. }
  466. })();
  467. /**
  468. * @function clone
  469. *
  470. * @description
  471. * copy an object deeply as much as possible
  472. *
  473. * If `strict` is applied, then all properties (including non-enumerable ones)
  474. * are copied with their original property descriptors on both objects and arrays.
  475. *
  476. * The object is compared to the global constructors in the `realm` provided,
  477. * and the native constructor is always used to ensure that extensions of native
  478. * objects (allows in ES2015+) are maintained.
  479. *
  480. * @param object the object to copy
  481. * @param [options] the options for copying with
  482. * @param [options.isStrict] should the copy be strict
  483. * @param [options.realm] the realm (this) object the object is copied from
  484. * @returns the copied object
  485. */
  486. function clone(object, options = null) {
  487. // manually coalesced instead of default parameters for performance
  488. const isStrict = !!(options && options.isStrict);
  489. const realm = options && options.realm || GLOBAL_THIS;
  490. const getObjectClone = isStrict ? getObjectCloneStrict : getObjectCloneLoose;
  491. /**
  492. * @function handleCopy
  493. *
  494. * @description
  495. * copy the object recursively based on its type
  496. *
  497. * @param object the object to copy
  498. * @returns the copied object
  499. */
  500. const handleCopy = (object, cache) => {
  501. if (!object || typeof object !== 'object' || cache.has(object)) {
  502. return object;
  503. } // DOM objects
  504. if (typeof HTMLElement !== 'undefined' && object instanceof HTMLElement) {
  505. return object.cloneNode(false);
  506. }
  507. const Constructor = object.constructor; // plain objects
  508. if (Constructor === realm.Object) {
  509. cache.add(object);
  510. return getObjectClone(object, realm, handleCopy, cache);
  511. }
  512. let clone; // arrays
  513. if (isArray(object)) {
  514. cache.add(object); // if strict, include non-standard properties
  515. if (isStrict) {
  516. return getObjectCloneStrict(object, realm, handleCopy, cache);
  517. }
  518. clone = new Constructor();
  519. for (let index = 0; index < object.length; index++) {
  520. clone[index] = handleCopy(object[index], cache);
  521. }
  522. return clone;
  523. } // dates
  524. if (object instanceof realm.Date) {
  525. return new Constructor(object.getTime());
  526. } // regexps
  527. if (object instanceof realm.RegExp) {
  528. clone = new Constructor(object.source, object.flags || getRegExpFlags(object));
  529. clone.lastIndex = object.lastIndex;
  530. return clone;
  531. } // maps
  532. if (realm.Map && object instanceof realm.Map) {
  533. cache.add(object);
  534. clone = new Constructor();
  535. object.forEach((value, key) => {
  536. clone.set(key, handleCopy(value, cache));
  537. });
  538. return clone;
  539. } // sets
  540. if (realm.Set && object instanceof realm.Set) {
  541. cache.add(object);
  542. clone = new Constructor();
  543. object.forEach(value => {
  544. clone.add(handleCopy(value, cache));
  545. });
  546. return clone;
  547. } // buffers (node-only)
  548. if (realm.Buffer && realm.Buffer.isBuffer(object)) {
  549. clone = realm.Buffer.allocUnsafe ? realm.Buffer.allocUnsafe(object.length) : new Constructor(object.length);
  550. object.copy(clone);
  551. return clone;
  552. } // arraybuffers / dataviews
  553. if (realm.ArrayBuffer) {
  554. // dataviews
  555. if (realm.ArrayBuffer.isView(object)) {
  556. return new Constructor(object.buffer.slice(0));
  557. } // arraybuffers
  558. if (object instanceof realm.ArrayBuffer) {
  559. return object.slice(0);
  560. }
  561. } // if the object cannot / should not be cloned, don't
  562. if ( // promise-like
  563. hasOwnProperty.call(object, 'then') && typeof object.then === 'function' || // errors
  564. object instanceof Error || // weakmaps
  565. realm.WeakMap && object instanceof realm.WeakMap || // weaksets
  566. realm.WeakSet && object instanceof realm.WeakSet) {
  567. return object;
  568. }
  569. cache.add(object); // assume anything left is a custom constructor
  570. return getObjectClone(object, realm, handleCopy, cache);
  571. };
  572. return handleCopy(object, createCache());
  573. }
  574. }
  575. exports.installHook = installHook;
  576. /***/ }),
  577. /***/ "../shared-utils/lib/backend.js":
  578. /*!**************************************!*\
  579. !*** ../shared-utils/lib/backend.js ***!
  580. \**************************************/
  581. /***/ ((__unused_webpack_module, exports) => {
  582. Object.defineProperty(exports, "__esModule", ({
  583. value: true
  584. }));
  585. exports.getCatchedGetters = exports.getCustomStoreDetails = exports.getCustomRouterDetails = exports.isVueInstance = exports.getCustomObjectDetails = exports.getCustomInstanceDetails = exports.getInstanceMap = exports.backendInjections = void 0;
  586. exports.backendInjections = {
  587. instanceMap: new Map(),
  588. isVueInstance: () => false,
  589. getCustomInstanceDetails: () => ({}),
  590. getCustomObjectDetails: () => undefined
  591. };
  592. function getInstanceMap() {
  593. return exports.backendInjections.instanceMap;
  594. }
  595. exports.getInstanceMap = getInstanceMap;
  596. function getCustomInstanceDetails(instance) {
  597. return exports.backendInjections.getCustomInstanceDetails(instance);
  598. }
  599. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  600. function getCustomObjectDetails(value, proto) {
  601. return exports.backendInjections.getCustomObjectDetails(value, proto);
  602. }
  603. exports.getCustomObjectDetails = getCustomObjectDetails;
  604. function isVueInstance(value) {
  605. return exports.backendInjections.isVueInstance(value);
  606. }
  607. exports.isVueInstance = isVueInstance; // @TODO refactor
  608. function getCustomRouterDetails(router) {
  609. return {
  610. _custom: {
  611. type: 'router',
  612. display: 'VueRouter',
  613. value: {
  614. options: router.options,
  615. currentRoute: router.currentRoute
  616. },
  617. fields: {
  618. abstract: true
  619. }
  620. }
  621. };
  622. }
  623. exports.getCustomRouterDetails = getCustomRouterDetails; // @TODO refactor
  624. function getCustomStoreDetails(store) {
  625. return {
  626. _custom: {
  627. type: 'store',
  628. display: 'Store',
  629. value: {
  630. state: store.state,
  631. getters: getCatchedGetters(store)
  632. },
  633. fields: {
  634. abstract: true
  635. }
  636. }
  637. };
  638. }
  639. exports.getCustomStoreDetails = getCustomStoreDetails; // @TODO refactor
  640. function getCatchedGetters(store) {
  641. const getters = {};
  642. const origGetters = store.getters || {};
  643. const keys = Object.keys(origGetters);
  644. for (let i = 0; i < keys.length; i++) {
  645. const key = keys[i];
  646. Object.defineProperty(getters, key, {
  647. enumerable: true,
  648. get: () => {
  649. try {
  650. return origGetters[key];
  651. } catch (e) {
  652. return e;
  653. }
  654. }
  655. });
  656. }
  657. return getters;
  658. }
  659. exports.getCatchedGetters = getCatchedGetters;
  660. /***/ }),
  661. /***/ "../shared-utils/lib/bridge.js":
  662. /*!*************************************!*\
  663. !*** ../shared-utils/lib/bridge.js ***!
  664. \*************************************/
  665. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  666. Object.defineProperty(exports, "__esModule", ({
  667. value: true
  668. }));
  669. exports.Bridge = void 0;
  670. const events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
  671. const raf_1 = __webpack_require__(/*! ./raf */ "../shared-utils/lib/raf.js");
  672. const BATCH_DURATION = 100;
  673. class Bridge extends events_1.EventEmitter {
  674. constructor(wall) {
  675. super();
  676. this.setMaxListeners(Infinity);
  677. this.wall = wall;
  678. wall.listen(messages => {
  679. if (Array.isArray(messages)) {
  680. messages.forEach(message => this._emit(message));
  681. } else {
  682. this._emit(messages);
  683. }
  684. });
  685. this._batchingQueue = [];
  686. this._sendingQueue = [];
  687. this._receivingQueue = [];
  688. this._sending = false;
  689. }
  690. on(event, listener) {
  691. const wrappedListener = async (...args) => {
  692. try {
  693. await listener(...args);
  694. } catch (e) {
  695. console.error(`[Bridge] Error in listener for event ${event.toString()} with args:`, args);
  696. console.error(e);
  697. }
  698. };
  699. return super.on(event, wrappedListener);
  700. }
  701. send(event, payload) {
  702. this._batchingQueue.push({
  703. event,
  704. payload
  705. });
  706. if (this._timer == null) {
  707. this._timer = setTimeout(() => this._flush(), BATCH_DURATION);
  708. }
  709. }
  710. /**
  711. * Log a message to the devtools background page.
  712. */
  713. log(message) {
  714. this.send('log', message);
  715. }
  716. _flush() {
  717. if (this._batchingQueue.length) this._send(this._batchingQueue);
  718. clearTimeout(this._timer);
  719. this._timer = null;
  720. this._batchingQueue = [];
  721. } // @TODO types
  722. _emit(message) {
  723. if (typeof message === 'string') {
  724. this.emit(message);
  725. } else if (message._chunk) {
  726. this._receivingQueue.push(message._chunk);
  727. if (message.last) {
  728. this.emit(message.event, this._receivingQueue);
  729. this._receivingQueue = [];
  730. }
  731. } else if (message.event) {
  732. this.emit(message.event, message.payload);
  733. }
  734. } // @TODO types
  735. _send(messages) {
  736. this._sendingQueue.push(messages);
  737. this._nextSend();
  738. }
  739. _nextSend() {
  740. if (!this._sendingQueue.length || this._sending) return;
  741. this._sending = true;
  742. const messages = this._sendingQueue.shift();
  743. try {
  744. this.wall.send(messages);
  745. } catch (err) {
  746. if (err.message === 'Message length exceeded maximum allowed length.') {
  747. this._sendingQueue.splice(0, 0, messages.map(message => [message]));
  748. }
  749. }
  750. this._sending = false;
  751. (0, raf_1.raf)(() => this._nextSend());
  752. }
  753. }
  754. exports.Bridge = Bridge;
  755. /***/ }),
  756. /***/ "../shared-utils/lib/consts.js":
  757. /*!*************************************!*\
  758. !*** ../shared-utils/lib/consts.js ***!
  759. \*************************************/
  760. /***/ ((__unused_webpack_module, exports) => {
  761. Object.defineProperty(exports, "__esModule", ({
  762. value: true
  763. }));
  764. exports.HookEvents = exports.BridgeSubscriptions = exports.BridgeEvents = exports.BuiltinTabs = void 0;
  765. var BuiltinTabs;
  766. (function (BuiltinTabs) {
  767. BuiltinTabs["COMPONENTS"] = "components";
  768. BuiltinTabs["TIMELINE"] = "timeline";
  769. BuiltinTabs["PLUGINS"] = "plugins";
  770. BuiltinTabs["SETTINGS"] = "settings";
  771. })(BuiltinTabs = exports.BuiltinTabs || (exports.BuiltinTabs = {}));
  772. var BridgeEvents;
  773. (function (BridgeEvents) {
  774. // Misc
  775. BridgeEvents["TO_BACK_SUBSCRIBE"] = "b:subscribe";
  776. BridgeEvents["TO_BACK_UNSUBSCRIBE"] = "b:unsubscribe";
  777. /** Backend is ready */
  778. BridgeEvents["TO_FRONT_READY"] = "f:ready";
  779. /** Displays the "detected Vue" console log */
  780. BridgeEvents["TO_BACK_LOG_DETECTED_VUE"] = "b:log-detected-vue";
  781. /** Force refresh */
  782. BridgeEvents["TO_BACK_REFRESH"] = "b:refresh";
  783. /** Tab was switched */
  784. BridgeEvents["TO_BACK_TAB_SWITCH"] = "b:tab:switch";
  785. BridgeEvents["TO_BACK_LOG"] = "b:log";
  786. /** Reconnected after background script is terminated (idle) */
  787. BridgeEvents["TO_FRONT_RECONNECTED"] = "f:reconnected";
  788. /** Change app title (electron) */
  789. BridgeEvents["TO_FRONT_TITLE"] = "f:title"; // Apps
  790. /** App was registered */
  791. BridgeEvents["TO_FRONT_APP_ADD"] = "f:app:add";
  792. /** Get app list */
  793. BridgeEvents["TO_BACK_APP_LIST"] = "b:app:list";
  794. BridgeEvents["TO_FRONT_APP_LIST"] = "f:app:list";
  795. BridgeEvents["TO_FRONT_APP_REMOVE"] = "f:app:remove";
  796. BridgeEvents["TO_BACK_APP_SELECT"] = "b:app:select";
  797. BridgeEvents["TO_FRONT_APP_SELECTED"] = "f:app:selected";
  798. BridgeEvents["TO_BACK_SCAN_LEGACY_APPS"] = "b:app:scan-legacy"; // Components
  799. BridgeEvents["TO_BACK_COMPONENT_TREE"] = "b:component:tree";
  800. BridgeEvents["TO_FRONT_COMPONENT_TREE"] = "f:component:tree";
  801. BridgeEvents["TO_BACK_COMPONENT_SELECTED_DATA"] = "b:component:selected-data";
  802. BridgeEvents["TO_FRONT_COMPONENT_SELECTED_DATA"] = "f:component:selected-data";
  803. BridgeEvents["TO_BACK_COMPONENT_EXPAND"] = "b:component:expand";
  804. BridgeEvents["TO_FRONT_COMPONENT_EXPAND"] = "f:component:expand";
  805. BridgeEvents["TO_BACK_COMPONENT_SCROLL_TO"] = "b:component:scroll-to";
  806. BridgeEvents["TO_BACK_COMPONENT_FILTER"] = "b:component:filter";
  807. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OVER"] = "b:component:mouse-over";
  808. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OUT"] = "b:component:mouse-out";
  809. BridgeEvents["TO_BACK_COMPONENT_CONTEXT_MENU_TARGET"] = "b:component:context-menu-target";
  810. BridgeEvents["TO_BACK_COMPONENT_EDIT_STATE"] = "b:component:edit-state";
  811. BridgeEvents["TO_BACK_COMPONENT_PICK"] = "b:component:pick";
  812. BridgeEvents["TO_FRONT_COMPONENT_PICK"] = "f:component:pick";
  813. BridgeEvents["TO_BACK_COMPONENT_PICK_CANCELED"] = "b:component:pick-canceled";
  814. BridgeEvents["TO_FRONT_COMPONENT_PICK_CANCELED"] = "f:component:pick-canceled";
  815. BridgeEvents["TO_BACK_COMPONENT_INSPECT_DOM"] = "b:component:inspect-dom";
  816. BridgeEvents["TO_FRONT_COMPONENT_INSPECT_DOM"] = "f:component:inspect-dom";
  817. BridgeEvents["TO_BACK_COMPONENT_RENDER_CODE"] = "b:component:render-code";
  818. BridgeEvents["TO_FRONT_COMPONENT_RENDER_CODE"] = "f:component:render-code";
  819. BridgeEvents["TO_FRONT_COMPONENT_UPDATED"] = "f:component:updated"; // Timeline
  820. BridgeEvents["TO_FRONT_TIMELINE_EVENT"] = "f:timeline:event";
  821. BridgeEvents["TO_BACK_TIMELINE_LAYER_LIST"] = "b:timeline:layer-list";
  822. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LIST"] = "f:timeline:layer-list";
  823. BridgeEvents["TO_FRONT_TIMELINE_LAYER_ADD"] = "f:timeline:layer-add";
  824. BridgeEvents["TO_BACK_TIMELINE_SHOW_SCREENSHOT"] = "b:timeline:show-screenshot";
  825. BridgeEvents["TO_BACK_TIMELINE_CLEAR"] = "b:timeline:clear";
  826. BridgeEvents["TO_BACK_TIMELINE_EVENT_DATA"] = "b:timeline:event-data";
  827. BridgeEvents["TO_FRONT_TIMELINE_EVENT_DATA"] = "f:timeline:event-data";
  828. BridgeEvents["TO_BACK_TIMELINE_LAYER_LOAD_EVENTS"] = "b:timeline:layer-load-events";
  829. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS"] = "f:timeline:layer-load-events";
  830. BridgeEvents["TO_BACK_TIMELINE_LOAD_MARKERS"] = "b:timeline:load-markers";
  831. BridgeEvents["TO_FRONT_TIMELINE_LOAD_MARKERS"] = "f:timeline:load-markers";
  832. BridgeEvents["TO_FRONT_TIMELINE_MARKER"] = "f:timeline:marker"; // Plugins
  833. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_LIST"] = "b:devtools-plugin:list";
  834. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_LIST"] = "f:devtools-plugin:list";
  835. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_ADD"] = "f:devtools-plugin:add";
  836. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED"] = "b:devtools-plugin:setting-updated"; // Custom inspectors
  837. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_LIST"] = "b:custom-inspector:list";
  838. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_LIST"] = "f:custom-inspector:list";
  839. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_ADD"] = "f:custom-inspector:add";
  840. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_TREE"] = "b:custom-inspector:tree";
  841. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_TREE"] = "f:custom-inspector:tree";
  842. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_STATE"] = "b:custom-inspector:state";
  843. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_STATE"] = "f:custom-inspector:state";
  844. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE"] = "b:custom-inspector:edit-state";
  845. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_ACTION"] = "b:custom-inspector:action";
  846. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_NODE_ACTION"] = "b:custom-inspector:node-action";
  847. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE"] = "f:custom-inspector:select-node"; // Custom state
  848. BridgeEvents["TO_BACK_CUSTOM_STATE_ACTION"] = "b:custom-state:action";
  849. })(BridgeEvents = exports.BridgeEvents || (exports.BridgeEvents = {}));
  850. var BridgeSubscriptions;
  851. (function (BridgeSubscriptions) {
  852. BridgeSubscriptions["SELECTED_COMPONENT_DATA"] = "component:selected-data";
  853. BridgeSubscriptions["COMPONENT_TREE"] = "component:tree";
  854. })(BridgeSubscriptions = exports.BridgeSubscriptions || (exports.BridgeSubscriptions = {}));
  855. var HookEvents;
  856. (function (HookEvents) {
  857. HookEvents["INIT"] = "init";
  858. HookEvents["APP_INIT"] = "app:init";
  859. HookEvents["APP_ADD"] = "app:add";
  860. HookEvents["APP_UNMOUNT"] = "app:unmount";
  861. HookEvents["COMPONENT_UPDATED"] = "component:updated";
  862. HookEvents["COMPONENT_ADDED"] = "component:added";
  863. HookEvents["COMPONENT_REMOVED"] = "component:removed";
  864. HookEvents["COMPONENT_EMIT"] = "component:emit";
  865. HookEvents["COMPONENT_HIGHLIGHT"] = "component:highlight";
  866. HookEvents["COMPONENT_UNHIGHLIGHT"] = "component:unhighlight";
  867. HookEvents["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
  868. HookEvents["TIMELINE_LAYER_ADDED"] = "timeline:layer-added";
  869. HookEvents["TIMELINE_EVENT_ADDED"] = "timeline:event-added";
  870. HookEvents["CUSTOM_INSPECTOR_ADD"] = "custom-inspector:add";
  871. HookEvents["CUSTOM_INSPECTOR_SEND_TREE"] = "custom-inspector:send-tree";
  872. HookEvents["CUSTOM_INSPECTOR_SEND_STATE"] = "custom-inspector:send-state";
  873. HookEvents["CUSTOM_INSPECTOR_SELECT_NODE"] = "custom-inspector:select-node";
  874. HookEvents["PERFORMANCE_START"] = "perf:start";
  875. HookEvents["PERFORMANCE_END"] = "perf:end";
  876. HookEvents["PLUGIN_SETTINGS_SET"] = "plugin:settings:set";
  877. /**
  878. * @deprecated
  879. */
  880. HookEvents["FLUSH"] = "flush";
  881. /**
  882. * @deprecated
  883. */
  884. HookEvents["TRACK_UPDATE"] = "_track-update";
  885. /**
  886. * @deprecated
  887. */
  888. HookEvents["FLASH_UPDATE"] = "_flash-update";
  889. })(HookEvents = exports.HookEvents || (exports.HookEvents = {}));
  890. /***/ }),
  891. /***/ "../shared-utils/lib/edit.js":
  892. /*!***********************************!*\
  893. !*** ../shared-utils/lib/edit.js ***!
  894. \***********************************/
  895. /***/ ((__unused_webpack_module, exports) => {
  896. Object.defineProperty(exports, "__esModule", ({
  897. value: true
  898. }));
  899. exports.StateEditor = void 0;
  900. class StateEditor {
  901. set(object, path, value, cb = null) {
  902. const sections = Array.isArray(path) ? path : path.split('.');
  903. while (sections.length > 1) {
  904. object = object[sections.shift()];
  905. if (this.isRef(object)) {
  906. object = this.getRefValue(object);
  907. }
  908. }
  909. const field = sections[0];
  910. if (cb) {
  911. cb(object, field, value);
  912. } else if (this.isRef(object[field])) {
  913. this.setRefValue(object[field], value);
  914. } else {
  915. object[field] = value;
  916. }
  917. }
  918. get(object, path) {
  919. const sections = Array.isArray(path) ? path : path.split('.');
  920. for (let i = 0; i < sections.length; i++) {
  921. object = object[sections[i]];
  922. if (this.isRef(object)) {
  923. object = this.getRefValue(object);
  924. }
  925. if (!object) {
  926. return undefined;
  927. }
  928. }
  929. return object;
  930. }
  931. has(object, path, parent = false) {
  932. if (typeof object === 'undefined') {
  933. return false;
  934. }
  935. const sections = Array.isArray(path) ? path.slice() : path.split('.');
  936. const size = !parent ? 1 : 2;
  937. while (object && sections.length > size) {
  938. object = object[sections.shift()];
  939. if (this.isRef(object)) {
  940. object = this.getRefValue(object);
  941. }
  942. }
  943. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  944. }
  945. createDefaultSetCallback(state) {
  946. return (obj, field, value) => {
  947. if (state.remove || state.newKey) {
  948. if (Array.isArray(obj)) {
  949. obj.splice(field, 1);
  950. } else {
  951. delete obj[field];
  952. }
  953. }
  954. if (!state.remove) {
  955. const target = obj[state.newKey || field];
  956. if (this.isRef(target)) {
  957. this.setRefValue(target, value);
  958. } else {
  959. obj[state.newKey || field] = value;
  960. }
  961. }
  962. };
  963. }
  964. isRef(ref) {
  965. // To implement in subclass
  966. return false;
  967. }
  968. setRefValue(ref, value) {// To implement in subclass
  969. }
  970. getRefValue(ref) {
  971. // To implement in subclass
  972. return ref;
  973. }
  974. }
  975. exports.StateEditor = StateEditor;
  976. /***/ }),
  977. /***/ "../shared-utils/lib/env.js":
  978. /*!**********************************!*\
  979. !*** ../shared-utils/lib/env.js ***!
  980. \**********************************/
  981. /***/ ((__unused_webpack_module, exports) => {
  982. Object.defineProperty(exports, "__esModule", ({
  983. value: true
  984. }));
  985. exports.initEnv = exports.keys = exports.isLinux = exports.isMac = exports.isWindows = exports.isFirefox = exports.isChrome = exports.target = exports.isBrowser = void 0;
  986. exports.isBrowser = typeof navigator !== 'undefined' && typeof window !== 'undefined';
  987. exports.target = exports.isBrowser ? window : typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof my !== 'undefined' ? my : {};
  988. exports.isChrome = typeof exports.target.chrome !== 'undefined' && !!exports.target.chrome.devtools;
  989. exports.isFirefox = exports.isBrowser && navigator.userAgent && navigator.userAgent.indexOf('Firefox') > -1;
  990. exports.isWindows = exports.isBrowser && navigator.platform.indexOf('Win') === 0;
  991. exports.isMac = exports.isBrowser && navigator.platform === 'MacIntel';
  992. exports.isLinux = exports.isBrowser && navigator.platform.indexOf('Linux') === 0;
  993. exports.keys = {
  994. ctrl: exports.isMac ? '&#8984;' : 'Ctrl',
  995. shift: 'Shift',
  996. alt: exports.isMac ? '&#8997;' : 'Alt',
  997. del: 'Del',
  998. enter: 'Enter',
  999. esc: 'Esc'
  1000. };
  1001. function initEnv(Vue) {
  1002. if (Vue.prototype.hasOwnProperty('$isChrome')) return;
  1003. Object.defineProperties(Vue.prototype, {
  1004. $isChrome: {
  1005. get: () => exports.isChrome
  1006. },
  1007. $isFirefox: {
  1008. get: () => exports.isFirefox
  1009. },
  1010. $isWindows: {
  1011. get: () => exports.isWindows
  1012. },
  1013. $isMac: {
  1014. get: () => exports.isMac
  1015. },
  1016. $isLinux: {
  1017. get: () => exports.isLinux
  1018. },
  1019. $keys: {
  1020. get: () => exports.keys
  1021. }
  1022. });
  1023. if (exports.isWindows) document.body.classList.add('platform-windows');
  1024. if (exports.isMac) document.body.classList.add('platform-mac');
  1025. if (exports.isLinux) document.body.classList.add('platform-linux');
  1026. }
  1027. exports.initEnv = initEnv;
  1028. /***/ }),
  1029. /***/ "../shared-utils/lib/index.js":
  1030. /*!************************************!*\
  1031. !*** ../shared-utils/lib/index.js ***!
  1032. \************************************/
  1033. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1034. var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
  1035. if (k2 === undefined) k2 = k;
  1036. var desc = Object.getOwnPropertyDescriptor(m, k);
  1037. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1038. desc = {
  1039. enumerable: true,
  1040. get: function () {
  1041. return m[k];
  1042. }
  1043. };
  1044. }
  1045. Object.defineProperty(o, k2, desc);
  1046. } : function (o, m, k, k2) {
  1047. if (k2 === undefined) k2 = k;
  1048. o[k2] = m[k];
  1049. });
  1050. var __exportStar = this && this.__exportStar || function (m, exports) {
  1051. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  1052. };
  1053. Object.defineProperty(exports, "__esModule", ({
  1054. value: true
  1055. }));
  1056. __exportStar(__webpack_require__(/*! ./backend */ "../shared-utils/lib/backend.js"), exports);
  1057. __exportStar(__webpack_require__(/*! ./bridge */ "../shared-utils/lib/bridge.js"), exports);
  1058. __exportStar(__webpack_require__(/*! ./consts */ "../shared-utils/lib/consts.js"), exports);
  1059. __exportStar(__webpack_require__(/*! ./edit */ "../shared-utils/lib/edit.js"), exports);
  1060. __exportStar(__webpack_require__(/*! ./env */ "../shared-utils/lib/env.js"), exports);
  1061. __exportStar(__webpack_require__(/*! ./plugin-permissions */ "../shared-utils/lib/plugin-permissions.js"), exports);
  1062. __exportStar(__webpack_require__(/*! ./plugin-settings */ "../shared-utils/lib/plugin-settings.js"), exports);
  1063. __exportStar(__webpack_require__(/*! ./shared-data */ "../shared-utils/lib/shared-data.js"), exports);
  1064. __exportStar(__webpack_require__(/*! ./shell */ "../shared-utils/lib/shell.js"), exports);
  1065. __exportStar(__webpack_require__(/*! ./storage */ "../shared-utils/lib/storage.js"), exports);
  1066. __exportStar(__webpack_require__(/*! ./transfer */ "../shared-utils/lib/transfer.js"), exports);
  1067. __exportStar(__webpack_require__(/*! ./util */ "../shared-utils/lib/util.js"), exports);
  1068. __exportStar(__webpack_require__(/*! ./raf */ "../shared-utils/lib/raf.js"), exports);
  1069. /***/ }),
  1070. /***/ "../shared-utils/lib/plugin-permissions.js":
  1071. /*!*************************************************!*\
  1072. !*** ../shared-utils/lib/plugin-permissions.js ***!
  1073. \*************************************************/
  1074. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1075. Object.defineProperty(exports, "__esModule", ({
  1076. value: true
  1077. }));
  1078. exports.setPluginPermission = exports.hasPluginPermission = exports.PluginPermission = void 0;
  1079. const shared_data_1 = __webpack_require__(/*! ./shared-data */ "../shared-utils/lib/shared-data.js");
  1080. var PluginPermission;
  1081. (function (PluginPermission) {
  1082. PluginPermission["ENABLED"] = "enabled";
  1083. PluginPermission["COMPONENTS"] = "components";
  1084. PluginPermission["CUSTOM_INSPECTOR"] = "custom-inspector";
  1085. PluginPermission["TIMELINE"] = "timeline";
  1086. })(PluginPermission = exports.PluginPermission || (exports.PluginPermission = {}));
  1087. function hasPluginPermission(pluginId, permission) {
  1088. const result = shared_data_1.SharedData.pluginPermissions[`${pluginId}:${permission}`];
  1089. if (result == null) return true;
  1090. return !!result;
  1091. }
  1092. exports.hasPluginPermission = hasPluginPermission;
  1093. function setPluginPermission(pluginId, permission, active) {
  1094. shared_data_1.SharedData.pluginPermissions = { ...shared_data_1.SharedData.pluginPermissions,
  1095. [`${pluginId}:${permission}`]: active
  1096. };
  1097. }
  1098. exports.setPluginPermission = setPluginPermission;
  1099. /***/ }),
  1100. /***/ "../shared-utils/lib/plugin-settings.js":
  1101. /*!**********************************************!*\
  1102. !*** ../shared-utils/lib/plugin-settings.js ***!
  1103. \**********************************************/
  1104. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1105. Object.defineProperty(exports, "__esModule", ({
  1106. value: true
  1107. }));
  1108. exports.getPluginDefaultSettings = exports.setPluginSettings = exports.getPluginSettings = void 0;
  1109. const shared_data_1 = __webpack_require__(/*! ./shared-data */ "../shared-utils/lib/shared-data.js");
  1110. function getPluginSettings(pluginId, defaultSettings) {
  1111. var _a;
  1112. return { ...(defaultSettings !== null && defaultSettings !== void 0 ? defaultSettings : {}),
  1113. ...((_a = shared_data_1.SharedData.pluginSettings[pluginId]) !== null && _a !== void 0 ? _a : {})
  1114. };
  1115. }
  1116. exports.getPluginSettings = getPluginSettings;
  1117. function setPluginSettings(pluginId, settings) {
  1118. shared_data_1.SharedData.pluginSettings = { ...shared_data_1.SharedData.pluginSettings,
  1119. [pluginId]: settings
  1120. };
  1121. }
  1122. exports.setPluginSettings = setPluginSettings;
  1123. function getPluginDefaultSettings(schema) {
  1124. const result = {};
  1125. if (schema) {
  1126. for (const id in schema) {
  1127. const item = schema[id];
  1128. result[id] = item.defaultValue;
  1129. }
  1130. }
  1131. return result;
  1132. }
  1133. exports.getPluginDefaultSettings = getPluginDefaultSettings;
  1134. /***/ }),
  1135. /***/ "../shared-utils/lib/raf.js":
  1136. /*!**********************************!*\
  1137. !*** ../shared-utils/lib/raf.js ***!
  1138. \**********************************/
  1139. /***/ ((__unused_webpack_module, exports) => {
  1140. Object.defineProperty(exports, "__esModule", ({
  1141. value: true
  1142. }));
  1143. exports.raf = void 0;
  1144. let pendingCallbacks = [];
  1145. /**
  1146. * requestAnimationFrame that also works on non-browser environments like Node.
  1147. */
  1148. exports.raf = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : typeof setImmediate === 'function' ? fn => {
  1149. if (!pendingCallbacks.length) {
  1150. setImmediate(() => {
  1151. const now = performance.now();
  1152. const cbs = pendingCallbacks; // in case cbs add new callbacks
  1153. pendingCallbacks = [];
  1154. cbs.forEach(cb => cb(now));
  1155. });
  1156. }
  1157. pendingCallbacks.push(fn);
  1158. } : function (callback) {
  1159. return setTimeout(function () {
  1160. callback(Date.now());
  1161. }, 1000 / 60);
  1162. };
  1163. /***/ }),
  1164. /***/ "../shared-utils/lib/shared-data.js":
  1165. /*!******************************************!*\
  1166. !*** ../shared-utils/lib/shared-data.js ***!
  1167. \******************************************/
  1168. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1169. Object.defineProperty(exports, "__esModule", ({
  1170. value: true
  1171. }));
  1172. exports.SharedData = exports.watchSharedData = exports.destroySharedData = exports.onSharedDataInit = exports.initSharedData = void 0;
  1173. const storage_1 = __webpack_require__(/*! ./storage */ "../shared-utils/lib/storage.js");
  1174. const env_1 = __webpack_require__(/*! ./env */ "../shared-utils/lib/env.js"); // Initial state
  1175. const internalSharedData = {
  1176. openInEditorHost: '/',
  1177. componentNameStyle: 'class',
  1178. theme: 'auto',
  1179. displayDensity: 'low',
  1180. timeFormat: 'default',
  1181. recordVuex: true,
  1182. cacheVuexSnapshotsEvery: 50,
  1183. cacheVuexSnapshotsLimit: 10,
  1184. snapshotLoading: false,
  1185. componentEventsEnabled: true,
  1186. performanceMonitoringEnabled: true,
  1187. editableProps: false,
  1188. logDetected: true,
  1189. vuexNewBackend: false,
  1190. vuexAutoload: false,
  1191. vuexGroupGettersByModule: true,
  1192. showMenuScrollTip: true,
  1193. timelineTimeGrid: true,
  1194. timelineScreenshots: true,
  1195. menuStepScrolling: env_1.isMac,
  1196. pluginPermissions: {},
  1197. pluginSettings: {},
  1198. pageConfig: {},
  1199. legacyApps: false,
  1200. trackUpdates: true,
  1201. flashUpdates: false,
  1202. debugInfo: false,
  1203. isBrowser: env_1.isBrowser
  1204. };
  1205. const persisted = ['componentNameStyle', 'theme', 'displayDensity', 'recordVuex', 'editableProps', 'logDetected', 'vuexNewBackend', 'vuexAutoload', 'vuexGroupGettersByModule', 'timeFormat', 'showMenuScrollTip', 'timelineTimeGrid', 'timelineScreenshots', 'menuStepScrolling', 'pluginPermissions', 'pluginSettings', 'performanceMonitoringEnabled', 'componentEventsEnabled', 'trackUpdates', 'flashUpdates', 'debugInfo'];
  1206. const storageVersion = '6.0.0-alpha.1'; // ---- INTERNALS ---- //
  1207. let bridge; // List of fields to persist to storage (disabled if 'false')
  1208. // This should be unique to each shared data client to prevent conflicts
  1209. let persist = false;
  1210. let data;
  1211. let initRetryInterval;
  1212. let initRetryCount = 0;
  1213. const initCbs = [];
  1214. function initSharedData(params) {
  1215. return new Promise(resolve => {
  1216. // Mandatory params
  1217. bridge = params.bridge;
  1218. persist = !!params.persist;
  1219. if (persist) {
  1220. if (true) {
  1221. // eslint-disable-next-line no-console
  1222. console.log('[shared data] Master init in progress...');
  1223. } // Load persisted fields
  1224. persisted.forEach(key => {
  1225. const value = (0, storage_1.getStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`);
  1226. if (value !== null) {
  1227. internalSharedData[key] = value;
  1228. }
  1229. });
  1230. bridge.on('shared-data:load', () => {
  1231. // Send all fields
  1232. Object.keys(internalSharedData).forEach(key => {
  1233. sendValue(key, internalSharedData[key]);
  1234. });
  1235. bridge.send('shared-data:load-complete');
  1236. });
  1237. bridge.on('shared-data:init-complete', () => {
  1238. if (true) {
  1239. // eslint-disable-next-line no-console
  1240. console.log('[shared data] Master init complete');
  1241. }
  1242. clearInterval(initRetryInterval);
  1243. resolve();
  1244. });
  1245. bridge.send('shared-data:master-init-waiting'); // In case backend init is executed after frontend
  1246. bridge.on('shared-data:minion-init-waiting', () => {
  1247. bridge.send('shared-data:master-init-waiting');
  1248. });
  1249. initRetryCount = 0;
  1250. clearInterval(initRetryInterval);
  1251. initRetryInterval = setInterval(() => {
  1252. if (true) {
  1253. // eslint-disable-next-line no-console
  1254. console.log('[shared data] Master init retrying...');
  1255. }
  1256. bridge.send('shared-data:master-init-waiting');
  1257. initRetryCount++;
  1258. if (initRetryCount > 30) {
  1259. clearInterval(initRetryInterval);
  1260. console.error('[shared data] Master init failed');
  1261. }
  1262. }, 2000);
  1263. } else {
  1264. if (true) {// eslint-disable-next-line no-console
  1265. // console.log('[shared data] Minion init in progress...')
  1266. }
  1267. bridge.on('shared-data:master-init-waiting', () => {
  1268. if (true) {// eslint-disable-next-line no-console
  1269. // console.log('[shared data] Minion loading data...')
  1270. } // Load all persisted shared data
  1271. bridge.send('shared-data:load');
  1272. bridge.once('shared-data:load-complete', () => {
  1273. if (true) {// eslint-disable-next-line no-console
  1274. // console.log('[shared data] Minion init complete')
  1275. }
  1276. bridge.send('shared-data:init-complete');
  1277. resolve();
  1278. });
  1279. });
  1280. bridge.send('shared-data:minion-init-waiting');
  1281. }
  1282. data = { ...internalSharedData
  1283. };
  1284. if (params.Vue) {
  1285. data = params.Vue.observable(data);
  1286. } // Update value from other shared data clients
  1287. bridge.on('shared-data:set', ({
  1288. key,
  1289. value
  1290. }) => {
  1291. setValue(key, value);
  1292. });
  1293. initCbs.forEach(cb => cb());
  1294. });
  1295. }
  1296. exports.initSharedData = initSharedData;
  1297. function onSharedDataInit(cb) {
  1298. initCbs.push(cb);
  1299. return () => {
  1300. const index = initCbs.indexOf(cb);
  1301. if (index !== -1) initCbs.splice(index, 1);
  1302. };
  1303. }
  1304. exports.onSharedDataInit = onSharedDataInit;
  1305. function destroySharedData() {
  1306. bridge.removeAllListeners('shared-data:set');
  1307. watchers = {};
  1308. }
  1309. exports.destroySharedData = destroySharedData;
  1310. let watchers = {};
  1311. function setValue(key, value) {
  1312. // Storage
  1313. if (persist && persisted.includes(key)) {
  1314. (0, storage_1.setStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`, value);
  1315. }
  1316. const oldValue = data[key];
  1317. data[key] = value;
  1318. const handlers = watchers[key];
  1319. if (handlers) {
  1320. handlers.forEach(h => h(value, oldValue));
  1321. } // Validate Proxy set trap
  1322. return true;
  1323. }
  1324. function sendValue(key, value) {
  1325. bridge && bridge.send('shared-data:set', {
  1326. key,
  1327. value
  1328. });
  1329. }
  1330. function watchSharedData(prop, handler) {
  1331. const list = watchers[prop] || (watchers[prop] = []);
  1332. list.push(handler);
  1333. return () => {
  1334. const index = list.indexOf(handler);
  1335. if (index !== -1) list.splice(index, 1);
  1336. };
  1337. }
  1338. exports.watchSharedData = watchSharedData;
  1339. const proxy = {};
  1340. Object.keys(internalSharedData).forEach(key => {
  1341. Object.defineProperty(proxy, key, {
  1342. configurable: false,
  1343. get: () => data[key],
  1344. set: value => {
  1345. sendValue(key, value);
  1346. setValue(key, value);
  1347. }
  1348. });
  1349. });
  1350. exports.SharedData = proxy;
  1351. /***/ }),
  1352. /***/ "../shared-utils/lib/shell.js":
  1353. /*!************************************!*\
  1354. !*** ../shared-utils/lib/shell.js ***!
  1355. \************************************/
  1356. /***/ ((__unused_webpack_module, exports) => {
  1357. Object.defineProperty(exports, "__esModule", ({
  1358. value: true
  1359. }));
  1360. /***/ }),
  1361. /***/ "../shared-utils/lib/storage.js":
  1362. /*!**************************************!*\
  1363. !*** ../shared-utils/lib/storage.js ***!
  1364. \**************************************/
  1365. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1366. Object.defineProperty(exports, "__esModule", ({
  1367. value: true
  1368. }));
  1369. exports.clearStorage = exports.removeStorage = exports.setStorage = exports.getStorage = exports.initStorage = void 0;
  1370. const env_1 = __webpack_require__(/*! ./env */ "../shared-utils/lib/env.js"); // If we can, we use the browser extension API to store data
  1371. // it's async though, so we synchronize changes from an intermediate
  1372. // storageData object
  1373. const useStorage = typeof env_1.target.chrome !== 'undefined' && typeof env_1.target.chrome.storage !== 'undefined';
  1374. let storageData = null;
  1375. function initStorage() {
  1376. return new Promise(resolve => {
  1377. if (useStorage) {
  1378. env_1.target.chrome.storage.local.get(null, result => {
  1379. storageData = result;
  1380. resolve();
  1381. });
  1382. } else {
  1383. storageData = {};
  1384. resolve();
  1385. }
  1386. });
  1387. }
  1388. exports.initStorage = initStorage;
  1389. function getStorage(key, defaultValue = null) {
  1390. checkStorage();
  1391. if (useStorage) {
  1392. return getDefaultValue(storageData[key], defaultValue);
  1393. } else {
  1394. try {
  1395. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue);
  1396. } catch (e) {}
  1397. }
  1398. }
  1399. exports.getStorage = getStorage;
  1400. function setStorage(key, val) {
  1401. checkStorage();
  1402. if (useStorage) {
  1403. storageData[key] = val;
  1404. env_1.target.chrome.storage.local.set({
  1405. [key]: val
  1406. });
  1407. } else {
  1408. try {
  1409. localStorage.setItem(key, JSON.stringify(val));
  1410. } catch (e) {}
  1411. }
  1412. }
  1413. exports.setStorage = setStorage;
  1414. function removeStorage(key) {
  1415. checkStorage();
  1416. if (useStorage) {
  1417. delete storageData[key];
  1418. env_1.target.chrome.storage.local.remove([key]);
  1419. } else {
  1420. try {
  1421. localStorage.removeItem(key);
  1422. } catch (e) {}
  1423. }
  1424. }
  1425. exports.removeStorage = removeStorage;
  1426. function clearStorage() {
  1427. checkStorage();
  1428. if (useStorage) {
  1429. storageData = {};
  1430. env_1.target.chrome.storage.local.clear();
  1431. } else {
  1432. try {
  1433. localStorage.clear();
  1434. } catch (e) {}
  1435. }
  1436. }
  1437. exports.clearStorage = clearStorage;
  1438. function checkStorage() {
  1439. if (!storageData) {
  1440. throw new Error('Storage wasn\'t initialized with \'init()\'');
  1441. }
  1442. }
  1443. function getDefaultValue(value, defaultValue) {
  1444. if (value == null) {
  1445. return defaultValue;
  1446. }
  1447. return value;
  1448. }
  1449. /***/ }),
  1450. /***/ "../shared-utils/lib/transfer.js":
  1451. /*!***************************************!*\
  1452. !*** ../shared-utils/lib/transfer.js ***!
  1453. \***************************************/
  1454. /***/ ((__unused_webpack_module, exports) => {
  1455. Object.defineProperty(exports, "__esModule", ({
  1456. value: true
  1457. }));
  1458. exports.stringifyStrictCircularAutoChunks = exports.parseCircularAutoChunks = exports.stringifyCircularAutoChunks = void 0;
  1459. const MAX_SERIALIZED_SIZE = 512 * 1024; // 1MB
  1460. function encode(data, replacer, list, seen) {
  1461. let stored, key, value, i, l;
  1462. const seenIndex = seen.get(data);
  1463. if (seenIndex != null) {
  1464. return seenIndex;
  1465. }
  1466. const index = list.length;
  1467. const proto = Object.prototype.toString.call(data);
  1468. if (proto === '[object Object]') {
  1469. stored = {};
  1470. seen.set(data, index);
  1471. list.push(stored);
  1472. const keys = Object.keys(data);
  1473. for (i = 0, l = keys.length; i < l; i++) {
  1474. key = keys[i];
  1475. try {
  1476. value = data[key];
  1477. if (replacer) value = replacer.call(data, key, value);
  1478. } catch (e) {
  1479. value = e;
  1480. }
  1481. stored[key] = encode(value, replacer, list, seen);
  1482. }
  1483. } else if (proto === '[object Array]') {
  1484. stored = [];
  1485. seen.set(data, index);
  1486. list.push(stored);
  1487. for (i = 0, l = data.length; i < l; i++) {
  1488. try {
  1489. value = data[i];
  1490. if (replacer) value = replacer.call(data, i, value);
  1491. } catch (e) {
  1492. value = e;
  1493. }
  1494. stored[i] = encode(value, replacer, list, seen);
  1495. }
  1496. } else {
  1497. list.push(data);
  1498. }
  1499. return index;
  1500. }
  1501. function decode(list, reviver) {
  1502. let i = list.length;
  1503. let j, k, data, key, value, proto;
  1504. while (i--) {
  1505. data = list[i];
  1506. proto = Object.prototype.toString.call(data);
  1507. if (proto === '[object Object]') {
  1508. const keys = Object.keys(data);
  1509. for (j = 0, k = keys.length; j < k; j++) {
  1510. key = keys[j];
  1511. value = list[data[key]];
  1512. if (reviver) value = reviver.call(data, key, value);
  1513. data[key] = value;
  1514. }
  1515. } else if (proto === '[object Array]') {
  1516. for (j = 0, k = data.length; j < k; j++) {
  1517. value = list[data[j]];
  1518. if (reviver) value = reviver.call(data, j, value);
  1519. data[j] = value;
  1520. }
  1521. }
  1522. }
  1523. }
  1524. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  1525. let result;
  1526. try {
  1527. result = arguments.length === 1 ? JSON.stringify(data) // @ts-ignore
  1528. : JSON.stringify(data, replacer, space);
  1529. } catch (e) {
  1530. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  1531. }
  1532. if (result.length > MAX_SERIALIZED_SIZE) {
  1533. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  1534. const chunks = [];
  1535. for (let i = 0; i < chunkCount; i++) {
  1536. chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE));
  1537. }
  1538. return chunks;
  1539. }
  1540. return result;
  1541. }
  1542. exports.stringifyCircularAutoChunks = stringifyCircularAutoChunks;
  1543. function parseCircularAutoChunks(data, reviver = null) {
  1544. if (Array.isArray(data)) {
  1545. data = data.join('');
  1546. }
  1547. const hasCircular = /^\s/.test(data);
  1548. if (!hasCircular) {
  1549. return arguments.length === 1 ? JSON.parse(data) // @ts-ignore
  1550. : JSON.parse(data, reviver);
  1551. } else {
  1552. const list = JSON.parse(data);
  1553. decode(list, reviver);
  1554. return list[0];
  1555. }
  1556. }
  1557. exports.parseCircularAutoChunks = parseCircularAutoChunks;
  1558. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  1559. const list = [];
  1560. encode(data, replacer, list, new Map());
  1561. return space ? ' ' + JSON.stringify(list, null, space) : ' ' + JSON.stringify(list);
  1562. }
  1563. exports.stringifyStrictCircularAutoChunks = stringifyStrictCircularAutoChunks;
  1564. /***/ }),
  1565. /***/ "../shared-utils/lib/util.js":
  1566. /*!***********************************!*\
  1567. !*** ../shared-utils/lib/util.js ***!
  1568. \***********************************/
  1569. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1570. var __importDefault = this && this.__importDefault || function (mod) {
  1571. return mod && mod.__esModule ? mod : {
  1572. "default": mod
  1573. };
  1574. };
  1575. Object.defineProperty(exports, "__esModule", ({
  1576. value: true
  1577. }));
  1578. exports.isEmptyObject = exports.copyToClipboard = exports.escape = exports.openInEditor = exports.focusInput = exports.simpleGet = exports.sortByKey = exports.searchDeepInObject = exports.isPlainObject = exports.revive = exports.parse = exports.getCustomRefDetails = exports.getCustomHTMLElementDetails = exports.getCustomFunctionDetails = exports.getCustomComponentDefinitionDetails = exports.getComponentName = exports.reviveSet = exports.getCustomSetDetails = exports.reviveMap = exports.getCustomMapDetails = exports.stringify = exports.specialTokenToString = exports.MAX_ARRAY_SIZE = exports.MAX_STRING_SIZE = exports.SPECIAL_TOKENS = exports.NAN = exports.NEGATIVE_INFINITY = exports.INFINITY = exports.UNDEFINED = exports.inDoc = exports.getComponentDisplayName = exports.kebabize = exports.camelize = exports.classify = void 0;
  1579. const path_1 = __importDefault(__webpack_require__(/*! path */ "../../node_modules/path-browserify/index.js"));
  1580. const transfer_1 = __webpack_require__(/*! ./transfer */ "../shared-utils/lib/transfer.js");
  1581. const backend_1 = __webpack_require__(/*! ./backend */ "../shared-utils/lib/backend.js");
  1582. const shared_data_1 = __webpack_require__(/*! ./shared-data */ "../shared-utils/lib/shared-data.js");
  1583. const env_1 = __webpack_require__(/*! ./env */ "../shared-utils/lib/env.js");
  1584. function cached(fn) {
  1585. const cache = Object.create(null);
  1586. return function cachedFn(str) {
  1587. const hit = cache[str];
  1588. return hit || (cache[str] = fn(str));
  1589. };
  1590. }
  1591. const classifyRE = /(?:^|[-_/])(\w)/g;
  1592. exports.classify = cached(str => {
  1593. // fix: str.replace may causes '"replace" is not a function' exception.
  1594. // This bug may causes the UI 'Component Filter' to not work properly
  1595. // e.g. The type of 'str' is Number.
  1596. // So need cover 'str' to String.
  1597. return str && ('' + str).replace(classifyRE, toUpper);
  1598. });
  1599. const camelizeRE = /-(\w)/g;
  1600. exports.camelize = cached(str => {
  1601. return str && str.replace(camelizeRE, toUpper);
  1602. });
  1603. const kebabizeRE = /([a-z0-9])([A-Z])/g;
  1604. exports.kebabize = cached(str => {
  1605. return str && str.replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {
  1606. return `${lowerCaseCharacter}-${upperCaseLetter}`;
  1607. }).toLowerCase();
  1608. });
  1609. function toUpper(_, c) {
  1610. return c ? c.toUpperCase() : '';
  1611. }
  1612. function getComponentDisplayName(originalName, style = 'class') {
  1613. switch (style) {
  1614. case 'class':
  1615. return (0, exports.classify)(originalName);
  1616. case 'kebab':
  1617. return (0, exports.kebabize)(originalName);
  1618. case 'original':
  1619. default:
  1620. return originalName;
  1621. }
  1622. }
  1623. exports.getComponentDisplayName = getComponentDisplayName;
  1624. function inDoc(node) {
  1625. if (!node) return false;
  1626. const doc = node.ownerDocument.documentElement;
  1627. const parent = node.parentNode;
  1628. return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  1629. }
  1630. exports.inDoc = inDoc;
  1631. /**
  1632. * Stringify/parse data using CircularJSON.
  1633. */
  1634. exports.UNDEFINED = '__vue_devtool_undefined__';
  1635. exports.INFINITY = '__vue_devtool_infinity__';
  1636. exports.NEGATIVE_INFINITY = '__vue_devtool_negative_infinity__';
  1637. exports.NAN = '__vue_devtool_nan__';
  1638. exports.SPECIAL_TOKENS = {
  1639. true: true,
  1640. false: false,
  1641. undefined: exports.UNDEFINED,
  1642. null: null,
  1643. '-Infinity': exports.NEGATIVE_INFINITY,
  1644. Infinity: exports.INFINITY,
  1645. NaN: exports.NAN
  1646. };
  1647. exports.MAX_STRING_SIZE = 10000;
  1648. exports.MAX_ARRAY_SIZE = 5000;
  1649. function specialTokenToString(value) {
  1650. if (value === null) {
  1651. return 'null';
  1652. } else if (value === exports.UNDEFINED) {
  1653. return 'undefined';
  1654. } else if (value === exports.NAN) {
  1655. return 'NaN';
  1656. } else if (value === exports.INFINITY) {
  1657. return 'Infinity';
  1658. } else if (value === exports.NEGATIVE_INFINITY) {
  1659. return '-Infinity';
  1660. }
  1661. return false;
  1662. }
  1663. exports.specialTokenToString = specialTokenToString;
  1664. /**
  1665. * Needed to prevent stack overflow
  1666. * while replacing complex objects
  1667. * like components because we create
  1668. * new objects with the CustomValue API
  1669. * (.i.e `{ _custom: { ... } }`)
  1670. */
  1671. class EncodeCache {
  1672. constructor() {
  1673. this.map = new Map();
  1674. }
  1675. /**
  1676. * Returns a result unique to each input data
  1677. * @param {*} data Input data
  1678. * @param {*} factory Function used to create the unique result
  1679. */
  1680. cache(data, factory) {
  1681. const cached = this.map.get(data);
  1682. if (cached) {
  1683. return cached;
  1684. } else {
  1685. const result = factory(data);
  1686. this.map.set(data, result);
  1687. return result;
  1688. }
  1689. }
  1690. clear() {
  1691. this.map.clear();
  1692. }
  1693. }
  1694. const encodeCache = new EncodeCache();
  1695. class ReviveCache {
  1696. constructor(maxSize) {
  1697. this.maxSize = maxSize;
  1698. this.map = new Map();
  1699. this.index = 0;
  1700. this.size = 0;
  1701. }
  1702. cache(value) {
  1703. const currentIndex = this.index;
  1704. this.map.set(currentIndex, value);
  1705. this.size++;
  1706. if (this.size > this.maxSize) {
  1707. this.map.delete(currentIndex - this.size);
  1708. this.size--;
  1709. }
  1710. this.index++;
  1711. return currentIndex;
  1712. }
  1713. read(id) {
  1714. return this.map.get(id);
  1715. }
  1716. }
  1717. const reviveCache = new ReviveCache(1000);
  1718. const replacers = {
  1719. internal: replacerForInternal,
  1720. user: replaceForUser
  1721. };
  1722. function stringify(data, target = 'internal') {
  1723. // Create a fresh cache for each serialization
  1724. encodeCache.clear();
  1725. return (0, transfer_1.stringifyCircularAutoChunks)(data, replacers[target]);
  1726. }
  1727. exports.stringify = stringify;
  1728. function replacerForInternal(key) {
  1729. var _a; // @ts-ignore
  1730. const val = this[key];
  1731. const type = typeof val;
  1732. if (Array.isArray(val)) {
  1733. const l = val.length;
  1734. if (l > exports.MAX_ARRAY_SIZE) {
  1735. return {
  1736. _isArray: true,
  1737. length: l,
  1738. items: val.slice(0, exports.MAX_ARRAY_SIZE)
  1739. };
  1740. }
  1741. return val;
  1742. } else if (typeof val === 'string') {
  1743. if (val.length > exports.MAX_STRING_SIZE) {
  1744. return val.substring(0, exports.MAX_STRING_SIZE) + `... (${val.length} total length)`;
  1745. } else {
  1746. return val;
  1747. }
  1748. } else if (type === 'undefined') {
  1749. return exports.UNDEFINED;
  1750. } else if (val === Infinity) {
  1751. return exports.INFINITY;
  1752. } else if (val === -Infinity) {
  1753. return exports.NEGATIVE_INFINITY;
  1754. } else if (type === 'function') {
  1755. return getCustomFunctionDetails(val);
  1756. } else if (type === 'symbol') {
  1757. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  1758. } else if (val !== null && type === 'object') {
  1759. const proto = Object.prototype.toString.call(val);
  1760. if (proto === '[object Map]') {
  1761. return encodeCache.cache(val, () => getCustomMapDetails(val));
  1762. } else if (proto === '[object Set]') {
  1763. return encodeCache.cache(val, () => getCustomSetDetails(val));
  1764. } else if (proto === '[object RegExp]') {
  1765. // special handling of native type
  1766. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  1767. } else if (proto === '[object Date]') {
  1768. return `[native Date ${Date.prototype.toString.call(val)}]`;
  1769. } else if (proto === '[object Error]') {
  1770. return `[native Error ${val.message}<>${val.stack}]`;
  1771. } else if (val.state && val._vm) {
  1772. return encodeCache.cache(val, () => (0, backend_1.getCustomStoreDetails)(val));
  1773. } else if (val.constructor && val.constructor.name === 'VueRouter') {
  1774. return encodeCache.cache(val, () => (0, backend_1.getCustomRouterDetails)(val));
  1775. } else if ((0, backend_1.isVueInstance)(val)) {
  1776. return encodeCache.cache(val, () => (0, backend_1.getCustomInstanceDetails)(val));
  1777. } else if (typeof val.render === 'function') {
  1778. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val));
  1779. } else if (val.constructor && val.constructor.name === 'VNode') {
  1780. return `[native VNode <${val.tag}>]`;
  1781. } else if (typeof HTMLElement !== 'undefined' && val instanceof HTMLElement) {
  1782. return encodeCache.cache(val, () => getCustomHTMLElementDetails(val));
  1783. } else if (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Store' && val._wrappedGetters) {
  1784. return `[object Store]`;
  1785. } else if (val.currentRoute) {
  1786. return `[object Router]`;
  1787. }
  1788. const customDetails = (0, backend_1.getCustomObjectDetails)(val, proto);
  1789. if (customDetails != null) return customDetails;
  1790. } else if (Number.isNaN(val)) {
  1791. return exports.NAN;
  1792. }
  1793. return sanitize(val);
  1794. } // @TODO revive from backend to have more data to the clipboard
  1795. function replaceForUser(key) {
  1796. // @ts-ignore
  1797. let val = this[key];
  1798. const type = typeof val;
  1799. if ((val === null || val === void 0 ? void 0 : val._custom) && 'value' in val._custom) {
  1800. val = val._custom.value;
  1801. }
  1802. if (type !== 'object') {
  1803. if (val === exports.UNDEFINED) {
  1804. return undefined;
  1805. } else if (val === exports.INFINITY) {
  1806. return Infinity;
  1807. } else if (val === exports.NEGATIVE_INFINITY) {
  1808. return -Infinity;
  1809. } else if (val === exports.NAN) {
  1810. return NaN;
  1811. }
  1812. return val;
  1813. }
  1814. return sanitize(val);
  1815. }
  1816. function getCustomMapDetails(val) {
  1817. const list = [];
  1818. val.forEach((value, key) => list.push({
  1819. key,
  1820. value
  1821. }));
  1822. return {
  1823. _custom: {
  1824. type: 'map',
  1825. display: 'Map',
  1826. value: list,
  1827. readOnly: true,
  1828. fields: {
  1829. abstract: true
  1830. }
  1831. }
  1832. };
  1833. }
  1834. exports.getCustomMapDetails = getCustomMapDetails;
  1835. function reviveMap(val) {
  1836. const result = new Map();
  1837. const list = val._custom.value;
  1838. for (let i = 0; i < list.length; i++) {
  1839. const {
  1840. key,
  1841. value
  1842. } = list[i];
  1843. result.set(key, revive(value));
  1844. }
  1845. return result;
  1846. }
  1847. exports.reviveMap = reviveMap;
  1848. function getCustomSetDetails(val) {
  1849. const list = Array.from(val);
  1850. return {
  1851. _custom: {
  1852. type: 'set',
  1853. display: `Set[${list.length}]`,
  1854. value: list,
  1855. readOnly: true
  1856. }
  1857. };
  1858. }
  1859. exports.getCustomSetDetails = getCustomSetDetails;
  1860. function reviveSet(val) {
  1861. const result = new Set();
  1862. const list = val._custom.value;
  1863. for (let i = 0; i < list.length; i++) {
  1864. const value = list[i];
  1865. result.add(revive(value));
  1866. }
  1867. return result;
  1868. }
  1869. exports.reviveSet = reviveSet; // Use a custom basename functions instead of the shimed version
  1870. // because it doesn't work on Windows
  1871. function basename(filename, ext) {
  1872. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'), ext);
  1873. }
  1874. function getComponentName(options) {
  1875. const name = options.displayName || options.name || options._componentTag;
  1876. if (name) {
  1877. return name;
  1878. }
  1879. const file = options.__file; // injected by vue-loader
  1880. if (file) {
  1881. return (0, exports.classify)(basename(file, '.vue'));
  1882. }
  1883. }
  1884. exports.getComponentName = getComponentName;
  1885. function getCustomComponentDefinitionDetails(def) {
  1886. let display = getComponentName(def);
  1887. if (display) {
  1888. if (def.name && def.__file) {
  1889. display += ` <span>(${def.__file})</span>`;
  1890. }
  1891. } else {
  1892. display = '<i>Unknown Component</i>';
  1893. }
  1894. return {
  1895. _custom: {
  1896. type: 'component-definition',
  1897. display,
  1898. tooltip: 'Component definition',
  1899. ...(def.__file ? {
  1900. file: def.__file
  1901. } : {})
  1902. }
  1903. };
  1904. }
  1905. exports.getCustomComponentDefinitionDetails = getCustomComponentDefinitionDetails; // eslint-disable-next-line @typescript-eslint/ban-types
  1906. function getCustomFunctionDetails(func) {
  1907. let string = '';
  1908. let matches = null;
  1909. try {
  1910. string = Function.prototype.toString.call(func);
  1911. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  1912. } catch (e) {// Func is probably a Proxy, which can break Function.prototype.toString()
  1913. } // Trim any excess whitespace from the argument string
  1914. const match = matches && matches[0];
  1915. const args = typeof match === 'string' ? match : '(?)';
  1916. const name = typeof func.name === 'string' ? func.name : '';
  1917. return {
  1918. _custom: {
  1919. type: 'function',
  1920. display: `<span style="opacity:.5;">function</span> ${escape(name)}${args}`,
  1921. tooltip: string.trim() ? `<pre>${string}</pre>` : null,
  1922. _reviveId: reviveCache.cache(func)
  1923. }
  1924. };
  1925. }
  1926. exports.getCustomFunctionDetails = getCustomFunctionDetails;
  1927. function getCustomHTMLElementDetails(value) {
  1928. try {
  1929. return {
  1930. _custom: {
  1931. type: 'HTMLElement',
  1932. display: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  1933. value: namedNodeMapToObject(value.attributes),
  1934. actions: [{
  1935. icon: 'input',
  1936. tooltip: 'Log element to console',
  1937. action: () => {
  1938. // eslint-disable-next-line no-console
  1939. console.log(value);
  1940. }
  1941. }]
  1942. }
  1943. };
  1944. } catch (e) {
  1945. return {
  1946. _custom: {
  1947. type: 'HTMLElement',
  1948. display: `<span class="text-blue-500">${String(value)}</span>`
  1949. }
  1950. };
  1951. }
  1952. }
  1953. exports.getCustomHTMLElementDetails = getCustomHTMLElementDetails;
  1954. function namedNodeMapToObject(map) {
  1955. const result = {};
  1956. const l = map.length;
  1957. for (let i = 0; i < l; i++) {
  1958. const node = map.item(i);
  1959. result[node.name] = node.value;
  1960. }
  1961. return result;
  1962. }
  1963. function getCustomRefDetails(instance, key, ref) {
  1964. let value;
  1965. if (Array.isArray(ref)) {
  1966. value = ref.map(r => getCustomRefDetails(instance, key, r)).map(data => data.value);
  1967. } else {
  1968. let name;
  1969. if (ref._isVue) {
  1970. name = getComponentName(ref.$options);
  1971. } else {
  1972. name = ref.tagName.toLowerCase();
  1973. }
  1974. value = {
  1975. _custom: {
  1976. display: `&lt;${name}` + (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : '') + (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : '') + '&gt;',
  1977. uid: instance.__VUE_DEVTOOLS_UID__,
  1978. type: 'reference'
  1979. }
  1980. };
  1981. }
  1982. return {
  1983. type: '$refs',
  1984. key: key,
  1985. value,
  1986. editable: false
  1987. };
  1988. }
  1989. exports.getCustomRefDetails = getCustomRefDetails;
  1990. function parse(data, revive = false) {
  1991. return revive ? (0, transfer_1.parseCircularAutoChunks)(data, reviver) : (0, transfer_1.parseCircularAutoChunks)(data);
  1992. }
  1993. exports.parse = parse;
  1994. const specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
  1995. const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  1996. function reviver(key, val) {
  1997. return revive(val);
  1998. }
  1999. function revive(val) {
  2000. if (val === exports.UNDEFINED) {
  2001. return undefined;
  2002. } else if (val === exports.INFINITY) {
  2003. return Infinity;
  2004. } else if (val === exports.NEGATIVE_INFINITY) {
  2005. return -Infinity;
  2006. } else if (val === exports.NAN) {
  2007. return NaN;
  2008. } else if (val && val._custom) {
  2009. const {
  2010. _custom: custom
  2011. } = val;
  2012. if (custom.type === 'component') {
  2013. return (0, backend_1.getInstanceMap)().get(custom.id);
  2014. } else if (custom.type === 'map') {
  2015. return reviveMap(val);
  2016. } else if (custom.type === 'set') {
  2017. return reviveSet(val);
  2018. } else if (custom._reviveId) {
  2019. return reviveCache.read(custom._reviveId);
  2020. } else {
  2021. return revive(custom.value);
  2022. }
  2023. } else if (symbolRE.test(val)) {
  2024. const [, string] = symbolRE.exec(val);
  2025. return Symbol.for(string);
  2026. } else if (specialTypeRE.test(val)) {
  2027. const [, type, string,, details] = specialTypeRE.exec(val);
  2028. const result = new env_1.target[type](string);
  2029. if (type === 'Error' && details) {
  2030. result.stack = details;
  2031. }
  2032. return result;
  2033. } else {
  2034. return val;
  2035. }
  2036. }
  2037. exports.revive = revive;
  2038. /**
  2039. * Sanitize data to be posted to the other side.
  2040. * Since the message posted is sent with structured clone,
  2041. * we need to filter out any types that might cause an error.
  2042. *
  2043. * @param {*} data
  2044. * @return {*}
  2045. */
  2046. function sanitize(data) {
  2047. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  2048. // handle types that will probably cause issues in
  2049. // the structured clone
  2050. return Object.prototype.toString.call(data);
  2051. } else {
  2052. return data;
  2053. }
  2054. }
  2055. function isPlainObject(obj) {
  2056. return Object.prototype.toString.call(obj) === '[object Object]';
  2057. }
  2058. exports.isPlainObject = isPlainObject;
  2059. function isPrimitive(data) {
  2060. if (data == null) {
  2061. return true;
  2062. }
  2063. const type = typeof data;
  2064. return type === 'string' || type === 'number' || type === 'boolean';
  2065. }
  2066. /**
  2067. * Searches a key or value in the object, with a maximum deepness
  2068. * @param {*} obj Search target
  2069. * @param {string} searchTerm Search string
  2070. * @returns {boolean} Search match
  2071. */
  2072. function searchDeepInObject(obj, searchTerm) {
  2073. const seen = new Map();
  2074. const result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0);
  2075. seen.clear();
  2076. return result;
  2077. }
  2078. exports.searchDeepInObject = searchDeepInObject;
  2079. const SEARCH_MAX_DEPTH = 10;
  2080. /**
  2081. * Executes a search on each field of the provided object
  2082. * @param {*} obj Search target
  2083. * @param {string} searchTerm Search string
  2084. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  2085. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  2086. * @returns {boolean} Search match
  2087. */
  2088. function internalSearchObject(obj, searchTerm, seen, depth) {
  2089. if (depth > SEARCH_MAX_DEPTH) {
  2090. return false;
  2091. }
  2092. let match = false;
  2093. const keys = Object.keys(obj);
  2094. let key, value;
  2095. for (let i = 0; i < keys.length; i++) {
  2096. key = keys[i];
  2097. value = obj[key];
  2098. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1);
  2099. if (match) {
  2100. break;
  2101. }
  2102. }
  2103. return match;
  2104. }
  2105. /**
  2106. * Executes a search on each value of the provided array
  2107. * @param {*} array Search target
  2108. * @param {string} searchTerm Search string
  2109. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  2110. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  2111. * @returns {boolean} Search match
  2112. */
  2113. function internalSearchArray(array, searchTerm, seen, depth) {
  2114. if (depth > SEARCH_MAX_DEPTH) {
  2115. return false;
  2116. }
  2117. let match = false;
  2118. let value;
  2119. for (let i = 0; i < array.length; i++) {
  2120. value = array[i];
  2121. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1);
  2122. if (match) {
  2123. break;
  2124. }
  2125. }
  2126. return match;
  2127. }
  2128. /**
  2129. * Checks if the provided field matches the search terms
  2130. * @param {string} searchTerm Search string
  2131. * @param {string} key Field key (null if from array)
  2132. * @param {*} value Field value
  2133. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  2134. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  2135. * @returns {boolean} Search match
  2136. */
  2137. function internalSearchCheck(searchTerm, key, value, seen, depth) {
  2138. let match = false;
  2139. let result;
  2140. if (key === '_custom') {
  2141. key = value.display;
  2142. value = value.value;
  2143. }
  2144. (result = specialTokenToString(value)) && (value = result);
  2145. if (key && compare(key, searchTerm)) {
  2146. match = true;
  2147. seen.set(value, true);
  2148. } else if (seen.has(value)) {
  2149. match = seen.get(value);
  2150. } else if (Array.isArray(value)) {
  2151. seen.set(value, null);
  2152. match = internalSearchArray(value, searchTerm, seen, depth);
  2153. seen.set(value, match);
  2154. } else if (isPlainObject(value)) {
  2155. seen.set(value, null);
  2156. match = internalSearchObject(value, searchTerm, seen, depth);
  2157. seen.set(value, match);
  2158. } else if (compare(value, searchTerm)) {
  2159. match = true;
  2160. seen.set(value, true);
  2161. }
  2162. return match;
  2163. }
  2164. /**
  2165. * Compares two values
  2166. * @param {*} value Mixed type value that will be cast to string
  2167. * @param {string} searchTerm Search string
  2168. * @returns {boolean} Search match
  2169. */
  2170. function compare(value, searchTerm) {
  2171. return ('' + value).toLowerCase().indexOf(searchTerm) !== -1;
  2172. }
  2173. function sortByKey(state) {
  2174. return state && state.slice().sort((a, b) => {
  2175. if (a.key < b.key) return -1;
  2176. if (a.key > b.key) return 1;
  2177. return 0;
  2178. });
  2179. }
  2180. exports.sortByKey = sortByKey;
  2181. function simpleGet(object, path) {
  2182. const sections = Array.isArray(path) ? path : path.split('.');
  2183. for (let i = 0; i < sections.length; i++) {
  2184. object = object[sections[i]];
  2185. if (!object) {
  2186. return undefined;
  2187. }
  2188. }
  2189. return object;
  2190. }
  2191. exports.simpleGet = simpleGet;
  2192. function focusInput(el) {
  2193. el.focus();
  2194. el.setSelectionRange(0, el.value.length);
  2195. }
  2196. exports.focusInput = focusInput;
  2197. function openInEditor(file) {
  2198. // Console display
  2199. const fileName = file.replace(/\\/g, '\\\\');
  2200. const src = `fetch('${shared_data_1.SharedData.openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  2201. if (response.ok) {
  2202. console.log('File ${fileName} opened in editor')
  2203. } else {
  2204. const msg = 'Opening component ${fileName} failed'
  2205. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  2206. if (target.__VUE_DEVTOOLS_TOAST__) {
  2207. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  2208. } else {
  2209. console.log('%c' + msg, 'color:red')
  2210. }
  2211. console.log('Check the setup of your project, see https://devtools.vuejs.org/guide/open-in-editor.html')
  2212. }
  2213. })`;
  2214. if (env_1.isChrome) {
  2215. env_1.target.chrome.devtools.inspectedWindow.eval(src);
  2216. } else {
  2217. // eslint-disable-next-line no-eval
  2218. [eval][0](src);
  2219. }
  2220. }
  2221. exports.openInEditor = openInEditor;
  2222. const ESC = {
  2223. '<': '&lt;',
  2224. '>': '&gt;',
  2225. '"': '&quot;',
  2226. '&': '&amp;'
  2227. };
  2228. function escape(s) {
  2229. return s.replace(/[<>"&]/g, escapeChar);
  2230. }
  2231. exports.escape = escape;
  2232. function escapeChar(a) {
  2233. return ESC[a] || a;
  2234. }
  2235. function copyToClipboard(state) {
  2236. let text;
  2237. if (typeof state !== 'object') {
  2238. text = String(state);
  2239. } else {
  2240. text = stringify(state, 'user');
  2241. } // @TODO navigator.clipboard is buggy in extensions
  2242. if (typeof document === 'undefined') return;
  2243. const dummyTextArea = document.createElement('textarea');
  2244. dummyTextArea.textContent = text;
  2245. document.body.appendChild(dummyTextArea);
  2246. dummyTextArea.select();
  2247. document.execCommand('copy');
  2248. document.body.removeChild(dummyTextArea);
  2249. }
  2250. exports.copyToClipboard = copyToClipboard;
  2251. function isEmptyObject(obj) {
  2252. return obj === exports.UNDEFINED || !obj || Object.keys(obj).length === 0;
  2253. }
  2254. exports.isEmptyObject = isEmptyObject;
  2255. /***/ }),
  2256. /***/ "../../node_modules/events/events.js":
  2257. /*!*******************************************!*\
  2258. !*** ../../node_modules/events/events.js ***!
  2259. \*******************************************/
  2260. /***/ ((module) => {
  2261. // Copyright Joyent, Inc. and other Node contributors.
  2262. //
  2263. // Permission is hereby granted, free of charge, to any person obtaining a
  2264. // copy of this software and associated documentation files (the
  2265. // "Software"), to deal in the Software without restriction, including
  2266. // without limitation the rights to use, copy, modify, merge, publish,
  2267. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2268. // persons to whom the Software is furnished to do so, subject to the
  2269. // following conditions:
  2270. //
  2271. // The above copyright notice and this permission notice shall be included
  2272. // in all copies or substantial portions of the Software.
  2273. //
  2274. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2275. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2276. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2277. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  2278. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  2279. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  2280. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  2281. var R = typeof Reflect === 'object' ? Reflect : null
  2282. var ReflectApply = R && typeof R.apply === 'function'
  2283. ? R.apply
  2284. : function ReflectApply(target, receiver, args) {
  2285. return Function.prototype.apply.call(target, receiver, args);
  2286. }
  2287. var ReflectOwnKeys
  2288. if (R && typeof R.ownKeys === 'function') {
  2289. ReflectOwnKeys = R.ownKeys
  2290. } else if (Object.getOwnPropertySymbols) {
  2291. ReflectOwnKeys = function ReflectOwnKeys(target) {
  2292. return Object.getOwnPropertyNames(target)
  2293. .concat(Object.getOwnPropertySymbols(target));
  2294. };
  2295. } else {
  2296. ReflectOwnKeys = function ReflectOwnKeys(target) {
  2297. return Object.getOwnPropertyNames(target);
  2298. };
  2299. }
  2300. function ProcessEmitWarning(warning) {
  2301. if (console && console.warn) console.warn(warning);
  2302. }
  2303. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  2304. return value !== value;
  2305. }
  2306. function EventEmitter() {
  2307. EventEmitter.init.call(this);
  2308. }
  2309. module.exports = EventEmitter;
  2310. module.exports.once = once;
  2311. // Backwards-compat with node 0.10.x
  2312. EventEmitter.EventEmitter = EventEmitter;
  2313. EventEmitter.prototype._events = undefined;
  2314. EventEmitter.prototype._eventsCount = 0;
  2315. EventEmitter.prototype._maxListeners = undefined;
  2316. // By default EventEmitters will print a warning if more than 10 listeners are
  2317. // added to it. This is a useful default which helps finding memory leaks.
  2318. var defaultMaxListeners = 10;
  2319. function checkListener(listener) {
  2320. if (typeof listener !== 'function') {
  2321. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  2322. }
  2323. }
  2324. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  2325. enumerable: true,
  2326. get: function() {
  2327. return defaultMaxListeners;
  2328. },
  2329. set: function(arg) {
  2330. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  2331. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  2332. }
  2333. defaultMaxListeners = arg;
  2334. }
  2335. });
  2336. EventEmitter.init = function() {
  2337. if (this._events === undefined ||
  2338. this._events === Object.getPrototypeOf(this)._events) {
  2339. this._events = Object.create(null);
  2340. this._eventsCount = 0;
  2341. }
  2342. this._maxListeners = this._maxListeners || undefined;
  2343. };
  2344. // Obviously not all Emitters should be limited to 10. This function allows
  2345. // that to be increased. Set to zero for unlimited.
  2346. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  2347. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  2348. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  2349. }
  2350. this._maxListeners = n;
  2351. return this;
  2352. };
  2353. function _getMaxListeners(that) {
  2354. if (that._maxListeners === undefined)
  2355. return EventEmitter.defaultMaxListeners;
  2356. return that._maxListeners;
  2357. }
  2358. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  2359. return _getMaxListeners(this);
  2360. };
  2361. EventEmitter.prototype.emit = function emit(type) {
  2362. var args = [];
  2363. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  2364. var doError = (type === 'error');
  2365. var events = this._events;
  2366. if (events !== undefined)
  2367. doError = (doError && events.error === undefined);
  2368. else if (!doError)
  2369. return false;
  2370. // If there is no 'error' event listener then throw.
  2371. if (doError) {
  2372. var er;
  2373. if (args.length > 0)
  2374. er = args[0];
  2375. if (er instanceof Error) {
  2376. // Note: The comments on the `throw` lines are intentional, they show
  2377. // up in Node's output if this results in an unhandled exception.
  2378. throw er; // Unhandled 'error' event
  2379. }
  2380. // At least give some kind of context to the user
  2381. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  2382. err.context = er;
  2383. throw err; // Unhandled 'error' event
  2384. }
  2385. var handler = events[type];
  2386. if (handler === undefined)
  2387. return false;
  2388. if (typeof handler === 'function') {
  2389. ReflectApply(handler, this, args);
  2390. } else {
  2391. var len = handler.length;
  2392. var listeners = arrayClone(handler, len);
  2393. for (var i = 0; i < len; ++i)
  2394. ReflectApply(listeners[i], this, args);
  2395. }
  2396. return true;
  2397. };
  2398. function _addListener(target, type, listener, prepend) {
  2399. var m;
  2400. var events;
  2401. var existing;
  2402. checkListener(listener);
  2403. events = target._events;
  2404. if (events === undefined) {
  2405. events = target._events = Object.create(null);
  2406. target._eventsCount = 0;
  2407. } else {
  2408. // To avoid recursion in the case that type === "newListener"! Before
  2409. // adding it to the listeners, first emit "newListener".
  2410. if (events.newListener !== undefined) {
  2411. target.emit('newListener', type,
  2412. listener.listener ? listener.listener : listener);
  2413. // Re-assign `events` because a newListener handler could have caused the
  2414. // this._events to be assigned to a new object
  2415. events = target._events;
  2416. }
  2417. existing = events[type];
  2418. }
  2419. if (existing === undefined) {
  2420. // Optimize the case of one listener. Don't need the extra array object.
  2421. existing = events[type] = listener;
  2422. ++target._eventsCount;
  2423. } else {
  2424. if (typeof existing === 'function') {
  2425. // Adding the second element, need to change to array.
  2426. existing = events[type] =
  2427. prepend ? [listener, existing] : [existing, listener];
  2428. // If we've already got an array, just append.
  2429. } else if (prepend) {
  2430. existing.unshift(listener);
  2431. } else {
  2432. existing.push(listener);
  2433. }
  2434. // Check for listener leak
  2435. m = _getMaxListeners(target);
  2436. if (m > 0 && existing.length > m && !existing.warned) {
  2437. existing.warned = true;
  2438. // No error code for this since it is a Warning
  2439. // eslint-disable-next-line no-restricted-syntax
  2440. var w = new Error('Possible EventEmitter memory leak detected. ' +
  2441. existing.length + ' ' + String(type) + ' listeners ' +
  2442. 'added. Use emitter.setMaxListeners() to ' +
  2443. 'increase limit');
  2444. w.name = 'MaxListenersExceededWarning';
  2445. w.emitter = target;
  2446. w.type = type;
  2447. w.count = existing.length;
  2448. ProcessEmitWarning(w);
  2449. }
  2450. }
  2451. return target;
  2452. }
  2453. EventEmitter.prototype.addListener = function addListener(type, listener) {
  2454. return _addListener(this, type, listener, false);
  2455. };
  2456. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  2457. EventEmitter.prototype.prependListener =
  2458. function prependListener(type, listener) {
  2459. return _addListener(this, type, listener, true);
  2460. };
  2461. function onceWrapper() {
  2462. if (!this.fired) {
  2463. this.target.removeListener(this.type, this.wrapFn);
  2464. this.fired = true;
  2465. if (arguments.length === 0)
  2466. return this.listener.call(this.target);
  2467. return this.listener.apply(this.target, arguments);
  2468. }
  2469. }
  2470. function _onceWrap(target, type, listener) {
  2471. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  2472. var wrapped = onceWrapper.bind(state);
  2473. wrapped.listener = listener;
  2474. state.wrapFn = wrapped;
  2475. return wrapped;
  2476. }
  2477. EventEmitter.prototype.once = function once(type, listener) {
  2478. checkListener(listener);
  2479. this.on(type, _onceWrap(this, type, listener));
  2480. return this;
  2481. };
  2482. EventEmitter.prototype.prependOnceListener =
  2483. function prependOnceListener(type, listener) {
  2484. checkListener(listener);
  2485. this.prependListener(type, _onceWrap(this, type, listener));
  2486. return this;
  2487. };
  2488. // Emits a 'removeListener' event if and only if the listener was removed.
  2489. EventEmitter.prototype.removeListener =
  2490. function removeListener(type, listener) {
  2491. var list, events, position, i, originalListener;
  2492. checkListener(listener);
  2493. events = this._events;
  2494. if (events === undefined)
  2495. return this;
  2496. list = events[type];
  2497. if (list === undefined)
  2498. return this;
  2499. if (list === listener || list.listener === listener) {
  2500. if (--this._eventsCount === 0)
  2501. this._events = Object.create(null);
  2502. else {
  2503. delete events[type];
  2504. if (events.removeListener)
  2505. this.emit('removeListener', type, list.listener || listener);
  2506. }
  2507. } else if (typeof list !== 'function') {
  2508. position = -1;
  2509. for (i = list.length - 1; i >= 0; i--) {
  2510. if (list[i] === listener || list[i].listener === listener) {
  2511. originalListener = list[i].listener;
  2512. position = i;
  2513. break;
  2514. }
  2515. }
  2516. if (position < 0)
  2517. return this;
  2518. if (position === 0)
  2519. list.shift();
  2520. else {
  2521. spliceOne(list, position);
  2522. }
  2523. if (list.length === 1)
  2524. events[type] = list[0];
  2525. if (events.removeListener !== undefined)
  2526. this.emit('removeListener', type, originalListener || listener);
  2527. }
  2528. return this;
  2529. };
  2530. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  2531. EventEmitter.prototype.removeAllListeners =
  2532. function removeAllListeners(type) {
  2533. var listeners, events, i;
  2534. events = this._events;
  2535. if (events === undefined)
  2536. return this;
  2537. // not listening for removeListener, no need to emit
  2538. if (events.removeListener === undefined) {
  2539. if (arguments.length === 0) {
  2540. this._events = Object.create(null);
  2541. this._eventsCount = 0;
  2542. } else if (events[type] !== undefined) {
  2543. if (--this._eventsCount === 0)
  2544. this._events = Object.create(null);
  2545. else
  2546. delete events[type];
  2547. }
  2548. return this;
  2549. }
  2550. // emit removeListener for all listeners on all events
  2551. if (arguments.length === 0) {
  2552. var keys = Object.keys(events);
  2553. var key;
  2554. for (i = 0; i < keys.length; ++i) {
  2555. key = keys[i];
  2556. if (key === 'removeListener') continue;
  2557. this.removeAllListeners(key);
  2558. }
  2559. this.removeAllListeners('removeListener');
  2560. this._events = Object.create(null);
  2561. this._eventsCount = 0;
  2562. return this;
  2563. }
  2564. listeners = events[type];
  2565. if (typeof listeners === 'function') {
  2566. this.removeListener(type, listeners);
  2567. } else if (listeners !== undefined) {
  2568. // LIFO order
  2569. for (i = listeners.length - 1; i >= 0; i--) {
  2570. this.removeListener(type, listeners[i]);
  2571. }
  2572. }
  2573. return this;
  2574. };
  2575. function _listeners(target, type, unwrap) {
  2576. var events = target._events;
  2577. if (events === undefined)
  2578. return [];
  2579. var evlistener = events[type];
  2580. if (evlistener === undefined)
  2581. return [];
  2582. if (typeof evlistener === 'function')
  2583. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  2584. return unwrap ?
  2585. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  2586. }
  2587. EventEmitter.prototype.listeners = function listeners(type) {
  2588. return _listeners(this, type, true);
  2589. };
  2590. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  2591. return _listeners(this, type, false);
  2592. };
  2593. EventEmitter.listenerCount = function(emitter, type) {
  2594. if (typeof emitter.listenerCount === 'function') {
  2595. return emitter.listenerCount(type);
  2596. } else {
  2597. return listenerCount.call(emitter, type);
  2598. }
  2599. };
  2600. EventEmitter.prototype.listenerCount = listenerCount;
  2601. function listenerCount(type) {
  2602. var events = this._events;
  2603. if (events !== undefined) {
  2604. var evlistener = events[type];
  2605. if (typeof evlistener === 'function') {
  2606. return 1;
  2607. } else if (evlistener !== undefined) {
  2608. return evlistener.length;
  2609. }
  2610. }
  2611. return 0;
  2612. }
  2613. EventEmitter.prototype.eventNames = function eventNames() {
  2614. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  2615. };
  2616. function arrayClone(arr, n) {
  2617. var copy = new Array(n);
  2618. for (var i = 0; i < n; ++i)
  2619. copy[i] = arr[i];
  2620. return copy;
  2621. }
  2622. function spliceOne(list, index) {
  2623. for (; index + 1 < list.length; index++)
  2624. list[index] = list[index + 1];
  2625. list.pop();
  2626. }
  2627. function unwrapListeners(arr) {
  2628. var ret = new Array(arr.length);
  2629. for (var i = 0; i < ret.length; ++i) {
  2630. ret[i] = arr[i].listener || arr[i];
  2631. }
  2632. return ret;
  2633. }
  2634. function once(emitter, name) {
  2635. return new Promise(function (resolve, reject) {
  2636. function errorListener(err) {
  2637. emitter.removeListener(name, resolver);
  2638. reject(err);
  2639. }
  2640. function resolver() {
  2641. if (typeof emitter.removeListener === 'function') {
  2642. emitter.removeListener('error', errorListener);
  2643. }
  2644. resolve([].slice.call(arguments));
  2645. };
  2646. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  2647. if (name !== 'error') {
  2648. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  2649. }
  2650. });
  2651. }
  2652. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  2653. if (typeof emitter.on === 'function') {
  2654. eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  2655. }
  2656. }
  2657. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  2658. if (typeof emitter.on === 'function') {
  2659. if (flags.once) {
  2660. emitter.once(name, listener);
  2661. } else {
  2662. emitter.on(name, listener);
  2663. }
  2664. } else if (typeof emitter.addEventListener === 'function') {
  2665. // EventTarget does not have `error` event semantics like Node
  2666. // EventEmitters, we do not listen for `error` events here.
  2667. emitter.addEventListener(name, function wrapListener(arg) {
  2668. // IE does not have builtin `{ once: true }` support so we
  2669. // have to do it manually.
  2670. if (flags.once) {
  2671. emitter.removeEventListener(name, wrapListener);
  2672. }
  2673. listener(arg);
  2674. });
  2675. } else {
  2676. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  2677. }
  2678. }
  2679. /***/ }),
  2680. /***/ "../../node_modules/path-browserify/index.js":
  2681. /*!***************************************************!*\
  2682. !*** ../../node_modules/path-browserify/index.js ***!
  2683. \***************************************************/
  2684. /***/ ((module) => {
  2685. // 'path' module extracted from Node.js v8.11.1 (only the posix part)
  2686. // transplited with Babel
  2687. // Copyright Joyent, Inc. and other Node contributors.
  2688. //
  2689. // Permission is hereby granted, free of charge, to any person obtaining a
  2690. // copy of this software and associated documentation files (the
  2691. // "Software"), to deal in the Software without restriction, including
  2692. // without limitation the rights to use, copy, modify, merge, publish,
  2693. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2694. // persons to whom the Software is furnished to do so, subject to the
  2695. // following conditions:
  2696. //
  2697. // The above copyright notice and this permission notice shall be included
  2698. // in all copies or substantial portions of the Software.
  2699. //
  2700. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2701. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2702. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2703. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  2704. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  2705. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  2706. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  2707. function assertPath(path) {
  2708. if (typeof path !== 'string') {
  2709. throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
  2710. }
  2711. }
  2712. // Resolves . and .. elements in a path with directory names
  2713. function normalizeStringPosix(path, allowAboveRoot) {
  2714. var res = '';
  2715. var lastSegmentLength = 0;
  2716. var lastSlash = -1;
  2717. var dots = 0;
  2718. var code;
  2719. for (var i = 0; i <= path.length; ++i) {
  2720. if (i < path.length)
  2721. code = path.charCodeAt(i);
  2722. else if (code === 47 /*/*/)
  2723. break;
  2724. else
  2725. code = 47 /*/*/;
  2726. if (code === 47 /*/*/) {
  2727. if (lastSlash === i - 1 || dots === 1) {
  2728. // NOOP
  2729. } else if (lastSlash !== i - 1 && dots === 2) {
  2730. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
  2731. if (res.length > 2) {
  2732. var lastSlashIndex = res.lastIndexOf('/');
  2733. if (lastSlashIndex !== res.length - 1) {
  2734. if (lastSlashIndex === -1) {
  2735. res = '';
  2736. lastSegmentLength = 0;
  2737. } else {
  2738. res = res.slice(0, lastSlashIndex);
  2739. lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
  2740. }
  2741. lastSlash = i;
  2742. dots = 0;
  2743. continue;
  2744. }
  2745. } else if (res.length === 2 || res.length === 1) {
  2746. res = '';
  2747. lastSegmentLength = 0;
  2748. lastSlash = i;
  2749. dots = 0;
  2750. continue;
  2751. }
  2752. }
  2753. if (allowAboveRoot) {
  2754. if (res.length > 0)
  2755. res += '/..';
  2756. else
  2757. res = '..';
  2758. lastSegmentLength = 2;
  2759. }
  2760. } else {
  2761. if (res.length > 0)
  2762. res += '/' + path.slice(lastSlash + 1, i);
  2763. else
  2764. res = path.slice(lastSlash + 1, i);
  2765. lastSegmentLength = i - lastSlash - 1;
  2766. }
  2767. lastSlash = i;
  2768. dots = 0;
  2769. } else if (code === 46 /*.*/ && dots !== -1) {
  2770. ++dots;
  2771. } else {
  2772. dots = -1;
  2773. }
  2774. }
  2775. return res;
  2776. }
  2777. function _format(sep, pathObject) {
  2778. var dir = pathObject.dir || pathObject.root;
  2779. var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
  2780. if (!dir) {
  2781. return base;
  2782. }
  2783. if (dir === pathObject.root) {
  2784. return dir + base;
  2785. }
  2786. return dir + sep + base;
  2787. }
  2788. var posix = {
  2789. // path.resolve([from ...], to)
  2790. resolve: function resolve() {
  2791. var resolvedPath = '';
  2792. var resolvedAbsolute = false;
  2793. var cwd;
  2794. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  2795. var path;
  2796. if (i >= 0)
  2797. path = arguments[i];
  2798. else {
  2799. if (cwd === undefined)
  2800. cwd = process.cwd();
  2801. path = cwd;
  2802. }
  2803. assertPath(path);
  2804. // Skip empty entries
  2805. if (path.length === 0) {
  2806. continue;
  2807. }
  2808. resolvedPath = path + '/' + resolvedPath;
  2809. resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
  2810. }
  2811. // At this point the path should be resolved to a full absolute path, but
  2812. // handle relative paths to be safe (might happen when process.cwd() fails)
  2813. // Normalize the path
  2814. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  2815. if (resolvedAbsolute) {
  2816. if (resolvedPath.length > 0)
  2817. return '/' + resolvedPath;
  2818. else
  2819. return '/';
  2820. } else if (resolvedPath.length > 0) {
  2821. return resolvedPath;
  2822. } else {
  2823. return '.';
  2824. }
  2825. },
  2826. normalize: function normalize(path) {
  2827. assertPath(path);
  2828. if (path.length === 0) return '.';
  2829. var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
  2830. var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
  2831. // Normalize the path
  2832. path = normalizeStringPosix(path, !isAbsolute);
  2833. if (path.length === 0 && !isAbsolute) path = '.';
  2834. if (path.length > 0 && trailingSeparator) path += '/';
  2835. if (isAbsolute) return '/' + path;
  2836. return path;
  2837. },
  2838. isAbsolute: function isAbsolute(path) {
  2839. assertPath(path);
  2840. return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
  2841. },
  2842. join: function join() {
  2843. if (arguments.length === 0)
  2844. return '.';
  2845. var joined;
  2846. for (var i = 0; i < arguments.length; ++i) {
  2847. var arg = arguments[i];
  2848. assertPath(arg);
  2849. if (arg.length > 0) {
  2850. if (joined === undefined)
  2851. joined = arg;
  2852. else
  2853. joined += '/' + arg;
  2854. }
  2855. }
  2856. if (joined === undefined)
  2857. return '.';
  2858. return posix.normalize(joined);
  2859. },
  2860. relative: function relative(from, to) {
  2861. assertPath(from);
  2862. assertPath(to);
  2863. if (from === to) return '';
  2864. from = posix.resolve(from);
  2865. to = posix.resolve(to);
  2866. if (from === to) return '';
  2867. // Trim any leading backslashes
  2868. var fromStart = 1;
  2869. for (; fromStart < from.length; ++fromStart) {
  2870. if (from.charCodeAt(fromStart) !== 47 /*/*/)
  2871. break;
  2872. }
  2873. var fromEnd = from.length;
  2874. var fromLen = fromEnd - fromStart;
  2875. // Trim any leading backslashes
  2876. var toStart = 1;
  2877. for (; toStart < to.length; ++toStart) {
  2878. if (to.charCodeAt(toStart) !== 47 /*/*/)
  2879. break;
  2880. }
  2881. var toEnd = to.length;
  2882. var toLen = toEnd - toStart;
  2883. // Compare paths to find the longest common path from root
  2884. var length = fromLen < toLen ? fromLen : toLen;
  2885. var lastCommonSep = -1;
  2886. var i = 0;
  2887. for (; i <= length; ++i) {
  2888. if (i === length) {
  2889. if (toLen > length) {
  2890. if (to.charCodeAt(toStart + i) === 47 /*/*/) {
  2891. // We get here if `from` is the exact base path for `to`.
  2892. // For example: from='/foo/bar'; to='/foo/bar/baz'
  2893. return to.slice(toStart + i + 1);
  2894. } else if (i === 0) {
  2895. // We get here if `from` is the root
  2896. // For example: from='/'; to='/foo'
  2897. return to.slice(toStart + i);
  2898. }
  2899. } else if (fromLen > length) {
  2900. if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
  2901. // We get here if `to` is the exact base path for `from`.
  2902. // For example: from='/foo/bar/baz'; to='/foo/bar'
  2903. lastCommonSep = i;
  2904. } else if (i === 0) {
  2905. // We get here if `to` is the root.
  2906. // For example: from='/foo'; to='/'
  2907. lastCommonSep = 0;
  2908. }
  2909. }
  2910. break;
  2911. }
  2912. var fromCode = from.charCodeAt(fromStart + i);
  2913. var toCode = to.charCodeAt(toStart + i);
  2914. if (fromCode !== toCode)
  2915. break;
  2916. else if (fromCode === 47 /*/*/)
  2917. lastCommonSep = i;
  2918. }
  2919. var out = '';
  2920. // Generate the relative path based on the path difference between `to`
  2921. // and `from`
  2922. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  2923. if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
  2924. if (out.length === 0)
  2925. out += '..';
  2926. else
  2927. out += '/..';
  2928. }
  2929. }
  2930. // Lastly, append the rest of the destination (`to`) path that comes after
  2931. // the common path parts
  2932. if (out.length > 0)
  2933. return out + to.slice(toStart + lastCommonSep);
  2934. else {
  2935. toStart += lastCommonSep;
  2936. if (to.charCodeAt(toStart) === 47 /*/*/)
  2937. ++toStart;
  2938. return to.slice(toStart);
  2939. }
  2940. },
  2941. _makeLong: function _makeLong(path) {
  2942. return path;
  2943. },
  2944. dirname: function dirname(path) {
  2945. assertPath(path);
  2946. if (path.length === 0) return '.';
  2947. var code = path.charCodeAt(0);
  2948. var hasRoot = code === 47 /*/*/;
  2949. var end = -1;
  2950. var matchedSlash = true;
  2951. for (var i = path.length - 1; i >= 1; --i) {
  2952. code = path.charCodeAt(i);
  2953. if (code === 47 /*/*/) {
  2954. if (!matchedSlash) {
  2955. end = i;
  2956. break;
  2957. }
  2958. } else {
  2959. // We saw the first non-path separator
  2960. matchedSlash = false;
  2961. }
  2962. }
  2963. if (end === -1) return hasRoot ? '/' : '.';
  2964. if (hasRoot && end === 1) return '//';
  2965. return path.slice(0, end);
  2966. },
  2967. basename: function basename(path, ext) {
  2968. if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
  2969. assertPath(path);
  2970. var start = 0;
  2971. var end = -1;
  2972. var matchedSlash = true;
  2973. var i;
  2974. if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
  2975. if (ext.length === path.length && ext === path) return '';
  2976. var extIdx = ext.length - 1;
  2977. var firstNonSlashEnd = -1;
  2978. for (i = path.length - 1; i >= 0; --i) {
  2979. var code = path.charCodeAt(i);
  2980. if (code === 47 /*/*/) {
  2981. // If we reached a path separator that was not part of a set of path
  2982. // separators at the end of the string, stop now
  2983. if (!matchedSlash) {
  2984. start = i + 1;
  2985. break;
  2986. }
  2987. } else {
  2988. if (firstNonSlashEnd === -1) {
  2989. // We saw the first non-path separator, remember this index in case
  2990. // we need it if the extension ends up not matching
  2991. matchedSlash = false;
  2992. firstNonSlashEnd = i + 1;
  2993. }
  2994. if (extIdx >= 0) {
  2995. // Try to match the explicit extension
  2996. if (code === ext.charCodeAt(extIdx)) {
  2997. if (--extIdx === -1) {
  2998. // We matched the extension, so mark this as the end of our path
  2999. // component
  3000. end = i;
  3001. }
  3002. } else {
  3003. // Extension does not match, so our result is the entire path
  3004. // component
  3005. extIdx = -1;
  3006. end = firstNonSlashEnd;
  3007. }
  3008. }
  3009. }
  3010. }
  3011. if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
  3012. return path.slice(start, end);
  3013. } else {
  3014. for (i = path.length - 1; i >= 0; --i) {
  3015. if (path.charCodeAt(i) === 47 /*/*/) {
  3016. // If we reached a path separator that was not part of a set of path
  3017. // separators at the end of the string, stop now
  3018. if (!matchedSlash) {
  3019. start = i + 1;
  3020. break;
  3021. }
  3022. } else if (end === -1) {
  3023. // We saw the first non-path separator, mark this as the end of our
  3024. // path component
  3025. matchedSlash = false;
  3026. end = i + 1;
  3027. }
  3028. }
  3029. if (end === -1) return '';
  3030. return path.slice(start, end);
  3031. }
  3032. },
  3033. extname: function extname(path) {
  3034. assertPath(path);
  3035. var startDot = -1;
  3036. var startPart = 0;
  3037. var end = -1;
  3038. var matchedSlash = true;
  3039. // Track the state of characters (if any) we see before our first dot and
  3040. // after any path separator we find
  3041. var preDotState = 0;
  3042. for (var i = path.length - 1; i >= 0; --i) {
  3043. var code = path.charCodeAt(i);
  3044. if (code === 47 /*/*/) {
  3045. // If we reached a path separator that was not part of a set of path
  3046. // separators at the end of the string, stop now
  3047. if (!matchedSlash) {
  3048. startPart = i + 1;
  3049. break;
  3050. }
  3051. continue;
  3052. }
  3053. if (end === -1) {
  3054. // We saw the first non-path separator, mark this as the end of our
  3055. // extension
  3056. matchedSlash = false;
  3057. end = i + 1;
  3058. }
  3059. if (code === 46 /*.*/) {
  3060. // If this is our first dot, mark it as the start of our extension
  3061. if (startDot === -1)
  3062. startDot = i;
  3063. else if (preDotState !== 1)
  3064. preDotState = 1;
  3065. } else if (startDot !== -1) {
  3066. // We saw a non-dot and non-path separator before our dot, so we should
  3067. // have a good chance at having a non-empty extension
  3068. preDotState = -1;
  3069. }
  3070. }
  3071. if (startDot === -1 || end === -1 ||
  3072. // We saw a non-dot character immediately before the dot
  3073. preDotState === 0 ||
  3074. // The (right-most) trimmed path component is exactly '..'
  3075. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3076. return '';
  3077. }
  3078. return path.slice(startDot, end);
  3079. },
  3080. format: function format(pathObject) {
  3081. if (pathObject === null || typeof pathObject !== 'object') {
  3082. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  3083. }
  3084. return _format('/', pathObject);
  3085. },
  3086. parse: function parse(path) {
  3087. assertPath(path);
  3088. var ret = { root: '', dir: '', base: '', ext: '', name: '' };
  3089. if (path.length === 0) return ret;
  3090. var code = path.charCodeAt(0);
  3091. var isAbsolute = code === 47 /*/*/;
  3092. var start;
  3093. if (isAbsolute) {
  3094. ret.root = '/';
  3095. start = 1;
  3096. } else {
  3097. start = 0;
  3098. }
  3099. var startDot = -1;
  3100. var startPart = 0;
  3101. var end = -1;
  3102. var matchedSlash = true;
  3103. var i = path.length - 1;
  3104. // Track the state of characters (if any) we see before our first dot and
  3105. // after any path separator we find
  3106. var preDotState = 0;
  3107. // Get non-dir info
  3108. for (; i >= start; --i) {
  3109. code = path.charCodeAt(i);
  3110. if (code === 47 /*/*/) {
  3111. // If we reached a path separator that was not part of a set of path
  3112. // separators at the end of the string, stop now
  3113. if (!matchedSlash) {
  3114. startPart = i + 1;
  3115. break;
  3116. }
  3117. continue;
  3118. }
  3119. if (end === -1) {
  3120. // We saw the first non-path separator, mark this as the end of our
  3121. // extension
  3122. matchedSlash = false;
  3123. end = i + 1;
  3124. }
  3125. if (code === 46 /*.*/) {
  3126. // If this is our first dot, mark it as the start of our extension
  3127. if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
  3128. } else if (startDot !== -1) {
  3129. // We saw a non-dot and non-path separator before our dot, so we should
  3130. // have a good chance at having a non-empty extension
  3131. preDotState = -1;
  3132. }
  3133. }
  3134. if (startDot === -1 || end === -1 ||
  3135. // We saw a non-dot character immediately before the dot
  3136. preDotState === 0 ||
  3137. // The (right-most) trimmed path component is exactly '..'
  3138. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3139. if (end !== -1) {
  3140. if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
  3141. }
  3142. } else {
  3143. if (startPart === 0 && isAbsolute) {
  3144. ret.name = path.slice(1, startDot);
  3145. ret.base = path.slice(1, end);
  3146. } else {
  3147. ret.name = path.slice(startPart, startDot);
  3148. ret.base = path.slice(startPart, end);
  3149. }
  3150. ret.ext = path.slice(startDot, end);
  3151. }
  3152. if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
  3153. return ret;
  3154. },
  3155. sep: '/',
  3156. delimiter: ':',
  3157. win32: null,
  3158. posix: null
  3159. };
  3160. posix.posix = posix;
  3161. module.exports = posix;
  3162. /***/ })
  3163. /******/ });
  3164. /************************************************************************/
  3165. /******/ // The module cache
  3166. /******/ var __webpack_module_cache__ = {};
  3167. /******/
  3168. /******/ // The require function
  3169. /******/ function __webpack_require__(moduleId) {
  3170. /******/ // Check if module is in cache
  3171. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  3172. /******/ if (cachedModule !== undefined) {
  3173. /******/ return cachedModule.exports;
  3174. /******/ }
  3175. /******/ // Create a new module (and put it into the cache)
  3176. /******/ var module = __webpack_module_cache__[moduleId] = {
  3177. /******/ // no module.id needed
  3178. /******/ // no module.loaded needed
  3179. /******/ exports: {}
  3180. /******/ };
  3181. /******/
  3182. /******/ // Execute the module function
  3183. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  3184. /******/
  3185. /******/ // Return the exports of the module
  3186. /******/ return module.exports;
  3187. /******/ }
  3188. /******/
  3189. /************************************************************************/
  3190. /******/ /* webpack/runtime/compat get default export */
  3191. /******/ (() => {
  3192. /******/ // getDefaultExport function for compatibility with non-harmony modules
  3193. /******/ __webpack_require__.n = (module) => {
  3194. /******/ var getter = module && module.__esModule ?
  3195. /******/ () => (module['default']) :
  3196. /******/ () => (module);
  3197. /******/ __webpack_require__.d(getter, { a: getter });
  3198. /******/ return getter;
  3199. /******/ };
  3200. /******/ })();
  3201. /******/
  3202. /******/ /* webpack/runtime/define property getters */
  3203. /******/ (() => {
  3204. /******/ // define getter functions for harmony exports
  3205. /******/ __webpack_require__.d = (exports, definition) => {
  3206. /******/ for(var key in definition) {
  3207. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  3208. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  3209. /******/ }
  3210. /******/ }
  3211. /******/ };
  3212. /******/ })();
  3213. /******/
  3214. /******/ /* webpack/runtime/global */
  3215. /******/ (() => {
  3216. /******/ __webpack_require__.g = (function() {
  3217. /******/ if (typeof globalThis === 'object') return globalThis;
  3218. /******/ try {
  3219. /******/ return this || new Function('return this')();
  3220. /******/ } catch (e) {
  3221. /******/ if (typeof window === 'object') return window;
  3222. /******/ }
  3223. /******/ })();
  3224. /******/ })();
  3225. /******/
  3226. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  3227. /******/ (() => {
  3228. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  3229. /******/ })();
  3230. /******/
  3231. /******/ /* webpack/runtime/make namespace object */
  3232. /******/ (() => {
  3233. /******/ // define __esModule on exports
  3234. /******/ __webpack_require__.r = (exports) => {
  3235. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  3236. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  3237. /******/ }
  3238. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  3239. /******/ };
  3240. /******/ })();
  3241. /******/
  3242. /************************************************************************/
  3243. var __webpack_exports__ = {};
  3244. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  3245. (() => {
  3246. /*!*********************!*\
  3247. !*** ./src/hook.ts ***!
  3248. \*********************/
  3249. __webpack_require__.r(__webpack_exports__);
  3250. /* harmony import */ var _back_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @back/hook */ "../app-backend-core/lib/hook.js");
  3251. /* harmony import */ var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue-devtools/shared-utils */ "../shared-utils/lib/index.js");
  3252. /* harmony import */ var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__);
  3253. (0,_back_hook__WEBPACK_IMPORTED_MODULE_0__.installHook)(_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target);
  3254. })();
  3255. /******/ })()
  3256. ;