app.js 462 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521
  1. function getTarget() {
  2. if (typeof window !== "undefined") {
  3. return window;
  4. }
  5. if (typeof globalThis !== "undefined") {
  6. return globalThis;
  7. }
  8. if (typeof global !== "undefined") {
  9. return global;
  10. }
  11. if (typeof my !== "undefined") {
  12. return my;
  13. }
  14. }
  15. class Socket {
  16. constructor(host) {
  17. this.sid = "";
  18. this.ackTimeout = 5e3;
  19. this.closed = false;
  20. this._ackTimer = 0;
  21. this._onCallbacks = {};
  22. this.host = host;
  23. setTimeout(() => {
  24. this.connect();
  25. }, 50);
  26. }
  27. connect() {
  28. this._socket = uni.connectSocket({
  29. url: `ws://${this.host}/socket.io/?EIO=4&transport=websocket`,
  30. multiple: true,
  31. complete(res) {
  32. }
  33. });
  34. this._socket.onOpen((res) => {
  35. });
  36. this._socket.onMessage(({ data }) => {
  37. if (typeof my !== "undefined") {
  38. data = data.data;
  39. }
  40. if (typeof data !== "string") {
  41. return;
  42. }
  43. if (data[0] === "0") {
  44. this._send("40");
  45. const res = JSON.parse(data.slice(1));
  46. this.sid = res.sid;
  47. } else if (data[0] + data[1] === "40") {
  48. this.sid = JSON.parse(data.slice(2)).sid;
  49. this._trigger("connect");
  50. } else if (data === "3") {
  51. this._send("2");
  52. } else if (data === "2") {
  53. this._send("3");
  54. } else {
  55. const match = /\[.*\]/.exec(data);
  56. if (!match)
  57. return;
  58. try {
  59. const [event, args] = JSON.parse(match[0]);
  60. this._trigger(event, args);
  61. } catch (err) {
  62. console.error("Vue DevTools onMessage: ", err);
  63. }
  64. }
  65. });
  66. this._socket.onClose((res) => {
  67. this.closed = true;
  68. this._trigger("disconnect", res);
  69. });
  70. this._socket.onError((res) => {
  71. console.error(res.errMsg);
  72. });
  73. }
  74. on(event, callback) {
  75. (this._onCallbacks[event] || (this._onCallbacks[event] = [])).push(callback);
  76. }
  77. emit(event, data) {
  78. if (this.closed) {
  79. return;
  80. }
  81. this._heartbeat();
  82. this._send(`42${JSON.stringify(typeof data !== "undefined" ? [event, data] : [event])}`);
  83. }
  84. disconnect() {
  85. clearTimeout(this._ackTimer);
  86. if (this._socket && !this.closed) {
  87. this._send("41");
  88. this._socket.close({});
  89. }
  90. }
  91. _heartbeat() {
  92. clearTimeout(this._ackTimer);
  93. this._ackTimer = setTimeout(() => {
  94. this._socket && this._socket.send({ data: "3" });
  95. }, this.ackTimeout);
  96. }
  97. _send(data) {
  98. this._socket && this._socket.send({ data });
  99. }
  100. _trigger(event, args) {
  101. const callbacks = this._onCallbacks[event];
  102. if (callbacks) {
  103. callbacks.forEach((callback) => {
  104. callback(args);
  105. });
  106. }
  107. }
  108. }
  109. let socketReadyCallback;
  110. getTarget().__VUE_DEVTOOLS_ON_SOCKET_READY__ = (callback) => {
  111. socketReadyCallback = callback;
  112. };
  113. let targetHost = "";
  114. const hosts = "".split(",");
  115. setTimeout(() => {
  116. uni.request({
  117. url: `http://${"localhost"}:${__VUE_DEVTOOLS_TEST_PORT__}`,
  118. timeout: 1e3,
  119. success() {
  120. targetHost = "localhost";
  121. initSocket();
  122. },
  123. fail() {
  124. if (!targetHost && hosts.length) {
  125. hosts.forEach((host) => {
  126. uni.request({
  127. url: `http://${host}:${__VUE_DEVTOOLS_TEST_PORT__}`,
  128. timeout: 1e3,
  129. success() {
  130. if (!targetHost) {
  131. targetHost = host;
  132. initSocket();
  133. }
  134. }
  135. });
  136. });
  137. }
  138. }
  139. });
  140. }, 0);
  141. throwConnectionError();
  142. function throwConnectionError() {
  143. setTimeout(() => {
  144. if (!targetHost) {
  145. throw new Error("未能获取局域网地址,本地调试服务不可用");
  146. }
  147. }, (hosts.length + 1) * 1100);
  148. }
  149. function initSocket() {
  150. getTarget().__VUE_DEVTOOLS_SOCKET__ = new Socket(targetHost + ":8098");
  151. socketReadyCallback();
  152. }
  153. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  154. (function() {
  155. var __webpack_modules__ = {
  156. /***/
  157. "../app-backend-core/lib/hook.js": (
  158. /*!***************************************!*\
  159. !*** ../app-backend-core/lib/hook.js ***!
  160. \***************************************/
  161. /***/
  162. (__unused_webpack_module, exports, __webpack_require__2) => {
  163. Object.defineProperty(exports, "__esModule", {
  164. value: true
  165. });
  166. exports.installHook = void 0;
  167. function installHook(target, isIframe = false) {
  168. const devtoolsVersion = "6.0";
  169. let listeners = {};
  170. function injectIframeHook(iframe) {
  171. if (iframe.__vdevtools__injected)
  172. return;
  173. try {
  174. iframe.__vdevtools__injected = true;
  175. const inject = () => {
  176. try {
  177. iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
  178. const script = iframe.contentDocument.createElement("script");
  179. script.textContent = ";(" + installHook.toString() + ")(window, true)";
  180. iframe.contentDocument.documentElement.appendChild(script);
  181. script.parentNode.removeChild(script);
  182. } catch (e) {
  183. }
  184. };
  185. inject();
  186. iframe.addEventListener("load", () => inject());
  187. } catch (e) {
  188. }
  189. }
  190. let iframeChecks = 0;
  191. function injectToIframes() {
  192. if (typeof window === "undefined")
  193. return;
  194. const iframes = document.querySelectorAll("iframe:not([data-vue-devtools-ignore])");
  195. for (const iframe of iframes) {
  196. injectIframeHook(iframe);
  197. }
  198. }
  199. injectToIframes();
  200. const iframeTimer = setInterval(() => {
  201. injectToIframes();
  202. iframeChecks++;
  203. if (iframeChecks >= 5) {
  204. clearInterval(iframeTimer);
  205. }
  206. }, 1e3);
  207. if (Object.prototype.hasOwnProperty.call(target, "__VUE_DEVTOOLS_GLOBAL_HOOK__")) {
  208. if (target.__VUE_DEVTOOLS_GLOBAL_HOOK__.devtoolsVersion !== devtoolsVersion) {
  209. console.error(`Another version of Vue Devtools seems to be installed. Please enable only one version at a time.`);
  210. }
  211. return;
  212. }
  213. let hook;
  214. if (isIframe) {
  215. const sendToParent = (cb) => {
  216. try {
  217. const hook2 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  218. if (hook2) {
  219. return cb(hook2);
  220. } else {
  221. console.warn("[Vue Devtools] No hook in parent window");
  222. }
  223. } catch (e) {
  224. console.warn("[Vue Devtools] Failed to send message to parent window", e);
  225. }
  226. };
  227. hook = {
  228. devtoolsVersion,
  229. // eslint-disable-next-line accessor-pairs
  230. set Vue(value) {
  231. sendToParent((hook2) => {
  232. hook2.Vue = value;
  233. });
  234. },
  235. // eslint-disable-next-line accessor-pairs
  236. set enabled(value) {
  237. sendToParent((hook2) => {
  238. hook2.enabled = value;
  239. });
  240. },
  241. on(event, fn) {
  242. sendToParent((hook2) => hook2.on(event, fn));
  243. },
  244. once(event, fn) {
  245. sendToParent((hook2) => hook2.once(event, fn));
  246. },
  247. off(event, fn) {
  248. sendToParent((hook2) => hook2.off(event, fn));
  249. },
  250. emit(event, ...args) {
  251. sendToParent((hook2) => hook2.emit(event, ...args));
  252. },
  253. cleanupBuffer(matchArg) {
  254. var _a;
  255. return (_a = sendToParent((hook2) => hook2.cleanupBuffer(matchArg))) !== null && _a !== void 0 ? _a : false;
  256. }
  257. };
  258. } else {
  259. hook = {
  260. devtoolsVersion,
  261. Vue: null,
  262. enabled: void 0,
  263. _buffer: [],
  264. store: null,
  265. initialState: null,
  266. storeModules: null,
  267. flushStoreModules: null,
  268. apps: [],
  269. _replayBuffer(event) {
  270. const buffer = this._buffer;
  271. this._buffer = [];
  272. for (let i = 0, l = buffer.length; i < l; i++) {
  273. const allArgs = buffer[i];
  274. allArgs[0] === event ? this.emit.apply(this, allArgs) : this._buffer.push(allArgs);
  275. }
  276. },
  277. on(event, fn) {
  278. const $event = "$" + event;
  279. if (listeners[$event]) {
  280. listeners[$event].push(fn);
  281. } else {
  282. listeners[$event] = [fn];
  283. this._replayBuffer(event);
  284. }
  285. },
  286. once(event, fn) {
  287. const on = (...args) => {
  288. this.off(event, on);
  289. return fn.apply(this, args);
  290. };
  291. this.on(event, on);
  292. },
  293. off(event, fn) {
  294. event = "$" + event;
  295. if (!arguments.length) {
  296. listeners = {};
  297. } else {
  298. const cbs = listeners[event];
  299. if (cbs) {
  300. if (!fn) {
  301. listeners[event] = null;
  302. } else {
  303. for (let i = 0, l = cbs.length; i < l; i++) {
  304. const cb = cbs[i];
  305. if (cb === fn || cb.fn === fn) {
  306. cbs.splice(i, 1);
  307. break;
  308. }
  309. }
  310. }
  311. }
  312. }
  313. },
  314. emit(event, ...args) {
  315. const $event = "$" + event;
  316. let cbs = listeners[$event];
  317. if (cbs) {
  318. cbs = cbs.slice();
  319. for (let i = 0, l = cbs.length; i < l; i++) {
  320. try {
  321. const result = cbs[i].apply(this, args);
  322. if (typeof (result === null || result === void 0 ? void 0 : result.catch) === "function") {
  323. result.catch((e) => {
  324. console.error(`[Hook] Error in async event handler for ${event} with args:`, args);
  325. console.error(e);
  326. });
  327. }
  328. } catch (e) {
  329. console.error(`[Hook] Error in event handler for ${event} with args:`, args);
  330. console.error(e);
  331. }
  332. }
  333. } else {
  334. this._buffer.push([event, ...args]);
  335. }
  336. },
  337. /**
  338. * Remove buffered events with any argument that is equal to the given value.
  339. * @param matchArg Given value to match.
  340. */
  341. cleanupBuffer(matchArg) {
  342. let wasBuffered = false;
  343. this._buffer = this._buffer.filter((item) => {
  344. if (item.some((arg) => arg === matchArg)) {
  345. wasBuffered = true;
  346. return false;
  347. }
  348. return true;
  349. });
  350. return wasBuffered;
  351. }
  352. };
  353. hook.once("init", (Vue) => {
  354. hook.Vue = Vue;
  355. if (Vue) {
  356. Vue.prototype.$inspect = function() {
  357. const fn = target.__VUE_DEVTOOLS_INSPECT__;
  358. fn && fn(this);
  359. };
  360. }
  361. });
  362. hook.on("app:init", (app, version, types) => {
  363. const appRecord = {
  364. app,
  365. version,
  366. types
  367. };
  368. hook.apps.push(appRecord);
  369. hook.emit("app:add", appRecord);
  370. });
  371. hook.once("vuex:init", (store) => {
  372. hook.store = store;
  373. hook.initialState = clone(store.state);
  374. const origReplaceState = store.replaceState.bind(store);
  375. store.replaceState = (state) => {
  376. hook.initialState = clone(state);
  377. origReplaceState(state);
  378. };
  379. let origRegister, origUnregister;
  380. if (store.registerModule) {
  381. hook.storeModules = [];
  382. origRegister = store.registerModule.bind(store);
  383. store.registerModule = (path, module, options) => {
  384. if (typeof path === "string")
  385. path = [path];
  386. hook.storeModules.push({
  387. path,
  388. module,
  389. options
  390. });
  391. origRegister(path, module, options);
  392. {
  393. console.log("early register module", path, module, options);
  394. }
  395. };
  396. origUnregister = store.unregisterModule.bind(store);
  397. store.unregisterModule = (path) => {
  398. if (typeof path === "string")
  399. path = [path];
  400. const key = path.join("/");
  401. const index = hook.storeModules.findIndex((m) => m.path.join("/") === key);
  402. if (index !== -1)
  403. hook.storeModules.splice(index, 1);
  404. origUnregister(path);
  405. {
  406. console.log("early unregister module", path);
  407. }
  408. };
  409. }
  410. hook.flushStoreModules = () => {
  411. store.replaceState = origReplaceState;
  412. if (store.registerModule) {
  413. store.registerModule = origRegister;
  414. store.unregisterModule = origUnregister;
  415. }
  416. return hook.storeModules || [];
  417. };
  418. });
  419. }
  420. {
  421. uni.syncDataToGlobal({
  422. __VUE_DEVTOOLS_GLOBAL_HOOK__: hook
  423. });
  424. }
  425. Object.defineProperty(target, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
  426. get() {
  427. return hook;
  428. }
  429. });
  430. if (target.__VUE_DEVTOOLS_HOOK_REPLAY__) {
  431. try {
  432. target.__VUE_DEVTOOLS_HOOK_REPLAY__.forEach((cb) => cb(hook));
  433. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = [];
  434. } catch (e) {
  435. console.error("[vue-devtools] Error during hook replay", e);
  436. }
  437. }
  438. const {
  439. toString: toStringFunction
  440. } = Function.prototype;
  441. const {
  442. create,
  443. defineProperty,
  444. getOwnPropertyDescriptor,
  445. getOwnPropertyNames,
  446. getOwnPropertySymbols,
  447. getPrototypeOf
  448. } = Object;
  449. const {
  450. hasOwnProperty,
  451. propertyIsEnumerable
  452. } = Object.prototype;
  453. const SUPPORTS = {
  454. SYMBOL_PROPERTIES: typeof getOwnPropertySymbols === "function",
  455. WEAKSET: typeof WeakSet === "function"
  456. };
  457. const createCache = () => {
  458. if (SUPPORTS.WEAKSET) {
  459. return /* @__PURE__ */ new WeakSet();
  460. }
  461. const object = create({
  462. add: (value) => object._values.push(value),
  463. has: (value) => !!~object._values.indexOf(value)
  464. });
  465. object._values = [];
  466. return object;
  467. };
  468. const getCleanClone = (object, realm) => {
  469. if (!object.constructor) {
  470. return create(null);
  471. }
  472. const prototype = object.__proto__ || getPrototypeOf(object);
  473. if (object.constructor === realm.Object) {
  474. return prototype === realm.Object.prototype ? {} : create(prototype);
  475. }
  476. if (~toStringFunction.call(object.constructor).indexOf("[native code]")) {
  477. try {
  478. return new object.constructor();
  479. } catch (e) {
  480. }
  481. }
  482. return create(prototype);
  483. };
  484. const getObjectCloneLoose = (object, realm, handleCopy, cache) => {
  485. const clone2 = getCleanClone(object, realm);
  486. for (const key in object) {
  487. if (hasOwnProperty.call(object, key)) {
  488. clone2[key] = handleCopy(object[key], cache);
  489. }
  490. }
  491. if (SUPPORTS.SYMBOL_PROPERTIES) {
  492. const symbols = getOwnPropertySymbols(object);
  493. if (symbols.length) {
  494. for (let index = 0, symbol; index < symbols.length; index++) {
  495. symbol = symbols[index];
  496. if (propertyIsEnumerable.call(object, symbol)) {
  497. clone2[symbol] = handleCopy(object[symbol], cache);
  498. }
  499. }
  500. }
  501. }
  502. return clone2;
  503. };
  504. const getObjectCloneStrict = (object, realm, handleCopy, cache) => {
  505. const clone2 = getCleanClone(object, realm);
  506. const properties = SUPPORTS.SYMBOL_PROPERTIES ? [].concat(getOwnPropertyNames(object), getOwnPropertySymbols(object)) : getOwnPropertyNames(object);
  507. if (properties.length) {
  508. for (let index = 0, property, descriptor; index < properties.length; index++) {
  509. property = properties[index];
  510. if (property !== "callee" && property !== "caller") {
  511. descriptor = getOwnPropertyDescriptor(object, property);
  512. descriptor.value = handleCopy(object[property], cache);
  513. defineProperty(clone2, property, descriptor);
  514. }
  515. }
  516. }
  517. return clone2;
  518. };
  519. const getRegExpFlags = (regExp) => {
  520. let flags = "";
  521. if (regExp.global) {
  522. flags += "g";
  523. }
  524. if (regExp.ignoreCase) {
  525. flags += "i";
  526. }
  527. if (regExp.multiline) {
  528. flags += "m";
  529. }
  530. if (regExp.unicode) {
  531. flags += "u";
  532. }
  533. if (regExp.sticky) {
  534. flags += "y";
  535. }
  536. return flags;
  537. };
  538. const {
  539. isArray
  540. } = Array;
  541. const GLOBAL_THIS = (() => {
  542. if (typeof self !== "undefined") {
  543. return self;
  544. }
  545. if (typeof window !== "undefined") {
  546. return window;
  547. }
  548. if (typeof __webpack_require__2.g !== "undefined") {
  549. return __webpack_require__2.g;
  550. }
  551. if (console && console.error) {
  552. console.error('Unable to locate global object, returning "this".');
  553. }
  554. })();
  555. function clone(object, options = null) {
  556. const isStrict = !!(options && options.isStrict);
  557. const realm = options && options.realm || GLOBAL_THIS;
  558. const getObjectClone = isStrict ? getObjectCloneStrict : getObjectCloneLoose;
  559. const handleCopy = (object2, cache) => {
  560. if (!object2 || typeof object2 !== "object" || cache.has(object2)) {
  561. return object2;
  562. }
  563. if (typeof HTMLElement !== "undefined" && object2 instanceof HTMLElement) {
  564. return object2.cloneNode(false);
  565. }
  566. const Constructor = object2.constructor;
  567. if (Constructor === realm.Object) {
  568. cache.add(object2);
  569. return getObjectClone(object2, realm, handleCopy, cache);
  570. }
  571. let clone2;
  572. if (isArray(object2)) {
  573. cache.add(object2);
  574. if (isStrict) {
  575. return getObjectCloneStrict(object2, realm, handleCopy, cache);
  576. }
  577. clone2 = new Constructor();
  578. for (let index = 0; index < object2.length; index++) {
  579. clone2[index] = handleCopy(object2[index], cache);
  580. }
  581. return clone2;
  582. }
  583. if (object2 instanceof realm.Date) {
  584. return new Constructor(object2.getTime());
  585. }
  586. if (object2 instanceof realm.RegExp) {
  587. clone2 = new Constructor(object2.source, object2.flags || getRegExpFlags(object2));
  588. clone2.lastIndex = object2.lastIndex;
  589. return clone2;
  590. }
  591. if (realm.Map && object2 instanceof realm.Map) {
  592. cache.add(object2);
  593. clone2 = new Constructor();
  594. object2.forEach((value, key) => {
  595. clone2.set(key, handleCopy(value, cache));
  596. });
  597. return clone2;
  598. }
  599. if (realm.Set && object2 instanceof realm.Set) {
  600. cache.add(object2);
  601. clone2 = new Constructor();
  602. object2.forEach((value) => {
  603. clone2.add(handleCopy(value, cache));
  604. });
  605. return clone2;
  606. }
  607. if (realm.Buffer && realm.Buffer.isBuffer(object2)) {
  608. clone2 = realm.Buffer.allocUnsafe ? realm.Buffer.allocUnsafe(object2.length) : new Constructor(object2.length);
  609. object2.copy(clone2);
  610. return clone2;
  611. }
  612. if (realm.ArrayBuffer) {
  613. if (realm.ArrayBuffer.isView(object2)) {
  614. return new Constructor(object2.buffer.slice(0));
  615. }
  616. if (object2 instanceof realm.ArrayBuffer) {
  617. return object2.slice(0);
  618. }
  619. }
  620. if (
  621. // promise-like
  622. hasOwnProperty.call(object2, "then") && typeof object2.then === "function" || // errors
  623. object2 instanceof Error || // weakmaps
  624. realm.WeakMap && object2 instanceof realm.WeakMap || // weaksets
  625. realm.WeakSet && object2 instanceof realm.WeakSet
  626. ) {
  627. return object2;
  628. }
  629. cache.add(object2);
  630. return getObjectClone(object2, realm, handleCopy, cache);
  631. };
  632. return handleCopy(object, createCache());
  633. }
  634. }
  635. exports.installHook = installHook;
  636. }
  637. ),
  638. /***/
  639. "../shared-utils/lib/backend.js": (
  640. /*!**************************************!*\
  641. !*** ../shared-utils/lib/backend.js ***!
  642. \**************************************/
  643. /***/
  644. (__unused_webpack_module, exports) => {
  645. Object.defineProperty(exports, "__esModule", {
  646. value: true
  647. });
  648. exports.getCatchedGetters = exports.getCustomStoreDetails = exports.getCustomRouterDetails = exports.isVueInstance = exports.getCustomObjectDetails = exports.getCustomInstanceDetails = exports.getInstanceMap = exports.backendInjections = void 0;
  649. exports.backendInjections = {
  650. instanceMap: /* @__PURE__ */ new Map(),
  651. isVueInstance: () => false,
  652. getCustomInstanceDetails: () => ({}),
  653. getCustomObjectDetails: () => void 0
  654. };
  655. function getInstanceMap() {
  656. return exports.backendInjections.instanceMap;
  657. }
  658. exports.getInstanceMap = getInstanceMap;
  659. function getCustomInstanceDetails(instance) {
  660. return exports.backendInjections.getCustomInstanceDetails(instance);
  661. }
  662. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  663. function getCustomObjectDetails(value, proto) {
  664. return exports.backendInjections.getCustomObjectDetails(value, proto);
  665. }
  666. exports.getCustomObjectDetails = getCustomObjectDetails;
  667. function isVueInstance(value) {
  668. return exports.backendInjections.isVueInstance(value);
  669. }
  670. exports.isVueInstance = isVueInstance;
  671. function getCustomRouterDetails(router) {
  672. return {
  673. _custom: {
  674. type: "router",
  675. display: "VueRouter",
  676. value: {
  677. options: router.options,
  678. currentRoute: router.currentRoute
  679. },
  680. fields: {
  681. abstract: true
  682. }
  683. }
  684. };
  685. }
  686. exports.getCustomRouterDetails = getCustomRouterDetails;
  687. function getCustomStoreDetails(store) {
  688. return {
  689. _custom: {
  690. type: "store",
  691. display: "Store",
  692. value: {
  693. state: store.state,
  694. getters: getCatchedGetters(store)
  695. },
  696. fields: {
  697. abstract: true
  698. }
  699. }
  700. };
  701. }
  702. exports.getCustomStoreDetails = getCustomStoreDetails;
  703. function getCatchedGetters(store) {
  704. const getters = {};
  705. const origGetters = store.getters || {};
  706. const keys = Object.keys(origGetters);
  707. for (let i = 0; i < keys.length; i++) {
  708. const key = keys[i];
  709. Object.defineProperty(getters, key, {
  710. enumerable: true,
  711. get: () => {
  712. try {
  713. return origGetters[key];
  714. } catch (e) {
  715. return e;
  716. }
  717. }
  718. });
  719. }
  720. return getters;
  721. }
  722. exports.getCatchedGetters = getCatchedGetters;
  723. }
  724. ),
  725. /***/
  726. "../shared-utils/lib/bridge.js": (
  727. /*!*************************************!*\
  728. !*** ../shared-utils/lib/bridge.js ***!
  729. \*************************************/
  730. /***/
  731. (__unused_webpack_module, exports, __webpack_require__2) => {
  732. Object.defineProperty(exports, "__esModule", {
  733. value: true
  734. });
  735. exports.Bridge = void 0;
  736. const events_1 = __webpack_require__2(
  737. /*! events */
  738. "../../node_modules/events/events.js"
  739. );
  740. const raf_1 = __webpack_require__2(
  741. /*! ./raf */
  742. "../shared-utils/lib/raf.js"
  743. );
  744. const BATCH_DURATION = 100;
  745. class Bridge extends events_1.EventEmitter {
  746. constructor(wall) {
  747. super();
  748. this.setMaxListeners(Infinity);
  749. this.wall = wall;
  750. wall.listen((messages) => {
  751. if (Array.isArray(messages)) {
  752. messages.forEach((message) => this._emit(message));
  753. } else {
  754. this._emit(messages);
  755. }
  756. });
  757. this._batchingQueue = [];
  758. this._sendingQueue = [];
  759. this._receivingQueue = [];
  760. this._sending = false;
  761. }
  762. on(event, listener) {
  763. const wrappedListener = async (...args) => {
  764. try {
  765. await listener(...args);
  766. } catch (e) {
  767. console.error(`[Bridge] Error in listener for event ${event.toString()} with args:`, args);
  768. console.error(e);
  769. }
  770. };
  771. return super.on(event, wrappedListener);
  772. }
  773. send(event, payload) {
  774. this._batchingQueue.push({
  775. event,
  776. payload
  777. });
  778. if (this._timer == null) {
  779. this._timer = setTimeout(() => this._flush(), BATCH_DURATION);
  780. }
  781. }
  782. /**
  783. * Log a message to the devtools background page.
  784. */
  785. log(message) {
  786. this.send("log", message);
  787. }
  788. _flush() {
  789. if (this._batchingQueue.length)
  790. this._send(this._batchingQueue);
  791. clearTimeout(this._timer);
  792. this._timer = null;
  793. this._batchingQueue = [];
  794. }
  795. // @TODO types
  796. _emit(message) {
  797. if (typeof message === "string") {
  798. this.emit(message);
  799. } else if (message._chunk) {
  800. this._receivingQueue.push(message._chunk);
  801. if (message.last) {
  802. this.emit(message.event, this._receivingQueue);
  803. this._receivingQueue = [];
  804. }
  805. } else if (message.event) {
  806. this.emit(message.event, message.payload);
  807. }
  808. }
  809. // @TODO types
  810. _send(messages) {
  811. this._sendingQueue.push(messages);
  812. this._nextSend();
  813. }
  814. _nextSend() {
  815. if (!this._sendingQueue.length || this._sending)
  816. return;
  817. this._sending = true;
  818. const messages = this._sendingQueue.shift();
  819. try {
  820. this.wall.send(messages);
  821. } catch (err) {
  822. if (err.message === "Message length exceeded maximum allowed length.") {
  823. this._sendingQueue.splice(0, 0, messages.map((message) => [message]));
  824. }
  825. }
  826. this._sending = false;
  827. (0, raf_1.raf)(() => this._nextSend());
  828. }
  829. }
  830. exports.Bridge = Bridge;
  831. }
  832. ),
  833. /***/
  834. "../shared-utils/lib/consts.js": (
  835. /*!*************************************!*\
  836. !*** ../shared-utils/lib/consts.js ***!
  837. \*************************************/
  838. /***/
  839. (__unused_webpack_module, exports) => {
  840. Object.defineProperty(exports, "__esModule", {
  841. value: true
  842. });
  843. exports.HookEvents = exports.BridgeSubscriptions = exports.BridgeEvents = exports.BuiltinTabs = void 0;
  844. (function(BuiltinTabs) {
  845. BuiltinTabs["COMPONENTS"] = "components";
  846. BuiltinTabs["TIMELINE"] = "timeline";
  847. BuiltinTabs["PLUGINS"] = "plugins";
  848. BuiltinTabs["SETTINGS"] = "settings";
  849. })(exports.BuiltinTabs || (exports.BuiltinTabs = {}));
  850. (function(BridgeEvents) {
  851. BridgeEvents["TO_BACK_SUBSCRIBE"] = "b:subscribe";
  852. BridgeEvents["TO_BACK_UNSUBSCRIBE"] = "b:unsubscribe";
  853. BridgeEvents["TO_FRONT_READY"] = "f:ready";
  854. BridgeEvents["TO_BACK_LOG_DETECTED_VUE"] = "b:log-detected-vue";
  855. BridgeEvents["TO_BACK_REFRESH"] = "b:refresh";
  856. BridgeEvents["TO_BACK_TAB_SWITCH"] = "b:tab:switch";
  857. BridgeEvents["TO_BACK_LOG"] = "b:log";
  858. BridgeEvents["TO_FRONT_RECONNECTED"] = "f:reconnected";
  859. BridgeEvents["TO_FRONT_TITLE"] = "f:title";
  860. BridgeEvents["TO_FRONT_APP_ADD"] = "f:app:add";
  861. BridgeEvents["TO_BACK_APP_LIST"] = "b:app:list";
  862. BridgeEvents["TO_FRONT_APP_LIST"] = "f:app:list";
  863. BridgeEvents["TO_FRONT_APP_REMOVE"] = "f:app:remove";
  864. BridgeEvents["TO_BACK_APP_SELECT"] = "b:app:select";
  865. BridgeEvents["TO_FRONT_APP_SELECTED"] = "f:app:selected";
  866. BridgeEvents["TO_BACK_SCAN_LEGACY_APPS"] = "b:app:scan-legacy";
  867. BridgeEvents["TO_BACK_COMPONENT_TREE"] = "b:component:tree";
  868. BridgeEvents["TO_FRONT_COMPONENT_TREE"] = "f:component:tree";
  869. BridgeEvents["TO_BACK_COMPONENT_SELECTED_DATA"] = "b:component:selected-data";
  870. BridgeEvents["TO_FRONT_COMPONENT_SELECTED_DATA"] = "f:component:selected-data";
  871. BridgeEvents["TO_BACK_COMPONENT_EXPAND"] = "b:component:expand";
  872. BridgeEvents["TO_FRONT_COMPONENT_EXPAND"] = "f:component:expand";
  873. BridgeEvents["TO_BACK_COMPONENT_SCROLL_TO"] = "b:component:scroll-to";
  874. BridgeEvents["TO_BACK_COMPONENT_FILTER"] = "b:component:filter";
  875. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OVER"] = "b:component:mouse-over";
  876. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OUT"] = "b:component:mouse-out";
  877. BridgeEvents["TO_BACK_COMPONENT_CONTEXT_MENU_TARGET"] = "b:component:context-menu-target";
  878. BridgeEvents["TO_BACK_COMPONENT_EDIT_STATE"] = "b:component:edit-state";
  879. BridgeEvents["TO_BACK_COMPONENT_PICK"] = "b:component:pick";
  880. BridgeEvents["TO_FRONT_COMPONENT_PICK"] = "f:component:pick";
  881. BridgeEvents["TO_BACK_COMPONENT_PICK_CANCELED"] = "b:component:pick-canceled";
  882. BridgeEvents["TO_FRONT_COMPONENT_PICK_CANCELED"] = "f:component:pick-canceled";
  883. BridgeEvents["TO_BACK_COMPONENT_INSPECT_DOM"] = "b:component:inspect-dom";
  884. BridgeEvents["TO_FRONT_COMPONENT_INSPECT_DOM"] = "f:component:inspect-dom";
  885. BridgeEvents["TO_BACK_COMPONENT_RENDER_CODE"] = "b:component:render-code";
  886. BridgeEvents["TO_FRONT_COMPONENT_RENDER_CODE"] = "f:component:render-code";
  887. BridgeEvents["TO_FRONT_COMPONENT_UPDATED"] = "f:component:updated";
  888. BridgeEvents["TO_FRONT_TIMELINE_EVENT"] = "f:timeline:event";
  889. BridgeEvents["TO_BACK_TIMELINE_LAYER_LIST"] = "b:timeline:layer-list";
  890. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LIST"] = "f:timeline:layer-list";
  891. BridgeEvents["TO_FRONT_TIMELINE_LAYER_ADD"] = "f:timeline:layer-add";
  892. BridgeEvents["TO_BACK_TIMELINE_SHOW_SCREENSHOT"] = "b:timeline:show-screenshot";
  893. BridgeEvents["TO_BACK_TIMELINE_CLEAR"] = "b:timeline:clear";
  894. BridgeEvents["TO_BACK_TIMELINE_EVENT_DATA"] = "b:timeline:event-data";
  895. BridgeEvents["TO_FRONT_TIMELINE_EVENT_DATA"] = "f:timeline:event-data";
  896. BridgeEvents["TO_BACK_TIMELINE_LAYER_LOAD_EVENTS"] = "b:timeline:layer-load-events";
  897. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS"] = "f:timeline:layer-load-events";
  898. BridgeEvents["TO_BACK_TIMELINE_LOAD_MARKERS"] = "b:timeline:load-markers";
  899. BridgeEvents["TO_FRONT_TIMELINE_LOAD_MARKERS"] = "f:timeline:load-markers";
  900. BridgeEvents["TO_FRONT_TIMELINE_MARKER"] = "f:timeline:marker";
  901. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_LIST"] = "b:devtools-plugin:list";
  902. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_LIST"] = "f:devtools-plugin:list";
  903. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_ADD"] = "f:devtools-plugin:add";
  904. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED"] = "b:devtools-plugin:setting-updated";
  905. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_LIST"] = "b:custom-inspector:list";
  906. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_LIST"] = "f:custom-inspector:list";
  907. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_ADD"] = "f:custom-inspector:add";
  908. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_TREE"] = "b:custom-inspector:tree";
  909. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_TREE"] = "f:custom-inspector:tree";
  910. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_STATE"] = "b:custom-inspector:state";
  911. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_STATE"] = "f:custom-inspector:state";
  912. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE"] = "b:custom-inspector:edit-state";
  913. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_ACTION"] = "b:custom-inspector:action";
  914. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_NODE_ACTION"] = "b:custom-inspector:node-action";
  915. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE"] = "f:custom-inspector:select-node";
  916. BridgeEvents["TO_BACK_CUSTOM_STATE_ACTION"] = "b:custom-state:action";
  917. })(exports.BridgeEvents || (exports.BridgeEvents = {}));
  918. (function(BridgeSubscriptions) {
  919. BridgeSubscriptions["SELECTED_COMPONENT_DATA"] = "component:selected-data";
  920. BridgeSubscriptions["COMPONENT_TREE"] = "component:tree";
  921. })(exports.BridgeSubscriptions || (exports.BridgeSubscriptions = {}));
  922. (function(HookEvents) {
  923. HookEvents["INIT"] = "init";
  924. HookEvents["APP_INIT"] = "app:init";
  925. HookEvents["APP_ADD"] = "app:add";
  926. HookEvents["APP_UNMOUNT"] = "app:unmount";
  927. HookEvents["COMPONENT_UPDATED"] = "component:updated";
  928. HookEvents["COMPONENT_ADDED"] = "component:added";
  929. HookEvents["COMPONENT_REMOVED"] = "component:removed";
  930. HookEvents["COMPONENT_EMIT"] = "component:emit";
  931. HookEvents["COMPONENT_HIGHLIGHT"] = "component:highlight";
  932. HookEvents["COMPONENT_UNHIGHLIGHT"] = "component:unhighlight";
  933. HookEvents["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
  934. HookEvents["TIMELINE_LAYER_ADDED"] = "timeline:layer-added";
  935. HookEvents["TIMELINE_EVENT_ADDED"] = "timeline:event-added";
  936. HookEvents["CUSTOM_INSPECTOR_ADD"] = "custom-inspector:add";
  937. HookEvents["CUSTOM_INSPECTOR_SEND_TREE"] = "custom-inspector:send-tree";
  938. HookEvents["CUSTOM_INSPECTOR_SEND_STATE"] = "custom-inspector:send-state";
  939. HookEvents["CUSTOM_INSPECTOR_SELECT_NODE"] = "custom-inspector:select-node";
  940. HookEvents["PERFORMANCE_START"] = "perf:start";
  941. HookEvents["PERFORMANCE_END"] = "perf:end";
  942. HookEvents["PLUGIN_SETTINGS_SET"] = "plugin:settings:set";
  943. HookEvents["FLUSH"] = "flush";
  944. HookEvents["TRACK_UPDATE"] = "_track-update";
  945. HookEvents["FLASH_UPDATE"] = "_flash-update";
  946. })(exports.HookEvents || (exports.HookEvents = {}));
  947. }
  948. ),
  949. /***/
  950. "../shared-utils/lib/edit.js": (
  951. /*!***********************************!*\
  952. !*** ../shared-utils/lib/edit.js ***!
  953. \***********************************/
  954. /***/
  955. (__unused_webpack_module, exports) => {
  956. Object.defineProperty(exports, "__esModule", {
  957. value: true
  958. });
  959. exports.StateEditor = void 0;
  960. class StateEditor {
  961. set(object, path, value, cb = null) {
  962. const sections = Array.isArray(path) ? path : path.split(".");
  963. while (sections.length > 1) {
  964. object = object[sections.shift()];
  965. if (this.isRef(object)) {
  966. object = this.getRefValue(object);
  967. }
  968. }
  969. const field = sections[0];
  970. if (cb) {
  971. cb(object, field, value);
  972. } else if (this.isRef(object[field])) {
  973. this.setRefValue(object[field], value);
  974. } else {
  975. object[field] = value;
  976. }
  977. }
  978. get(object, path) {
  979. const sections = Array.isArray(path) ? path : path.split(".");
  980. for (let i = 0; i < sections.length; i++) {
  981. object = object[sections[i]];
  982. if (this.isRef(object)) {
  983. object = this.getRefValue(object);
  984. }
  985. if (!object) {
  986. return void 0;
  987. }
  988. }
  989. return object;
  990. }
  991. has(object, path, parent = false) {
  992. if (typeof object === "undefined") {
  993. return false;
  994. }
  995. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  996. const size = !parent ? 1 : 2;
  997. while (object && sections.length > size) {
  998. object = object[sections.shift()];
  999. if (this.isRef(object)) {
  1000. object = this.getRefValue(object);
  1001. }
  1002. }
  1003. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  1004. }
  1005. createDefaultSetCallback(state) {
  1006. return (obj, field, value) => {
  1007. if (state.remove || state.newKey) {
  1008. if (Array.isArray(obj)) {
  1009. obj.splice(field, 1);
  1010. } else {
  1011. delete obj[field];
  1012. }
  1013. }
  1014. if (!state.remove) {
  1015. const target = obj[state.newKey || field];
  1016. if (this.isRef(target)) {
  1017. this.setRefValue(target, value);
  1018. } else {
  1019. obj[state.newKey || field] = value;
  1020. }
  1021. }
  1022. };
  1023. }
  1024. isRef(ref) {
  1025. return false;
  1026. }
  1027. setRefValue(ref, value) {
  1028. }
  1029. getRefValue(ref) {
  1030. return ref;
  1031. }
  1032. }
  1033. exports.StateEditor = StateEditor;
  1034. }
  1035. ),
  1036. /***/
  1037. "../shared-utils/lib/env.js": (
  1038. /*!**********************************!*\
  1039. !*** ../shared-utils/lib/env.js ***!
  1040. \**********************************/
  1041. /***/
  1042. (__unused_webpack_module, exports) => {
  1043. Object.defineProperty(exports, "__esModule", {
  1044. value: true
  1045. });
  1046. exports.initEnv = exports.keys = exports.isLinux = exports.isMac = exports.isWindows = exports.isFirefox = exports.isChrome = exports.target = exports.isBrowser = void 0;
  1047. exports.isBrowser = typeof navigator !== "undefined" && typeof window !== "undefined";
  1048. exports.target = exports.isBrowser ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  1049. exports.isChrome = typeof exports.target.chrome !== "undefined" && !!exports.target.chrome.devtools;
  1050. exports.isFirefox = exports.isBrowser && navigator.userAgent && navigator.userAgent.indexOf("Firefox") > -1;
  1051. exports.isWindows = exports.isBrowser && navigator.platform.indexOf("Win") === 0;
  1052. exports.isMac = exports.isBrowser && navigator.platform === "MacIntel";
  1053. exports.isLinux = exports.isBrowser && navigator.platform.indexOf("Linux") === 0;
  1054. exports.keys = {
  1055. ctrl: exports.isMac ? "&#8984;" : "Ctrl",
  1056. shift: "Shift",
  1057. alt: exports.isMac ? "&#8997;" : "Alt",
  1058. del: "Del",
  1059. enter: "Enter",
  1060. esc: "Esc"
  1061. };
  1062. function initEnv(Vue) {
  1063. if (Vue.prototype.hasOwnProperty("$isChrome"))
  1064. return;
  1065. Object.defineProperties(Vue.prototype, {
  1066. $isChrome: {
  1067. get: () => exports.isChrome
  1068. },
  1069. $isFirefox: {
  1070. get: () => exports.isFirefox
  1071. },
  1072. $isWindows: {
  1073. get: () => exports.isWindows
  1074. },
  1075. $isMac: {
  1076. get: () => exports.isMac
  1077. },
  1078. $isLinux: {
  1079. get: () => exports.isLinux
  1080. },
  1081. $keys: {
  1082. get: () => exports.keys
  1083. }
  1084. });
  1085. if (exports.isWindows)
  1086. document.body.classList.add("platform-windows");
  1087. if (exports.isMac)
  1088. document.body.classList.add("platform-mac");
  1089. if (exports.isLinux)
  1090. document.body.classList.add("platform-linux");
  1091. }
  1092. exports.initEnv = initEnv;
  1093. }
  1094. ),
  1095. /***/
  1096. "../shared-utils/lib/index.js": (
  1097. /*!************************************!*\
  1098. !*** ../shared-utils/lib/index.js ***!
  1099. \************************************/
  1100. /***/
  1101. function(__unused_webpack_module, exports, __webpack_require__2) {
  1102. var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
  1103. if (k2 === void 0)
  1104. k2 = k;
  1105. var desc = Object.getOwnPropertyDescriptor(m, k);
  1106. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1107. desc = {
  1108. enumerable: true,
  1109. get: function() {
  1110. return m[k];
  1111. }
  1112. };
  1113. }
  1114. Object.defineProperty(o, k2, desc);
  1115. } : function(o, m, k, k2) {
  1116. if (k2 === void 0)
  1117. k2 = k;
  1118. o[k2] = m[k];
  1119. });
  1120. var __exportStar = this && this.__exportStar || function(m, exports2) {
  1121. for (var p in m)
  1122. if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
  1123. __createBinding(exports2, m, p);
  1124. };
  1125. Object.defineProperty(exports, "__esModule", {
  1126. value: true
  1127. });
  1128. __exportStar(__webpack_require__2(
  1129. /*! ./backend */
  1130. "../shared-utils/lib/backend.js"
  1131. ), exports);
  1132. __exportStar(__webpack_require__2(
  1133. /*! ./bridge */
  1134. "../shared-utils/lib/bridge.js"
  1135. ), exports);
  1136. __exportStar(__webpack_require__2(
  1137. /*! ./consts */
  1138. "../shared-utils/lib/consts.js"
  1139. ), exports);
  1140. __exportStar(__webpack_require__2(
  1141. /*! ./edit */
  1142. "../shared-utils/lib/edit.js"
  1143. ), exports);
  1144. __exportStar(__webpack_require__2(
  1145. /*! ./env */
  1146. "../shared-utils/lib/env.js"
  1147. ), exports);
  1148. __exportStar(__webpack_require__2(
  1149. /*! ./plugin-permissions */
  1150. "../shared-utils/lib/plugin-permissions.js"
  1151. ), exports);
  1152. __exportStar(__webpack_require__2(
  1153. /*! ./plugin-settings */
  1154. "../shared-utils/lib/plugin-settings.js"
  1155. ), exports);
  1156. __exportStar(__webpack_require__2(
  1157. /*! ./shared-data */
  1158. "../shared-utils/lib/shared-data.js"
  1159. ), exports);
  1160. __exportStar(__webpack_require__2(
  1161. /*! ./shell */
  1162. "../shared-utils/lib/shell.js"
  1163. ), exports);
  1164. __exportStar(__webpack_require__2(
  1165. /*! ./storage */
  1166. "../shared-utils/lib/storage.js"
  1167. ), exports);
  1168. __exportStar(__webpack_require__2(
  1169. /*! ./transfer */
  1170. "../shared-utils/lib/transfer.js"
  1171. ), exports);
  1172. __exportStar(__webpack_require__2(
  1173. /*! ./util */
  1174. "../shared-utils/lib/util.js"
  1175. ), exports);
  1176. __exportStar(__webpack_require__2(
  1177. /*! ./raf */
  1178. "../shared-utils/lib/raf.js"
  1179. ), exports);
  1180. }
  1181. ),
  1182. /***/
  1183. "../shared-utils/lib/plugin-permissions.js": (
  1184. /*!*************************************************!*\
  1185. !*** ../shared-utils/lib/plugin-permissions.js ***!
  1186. \*************************************************/
  1187. /***/
  1188. (__unused_webpack_module, exports, __webpack_require__2) => {
  1189. Object.defineProperty(exports, "__esModule", {
  1190. value: true
  1191. });
  1192. exports.setPluginPermission = exports.hasPluginPermission = exports.PluginPermission = void 0;
  1193. const shared_data_1 = __webpack_require__2(
  1194. /*! ./shared-data */
  1195. "../shared-utils/lib/shared-data.js"
  1196. );
  1197. (function(PluginPermission) {
  1198. PluginPermission["ENABLED"] = "enabled";
  1199. PluginPermission["COMPONENTS"] = "components";
  1200. PluginPermission["CUSTOM_INSPECTOR"] = "custom-inspector";
  1201. PluginPermission["TIMELINE"] = "timeline";
  1202. })(exports.PluginPermission || (exports.PluginPermission = {}));
  1203. function hasPluginPermission(pluginId, permission) {
  1204. const result = shared_data_1.SharedData.pluginPermissions[`${pluginId}:${permission}`];
  1205. if (result == null)
  1206. return true;
  1207. return !!result;
  1208. }
  1209. exports.hasPluginPermission = hasPluginPermission;
  1210. function setPluginPermission(pluginId, permission, active) {
  1211. shared_data_1.SharedData.pluginPermissions = {
  1212. ...shared_data_1.SharedData.pluginPermissions,
  1213. [`${pluginId}:${permission}`]: active
  1214. };
  1215. }
  1216. exports.setPluginPermission = setPluginPermission;
  1217. }
  1218. ),
  1219. /***/
  1220. "../shared-utils/lib/plugin-settings.js": (
  1221. /*!**********************************************!*\
  1222. !*** ../shared-utils/lib/plugin-settings.js ***!
  1223. \**********************************************/
  1224. /***/
  1225. (__unused_webpack_module, exports, __webpack_require__2) => {
  1226. Object.defineProperty(exports, "__esModule", {
  1227. value: true
  1228. });
  1229. exports.getPluginDefaultSettings = exports.setPluginSettings = exports.getPluginSettings = void 0;
  1230. const shared_data_1 = __webpack_require__2(
  1231. /*! ./shared-data */
  1232. "../shared-utils/lib/shared-data.js"
  1233. );
  1234. function getPluginSettings(pluginId, defaultSettings) {
  1235. var _a;
  1236. return {
  1237. ...defaultSettings !== null && defaultSettings !== void 0 ? defaultSettings : {},
  1238. ...(_a = shared_data_1.SharedData.pluginSettings[pluginId]) !== null && _a !== void 0 ? _a : {}
  1239. };
  1240. }
  1241. exports.getPluginSettings = getPluginSettings;
  1242. function setPluginSettings(pluginId, settings) {
  1243. shared_data_1.SharedData.pluginSettings = {
  1244. ...shared_data_1.SharedData.pluginSettings,
  1245. [pluginId]: settings
  1246. };
  1247. }
  1248. exports.setPluginSettings = setPluginSettings;
  1249. function getPluginDefaultSettings(schema) {
  1250. const result = {};
  1251. if (schema) {
  1252. for (const id in schema) {
  1253. const item = schema[id];
  1254. result[id] = item.defaultValue;
  1255. }
  1256. }
  1257. return result;
  1258. }
  1259. exports.getPluginDefaultSettings = getPluginDefaultSettings;
  1260. }
  1261. ),
  1262. /***/
  1263. "../shared-utils/lib/raf.js": (
  1264. /*!**********************************!*\
  1265. !*** ../shared-utils/lib/raf.js ***!
  1266. \**********************************/
  1267. /***/
  1268. (__unused_webpack_module, exports) => {
  1269. Object.defineProperty(exports, "__esModule", {
  1270. value: true
  1271. });
  1272. exports.raf = void 0;
  1273. let pendingCallbacks = [];
  1274. exports.raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : typeof setImmediate === "function" ? (fn) => {
  1275. if (!pendingCallbacks.length) {
  1276. setImmediate(() => {
  1277. const now = performance.now();
  1278. const cbs = pendingCallbacks;
  1279. pendingCallbacks = [];
  1280. cbs.forEach((cb) => cb(now));
  1281. });
  1282. }
  1283. pendingCallbacks.push(fn);
  1284. } : function(callback) {
  1285. return setTimeout(function() {
  1286. callback(Date.now());
  1287. }, 1e3 / 60);
  1288. };
  1289. }
  1290. ),
  1291. /***/
  1292. "../shared-utils/lib/shared-data.js": (
  1293. /*!******************************************!*\
  1294. !*** ../shared-utils/lib/shared-data.js ***!
  1295. \******************************************/
  1296. /***/
  1297. (__unused_webpack_module, exports, __webpack_require__2) => {
  1298. Object.defineProperty(exports, "__esModule", {
  1299. value: true
  1300. });
  1301. exports.SharedData = exports.watchSharedData = exports.destroySharedData = exports.onSharedDataInit = exports.initSharedData = void 0;
  1302. const storage_1 = __webpack_require__2(
  1303. /*! ./storage */
  1304. "../shared-utils/lib/storage.js"
  1305. );
  1306. const env_1 = __webpack_require__2(
  1307. /*! ./env */
  1308. "../shared-utils/lib/env.js"
  1309. );
  1310. const internalSharedData = {
  1311. openInEditorHost: "/",
  1312. componentNameStyle: "class",
  1313. theme: "auto",
  1314. displayDensity: "low",
  1315. timeFormat: "default",
  1316. recordVuex: true,
  1317. cacheVuexSnapshotsEvery: 50,
  1318. cacheVuexSnapshotsLimit: 10,
  1319. snapshotLoading: false,
  1320. componentEventsEnabled: true,
  1321. performanceMonitoringEnabled: true,
  1322. editableProps: false,
  1323. logDetected: true,
  1324. vuexNewBackend: false,
  1325. vuexAutoload: false,
  1326. vuexGroupGettersByModule: true,
  1327. showMenuScrollTip: true,
  1328. timelineTimeGrid: true,
  1329. timelineScreenshots: true,
  1330. menuStepScrolling: env_1.isMac,
  1331. pluginPermissions: {},
  1332. pluginSettings: {},
  1333. pageConfig: {},
  1334. legacyApps: false,
  1335. trackUpdates: true,
  1336. flashUpdates: false,
  1337. debugInfo: false,
  1338. isBrowser: env_1.isBrowser
  1339. };
  1340. const persisted = ["componentNameStyle", "theme", "displayDensity", "recordVuex", "editableProps", "logDetected", "vuexNewBackend", "vuexAutoload", "vuexGroupGettersByModule", "timeFormat", "showMenuScrollTip", "timelineTimeGrid", "timelineScreenshots", "menuStepScrolling", "pluginPermissions", "pluginSettings", "performanceMonitoringEnabled", "componentEventsEnabled", "trackUpdates", "flashUpdates", "debugInfo"];
  1341. const storageVersion = "6.0.0-alpha.1";
  1342. let bridge;
  1343. let persist = false;
  1344. let data;
  1345. let initRetryInterval;
  1346. let initRetryCount = 0;
  1347. const initCbs = [];
  1348. function initSharedData(params) {
  1349. return new Promise((resolve) => {
  1350. bridge = params.bridge;
  1351. persist = !!params.persist;
  1352. if (persist) {
  1353. {
  1354. console.log("[shared data] Master init in progress...");
  1355. }
  1356. persisted.forEach((key) => {
  1357. const value = (0, storage_1.getStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`);
  1358. if (value !== null) {
  1359. internalSharedData[key] = value;
  1360. }
  1361. });
  1362. bridge.on("shared-data:load", () => {
  1363. Object.keys(internalSharedData).forEach((key) => {
  1364. sendValue(key, internalSharedData[key]);
  1365. });
  1366. bridge.send("shared-data:load-complete");
  1367. });
  1368. bridge.on("shared-data:init-complete", () => {
  1369. {
  1370. console.log("[shared data] Master init complete");
  1371. }
  1372. clearInterval(initRetryInterval);
  1373. resolve();
  1374. });
  1375. bridge.send("shared-data:master-init-waiting");
  1376. bridge.on("shared-data:minion-init-waiting", () => {
  1377. bridge.send("shared-data:master-init-waiting");
  1378. });
  1379. initRetryCount = 0;
  1380. clearInterval(initRetryInterval);
  1381. initRetryInterval = setInterval(() => {
  1382. {
  1383. console.log("[shared data] Master init retrying...");
  1384. }
  1385. bridge.send("shared-data:master-init-waiting");
  1386. initRetryCount++;
  1387. if (initRetryCount > 30) {
  1388. clearInterval(initRetryInterval);
  1389. console.error("[shared data] Master init failed");
  1390. }
  1391. }, 2e3);
  1392. } else {
  1393. bridge.on("shared-data:master-init-waiting", () => {
  1394. bridge.send("shared-data:load");
  1395. bridge.once("shared-data:load-complete", () => {
  1396. bridge.send("shared-data:init-complete");
  1397. resolve();
  1398. });
  1399. });
  1400. bridge.send("shared-data:minion-init-waiting");
  1401. }
  1402. data = {
  1403. ...internalSharedData
  1404. };
  1405. if (params.Vue) {
  1406. data = params.Vue.observable(data);
  1407. }
  1408. bridge.on("shared-data:set", ({
  1409. key,
  1410. value
  1411. }) => {
  1412. setValue(key, value);
  1413. });
  1414. initCbs.forEach((cb) => cb());
  1415. });
  1416. }
  1417. exports.initSharedData = initSharedData;
  1418. function onSharedDataInit(cb) {
  1419. initCbs.push(cb);
  1420. return () => {
  1421. const index = initCbs.indexOf(cb);
  1422. if (index !== -1)
  1423. initCbs.splice(index, 1);
  1424. };
  1425. }
  1426. exports.onSharedDataInit = onSharedDataInit;
  1427. function destroySharedData() {
  1428. bridge.removeAllListeners("shared-data:set");
  1429. watchers = {};
  1430. }
  1431. exports.destroySharedData = destroySharedData;
  1432. let watchers = {};
  1433. function setValue(key, value) {
  1434. if (persist && persisted.includes(key)) {
  1435. (0, storage_1.setStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`, value);
  1436. }
  1437. const oldValue = data[key];
  1438. data[key] = value;
  1439. const handlers = watchers[key];
  1440. if (handlers) {
  1441. handlers.forEach((h) => h(value, oldValue));
  1442. }
  1443. return true;
  1444. }
  1445. function sendValue(key, value) {
  1446. bridge && bridge.send("shared-data:set", {
  1447. key,
  1448. value
  1449. });
  1450. }
  1451. function watchSharedData(prop, handler) {
  1452. const list = watchers[prop] || (watchers[prop] = []);
  1453. list.push(handler);
  1454. return () => {
  1455. const index = list.indexOf(handler);
  1456. if (index !== -1)
  1457. list.splice(index, 1);
  1458. };
  1459. }
  1460. exports.watchSharedData = watchSharedData;
  1461. const proxy = {};
  1462. Object.keys(internalSharedData).forEach((key) => {
  1463. Object.defineProperty(proxy, key, {
  1464. configurable: false,
  1465. get: () => data[key],
  1466. set: (value) => {
  1467. sendValue(key, value);
  1468. setValue(key, value);
  1469. }
  1470. });
  1471. });
  1472. exports.SharedData = proxy;
  1473. }
  1474. ),
  1475. /***/
  1476. "../shared-utils/lib/shell.js": (
  1477. /*!************************************!*\
  1478. !*** ../shared-utils/lib/shell.js ***!
  1479. \************************************/
  1480. /***/
  1481. (__unused_webpack_module, exports) => {
  1482. Object.defineProperty(exports, "__esModule", {
  1483. value: true
  1484. });
  1485. }
  1486. ),
  1487. /***/
  1488. "../shared-utils/lib/storage.js": (
  1489. /*!**************************************!*\
  1490. !*** ../shared-utils/lib/storage.js ***!
  1491. \**************************************/
  1492. /***/
  1493. (__unused_webpack_module, exports, __webpack_require__2) => {
  1494. Object.defineProperty(exports, "__esModule", {
  1495. value: true
  1496. });
  1497. exports.clearStorage = exports.removeStorage = exports.setStorage = exports.getStorage = exports.initStorage = void 0;
  1498. const env_1 = __webpack_require__2(
  1499. /*! ./env */
  1500. "../shared-utils/lib/env.js"
  1501. );
  1502. const useStorage = typeof env_1.target.chrome !== "undefined" && typeof env_1.target.chrome.storage !== "undefined";
  1503. let storageData = null;
  1504. function initStorage() {
  1505. return new Promise((resolve) => {
  1506. if (useStorage) {
  1507. env_1.target.chrome.storage.local.get(null, (result) => {
  1508. storageData = result;
  1509. resolve();
  1510. });
  1511. } else {
  1512. storageData = {};
  1513. resolve();
  1514. }
  1515. });
  1516. }
  1517. exports.initStorage = initStorage;
  1518. function getStorage(key, defaultValue = null) {
  1519. checkStorage();
  1520. if (useStorage) {
  1521. return getDefaultValue(storageData[key], defaultValue);
  1522. } else {
  1523. try {
  1524. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue);
  1525. } catch (e) {
  1526. }
  1527. }
  1528. }
  1529. exports.getStorage = getStorage;
  1530. function setStorage(key, val) {
  1531. checkStorage();
  1532. if (useStorage) {
  1533. storageData[key] = val;
  1534. env_1.target.chrome.storage.local.set({
  1535. [key]: val
  1536. });
  1537. } else {
  1538. try {
  1539. localStorage.setItem(key, JSON.stringify(val));
  1540. } catch (e) {
  1541. }
  1542. }
  1543. }
  1544. exports.setStorage = setStorage;
  1545. function removeStorage(key) {
  1546. checkStorage();
  1547. if (useStorage) {
  1548. delete storageData[key];
  1549. env_1.target.chrome.storage.local.remove([key]);
  1550. } else {
  1551. try {
  1552. localStorage.removeItem(key);
  1553. } catch (e) {
  1554. }
  1555. }
  1556. }
  1557. exports.removeStorage = removeStorage;
  1558. function clearStorage() {
  1559. checkStorage();
  1560. if (useStorage) {
  1561. storageData = {};
  1562. env_1.target.chrome.storage.local.clear();
  1563. } else {
  1564. try {
  1565. localStorage.clear();
  1566. } catch (e) {
  1567. }
  1568. }
  1569. }
  1570. exports.clearStorage = clearStorage;
  1571. function checkStorage() {
  1572. if (!storageData) {
  1573. throw new Error("Storage wasn't initialized with 'init()'");
  1574. }
  1575. }
  1576. function getDefaultValue(value, defaultValue) {
  1577. if (value == null) {
  1578. return defaultValue;
  1579. }
  1580. return value;
  1581. }
  1582. }
  1583. ),
  1584. /***/
  1585. "../shared-utils/lib/transfer.js": (
  1586. /*!***************************************!*\
  1587. !*** ../shared-utils/lib/transfer.js ***!
  1588. \***************************************/
  1589. /***/
  1590. (__unused_webpack_module, exports) => {
  1591. Object.defineProperty(exports, "__esModule", {
  1592. value: true
  1593. });
  1594. exports.stringifyStrictCircularAutoChunks = exports.parseCircularAutoChunks = exports.stringifyCircularAutoChunks = void 0;
  1595. const MAX_SERIALIZED_SIZE = 512 * 1024;
  1596. function encode(data, replacer, list, seen) {
  1597. let stored, key, value, i, l;
  1598. const seenIndex = seen.get(data);
  1599. if (seenIndex != null) {
  1600. return seenIndex;
  1601. }
  1602. const index = list.length;
  1603. const proto = Object.prototype.toString.call(data);
  1604. if (proto === "[object Object]") {
  1605. stored = {};
  1606. seen.set(data, index);
  1607. list.push(stored);
  1608. const keys = Object.keys(data);
  1609. for (i = 0, l = keys.length; i < l; i++) {
  1610. key = keys[i];
  1611. try {
  1612. value = data[key];
  1613. if (replacer)
  1614. value = replacer.call(data, key, value);
  1615. } catch (e) {
  1616. value = e;
  1617. }
  1618. stored[key] = encode(value, replacer, list, seen);
  1619. }
  1620. } else if (proto === "[object Array]") {
  1621. stored = [];
  1622. seen.set(data, index);
  1623. list.push(stored);
  1624. for (i = 0, l = data.length; i < l; i++) {
  1625. try {
  1626. value = data[i];
  1627. if (replacer)
  1628. value = replacer.call(data, i, value);
  1629. } catch (e) {
  1630. value = e;
  1631. }
  1632. stored[i] = encode(value, replacer, list, seen);
  1633. }
  1634. } else {
  1635. list.push(data);
  1636. }
  1637. return index;
  1638. }
  1639. function decode(list, reviver) {
  1640. let i = list.length;
  1641. let j, k, data, key, value, proto;
  1642. while (i--) {
  1643. data = list[i];
  1644. proto = Object.prototype.toString.call(data);
  1645. if (proto === "[object Object]") {
  1646. const keys = Object.keys(data);
  1647. for (j = 0, k = keys.length; j < k; j++) {
  1648. key = keys[j];
  1649. value = list[data[key]];
  1650. if (reviver)
  1651. value = reviver.call(data, key, value);
  1652. data[key] = value;
  1653. }
  1654. } else if (proto === "[object Array]") {
  1655. for (j = 0, k = data.length; j < k; j++) {
  1656. value = list[data[j]];
  1657. if (reviver)
  1658. value = reviver.call(data, j, value);
  1659. data[j] = value;
  1660. }
  1661. }
  1662. }
  1663. }
  1664. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  1665. let result;
  1666. try {
  1667. result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, replacer, space);
  1668. } catch (e) {
  1669. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  1670. }
  1671. if (result.length > MAX_SERIALIZED_SIZE) {
  1672. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  1673. const chunks = [];
  1674. for (let i = 0; i < chunkCount; i++) {
  1675. chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE));
  1676. }
  1677. return chunks;
  1678. }
  1679. return result;
  1680. }
  1681. exports.stringifyCircularAutoChunks = stringifyCircularAutoChunks;
  1682. function parseCircularAutoChunks(data, reviver = null) {
  1683. if (Array.isArray(data)) {
  1684. data = data.join("");
  1685. }
  1686. const hasCircular = /^\s/.test(data);
  1687. if (!hasCircular) {
  1688. return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver);
  1689. } else {
  1690. const list = JSON.parse(data);
  1691. decode(list, reviver);
  1692. return list[0];
  1693. }
  1694. }
  1695. exports.parseCircularAutoChunks = parseCircularAutoChunks;
  1696. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  1697. const list = [];
  1698. encode(data, replacer, list, /* @__PURE__ */ new Map());
  1699. return space ? " " + JSON.stringify(list, null, space) : " " + JSON.stringify(list);
  1700. }
  1701. exports.stringifyStrictCircularAutoChunks = stringifyStrictCircularAutoChunks;
  1702. }
  1703. ),
  1704. /***/
  1705. "../shared-utils/lib/util.js": (
  1706. /*!***********************************!*\
  1707. !*** ../shared-utils/lib/util.js ***!
  1708. \***********************************/
  1709. /***/
  1710. function(__unused_webpack_module, exports, __webpack_require__2) {
  1711. var __importDefault = this && this.__importDefault || function(mod) {
  1712. return mod && mod.__esModule ? mod : {
  1713. "default": mod
  1714. };
  1715. };
  1716. Object.defineProperty(exports, "__esModule", {
  1717. value: true
  1718. });
  1719. 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;
  1720. const path_1 = __importDefault(__webpack_require__2(
  1721. /*! path */
  1722. "../../node_modules/path-browserify/index.js"
  1723. ));
  1724. const transfer_1 = __webpack_require__2(
  1725. /*! ./transfer */
  1726. "../shared-utils/lib/transfer.js"
  1727. );
  1728. const backend_1 = __webpack_require__2(
  1729. /*! ./backend */
  1730. "../shared-utils/lib/backend.js"
  1731. );
  1732. const shared_data_1 = __webpack_require__2(
  1733. /*! ./shared-data */
  1734. "../shared-utils/lib/shared-data.js"
  1735. );
  1736. const env_1 = __webpack_require__2(
  1737. /*! ./env */
  1738. "../shared-utils/lib/env.js"
  1739. );
  1740. function cached(fn) {
  1741. const cache = /* @__PURE__ */ Object.create(null);
  1742. return function cachedFn(str) {
  1743. const hit = cache[str];
  1744. return hit || (cache[str] = fn(str));
  1745. };
  1746. }
  1747. const classifyRE = /(?:^|[-_/])(\w)/g;
  1748. exports.classify = cached((str) => {
  1749. return str && ("" + str).replace(classifyRE, toUpper);
  1750. });
  1751. const camelizeRE = /-(\w)/g;
  1752. exports.camelize = cached((str) => {
  1753. return str && str.replace(camelizeRE, toUpper);
  1754. });
  1755. const kebabizeRE = /([a-z0-9])([A-Z])/g;
  1756. exports.kebabize = cached((str) => {
  1757. return str && str.replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {
  1758. return `${lowerCaseCharacter}-${upperCaseLetter}`;
  1759. }).toLowerCase();
  1760. });
  1761. function toUpper(_, c) {
  1762. return c ? c.toUpperCase() : "";
  1763. }
  1764. function getComponentDisplayName(originalName, style = "class") {
  1765. switch (style) {
  1766. case "class":
  1767. return (0, exports.classify)(originalName);
  1768. case "kebab":
  1769. return (0, exports.kebabize)(originalName);
  1770. case "original":
  1771. default:
  1772. return originalName;
  1773. }
  1774. }
  1775. exports.getComponentDisplayName = getComponentDisplayName;
  1776. function inDoc(node) {
  1777. if (!node)
  1778. return false;
  1779. const doc = node.ownerDocument.documentElement;
  1780. const parent = node.parentNode;
  1781. return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  1782. }
  1783. exports.inDoc = inDoc;
  1784. exports.UNDEFINED = "__vue_devtool_undefined__";
  1785. exports.INFINITY = "__vue_devtool_infinity__";
  1786. exports.NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  1787. exports.NAN = "__vue_devtool_nan__";
  1788. exports.SPECIAL_TOKENS = {
  1789. true: true,
  1790. false: false,
  1791. undefined: exports.UNDEFINED,
  1792. null: null,
  1793. "-Infinity": exports.NEGATIVE_INFINITY,
  1794. Infinity: exports.INFINITY,
  1795. NaN: exports.NAN
  1796. };
  1797. exports.MAX_STRING_SIZE = 1e4;
  1798. exports.MAX_ARRAY_SIZE = 5e3;
  1799. function specialTokenToString(value) {
  1800. if (value === null) {
  1801. return "null";
  1802. } else if (value === exports.UNDEFINED) {
  1803. return "undefined";
  1804. } else if (value === exports.NAN) {
  1805. return "NaN";
  1806. } else if (value === exports.INFINITY) {
  1807. return "Infinity";
  1808. } else if (value === exports.NEGATIVE_INFINITY) {
  1809. return "-Infinity";
  1810. }
  1811. return false;
  1812. }
  1813. exports.specialTokenToString = specialTokenToString;
  1814. class EncodeCache {
  1815. constructor() {
  1816. this.map = /* @__PURE__ */ new Map();
  1817. }
  1818. /**
  1819. * Returns a result unique to each input data
  1820. * @param {*} data Input data
  1821. * @param {*} factory Function used to create the unique result
  1822. */
  1823. cache(data, factory) {
  1824. const cached2 = this.map.get(data);
  1825. if (cached2) {
  1826. return cached2;
  1827. } else {
  1828. const result = factory(data);
  1829. this.map.set(data, result);
  1830. return result;
  1831. }
  1832. }
  1833. clear() {
  1834. this.map.clear();
  1835. }
  1836. }
  1837. const encodeCache = new EncodeCache();
  1838. class ReviveCache {
  1839. constructor(maxSize) {
  1840. this.maxSize = maxSize;
  1841. this.map = /* @__PURE__ */ new Map();
  1842. this.index = 0;
  1843. this.size = 0;
  1844. }
  1845. cache(value) {
  1846. const currentIndex = this.index;
  1847. this.map.set(currentIndex, value);
  1848. this.size++;
  1849. if (this.size > this.maxSize) {
  1850. this.map.delete(currentIndex - this.size);
  1851. this.size--;
  1852. }
  1853. this.index++;
  1854. return currentIndex;
  1855. }
  1856. read(id) {
  1857. return this.map.get(id);
  1858. }
  1859. }
  1860. const reviveCache = new ReviveCache(1e3);
  1861. const replacers = {
  1862. internal: replacerForInternal,
  1863. user: replaceForUser
  1864. };
  1865. function stringify(data, target = "internal") {
  1866. encodeCache.clear();
  1867. return (0, transfer_1.stringifyCircularAutoChunks)(data, replacers[target]);
  1868. }
  1869. exports.stringify = stringify;
  1870. function replacerForInternal(key) {
  1871. var _a;
  1872. const val = this[key];
  1873. const type = typeof val;
  1874. if (Array.isArray(val)) {
  1875. const l = val.length;
  1876. if (l > exports.MAX_ARRAY_SIZE) {
  1877. return {
  1878. _isArray: true,
  1879. length: l,
  1880. items: val.slice(0, exports.MAX_ARRAY_SIZE)
  1881. };
  1882. }
  1883. return val;
  1884. } else if (typeof val === "string") {
  1885. if (val.length > exports.MAX_STRING_SIZE) {
  1886. return val.substring(0, exports.MAX_STRING_SIZE) + `... (${val.length} total length)`;
  1887. } else {
  1888. return val;
  1889. }
  1890. } else if (type === "undefined") {
  1891. return exports.UNDEFINED;
  1892. } else if (val === Infinity) {
  1893. return exports.INFINITY;
  1894. } else if (val === -Infinity) {
  1895. return exports.NEGATIVE_INFINITY;
  1896. } else if (type === "function") {
  1897. return getCustomFunctionDetails(val);
  1898. } else if (type === "symbol") {
  1899. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  1900. } else if (val !== null && type === "object") {
  1901. const proto = Object.prototype.toString.call(val);
  1902. if (proto === "[object Map]") {
  1903. return encodeCache.cache(val, () => getCustomMapDetails(val));
  1904. } else if (proto === "[object Set]") {
  1905. return encodeCache.cache(val, () => getCustomSetDetails(val));
  1906. } else if (proto === "[object RegExp]") {
  1907. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  1908. } else if (proto === "[object Date]") {
  1909. return `[native Date ${Date.prototype.toString.call(val)}]`;
  1910. } else if (proto === "[object Error]") {
  1911. return `[native Error ${val.message}<>${val.stack}]`;
  1912. } else if (val.state && val._vm) {
  1913. return encodeCache.cache(val, () => (0, backend_1.getCustomStoreDetails)(val));
  1914. } else if (val.constructor && val.constructor.name === "VueRouter") {
  1915. return encodeCache.cache(val, () => (0, backend_1.getCustomRouterDetails)(val));
  1916. } else if ((0, backend_1.isVueInstance)(val)) {
  1917. return encodeCache.cache(val, () => (0, backend_1.getCustomInstanceDetails)(val));
  1918. } else if (typeof val.render === "function") {
  1919. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val));
  1920. } else if (val.constructor && val.constructor.name === "VNode") {
  1921. return `[native VNode <${val.tag}>]`;
  1922. } else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
  1923. return encodeCache.cache(val, () => getCustomHTMLElementDetails(val));
  1924. } else if (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) === "Store" && val._wrappedGetters) {
  1925. return `[object Store]`;
  1926. } else if (val.currentRoute) {
  1927. return `[object Router]`;
  1928. }
  1929. const customDetails = (0, backend_1.getCustomObjectDetails)(val, proto);
  1930. if (customDetails != null)
  1931. return customDetails;
  1932. } else if (Number.isNaN(val)) {
  1933. return exports.NAN;
  1934. }
  1935. return sanitize(val);
  1936. }
  1937. function replaceForUser(key) {
  1938. let val = this[key];
  1939. const type = typeof val;
  1940. if ((val === null || val === void 0 ? void 0 : val._custom) && "value" in val._custom) {
  1941. val = val._custom.value;
  1942. }
  1943. if (type !== "object") {
  1944. if (val === exports.UNDEFINED) {
  1945. return void 0;
  1946. } else if (val === exports.INFINITY) {
  1947. return Infinity;
  1948. } else if (val === exports.NEGATIVE_INFINITY) {
  1949. return -Infinity;
  1950. } else if (val === exports.NAN) {
  1951. return NaN;
  1952. }
  1953. return val;
  1954. }
  1955. return sanitize(val);
  1956. }
  1957. function getCustomMapDetails(val) {
  1958. const list = [];
  1959. val.forEach((value, key) => list.push({
  1960. key,
  1961. value
  1962. }));
  1963. return {
  1964. _custom: {
  1965. type: "map",
  1966. display: "Map",
  1967. value: list,
  1968. readOnly: true,
  1969. fields: {
  1970. abstract: true
  1971. }
  1972. }
  1973. };
  1974. }
  1975. exports.getCustomMapDetails = getCustomMapDetails;
  1976. function reviveMap(val) {
  1977. const result = /* @__PURE__ */ new Map();
  1978. const list = val._custom.value;
  1979. for (let i = 0; i < list.length; i++) {
  1980. const {
  1981. key,
  1982. value
  1983. } = list[i];
  1984. result.set(key, revive(value));
  1985. }
  1986. return result;
  1987. }
  1988. exports.reviveMap = reviveMap;
  1989. function getCustomSetDetails(val) {
  1990. const list = Array.from(val);
  1991. return {
  1992. _custom: {
  1993. type: "set",
  1994. display: `Set[${list.length}]`,
  1995. value: list,
  1996. readOnly: true
  1997. }
  1998. };
  1999. }
  2000. exports.getCustomSetDetails = getCustomSetDetails;
  2001. function reviveSet(val) {
  2002. const result = /* @__PURE__ */ new Set();
  2003. const list = val._custom.value;
  2004. for (let i = 0; i < list.length; i++) {
  2005. const value = list[i];
  2006. result.add(revive(value));
  2007. }
  2008. return result;
  2009. }
  2010. exports.reviveSet = reviveSet;
  2011. function basename(filename, ext) {
  2012. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  2013. }
  2014. function getComponentName(options) {
  2015. const name = options.displayName || options.name || options._componentTag;
  2016. if (name) {
  2017. return name;
  2018. }
  2019. const file = options.__file;
  2020. if (file) {
  2021. return (0, exports.classify)(basename(file, ".vue"));
  2022. }
  2023. }
  2024. exports.getComponentName = getComponentName;
  2025. function getCustomComponentDefinitionDetails(def) {
  2026. let display = getComponentName(def);
  2027. if (display) {
  2028. if (def.name && def.__file) {
  2029. display += ` <span>(${def.__file})</span>`;
  2030. }
  2031. } else {
  2032. display = "<i>Unknown Component</i>";
  2033. }
  2034. return {
  2035. _custom: {
  2036. type: "component-definition",
  2037. display,
  2038. tooltip: "Component definition",
  2039. ...def.__file ? {
  2040. file: def.__file
  2041. } : {}
  2042. }
  2043. };
  2044. }
  2045. exports.getCustomComponentDefinitionDetails = getCustomComponentDefinitionDetails;
  2046. function getCustomFunctionDetails(func) {
  2047. let string = "";
  2048. let matches = null;
  2049. try {
  2050. string = Function.prototype.toString.call(func);
  2051. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  2052. } catch (e) {
  2053. }
  2054. const match = matches && matches[0];
  2055. const args = typeof match === "string" ? match : "(?)";
  2056. const name = typeof func.name === "string" ? func.name : "";
  2057. return {
  2058. _custom: {
  2059. type: "function",
  2060. display: `<span style="opacity:.5;">function</span> ${escape(name)}${args}`,
  2061. tooltip: string.trim() ? `<pre>${string}</pre>` : null,
  2062. _reviveId: reviveCache.cache(func)
  2063. }
  2064. };
  2065. }
  2066. exports.getCustomFunctionDetails = getCustomFunctionDetails;
  2067. function getCustomHTMLElementDetails(value) {
  2068. try {
  2069. return {
  2070. _custom: {
  2071. type: "HTMLElement",
  2072. display: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  2073. value: namedNodeMapToObject(value.attributes),
  2074. actions: [{
  2075. icon: "input",
  2076. tooltip: "Log element to console",
  2077. action: () => {
  2078. console.log(value);
  2079. }
  2080. }]
  2081. }
  2082. };
  2083. } catch (e) {
  2084. return {
  2085. _custom: {
  2086. type: "HTMLElement",
  2087. display: `<span class="text-blue-500">${String(value)}</span>`
  2088. }
  2089. };
  2090. }
  2091. }
  2092. exports.getCustomHTMLElementDetails = getCustomHTMLElementDetails;
  2093. function namedNodeMapToObject(map) {
  2094. const result = {};
  2095. const l = map.length;
  2096. for (let i = 0; i < l; i++) {
  2097. const node = map.item(i);
  2098. result[node.name] = node.value;
  2099. }
  2100. return result;
  2101. }
  2102. function getCustomRefDetails(instance, key, ref) {
  2103. let value;
  2104. if (Array.isArray(ref)) {
  2105. value = ref.map((r) => getCustomRefDetails(instance, key, r)).map((data) => data.value);
  2106. } else {
  2107. let name;
  2108. if (ref._isVue) {
  2109. name = getComponentName(ref.$options);
  2110. } else {
  2111. name = ref.tagName.toLowerCase();
  2112. }
  2113. value = {
  2114. _custom: {
  2115. display: `&lt;${name}` + (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : "") + (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : "") + "&gt;",
  2116. uid: instance.__VUE_DEVTOOLS_UID__,
  2117. type: "reference"
  2118. }
  2119. };
  2120. }
  2121. return {
  2122. type: "$refs",
  2123. key,
  2124. value,
  2125. editable: false
  2126. };
  2127. }
  2128. exports.getCustomRefDetails = getCustomRefDetails;
  2129. function parse(data, revive2 = false) {
  2130. return revive2 ? (0, transfer_1.parseCircularAutoChunks)(data, reviver) : (0, transfer_1.parseCircularAutoChunks)(data);
  2131. }
  2132. exports.parse = parse;
  2133. const specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
  2134. const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  2135. function reviver(key, val) {
  2136. return revive(val);
  2137. }
  2138. function revive(val) {
  2139. if (val === exports.UNDEFINED) {
  2140. return void 0;
  2141. } else if (val === exports.INFINITY) {
  2142. return Infinity;
  2143. } else if (val === exports.NEGATIVE_INFINITY) {
  2144. return -Infinity;
  2145. } else if (val === exports.NAN) {
  2146. return NaN;
  2147. } else if (val && val._custom) {
  2148. const {
  2149. _custom: custom
  2150. } = val;
  2151. if (custom.type === "component") {
  2152. return (0, backend_1.getInstanceMap)().get(custom.id);
  2153. } else if (custom.type === "map") {
  2154. return reviveMap(val);
  2155. } else if (custom.type === "set") {
  2156. return reviveSet(val);
  2157. } else if (custom._reviveId) {
  2158. return reviveCache.read(custom._reviveId);
  2159. } else {
  2160. return revive(custom.value);
  2161. }
  2162. } else if (symbolRE.test(val)) {
  2163. const [, string] = symbolRE.exec(val);
  2164. return Symbol.for(string);
  2165. } else if (specialTypeRE.test(val)) {
  2166. const [, type, string, , details] = specialTypeRE.exec(val);
  2167. const result = new env_1.target[type](string);
  2168. if (type === "Error" && details) {
  2169. result.stack = details;
  2170. }
  2171. return result;
  2172. } else {
  2173. return val;
  2174. }
  2175. }
  2176. exports.revive = revive;
  2177. function sanitize(data) {
  2178. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  2179. return Object.prototype.toString.call(data);
  2180. } else {
  2181. return data;
  2182. }
  2183. }
  2184. function isPlainObject(obj) {
  2185. return Object.prototype.toString.call(obj) === "[object Object]";
  2186. }
  2187. exports.isPlainObject = isPlainObject;
  2188. function isPrimitive(data) {
  2189. if (data == null) {
  2190. return true;
  2191. }
  2192. const type = typeof data;
  2193. return type === "string" || type === "number" || type === "boolean";
  2194. }
  2195. function searchDeepInObject(obj, searchTerm) {
  2196. const seen = /* @__PURE__ */ new Map();
  2197. const result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0);
  2198. seen.clear();
  2199. return result;
  2200. }
  2201. exports.searchDeepInObject = searchDeepInObject;
  2202. const SEARCH_MAX_DEPTH = 10;
  2203. function internalSearchObject(obj, searchTerm, seen, depth) {
  2204. if (depth > SEARCH_MAX_DEPTH) {
  2205. return false;
  2206. }
  2207. let match = false;
  2208. const keys = Object.keys(obj);
  2209. let key, value;
  2210. for (let i = 0; i < keys.length; i++) {
  2211. key = keys[i];
  2212. value = obj[key];
  2213. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1);
  2214. if (match) {
  2215. break;
  2216. }
  2217. }
  2218. return match;
  2219. }
  2220. function internalSearchArray(array, searchTerm, seen, depth) {
  2221. if (depth > SEARCH_MAX_DEPTH) {
  2222. return false;
  2223. }
  2224. let match = false;
  2225. let value;
  2226. for (let i = 0; i < array.length; i++) {
  2227. value = array[i];
  2228. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1);
  2229. if (match) {
  2230. break;
  2231. }
  2232. }
  2233. return match;
  2234. }
  2235. function internalSearchCheck(searchTerm, key, value, seen, depth) {
  2236. let match = false;
  2237. let result;
  2238. if (key === "_custom") {
  2239. key = value.display;
  2240. value = value.value;
  2241. }
  2242. (result = specialTokenToString(value)) && (value = result);
  2243. if (key && compare(key, searchTerm)) {
  2244. match = true;
  2245. seen.set(value, true);
  2246. } else if (seen.has(value)) {
  2247. match = seen.get(value);
  2248. } else if (Array.isArray(value)) {
  2249. seen.set(value, null);
  2250. match = internalSearchArray(value, searchTerm, seen, depth);
  2251. seen.set(value, match);
  2252. } else if (isPlainObject(value)) {
  2253. seen.set(value, null);
  2254. match = internalSearchObject(value, searchTerm, seen, depth);
  2255. seen.set(value, match);
  2256. } else if (compare(value, searchTerm)) {
  2257. match = true;
  2258. seen.set(value, true);
  2259. }
  2260. return match;
  2261. }
  2262. function compare(value, searchTerm) {
  2263. return ("" + value).toLowerCase().indexOf(searchTerm) !== -1;
  2264. }
  2265. function sortByKey(state) {
  2266. return state && state.slice().sort((a, b) => {
  2267. if (a.key < b.key)
  2268. return -1;
  2269. if (a.key > b.key)
  2270. return 1;
  2271. return 0;
  2272. });
  2273. }
  2274. exports.sortByKey = sortByKey;
  2275. function simpleGet(object, path) {
  2276. const sections = Array.isArray(path) ? path : path.split(".");
  2277. for (let i = 0; i < sections.length; i++) {
  2278. object = object[sections[i]];
  2279. if (!object) {
  2280. return void 0;
  2281. }
  2282. }
  2283. return object;
  2284. }
  2285. exports.simpleGet = simpleGet;
  2286. function focusInput(el) {
  2287. el.focus();
  2288. el.setSelectionRange(0, el.value.length);
  2289. }
  2290. exports.focusInput = focusInput;
  2291. function openInEditor(file) {
  2292. const fileName = file.replace(/\\/g, "\\\\");
  2293. const src = `fetch('${shared_data_1.SharedData.openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  2294. if (response.ok) {
  2295. console.log('File ${fileName} opened in editor')
  2296. } else {
  2297. const msg = 'Opening component ${fileName} failed'
  2298. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  2299. if (target.__VUE_DEVTOOLS_TOAST__) {
  2300. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  2301. } else {
  2302. console.log('%c' + msg, 'color:red')
  2303. }
  2304. console.log('Check the setup of your project, see https://devtools.vuejs.org/guide/open-in-editor.html')
  2305. }
  2306. })`;
  2307. if (env_1.isChrome) {
  2308. env_1.target.chrome.devtools.inspectedWindow.eval(src);
  2309. } else {
  2310. [eval][0](src);
  2311. }
  2312. }
  2313. exports.openInEditor = openInEditor;
  2314. const ESC = {
  2315. "<": "&lt;",
  2316. ">": "&gt;",
  2317. '"': "&quot;",
  2318. "&": "&amp;"
  2319. };
  2320. function escape(s) {
  2321. return s.replace(/[<>"&]/g, escapeChar);
  2322. }
  2323. exports.escape = escape;
  2324. function escapeChar(a) {
  2325. return ESC[a] || a;
  2326. }
  2327. function copyToClipboard(state) {
  2328. let text;
  2329. if (typeof state !== "object") {
  2330. text = String(state);
  2331. } else {
  2332. text = stringify(state, "user");
  2333. }
  2334. if (typeof document === "undefined")
  2335. return;
  2336. const dummyTextArea = document.createElement("textarea");
  2337. dummyTextArea.textContent = text;
  2338. document.body.appendChild(dummyTextArea);
  2339. dummyTextArea.select();
  2340. document.execCommand("copy");
  2341. document.body.removeChild(dummyTextArea);
  2342. }
  2343. exports.copyToClipboard = copyToClipboard;
  2344. function isEmptyObject(obj) {
  2345. return obj === exports.UNDEFINED || !obj || Object.keys(obj).length === 0;
  2346. }
  2347. exports.isEmptyObject = isEmptyObject;
  2348. }
  2349. ),
  2350. /***/
  2351. "../../node_modules/events/events.js": (
  2352. /*!*******************************************!*\
  2353. !*** ../../node_modules/events/events.js ***!
  2354. \*******************************************/
  2355. /***/
  2356. (module) => {
  2357. var R = typeof Reflect === "object" ? Reflect : null;
  2358. var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
  2359. return Function.prototype.apply.call(target, receiver, args);
  2360. };
  2361. var ReflectOwnKeys;
  2362. if (R && typeof R.ownKeys === "function") {
  2363. ReflectOwnKeys = R.ownKeys;
  2364. } else if (Object.getOwnPropertySymbols) {
  2365. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  2366. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  2367. };
  2368. } else {
  2369. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  2370. return Object.getOwnPropertyNames(target);
  2371. };
  2372. }
  2373. function ProcessEmitWarning(warning) {
  2374. if (console && console.warn)
  2375. console.warn(warning);
  2376. }
  2377. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  2378. return value !== value;
  2379. };
  2380. function EventEmitter() {
  2381. EventEmitter.init.call(this);
  2382. }
  2383. module.exports = EventEmitter;
  2384. module.exports.once = once;
  2385. EventEmitter.EventEmitter = EventEmitter;
  2386. EventEmitter.prototype._events = void 0;
  2387. EventEmitter.prototype._eventsCount = 0;
  2388. EventEmitter.prototype._maxListeners = void 0;
  2389. var defaultMaxListeners = 10;
  2390. function checkListener(listener) {
  2391. if (typeof listener !== "function") {
  2392. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  2393. }
  2394. }
  2395. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  2396. enumerable: true,
  2397. get: function() {
  2398. return defaultMaxListeners;
  2399. },
  2400. set: function(arg) {
  2401. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  2402. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  2403. }
  2404. defaultMaxListeners = arg;
  2405. }
  2406. });
  2407. EventEmitter.init = function() {
  2408. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  2409. this._events = /* @__PURE__ */ Object.create(null);
  2410. this._eventsCount = 0;
  2411. }
  2412. this._maxListeners = this._maxListeners || void 0;
  2413. };
  2414. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  2415. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  2416. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  2417. }
  2418. this._maxListeners = n;
  2419. return this;
  2420. };
  2421. function _getMaxListeners(that) {
  2422. if (that._maxListeners === void 0)
  2423. return EventEmitter.defaultMaxListeners;
  2424. return that._maxListeners;
  2425. }
  2426. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  2427. return _getMaxListeners(this);
  2428. };
  2429. EventEmitter.prototype.emit = function emit(type) {
  2430. var args = [];
  2431. for (var i = 1; i < arguments.length; i++)
  2432. args.push(arguments[i]);
  2433. var doError = type === "error";
  2434. var events = this._events;
  2435. if (events !== void 0)
  2436. doError = doError && events.error === void 0;
  2437. else if (!doError)
  2438. return false;
  2439. if (doError) {
  2440. var er;
  2441. if (args.length > 0)
  2442. er = args[0];
  2443. if (er instanceof Error) {
  2444. throw er;
  2445. }
  2446. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  2447. err.context = er;
  2448. throw err;
  2449. }
  2450. var handler = events[type];
  2451. if (handler === void 0)
  2452. return false;
  2453. if (typeof handler === "function") {
  2454. ReflectApply(handler, this, args);
  2455. } else {
  2456. var len = handler.length;
  2457. var listeners = arrayClone(handler, len);
  2458. for (var i = 0; i < len; ++i)
  2459. ReflectApply(listeners[i], this, args);
  2460. }
  2461. return true;
  2462. };
  2463. function _addListener(target, type, listener, prepend) {
  2464. var m;
  2465. var events;
  2466. var existing;
  2467. checkListener(listener);
  2468. events = target._events;
  2469. if (events === void 0) {
  2470. events = target._events = /* @__PURE__ */ Object.create(null);
  2471. target._eventsCount = 0;
  2472. } else {
  2473. if (events.newListener !== void 0) {
  2474. target.emit(
  2475. "newListener",
  2476. type,
  2477. listener.listener ? listener.listener : listener
  2478. );
  2479. events = target._events;
  2480. }
  2481. existing = events[type];
  2482. }
  2483. if (existing === void 0) {
  2484. existing = events[type] = listener;
  2485. ++target._eventsCount;
  2486. } else {
  2487. if (typeof existing === "function") {
  2488. existing = events[type] = prepend ? [listener, existing] : [existing, listener];
  2489. } else if (prepend) {
  2490. existing.unshift(listener);
  2491. } else {
  2492. existing.push(listener);
  2493. }
  2494. m = _getMaxListeners(target);
  2495. if (m > 0 && existing.length > m && !existing.warned) {
  2496. existing.warned = true;
  2497. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  2498. w.name = "MaxListenersExceededWarning";
  2499. w.emitter = target;
  2500. w.type = type;
  2501. w.count = existing.length;
  2502. ProcessEmitWarning(w);
  2503. }
  2504. }
  2505. return target;
  2506. }
  2507. EventEmitter.prototype.addListener = function addListener(type, listener) {
  2508. return _addListener(this, type, listener, false);
  2509. };
  2510. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  2511. EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  2512. return _addListener(this, type, listener, true);
  2513. };
  2514. function onceWrapper() {
  2515. if (!this.fired) {
  2516. this.target.removeListener(this.type, this.wrapFn);
  2517. this.fired = true;
  2518. if (arguments.length === 0)
  2519. return this.listener.call(this.target);
  2520. return this.listener.apply(this.target, arguments);
  2521. }
  2522. }
  2523. function _onceWrap(target, type, listener) {
  2524. var state = { fired: false, wrapFn: void 0, target, type, listener };
  2525. var wrapped = onceWrapper.bind(state);
  2526. wrapped.listener = listener;
  2527. state.wrapFn = wrapped;
  2528. return wrapped;
  2529. }
  2530. EventEmitter.prototype.once = function once2(type, listener) {
  2531. checkListener(listener);
  2532. this.on(type, _onceWrap(this, type, listener));
  2533. return this;
  2534. };
  2535. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  2536. checkListener(listener);
  2537. this.prependListener(type, _onceWrap(this, type, listener));
  2538. return this;
  2539. };
  2540. EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  2541. var list, events, position, i, originalListener;
  2542. checkListener(listener);
  2543. events = this._events;
  2544. if (events === void 0)
  2545. return this;
  2546. list = events[type];
  2547. if (list === void 0)
  2548. return this;
  2549. if (list === listener || list.listener === listener) {
  2550. if (--this._eventsCount === 0)
  2551. this._events = /* @__PURE__ */ Object.create(null);
  2552. else {
  2553. delete events[type];
  2554. if (events.removeListener)
  2555. this.emit("removeListener", type, list.listener || listener);
  2556. }
  2557. } else if (typeof list !== "function") {
  2558. position = -1;
  2559. for (i = list.length - 1; i >= 0; i--) {
  2560. if (list[i] === listener || list[i].listener === listener) {
  2561. originalListener = list[i].listener;
  2562. position = i;
  2563. break;
  2564. }
  2565. }
  2566. if (position < 0)
  2567. return this;
  2568. if (position === 0)
  2569. list.shift();
  2570. else {
  2571. spliceOne(list, position);
  2572. }
  2573. if (list.length === 1)
  2574. events[type] = list[0];
  2575. if (events.removeListener !== void 0)
  2576. this.emit("removeListener", type, originalListener || listener);
  2577. }
  2578. return this;
  2579. };
  2580. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  2581. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  2582. var listeners, events, i;
  2583. events = this._events;
  2584. if (events === void 0)
  2585. return this;
  2586. if (events.removeListener === void 0) {
  2587. if (arguments.length === 0) {
  2588. this._events = /* @__PURE__ */ Object.create(null);
  2589. this._eventsCount = 0;
  2590. } else if (events[type] !== void 0) {
  2591. if (--this._eventsCount === 0)
  2592. this._events = /* @__PURE__ */ Object.create(null);
  2593. else
  2594. delete events[type];
  2595. }
  2596. return this;
  2597. }
  2598. if (arguments.length === 0) {
  2599. var keys = Object.keys(events);
  2600. var key;
  2601. for (i = 0; i < keys.length; ++i) {
  2602. key = keys[i];
  2603. if (key === "removeListener")
  2604. continue;
  2605. this.removeAllListeners(key);
  2606. }
  2607. this.removeAllListeners("removeListener");
  2608. this._events = /* @__PURE__ */ Object.create(null);
  2609. this._eventsCount = 0;
  2610. return this;
  2611. }
  2612. listeners = events[type];
  2613. if (typeof listeners === "function") {
  2614. this.removeListener(type, listeners);
  2615. } else if (listeners !== void 0) {
  2616. for (i = listeners.length - 1; i >= 0; i--) {
  2617. this.removeListener(type, listeners[i]);
  2618. }
  2619. }
  2620. return this;
  2621. };
  2622. function _listeners(target, type, unwrap) {
  2623. var events = target._events;
  2624. if (events === void 0)
  2625. return [];
  2626. var evlistener = events[type];
  2627. if (evlistener === void 0)
  2628. return [];
  2629. if (typeof evlistener === "function")
  2630. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  2631. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  2632. }
  2633. EventEmitter.prototype.listeners = function listeners(type) {
  2634. return _listeners(this, type, true);
  2635. };
  2636. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  2637. return _listeners(this, type, false);
  2638. };
  2639. EventEmitter.listenerCount = function(emitter, type) {
  2640. if (typeof emitter.listenerCount === "function") {
  2641. return emitter.listenerCount(type);
  2642. } else {
  2643. return listenerCount.call(emitter, type);
  2644. }
  2645. };
  2646. EventEmitter.prototype.listenerCount = listenerCount;
  2647. function listenerCount(type) {
  2648. var events = this._events;
  2649. if (events !== void 0) {
  2650. var evlistener = events[type];
  2651. if (typeof evlistener === "function") {
  2652. return 1;
  2653. } else if (evlistener !== void 0) {
  2654. return evlistener.length;
  2655. }
  2656. }
  2657. return 0;
  2658. }
  2659. EventEmitter.prototype.eventNames = function eventNames() {
  2660. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  2661. };
  2662. function arrayClone(arr, n) {
  2663. var copy = new Array(n);
  2664. for (var i = 0; i < n; ++i)
  2665. copy[i] = arr[i];
  2666. return copy;
  2667. }
  2668. function spliceOne(list, index) {
  2669. for (; index + 1 < list.length; index++)
  2670. list[index] = list[index + 1];
  2671. list.pop();
  2672. }
  2673. function unwrapListeners(arr) {
  2674. var ret = new Array(arr.length);
  2675. for (var i = 0; i < ret.length; ++i) {
  2676. ret[i] = arr[i].listener || arr[i];
  2677. }
  2678. return ret;
  2679. }
  2680. function once(emitter, name) {
  2681. return new Promise(function(resolve, reject) {
  2682. function errorListener(err) {
  2683. emitter.removeListener(name, resolver);
  2684. reject(err);
  2685. }
  2686. function resolver() {
  2687. if (typeof emitter.removeListener === "function") {
  2688. emitter.removeListener("error", errorListener);
  2689. }
  2690. resolve([].slice.call(arguments));
  2691. }
  2692. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  2693. if (name !== "error") {
  2694. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  2695. }
  2696. });
  2697. }
  2698. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  2699. if (typeof emitter.on === "function") {
  2700. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  2701. }
  2702. }
  2703. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  2704. if (typeof emitter.on === "function") {
  2705. if (flags.once) {
  2706. emitter.once(name, listener);
  2707. } else {
  2708. emitter.on(name, listener);
  2709. }
  2710. } else if (typeof emitter.addEventListener === "function") {
  2711. emitter.addEventListener(name, function wrapListener(arg) {
  2712. if (flags.once) {
  2713. emitter.removeEventListener(name, wrapListener);
  2714. }
  2715. listener(arg);
  2716. });
  2717. } else {
  2718. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  2719. }
  2720. }
  2721. }
  2722. ),
  2723. /***/
  2724. "../../node_modules/path-browserify/index.js": (
  2725. /*!***************************************************!*\
  2726. !*** ../../node_modules/path-browserify/index.js ***!
  2727. \***************************************************/
  2728. /***/
  2729. (module) => {
  2730. function assertPath(path) {
  2731. if (typeof path !== "string") {
  2732. throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
  2733. }
  2734. }
  2735. function normalizeStringPosix(path, allowAboveRoot) {
  2736. var res = "";
  2737. var lastSegmentLength = 0;
  2738. var lastSlash = -1;
  2739. var dots = 0;
  2740. var code;
  2741. for (var i = 0; i <= path.length; ++i) {
  2742. if (i < path.length)
  2743. code = path.charCodeAt(i);
  2744. else if (code === 47)
  2745. break;
  2746. else
  2747. code = 47;
  2748. if (code === 47) {
  2749. if (lastSlash === i - 1 || dots === 1)
  2750. ;
  2751. else if (lastSlash !== i - 1 && dots === 2) {
  2752. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
  2753. if (res.length > 2) {
  2754. var lastSlashIndex = res.lastIndexOf("/");
  2755. if (lastSlashIndex !== res.length - 1) {
  2756. if (lastSlashIndex === -1) {
  2757. res = "";
  2758. lastSegmentLength = 0;
  2759. } else {
  2760. res = res.slice(0, lastSlashIndex);
  2761. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  2762. }
  2763. lastSlash = i;
  2764. dots = 0;
  2765. continue;
  2766. }
  2767. } else if (res.length === 2 || res.length === 1) {
  2768. res = "";
  2769. lastSegmentLength = 0;
  2770. lastSlash = i;
  2771. dots = 0;
  2772. continue;
  2773. }
  2774. }
  2775. if (allowAboveRoot) {
  2776. if (res.length > 0)
  2777. res += "/..";
  2778. else
  2779. res = "..";
  2780. lastSegmentLength = 2;
  2781. }
  2782. } else {
  2783. if (res.length > 0)
  2784. res += "/" + path.slice(lastSlash + 1, i);
  2785. else
  2786. res = path.slice(lastSlash + 1, i);
  2787. lastSegmentLength = i - lastSlash - 1;
  2788. }
  2789. lastSlash = i;
  2790. dots = 0;
  2791. } else if (code === 46 && dots !== -1) {
  2792. ++dots;
  2793. } else {
  2794. dots = -1;
  2795. }
  2796. }
  2797. return res;
  2798. }
  2799. function _format(sep, pathObject) {
  2800. var dir = pathObject.dir || pathObject.root;
  2801. var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  2802. if (!dir) {
  2803. return base;
  2804. }
  2805. if (dir === pathObject.root) {
  2806. return dir + base;
  2807. }
  2808. return dir + sep + base;
  2809. }
  2810. var posix = {
  2811. // path.resolve([from ...], to)
  2812. resolve: function resolve() {
  2813. var resolvedPath = "";
  2814. var resolvedAbsolute = false;
  2815. var cwd;
  2816. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  2817. var path;
  2818. if (i >= 0)
  2819. path = arguments[i];
  2820. else {
  2821. if (cwd === void 0)
  2822. cwd = process.cwd();
  2823. path = cwd;
  2824. }
  2825. assertPath(path);
  2826. if (path.length === 0) {
  2827. continue;
  2828. }
  2829. resolvedPath = path + "/" + resolvedPath;
  2830. resolvedAbsolute = path.charCodeAt(0) === 47;
  2831. }
  2832. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  2833. if (resolvedAbsolute) {
  2834. if (resolvedPath.length > 0)
  2835. return "/" + resolvedPath;
  2836. else
  2837. return "/";
  2838. } else if (resolvedPath.length > 0) {
  2839. return resolvedPath;
  2840. } else {
  2841. return ".";
  2842. }
  2843. },
  2844. normalize: function normalize(path) {
  2845. assertPath(path);
  2846. if (path.length === 0)
  2847. return ".";
  2848. var isAbsolute = path.charCodeAt(0) === 47;
  2849. var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  2850. path = normalizeStringPosix(path, !isAbsolute);
  2851. if (path.length === 0 && !isAbsolute)
  2852. path = ".";
  2853. if (path.length > 0 && trailingSeparator)
  2854. path += "/";
  2855. if (isAbsolute)
  2856. return "/" + path;
  2857. return path;
  2858. },
  2859. isAbsolute: function isAbsolute(path) {
  2860. assertPath(path);
  2861. return path.length > 0 && path.charCodeAt(0) === 47;
  2862. },
  2863. join: function join() {
  2864. if (arguments.length === 0)
  2865. return ".";
  2866. var joined;
  2867. for (var i = 0; i < arguments.length; ++i) {
  2868. var arg = arguments[i];
  2869. assertPath(arg);
  2870. if (arg.length > 0) {
  2871. if (joined === void 0)
  2872. joined = arg;
  2873. else
  2874. joined += "/" + arg;
  2875. }
  2876. }
  2877. if (joined === void 0)
  2878. return ".";
  2879. return posix.normalize(joined);
  2880. },
  2881. relative: function relative(from, to) {
  2882. assertPath(from);
  2883. assertPath(to);
  2884. if (from === to)
  2885. return "";
  2886. from = posix.resolve(from);
  2887. to = posix.resolve(to);
  2888. if (from === to)
  2889. return "";
  2890. var fromStart = 1;
  2891. for (; fromStart < from.length; ++fromStart) {
  2892. if (from.charCodeAt(fromStart) !== 47)
  2893. break;
  2894. }
  2895. var fromEnd = from.length;
  2896. var fromLen = fromEnd - fromStart;
  2897. var toStart = 1;
  2898. for (; toStart < to.length; ++toStart) {
  2899. if (to.charCodeAt(toStart) !== 47)
  2900. break;
  2901. }
  2902. var toEnd = to.length;
  2903. var toLen = toEnd - toStart;
  2904. var length = fromLen < toLen ? fromLen : toLen;
  2905. var lastCommonSep = -1;
  2906. var i = 0;
  2907. for (; i <= length; ++i) {
  2908. if (i === length) {
  2909. if (toLen > length) {
  2910. if (to.charCodeAt(toStart + i) === 47) {
  2911. return to.slice(toStart + i + 1);
  2912. } else if (i === 0) {
  2913. return to.slice(toStart + i);
  2914. }
  2915. } else if (fromLen > length) {
  2916. if (from.charCodeAt(fromStart + i) === 47) {
  2917. lastCommonSep = i;
  2918. } else if (i === 0) {
  2919. lastCommonSep = 0;
  2920. }
  2921. }
  2922. break;
  2923. }
  2924. var fromCode = from.charCodeAt(fromStart + i);
  2925. var toCode = to.charCodeAt(toStart + i);
  2926. if (fromCode !== toCode)
  2927. break;
  2928. else if (fromCode === 47)
  2929. lastCommonSep = i;
  2930. }
  2931. var out = "";
  2932. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  2933. if (i === fromEnd || from.charCodeAt(i) === 47) {
  2934. if (out.length === 0)
  2935. out += "..";
  2936. else
  2937. out += "/..";
  2938. }
  2939. }
  2940. if (out.length > 0)
  2941. return out + to.slice(toStart + lastCommonSep);
  2942. else {
  2943. toStart += lastCommonSep;
  2944. if (to.charCodeAt(toStart) === 47)
  2945. ++toStart;
  2946. return to.slice(toStart);
  2947. }
  2948. },
  2949. _makeLong: function _makeLong(path) {
  2950. return path;
  2951. },
  2952. dirname: function dirname(path) {
  2953. assertPath(path);
  2954. if (path.length === 0)
  2955. return ".";
  2956. var code = path.charCodeAt(0);
  2957. var hasRoot = code === 47;
  2958. var end = -1;
  2959. var matchedSlash = true;
  2960. for (var i = path.length - 1; i >= 1; --i) {
  2961. code = path.charCodeAt(i);
  2962. if (code === 47) {
  2963. if (!matchedSlash) {
  2964. end = i;
  2965. break;
  2966. }
  2967. } else {
  2968. matchedSlash = false;
  2969. }
  2970. }
  2971. if (end === -1)
  2972. return hasRoot ? "/" : ".";
  2973. if (hasRoot && end === 1)
  2974. return "//";
  2975. return path.slice(0, end);
  2976. },
  2977. basename: function basename(path, ext) {
  2978. if (ext !== void 0 && typeof ext !== "string")
  2979. throw new TypeError('"ext" argument must be a string');
  2980. assertPath(path);
  2981. var start = 0;
  2982. var end = -1;
  2983. var matchedSlash = true;
  2984. var i;
  2985. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  2986. if (ext.length === path.length && ext === path)
  2987. return "";
  2988. var extIdx = ext.length - 1;
  2989. var firstNonSlashEnd = -1;
  2990. for (i = path.length - 1; i >= 0; --i) {
  2991. var code = path.charCodeAt(i);
  2992. if (code === 47) {
  2993. if (!matchedSlash) {
  2994. start = i + 1;
  2995. break;
  2996. }
  2997. } else {
  2998. if (firstNonSlashEnd === -1) {
  2999. matchedSlash = false;
  3000. firstNonSlashEnd = i + 1;
  3001. }
  3002. if (extIdx >= 0) {
  3003. if (code === ext.charCodeAt(extIdx)) {
  3004. if (--extIdx === -1) {
  3005. end = i;
  3006. }
  3007. } else {
  3008. extIdx = -1;
  3009. end = firstNonSlashEnd;
  3010. }
  3011. }
  3012. }
  3013. }
  3014. if (start === end)
  3015. end = firstNonSlashEnd;
  3016. else if (end === -1)
  3017. end = path.length;
  3018. return path.slice(start, end);
  3019. } else {
  3020. for (i = path.length - 1; i >= 0; --i) {
  3021. if (path.charCodeAt(i) === 47) {
  3022. if (!matchedSlash) {
  3023. start = i + 1;
  3024. break;
  3025. }
  3026. } else if (end === -1) {
  3027. matchedSlash = false;
  3028. end = i + 1;
  3029. }
  3030. }
  3031. if (end === -1)
  3032. return "";
  3033. return path.slice(start, end);
  3034. }
  3035. },
  3036. extname: function extname(path) {
  3037. assertPath(path);
  3038. var startDot = -1;
  3039. var startPart = 0;
  3040. var end = -1;
  3041. var matchedSlash = true;
  3042. var preDotState = 0;
  3043. for (var i = path.length - 1; i >= 0; --i) {
  3044. var code = path.charCodeAt(i);
  3045. if (code === 47) {
  3046. if (!matchedSlash) {
  3047. startPart = i + 1;
  3048. break;
  3049. }
  3050. continue;
  3051. }
  3052. if (end === -1) {
  3053. matchedSlash = false;
  3054. end = i + 1;
  3055. }
  3056. if (code === 46) {
  3057. if (startDot === -1)
  3058. startDot = i;
  3059. else if (preDotState !== 1)
  3060. preDotState = 1;
  3061. } else if (startDot !== -1) {
  3062. preDotState = -1;
  3063. }
  3064. }
  3065. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  3066. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  3067. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3068. return "";
  3069. }
  3070. return path.slice(startDot, end);
  3071. },
  3072. format: function format(pathObject) {
  3073. if (pathObject === null || typeof pathObject !== "object") {
  3074. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  3075. }
  3076. return _format("/", pathObject);
  3077. },
  3078. parse: function parse(path) {
  3079. assertPath(path);
  3080. var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  3081. if (path.length === 0)
  3082. return ret;
  3083. var code = path.charCodeAt(0);
  3084. var isAbsolute = code === 47;
  3085. var start;
  3086. if (isAbsolute) {
  3087. ret.root = "/";
  3088. start = 1;
  3089. } else {
  3090. start = 0;
  3091. }
  3092. var startDot = -1;
  3093. var startPart = 0;
  3094. var end = -1;
  3095. var matchedSlash = true;
  3096. var i = path.length - 1;
  3097. var preDotState = 0;
  3098. for (; i >= start; --i) {
  3099. code = path.charCodeAt(i);
  3100. if (code === 47) {
  3101. if (!matchedSlash) {
  3102. startPart = i + 1;
  3103. break;
  3104. }
  3105. continue;
  3106. }
  3107. if (end === -1) {
  3108. matchedSlash = false;
  3109. end = i + 1;
  3110. }
  3111. if (code === 46) {
  3112. if (startDot === -1)
  3113. startDot = i;
  3114. else if (preDotState !== 1)
  3115. preDotState = 1;
  3116. } else if (startDot !== -1) {
  3117. preDotState = -1;
  3118. }
  3119. }
  3120. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  3121. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  3122. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3123. if (end !== -1) {
  3124. if (startPart === 0 && isAbsolute)
  3125. ret.base = ret.name = path.slice(1, end);
  3126. else
  3127. ret.base = ret.name = path.slice(startPart, end);
  3128. }
  3129. } else {
  3130. if (startPart === 0 && isAbsolute) {
  3131. ret.name = path.slice(1, startDot);
  3132. ret.base = path.slice(1, end);
  3133. } else {
  3134. ret.name = path.slice(startPart, startDot);
  3135. ret.base = path.slice(startPart, end);
  3136. }
  3137. ret.ext = path.slice(startDot, end);
  3138. }
  3139. if (startPart > 0)
  3140. ret.dir = path.slice(0, startPart - 1);
  3141. else if (isAbsolute)
  3142. ret.dir = "/";
  3143. return ret;
  3144. },
  3145. sep: "/",
  3146. delimiter: ":",
  3147. win32: null,
  3148. posix: null
  3149. };
  3150. posix.posix = posix;
  3151. module.exports = posix;
  3152. }
  3153. )
  3154. /******/
  3155. };
  3156. var __webpack_module_cache__ = {};
  3157. function __webpack_require__(moduleId) {
  3158. var cachedModule = __webpack_module_cache__[moduleId];
  3159. if (cachedModule !== void 0) {
  3160. return cachedModule.exports;
  3161. }
  3162. var module = __webpack_module_cache__[moduleId] = {
  3163. /******/
  3164. // no module.id needed
  3165. /******/
  3166. // no module.loaded needed
  3167. /******/
  3168. exports: {}
  3169. /******/
  3170. };
  3171. __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  3172. return module.exports;
  3173. }
  3174. (() => {
  3175. __webpack_require__.n = (module) => {
  3176. var getter = module && module.__esModule ? (
  3177. /******/
  3178. () => module["default"]
  3179. ) : (
  3180. /******/
  3181. () => module
  3182. );
  3183. __webpack_require__.d(getter, { a: getter });
  3184. return getter;
  3185. };
  3186. })();
  3187. (() => {
  3188. __webpack_require__.d = (exports, definition) => {
  3189. for (var key in definition) {
  3190. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  3191. Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  3192. }
  3193. }
  3194. };
  3195. })();
  3196. (() => {
  3197. __webpack_require__.g = function() {
  3198. if (typeof globalThis === "object")
  3199. return globalThis;
  3200. try {
  3201. return this || new Function("return this")();
  3202. } catch (e) {
  3203. if (typeof window === "object")
  3204. return window;
  3205. }
  3206. }();
  3207. })();
  3208. (() => {
  3209. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  3210. })();
  3211. (() => {
  3212. __webpack_require__.r = (exports) => {
  3213. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  3214. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  3215. }
  3216. Object.defineProperty(exports, "__esModule", { value: true });
  3217. };
  3218. })();
  3219. var __webpack_exports__ = {};
  3220. (() => {
  3221. /*!*********************!*\
  3222. !*** ./src/hook.ts ***!
  3223. \*********************/
  3224. __webpack_require__.r(__webpack_exports__);
  3225. var _back_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
  3226. /*! @back/hook */
  3227. "../app-backend-core/lib/hook.js"
  3228. );
  3229. var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
  3230. /*! @vue-devtools/shared-utils */
  3231. "../shared-utils/lib/index.js"
  3232. );
  3233. (0, _back_hook__WEBPACK_IMPORTED_MODULE_0__.installHook)(_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target);
  3234. })();
  3235. })();
  3236. (function() {
  3237. var __webpack_modules__ = {
  3238. /***/
  3239. "../api/lib/esm/const.js": (
  3240. /*!*******************************!*\
  3241. !*** ../api/lib/esm/const.js ***!
  3242. \*******************************/
  3243. /***/
  3244. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3245. __webpack_require__2.r(__webpack_exports__2);
  3246. __webpack_require__2.d(__webpack_exports__2, {
  3247. /* harmony export */
  3248. "HOOK_PLUGIN_SETTINGS_SET": () => (
  3249. /* binding */
  3250. HOOK_PLUGIN_SETTINGS_SET
  3251. ),
  3252. /* harmony export */
  3253. "HOOK_SETUP": () => (
  3254. /* binding */
  3255. HOOK_SETUP
  3256. )
  3257. /* harmony export */
  3258. });
  3259. const HOOK_SETUP = "devtools-plugin:setup";
  3260. const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
  3261. }
  3262. ),
  3263. /***/
  3264. "../api/lib/esm/env.js": (
  3265. /*!*****************************!*\
  3266. !*** ../api/lib/esm/env.js ***!
  3267. \*****************************/
  3268. /***/
  3269. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3270. __webpack_require__2.r(__webpack_exports__2);
  3271. __webpack_require__2.d(__webpack_exports__2, {
  3272. /* harmony export */
  3273. "getDevtoolsGlobalHook": () => (
  3274. /* binding */
  3275. getDevtoolsGlobalHook
  3276. ),
  3277. /* harmony export */
  3278. "getTarget": () => (
  3279. /* binding */
  3280. getTarget2
  3281. ),
  3282. /* harmony export */
  3283. "isProxyAvailable": () => (
  3284. /* binding */
  3285. isProxyAvailable
  3286. )
  3287. /* harmony export */
  3288. });
  3289. function getDevtoolsGlobalHook() {
  3290. return getTarget2().__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3291. }
  3292. function getTarget2() {
  3293. return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  3294. }
  3295. const isProxyAvailable = typeof Proxy === "function";
  3296. }
  3297. ),
  3298. /***/
  3299. "../api/lib/esm/index.js": (
  3300. /*!*******************************!*\
  3301. !*** ../api/lib/esm/index.js ***!
  3302. \*******************************/
  3303. /***/
  3304. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3305. __webpack_require__2.r(__webpack_exports__2);
  3306. __webpack_require__2.d(__webpack_exports__2, {
  3307. /* harmony export */
  3308. "isPerformanceSupported": () => (
  3309. /* reexport safe */
  3310. _time_js__WEBPACK_IMPORTED_MODULE_0__.isPerformanceSupported
  3311. ),
  3312. /* harmony export */
  3313. "now": () => (
  3314. /* reexport safe */
  3315. _time_js__WEBPACK_IMPORTED_MODULE_0__.now
  3316. ),
  3317. /* harmony export */
  3318. "setupDevtoolsPlugin": () => (
  3319. /* binding */
  3320. setupDevtoolsPlugin
  3321. )
  3322. /* harmony export */
  3323. });
  3324. var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2(
  3325. /*! ./env.js */
  3326. "../api/lib/esm/env.js"
  3327. );
  3328. var _const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2(
  3329. /*! ./const.js */
  3330. "../api/lib/esm/const.js"
  3331. );
  3332. var _proxy_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2(
  3333. /*! ./proxy.js */
  3334. "../api/lib/esm/proxy.js"
  3335. );
  3336. var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2(
  3337. /*! ./time.js */
  3338. "../api/lib/esm/time.js"
  3339. );
  3340. function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  3341. const descriptor = pluginDescriptor;
  3342. const target = (0, _env_js__WEBPACK_IMPORTED_MODULE_1__.getTarget)();
  3343. const hook = (0, _env_js__WEBPACK_IMPORTED_MODULE_1__.getDevtoolsGlobalHook)();
  3344. const enableProxy = _env_js__WEBPACK_IMPORTED_MODULE_1__.isProxyAvailable && descriptor.enableEarlyProxy;
  3345. if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
  3346. hook.emit(_const_js__WEBPACK_IMPORTED_MODULE_2__.HOOK_SETUP, pluginDescriptor, setupFn);
  3347. } else {
  3348. const proxy = enableProxy ? new _proxy_js__WEBPACK_IMPORTED_MODULE_3__.ApiProxy(descriptor, hook) : null;
  3349. const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
  3350. list.push({
  3351. pluginDescriptor: descriptor,
  3352. setupFn,
  3353. proxy
  3354. });
  3355. if (proxy)
  3356. setupFn(proxy.proxiedTarget);
  3357. }
  3358. }
  3359. }
  3360. ),
  3361. /***/
  3362. "../api/lib/esm/proxy.js": (
  3363. /*!*******************************!*\
  3364. !*** ../api/lib/esm/proxy.js ***!
  3365. \*******************************/
  3366. /***/
  3367. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3368. __webpack_require__2.r(__webpack_exports__2);
  3369. __webpack_require__2.d(__webpack_exports__2, {
  3370. /* harmony export */
  3371. "ApiProxy": () => (
  3372. /* binding */
  3373. ApiProxy
  3374. )
  3375. /* harmony export */
  3376. });
  3377. var _const_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2(
  3378. /*! ./const.js */
  3379. "../api/lib/esm/const.js"
  3380. );
  3381. var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2(
  3382. /*! ./time.js */
  3383. "../api/lib/esm/time.js"
  3384. );
  3385. class ApiProxy {
  3386. constructor(plugin, hook) {
  3387. this.target = null;
  3388. this.targetQueue = [];
  3389. this.onQueue = [];
  3390. this.plugin = plugin;
  3391. this.hook = hook;
  3392. const defaultSettings = {};
  3393. if (plugin.settings) {
  3394. for (const id in plugin.settings) {
  3395. const item = plugin.settings[id];
  3396. defaultSettings[id] = item.defaultValue;
  3397. }
  3398. }
  3399. const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
  3400. let currentSettings = Object.assign({}, defaultSettings);
  3401. try {
  3402. const raw = localStorage.getItem(localSettingsSaveId);
  3403. const data = JSON.parse(raw);
  3404. Object.assign(currentSettings, data);
  3405. } catch (e) {
  3406. }
  3407. this.fallbacks = {
  3408. getSettings() {
  3409. return currentSettings;
  3410. },
  3411. setSettings(value) {
  3412. try {
  3413. localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
  3414. } catch (e) {
  3415. }
  3416. currentSettings = value;
  3417. },
  3418. now() {
  3419. return (0, _time_js__WEBPACK_IMPORTED_MODULE_0__.now)();
  3420. }
  3421. };
  3422. if (hook) {
  3423. hook.on(_const_js__WEBPACK_IMPORTED_MODULE_1__.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
  3424. if (pluginId === this.plugin.id) {
  3425. this.fallbacks.setSettings(value);
  3426. }
  3427. });
  3428. }
  3429. this.proxiedOn = new Proxy({}, {
  3430. get: (_target, prop) => {
  3431. if (this.target) {
  3432. return this.target.on[prop];
  3433. } else {
  3434. return (...args) => {
  3435. this.onQueue.push({
  3436. method: prop,
  3437. args
  3438. });
  3439. };
  3440. }
  3441. }
  3442. });
  3443. this.proxiedTarget = new Proxy({}, {
  3444. get: (_target, prop) => {
  3445. if (this.target) {
  3446. return this.target[prop];
  3447. } else if (prop === "on") {
  3448. return this.proxiedOn;
  3449. } else if (Object.keys(this.fallbacks).includes(prop)) {
  3450. return (...args) => {
  3451. this.targetQueue.push({
  3452. method: prop,
  3453. args,
  3454. resolve: () => {
  3455. }
  3456. });
  3457. return this.fallbacks[prop](...args);
  3458. };
  3459. } else {
  3460. return (...args) => {
  3461. return new Promise((resolve) => {
  3462. this.targetQueue.push({
  3463. method: prop,
  3464. args,
  3465. resolve
  3466. });
  3467. });
  3468. };
  3469. }
  3470. }
  3471. });
  3472. }
  3473. async setRealTarget(target) {
  3474. this.target = target;
  3475. for (const item of this.onQueue) {
  3476. this.target.on[item.method](...item.args);
  3477. }
  3478. for (const item of this.targetQueue) {
  3479. item.resolve(await this.target[item.method](...item.args));
  3480. }
  3481. }
  3482. }
  3483. }
  3484. ),
  3485. /***/
  3486. "../api/lib/esm/time.js": (
  3487. /*!******************************!*\
  3488. !*** ../api/lib/esm/time.js ***!
  3489. \******************************/
  3490. /***/
  3491. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3492. __webpack_require__2.r(__webpack_exports__2);
  3493. __webpack_require__2.d(__webpack_exports__2, {
  3494. /* harmony export */
  3495. "isPerformanceSupported": () => (
  3496. /* binding */
  3497. isPerformanceSupported
  3498. ),
  3499. /* harmony export */
  3500. "now": () => (
  3501. /* binding */
  3502. now
  3503. )
  3504. /* harmony export */
  3505. });
  3506. let supported;
  3507. let perf;
  3508. function isPerformanceSupported() {
  3509. var _a;
  3510. if (supported !== void 0) {
  3511. return supported;
  3512. }
  3513. if (typeof window !== "undefined" && window.performance) {
  3514. supported = true;
  3515. perf = window.performance;
  3516. } else if (typeof __webpack_require__2.g !== "undefined" && ((_a = __webpack_require__2.g.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
  3517. supported = true;
  3518. perf = __webpack_require__2.g.perf_hooks.performance;
  3519. } else {
  3520. supported = false;
  3521. }
  3522. return supported;
  3523. }
  3524. function now() {
  3525. return isPerformanceSupported() ? perf.now() : Date.now();
  3526. }
  3527. }
  3528. ),
  3529. /***/
  3530. "../app-backend-api/lib/api.js": (
  3531. /*!*************************************!*\
  3532. !*** ../app-backend-api/lib/api.js ***!
  3533. \*************************************/
  3534. /***/
  3535. (__unused_webpack_module, exports, __webpack_require__2) => {
  3536. Object.defineProperty(exports, "__esModule", {
  3537. value: true
  3538. });
  3539. exports.DevtoolsPluginApiInstance = exports.DevtoolsApi = void 0;
  3540. const shared_utils_1 = __webpack_require__2(
  3541. /*! @vue-devtools/shared-utils */
  3542. "../shared-utils/lib/index.js"
  3543. );
  3544. const devtools_api_1 = __webpack_require__2(
  3545. /*! @vue/devtools-api */
  3546. "../api/lib/esm/index.js"
  3547. );
  3548. const hooks_1 = __webpack_require__2(
  3549. /*! ./hooks */
  3550. "../app-backend-api/lib/hooks.js"
  3551. );
  3552. const pluginOn = [];
  3553. class DevtoolsApi {
  3554. constructor(backend, ctx) {
  3555. this.stateEditor = new shared_utils_1.StateEditor();
  3556. this.backend = backend;
  3557. this.ctx = ctx;
  3558. this.bridge = ctx.bridge;
  3559. this.on = new hooks_1.DevtoolsHookable(ctx);
  3560. }
  3561. async callHook(eventType, payload, ctx = this.ctx) {
  3562. payload = await this.on.callHandlers(eventType, payload, ctx);
  3563. for (const on of pluginOn) {
  3564. payload = await on.callHandlers(eventType, payload, ctx);
  3565. }
  3566. return payload;
  3567. }
  3568. async transformCall(callName, ...args) {
  3569. const payload = await this.callHook(
  3570. "transformCall",
  3571. {
  3572. callName,
  3573. inArgs: args,
  3574. outArgs: args.slice()
  3575. }
  3576. );
  3577. return payload.outArgs;
  3578. }
  3579. async getAppRecordName(app, defaultName) {
  3580. const payload = await this.callHook(
  3581. "getAppRecordName",
  3582. {
  3583. app,
  3584. name: null
  3585. }
  3586. );
  3587. if (payload.name) {
  3588. return payload.name;
  3589. } else {
  3590. return `App ${defaultName}`;
  3591. }
  3592. }
  3593. async getAppRootInstance(app) {
  3594. const payload = await this.callHook(
  3595. "getAppRootInstance",
  3596. {
  3597. app,
  3598. root: null
  3599. }
  3600. );
  3601. return payload.root;
  3602. }
  3603. async registerApplication(app) {
  3604. await this.callHook(
  3605. "registerApplication",
  3606. {
  3607. app
  3608. }
  3609. );
  3610. }
  3611. async walkComponentTree(instance, maxDepth = -1, filter = null, recursively = false) {
  3612. const payload = await this.callHook(
  3613. "walkComponentTree",
  3614. {
  3615. componentInstance: instance,
  3616. componentTreeData: null,
  3617. maxDepth,
  3618. filter,
  3619. recursively
  3620. }
  3621. );
  3622. return payload.componentTreeData;
  3623. }
  3624. async visitComponentTree(instance, treeNode, filter = null, app) {
  3625. const payload = await this.callHook(
  3626. "visitComponentTree",
  3627. {
  3628. app,
  3629. componentInstance: instance,
  3630. treeNode,
  3631. filter
  3632. }
  3633. );
  3634. return payload.treeNode;
  3635. }
  3636. async walkComponentParents(instance) {
  3637. const payload = await this.callHook(
  3638. "walkComponentParents",
  3639. {
  3640. componentInstance: instance,
  3641. parentInstances: []
  3642. }
  3643. );
  3644. return payload.parentInstances;
  3645. }
  3646. async inspectComponent(instance, app) {
  3647. const payload = await this.callHook(
  3648. "inspectComponent",
  3649. {
  3650. app,
  3651. componentInstance: instance,
  3652. instanceData: null
  3653. }
  3654. );
  3655. return payload.instanceData;
  3656. }
  3657. async getComponentBounds(instance) {
  3658. const payload = await this.callHook(
  3659. "getComponentBounds",
  3660. {
  3661. componentInstance: instance,
  3662. bounds: null
  3663. }
  3664. );
  3665. return payload.bounds;
  3666. }
  3667. async getComponentName(instance) {
  3668. const payload = await this.callHook(
  3669. "getComponentName",
  3670. {
  3671. componentInstance: instance,
  3672. name: null
  3673. }
  3674. );
  3675. return payload.name;
  3676. }
  3677. async getComponentInstances(app) {
  3678. const payload = await this.callHook(
  3679. "getComponentInstances",
  3680. {
  3681. app,
  3682. componentInstances: []
  3683. }
  3684. );
  3685. return payload.componentInstances;
  3686. }
  3687. async getElementComponent(element) {
  3688. const payload = await this.callHook(
  3689. "getElementComponent",
  3690. {
  3691. element,
  3692. componentInstance: null
  3693. }
  3694. );
  3695. return payload.componentInstance;
  3696. }
  3697. async getComponentRootElements(instance) {
  3698. const payload = await this.callHook(
  3699. "getComponentRootElements",
  3700. {
  3701. componentInstance: instance,
  3702. rootElements: []
  3703. }
  3704. );
  3705. return payload.rootElements;
  3706. }
  3707. async editComponentState(instance, dotPath, type, state, app) {
  3708. const arrayPath = dotPath.split(".");
  3709. const payload = await this.callHook(
  3710. "editComponentState",
  3711. {
  3712. app,
  3713. componentInstance: instance,
  3714. path: arrayPath,
  3715. type,
  3716. state,
  3717. set: (object, path = arrayPath, value = state.value, cb) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
  3718. }
  3719. );
  3720. return payload.componentInstance;
  3721. }
  3722. async getComponentDevtoolsOptions(instance) {
  3723. const payload = await this.callHook(
  3724. "getAppDevtoolsOptions",
  3725. {
  3726. componentInstance: instance,
  3727. options: null
  3728. }
  3729. );
  3730. return payload.options || {};
  3731. }
  3732. async getComponentRenderCode(instance) {
  3733. const payload = await this.callHook(
  3734. "getComponentRenderCode",
  3735. {
  3736. componentInstance: instance,
  3737. code: null
  3738. }
  3739. );
  3740. return {
  3741. code: payload.code
  3742. };
  3743. }
  3744. async inspectTimelineEvent(eventData, app) {
  3745. const payload = await this.callHook(
  3746. "inspectTimelineEvent",
  3747. {
  3748. event: eventData.event,
  3749. layerId: eventData.layerId,
  3750. app,
  3751. data: eventData.event.data,
  3752. all: eventData.all
  3753. }
  3754. );
  3755. return payload.data;
  3756. }
  3757. async clearTimeline() {
  3758. await this.callHook(
  3759. "timelineCleared",
  3760. {}
  3761. );
  3762. }
  3763. async getInspectorTree(inspectorId, app, filter) {
  3764. const payload = await this.callHook(
  3765. "getInspectorTree",
  3766. {
  3767. inspectorId,
  3768. app,
  3769. filter,
  3770. rootNodes: []
  3771. }
  3772. );
  3773. return payload.rootNodes;
  3774. }
  3775. async getInspectorState(inspectorId, app, nodeId) {
  3776. const payload = await this.callHook(
  3777. "getInspectorState",
  3778. {
  3779. inspectorId,
  3780. app,
  3781. nodeId,
  3782. state: null
  3783. }
  3784. );
  3785. return payload.state;
  3786. }
  3787. async editInspectorState(inspectorId, app, nodeId, dotPath, type, state) {
  3788. const arrayPath = dotPath.split(".");
  3789. await this.callHook(
  3790. "editInspectorState",
  3791. {
  3792. inspectorId,
  3793. app,
  3794. nodeId,
  3795. path: arrayPath,
  3796. type,
  3797. state,
  3798. set: (object, path = arrayPath, value = state.value, cb) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
  3799. }
  3800. );
  3801. }
  3802. now() {
  3803. return (0, devtools_api_1.now)();
  3804. }
  3805. }
  3806. exports.DevtoolsApi = DevtoolsApi;
  3807. class DevtoolsPluginApiInstance {
  3808. constructor(plugin, appRecord, ctx) {
  3809. this.bridge = ctx.bridge;
  3810. this.ctx = ctx;
  3811. this.plugin = plugin;
  3812. this.appRecord = appRecord;
  3813. this.backendApi = appRecord.backend.api;
  3814. this.defaultSettings = (0, shared_utils_1.getPluginDefaultSettings)(plugin.descriptor.settings);
  3815. this.on = new hooks_1.DevtoolsHookable(ctx, plugin);
  3816. pluginOn.push(this.on);
  3817. }
  3818. // Plugin API
  3819. async notifyComponentUpdate(instance = null) {
  3820. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3821. return;
  3822. if (instance) {
  3823. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UPDATED, ...await this.backendApi.transformCall(shared_utils_1.HookEvents.COMPONENT_UPDATED, instance));
  3824. } else {
  3825. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UPDATED);
  3826. }
  3827. }
  3828. addTimelineLayer(options) {
  3829. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.TIMELINE))
  3830. return false;
  3831. this.ctx.hook.emit(shared_utils_1.HookEvents.TIMELINE_LAYER_ADDED, options, this.plugin);
  3832. return true;
  3833. }
  3834. addTimelineEvent(options) {
  3835. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.TIMELINE))
  3836. return false;
  3837. this.ctx.hook.emit(shared_utils_1.HookEvents.TIMELINE_EVENT_ADDED, options, this.plugin);
  3838. return true;
  3839. }
  3840. addInspector(options) {
  3841. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3842. return false;
  3843. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_ADD, options, this.plugin);
  3844. return true;
  3845. }
  3846. sendInspectorTree(inspectorId) {
  3847. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3848. return false;
  3849. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_TREE, inspectorId, this.plugin);
  3850. return true;
  3851. }
  3852. sendInspectorState(inspectorId) {
  3853. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3854. return false;
  3855. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_STATE, inspectorId, this.plugin);
  3856. return true;
  3857. }
  3858. selectInspectorNode(inspectorId, nodeId) {
  3859. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3860. return false;
  3861. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SELECT_NODE, inspectorId, nodeId, this.plugin);
  3862. return true;
  3863. }
  3864. getComponentBounds(instance) {
  3865. return this.backendApi.getComponentBounds(instance);
  3866. }
  3867. getComponentName(instance) {
  3868. return this.backendApi.getComponentName(instance);
  3869. }
  3870. getComponentInstances(app) {
  3871. return this.backendApi.getComponentInstances(app);
  3872. }
  3873. highlightElement(instance) {
  3874. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3875. return false;
  3876. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_HIGHLIGHT, instance.__VUE_DEVTOOLS_UID__, this.plugin);
  3877. return true;
  3878. }
  3879. unhighlightElement() {
  3880. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3881. return false;
  3882. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UNHIGHLIGHT, this.plugin);
  3883. return true;
  3884. }
  3885. getSettings(pluginId) {
  3886. return (0, shared_utils_1.getPluginSettings)(pluginId !== null && pluginId !== void 0 ? pluginId : this.plugin.descriptor.id, this.defaultSettings);
  3887. }
  3888. setSettings(value, pluginId) {
  3889. (0, shared_utils_1.setPluginSettings)(pluginId !== null && pluginId !== void 0 ? pluginId : this.plugin.descriptor.id, value);
  3890. }
  3891. now() {
  3892. return (0, devtools_api_1.now)();
  3893. }
  3894. get enabled() {
  3895. return (0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, shared_utils_1.PluginPermission.ENABLED);
  3896. }
  3897. hasPermission(permission) {
  3898. return (0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, permission);
  3899. }
  3900. }
  3901. exports.DevtoolsPluginApiInstance = DevtoolsPluginApiInstance;
  3902. }
  3903. ),
  3904. /***/
  3905. "../app-backend-api/lib/app-record.js": (
  3906. /*!********************************************!*\
  3907. !*** ../app-backend-api/lib/app-record.js ***!
  3908. \********************************************/
  3909. /***/
  3910. (__unused_webpack_module, exports) => {
  3911. Object.defineProperty(exports, "__esModule", {
  3912. value: true
  3913. });
  3914. }
  3915. ),
  3916. /***/
  3917. "../app-backend-api/lib/backend-context.js": (
  3918. /*!*************************************************!*\
  3919. !*** ../app-backend-api/lib/backend-context.js ***!
  3920. \*************************************************/
  3921. /***/
  3922. (__unused_webpack_module, exports) => {
  3923. Object.defineProperty(exports, "__esModule", {
  3924. value: true
  3925. });
  3926. exports.createBackendContext = void 0;
  3927. function createBackendContext(options) {
  3928. return {
  3929. bridge: options.bridge,
  3930. hook: options.hook,
  3931. backends: [],
  3932. appRecords: [],
  3933. currentTab: null,
  3934. currentAppRecord: null,
  3935. currentInspectedComponentId: null,
  3936. plugins: [],
  3937. currentPlugin: null,
  3938. timelineLayers: [],
  3939. nextTimelineEventId: 0,
  3940. timelineEventMap: /* @__PURE__ */ new Map(),
  3941. perfUniqueGroupId: 0,
  3942. customInspectors: [],
  3943. timelineMarkers: []
  3944. };
  3945. }
  3946. exports.createBackendContext = createBackendContext;
  3947. }
  3948. ),
  3949. /***/
  3950. "../app-backend-api/lib/backend.js": (
  3951. /*!*****************************************!*\
  3952. !*** ../app-backend-api/lib/backend.js ***!
  3953. \*****************************************/
  3954. /***/
  3955. (__unused_webpack_module, exports, __webpack_require__2) => {
  3956. Object.defineProperty(exports, "__esModule", {
  3957. value: true
  3958. });
  3959. exports.createBackend = exports.defineBackend = exports.BuiltinBackendFeature = void 0;
  3960. const api_1 = __webpack_require__2(
  3961. /*! ./api */
  3962. "../app-backend-api/lib/api.js"
  3963. );
  3964. (function(BuiltinBackendFeature) {
  3965. BuiltinBackendFeature["FLUSH"] = "flush";
  3966. })(exports.BuiltinBackendFeature || (exports.BuiltinBackendFeature = {}));
  3967. function defineBackend(options) {
  3968. return options;
  3969. }
  3970. exports.defineBackend = defineBackend;
  3971. function createBackend(options, ctx) {
  3972. const backend = {
  3973. options,
  3974. api: null
  3975. };
  3976. backend.api = new api_1.DevtoolsApi(backend, ctx);
  3977. options.setup(backend.api);
  3978. return backend;
  3979. }
  3980. exports.createBackend = createBackend;
  3981. }
  3982. ),
  3983. /***/
  3984. "../app-backend-api/lib/global-hook.js": (
  3985. /*!*********************************************!*\
  3986. !*** ../app-backend-api/lib/global-hook.js ***!
  3987. \*********************************************/
  3988. /***/
  3989. (__unused_webpack_module, exports) => {
  3990. Object.defineProperty(exports, "__esModule", {
  3991. value: true
  3992. });
  3993. }
  3994. ),
  3995. /***/
  3996. "../app-backend-api/lib/hooks.js": (
  3997. /*!***************************************!*\
  3998. !*** ../app-backend-api/lib/hooks.js ***!
  3999. \***************************************/
  4000. /***/
  4001. (__unused_webpack_module, exports, __webpack_require__2) => {
  4002. Object.defineProperty(exports, "__esModule", {
  4003. value: true
  4004. });
  4005. exports.DevtoolsHookable = void 0;
  4006. const shared_utils_1 = __webpack_require__2(
  4007. /*! @vue-devtools/shared-utils */
  4008. "../shared-utils/lib/index.js"
  4009. );
  4010. class DevtoolsHookable {
  4011. constructor(ctx, plugin = null) {
  4012. this.handlers = {};
  4013. this.ctx = ctx;
  4014. this.plugin = plugin;
  4015. }
  4016. hook(eventType, handler, pluginPermision = null) {
  4017. const handlers = this.handlers[eventType] = this.handlers[eventType] || [];
  4018. if (this.plugin) {
  4019. const originalHandler = handler;
  4020. handler = (...args) => {
  4021. var _a;
  4022. if (!(0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, shared_utils_1.PluginPermission.ENABLED) || pluginPermision && !(0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, pluginPermision))
  4023. return;
  4024. if (!this.plugin.descriptor.disableAppScope && ((_a = this.ctx.currentAppRecord) === null || _a === void 0 ? void 0 : _a.options.app) !== this.plugin.descriptor.app)
  4025. return;
  4026. if (!this.plugin.descriptor.disablePluginScope && args[0].pluginId != null && args[0].pluginId !== this.plugin.descriptor.id)
  4027. return;
  4028. return originalHandler(...args);
  4029. };
  4030. }
  4031. handlers.push({
  4032. handler,
  4033. plugin: this.ctx.currentPlugin
  4034. });
  4035. }
  4036. async callHandlers(eventType, payload, ctx) {
  4037. if (this.handlers[eventType]) {
  4038. const handlers = this.handlers[eventType];
  4039. for (let i = 0; i < handlers.length; i++) {
  4040. const {
  4041. handler,
  4042. plugin
  4043. } = handlers[i];
  4044. try {
  4045. await handler(payload, ctx);
  4046. } catch (e) {
  4047. console.error(`An error occurred in hook '${eventType}'${plugin ? ` registered by plugin '${plugin.descriptor.id}'` : ""} with payload:`, payload);
  4048. console.error(e);
  4049. }
  4050. }
  4051. }
  4052. return payload;
  4053. }
  4054. transformCall(handler) {
  4055. this.hook(
  4056. "transformCall",
  4057. handler
  4058. );
  4059. }
  4060. getAppRecordName(handler) {
  4061. this.hook(
  4062. "getAppRecordName",
  4063. handler
  4064. );
  4065. }
  4066. getAppRootInstance(handler) {
  4067. this.hook(
  4068. "getAppRootInstance",
  4069. handler
  4070. );
  4071. }
  4072. registerApplication(handler) {
  4073. this.hook(
  4074. "registerApplication",
  4075. handler
  4076. );
  4077. }
  4078. walkComponentTree(handler) {
  4079. this.hook(
  4080. "walkComponentTree",
  4081. handler,
  4082. shared_utils_1.PluginPermission.COMPONENTS
  4083. );
  4084. }
  4085. visitComponentTree(handler) {
  4086. this.hook(
  4087. "visitComponentTree",
  4088. handler,
  4089. shared_utils_1.PluginPermission.COMPONENTS
  4090. );
  4091. }
  4092. walkComponentParents(handler) {
  4093. this.hook(
  4094. "walkComponentParents",
  4095. handler,
  4096. shared_utils_1.PluginPermission.COMPONENTS
  4097. );
  4098. }
  4099. inspectComponent(handler) {
  4100. this.hook(
  4101. "inspectComponent",
  4102. handler,
  4103. shared_utils_1.PluginPermission.COMPONENTS
  4104. );
  4105. }
  4106. getComponentBounds(handler) {
  4107. this.hook(
  4108. "getComponentBounds",
  4109. handler,
  4110. shared_utils_1.PluginPermission.COMPONENTS
  4111. );
  4112. }
  4113. getComponentName(handler) {
  4114. this.hook(
  4115. "getComponentName",
  4116. handler,
  4117. shared_utils_1.PluginPermission.COMPONENTS
  4118. );
  4119. }
  4120. getComponentInstances(handler) {
  4121. this.hook(
  4122. "getComponentInstances",
  4123. handler,
  4124. shared_utils_1.PluginPermission.COMPONENTS
  4125. );
  4126. }
  4127. getElementComponent(handler) {
  4128. this.hook(
  4129. "getElementComponent",
  4130. handler,
  4131. shared_utils_1.PluginPermission.COMPONENTS
  4132. );
  4133. }
  4134. getComponentRootElements(handler) {
  4135. this.hook(
  4136. "getComponentRootElements",
  4137. handler,
  4138. shared_utils_1.PluginPermission.COMPONENTS
  4139. );
  4140. }
  4141. editComponentState(handler) {
  4142. this.hook(
  4143. "editComponentState",
  4144. handler,
  4145. shared_utils_1.PluginPermission.COMPONENTS
  4146. );
  4147. }
  4148. getComponentDevtoolsOptions(handler) {
  4149. this.hook(
  4150. "getAppDevtoolsOptions",
  4151. handler,
  4152. shared_utils_1.PluginPermission.COMPONENTS
  4153. );
  4154. }
  4155. getComponentRenderCode(handler) {
  4156. this.hook(
  4157. "getComponentRenderCode",
  4158. handler,
  4159. shared_utils_1.PluginPermission.COMPONENTS
  4160. );
  4161. }
  4162. inspectTimelineEvent(handler) {
  4163. this.hook(
  4164. "inspectTimelineEvent",
  4165. handler,
  4166. shared_utils_1.PluginPermission.TIMELINE
  4167. );
  4168. }
  4169. timelineCleared(handler) {
  4170. this.hook(
  4171. "timelineCleared",
  4172. handler,
  4173. shared_utils_1.PluginPermission.TIMELINE
  4174. );
  4175. }
  4176. getInspectorTree(handler) {
  4177. this.hook(
  4178. "getInspectorTree",
  4179. handler,
  4180. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4181. );
  4182. }
  4183. getInspectorState(handler) {
  4184. this.hook(
  4185. "getInspectorState",
  4186. handler,
  4187. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4188. );
  4189. }
  4190. editInspectorState(handler) {
  4191. this.hook(
  4192. "editInspectorState",
  4193. handler,
  4194. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4195. );
  4196. }
  4197. setPluginSettings(handler) {
  4198. this.hook(
  4199. "setPluginSettings",
  4200. handler
  4201. );
  4202. }
  4203. }
  4204. exports.DevtoolsHookable = DevtoolsHookable;
  4205. }
  4206. ),
  4207. /***/
  4208. "../app-backend-api/lib/index.js": (
  4209. /*!***************************************!*\
  4210. !*** ../app-backend-api/lib/index.js ***!
  4211. \***************************************/
  4212. /***/
  4213. function(__unused_webpack_module, exports, __webpack_require__2) {
  4214. var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
  4215. if (k2 === void 0)
  4216. k2 = k;
  4217. var desc = Object.getOwnPropertyDescriptor(m, k);
  4218. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4219. desc = {
  4220. enumerable: true,
  4221. get: function() {
  4222. return m[k];
  4223. }
  4224. };
  4225. }
  4226. Object.defineProperty(o, k2, desc);
  4227. } : function(o, m, k, k2) {
  4228. if (k2 === void 0)
  4229. k2 = k;
  4230. o[k2] = m[k];
  4231. });
  4232. var __exportStar = this && this.__exportStar || function(m, exports2) {
  4233. for (var p in m)
  4234. if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
  4235. __createBinding(exports2, m, p);
  4236. };
  4237. Object.defineProperty(exports, "__esModule", {
  4238. value: true
  4239. });
  4240. __exportStar(__webpack_require__2(
  4241. /*! ./api */
  4242. "../app-backend-api/lib/api.js"
  4243. ), exports);
  4244. __exportStar(__webpack_require__2(
  4245. /*! ./app-record */
  4246. "../app-backend-api/lib/app-record.js"
  4247. ), exports);
  4248. __exportStar(__webpack_require__2(
  4249. /*! ./backend */
  4250. "../app-backend-api/lib/backend.js"
  4251. ), exports);
  4252. __exportStar(__webpack_require__2(
  4253. /*! ./backend-context */
  4254. "../app-backend-api/lib/backend-context.js"
  4255. ), exports);
  4256. __exportStar(__webpack_require__2(
  4257. /*! ./global-hook */
  4258. "../app-backend-api/lib/global-hook.js"
  4259. ), exports);
  4260. __exportStar(__webpack_require__2(
  4261. /*! ./hooks */
  4262. "../app-backend-api/lib/hooks.js"
  4263. ), exports);
  4264. __exportStar(__webpack_require__2(
  4265. /*! ./plugin */
  4266. "../app-backend-api/lib/plugin.js"
  4267. ), exports);
  4268. }
  4269. ),
  4270. /***/
  4271. "../app-backend-api/lib/plugin.js": (
  4272. /*!****************************************!*\
  4273. !*** ../app-backend-api/lib/plugin.js ***!
  4274. \****************************************/
  4275. /***/
  4276. (__unused_webpack_module, exports) => {
  4277. Object.defineProperty(exports, "__esModule", {
  4278. value: true
  4279. });
  4280. }
  4281. ),
  4282. /***/
  4283. "../app-backend-core/lib/app.js": (
  4284. /*!**************************************!*\
  4285. !*** ../app-backend-core/lib/app.js ***!
  4286. \**************************************/
  4287. /***/
  4288. function(__unused_webpack_module, exports, __webpack_require__2) {
  4289. var __importDefault = this && this.__importDefault || function(mod) {
  4290. return mod && mod.__esModule ? mod : {
  4291. "default": mod
  4292. };
  4293. };
  4294. Object.defineProperty(exports, "__esModule", {
  4295. value: true
  4296. });
  4297. exports._legacy_getAndRegisterApps = exports.removeApp = exports.sendApps = exports.waitForAppsRegistration = exports.getAppRecord = exports.getAppRecordId = exports.mapAppRecord = exports.selectApp = exports.registerApp = void 0;
  4298. const shared_utils_1 = __webpack_require__2(
  4299. /*! @vue-devtools/shared-utils */
  4300. "../shared-utils/lib/index.js"
  4301. );
  4302. const speakingurl_1 = __importDefault(__webpack_require__2(
  4303. /*! speakingurl */
  4304. "../../node_modules/speakingurl/index.js"
  4305. ));
  4306. const queue_1 = __webpack_require__2(
  4307. /*! ./util/queue */
  4308. "../app-backend-core/lib/util/queue.js"
  4309. );
  4310. const scan_1 = __webpack_require__2(
  4311. /*! ./legacy/scan */
  4312. "../app-backend-core/lib/legacy/scan.js"
  4313. );
  4314. const timeline_1 = __webpack_require__2(
  4315. /*! ./timeline */
  4316. "../app-backend-core/lib/timeline.js"
  4317. );
  4318. const backend_1 = __webpack_require__2(
  4319. /*! ./backend */
  4320. "../app-backend-core/lib/backend.js"
  4321. );
  4322. const global_hook_js_1 = __webpack_require__2(
  4323. /*! ./global-hook.js */
  4324. "../app-backend-core/lib/global-hook.js"
  4325. );
  4326. const jobs = new queue_1.JobQueue();
  4327. let recordId = 0;
  4328. const appRecordPromises = /* @__PURE__ */ new Map();
  4329. async function registerApp(options, ctx) {
  4330. return jobs.queue("regiserApp", () => registerAppJob(options, ctx));
  4331. }
  4332. exports.registerApp = registerApp;
  4333. async function registerAppJob(options, ctx) {
  4334. if (ctx.appRecords.find((a) => a.options.app === options.app)) {
  4335. return;
  4336. }
  4337. if (!options.version) {
  4338. throw new Error("[Vue Devtools] Vue version not found");
  4339. }
  4340. const baseFrameworkVersion = parseInt(options.version.substring(0, options.version.indexOf(".")));
  4341. for (let i = 0; i < backend_1.availableBackends.length; i++) {
  4342. const backendOptions = backend_1.availableBackends[i];
  4343. if (backendOptions.frameworkVersion === baseFrameworkVersion) {
  4344. const backend = (0, backend_1.getBackend)(backendOptions, ctx);
  4345. await createAppRecord(options, backend, ctx);
  4346. break;
  4347. }
  4348. }
  4349. }
  4350. async function createAppRecord(options, backend, ctx) {
  4351. var _a, _b, _c;
  4352. const rootInstance = await backend.api.getAppRootInstance(options.app);
  4353. if (rootInstance) {
  4354. if ((await backend.api.getComponentDevtoolsOptions(rootInstance)).hide) {
  4355. options.app._vueDevtools_hidden_ = true;
  4356. return;
  4357. }
  4358. recordId++;
  4359. const name = await backend.api.getAppRecordName(options.app, recordId.toString());
  4360. const id = getAppRecordId(options.app, (0, speakingurl_1.default)(name));
  4361. const [el] = await backend.api.getComponentRootElements(rootInstance);
  4362. const record = {
  4363. id,
  4364. name,
  4365. options,
  4366. backend,
  4367. lastInspectedComponentId: null,
  4368. instanceMap: /* @__PURE__ */ new Map(),
  4369. rootInstance,
  4370. perfGroupIds: /* @__PURE__ */ new Map(),
  4371. iframe: shared_utils_1.isBrowser && el && document !== el.ownerDocument ? (_b = (_a = el.ownerDocument) === null || _a === void 0 ? void 0 : _a.location) === null || _b === void 0 ? void 0 : _b.pathname : null,
  4372. meta: (_c = options.meta) !== null && _c !== void 0 ? _c : {}
  4373. };
  4374. options.app.__VUE_DEVTOOLS_APP_RECORD__ = record;
  4375. const rootId = `${record.id}:root`;
  4376. record.instanceMap.set(rootId, record.rootInstance);
  4377. record.rootInstance.__VUE_DEVTOOLS_UID__ = rootId;
  4378. (0, timeline_1.addBuiltinLayers)(record, ctx);
  4379. ctx.appRecords.push(record);
  4380. if (backend.options.setupApp) {
  4381. backend.options.setupApp(backend.api, record);
  4382. }
  4383. await backend.api.registerApplication(options.app);
  4384. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_ADD, {
  4385. appRecord: mapAppRecord(record)
  4386. });
  4387. if (appRecordPromises.has(options.app)) {
  4388. for (const r of appRecordPromises.get(options.app)) {
  4389. await r(record);
  4390. }
  4391. }
  4392. if (ctx.currentAppRecord == null) {
  4393. await selectApp(record, ctx);
  4394. }
  4395. } else if (shared_utils_1.SharedData.debugInfo) {
  4396. console.warn("[Vue devtools] No root instance found for app, it might have been unmounted", options.app);
  4397. }
  4398. }
  4399. async function selectApp(record, ctx) {
  4400. ctx.currentAppRecord = record;
  4401. ctx.currentInspectedComponentId = record.lastInspectedComponentId;
  4402. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_SELECTED, {
  4403. id: record.id,
  4404. lastInspectedComponentId: record.lastInspectedComponentId
  4405. });
  4406. }
  4407. exports.selectApp = selectApp;
  4408. function mapAppRecord(record) {
  4409. return {
  4410. id: record.id,
  4411. name: record.name,
  4412. version: record.options.version,
  4413. iframe: record.iframe
  4414. };
  4415. }
  4416. exports.mapAppRecord = mapAppRecord;
  4417. const appIds = /* @__PURE__ */ new Set();
  4418. function getAppRecordId(app, defaultId) {
  4419. if (app.__VUE_DEVTOOLS_APP_RECORD_ID__ != null) {
  4420. return app.__VUE_DEVTOOLS_APP_RECORD_ID__;
  4421. }
  4422. let id = defaultId !== null && defaultId !== void 0 ? defaultId : (recordId++).toString();
  4423. if (defaultId && appIds.has(id)) {
  4424. let count = 1;
  4425. while (appIds.has(`${defaultId}_${count}`)) {
  4426. count++;
  4427. }
  4428. id = `${defaultId}_${count}`;
  4429. }
  4430. appIds.add(id);
  4431. app.__VUE_DEVTOOLS_APP_RECORD_ID__ = id;
  4432. return id;
  4433. }
  4434. exports.getAppRecordId = getAppRecordId;
  4435. async function getAppRecord(app, ctx) {
  4436. var _a;
  4437. const record = (_a = app.__VUE_DEVTOOLS_APP_RECORD__) !== null && _a !== void 0 ? _a : ctx.appRecords.find((ar) => ar.options.app === app);
  4438. if (record) {
  4439. return record;
  4440. }
  4441. if (app._vueDevtools_hidden_)
  4442. return null;
  4443. return new Promise((resolve, reject) => {
  4444. let resolvers = appRecordPromises.get(app);
  4445. let timedOut = false;
  4446. if (!resolvers) {
  4447. resolvers = [];
  4448. appRecordPromises.set(app, resolvers);
  4449. }
  4450. const fn = (record2) => {
  4451. if (!timedOut) {
  4452. clearTimeout(timer);
  4453. resolve(record2);
  4454. }
  4455. };
  4456. resolvers.push(fn);
  4457. const timer = setTimeout(() => {
  4458. timedOut = true;
  4459. const index = resolvers.indexOf(fn);
  4460. if (index !== -1)
  4461. resolvers.splice(index, 1);
  4462. if (shared_utils_1.SharedData.debugInfo) {
  4463. console.log("Timed out waiting for app record", app);
  4464. }
  4465. reject(new Error(`Timed out getting app record for app`));
  4466. }, 6e4);
  4467. });
  4468. }
  4469. exports.getAppRecord = getAppRecord;
  4470. function waitForAppsRegistration() {
  4471. return jobs.queue("waitForAppsRegistrationNoop", async () => {
  4472. });
  4473. }
  4474. exports.waitForAppsRegistration = waitForAppsRegistration;
  4475. async function sendApps(ctx) {
  4476. const appRecords = [];
  4477. for (const appRecord of ctx.appRecords) {
  4478. appRecords.push(appRecord);
  4479. }
  4480. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_LIST, {
  4481. apps: appRecords.map(mapAppRecord)
  4482. });
  4483. }
  4484. exports.sendApps = sendApps;
  4485. function removeAppRecord(appRecord, ctx) {
  4486. try {
  4487. appIds.delete(appRecord.id);
  4488. const index = ctx.appRecords.indexOf(appRecord);
  4489. if (index !== -1)
  4490. ctx.appRecords.splice(index, 1);
  4491. (0, timeline_1.removeLayersForApp)(appRecord.options.app, ctx);
  4492. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_REMOVE, {
  4493. id: appRecord.id
  4494. });
  4495. } catch (e) {
  4496. if (shared_utils_1.SharedData.debugInfo) {
  4497. console.error(e);
  4498. }
  4499. }
  4500. }
  4501. async function removeApp(app, ctx) {
  4502. try {
  4503. const appRecord = await getAppRecord(app, ctx);
  4504. if (appRecord) {
  4505. removeAppRecord(appRecord, ctx);
  4506. }
  4507. } catch (e) {
  4508. if (shared_utils_1.SharedData.debugInfo) {
  4509. console.error(e);
  4510. }
  4511. }
  4512. }
  4513. exports.removeApp = removeApp;
  4514. let scanTimeout;
  4515. function _legacy_getAndRegisterApps(ctx, clear = false) {
  4516. setTimeout(() => {
  4517. try {
  4518. if (clear) {
  4519. ctx.appRecords.forEach((appRecord) => {
  4520. if (appRecord.meta.Vue) {
  4521. removeAppRecord(appRecord, ctx);
  4522. }
  4523. });
  4524. }
  4525. const apps = (0, scan_1.scan)();
  4526. clearTimeout(scanTimeout);
  4527. if (!apps.length) {
  4528. scanTimeout = setTimeout(() => _legacy_getAndRegisterApps(ctx), 1e3);
  4529. }
  4530. apps.forEach((app) => {
  4531. const Vue = global_hook_js_1.hook.Vue;
  4532. registerApp({
  4533. app,
  4534. types: {},
  4535. version: Vue === null || Vue === void 0 ? void 0 : Vue.version,
  4536. meta: {
  4537. Vue
  4538. }
  4539. }, ctx);
  4540. });
  4541. } catch (e) {
  4542. console.error(`Error scanning for legacy apps:`);
  4543. console.error(e);
  4544. }
  4545. }, 0);
  4546. }
  4547. exports._legacy_getAndRegisterApps = _legacy_getAndRegisterApps;
  4548. }
  4549. ),
  4550. /***/
  4551. "../app-backend-core/lib/backend.js": (
  4552. /*!******************************************!*\
  4553. !*** ../app-backend-core/lib/backend.js ***!
  4554. \******************************************/
  4555. /***/
  4556. (__unused_webpack_module, exports, __webpack_require__2) => {
  4557. Object.defineProperty(exports, "__esModule", {
  4558. value: true
  4559. });
  4560. exports.getBackend = exports.availableBackends = void 0;
  4561. const app_backend_api_1 = __webpack_require__2(
  4562. /*! @vue-devtools/app-backend-api */
  4563. "../app-backend-api/lib/index.js"
  4564. );
  4565. const app_backend_vue3_1 = __webpack_require__2(
  4566. /*! @vue-devtools/app-backend-vue3 */
  4567. "../app-backend-vue3/lib/index.js"
  4568. );
  4569. const perf_1 = __webpack_require__2(
  4570. /*! ./perf */
  4571. "../app-backend-core/lib/perf.js"
  4572. );
  4573. exports.availableBackends = [
  4574. // backendVue1,
  4575. // backendVue2,
  4576. app_backend_vue3_1.backend
  4577. ];
  4578. const enabledBackends = /* @__PURE__ */ new Map();
  4579. function getBackend(backendOptions, ctx) {
  4580. let backend;
  4581. if (!enabledBackends.has(backendOptions)) {
  4582. backend = (0, app_backend_api_1.createBackend)(backendOptions, ctx);
  4583. (0, perf_1.handleAddPerformanceTag)(backend, ctx);
  4584. enabledBackends.set(backendOptions, backend);
  4585. ctx.backends.push(backend);
  4586. } else {
  4587. backend = enabledBackends.get(backendOptions);
  4588. }
  4589. return backend;
  4590. }
  4591. exports.getBackend = getBackend;
  4592. }
  4593. ),
  4594. /***/
  4595. "../app-backend-core/lib/component-pick.js": (
  4596. /*!*************************************************!*\
  4597. !*** ../app-backend-core/lib/component-pick.js ***!
  4598. \*************************************************/
  4599. /***/
  4600. (__unused_webpack_module, exports, __webpack_require__2) => {
  4601. Object.defineProperty(exports, "__esModule", {
  4602. value: true
  4603. });
  4604. const shared_utils_1 = __webpack_require__2(
  4605. /*! @vue-devtools/shared-utils */
  4606. "../shared-utils/lib/index.js"
  4607. );
  4608. const highlighter_1 = __webpack_require__2(
  4609. /*! ./highlighter */
  4610. "../app-backend-core/lib/highlighter.js"
  4611. );
  4612. class ComponentPicker {
  4613. constructor(ctx) {
  4614. this.ctx = ctx;
  4615. this.bindMethods();
  4616. }
  4617. /**
  4618. * Adds event listeners for mouseover and mouseup
  4619. */
  4620. startSelecting() {
  4621. if (!shared_utils_1.isBrowser)
  4622. return;
  4623. window.addEventListener("mouseover", this.elementMouseOver, true);
  4624. window.addEventListener("click", this.elementClicked, true);
  4625. window.addEventListener("mouseout", this.cancelEvent, true);
  4626. window.addEventListener("mouseenter", this.cancelEvent, true);
  4627. window.addEventListener("mouseleave", this.cancelEvent, true);
  4628. window.addEventListener("mousedown", this.cancelEvent, true);
  4629. window.addEventListener("mouseup", this.cancelEvent, true);
  4630. }
  4631. /**
  4632. * Removes event listeners
  4633. */
  4634. stopSelecting() {
  4635. if (!shared_utils_1.isBrowser)
  4636. return;
  4637. window.removeEventListener("mouseover", this.elementMouseOver, true);
  4638. window.removeEventListener("click", this.elementClicked, true);
  4639. window.removeEventListener("mouseout", this.cancelEvent, true);
  4640. window.removeEventListener("mouseenter", this.cancelEvent, true);
  4641. window.removeEventListener("mouseleave", this.cancelEvent, true);
  4642. window.removeEventListener("mousedown", this.cancelEvent, true);
  4643. window.removeEventListener("mouseup", this.cancelEvent, true);
  4644. (0, highlighter_1.unHighlight)();
  4645. }
  4646. /**
  4647. * Highlights a component on element mouse over
  4648. */
  4649. async elementMouseOver(e) {
  4650. this.cancelEvent(e);
  4651. const el = e.target;
  4652. if (el) {
  4653. await this.selectElementComponent(el);
  4654. }
  4655. (0, highlighter_1.unHighlight)();
  4656. if (this.selectedInstance) {
  4657. (0, highlighter_1.highlight)(this.selectedInstance, this.selectedBackend, this.ctx);
  4658. }
  4659. }
  4660. async selectElementComponent(el) {
  4661. for (const backend of this.ctx.backends) {
  4662. const instance = await backend.api.getElementComponent(el);
  4663. if (instance) {
  4664. this.selectedInstance = instance;
  4665. this.selectedBackend = backend;
  4666. return;
  4667. }
  4668. }
  4669. this.selectedInstance = null;
  4670. this.selectedBackend = null;
  4671. }
  4672. /**
  4673. * Selects an instance in the component view
  4674. */
  4675. async elementClicked(e) {
  4676. this.cancelEvent(e);
  4677. if (this.selectedInstance && this.selectedBackend) {
  4678. const parentInstances = await this.selectedBackend.api.walkComponentParents(this.selectedInstance);
  4679. this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK, {
  4680. id: this.selectedInstance.__VUE_DEVTOOLS_UID__,
  4681. parentIds: parentInstances.map((i) => i.__VUE_DEVTOOLS_UID__)
  4682. });
  4683. } else {
  4684. this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK_CANCELED, null);
  4685. }
  4686. this.stopSelecting();
  4687. }
  4688. /**
  4689. * Cancel a mouse event
  4690. */
  4691. cancelEvent(e) {
  4692. e.stopImmediatePropagation();
  4693. e.preventDefault();
  4694. }
  4695. /**
  4696. * Bind class methods to the class scope to avoid rebind for event listeners
  4697. */
  4698. bindMethods() {
  4699. this.startSelecting = this.startSelecting.bind(this);
  4700. this.stopSelecting = this.stopSelecting.bind(this);
  4701. this.elementMouseOver = this.elementMouseOver.bind(this);
  4702. this.elementClicked = this.elementClicked.bind(this);
  4703. }
  4704. }
  4705. exports["default"] = ComponentPicker;
  4706. }
  4707. ),
  4708. /***/
  4709. "../app-backend-core/lib/component.js": (
  4710. /*!********************************************!*\
  4711. !*** ../app-backend-core/lib/component.js ***!
  4712. \********************************************/
  4713. /***/
  4714. (__unused_webpack_module, exports, __webpack_require__2) => {
  4715. Object.defineProperty(exports, "__esModule", {
  4716. value: true
  4717. });
  4718. exports.sendComponentUpdateTracking = exports.refreshComponentTreeSearch = exports.getComponentInstance = exports.getComponentId = exports.editComponentState = exports.sendEmptyComponentData = exports.markSelectedInstance = exports.sendSelectedComponentData = exports.sendComponentTreeData = void 0;
  4719. const shared_utils_1 = __webpack_require__2(
  4720. /*! @vue-devtools/shared-utils */
  4721. "../shared-utils/lib/index.js"
  4722. );
  4723. const app_backend_api_1 = __webpack_require__2(
  4724. /*! @vue-devtools/app-backend-api */
  4725. "../app-backend-api/lib/index.js"
  4726. );
  4727. const app_1 = __webpack_require__2(
  4728. /*! ./app */
  4729. "../app-backend-core/lib/app.js"
  4730. );
  4731. const MAX_$VM = 10;
  4732. const $vmQueue = [];
  4733. async function sendComponentTreeData(appRecord, instanceId, filter = "", maxDepth = null, recursively = false, ctx) {
  4734. if (!instanceId || appRecord !== ctx.currentAppRecord)
  4735. return;
  4736. if (instanceId !== "_root" && ctx.currentAppRecord.backend.options.features.includes(app_backend_api_1.BuiltinBackendFeature.FLUSH)) {
  4737. return;
  4738. }
  4739. const instance = getComponentInstance(appRecord, instanceId);
  4740. if (!instance) {
  4741. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_TREE, {
  4742. instanceId,
  4743. treeData: null,
  4744. notFound: true
  4745. });
  4746. } else {
  4747. if (filter)
  4748. filter = filter.toLowerCase();
  4749. if (maxDepth == null) {
  4750. maxDepth = instance === ctx.currentAppRecord.rootInstance ? 2 : 1;
  4751. }
  4752. const data = await appRecord.backend.api.walkComponentTree(instance, maxDepth, filter, recursively);
  4753. const payload = {
  4754. instanceId,
  4755. treeData: (0, shared_utils_1.stringify)(data)
  4756. };
  4757. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_TREE, payload);
  4758. }
  4759. }
  4760. exports.sendComponentTreeData = sendComponentTreeData;
  4761. async function sendSelectedComponentData(appRecord, instanceId, ctx) {
  4762. if (!instanceId || appRecord !== ctx.currentAppRecord)
  4763. return;
  4764. const instance = getComponentInstance(appRecord, instanceId);
  4765. if (!instance) {
  4766. sendEmptyComponentData(instanceId, ctx);
  4767. } else {
  4768. if (typeof window !== "undefined") {
  4769. const win = window;
  4770. win.$vm = instance;
  4771. if ($vmQueue[0] !== instance) {
  4772. if ($vmQueue.length >= MAX_$VM) {
  4773. $vmQueue.pop();
  4774. }
  4775. for (let i = $vmQueue.length; i > 0; i--) {
  4776. win[`$vm${i}`] = $vmQueue[i] = $vmQueue[i - 1];
  4777. }
  4778. win.$vm0 = $vmQueue[0] = instance;
  4779. }
  4780. }
  4781. if (shared_utils_1.SharedData.debugInfo) {
  4782. console.log("[DEBUG] inspect", instance);
  4783. }
  4784. const parentInstances = await appRecord.backend.api.walkComponentParents(instance);
  4785. const payload = {
  4786. instanceId,
  4787. data: await appRecord.backend.api.inspectComponent(instance, ctx.currentAppRecord.options.app),
  4788. parentIds: parentInstances.map((i) => i.__VUE_DEVTOOLS_UID__)
  4789. };
  4790. {
  4791. payload.data.isSetup = !!instance.type.setup && !instance.type.render;
  4792. }
  4793. payload.data = (0, shared_utils_1.stringify)(payload.data);
  4794. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_SELECTED_DATA, payload);
  4795. markSelectedInstance(instanceId, ctx);
  4796. }
  4797. }
  4798. exports.sendSelectedComponentData = sendSelectedComponentData;
  4799. function markSelectedInstance(instanceId, ctx) {
  4800. ctx.currentInspectedComponentId = instanceId;
  4801. ctx.currentAppRecord.lastInspectedComponentId = instanceId;
  4802. }
  4803. exports.markSelectedInstance = markSelectedInstance;
  4804. function sendEmptyComponentData(instanceId, ctx) {
  4805. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_SELECTED_DATA, {
  4806. instanceId,
  4807. data: null
  4808. });
  4809. }
  4810. exports.sendEmptyComponentData = sendEmptyComponentData;
  4811. async function editComponentState(instanceId, dotPath, type, state, ctx) {
  4812. if (!instanceId)
  4813. return;
  4814. const instance = getComponentInstance(ctx.currentAppRecord, instanceId);
  4815. if (instance) {
  4816. if ("value" in state && state.value != null) {
  4817. state.value = (0, shared_utils_1.parse)(state.value, true);
  4818. }
  4819. await ctx.currentAppRecord.backend.api.editComponentState(instance, dotPath, type, state, ctx.currentAppRecord.options.app);
  4820. await sendSelectedComponentData(ctx.currentAppRecord, instanceId, ctx);
  4821. }
  4822. }
  4823. exports.editComponentState = editComponentState;
  4824. async function getComponentId(app, uid, instance, ctx) {
  4825. try {
  4826. if (instance.__VUE_DEVTOOLS_UID__)
  4827. return instance.__VUE_DEVTOOLS_UID__;
  4828. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  4829. if (!appRecord)
  4830. return null;
  4831. const isRoot = appRecord.rootInstance === instance;
  4832. return `${appRecord.id}:${isRoot ? "root" : uid}`;
  4833. } catch (e) {
  4834. if (shared_utils_1.SharedData.debugInfo) {
  4835. console.error(e);
  4836. }
  4837. return null;
  4838. }
  4839. }
  4840. exports.getComponentId = getComponentId;
  4841. function getComponentInstance(appRecord, instanceId, ctx) {
  4842. if (instanceId === "_root") {
  4843. instanceId = `${appRecord.id}:root`;
  4844. }
  4845. const instance = appRecord.instanceMap.get(instanceId);
  4846. if (!instance && shared_utils_1.SharedData.debugInfo) {
  4847. console.warn(`Instance uid=${instanceId} not found`);
  4848. }
  4849. return instance;
  4850. }
  4851. exports.getComponentInstance = getComponentInstance;
  4852. async function refreshComponentTreeSearch(ctx) {
  4853. if (!ctx.currentAppRecord.componentFilter)
  4854. return;
  4855. await sendComponentTreeData(ctx.currentAppRecord, "_root", ctx.currentAppRecord.componentFilter, null, false, ctx);
  4856. }
  4857. exports.refreshComponentTreeSearch = refreshComponentTreeSearch;
  4858. async function sendComponentUpdateTracking(instanceId, ctx) {
  4859. if (!instanceId)
  4860. return;
  4861. const payload = {
  4862. instanceId,
  4863. time: Date.now()
  4864. // Use normal date
  4865. };
  4866. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_UPDATED, payload);
  4867. }
  4868. exports.sendComponentUpdateTracking = sendComponentUpdateTracking;
  4869. }
  4870. ),
  4871. /***/
  4872. "../app-backend-core/lib/flash.js": (
  4873. /*!****************************************!*\
  4874. !*** ../app-backend-core/lib/flash.js ***!
  4875. \****************************************/
  4876. /***/
  4877. (__unused_webpack_module, exports) => {
  4878. Object.defineProperty(exports, "__esModule", {
  4879. value: true
  4880. });
  4881. exports.flashComponent = void 0;
  4882. async function flashComponent(instance, backend) {
  4883. const bounds = await backend.api.getComponentBounds(instance);
  4884. if (bounds) {
  4885. let overlay = instance.__VUE_DEVTOOLS_FLASH;
  4886. if (!overlay) {
  4887. overlay = document.createElement("div");
  4888. instance.__VUE_DEVTOOLS_FLASH = overlay;
  4889. overlay.style.border = "2px rgba(65, 184, 131, 0.7) solid";
  4890. overlay.style.position = "fixed";
  4891. overlay.style.zIndex = "99999999999998";
  4892. overlay.style.pointerEvents = "none";
  4893. overlay.style.borderRadius = "3px";
  4894. overlay.style.boxSizing = "border-box";
  4895. document.body.appendChild(overlay);
  4896. }
  4897. overlay.style.opacity = "1";
  4898. overlay.style.transition = null;
  4899. overlay.style.width = Math.round(bounds.width) + "px";
  4900. overlay.style.height = Math.round(bounds.height) + "px";
  4901. overlay.style.left = Math.round(bounds.left) + "px";
  4902. overlay.style.top = Math.round(bounds.top) + "px";
  4903. requestAnimationFrame(() => {
  4904. overlay.style.transition = "opacity 1s";
  4905. overlay.style.opacity = "0";
  4906. });
  4907. clearTimeout(overlay._timer);
  4908. overlay._timer = setTimeout(() => {
  4909. document.body.removeChild(overlay);
  4910. instance.__VUE_DEVTOOLS_FLASH = null;
  4911. }, 1e3);
  4912. }
  4913. }
  4914. exports.flashComponent = flashComponent;
  4915. }
  4916. ),
  4917. /***/
  4918. "../app-backend-core/lib/global-hook.js": (
  4919. /*!**********************************************!*\
  4920. !*** ../app-backend-core/lib/global-hook.js ***!
  4921. \**********************************************/
  4922. /***/
  4923. (__unused_webpack_module, exports, __webpack_require__2) => {
  4924. Object.defineProperty(exports, "__esModule", {
  4925. value: true
  4926. });
  4927. exports.hook = void 0;
  4928. const shared_utils_1 = __webpack_require__2(
  4929. /*! @vue-devtools/shared-utils */
  4930. "../shared-utils/lib/index.js"
  4931. );
  4932. exports.hook = shared_utils_1.target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4933. }
  4934. ),
  4935. /***/
  4936. "../app-backend-core/lib/highlighter.js": (
  4937. /*!**********************************************!*\
  4938. !*** ../app-backend-core/lib/highlighter.js ***!
  4939. \**********************************************/
  4940. /***/
  4941. (__unused_webpack_module, exports, __webpack_require__2) => {
  4942. Object.defineProperty(exports, "__esModule", {
  4943. value: true
  4944. });
  4945. exports.unHighlight = exports.highlight = void 0;
  4946. const shared_utils_1 = __webpack_require__2(
  4947. /*! @vue-devtools/shared-utils */
  4948. "../shared-utils/lib/index.js"
  4949. );
  4950. const queue_1 = __webpack_require__2(
  4951. /*! ./util/queue */
  4952. "../app-backend-core/lib/util/queue.js"
  4953. );
  4954. let overlay;
  4955. let overlayContent;
  4956. let currentInstance;
  4957. function createOverlay() {
  4958. if (overlay || !shared_utils_1.isBrowser)
  4959. return;
  4960. overlay = document.createElement("div");
  4961. overlay.style.backgroundColor = "rgba(65, 184, 131, 0.35)";
  4962. overlay.style.position = "fixed";
  4963. overlay.style.zIndex = "99999999999998";
  4964. overlay.style.pointerEvents = "none";
  4965. overlay.style.borderRadius = "3px";
  4966. overlayContent = document.createElement("div");
  4967. overlayContent.style.position = "fixed";
  4968. overlayContent.style.zIndex = "99999999999999";
  4969. overlayContent.style.pointerEvents = "none";
  4970. overlayContent.style.backgroundColor = "white";
  4971. overlayContent.style.fontFamily = "monospace";
  4972. overlayContent.style.fontSize = "11px";
  4973. overlayContent.style.padding = "4px 8px";
  4974. overlayContent.style.borderRadius = "3px";
  4975. overlayContent.style.color = "#333";
  4976. overlayContent.style.textAlign = "center";
  4977. overlayContent.style.border = "rgba(65, 184, 131, 0.5) 1px solid";
  4978. overlayContent.style.backgroundClip = "padding-box";
  4979. }
  4980. const jobQueue = new queue_1.JobQueue();
  4981. async function highlight(instance, backend, ctx) {
  4982. await jobQueue.queue("highlight", async () => {
  4983. if (!instance)
  4984. return;
  4985. const bounds = await backend.api.getComponentBounds(instance);
  4986. if (bounds) {
  4987. createOverlay();
  4988. const name = await backend.api.getComponentName(instance) || "Anonymous";
  4989. const pre = document.createElement("span");
  4990. pre.style.opacity = "0.6";
  4991. pre.innerText = "<";
  4992. const text = document.createElement("span");
  4993. text.style.fontWeight = "bold";
  4994. text.style.color = "#09ab56";
  4995. text.innerText = name;
  4996. const post = document.createElement("span");
  4997. post.style.opacity = "0.6";
  4998. post.innerText = ">";
  4999. const size = document.createElement("span");
  5000. size.style.opacity = "0.5";
  5001. size.style.marginLeft = "6px";
  5002. size.appendChild(document.createTextNode((Math.round(bounds.width * 100) / 100).toString()));
  5003. const multiply = document.createElement("span");
  5004. multiply.style.marginLeft = multiply.style.marginRight = "2px";
  5005. multiply.innerText = "×";
  5006. size.appendChild(multiply);
  5007. size.appendChild(document.createTextNode((Math.round(bounds.height * 100) / 100).toString()));
  5008. currentInstance = instance;
  5009. await showOverlay(bounds, [pre, text, post, size]);
  5010. }
  5011. startUpdateTimer(backend);
  5012. });
  5013. }
  5014. exports.highlight = highlight;
  5015. async function unHighlight() {
  5016. await jobQueue.queue("unHighlight", async () => {
  5017. var _a, _b;
  5018. (_a = overlay === null || overlay === void 0 ? void 0 : overlay.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(overlay);
  5019. (_b = overlayContent === null || overlayContent === void 0 ? void 0 : overlayContent.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(overlayContent);
  5020. currentInstance = null;
  5021. stopUpdateTimer();
  5022. });
  5023. }
  5024. exports.unHighlight = unHighlight;
  5025. function showOverlay(bounds, children = null) {
  5026. if (!shared_utils_1.isBrowser || !children.length)
  5027. return;
  5028. positionOverlay(bounds);
  5029. document.body.appendChild(overlay);
  5030. overlayContent.innerHTML = "";
  5031. children.forEach((child) => overlayContent.appendChild(child));
  5032. document.body.appendChild(overlayContent);
  5033. positionOverlayContent(bounds);
  5034. }
  5035. function positionOverlay({
  5036. width = 0,
  5037. height = 0,
  5038. top = 0,
  5039. left = 0
  5040. }) {
  5041. overlay.style.width = Math.round(width) + "px";
  5042. overlay.style.height = Math.round(height) + "px";
  5043. overlay.style.left = Math.round(left) + "px";
  5044. overlay.style.top = Math.round(top) + "px";
  5045. }
  5046. function positionOverlayContent({
  5047. height = 0,
  5048. top = 0,
  5049. left = 0
  5050. }) {
  5051. const contentWidth = overlayContent.offsetWidth;
  5052. const contentHeight = overlayContent.offsetHeight;
  5053. let contentLeft = left;
  5054. if (contentLeft < 0) {
  5055. contentLeft = 0;
  5056. } else if (contentLeft + contentWidth > window.innerWidth) {
  5057. contentLeft = window.innerWidth - contentWidth;
  5058. }
  5059. let contentTop = top - contentHeight - 2;
  5060. if (contentTop < 0) {
  5061. contentTop = top + height + 2;
  5062. }
  5063. if (contentTop < 0) {
  5064. contentTop = 0;
  5065. } else if (contentTop + contentHeight > window.innerHeight) {
  5066. contentTop = window.innerHeight - contentHeight;
  5067. }
  5068. overlayContent.style.left = ~~contentLeft + "px";
  5069. overlayContent.style.top = ~~contentTop + "px";
  5070. }
  5071. async function updateOverlay(backend, ctx) {
  5072. if (currentInstance) {
  5073. const bounds = await backend.api.getComponentBounds(currentInstance);
  5074. if (bounds) {
  5075. const sizeEl = overlayContent.children.item(3);
  5076. const widthEl = sizeEl.childNodes[0];
  5077. widthEl.textContent = (Math.round(bounds.width * 100) / 100).toString();
  5078. const heightEl = sizeEl.childNodes[2];
  5079. heightEl.textContent = (Math.round(bounds.height * 100) / 100).toString();
  5080. positionOverlay(bounds);
  5081. positionOverlayContent(bounds);
  5082. }
  5083. }
  5084. }
  5085. let updateTimer;
  5086. function startUpdateTimer(backend, ctx) {
  5087. stopUpdateTimer();
  5088. updateTimer = setInterval(() => {
  5089. jobQueue.queue("updateOverlay", async () => {
  5090. await updateOverlay(backend);
  5091. });
  5092. }, 1e3 / 30);
  5093. }
  5094. function stopUpdateTimer() {
  5095. clearInterval(updateTimer);
  5096. }
  5097. }
  5098. ),
  5099. /***/
  5100. "../app-backend-core/lib/index.js": (
  5101. /*!****************************************!*\
  5102. !*** ../app-backend-core/lib/index.js ***!
  5103. \****************************************/
  5104. /***/
  5105. function(__unused_webpack_module, exports, __webpack_require__2) {
  5106. var __importDefault = this && this.__importDefault || function(mod) {
  5107. return mod && mod.__esModule ? mod : {
  5108. "default": mod
  5109. };
  5110. };
  5111. var _a, _b;
  5112. Object.defineProperty(exports, "__esModule", {
  5113. value: true
  5114. });
  5115. exports.initBackend = void 0;
  5116. const app_backend_api_1 = __webpack_require__2(
  5117. /*! @vue-devtools/app-backend-api */
  5118. "../app-backend-api/lib/index.js"
  5119. );
  5120. const shared_utils_1 = __webpack_require__2(
  5121. /*! @vue-devtools/shared-utils */
  5122. "../shared-utils/lib/index.js"
  5123. );
  5124. const debounce_1 = __importDefault(__webpack_require__2(
  5125. /*! lodash/debounce */
  5126. "../../node_modules/lodash/debounce.js"
  5127. ));
  5128. const throttle_1 = __importDefault(__webpack_require__2(
  5129. /*! lodash/throttle */
  5130. "../../node_modules/lodash/throttle.js"
  5131. ));
  5132. const global_hook_1 = __webpack_require__2(
  5133. /*! ./global-hook */
  5134. "../app-backend-core/lib/global-hook.js"
  5135. );
  5136. const subscriptions_1 = __webpack_require__2(
  5137. /*! ./util/subscriptions */
  5138. "../app-backend-core/lib/util/subscriptions.js"
  5139. );
  5140. const highlighter_1 = __webpack_require__2(
  5141. /*! ./highlighter */
  5142. "../app-backend-core/lib/highlighter.js"
  5143. );
  5144. const timeline_1 = __webpack_require__2(
  5145. /*! ./timeline */
  5146. "../app-backend-core/lib/timeline.js"
  5147. );
  5148. const component_pick_1 = __importDefault(__webpack_require__2(
  5149. /*! ./component-pick */
  5150. "../app-backend-core/lib/component-pick.js"
  5151. ));
  5152. const component_1 = __webpack_require__2(
  5153. /*! ./component */
  5154. "../app-backend-core/lib/component.js"
  5155. );
  5156. const plugin_1 = __webpack_require__2(
  5157. /*! ./plugin */
  5158. "../app-backend-core/lib/plugin.js"
  5159. );
  5160. const devtools_api_1 = __webpack_require__2(
  5161. /*! @vue/devtools-api */
  5162. "../api/lib/esm/index.js"
  5163. );
  5164. const app_1 = __webpack_require__2(
  5165. /*! ./app */
  5166. "../app-backend-core/lib/app.js"
  5167. );
  5168. const inspector_1 = __webpack_require__2(
  5169. /*! ./inspector */
  5170. "../app-backend-core/lib/inspector.js"
  5171. );
  5172. const timeline_screenshot_1 = __webpack_require__2(
  5173. /*! ./timeline-screenshot */
  5174. "../app-backend-core/lib/timeline-screenshot.js"
  5175. );
  5176. const perf_1 = __webpack_require__2(
  5177. /*! ./perf */
  5178. "../app-backend-core/lib/perf.js"
  5179. );
  5180. const page_config_1 = __webpack_require__2(
  5181. /*! ./page-config */
  5182. "../app-backend-core/lib/page-config.js"
  5183. );
  5184. const timeline_marker_1 = __webpack_require__2(
  5185. /*! ./timeline-marker */
  5186. "../app-backend-core/lib/timeline-marker.js"
  5187. );
  5188. const flash_js_1 = __webpack_require__2(
  5189. /*! ./flash.js */
  5190. "../app-backend-core/lib/flash.js"
  5191. );
  5192. let ctx = (_a = shared_utils_1.target.__vdevtools_ctx) !== null && _a !== void 0 ? _a : null;
  5193. let connected = (_b = shared_utils_1.target.__vdevtools_connected) !== null && _b !== void 0 ? _b : false;
  5194. async function initBackend(bridge) {
  5195. await (0, shared_utils_1.initSharedData)({
  5196. bridge,
  5197. persist: false
  5198. });
  5199. shared_utils_1.SharedData.isBrowser = shared_utils_1.isBrowser;
  5200. (0, page_config_1.initOnPageConfig)();
  5201. if (!connected) {
  5202. ctx = shared_utils_1.target.__vdevtools_ctx = (0, app_backend_api_1.createBackendContext)({
  5203. bridge,
  5204. hook: global_hook_1.hook
  5205. });
  5206. shared_utils_1.SharedData.legacyApps = false;
  5207. if (global_hook_1.hook.Vue) {
  5208. connect();
  5209. (0, app_1._legacy_getAndRegisterApps)(ctx, true);
  5210. shared_utils_1.SharedData.legacyApps = true;
  5211. }
  5212. global_hook_1.hook.on(shared_utils_1.HookEvents.INIT, () => {
  5213. (0, app_1._legacy_getAndRegisterApps)(ctx, true);
  5214. shared_utils_1.SharedData.legacyApps = true;
  5215. });
  5216. global_hook_1.hook.on(shared_utils_1.HookEvents.APP_ADD, async (app) => {
  5217. await (0, app_1.registerApp)(app, ctx);
  5218. connect();
  5219. });
  5220. if (global_hook_1.hook.apps.length) {
  5221. global_hook_1.hook.apps.forEach((app) => {
  5222. (0, app_1.registerApp)(app, ctx);
  5223. connect();
  5224. });
  5225. }
  5226. } else {
  5227. ctx.bridge = bridge;
  5228. connectBridge();
  5229. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_RECONNECTED);
  5230. }
  5231. }
  5232. exports.initBackend = initBackend;
  5233. async function connect() {
  5234. if (connected) {
  5235. return;
  5236. }
  5237. connected = shared_utils_1.target.__vdevtools_connected = true;
  5238. await (0, app_1.waitForAppsRegistration)();
  5239. connectBridge();
  5240. ctx.currentTab = shared_utils_1.BuiltinTabs.COMPONENTS;
  5241. global_hook_1.hook.on(shared_utils_1.HookEvents.APP_UNMOUNT, async (app) => {
  5242. await (0, app_1.removeApp)(app, ctx);
  5243. });
  5244. const _sendComponentUpdate = async (appRecord, id) => {
  5245. try {
  5246. if (id && (0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.SELECTED_COMPONENT_DATA, (sub) => sub.payload.instanceId === id)) {
  5247. await (0, component_1.sendSelectedComponentData)(appRecord, id, ctx);
  5248. }
  5249. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === id)) {
  5250. await (0, component_1.sendComponentTreeData)(appRecord, id, appRecord.componentFilter, 0, false, ctx);
  5251. }
  5252. } catch (e) {
  5253. if (shared_utils_1.SharedData.debugInfo) {
  5254. console.error(e);
  5255. }
  5256. }
  5257. };
  5258. const sendComponentUpdate = (0, throttle_1.default)(_sendComponentUpdate, 100);
  5259. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_UPDATED, async (app, uid, parentUid, component) => {
  5260. try {
  5261. if (!app || typeof uid !== "number" && !uid || !component)
  5262. return;
  5263. let id;
  5264. let appRecord;
  5265. if (app && uid != null) {
  5266. id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5267. appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5268. } else {
  5269. id = ctx.currentInspectedComponentId;
  5270. appRecord = ctx.currentAppRecord;
  5271. }
  5272. if (shared_utils_1.SharedData.trackUpdates) {
  5273. await (0, component_1.sendComponentUpdateTracking)(id, ctx);
  5274. }
  5275. if (shared_utils_1.SharedData.flashUpdates) {
  5276. await (0, flash_js_1.flashComponent)(component, appRecord.backend);
  5277. }
  5278. await sendComponentUpdate(appRecord, id);
  5279. } catch (e) {
  5280. if (shared_utils_1.SharedData.debugInfo) {
  5281. console.error(e);
  5282. }
  5283. }
  5284. });
  5285. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_ADDED, async (app, uid, parentUid, component) => {
  5286. try {
  5287. if (!app || typeof uid !== "number" && !uid || !component)
  5288. return;
  5289. const id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5290. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5291. if (component) {
  5292. if (component.__VUE_DEVTOOLS_UID__ == null) {
  5293. component.__VUE_DEVTOOLS_UID__ = id;
  5294. }
  5295. if (!appRecord.instanceMap.has(id)) {
  5296. appRecord.instanceMap.set(id, component);
  5297. }
  5298. }
  5299. if (uid !== 0 && parentUid === void 0) {
  5300. const parentId = `${id.split(":")[0]}:root`;
  5301. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5302. }
  5303. if (false)
  5304. ;
  5305. if (parentUid != null) {
  5306. const parentInstances = await appRecord.backend.api.walkComponentParents(component);
  5307. if (parentInstances.length) {
  5308. for (let i = 0; i < parentInstances.length; i++) {
  5309. const parentId = await (0, component_1.getComponentId)(app, parentUid, parentInstances[i], ctx);
  5310. if (i < 2 && (0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === parentId)) {
  5311. (0, shared_utils_1.raf)(() => {
  5312. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5313. });
  5314. }
  5315. if (shared_utils_1.SharedData.trackUpdates) {
  5316. await (0, component_1.sendComponentUpdateTracking)(parentId, ctx);
  5317. }
  5318. }
  5319. }
  5320. }
  5321. if (ctx.currentInspectedComponentId === id) {
  5322. await (0, component_1.sendSelectedComponentData)(appRecord, id, ctx);
  5323. }
  5324. if (shared_utils_1.SharedData.trackUpdates) {
  5325. await (0, component_1.sendComponentUpdateTracking)(id, ctx);
  5326. }
  5327. if (shared_utils_1.SharedData.flashUpdates) {
  5328. await (0, flash_js_1.flashComponent)(component, appRecord.backend);
  5329. }
  5330. await (0, component_1.refreshComponentTreeSearch)(ctx);
  5331. } catch (e) {
  5332. if (shared_utils_1.SharedData.debugInfo) {
  5333. console.error(e);
  5334. }
  5335. }
  5336. });
  5337. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_REMOVED, async (app, uid, parentUid, component) => {
  5338. try {
  5339. if (!app || typeof uid !== "number" && !uid || !component)
  5340. return;
  5341. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5342. if (uid !== 0 && parentUid === void 0) {
  5343. const id2 = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5344. const parentId = `${id2.split(":")[0]}:root`;
  5345. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5346. }
  5347. if (parentUid != null) {
  5348. const parentInstances = await appRecord.backend.api.walkComponentParents(component);
  5349. if (parentInstances.length) {
  5350. const parentId = await (0, component_1.getComponentId)(app, parentUid, parentInstances[0], ctx);
  5351. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === parentId)) {
  5352. (0, shared_utils_1.raf)(async () => {
  5353. try {
  5354. (0, component_1.sendComponentTreeData)(await (0, app_1.getAppRecord)(app, ctx), parentId, appRecord.componentFilter, null, false, ctx);
  5355. } catch (e) {
  5356. if (shared_utils_1.SharedData.debugInfo) {
  5357. console.error(e);
  5358. }
  5359. }
  5360. });
  5361. }
  5362. }
  5363. }
  5364. const id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5365. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.SELECTED_COMPONENT_DATA, (sub) => sub.payload.instanceId === id)) {
  5366. await (0, component_1.sendEmptyComponentData)(id, ctx);
  5367. }
  5368. appRecord.instanceMap.delete(id);
  5369. await (0, component_1.refreshComponentTreeSearch)(ctx);
  5370. } catch (e) {
  5371. if (shared_utils_1.SharedData.debugInfo) {
  5372. console.error(e);
  5373. }
  5374. }
  5375. });
  5376. global_hook_1.hook.on(shared_utils_1.HookEvents.TRACK_UPDATE, (id, ctx2) => {
  5377. (0, component_1.sendComponentUpdateTracking)(id, ctx2);
  5378. });
  5379. global_hook_1.hook.on(shared_utils_1.HookEvents.FLASH_UPDATE, (instance, backend) => {
  5380. (0, flash_js_1.flashComponent)(instance, backend);
  5381. });
  5382. global_hook_1.hook.on(shared_utils_1.HookEvents.PERFORMANCE_START, async (app, uid, vm, type, time) => {
  5383. await (0, perf_1.performanceMarkStart)(app, uid, vm, type, time, ctx);
  5384. });
  5385. global_hook_1.hook.on(shared_utils_1.HookEvents.PERFORMANCE_END, async (app, uid, vm, type, time) => {
  5386. await (0, perf_1.performanceMarkEnd)(app, uid, vm, type, time, ctx);
  5387. });
  5388. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_HIGHLIGHT, async (instanceId) => {
  5389. await (0, highlighter_1.highlight)(ctx.currentAppRecord.instanceMap.get(instanceId), ctx.currentAppRecord.backend, ctx);
  5390. });
  5391. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_UNHIGHLIGHT, async () => {
  5392. await (0, highlighter_1.unHighlight)();
  5393. });
  5394. (0, timeline_1.setupTimeline)(ctx);
  5395. global_hook_1.hook.on(shared_utils_1.HookEvents.TIMELINE_LAYER_ADDED, async (options, plugin) => {
  5396. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  5397. ctx.timelineLayers.push({
  5398. ...options,
  5399. appRecord,
  5400. plugin,
  5401. events: []
  5402. });
  5403. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_ADD, {});
  5404. });
  5405. global_hook_1.hook.on(shared_utils_1.HookEvents.TIMELINE_EVENT_ADDED, async (options, plugin) => {
  5406. await (0, timeline_1.addTimelineEvent)(options, plugin.descriptor.app, ctx);
  5407. });
  5408. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_ADD, async (options, plugin) => {
  5409. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  5410. ctx.customInspectors.push({
  5411. ...options,
  5412. appRecord,
  5413. plugin,
  5414. treeFilter: "",
  5415. selectedNodeId: null
  5416. });
  5417. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_ADD, {});
  5418. });
  5419. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_TREE, async (inspectorId, plugin) => {
  5420. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5421. if (inspector) {
  5422. await (0, inspector_1.sendInspectorTree)(inspector, ctx);
  5423. } else if (shared_utils_1.SharedData.debugInfo) {
  5424. console.warn(`Inspector ${inspectorId} not found`);
  5425. }
  5426. });
  5427. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_STATE, async (inspectorId, plugin) => {
  5428. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5429. if (inspector) {
  5430. await (0, inspector_1.sendInspectorState)(inspector, ctx);
  5431. } else if (shared_utils_1.SharedData.debugInfo) {
  5432. console.warn(`Inspector ${inspectorId} not found`);
  5433. }
  5434. });
  5435. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SELECT_NODE, async (inspectorId, nodeId, plugin) => {
  5436. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5437. if (inspector) {
  5438. await (0, inspector_1.selectInspectorNode)(inspector, nodeId, ctx);
  5439. } else if (shared_utils_1.SharedData.debugInfo) {
  5440. console.warn(`Inspector ${inspectorId} not found`);
  5441. }
  5442. });
  5443. try {
  5444. await (0, plugin_1.addPreviouslyRegisteredPlugins)(ctx);
  5445. } catch (e) {
  5446. console.error(`Error adding previously registered plugins:`);
  5447. console.error(e);
  5448. }
  5449. try {
  5450. await (0, plugin_1.addQueuedPlugins)(ctx);
  5451. } catch (e) {
  5452. console.error(`Error adding queued plugins:`);
  5453. console.error(e);
  5454. }
  5455. global_hook_1.hook.on(shared_utils_1.HookEvents.SETUP_DEVTOOLS_PLUGIN, async (pluginDescriptor, setupFn) => {
  5456. await (0, plugin_1.addPlugin)({
  5457. pluginDescriptor,
  5458. setupFn
  5459. }, ctx);
  5460. });
  5461. shared_utils_1.target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ = true;
  5462. const handleFlush = (0, debounce_1.default)(async () => {
  5463. var _a2;
  5464. if ((_a2 = ctx.currentAppRecord) === null || _a2 === void 0 ? void 0 : _a2.backend.options.features.includes(app_backend_api_1.BuiltinBackendFeature.FLUSH)) {
  5465. await (0, component_1.sendComponentTreeData)(ctx.currentAppRecord, "_root", ctx.currentAppRecord.componentFilter, null, false, ctx);
  5466. if (ctx.currentInspectedComponentId) {
  5467. await (0, component_1.sendSelectedComponentData)(ctx.currentAppRecord, ctx.currentInspectedComponentId, ctx);
  5468. }
  5469. }
  5470. }, 500);
  5471. global_hook_1.hook.off(shared_utils_1.HookEvents.FLUSH);
  5472. global_hook_1.hook.on(shared_utils_1.HookEvents.FLUSH, handleFlush);
  5473. try {
  5474. await (0, timeline_marker_1.addTimelineMarker)({
  5475. id: "vue-devtools-init-backend",
  5476. time: (0, devtools_api_1.now)(),
  5477. label: "Vue Devtools connected",
  5478. color: 4307075,
  5479. all: true
  5480. }, ctx);
  5481. } catch (e) {
  5482. console.error(`Error while adding devtools connected timeline marker:`);
  5483. console.error(e);
  5484. }
  5485. }
  5486. function connectBridge() {
  5487. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_SUBSCRIBE, ({
  5488. type,
  5489. payload
  5490. }) => {
  5491. (0, subscriptions_1.subscribe)(type, payload);
  5492. });
  5493. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_UNSUBSCRIBE, ({
  5494. type,
  5495. payload
  5496. }) => {
  5497. (0, subscriptions_1.unsubscribe)(type, payload);
  5498. });
  5499. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TAB_SWITCH, async (tab) => {
  5500. ctx.currentTab = tab;
  5501. await (0, highlighter_1.unHighlight)();
  5502. });
  5503. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_APP_LIST, async () => {
  5504. await (0, app_1.sendApps)(ctx);
  5505. });
  5506. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_APP_SELECT, async (id) => {
  5507. if (id == null)
  5508. return;
  5509. const record = ctx.appRecords.find((r) => r.id === id);
  5510. if (record) {
  5511. await (0, app_1.selectApp)(record, ctx);
  5512. } else if (shared_utils_1.SharedData.debugInfo) {
  5513. console.warn(`App with id ${id} not found`);
  5514. }
  5515. });
  5516. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_SCAN_LEGACY_APPS, () => {
  5517. if (global_hook_1.hook.Vue) {
  5518. (0, app_1._legacy_getAndRegisterApps)(ctx);
  5519. }
  5520. });
  5521. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_TREE, async ({
  5522. instanceId,
  5523. filter,
  5524. recursively
  5525. }) => {
  5526. ctx.currentAppRecord.componentFilter = filter;
  5527. (0, subscriptions_1.subscribe)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, {
  5528. instanceId
  5529. });
  5530. await (0, component_1.sendComponentTreeData)(ctx.currentAppRecord, instanceId, filter, null, recursively, ctx);
  5531. });
  5532. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_SELECTED_DATA, async (instanceId) => {
  5533. await (0, component_1.sendSelectedComponentData)(ctx.currentAppRecord, instanceId, ctx);
  5534. });
  5535. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_EDIT_STATE, async ({
  5536. instanceId,
  5537. dotPath,
  5538. type,
  5539. value,
  5540. newKey,
  5541. remove
  5542. }) => {
  5543. await (0, component_1.editComponentState)(instanceId, dotPath, type, {
  5544. value,
  5545. newKey,
  5546. remove
  5547. }, ctx);
  5548. });
  5549. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_INSPECT_DOM, async ({
  5550. instanceId
  5551. }) => {
  5552. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5553. if (instance) {
  5554. const [el] = await ctx.currentAppRecord.backend.api.getComponentRootElements(instance);
  5555. if (el) {
  5556. shared_utils_1.target.__VUE_DEVTOOLS_INSPECT_TARGET__ = el;
  5557. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_INSPECT_DOM, null);
  5558. }
  5559. }
  5560. });
  5561. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_SCROLL_TO, async ({
  5562. instanceId
  5563. }) => {
  5564. if (!shared_utils_1.isBrowser)
  5565. return;
  5566. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5567. if (instance) {
  5568. const [el] = await ctx.currentAppRecord.backend.api.getComponentRootElements(instance);
  5569. if (el) {
  5570. if (typeof el.scrollIntoView === "function") {
  5571. el.scrollIntoView({
  5572. behavior: "smooth",
  5573. block: "center",
  5574. inline: "center"
  5575. });
  5576. } else {
  5577. const bounds = await ctx.currentAppRecord.backend.api.getComponentBounds(instance);
  5578. const scrollTarget = document.createElement("div");
  5579. scrollTarget.style.position = "absolute";
  5580. scrollTarget.style.width = `${bounds.width}px`;
  5581. scrollTarget.style.height = `${bounds.height}px`;
  5582. scrollTarget.style.top = `${bounds.top}px`;
  5583. scrollTarget.style.left = `${bounds.left}px`;
  5584. document.body.appendChild(scrollTarget);
  5585. scrollTarget.scrollIntoView({
  5586. behavior: "smooth",
  5587. block: "center",
  5588. inline: "center"
  5589. });
  5590. setTimeout(() => {
  5591. document.body.removeChild(scrollTarget);
  5592. }, 2e3);
  5593. }
  5594. (0, highlighter_1.highlight)(instance, ctx.currentAppRecord.backend, ctx);
  5595. setTimeout(() => {
  5596. (0, highlighter_1.unHighlight)();
  5597. }, 2e3);
  5598. }
  5599. }
  5600. });
  5601. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_RENDER_CODE, async ({
  5602. instanceId
  5603. }) => {
  5604. if (!shared_utils_1.isBrowser)
  5605. return;
  5606. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5607. if (instance) {
  5608. const {
  5609. code
  5610. } = await ctx.currentAppRecord.backend.api.getComponentRenderCode(instance);
  5611. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_RENDER_CODE, {
  5612. instanceId,
  5613. code
  5614. });
  5615. }
  5616. });
  5617. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_STATE_ACTION, async ({
  5618. value,
  5619. actionIndex
  5620. }) => {
  5621. const rawAction = value._custom.actions[actionIndex];
  5622. const action = (0, shared_utils_1.revive)(rawAction === null || rawAction === void 0 ? void 0 : rawAction.action);
  5623. if (action) {
  5624. try {
  5625. await action();
  5626. } catch (e) {
  5627. console.error(e);
  5628. }
  5629. } else {
  5630. console.warn(`Couldn't revive action ${actionIndex} from`, value);
  5631. }
  5632. });
  5633. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_MOUSE_OVER, async (instanceId) => {
  5634. await (0, highlighter_1.highlight)(ctx.currentAppRecord.instanceMap.get(instanceId), ctx.currentAppRecord.backend, ctx);
  5635. });
  5636. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_MOUSE_OUT, async () => {
  5637. await (0, highlighter_1.unHighlight)();
  5638. });
  5639. const componentPicker = new component_pick_1.default(ctx);
  5640. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_PICK, () => {
  5641. componentPicker.startSelecting();
  5642. });
  5643. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_PICK_CANCELED, () => {
  5644. componentPicker.stopSelecting();
  5645. });
  5646. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LAYER_LIST, async () => {
  5647. await (0, timeline_1.sendTimelineLayers)(ctx);
  5648. });
  5649. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_SHOW_SCREENSHOT, async ({
  5650. screenshot
  5651. }) => {
  5652. await (0, timeline_screenshot_1.showScreenshot)(screenshot, ctx);
  5653. });
  5654. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_CLEAR, async () => {
  5655. await (0, timeline_1.clearTimeline)(ctx);
  5656. });
  5657. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_EVENT_DATA, async ({
  5658. id
  5659. }) => {
  5660. await (0, timeline_1.sendTimelineEventData)(id, ctx);
  5661. });
  5662. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LAYER_LOAD_EVENTS, async ({
  5663. appId,
  5664. layerId
  5665. }) => {
  5666. await (0, timeline_1.sendTimelineLayerEvents)(appId, layerId, ctx);
  5667. });
  5668. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LOAD_MARKERS, async () => {
  5669. await (0, timeline_marker_1.sendTimelineMarkers)(ctx);
  5670. });
  5671. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_LIST, async () => {
  5672. await (0, inspector_1.sendCustomInspectors)(ctx);
  5673. });
  5674. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_TREE, async ({
  5675. inspectorId,
  5676. appId,
  5677. treeFilter
  5678. }) => {
  5679. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5680. if (inspector) {
  5681. inspector.treeFilter = treeFilter;
  5682. (0, inspector_1.sendInspectorTree)(inspector, ctx);
  5683. } else if (shared_utils_1.SharedData.debugInfo) {
  5684. console.warn(`Inspector ${inspectorId} not found`);
  5685. }
  5686. });
  5687. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_STATE, async ({
  5688. inspectorId,
  5689. appId,
  5690. nodeId
  5691. }) => {
  5692. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5693. if (inspector) {
  5694. inspector.selectedNodeId = nodeId;
  5695. (0, inspector_1.sendInspectorState)(inspector, ctx);
  5696. } else if (shared_utils_1.SharedData.debugInfo) {
  5697. console.warn(`Inspector ${inspectorId} not found`);
  5698. }
  5699. });
  5700. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE, async ({
  5701. inspectorId,
  5702. appId,
  5703. nodeId,
  5704. path,
  5705. type,
  5706. payload
  5707. }) => {
  5708. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5709. if (inspector) {
  5710. await (0, inspector_1.editInspectorState)(inspector, nodeId, path, type, payload, ctx);
  5711. inspector.selectedNodeId = nodeId;
  5712. await (0, inspector_1.sendInspectorState)(inspector, ctx);
  5713. } else if (shared_utils_1.SharedData.debugInfo) {
  5714. console.warn(`Inspector ${inspectorId} not found`);
  5715. }
  5716. });
  5717. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_ACTION, async ({
  5718. inspectorId,
  5719. appId,
  5720. actionIndex,
  5721. actionType,
  5722. args
  5723. }) => {
  5724. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5725. if (inspector) {
  5726. const action = inspector[actionType !== null && actionType !== void 0 ? actionType : "actions"][actionIndex];
  5727. try {
  5728. await action.action(...args !== null && args !== void 0 ? args : []);
  5729. } catch (e) {
  5730. if (shared_utils_1.SharedData.debugInfo) {
  5731. console.error(e);
  5732. }
  5733. }
  5734. } else if (shared_utils_1.SharedData.debugInfo) {
  5735. console.warn(`Inspector ${inspectorId} not found`);
  5736. }
  5737. });
  5738. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_LOG, (payload) => {
  5739. let value = payload.value;
  5740. if (payload.serialized) {
  5741. value = (0, shared_utils_1.parse)(value, payload.revive);
  5742. } else if (payload.revive) {
  5743. value = (0, shared_utils_1.revive)(value);
  5744. }
  5745. console[payload.level](value);
  5746. });
  5747. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_DEVTOOLS_PLUGIN_LIST, async () => {
  5748. await (0, plugin_1.sendPluginList)(ctx);
  5749. });
  5750. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED, ({
  5751. pluginId,
  5752. key,
  5753. newValue,
  5754. oldValue
  5755. }) => {
  5756. const settings = (0, shared_utils_1.getPluginSettings)(pluginId);
  5757. ctx.hook.emit(shared_utils_1.HookEvents.PLUGIN_SETTINGS_SET, pluginId, settings);
  5758. ctx.currentAppRecord.backend.api.callHook(
  5759. "setPluginSettings",
  5760. {
  5761. app: ctx.currentAppRecord.options.app,
  5762. pluginId,
  5763. key,
  5764. newValue,
  5765. oldValue,
  5766. settings
  5767. }
  5768. );
  5769. });
  5770. }
  5771. }
  5772. ),
  5773. /***/
  5774. "../app-backend-core/lib/inspector.js": (
  5775. /*!********************************************!*\
  5776. !*** ../app-backend-core/lib/inspector.js ***!
  5777. \********************************************/
  5778. /***/
  5779. (__unused_webpack_module, exports, __webpack_require__2) => {
  5780. Object.defineProperty(exports, "__esModule", {
  5781. value: true
  5782. });
  5783. exports.selectInspectorNode = exports.sendCustomInspectors = exports.editInspectorState = exports.sendInspectorState = exports.sendInspectorTree = exports.getInspectorWithAppId = exports.getInspector = void 0;
  5784. const shared_utils_1 = __webpack_require__2(
  5785. /*! @vue-devtools/shared-utils */
  5786. "../shared-utils/lib/index.js"
  5787. );
  5788. function getInspector(inspectorId, app, ctx) {
  5789. return ctx.customInspectors.find((i) => i.id === inspectorId && i.appRecord.options.app === app);
  5790. }
  5791. exports.getInspector = getInspector;
  5792. async function getInspectorWithAppId(inspectorId, appId, ctx) {
  5793. for (const i of ctx.customInspectors) {
  5794. if (i.id === inspectorId && i.appRecord.id === appId) {
  5795. return i;
  5796. }
  5797. }
  5798. return null;
  5799. }
  5800. exports.getInspectorWithAppId = getInspectorWithAppId;
  5801. async function sendInspectorTree(inspector, ctx) {
  5802. const rootNodes = await inspector.appRecord.backend.api.getInspectorTree(inspector.id, inspector.appRecord.options.app, inspector.treeFilter);
  5803. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_TREE, {
  5804. appId: inspector.appRecord.id,
  5805. inspectorId: inspector.id,
  5806. rootNodes
  5807. });
  5808. }
  5809. exports.sendInspectorTree = sendInspectorTree;
  5810. async function sendInspectorState(inspector, ctx) {
  5811. const state = inspector.selectedNodeId ? await inspector.appRecord.backend.api.getInspectorState(inspector.id, inspector.appRecord.options.app, inspector.selectedNodeId) : null;
  5812. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_STATE, {
  5813. appId: inspector.appRecord.id,
  5814. inspectorId: inspector.id,
  5815. state: (0, shared_utils_1.stringify)(state)
  5816. });
  5817. }
  5818. exports.sendInspectorState = sendInspectorState;
  5819. async function editInspectorState(inspector, nodeId, dotPath, type, state, ctx) {
  5820. await inspector.appRecord.backend.api.editInspectorState(inspector.id, inspector.appRecord.options.app, nodeId, dotPath, type, {
  5821. ...state,
  5822. value: state.value != null ? (0, shared_utils_1.parse)(state.value, true) : state.value
  5823. });
  5824. }
  5825. exports.editInspectorState = editInspectorState;
  5826. async function sendCustomInspectors(ctx) {
  5827. var _a, _b;
  5828. const inspectors = [];
  5829. for (const i of ctx.customInspectors) {
  5830. inspectors.push({
  5831. id: i.id,
  5832. appId: i.appRecord.id,
  5833. pluginId: i.plugin.descriptor.id,
  5834. label: i.label,
  5835. icon: i.icon,
  5836. treeFilterPlaceholder: i.treeFilterPlaceholder,
  5837. stateFilterPlaceholder: i.stateFilterPlaceholder,
  5838. noSelectionText: i.noSelectionText,
  5839. actions: (_a = i.actions) === null || _a === void 0 ? void 0 : _a.map((a) => ({
  5840. icon: a.icon,
  5841. tooltip: a.tooltip
  5842. })),
  5843. nodeActions: (_b = i.nodeActions) === null || _b === void 0 ? void 0 : _b.map((a) => ({
  5844. icon: a.icon,
  5845. tooltip: a.tooltip
  5846. }))
  5847. });
  5848. }
  5849. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_LIST, {
  5850. inspectors
  5851. });
  5852. }
  5853. exports.sendCustomInspectors = sendCustomInspectors;
  5854. async function selectInspectorNode(inspector, nodeId, ctx) {
  5855. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE, {
  5856. appId: inspector.appRecord.id,
  5857. inspectorId: inspector.id,
  5858. nodeId
  5859. });
  5860. }
  5861. exports.selectInspectorNode = selectInspectorNode;
  5862. }
  5863. ),
  5864. /***/
  5865. "../app-backend-core/lib/legacy/scan.js": (
  5866. /*!**********************************************!*\
  5867. !*** ../app-backend-core/lib/legacy/scan.js ***!
  5868. \**********************************************/
  5869. /***/
  5870. (__unused_webpack_module, exports, __webpack_require__2) => {
  5871. Object.defineProperty(exports, "__esModule", {
  5872. value: true
  5873. });
  5874. exports.scan = void 0;
  5875. const shared_utils_1 = __webpack_require__2(
  5876. /*! @vue-devtools/shared-utils */
  5877. "../shared-utils/lib/index.js"
  5878. );
  5879. const page_config_1 = __webpack_require__2(
  5880. /*! ../page-config */
  5881. "../app-backend-core/lib/page-config.js"
  5882. );
  5883. const rootInstances = [];
  5884. function scan() {
  5885. rootInstances.length = 0;
  5886. let inFragment = false;
  5887. let currentFragment = null;
  5888. function processInstance(instance) {
  5889. if (instance) {
  5890. if (rootInstances.indexOf(instance.$root) === -1) {
  5891. instance = instance.$root;
  5892. }
  5893. if (instance._isFragment) {
  5894. inFragment = true;
  5895. currentFragment = instance;
  5896. }
  5897. let baseVue = instance.constructor;
  5898. while (baseVue.super) {
  5899. baseVue = baseVue.super;
  5900. }
  5901. if (baseVue.config && baseVue.config.devtools) {
  5902. rootInstances.push(instance);
  5903. }
  5904. return true;
  5905. }
  5906. }
  5907. if (shared_utils_1.isBrowser) {
  5908. const walkDocument = (document2) => {
  5909. walk(document2, function(node) {
  5910. if (inFragment) {
  5911. if (node === currentFragment._fragmentEnd) {
  5912. inFragment = false;
  5913. currentFragment = null;
  5914. }
  5915. return true;
  5916. }
  5917. const instance = node.__vue__;
  5918. return processInstance(instance);
  5919. });
  5920. };
  5921. walkDocument(document);
  5922. const iframes = document.querySelectorAll("iframe");
  5923. for (const iframe of iframes) {
  5924. try {
  5925. walkDocument(iframe.contentDocument);
  5926. } catch (e) {
  5927. }
  5928. }
  5929. const {
  5930. customVue2ScanSelector
  5931. } = (0, page_config_1.getPageConfig)();
  5932. const customTargets = customVue2ScanSelector ? document.querySelectorAll(customVue2ScanSelector) : [];
  5933. for (const customTarget of customTargets) {
  5934. try {
  5935. walkDocument(customTarget);
  5936. } catch (e) {
  5937. }
  5938. }
  5939. } else {
  5940. if (Array.isArray(shared_utils_1.target.__VUE_ROOT_INSTANCES__)) {
  5941. shared_utils_1.target.__VUE_ROOT_INSTANCES__.map(processInstance);
  5942. }
  5943. }
  5944. return rootInstances;
  5945. }
  5946. exports.scan = scan;
  5947. function walk(node, fn) {
  5948. if (node.childNodes) {
  5949. for (let i = 0, l = node.childNodes.length; i < l; i++) {
  5950. const child = node.childNodes[i];
  5951. const stop = fn(child);
  5952. if (!stop) {
  5953. walk(child, fn);
  5954. }
  5955. }
  5956. }
  5957. if (node.shadowRoot) {
  5958. walk(node.shadowRoot, fn);
  5959. }
  5960. }
  5961. }
  5962. ),
  5963. /***/
  5964. "../app-backend-core/lib/page-config.js": (
  5965. /*!**********************************************!*\
  5966. !*** ../app-backend-core/lib/page-config.js ***!
  5967. \**********************************************/
  5968. /***/
  5969. (__unused_webpack_module, exports, __webpack_require__2) => {
  5970. Object.defineProperty(exports, "__esModule", {
  5971. value: true
  5972. });
  5973. exports.initOnPageConfig = exports.getPageConfig = void 0;
  5974. const shared_utils_1 = __webpack_require__2(
  5975. /*! @vue-devtools/shared-utils */
  5976. "../shared-utils/lib/index.js"
  5977. );
  5978. let config = {};
  5979. function getPageConfig() {
  5980. return config;
  5981. }
  5982. exports.getPageConfig = getPageConfig;
  5983. function initOnPageConfig() {
  5984. if (Object.hasOwnProperty.call(shared_utils_1.target, "VUE_DEVTOOLS_CONFIG")) {
  5985. config = shared_utils_1.SharedData.pageConfig = shared_utils_1.target.VUE_DEVTOOLS_CONFIG;
  5986. if (Object.hasOwnProperty.call(config, "openInEditorHost")) {
  5987. shared_utils_1.SharedData.openInEditorHost = config.openInEditorHost;
  5988. }
  5989. }
  5990. }
  5991. exports.initOnPageConfig = initOnPageConfig;
  5992. }
  5993. ),
  5994. /***/
  5995. "../app-backend-core/lib/perf.js": (
  5996. /*!***************************************!*\
  5997. !*** ../app-backend-core/lib/perf.js ***!
  5998. \***************************************/
  5999. /***/
  6000. (__unused_webpack_module, exports, __webpack_require__2) => {
  6001. Object.defineProperty(exports, "__esModule", {
  6002. value: true
  6003. });
  6004. exports.handleAddPerformanceTag = exports.performanceMarkEnd = exports.performanceMarkStart = void 0;
  6005. const shared_utils_1 = __webpack_require__2(
  6006. /*! @vue-devtools/shared-utils */
  6007. "../shared-utils/lib/index.js"
  6008. );
  6009. const timeline_1 = __webpack_require__2(
  6010. /*! ./timeline */
  6011. "../app-backend-core/lib/timeline.js"
  6012. );
  6013. const app_1 = __webpack_require__2(
  6014. /*! ./app */
  6015. "../app-backend-core/lib/app.js"
  6016. );
  6017. const component_1 = __webpack_require__2(
  6018. /*! ./component */
  6019. "../app-backend-core/lib/component.js"
  6020. );
  6021. const subscriptions_1 = __webpack_require__2(
  6022. /*! ./util/subscriptions */
  6023. "../app-backend-core/lib/util/subscriptions.js"
  6024. );
  6025. async function performanceMarkStart(app, uid, instance, type, time, ctx) {
  6026. try {
  6027. if (!shared_utils_1.SharedData.performanceMonitoringEnabled)
  6028. return;
  6029. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6030. const componentName = await appRecord.backend.api.getComponentName(instance);
  6031. const groupId = ctx.perfUniqueGroupId++;
  6032. const groupKey = `${uid}-${type}`;
  6033. appRecord.perfGroupIds.set(groupKey, {
  6034. groupId,
  6035. time
  6036. });
  6037. await (0, timeline_1.addTimelineEvent)({
  6038. layerId: "performance",
  6039. event: {
  6040. time,
  6041. data: {
  6042. component: componentName,
  6043. type,
  6044. measure: "start"
  6045. },
  6046. title: componentName,
  6047. subtitle: type,
  6048. groupId
  6049. }
  6050. }, app, ctx);
  6051. if (markEndQueue.has(groupKey)) {
  6052. const {
  6053. app: app2,
  6054. uid: uid2,
  6055. instance: instance2,
  6056. type: type2,
  6057. time: time2
  6058. } = markEndQueue.get(groupKey);
  6059. markEndQueue.delete(groupKey);
  6060. await performanceMarkEnd(app2, uid2, instance2, type2, time2, ctx);
  6061. }
  6062. } catch (e) {
  6063. if (shared_utils_1.SharedData.debugInfo) {
  6064. console.error(e);
  6065. }
  6066. }
  6067. }
  6068. exports.performanceMarkStart = performanceMarkStart;
  6069. const markEndQueue = /* @__PURE__ */ new Map();
  6070. async function performanceMarkEnd(app, uid, instance, type, time, ctx) {
  6071. try {
  6072. if (!shared_utils_1.SharedData.performanceMonitoringEnabled)
  6073. return;
  6074. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6075. const componentName = await appRecord.backend.api.getComponentName(instance);
  6076. const groupKey = `${uid}-${type}`;
  6077. const groupInfo = appRecord.perfGroupIds.get(groupKey);
  6078. if (!groupInfo) {
  6079. markEndQueue.set(groupKey, {
  6080. app,
  6081. uid,
  6082. instance,
  6083. type,
  6084. time
  6085. });
  6086. return;
  6087. }
  6088. const {
  6089. groupId,
  6090. time: startTime
  6091. } = groupInfo;
  6092. const duration = time - startTime;
  6093. await (0, timeline_1.addTimelineEvent)({
  6094. layerId: "performance",
  6095. event: {
  6096. time,
  6097. data: {
  6098. component: componentName,
  6099. type,
  6100. measure: "end",
  6101. duration: {
  6102. _custom: {
  6103. type: "Duration",
  6104. value: duration,
  6105. display: `${duration} ms`
  6106. }
  6107. }
  6108. },
  6109. title: componentName,
  6110. subtitle: type,
  6111. groupId
  6112. }
  6113. }, app, ctx);
  6114. const tooSlow = duration > 10;
  6115. if (tooSlow || instance.__VUE_DEVTOOLS_SLOW__) {
  6116. let change = false;
  6117. if (tooSlow && !instance.__VUE_DEVTOOLS_SLOW__) {
  6118. instance.__VUE_DEVTOOLS_SLOW__ = {
  6119. duration: null,
  6120. measures: {}
  6121. };
  6122. }
  6123. const data = instance.__VUE_DEVTOOLS_SLOW__;
  6124. if (tooSlow && (data.duration == null || data.duration < duration)) {
  6125. data.duration = duration;
  6126. change = true;
  6127. }
  6128. if (data.measures[type] == null || data.measures[type] < duration) {
  6129. data.measures[type] = duration;
  6130. change = true;
  6131. }
  6132. if (change) {
  6133. const id = await (0, component_1.getComponentId)(app, uid, instance, ctx);
  6134. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === id)) {
  6135. (0, shared_utils_1.raf)(() => {
  6136. (0, component_1.sendComponentTreeData)(appRecord, id, ctx.currentAppRecord.componentFilter, null, false, ctx);
  6137. });
  6138. }
  6139. }
  6140. }
  6141. } catch (e) {
  6142. if (shared_utils_1.SharedData.debugInfo) {
  6143. console.error(e);
  6144. }
  6145. }
  6146. }
  6147. exports.performanceMarkEnd = performanceMarkEnd;
  6148. function handleAddPerformanceTag(backend, ctx) {
  6149. backend.api.on.visitComponentTree((payload) => {
  6150. if (payload.componentInstance.__VUE_DEVTOOLS_SLOW__) {
  6151. const {
  6152. duration,
  6153. measures
  6154. } = payload.componentInstance.__VUE_DEVTOOLS_SLOW__;
  6155. let tooltip = '<div class="grid grid-cols-2 gap-2 font-mono text-xs">';
  6156. for (const type in measures) {
  6157. const d = measures[type];
  6158. tooltip += `<div>${type}</div><div class="text-right text-black rounded px-1 ${d > 30 ? "bg-red-400" : d > 10 ? "bg-yellow-400" : "bg-green-400"}">${Math.round(d * 1e3) / 1e3} ms</div>`;
  6159. }
  6160. tooltip += "</div>";
  6161. payload.treeNode.tags.push({
  6162. backgroundColor: duration > 30 ? 16281969 : 16498468,
  6163. textColor: 0,
  6164. label: `${Math.round(duration * 1e3) / 1e3} ms`,
  6165. tooltip
  6166. });
  6167. }
  6168. });
  6169. }
  6170. exports.handleAddPerformanceTag = handleAddPerformanceTag;
  6171. }
  6172. ),
  6173. /***/
  6174. "../app-backend-core/lib/plugin.js": (
  6175. /*!*****************************************!*\
  6176. !*** ../app-backend-core/lib/plugin.js ***!
  6177. \*****************************************/
  6178. /***/
  6179. (__unused_webpack_module, exports, __webpack_require__2) => {
  6180. Object.defineProperty(exports, "__esModule", {
  6181. value: true
  6182. });
  6183. exports.serializePlugin = exports.sendPluginList = exports.addPreviouslyRegisteredPlugins = exports.addQueuedPlugins = exports.addPlugin = void 0;
  6184. const app_backend_api_1 = __webpack_require__2(
  6185. /*! @vue-devtools/app-backend-api */
  6186. "../app-backend-api/lib/index.js"
  6187. );
  6188. const shared_utils_1 = __webpack_require__2(
  6189. /*! @vue-devtools/shared-utils */
  6190. "../shared-utils/lib/index.js"
  6191. );
  6192. const app_1 = __webpack_require__2(
  6193. /*! ./app */
  6194. "../app-backend-core/lib/app.js"
  6195. );
  6196. async function addPlugin(pluginQueueItem, ctx) {
  6197. const {
  6198. pluginDescriptor,
  6199. setupFn
  6200. } = pluginQueueItem;
  6201. const plugin = {
  6202. descriptor: pluginDescriptor,
  6203. setupFn,
  6204. error: null
  6205. };
  6206. ctx.currentPlugin = plugin;
  6207. try {
  6208. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  6209. const api = new app_backend_api_1.DevtoolsPluginApiInstance(plugin, appRecord, ctx);
  6210. if (pluginQueueItem.proxy) {
  6211. await pluginQueueItem.proxy.setRealTarget(api);
  6212. } else {
  6213. setupFn(api);
  6214. }
  6215. } catch (e) {
  6216. plugin.error = e;
  6217. if (shared_utils_1.SharedData.debugInfo) {
  6218. console.error(e);
  6219. }
  6220. }
  6221. ctx.currentPlugin = null;
  6222. ctx.plugins.push(plugin);
  6223. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_DEVTOOLS_PLUGIN_ADD, {
  6224. plugin: await serializePlugin(plugin)
  6225. });
  6226. const targetList = shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ = shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ || [];
  6227. targetList.push({
  6228. pluginDescriptor,
  6229. setupFn
  6230. });
  6231. }
  6232. exports.addPlugin = addPlugin;
  6233. async function addQueuedPlugins(ctx) {
  6234. if (shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__ && Array.isArray(shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__)) {
  6235. for (const queueItem of shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__) {
  6236. await addPlugin(queueItem, ctx);
  6237. }
  6238. shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__ = null;
  6239. }
  6240. }
  6241. exports.addQueuedPlugins = addQueuedPlugins;
  6242. async function addPreviouslyRegisteredPlugins(ctx) {
  6243. if (shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ && Array.isArray(shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__)) {
  6244. for (const queueItem of shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__) {
  6245. await addPlugin(queueItem, ctx);
  6246. }
  6247. }
  6248. }
  6249. exports.addPreviouslyRegisteredPlugins = addPreviouslyRegisteredPlugins;
  6250. async function sendPluginList(ctx) {
  6251. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_DEVTOOLS_PLUGIN_LIST, {
  6252. plugins: await Promise.all(ctx.plugins.map((p) => serializePlugin(p)))
  6253. });
  6254. }
  6255. exports.sendPluginList = sendPluginList;
  6256. async function serializePlugin(plugin) {
  6257. return {
  6258. id: plugin.descriptor.id,
  6259. label: plugin.descriptor.label,
  6260. appId: (0, app_1.getAppRecordId)(plugin.descriptor.app),
  6261. packageName: plugin.descriptor.packageName,
  6262. homepage: plugin.descriptor.homepage,
  6263. logo: plugin.descriptor.logo,
  6264. componentStateTypes: plugin.descriptor.componentStateTypes,
  6265. settingsSchema: plugin.descriptor.settings
  6266. };
  6267. }
  6268. exports.serializePlugin = serializePlugin;
  6269. }
  6270. ),
  6271. /***/
  6272. "../app-backend-core/lib/timeline-builtins.js": (
  6273. /*!****************************************************!*\
  6274. !*** ../app-backend-core/lib/timeline-builtins.js ***!
  6275. \****************************************************/
  6276. /***/
  6277. (__unused_webpack_module, exports) => {
  6278. Object.defineProperty(exports, "__esModule", {
  6279. value: true
  6280. });
  6281. exports.builtinLayers = void 0;
  6282. exports.builtinLayers = [{
  6283. id: "mouse",
  6284. label: "Mouse",
  6285. color: 10768815,
  6286. screenshotOverlayRender(event, {
  6287. events
  6288. }) {
  6289. const samePositionEvent = events.find((e) => e !== event && e.renderMeta.textEl && e.data.x === event.data.x && e.data.y === event.data.y);
  6290. if (samePositionEvent) {
  6291. const text2 = document.createElement("div");
  6292. text2.innerText = event.data.type;
  6293. samePositionEvent.renderMeta.textEl.appendChild(text2);
  6294. return false;
  6295. }
  6296. const div = document.createElement("div");
  6297. div.style.position = "absolute";
  6298. div.style.left = `${event.data.x - 4}px`;
  6299. div.style.top = `${event.data.y - 4}px`;
  6300. div.style.width = "8px";
  6301. div.style.height = "8px";
  6302. div.style.borderRadius = "100%";
  6303. div.style.backgroundColor = "rgba(164, 81, 175, 0.5)";
  6304. const text = document.createElement("div");
  6305. text.innerText = event.data.type;
  6306. text.style.color = "#541e5b";
  6307. text.style.fontFamily = "monospace";
  6308. text.style.fontSize = "9px";
  6309. text.style.position = "absolute";
  6310. text.style.left = "10px";
  6311. text.style.top = "10px";
  6312. text.style.padding = "1px";
  6313. text.style.backgroundColor = "rgba(255, 255, 255, 0.9)";
  6314. text.style.borderRadius = "3px";
  6315. div.appendChild(text);
  6316. event.renderMeta.textEl = text;
  6317. return div;
  6318. }
  6319. }, {
  6320. id: "keyboard",
  6321. label: "Keyboard",
  6322. color: 8475055
  6323. }, {
  6324. id: "component-event",
  6325. label: "Component events",
  6326. color: 4307075,
  6327. screenshotOverlayRender: (event, {
  6328. events
  6329. }) => {
  6330. if (!event.meta.bounds || events.some((e) => e !== event && e.layerId === event.layerId && e.renderMeta.drawn && (e.meta.componentId === event.meta.componentId || e.meta.bounds.left === event.meta.bounds.left && e.meta.bounds.top === event.meta.bounds.top && e.meta.bounds.width === event.meta.bounds.width && e.meta.bounds.height === event.meta.bounds.height))) {
  6331. return false;
  6332. }
  6333. const div = document.createElement("div");
  6334. div.style.position = "absolute";
  6335. div.style.left = `${event.meta.bounds.left - 4}px`;
  6336. div.style.top = `${event.meta.bounds.top - 4}px`;
  6337. div.style.width = `${event.meta.bounds.width}px`;
  6338. div.style.height = `${event.meta.bounds.height}px`;
  6339. div.style.borderRadius = "8px";
  6340. div.style.borderStyle = "solid";
  6341. div.style.borderWidth = "4px";
  6342. div.style.borderColor = "rgba(65, 184, 131, 0.5)";
  6343. div.style.textAlign = "center";
  6344. div.style.display = "flex";
  6345. div.style.alignItems = "center";
  6346. div.style.justifyContent = "center";
  6347. div.style.overflow = "hidden";
  6348. const text = document.createElement("div");
  6349. text.style.color = "#267753";
  6350. text.style.fontFamily = "monospace";
  6351. text.style.fontSize = "9px";
  6352. text.style.padding = "1px";
  6353. text.style.backgroundColor = "rgba(255, 255, 255, 0.9)";
  6354. text.style.borderRadius = "3px";
  6355. text.innerText = event.data.event;
  6356. div.appendChild(text);
  6357. event.renderMeta.drawn = true;
  6358. return div;
  6359. }
  6360. }, {
  6361. id: "performance",
  6362. label: "Performance",
  6363. color: 4307050,
  6364. groupsOnly: true,
  6365. skipScreenshots: true,
  6366. ignoreNoDurationGroups: true
  6367. }];
  6368. }
  6369. ),
  6370. /***/
  6371. "../app-backend-core/lib/timeline-marker.js": (
  6372. /*!**************************************************!*\
  6373. !*** ../app-backend-core/lib/timeline-marker.js ***!
  6374. \**************************************************/
  6375. /***/
  6376. (__unused_webpack_module, exports, __webpack_require__2) => {
  6377. Object.defineProperty(exports, "__esModule", {
  6378. value: true
  6379. });
  6380. exports.sendTimelineMarkers = exports.addTimelineMarker = void 0;
  6381. const shared_utils_1 = __webpack_require__2(
  6382. /*! @vue-devtools/shared-utils */
  6383. "../shared-utils/lib/index.js"
  6384. );
  6385. const devtools_api_1 = __webpack_require__2(
  6386. /*! @vue/devtools-api */
  6387. "../api/lib/esm/index.js"
  6388. );
  6389. const timeline_1 = __webpack_require__2(
  6390. /*! ./timeline */
  6391. "../app-backend-core/lib/timeline.js"
  6392. );
  6393. async function addTimelineMarker(options, ctx) {
  6394. var _a;
  6395. if (!ctx.currentAppRecord) {
  6396. options.all = true;
  6397. }
  6398. const marker = {
  6399. ...options,
  6400. appRecord: options.all ? null : ctx.currentAppRecord
  6401. };
  6402. ctx.timelineMarkers.push(marker);
  6403. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_MARKER, {
  6404. marker: await serializeMarker(marker),
  6405. appId: (_a = ctx.currentAppRecord) === null || _a === void 0 ? void 0 : _a.id
  6406. });
  6407. }
  6408. exports.addTimelineMarker = addTimelineMarker;
  6409. async function sendTimelineMarkers(ctx) {
  6410. if (!ctx.currentAppRecord)
  6411. return;
  6412. const markers = ctx.timelineMarkers.filter((marker) => marker.all || marker.appRecord === ctx.currentAppRecord);
  6413. const result = [];
  6414. for (const marker of markers) {
  6415. result.push(await serializeMarker(marker));
  6416. }
  6417. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LOAD_MARKERS, {
  6418. markers: result,
  6419. appId: ctx.currentAppRecord.id
  6420. });
  6421. }
  6422. exports.sendTimelineMarkers = sendTimelineMarkers;
  6423. async function serializeMarker(marker) {
  6424. var _a;
  6425. let time = marker.time;
  6426. if ((0, devtools_api_1.isPerformanceSupported)() && time < timeline_1.dateThreshold) {
  6427. time += timeline_1.perfTimeDiff;
  6428. }
  6429. return {
  6430. id: marker.id,
  6431. appId: (_a = marker.appRecord) === null || _a === void 0 ? void 0 : _a.id,
  6432. all: marker.all,
  6433. time: Math.round(time * 1e3),
  6434. label: marker.label,
  6435. color: marker.color
  6436. };
  6437. }
  6438. }
  6439. ),
  6440. /***/
  6441. "../app-backend-core/lib/timeline-screenshot.js": (
  6442. /*!******************************************************!*\
  6443. !*** ../app-backend-core/lib/timeline-screenshot.js ***!
  6444. \******************************************************/
  6445. /***/
  6446. (__unused_webpack_module, exports, __webpack_require__2) => {
  6447. Object.defineProperty(exports, "__esModule", {
  6448. value: true
  6449. });
  6450. exports.showScreenshot = void 0;
  6451. const shared_utils_1 = __webpack_require__2(
  6452. /*! @vue-devtools/shared-utils */
  6453. "../shared-utils/lib/index.js"
  6454. );
  6455. const queue_1 = __webpack_require__2(
  6456. /*! ./util/queue */
  6457. "../app-backend-core/lib/util/queue.js"
  6458. );
  6459. const timeline_builtins_1 = __webpack_require__2(
  6460. /*! ./timeline-builtins */
  6461. "../app-backend-core/lib/timeline-builtins.js"
  6462. );
  6463. let overlay;
  6464. let image;
  6465. let container;
  6466. const jobQueue = new queue_1.JobQueue();
  6467. async function showScreenshot(screenshot, ctx) {
  6468. await jobQueue.queue("showScreenshot", async () => {
  6469. if (screenshot) {
  6470. if (!container) {
  6471. createElements();
  6472. }
  6473. image.src = screenshot.image;
  6474. image.style.visibility = screenshot.image ? "visible" : "hidden";
  6475. clearContent();
  6476. const events = screenshot.events.map((id) => ctx.timelineEventMap.get(id)).filter(Boolean).map((eventData) => ({
  6477. layer: timeline_builtins_1.builtinLayers.concat(ctx.timelineLayers).find((layer) => layer.id === eventData.layerId),
  6478. event: {
  6479. ...eventData.event,
  6480. layerId: eventData.layerId,
  6481. renderMeta: {}
  6482. }
  6483. }));
  6484. const renderContext = {
  6485. screenshot,
  6486. events: events.map(({
  6487. event
  6488. }) => event),
  6489. index: 0
  6490. };
  6491. for (let i = 0; i < events.length; i++) {
  6492. const {
  6493. layer,
  6494. event
  6495. } = events[i];
  6496. if (layer.screenshotOverlayRender) {
  6497. renderContext.index = i;
  6498. try {
  6499. const result = await layer.screenshotOverlayRender(event, renderContext);
  6500. if (result !== false) {
  6501. if (typeof result === "string") {
  6502. container.innerHTML += result;
  6503. } else {
  6504. container.appendChild(result);
  6505. }
  6506. }
  6507. } catch (e) {
  6508. if (shared_utils_1.SharedData.debugInfo) {
  6509. console.error(e);
  6510. }
  6511. }
  6512. }
  6513. }
  6514. showElement();
  6515. } else {
  6516. hideElement();
  6517. }
  6518. });
  6519. }
  6520. exports.showScreenshot = showScreenshot;
  6521. function createElements() {
  6522. overlay = document.createElement("div");
  6523. overlay.style.position = "fixed";
  6524. overlay.style.zIndex = "9999999999999";
  6525. overlay.style.pointerEvents = "none";
  6526. overlay.style.left = "0";
  6527. overlay.style.top = "0";
  6528. overlay.style.width = "100vw";
  6529. overlay.style.height = "100vh";
  6530. overlay.style.backgroundColor = "rgba(0,0,0,0.5)";
  6531. overlay.style.overflow = "hidden";
  6532. const imageBox = document.createElement("div");
  6533. imageBox.style.position = "relative";
  6534. overlay.appendChild(imageBox);
  6535. image = document.createElement("img");
  6536. imageBox.appendChild(image);
  6537. container = document.createElement("div");
  6538. container.style.position = "absolute";
  6539. container.style.left = "0";
  6540. container.style.top = "0";
  6541. imageBox.appendChild(container);
  6542. const style = document.createElement("style");
  6543. style.innerHTML = ".__vuedevtools_no-scroll { overflow: hidden; }";
  6544. document.head.appendChild(style);
  6545. }
  6546. function showElement() {
  6547. if (!overlay.parentNode) {
  6548. document.body.appendChild(overlay);
  6549. document.body.classList.add("__vuedevtools_no-scroll");
  6550. }
  6551. }
  6552. function hideElement() {
  6553. if (overlay && overlay.parentNode) {
  6554. overlay.parentNode.removeChild(overlay);
  6555. document.body.classList.remove("__vuedevtools_no-scroll");
  6556. clearContent();
  6557. }
  6558. }
  6559. function clearContent() {
  6560. while (container.firstChild) {
  6561. container.removeChild(container.lastChild);
  6562. }
  6563. }
  6564. }
  6565. ),
  6566. /***/
  6567. "../app-backend-core/lib/timeline.js": (
  6568. /*!*******************************************!*\
  6569. !*** ../app-backend-core/lib/timeline.js ***!
  6570. \*******************************************/
  6571. /***/
  6572. (__unused_webpack_module, exports, __webpack_require__2) => {
  6573. Object.defineProperty(exports, "__esModule", {
  6574. value: true
  6575. });
  6576. exports.sendTimelineLayerEvents = exports.removeLayersForApp = exports.sendTimelineEventData = exports.clearTimeline = exports.perfTimeDiff = exports.dateThreshold = exports.addTimelineEvent = exports.sendTimelineLayers = exports.addBuiltinLayers = exports.setupTimeline = void 0;
  6577. const shared_utils_1 = __webpack_require__2(
  6578. /*! @vue-devtools/shared-utils */
  6579. "../shared-utils/lib/index.js"
  6580. );
  6581. const devtools_api_1 = __webpack_require__2(
  6582. /*! @vue/devtools-api */
  6583. "../api/lib/esm/index.js"
  6584. );
  6585. const global_hook_1 = __webpack_require__2(
  6586. /*! ./global-hook */
  6587. "../app-backend-core/lib/global-hook.js"
  6588. );
  6589. const app_1 = __webpack_require__2(
  6590. /*! ./app */
  6591. "../app-backend-core/lib/app.js"
  6592. );
  6593. const timeline_builtins_1 = __webpack_require__2(
  6594. /*! ./timeline-builtins */
  6595. "../app-backend-core/lib/timeline-builtins.js"
  6596. );
  6597. function setupTimeline(ctx) {
  6598. setupBuiltinLayers(ctx);
  6599. }
  6600. exports.setupTimeline = setupTimeline;
  6601. function addBuiltinLayers(appRecord, ctx) {
  6602. for (const layerDef of timeline_builtins_1.builtinLayers) {
  6603. ctx.timelineLayers.push({
  6604. ...layerDef,
  6605. appRecord,
  6606. plugin: null,
  6607. events: []
  6608. });
  6609. }
  6610. }
  6611. exports.addBuiltinLayers = addBuiltinLayers;
  6612. function setupBuiltinLayers(ctx) {
  6613. if (shared_utils_1.isBrowser) {
  6614. ["mousedown", "mouseup", "click", "dblclick"].forEach((eventType) => {
  6615. window.addEventListener(eventType, async (event) => {
  6616. await addTimelineEvent({
  6617. layerId: "mouse",
  6618. event: {
  6619. time: (0, devtools_api_1.now)(),
  6620. data: {
  6621. type: eventType,
  6622. x: event.clientX,
  6623. y: event.clientY
  6624. },
  6625. title: eventType
  6626. }
  6627. }, null, ctx);
  6628. }, {
  6629. capture: true,
  6630. passive: true
  6631. });
  6632. });
  6633. ["keyup", "keydown", "keypress"].forEach((eventType) => {
  6634. window.addEventListener(eventType, async (event) => {
  6635. await addTimelineEvent({
  6636. layerId: "keyboard",
  6637. event: {
  6638. time: (0, devtools_api_1.now)(),
  6639. data: {
  6640. type: eventType,
  6641. key: event.key,
  6642. ctrlKey: event.ctrlKey,
  6643. shiftKey: event.shiftKey,
  6644. altKey: event.altKey,
  6645. metaKey: event.metaKey
  6646. },
  6647. title: event.key
  6648. }
  6649. }, null, ctx);
  6650. }, {
  6651. capture: true,
  6652. passive: true
  6653. });
  6654. });
  6655. }
  6656. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_EMIT, async (app, instance, event, params) => {
  6657. try {
  6658. if (!shared_utils_1.SharedData.componentEventsEnabled)
  6659. return;
  6660. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6661. const componentId = `${appRecord.id}:${instance.uid}`;
  6662. const componentDisplay = await appRecord.backend.api.getComponentName(instance) || "<i>Unknown Component</i>";
  6663. await addTimelineEvent({
  6664. layerId: "component-event",
  6665. event: {
  6666. time: (0, devtools_api_1.now)(),
  6667. data: {
  6668. component: {
  6669. _custom: {
  6670. type: "component-definition",
  6671. display: componentDisplay
  6672. }
  6673. },
  6674. event,
  6675. params
  6676. },
  6677. title: event,
  6678. subtitle: `by ${componentDisplay}`,
  6679. meta: {
  6680. componentId,
  6681. bounds: await appRecord.backend.api.getComponentBounds(instance)
  6682. }
  6683. }
  6684. }, app, ctx);
  6685. } catch (e) {
  6686. if (shared_utils_1.SharedData.debugInfo) {
  6687. console.error(e);
  6688. }
  6689. }
  6690. });
  6691. }
  6692. async function sendTimelineLayers(ctx) {
  6693. var _a, _b;
  6694. const layers = [];
  6695. for (const layer of ctx.timelineLayers) {
  6696. try {
  6697. layers.push({
  6698. id: layer.id,
  6699. label: layer.label,
  6700. color: layer.color,
  6701. appId: (_a = layer.appRecord) === null || _a === void 0 ? void 0 : _a.id,
  6702. pluginId: (_b = layer.plugin) === null || _b === void 0 ? void 0 : _b.descriptor.id,
  6703. groupsOnly: layer.groupsOnly,
  6704. skipScreenshots: layer.skipScreenshots,
  6705. ignoreNoDurationGroups: layer.ignoreNoDurationGroups
  6706. });
  6707. } catch (e) {
  6708. if (shared_utils_1.SharedData.debugInfo) {
  6709. console.error(e);
  6710. }
  6711. }
  6712. }
  6713. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_LIST, {
  6714. layers
  6715. });
  6716. }
  6717. exports.sendTimelineLayers = sendTimelineLayers;
  6718. async function addTimelineEvent(options, app, ctx) {
  6719. const appId = app ? (0, app_1.getAppRecordId)(app) : null;
  6720. const isAllApps = options.all || !app || appId == null;
  6721. const id = ctx.nextTimelineEventId++;
  6722. const eventData = {
  6723. id,
  6724. ...options,
  6725. all: isAllApps
  6726. };
  6727. ctx.timelineEventMap.set(eventData.id, eventData);
  6728. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_EVENT, {
  6729. appId: eventData.all ? "all" : appId,
  6730. layerId: eventData.layerId,
  6731. event: mapTimelineEvent(eventData)
  6732. });
  6733. const layer = ctx.timelineLayers.find((l) => {
  6734. var _a;
  6735. return (isAllApps || ((_a = l.appRecord) === null || _a === void 0 ? void 0 : _a.options.app) === app) && l.id === options.layerId;
  6736. });
  6737. if (layer) {
  6738. layer.events.push(eventData);
  6739. } else if (shared_utils_1.SharedData.debugInfo) {
  6740. console.warn(`Timeline layer ${options.layerId} not found`);
  6741. }
  6742. }
  6743. exports.addTimelineEvent = addTimelineEvent;
  6744. const initialTime = Date.now();
  6745. exports.dateThreshold = initialTime - 1e6;
  6746. exports.perfTimeDiff = initialTime - (0, devtools_api_1.now)();
  6747. function mapTimelineEvent(eventData) {
  6748. let time = eventData.event.time;
  6749. if ((0, devtools_api_1.isPerformanceSupported)() && time < exports.dateThreshold) {
  6750. time += exports.perfTimeDiff;
  6751. }
  6752. return {
  6753. id: eventData.id,
  6754. time: Math.round(time * 1e3),
  6755. logType: eventData.event.logType,
  6756. groupId: eventData.event.groupId,
  6757. title: eventData.event.title,
  6758. subtitle: eventData.event.subtitle
  6759. };
  6760. }
  6761. async function clearTimeline(ctx) {
  6762. ctx.timelineEventMap.clear();
  6763. for (const layer of ctx.timelineLayers) {
  6764. layer.events = [];
  6765. }
  6766. for (const backend of ctx.backends) {
  6767. await backend.api.clearTimeline();
  6768. }
  6769. }
  6770. exports.clearTimeline = clearTimeline;
  6771. async function sendTimelineEventData(id, ctx) {
  6772. let data = null;
  6773. const eventData = ctx.timelineEventMap.get(id);
  6774. if (eventData) {
  6775. data = await ctx.currentAppRecord.backend.api.inspectTimelineEvent(eventData, ctx.currentAppRecord.options.app);
  6776. data = (0, shared_utils_1.stringify)(data);
  6777. } else if (shared_utils_1.SharedData.debugInfo) {
  6778. console.warn(`Event ${id} not found`, ctx.timelineEventMap.keys());
  6779. }
  6780. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_EVENT_DATA, {
  6781. eventId: id,
  6782. data
  6783. });
  6784. }
  6785. exports.sendTimelineEventData = sendTimelineEventData;
  6786. function removeLayersForApp(app, ctx) {
  6787. const layers = ctx.timelineLayers.filter((l) => {
  6788. var _a;
  6789. return ((_a = l.appRecord) === null || _a === void 0 ? void 0 : _a.options.app) === app;
  6790. });
  6791. for (const layer of layers) {
  6792. const index = ctx.timelineLayers.indexOf(layer);
  6793. if (index !== -1)
  6794. ctx.timelineLayers.splice(index, 1);
  6795. for (const e of layer.events) {
  6796. ctx.timelineEventMap.delete(e.id);
  6797. }
  6798. }
  6799. }
  6800. exports.removeLayersForApp = removeLayersForApp;
  6801. function sendTimelineLayerEvents(appId, layerId, ctx) {
  6802. var _a;
  6803. const app = (_a = ctx.appRecords.find((ar) => ar.id === appId)) === null || _a === void 0 ? void 0 : _a.options.app;
  6804. if (!app)
  6805. return;
  6806. const layer = ctx.timelineLayers.find((l) => {
  6807. var _a2;
  6808. return ((_a2 = l.appRecord) === null || _a2 === void 0 ? void 0 : _a2.options.app) === app && l.id === layerId;
  6809. });
  6810. if (!layer)
  6811. return;
  6812. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS, {
  6813. appId,
  6814. layerId,
  6815. events: layer.events.map((e) => mapTimelineEvent(e))
  6816. });
  6817. }
  6818. exports.sendTimelineLayerEvents = sendTimelineLayerEvents;
  6819. }
  6820. ),
  6821. /***/
  6822. "../app-backend-core/lib/util/queue.js": (
  6823. /*!*********************************************!*\
  6824. !*** ../app-backend-core/lib/util/queue.js ***!
  6825. \*********************************************/
  6826. /***/
  6827. (__unused_webpack_module, exports) => {
  6828. Object.defineProperty(exports, "__esModule", {
  6829. value: true
  6830. });
  6831. exports.JobQueue = void 0;
  6832. class JobQueue {
  6833. constructor() {
  6834. this.jobs = [];
  6835. }
  6836. queue(id, fn) {
  6837. const job = {
  6838. id,
  6839. fn
  6840. };
  6841. return new Promise((resolve) => {
  6842. const onDone = () => {
  6843. this.currentJob = null;
  6844. const nextJob = this.jobs.shift();
  6845. if (nextJob) {
  6846. nextJob.fn();
  6847. }
  6848. resolve();
  6849. };
  6850. const run = () => {
  6851. this.currentJob = job;
  6852. return job.fn().then(onDone).catch((e) => {
  6853. console.error(`Job ${job.id} failed:`);
  6854. console.error(e);
  6855. });
  6856. };
  6857. if (this.currentJob) {
  6858. this.jobs.push({
  6859. id: job.id,
  6860. fn: () => run()
  6861. });
  6862. } else {
  6863. run();
  6864. }
  6865. });
  6866. }
  6867. }
  6868. exports.JobQueue = JobQueue;
  6869. }
  6870. ),
  6871. /***/
  6872. "../app-backend-core/lib/util/subscriptions.js": (
  6873. /*!*****************************************************!*\
  6874. !*** ../app-backend-core/lib/util/subscriptions.js ***!
  6875. \*****************************************************/
  6876. /***/
  6877. (__unused_webpack_module, exports) => {
  6878. Object.defineProperty(exports, "__esModule", {
  6879. value: true
  6880. });
  6881. exports.isSubscribed = exports.unsubscribe = exports.subscribe = void 0;
  6882. const activeSubs = /* @__PURE__ */ new Map();
  6883. function getSubs(type) {
  6884. let subs = activeSubs.get(type);
  6885. if (!subs) {
  6886. subs = [];
  6887. activeSubs.set(type, subs);
  6888. }
  6889. return subs;
  6890. }
  6891. function subscribe(type, payload) {
  6892. const rawPayload = getRawPayload(payload);
  6893. getSubs(type).push({
  6894. payload,
  6895. rawPayload
  6896. });
  6897. }
  6898. exports.subscribe = subscribe;
  6899. function unsubscribe(type, payload) {
  6900. const rawPayload = getRawPayload(payload);
  6901. const subs = getSubs(type);
  6902. let index;
  6903. while ((index = subs.findIndex((sub) => sub.rawPayload === rawPayload)) !== -1) {
  6904. subs.splice(index, 1);
  6905. }
  6906. }
  6907. exports.unsubscribe = unsubscribe;
  6908. function getRawPayload(payload) {
  6909. const data = Object.keys(payload).sort().reduce((acc, key) => {
  6910. acc[key] = payload[key];
  6911. return acc;
  6912. }, {});
  6913. return JSON.stringify(data);
  6914. }
  6915. function isSubscribed(type, predicate = () => true) {
  6916. return getSubs(type).some(predicate);
  6917. }
  6918. exports.isSubscribed = isSubscribed;
  6919. }
  6920. ),
  6921. /***/
  6922. "../app-backend-vue3/lib/components/data.js": (
  6923. /*!**************************************************!*\
  6924. !*** ../app-backend-vue3/lib/components/data.js ***!
  6925. \**************************************************/
  6926. /***/
  6927. (__unused_webpack_module, exports, __webpack_require__2) => {
  6928. Object.defineProperty(exports, "__esModule", {
  6929. value: true
  6930. });
  6931. exports.getCustomInstanceDetails = exports.editState = exports.getCustomObjectDetails = exports.getInstanceDetails = void 0;
  6932. const util_1 = __webpack_require__2(
  6933. /*! ./util */
  6934. "../app-backend-vue3/lib/components/util.js"
  6935. );
  6936. const shared_utils_1 = __webpack_require__2(
  6937. /*! @vue-devtools/shared-utils */
  6938. "../shared-utils/lib/index.js"
  6939. );
  6940. const util_2 = __webpack_require__2(
  6941. /*! ../util */
  6942. "../app-backend-vue3/lib/util.js"
  6943. );
  6944. const vueBuiltins = ["nextTick", "defineComponent", "defineAsyncComponent", "defineCustomElement", "ref", "computed", "reactive", "readonly", "watchEffect", "watchPostEffect", "watchSyncEffect", "watch", "isRef", "unref", "toRef", "toRefs", "isProxy", "isReactive", "isReadonly", "shallowRef", "triggerRef", "customRef", "shallowReactive", "shallowReadonly", "toRaw", "markRaw", "effectScope", "getCurrentScope", "onScopeDispose", "onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onErrorCaptured", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated", "onServerPrefetch", "provide", "inject", "h", "mergeProps", "cloneVNode", "isVNode", "resolveComponent", "resolveDirective", "withDirectives", "withModifiers"];
  6945. function getInstanceDetails(instance, ctx) {
  6946. var _a;
  6947. return {
  6948. id: (0, util_1.getUniqueComponentId)(instance, ctx),
  6949. name: (0, util_1.getInstanceName)(instance),
  6950. file: (_a = instance.type) === null || _a === void 0 ? void 0 : _a.__file,
  6951. state: getInstanceState(instance)
  6952. };
  6953. }
  6954. exports.getInstanceDetails = getInstanceDetails;
  6955. function getInstanceState(instance) {
  6956. const mergedType = resolveMergedOptions(instance);
  6957. return processProps(instance).concat(processState(instance), processSetupState(instance), processComputed(instance, mergedType), processAttrs(instance), processProvide(instance), processInject(instance, mergedType), processRefs(instance));
  6958. }
  6959. function processProps(instance) {
  6960. const propsData = [];
  6961. const propDefinitions = instance.type.props;
  6962. for (let key in instance.props) {
  6963. const propDefinition = propDefinitions ? propDefinitions[key] : null;
  6964. key = (0, shared_utils_1.camelize)(key);
  6965. propsData.push({
  6966. type: "props",
  6967. key,
  6968. value: (0, util_2.returnError)(() => instance.props[key]),
  6969. meta: propDefinition ? {
  6970. type: propDefinition.type ? getPropType(propDefinition.type) : "any",
  6971. required: !!propDefinition.required,
  6972. ...propDefinition.default != null ? {
  6973. default: propDefinition.default.toString()
  6974. } : {}
  6975. } : {
  6976. type: "invalid"
  6977. },
  6978. editable: shared_utils_1.SharedData.editableProps
  6979. });
  6980. }
  6981. return propsData;
  6982. }
  6983. const fnTypeRE = /^(?:function|class) (\w+)/;
  6984. function getPropType(type) {
  6985. if (Array.isArray(type)) {
  6986. return type.map((t) => getPropType(t)).join(" or ");
  6987. }
  6988. if (type == null) {
  6989. return "null";
  6990. }
  6991. const match = type.toString().match(fnTypeRE);
  6992. return typeof type === "function" ? match && match[1] || "any" : "any";
  6993. }
  6994. function processState(instance) {
  6995. const type = instance.type;
  6996. const props = type.props;
  6997. const getters = type.vuex && type.vuex.getters;
  6998. const computedDefs = type.computed;
  6999. const data = {
  7000. ...instance.data,
  7001. ...instance.renderContext
  7002. };
  7003. return Object.keys(data).filter((key) => !(props && key in props) && !(getters && key in getters) && !(computedDefs && key in computedDefs)).map((key) => ({
  7004. key,
  7005. type: "data",
  7006. value: (0, util_2.returnError)(() => data[key]),
  7007. editable: true
  7008. }));
  7009. }
  7010. function processSetupState(instance) {
  7011. const raw = instance.devtoolsRawSetupState || {};
  7012. return Object.keys(instance.setupState).filter((key) => !vueBuiltins.includes(key) && !key.startsWith("use")).map((key) => {
  7013. var _a, _b, _c, _d;
  7014. const value = (0, util_2.returnError)(() => toRaw(instance.setupState[key]));
  7015. const rawData = raw[key];
  7016. let result;
  7017. let isOther = typeof value === "function" || typeof (value === null || value === void 0 ? void 0 : value.render) === "function" || typeof (value === null || value === void 0 ? void 0 : value.__asyncLoader) === "function";
  7018. if (rawData) {
  7019. const info = getSetupStateInfo(rawData);
  7020. const objectType = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
  7021. const isState = info.ref || info.computed || info.reactive;
  7022. const raw2 = ((_b = (_a = rawData.effect) === null || _a === void 0 ? void 0 : _a.raw) === null || _b === void 0 ? void 0 : _b.toString()) || ((_d = (_c = rawData.effect) === null || _c === void 0 ? void 0 : _c.fn) === null || _d === void 0 ? void 0 : _d.toString());
  7023. if (objectType) {
  7024. isOther = false;
  7025. }
  7026. result = {
  7027. ...objectType ? {
  7028. objectType
  7029. } : {},
  7030. ...raw2 ? {
  7031. raw: raw2
  7032. } : {},
  7033. editable: isState && !info.readonly
  7034. };
  7035. }
  7036. const type = isOther ? "setup (other)" : "setup";
  7037. return {
  7038. key,
  7039. value,
  7040. type,
  7041. ...result
  7042. };
  7043. });
  7044. }
  7045. function isRef(raw) {
  7046. return !!raw.__v_isRef;
  7047. }
  7048. function isComputed(raw) {
  7049. return isRef(raw) && !!raw.effect;
  7050. }
  7051. function isReactive(raw) {
  7052. return !!raw.__v_isReactive;
  7053. }
  7054. function isReadOnly(raw) {
  7055. return !!raw.__v_isReadonly;
  7056. }
  7057. function toRaw(value) {
  7058. if (value === null || value === void 0 ? void 0 : value.__v_raw) {
  7059. return value.__v_raw;
  7060. }
  7061. return value;
  7062. }
  7063. function getSetupStateInfo(raw) {
  7064. return {
  7065. ref: isRef(raw),
  7066. computed: isComputed(raw),
  7067. reactive: isReactive(raw),
  7068. readonly: isReadOnly(raw)
  7069. };
  7070. }
  7071. function getCustomObjectDetails(object, proto) {
  7072. var _a, _b, _c, _d;
  7073. const info = getSetupStateInfo(object);
  7074. const isState = info.ref || info.computed || info.reactive;
  7075. if (isState) {
  7076. const objectType = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
  7077. const value = toRaw(info.reactive ? object : object._value);
  7078. const raw = ((_b = (_a = object.effect) === null || _a === void 0 ? void 0 : _a.raw) === null || _b === void 0 ? void 0 : _b.toString()) || ((_d = (_c = object.effect) === null || _c === void 0 ? void 0 : _c.fn) === null || _d === void 0 ? void 0 : _d.toString());
  7079. return {
  7080. _custom: {
  7081. type: objectType.toLowerCase(),
  7082. objectType,
  7083. value,
  7084. ...raw ? {
  7085. tooltip: `<span class="font-mono">${raw}</span>`
  7086. } : {}
  7087. }
  7088. };
  7089. }
  7090. if (typeof object.__asyncLoader === "function") {
  7091. return {
  7092. _custom: {
  7093. type: "component-definition",
  7094. display: "Async component definition"
  7095. }
  7096. };
  7097. }
  7098. }
  7099. exports.getCustomObjectDetails = getCustomObjectDetails;
  7100. function processComputed(instance, mergedType) {
  7101. const type = mergedType;
  7102. const computed = [];
  7103. const defs = type.computed || {};
  7104. for (const key in defs) {
  7105. const def = defs[key];
  7106. const type2 = typeof def === "function" && def.vuex ? "vuex bindings" : "computed";
  7107. computed.push({
  7108. type: type2,
  7109. key,
  7110. value: (0, util_2.returnError)(() => instance.proxy[key]),
  7111. editable: typeof def.set === "function"
  7112. });
  7113. }
  7114. return computed;
  7115. }
  7116. function processAttrs(instance) {
  7117. return Object.keys(instance.attrs).map((key) => ({
  7118. type: "attrs",
  7119. key,
  7120. value: (0, util_2.returnError)(() => instance.attrs[key])
  7121. }));
  7122. }
  7123. function processProvide(instance) {
  7124. return Reflect.ownKeys(instance.provides).map((key) => ({
  7125. type: "provided",
  7126. key: key.toString(),
  7127. value: (0, util_2.returnError)(() => instance.provides[key])
  7128. }));
  7129. }
  7130. function processInject(instance, mergedType) {
  7131. if (!(mergedType === null || mergedType === void 0 ? void 0 : mergedType.inject))
  7132. return [];
  7133. let keys = [];
  7134. let defaultValue;
  7135. if (Array.isArray(mergedType.inject)) {
  7136. keys = mergedType.inject.map((key) => ({
  7137. key,
  7138. originalKey: key
  7139. }));
  7140. } else {
  7141. keys = Reflect.ownKeys(mergedType.inject).map((key) => {
  7142. const value = mergedType.inject[key];
  7143. let originalKey;
  7144. if (typeof value === "string" || typeof value === "symbol") {
  7145. originalKey = value;
  7146. } else {
  7147. originalKey = value.from;
  7148. defaultValue = value.default;
  7149. }
  7150. return {
  7151. key,
  7152. originalKey
  7153. };
  7154. });
  7155. }
  7156. return keys.map(({
  7157. key,
  7158. originalKey
  7159. }) => ({
  7160. type: "injected",
  7161. key: originalKey && key !== originalKey ? `${originalKey.toString()} ➞ ${key.toString()}` : key.toString(),
  7162. value: (0, util_2.returnError)(() => instance.ctx[key] || instance.provides[originalKey] || defaultValue)
  7163. }));
  7164. }
  7165. function processRefs(instance) {
  7166. return Object.keys(instance.refs).map((key) => ({
  7167. type: "refs",
  7168. key,
  7169. value: (0, util_2.returnError)(() => instance.refs[key])
  7170. }));
  7171. }
  7172. function editState({
  7173. componentInstance,
  7174. path,
  7175. state,
  7176. type
  7177. }, stateEditor, ctx) {
  7178. if (!["data", "props", "computed", "setup"].includes(type))
  7179. return;
  7180. let target;
  7181. const targetPath = path.slice();
  7182. if (Object.keys(componentInstance.props).includes(path[0])) {
  7183. target = componentInstance.props;
  7184. } else if (componentInstance.devtoolsRawSetupState && Object.keys(componentInstance.devtoolsRawSetupState).includes(path[0])) {
  7185. target = componentInstance.devtoolsRawSetupState;
  7186. const currentValue = stateEditor.get(componentInstance.devtoolsRawSetupState, path);
  7187. if (currentValue != null) {
  7188. const info = getSetupStateInfo(currentValue);
  7189. if (info.readonly)
  7190. return;
  7191. }
  7192. } else {
  7193. target = componentInstance.proxy;
  7194. }
  7195. if (target && targetPath) {
  7196. stateEditor.set(target, targetPath, "value" in state ? state.value : void 0, stateEditor.createDefaultSetCallback(state));
  7197. }
  7198. }
  7199. exports.editState = editState;
  7200. function reduceStateList(list) {
  7201. if (!list.length) {
  7202. return void 0;
  7203. }
  7204. return list.reduce((map, item) => {
  7205. const key = item.type || "data";
  7206. const obj = map[key] = map[key] || {};
  7207. obj[item.key] = item.value;
  7208. return map;
  7209. }, {});
  7210. }
  7211. function getCustomInstanceDetails(instance) {
  7212. if (instance._)
  7213. instance = instance._;
  7214. const state = getInstanceState(instance);
  7215. return {
  7216. _custom: {
  7217. type: "component",
  7218. id: instance.__VUE_DEVTOOLS_UID__,
  7219. display: (0, util_1.getInstanceName)(instance),
  7220. tooltip: "Component instance",
  7221. value: reduceStateList(state),
  7222. fields: {
  7223. abstract: true
  7224. }
  7225. }
  7226. };
  7227. }
  7228. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  7229. function resolveMergedOptions(instance) {
  7230. const raw = instance.type;
  7231. const {
  7232. mixins,
  7233. extends: extendsOptions
  7234. } = raw;
  7235. const globalMixins = instance.appContext.mixins;
  7236. if (!globalMixins.length && !mixins && !extendsOptions)
  7237. return raw;
  7238. const options = {};
  7239. globalMixins.forEach((m) => mergeOptions(options, m));
  7240. mergeOptions(options, raw);
  7241. return options;
  7242. }
  7243. function mergeOptions(to, from, instance) {
  7244. if (typeof from === "function") {
  7245. from = from.options;
  7246. }
  7247. if (!from)
  7248. return to;
  7249. const {
  7250. mixins,
  7251. extends: extendsOptions
  7252. } = from;
  7253. extendsOptions && mergeOptions(to, extendsOptions);
  7254. mixins && mixins.forEach((m) => mergeOptions(to, m));
  7255. for (const key of ["computed", "inject"]) {
  7256. if (Object.prototype.hasOwnProperty.call(from, key)) {
  7257. if (!to[key]) {
  7258. to[key] = from[key];
  7259. } else {
  7260. Object.assign(to[key], from[key]);
  7261. }
  7262. }
  7263. }
  7264. return to;
  7265. }
  7266. }
  7267. ),
  7268. /***/
  7269. "../app-backend-vue3/lib/components/el.js": (
  7270. /*!************************************************!*\
  7271. !*** ../app-backend-vue3/lib/components/el.js ***!
  7272. \************************************************/
  7273. /***/
  7274. (__unused_webpack_module, exports, __webpack_require__2) => {
  7275. Object.defineProperty(exports, "__esModule", {
  7276. value: true
  7277. });
  7278. exports.getInstanceOrVnodeRect = exports.getRootElementsFromComponentInstance = exports.getComponentInstanceFromElement = void 0;
  7279. const shared_utils_1 = __webpack_require__2(
  7280. /*! @vue-devtools/shared-utils */
  7281. "../shared-utils/lib/index.js"
  7282. );
  7283. const util_1 = __webpack_require__2(
  7284. /*! ./util */
  7285. "../app-backend-vue3/lib/components/util.js"
  7286. );
  7287. function getComponentInstanceFromElement(element) {
  7288. return element.__vueParentComponent;
  7289. }
  7290. exports.getComponentInstanceFromElement = getComponentInstanceFromElement;
  7291. function getRootElementsFromComponentInstance(instance) {
  7292. if ((0, util_1.isFragment)(instance)) {
  7293. return getFragmentRootElements(instance.subTree);
  7294. }
  7295. if (!instance.subTree)
  7296. return [];
  7297. return [instance.subTree.el];
  7298. }
  7299. exports.getRootElementsFromComponentInstance = getRootElementsFromComponentInstance;
  7300. function getFragmentRootElements(vnode) {
  7301. if (!vnode.children)
  7302. return [];
  7303. const list = [];
  7304. for (let i = 0, l = vnode.children.length; i < l; i++) {
  7305. const childVnode = vnode.children[i];
  7306. if (childVnode.component) {
  7307. list.push(...getRootElementsFromComponentInstance(childVnode.component));
  7308. } else if (childVnode.el) {
  7309. list.push(childVnode.el);
  7310. }
  7311. }
  7312. return list;
  7313. }
  7314. function getInstanceOrVnodeRect(instance) {
  7315. const el = instance.subTree.el;
  7316. if (!shared_utils_1.isBrowser) {
  7317. return;
  7318. }
  7319. if (!(0, shared_utils_1.inDoc)(el)) {
  7320. return;
  7321. }
  7322. if ((0, util_1.isFragment)(instance)) {
  7323. return addIframePosition(getFragmentRect(instance.subTree), getElWindow(el));
  7324. } else if (el.nodeType === 1) {
  7325. return addIframePosition(el.getBoundingClientRect(), getElWindow(el));
  7326. } else if (instance.subTree.component) {
  7327. return getInstanceOrVnodeRect(instance.subTree.component);
  7328. }
  7329. }
  7330. exports.getInstanceOrVnodeRect = getInstanceOrVnodeRect;
  7331. function createRect() {
  7332. const rect = {
  7333. top: 0,
  7334. bottom: 0,
  7335. left: 0,
  7336. right: 0,
  7337. get width() {
  7338. return rect.right - rect.left;
  7339. },
  7340. get height() {
  7341. return rect.bottom - rect.top;
  7342. }
  7343. };
  7344. return rect;
  7345. }
  7346. function mergeRects(a, b) {
  7347. if (!a.top || b.top < a.top) {
  7348. a.top = b.top;
  7349. }
  7350. if (!a.bottom || b.bottom > a.bottom) {
  7351. a.bottom = b.bottom;
  7352. }
  7353. if (!a.left || b.left < a.left) {
  7354. a.left = b.left;
  7355. }
  7356. if (!a.right || b.right > a.right) {
  7357. a.right = b.right;
  7358. }
  7359. return a;
  7360. }
  7361. let range;
  7362. function getTextRect(node) {
  7363. if (!shared_utils_1.isBrowser)
  7364. return;
  7365. if (!range)
  7366. range = document.createRange();
  7367. range.selectNode(node);
  7368. return range.getBoundingClientRect();
  7369. }
  7370. function getFragmentRect(vnode) {
  7371. const rect = createRect();
  7372. if (!vnode.children)
  7373. return rect;
  7374. for (let i = 0, l = vnode.children.length; i < l; i++) {
  7375. const childVnode = vnode.children[i];
  7376. let childRect;
  7377. if (childVnode.component) {
  7378. childRect = getInstanceOrVnodeRect(childVnode.component);
  7379. } else if (childVnode.el) {
  7380. const el = childVnode.el;
  7381. if (el.nodeType === 1 || el.getBoundingClientRect) {
  7382. childRect = el.getBoundingClientRect();
  7383. } else if (el.nodeType === 3 && el.data.trim()) {
  7384. childRect = getTextRect(el);
  7385. }
  7386. }
  7387. if (childRect) {
  7388. mergeRects(rect, childRect);
  7389. }
  7390. }
  7391. return rect;
  7392. }
  7393. function getElWindow(el) {
  7394. return el.ownerDocument.defaultView;
  7395. }
  7396. function addIframePosition(bounds, win) {
  7397. if (win.__VUE_DEVTOOLS_IFRAME__) {
  7398. const rect = mergeRects(createRect(), bounds);
  7399. const iframeBounds = win.__VUE_DEVTOOLS_IFRAME__.getBoundingClientRect();
  7400. rect.top += iframeBounds.top;
  7401. rect.bottom += iframeBounds.top;
  7402. rect.left += iframeBounds.left;
  7403. rect.right += iframeBounds.left;
  7404. if (win.parent) {
  7405. return addIframePosition(rect, win.parent);
  7406. }
  7407. return rect;
  7408. }
  7409. return bounds;
  7410. }
  7411. }
  7412. ),
  7413. /***/
  7414. "../app-backend-vue3/lib/components/filter.js": (
  7415. /*!****************************************************!*\
  7416. !*** ../app-backend-vue3/lib/components/filter.js ***!
  7417. \****************************************************/
  7418. /***/
  7419. (__unused_webpack_module, exports, __webpack_require__2) => {
  7420. Object.defineProperty(exports, "__esModule", {
  7421. value: true
  7422. });
  7423. exports.ComponentFilter = void 0;
  7424. const shared_utils_1 = __webpack_require__2(
  7425. /*! @vue-devtools/shared-utils */
  7426. "../shared-utils/lib/index.js"
  7427. );
  7428. const util_1 = __webpack_require__2(
  7429. /*! ./util */
  7430. "../app-backend-vue3/lib/components/util.js"
  7431. );
  7432. class ComponentFilter {
  7433. constructor(filter) {
  7434. this.filter = filter || "";
  7435. }
  7436. /**
  7437. * Check if an instance is qualified.
  7438. *
  7439. * @param {Vue|Vnode} instance
  7440. * @return {Boolean}
  7441. */
  7442. isQualified(instance) {
  7443. const name = (0, util_1.getInstanceName)(instance);
  7444. return (0, shared_utils_1.classify)(name).toLowerCase().indexOf(this.filter) > -1 || (0, shared_utils_1.kebabize)(name).toLowerCase().indexOf(this.filter) > -1;
  7445. }
  7446. }
  7447. exports.ComponentFilter = ComponentFilter;
  7448. }
  7449. ),
  7450. /***/
  7451. "../app-backend-vue3/lib/components/tree.js": (
  7452. /*!**************************************************!*\
  7453. !*** ../app-backend-vue3/lib/components/tree.js ***!
  7454. \**************************************************/
  7455. /***/
  7456. (__unused_webpack_module, exports, __webpack_require__2) => {
  7457. Object.defineProperty(exports, "__esModule", {
  7458. value: true
  7459. });
  7460. exports.ComponentWalker = void 0;
  7461. const util_1 = __webpack_require__2(
  7462. /*! ./util */
  7463. "../app-backend-vue3/lib/components/util.js"
  7464. );
  7465. const filter_1 = __webpack_require__2(
  7466. /*! ./filter */
  7467. "../app-backend-vue3/lib/components/filter.js"
  7468. );
  7469. const el_1 = __webpack_require__2(
  7470. /*! ./el */
  7471. "../app-backend-vue3/lib/components/el.js"
  7472. );
  7473. class ComponentWalker {
  7474. constructor(maxDepth, filter, recursively, api, ctx) {
  7475. this.ctx = ctx;
  7476. this.api = api;
  7477. this.maxDepth = maxDepth;
  7478. this.recursively = recursively;
  7479. this.componentFilter = new filter_1.ComponentFilter(filter);
  7480. this.uniAppPageNames = ["Page", "KeepAlive", "AsyncComponentWrapper", "BaseTransition", "Transition"];
  7481. }
  7482. getComponentTree(instance) {
  7483. this.captureIds = /* @__PURE__ */ new Map();
  7484. return this.findQualifiedChildren(instance, 0);
  7485. }
  7486. getComponentParents(instance) {
  7487. this.captureIds = /* @__PURE__ */ new Map();
  7488. const parents = [];
  7489. this.captureId(instance);
  7490. let parent = instance;
  7491. {
  7492. while (parent = parent.parent) {
  7493. this.captureId(parent);
  7494. parents.push(parent);
  7495. }
  7496. }
  7497. return parents;
  7498. }
  7499. /**
  7500. * Find qualified children from a single instance.
  7501. * If the instance itself is qualified, just return itself.
  7502. * This is ok because [].concat works in both cases.
  7503. *
  7504. * @param {Vue|Vnode} instance
  7505. * @return {Vue|Array}
  7506. */
  7507. async findQualifiedChildren(instance, depth) {
  7508. var _a;
  7509. if (this.componentFilter.isQualified(instance) && !((_a = instance.type.devtools) === null || _a === void 0 ? void 0 : _a.hide)) {
  7510. return [await this.capture(instance, null, depth)];
  7511. } else if (instance.subTree) {
  7512. const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildrenByInstance(instance);
  7513. return this.findQualifiedChildrenFromList(list, depth);
  7514. } else {
  7515. return [];
  7516. }
  7517. }
  7518. /**
  7519. * Iterate through an array of instances and flatten it into
  7520. * an array of qualified instances. This is a depth-first
  7521. * traversal - e.g. if an instance is not matched, we will
  7522. * recursively go deeper until a qualified child is found.
  7523. *
  7524. * @param {Array} instances
  7525. * @return {Array}
  7526. */
  7527. async findQualifiedChildrenFromList(instances, depth) {
  7528. instances = instances.filter((child) => {
  7529. var _a;
  7530. return !(0, util_1.isBeingDestroyed)(child) && !((_a = child.type.devtools) === null || _a === void 0 ? void 0 : _a.hide);
  7531. });
  7532. if (!this.componentFilter.filter) {
  7533. return Promise.all(instances.map((child, index, list) => this.capture(child, list, depth)));
  7534. } else {
  7535. return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));
  7536. }
  7537. }
  7538. /**
  7539. * fixed by xxxxxx
  7540. * @param instance
  7541. * @param suspense
  7542. * @returns
  7543. */
  7544. getInternalInstanceChildrenByInstance(instance, suspense = null) {
  7545. if (instance.ctx.$children) {
  7546. return instance.ctx.$children.map((proxy) => proxy.$);
  7547. }
  7548. return this.getInternalInstanceChildren(instance.subTree, suspense);
  7549. }
  7550. /**
  7551. * Get children from a component instance.
  7552. */
  7553. getInternalInstanceChildren(subTree, suspense = null) {
  7554. const list = [];
  7555. if (subTree) {
  7556. if (subTree.component) {
  7557. this.getInstanceChildrenBySubTreeComponent(list, subTree, suspense);
  7558. } else if (subTree.suspense) {
  7559. const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
  7560. list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, {
  7561. ...subTree.suspense,
  7562. suspenseKey
  7563. }));
  7564. } else if (Array.isArray(subTree.children)) {
  7565. subTree.children.forEach((childSubTree) => {
  7566. if (childSubTree.component) {
  7567. this.getInstanceChildrenBySubTreeComponent(list, childSubTree, suspense);
  7568. } else {
  7569. list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
  7570. }
  7571. });
  7572. }
  7573. }
  7574. return list.filter((child) => {
  7575. var _a;
  7576. return !(0, util_1.isBeingDestroyed)(child) && !((_a = child.type.devtools) === null || _a === void 0 ? void 0 : _a.hide);
  7577. });
  7578. }
  7579. /**
  7580. * getInternalInstanceChildren by subTree component for uni-app defineSystemComponent
  7581. */
  7582. getInstanceChildrenBySubTreeComponent(list, subTree, suspense) {
  7583. if (subTree.type.__reserved || this.uniAppPageNames.includes(subTree.type.name)) {
  7584. list.push(...this.getInternalInstanceChildren(subTree.component.subTree));
  7585. } else {
  7586. !suspense ? list.push(subTree.component) : list.push({
  7587. ...subTree.component,
  7588. suspense
  7589. });
  7590. }
  7591. }
  7592. captureId(instance) {
  7593. if (!instance)
  7594. return null;
  7595. const id = instance.__VUE_DEVTOOLS_UID__ != null ? instance.__VUE_DEVTOOLS_UID__ : (0, util_1.getUniqueComponentId)(instance, this.ctx);
  7596. instance.__VUE_DEVTOOLS_UID__ = id;
  7597. if (this.captureIds.has(id)) {
  7598. return;
  7599. } else {
  7600. this.captureIds.set(id, void 0);
  7601. }
  7602. this.mark(instance);
  7603. return id;
  7604. }
  7605. /**
  7606. * Capture the meta information of an instance. (recursive)
  7607. *
  7608. * @param {Vue} instance
  7609. * @return {Object}
  7610. */
  7611. async capture(instance, list, depth) {
  7612. var _b;
  7613. if (!instance)
  7614. return null;
  7615. const id = this.captureId(instance);
  7616. const name = (0, util_1.getInstanceName)(instance);
  7617. const children = this.getInternalInstanceChildrenByInstance(instance).filter((child) => !(0, util_1.isBeingDestroyed)(child));
  7618. const parents = this.getComponentParents(instance) || [];
  7619. const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
  7620. const treeNode = {
  7621. uid: instance.uid,
  7622. id,
  7623. name,
  7624. renderKey: (0, util_1.getRenderKey)(instance.vnode ? instance.vnode.key : null),
  7625. inactive,
  7626. hasChildren: !!children.length,
  7627. children: [],
  7628. isFragment: (0, util_1.isFragment)(instance),
  7629. tags: typeof instance.type !== "function" ? [] : [{
  7630. label: "functional",
  7631. textColor: 5592405,
  7632. backgroundColor: 15658734
  7633. }],
  7634. autoOpen: this.recursively
  7635. };
  7636. {
  7637. treeNode.route = instance.attrs.__pagePath || "";
  7638. }
  7639. if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
  7640. treeNode.children = await Promise.all(children.map((child, index, list2) => this.capture(child, list2, depth + 1)).filter(Boolean));
  7641. }
  7642. if (this.isKeepAlive(instance)) {
  7643. const cachedComponents = this.getKeepAliveCachedInstances(instance);
  7644. const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_UID__);
  7645. for (const cachedChild of cachedComponents) {
  7646. if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_UID__)) {
  7647. const node = await this.capture({
  7648. ...cachedChild,
  7649. isDeactivated: true
  7650. }, null, depth + 1);
  7651. if (node) {
  7652. treeNode.children.push(node);
  7653. }
  7654. }
  7655. }
  7656. }
  7657. const rootElements = (0, el_1.getRootElementsFromComponentInstance)(instance);
  7658. const firstElement = rootElements[0];
  7659. if (firstElement === null || firstElement === void 0 ? void 0 : firstElement.parentElement) {
  7660. const parentInstance = instance.parent;
  7661. const parentRootElements = parentInstance ? (0, el_1.getRootElementsFromComponentInstance)(parentInstance) : [];
  7662. let el = firstElement;
  7663. const indexList = [];
  7664. do {
  7665. indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
  7666. el = el.parentElement;
  7667. } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
  7668. treeNode.domOrder = indexList.reverse();
  7669. } else {
  7670. treeNode.domOrder = [-1];
  7671. }
  7672. if ((_b = instance.suspense) === null || _b === void 0 ? void 0 : _b.suspenseKey) {
  7673. treeNode.tags.push({
  7674. label: instance.suspense.suspenseKey,
  7675. backgroundColor: 14979812,
  7676. textColor: 16777215
  7677. });
  7678. this.mark(instance, true);
  7679. }
  7680. return this.api.visitComponentTree(instance, treeNode, this.componentFilter.filter, this.ctx.currentAppRecord.options.app);
  7681. }
  7682. /**
  7683. * Mark an instance as captured and store it in the instance map.
  7684. *
  7685. * @param {Vue} instance
  7686. */
  7687. mark(instance, force = false) {
  7688. const instanceMap = this.ctx.currentAppRecord.instanceMap;
  7689. if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
  7690. instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance);
  7691. }
  7692. }
  7693. isKeepAlive(instance) {
  7694. return instance.type.__isKeepAlive && instance.__v_cache;
  7695. }
  7696. getKeepAliveCachedInstances(instance) {
  7697. return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
  7698. }
  7699. }
  7700. exports.ComponentWalker = ComponentWalker;
  7701. }
  7702. ),
  7703. /***/
  7704. "../app-backend-vue3/lib/components/util.js": (
  7705. /*!**************************************************!*\
  7706. !*** ../app-backend-vue3/lib/components/util.js ***!
  7707. \**************************************************/
  7708. /***/
  7709. (__unused_webpack_module, exports, __webpack_require__2) => {
  7710. Object.defineProperty(exports, "__esModule", {
  7711. value: true
  7712. });
  7713. exports.getComponentInstances = exports.getRenderKey = exports.getUniqueComponentId = exports.getInstanceName = exports.isFragment = exports.getAppRecord = exports.isBeingDestroyed = void 0;
  7714. const shared_utils_1 = __webpack_require__2(
  7715. /*! @vue-devtools/shared-utils */
  7716. "../shared-utils/lib/index.js"
  7717. );
  7718. const util_1 = __webpack_require__2(
  7719. /*! ../util */
  7720. "../app-backend-vue3/lib/util.js"
  7721. );
  7722. function isBeingDestroyed(instance) {
  7723. return instance._isBeingDestroyed || instance.isUnmounted;
  7724. }
  7725. exports.isBeingDestroyed = isBeingDestroyed;
  7726. function getAppRecord(instance) {
  7727. if (instance.root) {
  7728. return instance.appContext.app.__VUE_DEVTOOLS_APP_RECORD__;
  7729. }
  7730. }
  7731. exports.getAppRecord = getAppRecord;
  7732. function isFragment(instance) {
  7733. var _a;
  7734. const appRecord = getAppRecord(instance);
  7735. if (appRecord) {
  7736. return appRecord.options.types.Fragment === ((_a = instance.subTree) === null || _a === void 0 ? void 0 : _a.type);
  7737. }
  7738. }
  7739. exports.isFragment = isFragment;
  7740. function getInstanceName(instance) {
  7741. var _a, _b, _c;
  7742. const name = getComponentTypeName(instance.type || {});
  7743. if (name)
  7744. return name;
  7745. if (isAppRoot(instance))
  7746. return "Root";
  7747. for (const key in (_b = (_a = instance.parent) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.components) {
  7748. if (instance.parent.type.components[key] === instance.type)
  7749. return saveComponentName(instance, key);
  7750. }
  7751. for (const key in (_c = instance.appContext) === null || _c === void 0 ? void 0 : _c.components) {
  7752. if (instance.appContext.components[key] === instance.type)
  7753. return saveComponentName(instance, key);
  7754. }
  7755. return "Anonymous Component";
  7756. }
  7757. exports.getInstanceName = getInstanceName;
  7758. function saveComponentName(instance, key) {
  7759. instance.type.__vdevtools_guessedName = key;
  7760. return key;
  7761. }
  7762. function getComponentTypeName(options) {
  7763. const name = options.name || options._componentTag || options.__vdevtools_guessedName;
  7764. if (name) {
  7765. return name;
  7766. }
  7767. const file = options.__file;
  7768. if (file) {
  7769. return (0, shared_utils_1.classify)((0, util_1.basename)(file, ".vue"));
  7770. }
  7771. }
  7772. function isAppRoot(instance) {
  7773. return instance.ctx.$mpType === "app";
  7774. }
  7775. function getUniqueComponentId(instance, ctx) {
  7776. const appId = instance.appContext.app.__VUE_DEVTOOLS_APP_RECORD_ID__;
  7777. const instanceId = isAppRoot(instance) ? "root" : instance.uid;
  7778. return `${appId}:${instanceId}`;
  7779. }
  7780. exports.getUniqueComponentId = getUniqueComponentId;
  7781. function getRenderKey(value) {
  7782. if (value == null)
  7783. return;
  7784. const type = typeof value;
  7785. if (type === "number") {
  7786. return value;
  7787. } else if (type === "string") {
  7788. return `'${value}'`;
  7789. } else if (Array.isArray(value)) {
  7790. return "Array";
  7791. } else {
  7792. return "Object";
  7793. }
  7794. }
  7795. exports.getRenderKey = getRenderKey;
  7796. function getComponentInstances(app) {
  7797. const appRecord = app.__VUE_DEVTOOLS_APP_RECORD__;
  7798. const appId = appRecord.id.toString();
  7799. return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
  7800. }
  7801. exports.getComponentInstances = getComponentInstances;
  7802. }
  7803. ),
  7804. /***/
  7805. "../app-backend-vue3/lib/index.js": (
  7806. /*!****************************************!*\
  7807. !*** ../app-backend-vue3/lib/index.js ***!
  7808. \****************************************/
  7809. /***/
  7810. (__unused_webpack_module, exports, __webpack_require__2) => {
  7811. Object.defineProperty(exports, "__esModule", {
  7812. value: true
  7813. });
  7814. exports.backend = void 0;
  7815. const app_backend_api_1 = __webpack_require__2(
  7816. /*! @vue-devtools/app-backend-api */
  7817. "../app-backend-api/lib/index.js"
  7818. );
  7819. const tree_1 = __webpack_require__2(
  7820. /*! ./components/tree */
  7821. "../app-backend-vue3/lib/components/tree.js"
  7822. );
  7823. const data_1 = __webpack_require__2(
  7824. /*! ./components/data */
  7825. "../app-backend-vue3/lib/components/data.js"
  7826. );
  7827. const util_1 = __webpack_require__2(
  7828. /*! ./components/util */
  7829. "../app-backend-vue3/lib/components/util.js"
  7830. );
  7831. const el_1 = __webpack_require__2(
  7832. /*! ./components/el */
  7833. "../app-backend-vue3/lib/components/el.js"
  7834. );
  7835. const shared_utils_1 = __webpack_require__2(
  7836. /*! @vue-devtools/shared-utils */
  7837. "../shared-utils/lib/index.js"
  7838. );
  7839. exports.backend = (0, app_backend_api_1.defineBackend)({
  7840. frameworkVersion: 3,
  7841. features: [],
  7842. setup(api) {
  7843. api.on.getAppRecordName((payload) => {
  7844. if (payload.app._component) {
  7845. payload.name = payload.app._component.name;
  7846. }
  7847. });
  7848. api.on.getAppRootInstance((payload) => {
  7849. var _a, _b, _c, _d;
  7850. if (payload.app._instance) {
  7851. payload.root = payload.app._instance;
  7852. } else if ((_b = (_a = payload.app._container) === null || _a === void 0 ? void 0 : _a._vnode) === null || _b === void 0 ? void 0 : _b.component) {
  7853. payload.root = (_d = (_c = payload.app._container) === null || _c === void 0 ? void 0 : _c._vnode) === null || _d === void 0 ? void 0 : _d.component;
  7854. }
  7855. });
  7856. api.on.walkComponentTree(async (payload, ctx) => {
  7857. const walker = new tree_1.ComponentWalker(payload.maxDepth, payload.filter, payload.recursively, api, ctx);
  7858. payload.componentTreeData = await walker.getComponentTree(payload.componentInstance);
  7859. });
  7860. api.on.walkComponentParents((payload, ctx) => {
  7861. const walker = new tree_1.ComponentWalker(0, null, false, api, ctx);
  7862. payload.parentInstances = walker.getComponentParents(payload.componentInstance);
  7863. });
  7864. api.on.inspectComponent((payload, ctx) => {
  7865. shared_utils_1.backendInjections.getCustomInstanceDetails = data_1.getCustomInstanceDetails;
  7866. shared_utils_1.backendInjections.getCustomObjectDetails = data_1.getCustomObjectDetails;
  7867. shared_utils_1.backendInjections.instanceMap = ctx.currentAppRecord.instanceMap;
  7868. shared_utils_1.backendInjections.isVueInstance = (val) => val._ && Object.keys(val._).includes("vnode");
  7869. payload.instanceData = (0, data_1.getInstanceDetails)(payload.componentInstance, ctx);
  7870. });
  7871. api.on.getComponentName((payload) => {
  7872. payload.name = (0, util_1.getInstanceName)(payload.componentInstance);
  7873. });
  7874. api.on.getComponentBounds((payload) => {
  7875. payload.bounds = (0, el_1.getInstanceOrVnodeRect)(payload.componentInstance);
  7876. });
  7877. api.on.getElementComponent((payload) => {
  7878. payload.componentInstance = (0, el_1.getComponentInstanceFromElement)(payload.element);
  7879. });
  7880. api.on.getComponentInstances((payload) => {
  7881. payload.componentInstances = (0, util_1.getComponentInstances)(payload.app);
  7882. });
  7883. api.on.getComponentRootElements((payload) => {
  7884. payload.rootElements = (0, el_1.getRootElementsFromComponentInstance)(payload.componentInstance);
  7885. });
  7886. api.on.editComponentState((payload, ctx) => {
  7887. (0, data_1.editState)(payload, api.stateEditor, ctx);
  7888. });
  7889. api.on.getComponentDevtoolsOptions((payload) => {
  7890. payload.options = payload.componentInstance.type.devtools;
  7891. });
  7892. api.on.getComponentRenderCode((payload) => {
  7893. payload.code = !(payload.componentInstance.type instanceof Function) ? payload.componentInstance.render.toString() : payload.componentInstance.type.toString();
  7894. });
  7895. api.on.transformCall((payload) => {
  7896. if (payload.callName === shared_utils_1.HookEvents.COMPONENT_UPDATED) {
  7897. const component = payload.inArgs[0];
  7898. payload.outArgs = [component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component];
  7899. }
  7900. });
  7901. api.stateEditor.isRef = (value) => !!(value === null || value === void 0 ? void 0 : value.__v_isRef);
  7902. api.stateEditor.getRefValue = (ref) => ref.value;
  7903. api.stateEditor.setRefValue = (ref, value) => {
  7904. ref.value = value;
  7905. };
  7906. }
  7907. });
  7908. }
  7909. ),
  7910. /***/
  7911. "../app-backend-vue3/lib/util.js": (
  7912. /*!***************************************!*\
  7913. !*** ../app-backend-vue3/lib/util.js ***!
  7914. \***************************************/
  7915. /***/
  7916. function(__unused_webpack_module, exports, __webpack_require__2) {
  7917. var __importDefault = this && this.__importDefault || function(mod) {
  7918. return mod && mod.__esModule ? mod : {
  7919. "default": mod
  7920. };
  7921. };
  7922. Object.defineProperty(exports, "__esModule", {
  7923. value: true
  7924. });
  7925. exports.returnError = exports.basename = exports.flatten = void 0;
  7926. const path_1 = __importDefault(__webpack_require__2(
  7927. /*! path */
  7928. "../../node_modules/path-browserify/index.js"
  7929. ));
  7930. function flatten(items) {
  7931. return items.reduce((acc, item) => {
  7932. if (item instanceof Array)
  7933. acc.push(...flatten(item));
  7934. else if (item)
  7935. acc.push(item);
  7936. return acc;
  7937. }, []);
  7938. }
  7939. exports.flatten = flatten;
  7940. function basename(filename, ext) {
  7941. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  7942. }
  7943. exports.basename = basename;
  7944. function returnError(cb) {
  7945. try {
  7946. return cb();
  7947. } catch (e) {
  7948. return e;
  7949. }
  7950. }
  7951. exports.returnError = returnError;
  7952. }
  7953. ),
  7954. /***/
  7955. "../shared-utils/lib/backend.js": (
  7956. /*!**************************************!*\
  7957. !*** ../shared-utils/lib/backend.js ***!
  7958. \**************************************/
  7959. /***/
  7960. (__unused_webpack_module, exports) => {
  7961. Object.defineProperty(exports, "__esModule", {
  7962. value: true
  7963. });
  7964. exports.getCatchedGetters = exports.getCustomStoreDetails = exports.getCustomRouterDetails = exports.isVueInstance = exports.getCustomObjectDetails = exports.getCustomInstanceDetails = exports.getInstanceMap = exports.backendInjections = void 0;
  7965. exports.backendInjections = {
  7966. instanceMap: /* @__PURE__ */ new Map(),
  7967. isVueInstance: () => false,
  7968. getCustomInstanceDetails: () => ({}),
  7969. getCustomObjectDetails: () => void 0
  7970. };
  7971. function getInstanceMap() {
  7972. return exports.backendInjections.instanceMap;
  7973. }
  7974. exports.getInstanceMap = getInstanceMap;
  7975. function getCustomInstanceDetails(instance) {
  7976. return exports.backendInjections.getCustomInstanceDetails(instance);
  7977. }
  7978. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  7979. function getCustomObjectDetails(value, proto) {
  7980. return exports.backendInjections.getCustomObjectDetails(value, proto);
  7981. }
  7982. exports.getCustomObjectDetails = getCustomObjectDetails;
  7983. function isVueInstance(value) {
  7984. return exports.backendInjections.isVueInstance(value);
  7985. }
  7986. exports.isVueInstance = isVueInstance;
  7987. function getCustomRouterDetails(router) {
  7988. return {
  7989. _custom: {
  7990. type: "router",
  7991. display: "VueRouter",
  7992. value: {
  7993. options: router.options,
  7994. currentRoute: router.currentRoute
  7995. },
  7996. fields: {
  7997. abstract: true
  7998. }
  7999. }
  8000. };
  8001. }
  8002. exports.getCustomRouterDetails = getCustomRouterDetails;
  8003. function getCustomStoreDetails(store) {
  8004. return {
  8005. _custom: {
  8006. type: "store",
  8007. display: "Store",
  8008. value: {
  8009. state: store.state,
  8010. getters: getCatchedGetters(store)
  8011. },
  8012. fields: {
  8013. abstract: true
  8014. }
  8015. }
  8016. };
  8017. }
  8018. exports.getCustomStoreDetails = getCustomStoreDetails;
  8019. function getCatchedGetters(store) {
  8020. const getters = {};
  8021. const origGetters = store.getters || {};
  8022. const keys = Object.keys(origGetters);
  8023. for (let i = 0; i < keys.length; i++) {
  8024. const key = keys[i];
  8025. Object.defineProperty(getters, key, {
  8026. enumerable: true,
  8027. get: () => {
  8028. try {
  8029. return origGetters[key];
  8030. } catch (e) {
  8031. return e;
  8032. }
  8033. }
  8034. });
  8035. }
  8036. return getters;
  8037. }
  8038. exports.getCatchedGetters = getCatchedGetters;
  8039. }
  8040. ),
  8041. /***/
  8042. "../shared-utils/lib/bridge.js": (
  8043. /*!*************************************!*\
  8044. !*** ../shared-utils/lib/bridge.js ***!
  8045. \*************************************/
  8046. /***/
  8047. (__unused_webpack_module, exports, __webpack_require__2) => {
  8048. Object.defineProperty(exports, "__esModule", {
  8049. value: true
  8050. });
  8051. exports.Bridge = void 0;
  8052. const events_1 = __webpack_require__2(
  8053. /*! events */
  8054. "../../node_modules/events/events.js"
  8055. );
  8056. const raf_1 = __webpack_require__2(
  8057. /*! ./raf */
  8058. "../shared-utils/lib/raf.js"
  8059. );
  8060. const BATCH_DURATION = 100;
  8061. class Bridge extends events_1.EventEmitter {
  8062. constructor(wall) {
  8063. super();
  8064. this.setMaxListeners(Infinity);
  8065. this.wall = wall;
  8066. wall.listen((messages) => {
  8067. if (Array.isArray(messages)) {
  8068. messages.forEach((message) => this._emit(message));
  8069. } else {
  8070. this._emit(messages);
  8071. }
  8072. });
  8073. this._batchingQueue = [];
  8074. this._sendingQueue = [];
  8075. this._receivingQueue = [];
  8076. this._sending = false;
  8077. }
  8078. on(event, listener) {
  8079. const wrappedListener = async (...args) => {
  8080. try {
  8081. await listener(...args);
  8082. } catch (e) {
  8083. console.error(`[Bridge] Error in listener for event ${event.toString()} with args:`, args);
  8084. console.error(e);
  8085. }
  8086. };
  8087. return super.on(event, wrappedListener);
  8088. }
  8089. send(event, payload) {
  8090. this._batchingQueue.push({
  8091. event,
  8092. payload
  8093. });
  8094. if (this._timer == null) {
  8095. this._timer = setTimeout(() => this._flush(), BATCH_DURATION);
  8096. }
  8097. }
  8098. /**
  8099. * Log a message to the devtools background page.
  8100. */
  8101. log(message) {
  8102. this.send("log", message);
  8103. }
  8104. _flush() {
  8105. if (this._batchingQueue.length)
  8106. this._send(this._batchingQueue);
  8107. clearTimeout(this._timer);
  8108. this._timer = null;
  8109. this._batchingQueue = [];
  8110. }
  8111. // @TODO types
  8112. _emit(message) {
  8113. if (typeof message === "string") {
  8114. this.emit(message);
  8115. } else if (message._chunk) {
  8116. this._receivingQueue.push(message._chunk);
  8117. if (message.last) {
  8118. this.emit(message.event, this._receivingQueue);
  8119. this._receivingQueue = [];
  8120. }
  8121. } else if (message.event) {
  8122. this.emit(message.event, message.payload);
  8123. }
  8124. }
  8125. // @TODO types
  8126. _send(messages) {
  8127. this._sendingQueue.push(messages);
  8128. this._nextSend();
  8129. }
  8130. _nextSend() {
  8131. if (!this._sendingQueue.length || this._sending)
  8132. return;
  8133. this._sending = true;
  8134. const messages = this._sendingQueue.shift();
  8135. try {
  8136. this.wall.send(messages);
  8137. } catch (err) {
  8138. if (err.message === "Message length exceeded maximum allowed length.") {
  8139. this._sendingQueue.splice(0, 0, messages.map((message) => [message]));
  8140. }
  8141. }
  8142. this._sending = false;
  8143. (0, raf_1.raf)(() => this._nextSend());
  8144. }
  8145. }
  8146. exports.Bridge = Bridge;
  8147. }
  8148. ),
  8149. /***/
  8150. "../shared-utils/lib/consts.js": (
  8151. /*!*************************************!*\
  8152. !*** ../shared-utils/lib/consts.js ***!
  8153. \*************************************/
  8154. /***/
  8155. (__unused_webpack_module, exports) => {
  8156. Object.defineProperty(exports, "__esModule", {
  8157. value: true
  8158. });
  8159. exports.HookEvents = exports.BridgeSubscriptions = exports.BridgeEvents = exports.BuiltinTabs = void 0;
  8160. (function(BuiltinTabs) {
  8161. BuiltinTabs["COMPONENTS"] = "components";
  8162. BuiltinTabs["TIMELINE"] = "timeline";
  8163. BuiltinTabs["PLUGINS"] = "plugins";
  8164. BuiltinTabs["SETTINGS"] = "settings";
  8165. })(exports.BuiltinTabs || (exports.BuiltinTabs = {}));
  8166. (function(BridgeEvents) {
  8167. BridgeEvents["TO_BACK_SUBSCRIBE"] = "b:subscribe";
  8168. BridgeEvents["TO_BACK_UNSUBSCRIBE"] = "b:unsubscribe";
  8169. BridgeEvents["TO_FRONT_READY"] = "f:ready";
  8170. BridgeEvents["TO_BACK_LOG_DETECTED_VUE"] = "b:log-detected-vue";
  8171. BridgeEvents["TO_BACK_REFRESH"] = "b:refresh";
  8172. BridgeEvents["TO_BACK_TAB_SWITCH"] = "b:tab:switch";
  8173. BridgeEvents["TO_BACK_LOG"] = "b:log";
  8174. BridgeEvents["TO_FRONT_RECONNECTED"] = "f:reconnected";
  8175. BridgeEvents["TO_FRONT_TITLE"] = "f:title";
  8176. BridgeEvents["TO_FRONT_APP_ADD"] = "f:app:add";
  8177. BridgeEvents["TO_BACK_APP_LIST"] = "b:app:list";
  8178. BridgeEvents["TO_FRONT_APP_LIST"] = "f:app:list";
  8179. BridgeEvents["TO_FRONT_APP_REMOVE"] = "f:app:remove";
  8180. BridgeEvents["TO_BACK_APP_SELECT"] = "b:app:select";
  8181. BridgeEvents["TO_FRONT_APP_SELECTED"] = "f:app:selected";
  8182. BridgeEvents["TO_BACK_SCAN_LEGACY_APPS"] = "b:app:scan-legacy";
  8183. BridgeEvents["TO_BACK_COMPONENT_TREE"] = "b:component:tree";
  8184. BridgeEvents["TO_FRONT_COMPONENT_TREE"] = "f:component:tree";
  8185. BridgeEvents["TO_BACK_COMPONENT_SELECTED_DATA"] = "b:component:selected-data";
  8186. BridgeEvents["TO_FRONT_COMPONENT_SELECTED_DATA"] = "f:component:selected-data";
  8187. BridgeEvents["TO_BACK_COMPONENT_EXPAND"] = "b:component:expand";
  8188. BridgeEvents["TO_FRONT_COMPONENT_EXPAND"] = "f:component:expand";
  8189. BridgeEvents["TO_BACK_COMPONENT_SCROLL_TO"] = "b:component:scroll-to";
  8190. BridgeEvents["TO_BACK_COMPONENT_FILTER"] = "b:component:filter";
  8191. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OVER"] = "b:component:mouse-over";
  8192. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OUT"] = "b:component:mouse-out";
  8193. BridgeEvents["TO_BACK_COMPONENT_CONTEXT_MENU_TARGET"] = "b:component:context-menu-target";
  8194. BridgeEvents["TO_BACK_COMPONENT_EDIT_STATE"] = "b:component:edit-state";
  8195. BridgeEvents["TO_BACK_COMPONENT_PICK"] = "b:component:pick";
  8196. BridgeEvents["TO_FRONT_COMPONENT_PICK"] = "f:component:pick";
  8197. BridgeEvents["TO_BACK_COMPONENT_PICK_CANCELED"] = "b:component:pick-canceled";
  8198. BridgeEvents["TO_FRONT_COMPONENT_PICK_CANCELED"] = "f:component:pick-canceled";
  8199. BridgeEvents["TO_BACK_COMPONENT_INSPECT_DOM"] = "b:component:inspect-dom";
  8200. BridgeEvents["TO_FRONT_COMPONENT_INSPECT_DOM"] = "f:component:inspect-dom";
  8201. BridgeEvents["TO_BACK_COMPONENT_RENDER_CODE"] = "b:component:render-code";
  8202. BridgeEvents["TO_FRONT_COMPONENT_RENDER_CODE"] = "f:component:render-code";
  8203. BridgeEvents["TO_FRONT_COMPONENT_UPDATED"] = "f:component:updated";
  8204. BridgeEvents["TO_FRONT_TIMELINE_EVENT"] = "f:timeline:event";
  8205. BridgeEvents["TO_BACK_TIMELINE_LAYER_LIST"] = "b:timeline:layer-list";
  8206. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LIST"] = "f:timeline:layer-list";
  8207. BridgeEvents["TO_FRONT_TIMELINE_LAYER_ADD"] = "f:timeline:layer-add";
  8208. BridgeEvents["TO_BACK_TIMELINE_SHOW_SCREENSHOT"] = "b:timeline:show-screenshot";
  8209. BridgeEvents["TO_BACK_TIMELINE_CLEAR"] = "b:timeline:clear";
  8210. BridgeEvents["TO_BACK_TIMELINE_EVENT_DATA"] = "b:timeline:event-data";
  8211. BridgeEvents["TO_FRONT_TIMELINE_EVENT_DATA"] = "f:timeline:event-data";
  8212. BridgeEvents["TO_BACK_TIMELINE_LAYER_LOAD_EVENTS"] = "b:timeline:layer-load-events";
  8213. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS"] = "f:timeline:layer-load-events";
  8214. BridgeEvents["TO_BACK_TIMELINE_LOAD_MARKERS"] = "b:timeline:load-markers";
  8215. BridgeEvents["TO_FRONT_TIMELINE_LOAD_MARKERS"] = "f:timeline:load-markers";
  8216. BridgeEvents["TO_FRONT_TIMELINE_MARKER"] = "f:timeline:marker";
  8217. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_LIST"] = "b:devtools-plugin:list";
  8218. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_LIST"] = "f:devtools-plugin:list";
  8219. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_ADD"] = "f:devtools-plugin:add";
  8220. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED"] = "b:devtools-plugin:setting-updated";
  8221. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_LIST"] = "b:custom-inspector:list";
  8222. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_LIST"] = "f:custom-inspector:list";
  8223. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_ADD"] = "f:custom-inspector:add";
  8224. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_TREE"] = "b:custom-inspector:tree";
  8225. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_TREE"] = "f:custom-inspector:tree";
  8226. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_STATE"] = "b:custom-inspector:state";
  8227. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_STATE"] = "f:custom-inspector:state";
  8228. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE"] = "b:custom-inspector:edit-state";
  8229. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_ACTION"] = "b:custom-inspector:action";
  8230. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_NODE_ACTION"] = "b:custom-inspector:node-action";
  8231. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE"] = "f:custom-inspector:select-node";
  8232. BridgeEvents["TO_BACK_CUSTOM_STATE_ACTION"] = "b:custom-state:action";
  8233. })(exports.BridgeEvents || (exports.BridgeEvents = {}));
  8234. (function(BridgeSubscriptions) {
  8235. BridgeSubscriptions["SELECTED_COMPONENT_DATA"] = "component:selected-data";
  8236. BridgeSubscriptions["COMPONENT_TREE"] = "component:tree";
  8237. })(exports.BridgeSubscriptions || (exports.BridgeSubscriptions = {}));
  8238. (function(HookEvents) {
  8239. HookEvents["INIT"] = "init";
  8240. HookEvents["APP_INIT"] = "app:init";
  8241. HookEvents["APP_ADD"] = "app:add";
  8242. HookEvents["APP_UNMOUNT"] = "app:unmount";
  8243. HookEvents["COMPONENT_UPDATED"] = "component:updated";
  8244. HookEvents["COMPONENT_ADDED"] = "component:added";
  8245. HookEvents["COMPONENT_REMOVED"] = "component:removed";
  8246. HookEvents["COMPONENT_EMIT"] = "component:emit";
  8247. HookEvents["COMPONENT_HIGHLIGHT"] = "component:highlight";
  8248. HookEvents["COMPONENT_UNHIGHLIGHT"] = "component:unhighlight";
  8249. HookEvents["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
  8250. HookEvents["TIMELINE_LAYER_ADDED"] = "timeline:layer-added";
  8251. HookEvents["TIMELINE_EVENT_ADDED"] = "timeline:event-added";
  8252. HookEvents["CUSTOM_INSPECTOR_ADD"] = "custom-inspector:add";
  8253. HookEvents["CUSTOM_INSPECTOR_SEND_TREE"] = "custom-inspector:send-tree";
  8254. HookEvents["CUSTOM_INSPECTOR_SEND_STATE"] = "custom-inspector:send-state";
  8255. HookEvents["CUSTOM_INSPECTOR_SELECT_NODE"] = "custom-inspector:select-node";
  8256. HookEvents["PERFORMANCE_START"] = "perf:start";
  8257. HookEvents["PERFORMANCE_END"] = "perf:end";
  8258. HookEvents["PLUGIN_SETTINGS_SET"] = "plugin:settings:set";
  8259. HookEvents["FLUSH"] = "flush";
  8260. HookEvents["TRACK_UPDATE"] = "_track-update";
  8261. HookEvents["FLASH_UPDATE"] = "_flash-update";
  8262. })(exports.HookEvents || (exports.HookEvents = {}));
  8263. }
  8264. ),
  8265. /***/
  8266. "../shared-utils/lib/edit.js": (
  8267. /*!***********************************!*\
  8268. !*** ../shared-utils/lib/edit.js ***!
  8269. \***********************************/
  8270. /***/
  8271. (__unused_webpack_module, exports) => {
  8272. Object.defineProperty(exports, "__esModule", {
  8273. value: true
  8274. });
  8275. exports.StateEditor = void 0;
  8276. class StateEditor {
  8277. set(object, path, value, cb = null) {
  8278. const sections = Array.isArray(path) ? path : path.split(".");
  8279. while (sections.length > 1) {
  8280. object = object[sections.shift()];
  8281. if (this.isRef(object)) {
  8282. object = this.getRefValue(object);
  8283. }
  8284. }
  8285. const field = sections[0];
  8286. if (cb) {
  8287. cb(object, field, value);
  8288. } else if (this.isRef(object[field])) {
  8289. this.setRefValue(object[field], value);
  8290. } else {
  8291. object[field] = value;
  8292. }
  8293. }
  8294. get(object, path) {
  8295. const sections = Array.isArray(path) ? path : path.split(".");
  8296. for (let i = 0; i < sections.length; i++) {
  8297. object = object[sections[i]];
  8298. if (this.isRef(object)) {
  8299. object = this.getRefValue(object);
  8300. }
  8301. if (!object) {
  8302. return void 0;
  8303. }
  8304. }
  8305. return object;
  8306. }
  8307. has(object, path, parent = false) {
  8308. if (typeof object === "undefined") {
  8309. return false;
  8310. }
  8311. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  8312. const size = !parent ? 1 : 2;
  8313. while (object && sections.length > size) {
  8314. object = object[sections.shift()];
  8315. if (this.isRef(object)) {
  8316. object = this.getRefValue(object);
  8317. }
  8318. }
  8319. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  8320. }
  8321. createDefaultSetCallback(state) {
  8322. return (obj, field, value) => {
  8323. if (state.remove || state.newKey) {
  8324. if (Array.isArray(obj)) {
  8325. obj.splice(field, 1);
  8326. } else {
  8327. delete obj[field];
  8328. }
  8329. }
  8330. if (!state.remove) {
  8331. const target = obj[state.newKey || field];
  8332. if (this.isRef(target)) {
  8333. this.setRefValue(target, value);
  8334. } else {
  8335. obj[state.newKey || field] = value;
  8336. }
  8337. }
  8338. };
  8339. }
  8340. isRef(ref) {
  8341. return false;
  8342. }
  8343. setRefValue(ref, value) {
  8344. }
  8345. getRefValue(ref) {
  8346. return ref;
  8347. }
  8348. }
  8349. exports.StateEditor = StateEditor;
  8350. }
  8351. ),
  8352. /***/
  8353. "../shared-utils/lib/env.js": (
  8354. /*!**********************************!*\
  8355. !*** ../shared-utils/lib/env.js ***!
  8356. \**********************************/
  8357. /***/
  8358. (__unused_webpack_module, exports) => {
  8359. Object.defineProperty(exports, "__esModule", {
  8360. value: true
  8361. });
  8362. exports.initEnv = exports.keys = exports.isLinux = exports.isMac = exports.isWindows = exports.isFirefox = exports.isChrome = exports.target = exports.isBrowser = void 0;
  8363. exports.isBrowser = typeof navigator !== "undefined" && typeof window !== "undefined";
  8364. exports.target = exports.isBrowser ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  8365. exports.isChrome = typeof exports.target.chrome !== "undefined" && !!exports.target.chrome.devtools;
  8366. exports.isFirefox = exports.isBrowser && navigator.userAgent && navigator.userAgent.indexOf("Firefox") > -1;
  8367. exports.isWindows = exports.isBrowser && navigator.platform.indexOf("Win") === 0;
  8368. exports.isMac = exports.isBrowser && navigator.platform === "MacIntel";
  8369. exports.isLinux = exports.isBrowser && navigator.platform.indexOf("Linux") === 0;
  8370. exports.keys = {
  8371. ctrl: exports.isMac ? "&#8984;" : "Ctrl",
  8372. shift: "Shift",
  8373. alt: exports.isMac ? "&#8997;" : "Alt",
  8374. del: "Del",
  8375. enter: "Enter",
  8376. esc: "Esc"
  8377. };
  8378. function initEnv(Vue) {
  8379. if (Vue.prototype.hasOwnProperty("$isChrome"))
  8380. return;
  8381. Object.defineProperties(Vue.prototype, {
  8382. $isChrome: {
  8383. get: () => exports.isChrome
  8384. },
  8385. $isFirefox: {
  8386. get: () => exports.isFirefox
  8387. },
  8388. $isWindows: {
  8389. get: () => exports.isWindows
  8390. },
  8391. $isMac: {
  8392. get: () => exports.isMac
  8393. },
  8394. $isLinux: {
  8395. get: () => exports.isLinux
  8396. },
  8397. $keys: {
  8398. get: () => exports.keys
  8399. }
  8400. });
  8401. if (exports.isWindows)
  8402. document.body.classList.add("platform-windows");
  8403. if (exports.isMac)
  8404. document.body.classList.add("platform-mac");
  8405. if (exports.isLinux)
  8406. document.body.classList.add("platform-linux");
  8407. }
  8408. exports.initEnv = initEnv;
  8409. }
  8410. ),
  8411. /***/
  8412. "../shared-utils/lib/index.js": (
  8413. /*!************************************!*\
  8414. !*** ../shared-utils/lib/index.js ***!
  8415. \************************************/
  8416. /***/
  8417. function(__unused_webpack_module, exports, __webpack_require__2) {
  8418. var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
  8419. if (k2 === void 0)
  8420. k2 = k;
  8421. var desc = Object.getOwnPropertyDescriptor(m, k);
  8422. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  8423. desc = {
  8424. enumerable: true,
  8425. get: function() {
  8426. return m[k];
  8427. }
  8428. };
  8429. }
  8430. Object.defineProperty(o, k2, desc);
  8431. } : function(o, m, k, k2) {
  8432. if (k2 === void 0)
  8433. k2 = k;
  8434. o[k2] = m[k];
  8435. });
  8436. var __exportStar = this && this.__exportStar || function(m, exports2) {
  8437. for (var p in m)
  8438. if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
  8439. __createBinding(exports2, m, p);
  8440. };
  8441. Object.defineProperty(exports, "__esModule", {
  8442. value: true
  8443. });
  8444. __exportStar(__webpack_require__2(
  8445. /*! ./backend */
  8446. "../shared-utils/lib/backend.js"
  8447. ), exports);
  8448. __exportStar(__webpack_require__2(
  8449. /*! ./bridge */
  8450. "../shared-utils/lib/bridge.js"
  8451. ), exports);
  8452. __exportStar(__webpack_require__2(
  8453. /*! ./consts */
  8454. "../shared-utils/lib/consts.js"
  8455. ), exports);
  8456. __exportStar(__webpack_require__2(
  8457. /*! ./edit */
  8458. "../shared-utils/lib/edit.js"
  8459. ), exports);
  8460. __exportStar(__webpack_require__2(
  8461. /*! ./env */
  8462. "../shared-utils/lib/env.js"
  8463. ), exports);
  8464. __exportStar(__webpack_require__2(
  8465. /*! ./plugin-permissions */
  8466. "../shared-utils/lib/plugin-permissions.js"
  8467. ), exports);
  8468. __exportStar(__webpack_require__2(
  8469. /*! ./plugin-settings */
  8470. "../shared-utils/lib/plugin-settings.js"
  8471. ), exports);
  8472. __exportStar(__webpack_require__2(
  8473. /*! ./shared-data */
  8474. "../shared-utils/lib/shared-data.js"
  8475. ), exports);
  8476. __exportStar(__webpack_require__2(
  8477. /*! ./shell */
  8478. "../shared-utils/lib/shell.js"
  8479. ), exports);
  8480. __exportStar(__webpack_require__2(
  8481. /*! ./storage */
  8482. "../shared-utils/lib/storage.js"
  8483. ), exports);
  8484. __exportStar(__webpack_require__2(
  8485. /*! ./transfer */
  8486. "../shared-utils/lib/transfer.js"
  8487. ), exports);
  8488. __exportStar(__webpack_require__2(
  8489. /*! ./util */
  8490. "../shared-utils/lib/util.js"
  8491. ), exports);
  8492. __exportStar(__webpack_require__2(
  8493. /*! ./raf */
  8494. "../shared-utils/lib/raf.js"
  8495. ), exports);
  8496. }
  8497. ),
  8498. /***/
  8499. "../shared-utils/lib/plugin-permissions.js": (
  8500. /*!*************************************************!*\
  8501. !*** ../shared-utils/lib/plugin-permissions.js ***!
  8502. \*************************************************/
  8503. /***/
  8504. (__unused_webpack_module, exports, __webpack_require__2) => {
  8505. Object.defineProperty(exports, "__esModule", {
  8506. value: true
  8507. });
  8508. exports.setPluginPermission = exports.hasPluginPermission = exports.PluginPermission = void 0;
  8509. const shared_data_1 = __webpack_require__2(
  8510. /*! ./shared-data */
  8511. "../shared-utils/lib/shared-data.js"
  8512. );
  8513. (function(PluginPermission) {
  8514. PluginPermission["ENABLED"] = "enabled";
  8515. PluginPermission["COMPONENTS"] = "components";
  8516. PluginPermission["CUSTOM_INSPECTOR"] = "custom-inspector";
  8517. PluginPermission["TIMELINE"] = "timeline";
  8518. })(exports.PluginPermission || (exports.PluginPermission = {}));
  8519. function hasPluginPermission(pluginId, permission) {
  8520. const result = shared_data_1.SharedData.pluginPermissions[`${pluginId}:${permission}`];
  8521. if (result == null)
  8522. return true;
  8523. return !!result;
  8524. }
  8525. exports.hasPluginPermission = hasPluginPermission;
  8526. function setPluginPermission(pluginId, permission, active) {
  8527. shared_data_1.SharedData.pluginPermissions = {
  8528. ...shared_data_1.SharedData.pluginPermissions,
  8529. [`${pluginId}:${permission}`]: active
  8530. };
  8531. }
  8532. exports.setPluginPermission = setPluginPermission;
  8533. }
  8534. ),
  8535. /***/
  8536. "../shared-utils/lib/plugin-settings.js": (
  8537. /*!**********************************************!*\
  8538. !*** ../shared-utils/lib/plugin-settings.js ***!
  8539. \**********************************************/
  8540. /***/
  8541. (__unused_webpack_module, exports, __webpack_require__2) => {
  8542. Object.defineProperty(exports, "__esModule", {
  8543. value: true
  8544. });
  8545. exports.getPluginDefaultSettings = exports.setPluginSettings = exports.getPluginSettings = void 0;
  8546. const shared_data_1 = __webpack_require__2(
  8547. /*! ./shared-data */
  8548. "../shared-utils/lib/shared-data.js"
  8549. );
  8550. function getPluginSettings(pluginId, defaultSettings) {
  8551. var _a;
  8552. return {
  8553. ...defaultSettings !== null && defaultSettings !== void 0 ? defaultSettings : {},
  8554. ...(_a = shared_data_1.SharedData.pluginSettings[pluginId]) !== null && _a !== void 0 ? _a : {}
  8555. };
  8556. }
  8557. exports.getPluginSettings = getPluginSettings;
  8558. function setPluginSettings(pluginId, settings) {
  8559. shared_data_1.SharedData.pluginSettings = {
  8560. ...shared_data_1.SharedData.pluginSettings,
  8561. [pluginId]: settings
  8562. };
  8563. }
  8564. exports.setPluginSettings = setPluginSettings;
  8565. function getPluginDefaultSettings(schema) {
  8566. const result = {};
  8567. if (schema) {
  8568. for (const id in schema) {
  8569. const item = schema[id];
  8570. result[id] = item.defaultValue;
  8571. }
  8572. }
  8573. return result;
  8574. }
  8575. exports.getPluginDefaultSettings = getPluginDefaultSettings;
  8576. }
  8577. ),
  8578. /***/
  8579. "../shared-utils/lib/raf.js": (
  8580. /*!**********************************!*\
  8581. !*** ../shared-utils/lib/raf.js ***!
  8582. \**********************************/
  8583. /***/
  8584. (__unused_webpack_module, exports) => {
  8585. Object.defineProperty(exports, "__esModule", {
  8586. value: true
  8587. });
  8588. exports.raf = void 0;
  8589. let pendingCallbacks = [];
  8590. exports.raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : typeof setImmediate === "function" ? (fn) => {
  8591. if (!pendingCallbacks.length) {
  8592. setImmediate(() => {
  8593. const now = performance.now();
  8594. const cbs = pendingCallbacks;
  8595. pendingCallbacks = [];
  8596. cbs.forEach((cb) => cb(now));
  8597. });
  8598. }
  8599. pendingCallbacks.push(fn);
  8600. } : function(callback) {
  8601. return setTimeout(function() {
  8602. callback(Date.now());
  8603. }, 1e3 / 60);
  8604. };
  8605. }
  8606. ),
  8607. /***/
  8608. "../shared-utils/lib/shared-data.js": (
  8609. /*!******************************************!*\
  8610. !*** ../shared-utils/lib/shared-data.js ***!
  8611. \******************************************/
  8612. /***/
  8613. (__unused_webpack_module, exports, __webpack_require__2) => {
  8614. Object.defineProperty(exports, "__esModule", {
  8615. value: true
  8616. });
  8617. exports.SharedData = exports.watchSharedData = exports.destroySharedData = exports.onSharedDataInit = exports.initSharedData = void 0;
  8618. const storage_1 = __webpack_require__2(
  8619. /*! ./storage */
  8620. "../shared-utils/lib/storage.js"
  8621. );
  8622. const env_1 = __webpack_require__2(
  8623. /*! ./env */
  8624. "../shared-utils/lib/env.js"
  8625. );
  8626. const internalSharedData = {
  8627. openInEditorHost: "/",
  8628. componentNameStyle: "class",
  8629. theme: "auto",
  8630. displayDensity: "low",
  8631. timeFormat: "default",
  8632. recordVuex: true,
  8633. cacheVuexSnapshotsEvery: 50,
  8634. cacheVuexSnapshotsLimit: 10,
  8635. snapshotLoading: false,
  8636. componentEventsEnabled: true,
  8637. performanceMonitoringEnabled: true,
  8638. editableProps: false,
  8639. logDetected: true,
  8640. vuexNewBackend: false,
  8641. vuexAutoload: false,
  8642. vuexGroupGettersByModule: true,
  8643. showMenuScrollTip: true,
  8644. timelineTimeGrid: true,
  8645. timelineScreenshots: true,
  8646. menuStepScrolling: env_1.isMac,
  8647. pluginPermissions: {},
  8648. pluginSettings: {},
  8649. pageConfig: {},
  8650. legacyApps: false,
  8651. trackUpdates: true,
  8652. flashUpdates: false,
  8653. debugInfo: false,
  8654. isBrowser: env_1.isBrowser
  8655. };
  8656. const persisted = ["componentNameStyle", "theme", "displayDensity", "recordVuex", "editableProps", "logDetected", "vuexNewBackend", "vuexAutoload", "vuexGroupGettersByModule", "timeFormat", "showMenuScrollTip", "timelineTimeGrid", "timelineScreenshots", "menuStepScrolling", "pluginPermissions", "pluginSettings", "performanceMonitoringEnabled", "componentEventsEnabled", "trackUpdates", "flashUpdates", "debugInfo"];
  8657. const storageVersion = "6.0.0-alpha.1";
  8658. let bridge;
  8659. let persist = false;
  8660. let data;
  8661. let initRetryInterval;
  8662. let initRetryCount = 0;
  8663. const initCbs = [];
  8664. function initSharedData(params) {
  8665. return new Promise((resolve) => {
  8666. bridge = params.bridge;
  8667. persist = !!params.persist;
  8668. if (persist) {
  8669. {
  8670. console.log("[shared data] Master init in progress...");
  8671. }
  8672. persisted.forEach((key) => {
  8673. const value = (0, storage_1.getStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`);
  8674. if (value !== null) {
  8675. internalSharedData[key] = value;
  8676. }
  8677. });
  8678. bridge.on("shared-data:load", () => {
  8679. Object.keys(internalSharedData).forEach((key) => {
  8680. sendValue(key, internalSharedData[key]);
  8681. });
  8682. bridge.send("shared-data:load-complete");
  8683. });
  8684. bridge.on("shared-data:init-complete", () => {
  8685. {
  8686. console.log("[shared data] Master init complete");
  8687. }
  8688. clearInterval(initRetryInterval);
  8689. resolve();
  8690. });
  8691. bridge.send("shared-data:master-init-waiting");
  8692. bridge.on("shared-data:minion-init-waiting", () => {
  8693. bridge.send("shared-data:master-init-waiting");
  8694. });
  8695. initRetryCount = 0;
  8696. clearInterval(initRetryInterval);
  8697. initRetryInterval = setInterval(() => {
  8698. {
  8699. console.log("[shared data] Master init retrying...");
  8700. }
  8701. bridge.send("shared-data:master-init-waiting");
  8702. initRetryCount++;
  8703. if (initRetryCount > 30) {
  8704. clearInterval(initRetryInterval);
  8705. console.error("[shared data] Master init failed");
  8706. }
  8707. }, 2e3);
  8708. } else {
  8709. bridge.on("shared-data:master-init-waiting", () => {
  8710. bridge.send("shared-data:load");
  8711. bridge.once("shared-data:load-complete", () => {
  8712. bridge.send("shared-data:init-complete");
  8713. resolve();
  8714. });
  8715. });
  8716. bridge.send("shared-data:minion-init-waiting");
  8717. }
  8718. data = {
  8719. ...internalSharedData
  8720. };
  8721. if (params.Vue) {
  8722. data = params.Vue.observable(data);
  8723. }
  8724. bridge.on("shared-data:set", ({
  8725. key,
  8726. value
  8727. }) => {
  8728. setValue(key, value);
  8729. });
  8730. initCbs.forEach((cb) => cb());
  8731. });
  8732. }
  8733. exports.initSharedData = initSharedData;
  8734. function onSharedDataInit(cb) {
  8735. initCbs.push(cb);
  8736. return () => {
  8737. const index = initCbs.indexOf(cb);
  8738. if (index !== -1)
  8739. initCbs.splice(index, 1);
  8740. };
  8741. }
  8742. exports.onSharedDataInit = onSharedDataInit;
  8743. function destroySharedData() {
  8744. bridge.removeAllListeners("shared-data:set");
  8745. watchers = {};
  8746. }
  8747. exports.destroySharedData = destroySharedData;
  8748. let watchers = {};
  8749. function setValue(key, value) {
  8750. if (persist && persisted.includes(key)) {
  8751. (0, storage_1.setStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`, value);
  8752. }
  8753. const oldValue = data[key];
  8754. data[key] = value;
  8755. const handlers = watchers[key];
  8756. if (handlers) {
  8757. handlers.forEach((h) => h(value, oldValue));
  8758. }
  8759. return true;
  8760. }
  8761. function sendValue(key, value) {
  8762. bridge && bridge.send("shared-data:set", {
  8763. key,
  8764. value
  8765. });
  8766. }
  8767. function watchSharedData(prop, handler) {
  8768. const list = watchers[prop] || (watchers[prop] = []);
  8769. list.push(handler);
  8770. return () => {
  8771. const index = list.indexOf(handler);
  8772. if (index !== -1)
  8773. list.splice(index, 1);
  8774. };
  8775. }
  8776. exports.watchSharedData = watchSharedData;
  8777. const proxy = {};
  8778. Object.keys(internalSharedData).forEach((key) => {
  8779. Object.defineProperty(proxy, key, {
  8780. configurable: false,
  8781. get: () => data[key],
  8782. set: (value) => {
  8783. sendValue(key, value);
  8784. setValue(key, value);
  8785. }
  8786. });
  8787. });
  8788. exports.SharedData = proxy;
  8789. }
  8790. ),
  8791. /***/
  8792. "../shared-utils/lib/shell.js": (
  8793. /*!************************************!*\
  8794. !*** ../shared-utils/lib/shell.js ***!
  8795. \************************************/
  8796. /***/
  8797. (__unused_webpack_module, exports) => {
  8798. Object.defineProperty(exports, "__esModule", {
  8799. value: true
  8800. });
  8801. }
  8802. ),
  8803. /***/
  8804. "../shared-utils/lib/storage.js": (
  8805. /*!**************************************!*\
  8806. !*** ../shared-utils/lib/storage.js ***!
  8807. \**************************************/
  8808. /***/
  8809. (__unused_webpack_module, exports, __webpack_require__2) => {
  8810. Object.defineProperty(exports, "__esModule", {
  8811. value: true
  8812. });
  8813. exports.clearStorage = exports.removeStorage = exports.setStorage = exports.getStorage = exports.initStorage = void 0;
  8814. const env_1 = __webpack_require__2(
  8815. /*! ./env */
  8816. "../shared-utils/lib/env.js"
  8817. );
  8818. const useStorage = typeof env_1.target.chrome !== "undefined" && typeof env_1.target.chrome.storage !== "undefined";
  8819. let storageData = null;
  8820. function initStorage() {
  8821. return new Promise((resolve) => {
  8822. if (useStorage) {
  8823. env_1.target.chrome.storage.local.get(null, (result) => {
  8824. storageData = result;
  8825. resolve();
  8826. });
  8827. } else {
  8828. storageData = {};
  8829. resolve();
  8830. }
  8831. });
  8832. }
  8833. exports.initStorage = initStorage;
  8834. function getStorage(key, defaultValue = null) {
  8835. checkStorage();
  8836. if (useStorage) {
  8837. return getDefaultValue(storageData[key], defaultValue);
  8838. } else {
  8839. try {
  8840. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue);
  8841. } catch (e) {
  8842. }
  8843. }
  8844. }
  8845. exports.getStorage = getStorage;
  8846. function setStorage(key, val) {
  8847. checkStorage();
  8848. if (useStorage) {
  8849. storageData[key] = val;
  8850. env_1.target.chrome.storage.local.set({
  8851. [key]: val
  8852. });
  8853. } else {
  8854. try {
  8855. localStorage.setItem(key, JSON.stringify(val));
  8856. } catch (e) {
  8857. }
  8858. }
  8859. }
  8860. exports.setStorage = setStorage;
  8861. function removeStorage(key) {
  8862. checkStorage();
  8863. if (useStorage) {
  8864. delete storageData[key];
  8865. env_1.target.chrome.storage.local.remove([key]);
  8866. } else {
  8867. try {
  8868. localStorage.removeItem(key);
  8869. } catch (e) {
  8870. }
  8871. }
  8872. }
  8873. exports.removeStorage = removeStorage;
  8874. function clearStorage() {
  8875. checkStorage();
  8876. if (useStorage) {
  8877. storageData = {};
  8878. env_1.target.chrome.storage.local.clear();
  8879. } else {
  8880. try {
  8881. localStorage.clear();
  8882. } catch (e) {
  8883. }
  8884. }
  8885. }
  8886. exports.clearStorage = clearStorage;
  8887. function checkStorage() {
  8888. if (!storageData) {
  8889. throw new Error("Storage wasn't initialized with 'init()'");
  8890. }
  8891. }
  8892. function getDefaultValue(value, defaultValue) {
  8893. if (value == null) {
  8894. return defaultValue;
  8895. }
  8896. return value;
  8897. }
  8898. }
  8899. ),
  8900. /***/
  8901. "../shared-utils/lib/transfer.js": (
  8902. /*!***************************************!*\
  8903. !*** ../shared-utils/lib/transfer.js ***!
  8904. \***************************************/
  8905. /***/
  8906. (__unused_webpack_module, exports) => {
  8907. Object.defineProperty(exports, "__esModule", {
  8908. value: true
  8909. });
  8910. exports.stringifyStrictCircularAutoChunks = exports.parseCircularAutoChunks = exports.stringifyCircularAutoChunks = void 0;
  8911. const MAX_SERIALIZED_SIZE = 512 * 1024;
  8912. function encode(data, replacer, list, seen) {
  8913. let stored, key, value, i, l;
  8914. const seenIndex = seen.get(data);
  8915. if (seenIndex != null) {
  8916. return seenIndex;
  8917. }
  8918. const index = list.length;
  8919. const proto = Object.prototype.toString.call(data);
  8920. if (proto === "[object Object]") {
  8921. stored = {};
  8922. seen.set(data, index);
  8923. list.push(stored);
  8924. const keys = Object.keys(data);
  8925. for (i = 0, l = keys.length; i < l; i++) {
  8926. key = keys[i];
  8927. try {
  8928. value = data[key];
  8929. if (replacer)
  8930. value = replacer.call(data, key, value);
  8931. } catch (e) {
  8932. value = e;
  8933. }
  8934. stored[key] = encode(value, replacer, list, seen);
  8935. }
  8936. } else if (proto === "[object Array]") {
  8937. stored = [];
  8938. seen.set(data, index);
  8939. list.push(stored);
  8940. for (i = 0, l = data.length; i < l; i++) {
  8941. try {
  8942. value = data[i];
  8943. if (replacer)
  8944. value = replacer.call(data, i, value);
  8945. } catch (e) {
  8946. value = e;
  8947. }
  8948. stored[i] = encode(value, replacer, list, seen);
  8949. }
  8950. } else {
  8951. list.push(data);
  8952. }
  8953. return index;
  8954. }
  8955. function decode(list, reviver) {
  8956. let i = list.length;
  8957. let j, k, data, key, value, proto;
  8958. while (i--) {
  8959. data = list[i];
  8960. proto = Object.prototype.toString.call(data);
  8961. if (proto === "[object Object]") {
  8962. const keys = Object.keys(data);
  8963. for (j = 0, k = keys.length; j < k; j++) {
  8964. key = keys[j];
  8965. value = list[data[key]];
  8966. if (reviver)
  8967. value = reviver.call(data, key, value);
  8968. data[key] = value;
  8969. }
  8970. } else if (proto === "[object Array]") {
  8971. for (j = 0, k = data.length; j < k; j++) {
  8972. value = list[data[j]];
  8973. if (reviver)
  8974. value = reviver.call(data, j, value);
  8975. data[j] = value;
  8976. }
  8977. }
  8978. }
  8979. }
  8980. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  8981. let result;
  8982. try {
  8983. result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, replacer, space);
  8984. } catch (e) {
  8985. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  8986. }
  8987. if (result.length > MAX_SERIALIZED_SIZE) {
  8988. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  8989. const chunks = [];
  8990. for (let i = 0; i < chunkCount; i++) {
  8991. chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE));
  8992. }
  8993. return chunks;
  8994. }
  8995. return result;
  8996. }
  8997. exports.stringifyCircularAutoChunks = stringifyCircularAutoChunks;
  8998. function parseCircularAutoChunks(data, reviver = null) {
  8999. if (Array.isArray(data)) {
  9000. data = data.join("");
  9001. }
  9002. const hasCircular = /^\s/.test(data);
  9003. if (!hasCircular) {
  9004. return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver);
  9005. } else {
  9006. const list = JSON.parse(data);
  9007. decode(list, reviver);
  9008. return list[0];
  9009. }
  9010. }
  9011. exports.parseCircularAutoChunks = parseCircularAutoChunks;
  9012. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  9013. const list = [];
  9014. encode(data, replacer, list, /* @__PURE__ */ new Map());
  9015. return space ? " " + JSON.stringify(list, null, space) : " " + JSON.stringify(list);
  9016. }
  9017. exports.stringifyStrictCircularAutoChunks = stringifyStrictCircularAutoChunks;
  9018. }
  9019. ),
  9020. /***/
  9021. "../shared-utils/lib/util.js": (
  9022. /*!***********************************!*\
  9023. !*** ../shared-utils/lib/util.js ***!
  9024. \***********************************/
  9025. /***/
  9026. function(__unused_webpack_module, exports, __webpack_require__2) {
  9027. var __importDefault = this && this.__importDefault || function(mod) {
  9028. return mod && mod.__esModule ? mod : {
  9029. "default": mod
  9030. };
  9031. };
  9032. Object.defineProperty(exports, "__esModule", {
  9033. value: true
  9034. });
  9035. 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;
  9036. const path_1 = __importDefault(__webpack_require__2(
  9037. /*! path */
  9038. "../../node_modules/path-browserify/index.js"
  9039. ));
  9040. const transfer_1 = __webpack_require__2(
  9041. /*! ./transfer */
  9042. "../shared-utils/lib/transfer.js"
  9043. );
  9044. const backend_1 = __webpack_require__2(
  9045. /*! ./backend */
  9046. "../shared-utils/lib/backend.js"
  9047. );
  9048. const shared_data_1 = __webpack_require__2(
  9049. /*! ./shared-data */
  9050. "../shared-utils/lib/shared-data.js"
  9051. );
  9052. const env_1 = __webpack_require__2(
  9053. /*! ./env */
  9054. "../shared-utils/lib/env.js"
  9055. );
  9056. function cached(fn) {
  9057. const cache = /* @__PURE__ */ Object.create(null);
  9058. return function cachedFn(str) {
  9059. const hit = cache[str];
  9060. return hit || (cache[str] = fn(str));
  9061. };
  9062. }
  9063. const classifyRE = /(?:^|[-_/])(\w)/g;
  9064. exports.classify = cached((str) => {
  9065. return str && ("" + str).replace(classifyRE, toUpper);
  9066. });
  9067. const camelizeRE = /-(\w)/g;
  9068. exports.camelize = cached((str) => {
  9069. return str && str.replace(camelizeRE, toUpper);
  9070. });
  9071. const kebabizeRE = /([a-z0-9])([A-Z])/g;
  9072. exports.kebabize = cached((str) => {
  9073. return str && str.replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {
  9074. return `${lowerCaseCharacter}-${upperCaseLetter}`;
  9075. }).toLowerCase();
  9076. });
  9077. function toUpper(_, c) {
  9078. return c ? c.toUpperCase() : "";
  9079. }
  9080. function getComponentDisplayName(originalName, style = "class") {
  9081. switch (style) {
  9082. case "class":
  9083. return (0, exports.classify)(originalName);
  9084. case "kebab":
  9085. return (0, exports.kebabize)(originalName);
  9086. case "original":
  9087. default:
  9088. return originalName;
  9089. }
  9090. }
  9091. exports.getComponentDisplayName = getComponentDisplayName;
  9092. function inDoc(node) {
  9093. if (!node)
  9094. return false;
  9095. const doc = node.ownerDocument.documentElement;
  9096. const parent = node.parentNode;
  9097. return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  9098. }
  9099. exports.inDoc = inDoc;
  9100. exports.UNDEFINED = "__vue_devtool_undefined__";
  9101. exports.INFINITY = "__vue_devtool_infinity__";
  9102. exports.NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  9103. exports.NAN = "__vue_devtool_nan__";
  9104. exports.SPECIAL_TOKENS = {
  9105. true: true,
  9106. false: false,
  9107. undefined: exports.UNDEFINED,
  9108. null: null,
  9109. "-Infinity": exports.NEGATIVE_INFINITY,
  9110. Infinity: exports.INFINITY,
  9111. NaN: exports.NAN
  9112. };
  9113. exports.MAX_STRING_SIZE = 1e4;
  9114. exports.MAX_ARRAY_SIZE = 5e3;
  9115. function specialTokenToString(value) {
  9116. if (value === null) {
  9117. return "null";
  9118. } else if (value === exports.UNDEFINED) {
  9119. return "undefined";
  9120. } else if (value === exports.NAN) {
  9121. return "NaN";
  9122. } else if (value === exports.INFINITY) {
  9123. return "Infinity";
  9124. } else if (value === exports.NEGATIVE_INFINITY) {
  9125. return "-Infinity";
  9126. }
  9127. return false;
  9128. }
  9129. exports.specialTokenToString = specialTokenToString;
  9130. class EncodeCache {
  9131. constructor() {
  9132. this.map = /* @__PURE__ */ new Map();
  9133. }
  9134. /**
  9135. * Returns a result unique to each input data
  9136. * @param {*} data Input data
  9137. * @param {*} factory Function used to create the unique result
  9138. */
  9139. cache(data, factory) {
  9140. const cached2 = this.map.get(data);
  9141. if (cached2) {
  9142. return cached2;
  9143. } else {
  9144. const result = factory(data);
  9145. this.map.set(data, result);
  9146. return result;
  9147. }
  9148. }
  9149. clear() {
  9150. this.map.clear();
  9151. }
  9152. }
  9153. const encodeCache = new EncodeCache();
  9154. class ReviveCache {
  9155. constructor(maxSize) {
  9156. this.maxSize = maxSize;
  9157. this.map = /* @__PURE__ */ new Map();
  9158. this.index = 0;
  9159. this.size = 0;
  9160. }
  9161. cache(value) {
  9162. const currentIndex = this.index;
  9163. this.map.set(currentIndex, value);
  9164. this.size++;
  9165. if (this.size > this.maxSize) {
  9166. this.map.delete(currentIndex - this.size);
  9167. this.size--;
  9168. }
  9169. this.index++;
  9170. return currentIndex;
  9171. }
  9172. read(id) {
  9173. return this.map.get(id);
  9174. }
  9175. }
  9176. const reviveCache = new ReviveCache(1e3);
  9177. const replacers = {
  9178. internal: replacerForInternal,
  9179. user: replaceForUser
  9180. };
  9181. function stringify(data, target = "internal") {
  9182. encodeCache.clear();
  9183. return (0, transfer_1.stringifyCircularAutoChunks)(data, replacers[target]);
  9184. }
  9185. exports.stringify = stringify;
  9186. function replacerForInternal(key) {
  9187. var _a;
  9188. const val = this[key];
  9189. const type = typeof val;
  9190. if (Array.isArray(val)) {
  9191. const l = val.length;
  9192. if (l > exports.MAX_ARRAY_SIZE) {
  9193. return {
  9194. _isArray: true,
  9195. length: l,
  9196. items: val.slice(0, exports.MAX_ARRAY_SIZE)
  9197. };
  9198. }
  9199. return val;
  9200. } else if (typeof val === "string") {
  9201. if (val.length > exports.MAX_STRING_SIZE) {
  9202. return val.substring(0, exports.MAX_STRING_SIZE) + `... (${val.length} total length)`;
  9203. } else {
  9204. return val;
  9205. }
  9206. } else if (type === "undefined") {
  9207. return exports.UNDEFINED;
  9208. } else if (val === Infinity) {
  9209. return exports.INFINITY;
  9210. } else if (val === -Infinity) {
  9211. return exports.NEGATIVE_INFINITY;
  9212. } else if (type === "function") {
  9213. return getCustomFunctionDetails(val);
  9214. } else if (type === "symbol") {
  9215. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  9216. } else if (val !== null && type === "object") {
  9217. const proto = Object.prototype.toString.call(val);
  9218. if (proto === "[object Map]") {
  9219. return encodeCache.cache(val, () => getCustomMapDetails(val));
  9220. } else if (proto === "[object Set]") {
  9221. return encodeCache.cache(val, () => getCustomSetDetails(val));
  9222. } else if (proto === "[object RegExp]") {
  9223. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  9224. } else if (proto === "[object Date]") {
  9225. return `[native Date ${Date.prototype.toString.call(val)}]`;
  9226. } else if (proto === "[object Error]") {
  9227. return `[native Error ${val.message}<>${val.stack}]`;
  9228. } else if (val.state && val._vm) {
  9229. return encodeCache.cache(val, () => (0, backend_1.getCustomStoreDetails)(val));
  9230. } else if (val.constructor && val.constructor.name === "VueRouter") {
  9231. return encodeCache.cache(val, () => (0, backend_1.getCustomRouterDetails)(val));
  9232. } else if ((0, backend_1.isVueInstance)(val)) {
  9233. return encodeCache.cache(val, () => (0, backend_1.getCustomInstanceDetails)(val));
  9234. } else if (typeof val.render === "function") {
  9235. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val));
  9236. } else if (val.constructor && val.constructor.name === "VNode") {
  9237. return `[native VNode <${val.tag}>]`;
  9238. } else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
  9239. return encodeCache.cache(val, () => getCustomHTMLElementDetails(val));
  9240. } else if (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) === "Store" && val._wrappedGetters) {
  9241. return `[object Store]`;
  9242. } else if (val.currentRoute) {
  9243. return `[object Router]`;
  9244. }
  9245. const customDetails = (0, backend_1.getCustomObjectDetails)(val, proto);
  9246. if (customDetails != null)
  9247. return customDetails;
  9248. } else if (Number.isNaN(val)) {
  9249. return exports.NAN;
  9250. }
  9251. return sanitize(val);
  9252. }
  9253. function replaceForUser(key) {
  9254. let val = this[key];
  9255. const type = typeof val;
  9256. if ((val === null || val === void 0 ? void 0 : val._custom) && "value" in val._custom) {
  9257. val = val._custom.value;
  9258. }
  9259. if (type !== "object") {
  9260. if (val === exports.UNDEFINED) {
  9261. return void 0;
  9262. } else if (val === exports.INFINITY) {
  9263. return Infinity;
  9264. } else if (val === exports.NEGATIVE_INFINITY) {
  9265. return -Infinity;
  9266. } else if (val === exports.NAN) {
  9267. return NaN;
  9268. }
  9269. return val;
  9270. }
  9271. return sanitize(val);
  9272. }
  9273. function getCustomMapDetails(val) {
  9274. const list = [];
  9275. val.forEach((value, key) => list.push({
  9276. key,
  9277. value
  9278. }));
  9279. return {
  9280. _custom: {
  9281. type: "map",
  9282. display: "Map",
  9283. value: list,
  9284. readOnly: true,
  9285. fields: {
  9286. abstract: true
  9287. }
  9288. }
  9289. };
  9290. }
  9291. exports.getCustomMapDetails = getCustomMapDetails;
  9292. function reviveMap(val) {
  9293. const result = /* @__PURE__ */ new Map();
  9294. const list = val._custom.value;
  9295. for (let i = 0; i < list.length; i++) {
  9296. const {
  9297. key,
  9298. value
  9299. } = list[i];
  9300. result.set(key, revive(value));
  9301. }
  9302. return result;
  9303. }
  9304. exports.reviveMap = reviveMap;
  9305. function getCustomSetDetails(val) {
  9306. const list = Array.from(val);
  9307. return {
  9308. _custom: {
  9309. type: "set",
  9310. display: `Set[${list.length}]`,
  9311. value: list,
  9312. readOnly: true
  9313. }
  9314. };
  9315. }
  9316. exports.getCustomSetDetails = getCustomSetDetails;
  9317. function reviveSet(val) {
  9318. const result = /* @__PURE__ */ new Set();
  9319. const list = val._custom.value;
  9320. for (let i = 0; i < list.length; i++) {
  9321. const value = list[i];
  9322. result.add(revive(value));
  9323. }
  9324. return result;
  9325. }
  9326. exports.reviveSet = reviveSet;
  9327. function basename(filename, ext) {
  9328. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  9329. }
  9330. function getComponentName(options) {
  9331. const name = options.displayName || options.name || options._componentTag;
  9332. if (name) {
  9333. return name;
  9334. }
  9335. const file = options.__file;
  9336. if (file) {
  9337. return (0, exports.classify)(basename(file, ".vue"));
  9338. }
  9339. }
  9340. exports.getComponentName = getComponentName;
  9341. function getCustomComponentDefinitionDetails(def) {
  9342. let display = getComponentName(def);
  9343. if (display) {
  9344. if (def.name && def.__file) {
  9345. display += ` <span>(${def.__file})</span>`;
  9346. }
  9347. } else {
  9348. display = "<i>Unknown Component</i>";
  9349. }
  9350. return {
  9351. _custom: {
  9352. type: "component-definition",
  9353. display,
  9354. tooltip: "Component definition",
  9355. ...def.__file ? {
  9356. file: def.__file
  9357. } : {}
  9358. }
  9359. };
  9360. }
  9361. exports.getCustomComponentDefinitionDetails = getCustomComponentDefinitionDetails;
  9362. function getCustomFunctionDetails(func) {
  9363. let string = "";
  9364. let matches = null;
  9365. try {
  9366. string = Function.prototype.toString.call(func);
  9367. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  9368. } catch (e) {
  9369. }
  9370. const match = matches && matches[0];
  9371. const args = typeof match === "string" ? match : "(?)";
  9372. const name = typeof func.name === "string" ? func.name : "";
  9373. return {
  9374. _custom: {
  9375. type: "function",
  9376. display: `<span style="opacity:.5;">function</span> ${escape(name)}${args}`,
  9377. tooltip: string.trim() ? `<pre>${string}</pre>` : null,
  9378. _reviveId: reviveCache.cache(func)
  9379. }
  9380. };
  9381. }
  9382. exports.getCustomFunctionDetails = getCustomFunctionDetails;
  9383. function getCustomHTMLElementDetails(value) {
  9384. try {
  9385. return {
  9386. _custom: {
  9387. type: "HTMLElement",
  9388. display: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  9389. value: namedNodeMapToObject(value.attributes),
  9390. actions: [{
  9391. icon: "input",
  9392. tooltip: "Log element to console",
  9393. action: () => {
  9394. console.log(value);
  9395. }
  9396. }]
  9397. }
  9398. };
  9399. } catch (e) {
  9400. return {
  9401. _custom: {
  9402. type: "HTMLElement",
  9403. display: `<span class="text-blue-500">${String(value)}</span>`
  9404. }
  9405. };
  9406. }
  9407. }
  9408. exports.getCustomHTMLElementDetails = getCustomHTMLElementDetails;
  9409. function namedNodeMapToObject(map) {
  9410. const result = {};
  9411. const l = map.length;
  9412. for (let i = 0; i < l; i++) {
  9413. const node = map.item(i);
  9414. result[node.name] = node.value;
  9415. }
  9416. return result;
  9417. }
  9418. function getCustomRefDetails(instance, key, ref) {
  9419. let value;
  9420. if (Array.isArray(ref)) {
  9421. value = ref.map((r) => getCustomRefDetails(instance, key, r)).map((data) => data.value);
  9422. } else {
  9423. let name;
  9424. if (ref._isVue) {
  9425. name = getComponentName(ref.$options);
  9426. } else {
  9427. name = ref.tagName.toLowerCase();
  9428. }
  9429. value = {
  9430. _custom: {
  9431. display: `&lt;${name}` + (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : "") + (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : "") + "&gt;",
  9432. uid: instance.__VUE_DEVTOOLS_UID__,
  9433. type: "reference"
  9434. }
  9435. };
  9436. }
  9437. return {
  9438. type: "$refs",
  9439. key,
  9440. value,
  9441. editable: false
  9442. };
  9443. }
  9444. exports.getCustomRefDetails = getCustomRefDetails;
  9445. function parse(data, revive2 = false) {
  9446. return revive2 ? (0, transfer_1.parseCircularAutoChunks)(data, reviver) : (0, transfer_1.parseCircularAutoChunks)(data);
  9447. }
  9448. exports.parse = parse;
  9449. const specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
  9450. const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  9451. function reviver(key, val) {
  9452. return revive(val);
  9453. }
  9454. function revive(val) {
  9455. if (val === exports.UNDEFINED) {
  9456. return void 0;
  9457. } else if (val === exports.INFINITY) {
  9458. return Infinity;
  9459. } else if (val === exports.NEGATIVE_INFINITY) {
  9460. return -Infinity;
  9461. } else if (val === exports.NAN) {
  9462. return NaN;
  9463. } else if (val && val._custom) {
  9464. const {
  9465. _custom: custom
  9466. } = val;
  9467. if (custom.type === "component") {
  9468. return (0, backend_1.getInstanceMap)().get(custom.id);
  9469. } else if (custom.type === "map") {
  9470. return reviveMap(val);
  9471. } else if (custom.type === "set") {
  9472. return reviveSet(val);
  9473. } else if (custom._reviveId) {
  9474. return reviveCache.read(custom._reviveId);
  9475. } else {
  9476. return revive(custom.value);
  9477. }
  9478. } else if (symbolRE.test(val)) {
  9479. const [, string] = symbolRE.exec(val);
  9480. return Symbol.for(string);
  9481. } else if (specialTypeRE.test(val)) {
  9482. const [, type, string, , details] = specialTypeRE.exec(val);
  9483. const result = new env_1.target[type](string);
  9484. if (type === "Error" && details) {
  9485. result.stack = details;
  9486. }
  9487. return result;
  9488. } else {
  9489. return val;
  9490. }
  9491. }
  9492. exports.revive = revive;
  9493. function sanitize(data) {
  9494. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  9495. return Object.prototype.toString.call(data);
  9496. } else {
  9497. return data;
  9498. }
  9499. }
  9500. function isPlainObject(obj) {
  9501. return Object.prototype.toString.call(obj) === "[object Object]";
  9502. }
  9503. exports.isPlainObject = isPlainObject;
  9504. function isPrimitive(data) {
  9505. if (data == null) {
  9506. return true;
  9507. }
  9508. const type = typeof data;
  9509. return type === "string" || type === "number" || type === "boolean";
  9510. }
  9511. function searchDeepInObject(obj, searchTerm) {
  9512. const seen = /* @__PURE__ */ new Map();
  9513. const result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0);
  9514. seen.clear();
  9515. return result;
  9516. }
  9517. exports.searchDeepInObject = searchDeepInObject;
  9518. const SEARCH_MAX_DEPTH = 10;
  9519. function internalSearchObject(obj, searchTerm, seen, depth) {
  9520. if (depth > SEARCH_MAX_DEPTH) {
  9521. return false;
  9522. }
  9523. let match = false;
  9524. const keys = Object.keys(obj);
  9525. let key, value;
  9526. for (let i = 0; i < keys.length; i++) {
  9527. key = keys[i];
  9528. value = obj[key];
  9529. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1);
  9530. if (match) {
  9531. break;
  9532. }
  9533. }
  9534. return match;
  9535. }
  9536. function internalSearchArray(array, searchTerm, seen, depth) {
  9537. if (depth > SEARCH_MAX_DEPTH) {
  9538. return false;
  9539. }
  9540. let match = false;
  9541. let value;
  9542. for (let i = 0; i < array.length; i++) {
  9543. value = array[i];
  9544. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1);
  9545. if (match) {
  9546. break;
  9547. }
  9548. }
  9549. return match;
  9550. }
  9551. function internalSearchCheck(searchTerm, key, value, seen, depth) {
  9552. let match = false;
  9553. let result;
  9554. if (key === "_custom") {
  9555. key = value.display;
  9556. value = value.value;
  9557. }
  9558. (result = specialTokenToString(value)) && (value = result);
  9559. if (key && compare(key, searchTerm)) {
  9560. match = true;
  9561. seen.set(value, true);
  9562. } else if (seen.has(value)) {
  9563. match = seen.get(value);
  9564. } else if (Array.isArray(value)) {
  9565. seen.set(value, null);
  9566. match = internalSearchArray(value, searchTerm, seen, depth);
  9567. seen.set(value, match);
  9568. } else if (isPlainObject(value)) {
  9569. seen.set(value, null);
  9570. match = internalSearchObject(value, searchTerm, seen, depth);
  9571. seen.set(value, match);
  9572. } else if (compare(value, searchTerm)) {
  9573. match = true;
  9574. seen.set(value, true);
  9575. }
  9576. return match;
  9577. }
  9578. function compare(value, searchTerm) {
  9579. return ("" + value).toLowerCase().indexOf(searchTerm) !== -1;
  9580. }
  9581. function sortByKey(state) {
  9582. return state && state.slice().sort((a, b) => {
  9583. if (a.key < b.key)
  9584. return -1;
  9585. if (a.key > b.key)
  9586. return 1;
  9587. return 0;
  9588. });
  9589. }
  9590. exports.sortByKey = sortByKey;
  9591. function simpleGet(object, path) {
  9592. const sections = Array.isArray(path) ? path : path.split(".");
  9593. for (let i = 0; i < sections.length; i++) {
  9594. object = object[sections[i]];
  9595. if (!object) {
  9596. return void 0;
  9597. }
  9598. }
  9599. return object;
  9600. }
  9601. exports.simpleGet = simpleGet;
  9602. function focusInput(el) {
  9603. el.focus();
  9604. el.setSelectionRange(0, el.value.length);
  9605. }
  9606. exports.focusInput = focusInput;
  9607. function openInEditor(file) {
  9608. const fileName = file.replace(/\\/g, "\\\\");
  9609. const src = `fetch('${shared_data_1.SharedData.openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  9610. if (response.ok) {
  9611. console.log('File ${fileName} opened in editor')
  9612. } else {
  9613. const msg = 'Opening component ${fileName} failed'
  9614. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  9615. if (target.__VUE_DEVTOOLS_TOAST__) {
  9616. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  9617. } else {
  9618. console.log('%c' + msg, 'color:red')
  9619. }
  9620. console.log('Check the setup of your project, see https://devtools.vuejs.org/guide/open-in-editor.html')
  9621. }
  9622. })`;
  9623. if (env_1.isChrome) {
  9624. env_1.target.chrome.devtools.inspectedWindow.eval(src);
  9625. } else {
  9626. [eval][0](src);
  9627. }
  9628. }
  9629. exports.openInEditor = openInEditor;
  9630. const ESC = {
  9631. "<": "&lt;",
  9632. ">": "&gt;",
  9633. '"': "&quot;",
  9634. "&": "&amp;"
  9635. };
  9636. function escape(s) {
  9637. return s.replace(/[<>"&]/g, escapeChar);
  9638. }
  9639. exports.escape = escape;
  9640. function escapeChar(a) {
  9641. return ESC[a] || a;
  9642. }
  9643. function copyToClipboard(state) {
  9644. let text;
  9645. if (typeof state !== "object") {
  9646. text = String(state);
  9647. } else {
  9648. text = stringify(state, "user");
  9649. }
  9650. if (typeof document === "undefined")
  9651. return;
  9652. const dummyTextArea = document.createElement("textarea");
  9653. dummyTextArea.textContent = text;
  9654. document.body.appendChild(dummyTextArea);
  9655. dummyTextArea.select();
  9656. document.execCommand("copy");
  9657. document.body.removeChild(dummyTextArea);
  9658. }
  9659. exports.copyToClipboard = copyToClipboard;
  9660. function isEmptyObject(obj) {
  9661. return obj === exports.UNDEFINED || !obj || Object.keys(obj).length === 0;
  9662. }
  9663. exports.isEmptyObject = isEmptyObject;
  9664. }
  9665. ),
  9666. /***/
  9667. "../../node_modules/events/events.js": (
  9668. /*!*******************************************!*\
  9669. !*** ../../node_modules/events/events.js ***!
  9670. \*******************************************/
  9671. /***/
  9672. (module) => {
  9673. var R = typeof Reflect === "object" ? Reflect : null;
  9674. var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
  9675. return Function.prototype.apply.call(target, receiver, args);
  9676. };
  9677. var ReflectOwnKeys;
  9678. if (R && typeof R.ownKeys === "function") {
  9679. ReflectOwnKeys = R.ownKeys;
  9680. } else if (Object.getOwnPropertySymbols) {
  9681. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  9682. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  9683. };
  9684. } else {
  9685. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  9686. return Object.getOwnPropertyNames(target);
  9687. };
  9688. }
  9689. function ProcessEmitWarning(warning) {
  9690. if (console && console.warn)
  9691. console.warn(warning);
  9692. }
  9693. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  9694. return value !== value;
  9695. };
  9696. function EventEmitter() {
  9697. EventEmitter.init.call(this);
  9698. }
  9699. module.exports = EventEmitter;
  9700. module.exports.once = once;
  9701. EventEmitter.EventEmitter = EventEmitter;
  9702. EventEmitter.prototype._events = void 0;
  9703. EventEmitter.prototype._eventsCount = 0;
  9704. EventEmitter.prototype._maxListeners = void 0;
  9705. var defaultMaxListeners = 10;
  9706. function checkListener(listener) {
  9707. if (typeof listener !== "function") {
  9708. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  9709. }
  9710. }
  9711. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  9712. enumerable: true,
  9713. get: function() {
  9714. return defaultMaxListeners;
  9715. },
  9716. set: function(arg) {
  9717. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  9718. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  9719. }
  9720. defaultMaxListeners = arg;
  9721. }
  9722. });
  9723. EventEmitter.init = function() {
  9724. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  9725. this._events = /* @__PURE__ */ Object.create(null);
  9726. this._eventsCount = 0;
  9727. }
  9728. this._maxListeners = this._maxListeners || void 0;
  9729. };
  9730. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  9731. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  9732. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  9733. }
  9734. this._maxListeners = n;
  9735. return this;
  9736. };
  9737. function _getMaxListeners(that) {
  9738. if (that._maxListeners === void 0)
  9739. return EventEmitter.defaultMaxListeners;
  9740. return that._maxListeners;
  9741. }
  9742. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  9743. return _getMaxListeners(this);
  9744. };
  9745. EventEmitter.prototype.emit = function emit(type) {
  9746. var args = [];
  9747. for (var i = 1; i < arguments.length; i++)
  9748. args.push(arguments[i]);
  9749. var doError = type === "error";
  9750. var events = this._events;
  9751. if (events !== void 0)
  9752. doError = doError && events.error === void 0;
  9753. else if (!doError)
  9754. return false;
  9755. if (doError) {
  9756. var er;
  9757. if (args.length > 0)
  9758. er = args[0];
  9759. if (er instanceof Error) {
  9760. throw er;
  9761. }
  9762. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  9763. err.context = er;
  9764. throw err;
  9765. }
  9766. var handler = events[type];
  9767. if (handler === void 0)
  9768. return false;
  9769. if (typeof handler === "function") {
  9770. ReflectApply(handler, this, args);
  9771. } else {
  9772. var len = handler.length;
  9773. var listeners = arrayClone(handler, len);
  9774. for (var i = 0; i < len; ++i)
  9775. ReflectApply(listeners[i], this, args);
  9776. }
  9777. return true;
  9778. };
  9779. function _addListener(target, type, listener, prepend) {
  9780. var m;
  9781. var events;
  9782. var existing;
  9783. checkListener(listener);
  9784. events = target._events;
  9785. if (events === void 0) {
  9786. events = target._events = /* @__PURE__ */ Object.create(null);
  9787. target._eventsCount = 0;
  9788. } else {
  9789. if (events.newListener !== void 0) {
  9790. target.emit(
  9791. "newListener",
  9792. type,
  9793. listener.listener ? listener.listener : listener
  9794. );
  9795. events = target._events;
  9796. }
  9797. existing = events[type];
  9798. }
  9799. if (existing === void 0) {
  9800. existing = events[type] = listener;
  9801. ++target._eventsCount;
  9802. } else {
  9803. if (typeof existing === "function") {
  9804. existing = events[type] = prepend ? [listener, existing] : [existing, listener];
  9805. } else if (prepend) {
  9806. existing.unshift(listener);
  9807. } else {
  9808. existing.push(listener);
  9809. }
  9810. m = _getMaxListeners(target);
  9811. if (m > 0 && existing.length > m && !existing.warned) {
  9812. existing.warned = true;
  9813. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  9814. w.name = "MaxListenersExceededWarning";
  9815. w.emitter = target;
  9816. w.type = type;
  9817. w.count = existing.length;
  9818. ProcessEmitWarning(w);
  9819. }
  9820. }
  9821. return target;
  9822. }
  9823. EventEmitter.prototype.addListener = function addListener(type, listener) {
  9824. return _addListener(this, type, listener, false);
  9825. };
  9826. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  9827. EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  9828. return _addListener(this, type, listener, true);
  9829. };
  9830. function onceWrapper() {
  9831. if (!this.fired) {
  9832. this.target.removeListener(this.type, this.wrapFn);
  9833. this.fired = true;
  9834. if (arguments.length === 0)
  9835. return this.listener.call(this.target);
  9836. return this.listener.apply(this.target, arguments);
  9837. }
  9838. }
  9839. function _onceWrap(target, type, listener) {
  9840. var state = { fired: false, wrapFn: void 0, target, type, listener };
  9841. var wrapped = onceWrapper.bind(state);
  9842. wrapped.listener = listener;
  9843. state.wrapFn = wrapped;
  9844. return wrapped;
  9845. }
  9846. EventEmitter.prototype.once = function once2(type, listener) {
  9847. checkListener(listener);
  9848. this.on(type, _onceWrap(this, type, listener));
  9849. return this;
  9850. };
  9851. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  9852. checkListener(listener);
  9853. this.prependListener(type, _onceWrap(this, type, listener));
  9854. return this;
  9855. };
  9856. EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  9857. var list, events, position, i, originalListener;
  9858. checkListener(listener);
  9859. events = this._events;
  9860. if (events === void 0)
  9861. return this;
  9862. list = events[type];
  9863. if (list === void 0)
  9864. return this;
  9865. if (list === listener || list.listener === listener) {
  9866. if (--this._eventsCount === 0)
  9867. this._events = /* @__PURE__ */ Object.create(null);
  9868. else {
  9869. delete events[type];
  9870. if (events.removeListener)
  9871. this.emit("removeListener", type, list.listener || listener);
  9872. }
  9873. } else if (typeof list !== "function") {
  9874. position = -1;
  9875. for (i = list.length - 1; i >= 0; i--) {
  9876. if (list[i] === listener || list[i].listener === listener) {
  9877. originalListener = list[i].listener;
  9878. position = i;
  9879. break;
  9880. }
  9881. }
  9882. if (position < 0)
  9883. return this;
  9884. if (position === 0)
  9885. list.shift();
  9886. else {
  9887. spliceOne(list, position);
  9888. }
  9889. if (list.length === 1)
  9890. events[type] = list[0];
  9891. if (events.removeListener !== void 0)
  9892. this.emit("removeListener", type, originalListener || listener);
  9893. }
  9894. return this;
  9895. };
  9896. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  9897. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  9898. var listeners, events, i;
  9899. events = this._events;
  9900. if (events === void 0)
  9901. return this;
  9902. if (events.removeListener === void 0) {
  9903. if (arguments.length === 0) {
  9904. this._events = /* @__PURE__ */ Object.create(null);
  9905. this._eventsCount = 0;
  9906. } else if (events[type] !== void 0) {
  9907. if (--this._eventsCount === 0)
  9908. this._events = /* @__PURE__ */ Object.create(null);
  9909. else
  9910. delete events[type];
  9911. }
  9912. return this;
  9913. }
  9914. if (arguments.length === 0) {
  9915. var keys = Object.keys(events);
  9916. var key;
  9917. for (i = 0; i < keys.length; ++i) {
  9918. key = keys[i];
  9919. if (key === "removeListener")
  9920. continue;
  9921. this.removeAllListeners(key);
  9922. }
  9923. this.removeAllListeners("removeListener");
  9924. this._events = /* @__PURE__ */ Object.create(null);
  9925. this._eventsCount = 0;
  9926. return this;
  9927. }
  9928. listeners = events[type];
  9929. if (typeof listeners === "function") {
  9930. this.removeListener(type, listeners);
  9931. } else if (listeners !== void 0) {
  9932. for (i = listeners.length - 1; i >= 0; i--) {
  9933. this.removeListener(type, listeners[i]);
  9934. }
  9935. }
  9936. return this;
  9937. };
  9938. function _listeners(target, type, unwrap) {
  9939. var events = target._events;
  9940. if (events === void 0)
  9941. return [];
  9942. var evlistener = events[type];
  9943. if (evlistener === void 0)
  9944. return [];
  9945. if (typeof evlistener === "function")
  9946. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  9947. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  9948. }
  9949. EventEmitter.prototype.listeners = function listeners(type) {
  9950. return _listeners(this, type, true);
  9951. };
  9952. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  9953. return _listeners(this, type, false);
  9954. };
  9955. EventEmitter.listenerCount = function(emitter, type) {
  9956. if (typeof emitter.listenerCount === "function") {
  9957. return emitter.listenerCount(type);
  9958. } else {
  9959. return listenerCount.call(emitter, type);
  9960. }
  9961. };
  9962. EventEmitter.prototype.listenerCount = listenerCount;
  9963. function listenerCount(type) {
  9964. var events = this._events;
  9965. if (events !== void 0) {
  9966. var evlistener = events[type];
  9967. if (typeof evlistener === "function") {
  9968. return 1;
  9969. } else if (evlistener !== void 0) {
  9970. return evlistener.length;
  9971. }
  9972. }
  9973. return 0;
  9974. }
  9975. EventEmitter.prototype.eventNames = function eventNames() {
  9976. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  9977. };
  9978. function arrayClone(arr, n) {
  9979. var copy = new Array(n);
  9980. for (var i = 0; i < n; ++i)
  9981. copy[i] = arr[i];
  9982. return copy;
  9983. }
  9984. function spliceOne(list, index) {
  9985. for (; index + 1 < list.length; index++)
  9986. list[index] = list[index + 1];
  9987. list.pop();
  9988. }
  9989. function unwrapListeners(arr) {
  9990. var ret = new Array(arr.length);
  9991. for (var i = 0; i < ret.length; ++i) {
  9992. ret[i] = arr[i].listener || arr[i];
  9993. }
  9994. return ret;
  9995. }
  9996. function once(emitter, name) {
  9997. return new Promise(function(resolve, reject) {
  9998. function errorListener(err) {
  9999. emitter.removeListener(name, resolver);
  10000. reject(err);
  10001. }
  10002. function resolver() {
  10003. if (typeof emitter.removeListener === "function") {
  10004. emitter.removeListener("error", errorListener);
  10005. }
  10006. resolve([].slice.call(arguments));
  10007. }
  10008. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  10009. if (name !== "error") {
  10010. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  10011. }
  10012. });
  10013. }
  10014. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  10015. if (typeof emitter.on === "function") {
  10016. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  10017. }
  10018. }
  10019. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  10020. if (typeof emitter.on === "function") {
  10021. if (flags.once) {
  10022. emitter.once(name, listener);
  10023. } else {
  10024. emitter.on(name, listener);
  10025. }
  10026. } else if (typeof emitter.addEventListener === "function") {
  10027. emitter.addEventListener(name, function wrapListener(arg) {
  10028. if (flags.once) {
  10029. emitter.removeEventListener(name, wrapListener);
  10030. }
  10031. listener(arg);
  10032. });
  10033. } else {
  10034. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  10035. }
  10036. }
  10037. }
  10038. ),
  10039. /***/
  10040. "../../node_modules/lodash/_Symbol.js": (
  10041. /*!********************************************!*\
  10042. !*** ../../node_modules/lodash/_Symbol.js ***!
  10043. \********************************************/
  10044. /***/
  10045. (module, __unused_webpack_exports, __webpack_require__2) => {
  10046. var root = __webpack_require__2(
  10047. /*! ./_root */
  10048. "../../node_modules/lodash/_root.js"
  10049. );
  10050. var Symbol2 = root.Symbol;
  10051. module.exports = Symbol2;
  10052. }
  10053. ),
  10054. /***/
  10055. "../../node_modules/lodash/_baseGetTag.js": (
  10056. /*!************************************************!*\
  10057. !*** ../../node_modules/lodash/_baseGetTag.js ***!
  10058. \************************************************/
  10059. /***/
  10060. (module, __unused_webpack_exports, __webpack_require__2) => {
  10061. var Symbol2 = __webpack_require__2(
  10062. /*! ./_Symbol */
  10063. "../../node_modules/lodash/_Symbol.js"
  10064. ), getRawTag = __webpack_require__2(
  10065. /*! ./_getRawTag */
  10066. "../../node_modules/lodash/_getRawTag.js"
  10067. ), objectToString = __webpack_require__2(
  10068. /*! ./_objectToString */
  10069. "../../node_modules/lodash/_objectToString.js"
  10070. );
  10071. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  10072. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  10073. function baseGetTag(value) {
  10074. if (value == null) {
  10075. return value === void 0 ? undefinedTag : nullTag;
  10076. }
  10077. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  10078. }
  10079. module.exports = baseGetTag;
  10080. }
  10081. ),
  10082. /***/
  10083. "../../node_modules/lodash/_baseTrim.js": (
  10084. /*!**********************************************!*\
  10085. !*** ../../node_modules/lodash/_baseTrim.js ***!
  10086. \**********************************************/
  10087. /***/
  10088. (module, __unused_webpack_exports, __webpack_require__2) => {
  10089. var trimmedEndIndex = __webpack_require__2(
  10090. /*! ./_trimmedEndIndex */
  10091. "../../node_modules/lodash/_trimmedEndIndex.js"
  10092. );
  10093. var reTrimStart = /^\s+/;
  10094. function baseTrim(string) {
  10095. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  10096. }
  10097. module.exports = baseTrim;
  10098. }
  10099. ),
  10100. /***/
  10101. "../../node_modules/lodash/_freeGlobal.js": (
  10102. /*!************************************************!*\
  10103. !*** ../../node_modules/lodash/_freeGlobal.js ***!
  10104. \************************************************/
  10105. /***/
  10106. (module, __unused_webpack_exports, __webpack_require__2) => {
  10107. var freeGlobal = typeof __webpack_require__2.g == "object" && __webpack_require__2.g && __webpack_require__2.g.Object === Object && __webpack_require__2.g;
  10108. module.exports = freeGlobal;
  10109. }
  10110. ),
  10111. /***/
  10112. "../../node_modules/lodash/_getRawTag.js": (
  10113. /*!***********************************************!*\
  10114. !*** ../../node_modules/lodash/_getRawTag.js ***!
  10115. \***********************************************/
  10116. /***/
  10117. (module, __unused_webpack_exports, __webpack_require__2) => {
  10118. var Symbol2 = __webpack_require__2(
  10119. /*! ./_Symbol */
  10120. "../../node_modules/lodash/_Symbol.js"
  10121. );
  10122. var objectProto = Object.prototype;
  10123. var hasOwnProperty = objectProto.hasOwnProperty;
  10124. var nativeObjectToString = objectProto.toString;
  10125. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  10126. function getRawTag(value) {
  10127. var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
  10128. try {
  10129. value[symToStringTag] = void 0;
  10130. var unmasked = true;
  10131. } catch (e) {
  10132. }
  10133. var result = nativeObjectToString.call(value);
  10134. if (unmasked) {
  10135. if (isOwn) {
  10136. value[symToStringTag] = tag;
  10137. } else {
  10138. delete value[symToStringTag];
  10139. }
  10140. }
  10141. return result;
  10142. }
  10143. module.exports = getRawTag;
  10144. }
  10145. ),
  10146. /***/
  10147. "../../node_modules/lodash/_objectToString.js": (
  10148. /*!****************************************************!*\
  10149. !*** ../../node_modules/lodash/_objectToString.js ***!
  10150. \****************************************************/
  10151. /***/
  10152. (module) => {
  10153. var objectProto = Object.prototype;
  10154. var nativeObjectToString = objectProto.toString;
  10155. function objectToString(value) {
  10156. return nativeObjectToString.call(value);
  10157. }
  10158. module.exports = objectToString;
  10159. }
  10160. ),
  10161. /***/
  10162. "../../node_modules/lodash/_root.js": (
  10163. /*!******************************************!*\
  10164. !*** ../../node_modules/lodash/_root.js ***!
  10165. \******************************************/
  10166. /***/
  10167. (module, __unused_webpack_exports, __webpack_require__2) => {
  10168. var freeGlobal = __webpack_require__2(
  10169. /*! ./_freeGlobal */
  10170. "../../node_modules/lodash/_freeGlobal.js"
  10171. );
  10172. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  10173. var root = freeGlobal || freeSelf || Function("return this")();
  10174. module.exports = root;
  10175. }
  10176. ),
  10177. /***/
  10178. "../../node_modules/lodash/_trimmedEndIndex.js": (
  10179. /*!*****************************************************!*\
  10180. !*** ../../node_modules/lodash/_trimmedEndIndex.js ***!
  10181. \*****************************************************/
  10182. /***/
  10183. (module) => {
  10184. var reWhitespace = /\s/;
  10185. function trimmedEndIndex(string) {
  10186. var index = string.length;
  10187. while (index-- && reWhitespace.test(string.charAt(index))) {
  10188. }
  10189. return index;
  10190. }
  10191. module.exports = trimmedEndIndex;
  10192. }
  10193. ),
  10194. /***/
  10195. "../../node_modules/lodash/debounce.js": (
  10196. /*!*********************************************!*\
  10197. !*** ../../node_modules/lodash/debounce.js ***!
  10198. \*********************************************/
  10199. /***/
  10200. (module, __unused_webpack_exports, __webpack_require__2) => {
  10201. var isObject = __webpack_require__2(
  10202. /*! ./isObject */
  10203. "../../node_modules/lodash/isObject.js"
  10204. ), now = __webpack_require__2(
  10205. /*! ./now */
  10206. "../../node_modules/lodash/now.js"
  10207. ), toNumber = __webpack_require__2(
  10208. /*! ./toNumber */
  10209. "../../node_modules/lodash/toNumber.js"
  10210. );
  10211. var FUNC_ERROR_TEXT = "Expected a function";
  10212. var nativeMax = Math.max, nativeMin = Math.min;
  10213. function debounce(func, wait, options) {
  10214. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  10215. if (typeof func != "function") {
  10216. throw new TypeError(FUNC_ERROR_TEXT);
  10217. }
  10218. wait = toNumber(wait) || 0;
  10219. if (isObject(options)) {
  10220. leading = !!options.leading;
  10221. maxing = "maxWait" in options;
  10222. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10223. trailing = "trailing" in options ? !!options.trailing : trailing;
  10224. }
  10225. function invokeFunc(time) {
  10226. var args = lastArgs, thisArg = lastThis;
  10227. lastArgs = lastThis = void 0;
  10228. lastInvokeTime = time;
  10229. result = func.apply(thisArg, args);
  10230. return result;
  10231. }
  10232. function leadingEdge(time) {
  10233. lastInvokeTime = time;
  10234. timerId = setTimeout(timerExpired, wait);
  10235. return leading ? invokeFunc(time) : result;
  10236. }
  10237. function remainingWait(time) {
  10238. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  10239. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  10240. }
  10241. function shouldInvoke(time) {
  10242. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  10243. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  10244. }
  10245. function timerExpired() {
  10246. var time = now();
  10247. if (shouldInvoke(time)) {
  10248. return trailingEdge(time);
  10249. }
  10250. timerId = setTimeout(timerExpired, remainingWait(time));
  10251. }
  10252. function trailingEdge(time) {
  10253. timerId = void 0;
  10254. if (trailing && lastArgs) {
  10255. return invokeFunc(time);
  10256. }
  10257. lastArgs = lastThis = void 0;
  10258. return result;
  10259. }
  10260. function cancel() {
  10261. if (timerId !== void 0) {
  10262. clearTimeout(timerId);
  10263. }
  10264. lastInvokeTime = 0;
  10265. lastArgs = lastCallTime = lastThis = timerId = void 0;
  10266. }
  10267. function flush() {
  10268. return timerId === void 0 ? result : trailingEdge(now());
  10269. }
  10270. function debounced() {
  10271. var time = now(), isInvoking = shouldInvoke(time);
  10272. lastArgs = arguments;
  10273. lastThis = this;
  10274. lastCallTime = time;
  10275. if (isInvoking) {
  10276. if (timerId === void 0) {
  10277. return leadingEdge(lastCallTime);
  10278. }
  10279. if (maxing) {
  10280. clearTimeout(timerId);
  10281. timerId = setTimeout(timerExpired, wait);
  10282. return invokeFunc(lastCallTime);
  10283. }
  10284. }
  10285. if (timerId === void 0) {
  10286. timerId = setTimeout(timerExpired, wait);
  10287. }
  10288. return result;
  10289. }
  10290. debounced.cancel = cancel;
  10291. debounced.flush = flush;
  10292. return debounced;
  10293. }
  10294. module.exports = debounce;
  10295. }
  10296. ),
  10297. /***/
  10298. "../../node_modules/lodash/isObject.js": (
  10299. /*!*********************************************!*\
  10300. !*** ../../node_modules/lodash/isObject.js ***!
  10301. \*********************************************/
  10302. /***/
  10303. (module) => {
  10304. function isObject(value) {
  10305. var type = typeof value;
  10306. return value != null && (type == "object" || type == "function");
  10307. }
  10308. module.exports = isObject;
  10309. }
  10310. ),
  10311. /***/
  10312. "../../node_modules/lodash/isObjectLike.js": (
  10313. /*!*************************************************!*\
  10314. !*** ../../node_modules/lodash/isObjectLike.js ***!
  10315. \*************************************************/
  10316. /***/
  10317. (module) => {
  10318. function isObjectLike(value) {
  10319. return value != null && typeof value == "object";
  10320. }
  10321. module.exports = isObjectLike;
  10322. }
  10323. ),
  10324. /***/
  10325. "../../node_modules/lodash/isSymbol.js": (
  10326. /*!*********************************************!*\
  10327. !*** ../../node_modules/lodash/isSymbol.js ***!
  10328. \*********************************************/
  10329. /***/
  10330. (module, __unused_webpack_exports, __webpack_require__2) => {
  10331. var baseGetTag = __webpack_require__2(
  10332. /*! ./_baseGetTag */
  10333. "../../node_modules/lodash/_baseGetTag.js"
  10334. ), isObjectLike = __webpack_require__2(
  10335. /*! ./isObjectLike */
  10336. "../../node_modules/lodash/isObjectLike.js"
  10337. );
  10338. var symbolTag = "[object Symbol]";
  10339. function isSymbol(value) {
  10340. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  10341. }
  10342. module.exports = isSymbol;
  10343. }
  10344. ),
  10345. /***/
  10346. "../../node_modules/lodash/now.js": (
  10347. /*!****************************************!*\
  10348. !*** ../../node_modules/lodash/now.js ***!
  10349. \****************************************/
  10350. /***/
  10351. (module, __unused_webpack_exports, __webpack_require__2) => {
  10352. var root = __webpack_require__2(
  10353. /*! ./_root */
  10354. "../../node_modules/lodash/_root.js"
  10355. );
  10356. var now = function() {
  10357. return root.Date.now();
  10358. };
  10359. module.exports = now;
  10360. }
  10361. ),
  10362. /***/
  10363. "../../node_modules/lodash/throttle.js": (
  10364. /*!*********************************************!*\
  10365. !*** ../../node_modules/lodash/throttle.js ***!
  10366. \*********************************************/
  10367. /***/
  10368. (module, __unused_webpack_exports, __webpack_require__2) => {
  10369. var debounce = __webpack_require__2(
  10370. /*! ./debounce */
  10371. "../../node_modules/lodash/debounce.js"
  10372. ), isObject = __webpack_require__2(
  10373. /*! ./isObject */
  10374. "../../node_modules/lodash/isObject.js"
  10375. );
  10376. var FUNC_ERROR_TEXT = "Expected a function";
  10377. function throttle(func, wait, options) {
  10378. var leading = true, trailing = true;
  10379. if (typeof func != "function") {
  10380. throw new TypeError(FUNC_ERROR_TEXT);
  10381. }
  10382. if (isObject(options)) {
  10383. leading = "leading" in options ? !!options.leading : leading;
  10384. trailing = "trailing" in options ? !!options.trailing : trailing;
  10385. }
  10386. return debounce(func, wait, {
  10387. "leading": leading,
  10388. "maxWait": wait,
  10389. "trailing": trailing
  10390. });
  10391. }
  10392. module.exports = throttle;
  10393. }
  10394. ),
  10395. /***/
  10396. "../../node_modules/lodash/toNumber.js": (
  10397. /*!*********************************************!*\
  10398. !*** ../../node_modules/lodash/toNumber.js ***!
  10399. \*********************************************/
  10400. /***/
  10401. (module, __unused_webpack_exports, __webpack_require__2) => {
  10402. var baseTrim = __webpack_require__2(
  10403. /*! ./_baseTrim */
  10404. "../../node_modules/lodash/_baseTrim.js"
  10405. ), isObject = __webpack_require__2(
  10406. /*! ./isObject */
  10407. "../../node_modules/lodash/isObject.js"
  10408. ), isSymbol = __webpack_require__2(
  10409. /*! ./isSymbol */
  10410. "../../node_modules/lodash/isSymbol.js"
  10411. );
  10412. var NAN = 0 / 0;
  10413. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  10414. var reIsBinary = /^0b[01]+$/i;
  10415. var reIsOctal = /^0o[0-7]+$/i;
  10416. var freeParseInt = parseInt;
  10417. function toNumber(value) {
  10418. if (typeof value == "number") {
  10419. return value;
  10420. }
  10421. if (isSymbol(value)) {
  10422. return NAN;
  10423. }
  10424. if (isObject(value)) {
  10425. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  10426. value = isObject(other) ? other + "" : other;
  10427. }
  10428. if (typeof value != "string") {
  10429. return value === 0 ? value : +value;
  10430. }
  10431. value = baseTrim(value);
  10432. var isBinary = reIsBinary.test(value);
  10433. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  10434. }
  10435. module.exports = toNumber;
  10436. }
  10437. ),
  10438. /***/
  10439. "../../node_modules/path-browserify/index.js": (
  10440. /*!***************************************************!*\
  10441. !*** ../../node_modules/path-browserify/index.js ***!
  10442. \***************************************************/
  10443. /***/
  10444. (module) => {
  10445. function assertPath(path) {
  10446. if (typeof path !== "string") {
  10447. throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
  10448. }
  10449. }
  10450. function normalizeStringPosix(path, allowAboveRoot) {
  10451. var res = "";
  10452. var lastSegmentLength = 0;
  10453. var lastSlash = -1;
  10454. var dots = 0;
  10455. var code;
  10456. for (var i = 0; i <= path.length; ++i) {
  10457. if (i < path.length)
  10458. code = path.charCodeAt(i);
  10459. else if (code === 47)
  10460. break;
  10461. else
  10462. code = 47;
  10463. if (code === 47) {
  10464. if (lastSlash === i - 1 || dots === 1)
  10465. ;
  10466. else if (lastSlash !== i - 1 && dots === 2) {
  10467. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
  10468. if (res.length > 2) {
  10469. var lastSlashIndex = res.lastIndexOf("/");
  10470. if (lastSlashIndex !== res.length - 1) {
  10471. if (lastSlashIndex === -1) {
  10472. res = "";
  10473. lastSegmentLength = 0;
  10474. } else {
  10475. res = res.slice(0, lastSlashIndex);
  10476. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  10477. }
  10478. lastSlash = i;
  10479. dots = 0;
  10480. continue;
  10481. }
  10482. } else if (res.length === 2 || res.length === 1) {
  10483. res = "";
  10484. lastSegmentLength = 0;
  10485. lastSlash = i;
  10486. dots = 0;
  10487. continue;
  10488. }
  10489. }
  10490. if (allowAboveRoot) {
  10491. if (res.length > 0)
  10492. res += "/..";
  10493. else
  10494. res = "..";
  10495. lastSegmentLength = 2;
  10496. }
  10497. } else {
  10498. if (res.length > 0)
  10499. res += "/" + path.slice(lastSlash + 1, i);
  10500. else
  10501. res = path.slice(lastSlash + 1, i);
  10502. lastSegmentLength = i - lastSlash - 1;
  10503. }
  10504. lastSlash = i;
  10505. dots = 0;
  10506. } else if (code === 46 && dots !== -1) {
  10507. ++dots;
  10508. } else {
  10509. dots = -1;
  10510. }
  10511. }
  10512. return res;
  10513. }
  10514. function _format(sep, pathObject) {
  10515. var dir = pathObject.dir || pathObject.root;
  10516. var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  10517. if (!dir) {
  10518. return base;
  10519. }
  10520. if (dir === pathObject.root) {
  10521. return dir + base;
  10522. }
  10523. return dir + sep + base;
  10524. }
  10525. var posix = {
  10526. // path.resolve([from ...], to)
  10527. resolve: function resolve() {
  10528. var resolvedPath = "";
  10529. var resolvedAbsolute = false;
  10530. var cwd;
  10531. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  10532. var path;
  10533. if (i >= 0)
  10534. path = arguments[i];
  10535. else {
  10536. if (cwd === void 0)
  10537. cwd = process.cwd();
  10538. path = cwd;
  10539. }
  10540. assertPath(path);
  10541. if (path.length === 0) {
  10542. continue;
  10543. }
  10544. resolvedPath = path + "/" + resolvedPath;
  10545. resolvedAbsolute = path.charCodeAt(0) === 47;
  10546. }
  10547. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  10548. if (resolvedAbsolute) {
  10549. if (resolvedPath.length > 0)
  10550. return "/" + resolvedPath;
  10551. else
  10552. return "/";
  10553. } else if (resolvedPath.length > 0) {
  10554. return resolvedPath;
  10555. } else {
  10556. return ".";
  10557. }
  10558. },
  10559. normalize: function normalize(path) {
  10560. assertPath(path);
  10561. if (path.length === 0)
  10562. return ".";
  10563. var isAbsolute = path.charCodeAt(0) === 47;
  10564. var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  10565. path = normalizeStringPosix(path, !isAbsolute);
  10566. if (path.length === 0 && !isAbsolute)
  10567. path = ".";
  10568. if (path.length > 0 && trailingSeparator)
  10569. path += "/";
  10570. if (isAbsolute)
  10571. return "/" + path;
  10572. return path;
  10573. },
  10574. isAbsolute: function isAbsolute(path) {
  10575. assertPath(path);
  10576. return path.length > 0 && path.charCodeAt(0) === 47;
  10577. },
  10578. join: function join() {
  10579. if (arguments.length === 0)
  10580. return ".";
  10581. var joined;
  10582. for (var i = 0; i < arguments.length; ++i) {
  10583. var arg = arguments[i];
  10584. assertPath(arg);
  10585. if (arg.length > 0) {
  10586. if (joined === void 0)
  10587. joined = arg;
  10588. else
  10589. joined += "/" + arg;
  10590. }
  10591. }
  10592. if (joined === void 0)
  10593. return ".";
  10594. return posix.normalize(joined);
  10595. },
  10596. relative: function relative(from, to) {
  10597. assertPath(from);
  10598. assertPath(to);
  10599. if (from === to)
  10600. return "";
  10601. from = posix.resolve(from);
  10602. to = posix.resolve(to);
  10603. if (from === to)
  10604. return "";
  10605. var fromStart = 1;
  10606. for (; fromStart < from.length; ++fromStart) {
  10607. if (from.charCodeAt(fromStart) !== 47)
  10608. break;
  10609. }
  10610. var fromEnd = from.length;
  10611. var fromLen = fromEnd - fromStart;
  10612. var toStart = 1;
  10613. for (; toStart < to.length; ++toStart) {
  10614. if (to.charCodeAt(toStart) !== 47)
  10615. break;
  10616. }
  10617. var toEnd = to.length;
  10618. var toLen = toEnd - toStart;
  10619. var length = fromLen < toLen ? fromLen : toLen;
  10620. var lastCommonSep = -1;
  10621. var i = 0;
  10622. for (; i <= length; ++i) {
  10623. if (i === length) {
  10624. if (toLen > length) {
  10625. if (to.charCodeAt(toStart + i) === 47) {
  10626. return to.slice(toStart + i + 1);
  10627. } else if (i === 0) {
  10628. return to.slice(toStart + i);
  10629. }
  10630. } else if (fromLen > length) {
  10631. if (from.charCodeAt(fromStart + i) === 47) {
  10632. lastCommonSep = i;
  10633. } else if (i === 0) {
  10634. lastCommonSep = 0;
  10635. }
  10636. }
  10637. break;
  10638. }
  10639. var fromCode = from.charCodeAt(fromStart + i);
  10640. var toCode = to.charCodeAt(toStart + i);
  10641. if (fromCode !== toCode)
  10642. break;
  10643. else if (fromCode === 47)
  10644. lastCommonSep = i;
  10645. }
  10646. var out = "";
  10647. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  10648. if (i === fromEnd || from.charCodeAt(i) === 47) {
  10649. if (out.length === 0)
  10650. out += "..";
  10651. else
  10652. out += "/..";
  10653. }
  10654. }
  10655. if (out.length > 0)
  10656. return out + to.slice(toStart + lastCommonSep);
  10657. else {
  10658. toStart += lastCommonSep;
  10659. if (to.charCodeAt(toStart) === 47)
  10660. ++toStart;
  10661. return to.slice(toStart);
  10662. }
  10663. },
  10664. _makeLong: function _makeLong(path) {
  10665. return path;
  10666. },
  10667. dirname: function dirname(path) {
  10668. assertPath(path);
  10669. if (path.length === 0)
  10670. return ".";
  10671. var code = path.charCodeAt(0);
  10672. var hasRoot = code === 47;
  10673. var end = -1;
  10674. var matchedSlash = true;
  10675. for (var i = path.length - 1; i >= 1; --i) {
  10676. code = path.charCodeAt(i);
  10677. if (code === 47) {
  10678. if (!matchedSlash) {
  10679. end = i;
  10680. break;
  10681. }
  10682. } else {
  10683. matchedSlash = false;
  10684. }
  10685. }
  10686. if (end === -1)
  10687. return hasRoot ? "/" : ".";
  10688. if (hasRoot && end === 1)
  10689. return "//";
  10690. return path.slice(0, end);
  10691. },
  10692. basename: function basename(path, ext) {
  10693. if (ext !== void 0 && typeof ext !== "string")
  10694. throw new TypeError('"ext" argument must be a string');
  10695. assertPath(path);
  10696. var start = 0;
  10697. var end = -1;
  10698. var matchedSlash = true;
  10699. var i;
  10700. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  10701. if (ext.length === path.length && ext === path)
  10702. return "";
  10703. var extIdx = ext.length - 1;
  10704. var firstNonSlashEnd = -1;
  10705. for (i = path.length - 1; i >= 0; --i) {
  10706. var code = path.charCodeAt(i);
  10707. if (code === 47) {
  10708. if (!matchedSlash) {
  10709. start = i + 1;
  10710. break;
  10711. }
  10712. } else {
  10713. if (firstNonSlashEnd === -1) {
  10714. matchedSlash = false;
  10715. firstNonSlashEnd = i + 1;
  10716. }
  10717. if (extIdx >= 0) {
  10718. if (code === ext.charCodeAt(extIdx)) {
  10719. if (--extIdx === -1) {
  10720. end = i;
  10721. }
  10722. } else {
  10723. extIdx = -1;
  10724. end = firstNonSlashEnd;
  10725. }
  10726. }
  10727. }
  10728. }
  10729. if (start === end)
  10730. end = firstNonSlashEnd;
  10731. else if (end === -1)
  10732. end = path.length;
  10733. return path.slice(start, end);
  10734. } else {
  10735. for (i = path.length - 1; i >= 0; --i) {
  10736. if (path.charCodeAt(i) === 47) {
  10737. if (!matchedSlash) {
  10738. start = i + 1;
  10739. break;
  10740. }
  10741. } else if (end === -1) {
  10742. matchedSlash = false;
  10743. end = i + 1;
  10744. }
  10745. }
  10746. if (end === -1)
  10747. return "";
  10748. return path.slice(start, end);
  10749. }
  10750. },
  10751. extname: function extname(path) {
  10752. assertPath(path);
  10753. var startDot = -1;
  10754. var startPart = 0;
  10755. var end = -1;
  10756. var matchedSlash = true;
  10757. var preDotState = 0;
  10758. for (var i = path.length - 1; i >= 0; --i) {
  10759. var code = path.charCodeAt(i);
  10760. if (code === 47) {
  10761. if (!matchedSlash) {
  10762. startPart = i + 1;
  10763. break;
  10764. }
  10765. continue;
  10766. }
  10767. if (end === -1) {
  10768. matchedSlash = false;
  10769. end = i + 1;
  10770. }
  10771. if (code === 46) {
  10772. if (startDot === -1)
  10773. startDot = i;
  10774. else if (preDotState !== 1)
  10775. preDotState = 1;
  10776. } else if (startDot !== -1) {
  10777. preDotState = -1;
  10778. }
  10779. }
  10780. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  10781. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  10782. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10783. return "";
  10784. }
  10785. return path.slice(startDot, end);
  10786. },
  10787. format: function format(pathObject) {
  10788. if (pathObject === null || typeof pathObject !== "object") {
  10789. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  10790. }
  10791. return _format("/", pathObject);
  10792. },
  10793. parse: function parse(path) {
  10794. assertPath(path);
  10795. var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  10796. if (path.length === 0)
  10797. return ret;
  10798. var code = path.charCodeAt(0);
  10799. var isAbsolute = code === 47;
  10800. var start;
  10801. if (isAbsolute) {
  10802. ret.root = "/";
  10803. start = 1;
  10804. } else {
  10805. start = 0;
  10806. }
  10807. var startDot = -1;
  10808. var startPart = 0;
  10809. var end = -1;
  10810. var matchedSlash = true;
  10811. var i = path.length - 1;
  10812. var preDotState = 0;
  10813. for (; i >= start; --i) {
  10814. code = path.charCodeAt(i);
  10815. if (code === 47) {
  10816. if (!matchedSlash) {
  10817. startPart = i + 1;
  10818. break;
  10819. }
  10820. continue;
  10821. }
  10822. if (end === -1) {
  10823. matchedSlash = false;
  10824. end = i + 1;
  10825. }
  10826. if (code === 46) {
  10827. if (startDot === -1)
  10828. startDot = i;
  10829. else if (preDotState !== 1)
  10830. preDotState = 1;
  10831. } else if (startDot !== -1) {
  10832. preDotState = -1;
  10833. }
  10834. }
  10835. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  10836. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  10837. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10838. if (end !== -1) {
  10839. if (startPart === 0 && isAbsolute)
  10840. ret.base = ret.name = path.slice(1, end);
  10841. else
  10842. ret.base = ret.name = path.slice(startPart, end);
  10843. }
  10844. } else {
  10845. if (startPart === 0 && isAbsolute) {
  10846. ret.name = path.slice(1, startDot);
  10847. ret.base = path.slice(1, end);
  10848. } else {
  10849. ret.name = path.slice(startPart, startDot);
  10850. ret.base = path.slice(startPart, end);
  10851. }
  10852. ret.ext = path.slice(startDot, end);
  10853. }
  10854. if (startPart > 0)
  10855. ret.dir = path.slice(0, startPart - 1);
  10856. else if (isAbsolute)
  10857. ret.dir = "/";
  10858. return ret;
  10859. },
  10860. sep: "/",
  10861. delimiter: ":",
  10862. win32: null,
  10863. posix: null
  10864. };
  10865. posix.posix = posix;
  10866. module.exports = posix;
  10867. }
  10868. ),
  10869. /***/
  10870. "../../node_modules/speakingurl/index.js": (
  10871. /*!***********************************************!*\
  10872. !*** ../../node_modules/speakingurl/index.js ***!
  10873. \***********************************************/
  10874. /***/
  10875. (module, __unused_webpack_exports, __webpack_require__2) => {
  10876. module.exports = __webpack_require__2(
  10877. /*! ./lib/speakingurl */
  10878. "../../node_modules/speakingurl/lib/speakingurl.js"
  10879. );
  10880. }
  10881. ),
  10882. /***/
  10883. "../../node_modules/speakingurl/lib/speakingurl.js": (
  10884. /*!*********************************************************!*\
  10885. !*** ../../node_modules/speakingurl/lib/speakingurl.js ***!
  10886. \*********************************************************/
  10887. /***/
  10888. function(module, exports) {
  10889. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  10890. (function(root) {
  10891. var charMap = {
  10892. // latin
  10893. "À": "A",
  10894. "Á": "A",
  10895. "Â": "A",
  10896. "Ã": "A",
  10897. "Ä": "Ae",
  10898. "Å": "A",
  10899. "Æ": "AE",
  10900. "Ç": "C",
  10901. "È": "E",
  10902. "É": "E",
  10903. "Ê": "E",
  10904. "Ë": "E",
  10905. "Ì": "I",
  10906. "Í": "I",
  10907. "Î": "I",
  10908. "Ï": "I",
  10909. "Ð": "D",
  10910. "Ñ": "N",
  10911. "Ò": "O",
  10912. "Ó": "O",
  10913. "Ô": "O",
  10914. "Õ": "O",
  10915. "Ö": "Oe",
  10916. "Ő": "O",
  10917. "Ø": "O",
  10918. "Ù": "U",
  10919. "Ú": "U",
  10920. "Û": "U",
  10921. "Ü": "Ue",
  10922. "Ű": "U",
  10923. "Ý": "Y",
  10924. "Þ": "TH",
  10925. "ß": "ss",
  10926. "à": "a",
  10927. "á": "a",
  10928. "â": "a",
  10929. "ã": "a",
  10930. "ä": "ae",
  10931. "å": "a",
  10932. "æ": "ae",
  10933. "ç": "c",
  10934. "è": "e",
  10935. "é": "e",
  10936. "ê": "e",
  10937. "ë": "e",
  10938. "ì": "i",
  10939. "í": "i",
  10940. "î": "i",
  10941. "ï": "i",
  10942. "ð": "d",
  10943. "ñ": "n",
  10944. "ò": "o",
  10945. "ó": "o",
  10946. "ô": "o",
  10947. "õ": "o",
  10948. "ö": "oe",
  10949. "ő": "o",
  10950. "ø": "o",
  10951. "ù": "u",
  10952. "ú": "u",
  10953. "û": "u",
  10954. "ü": "ue",
  10955. "ű": "u",
  10956. "ý": "y",
  10957. "þ": "th",
  10958. "ÿ": "y",
  10959. "ẞ": "SS",
  10960. // language specific
  10961. // Arabic
  10962. "ا": "a",
  10963. "أ": "a",
  10964. "إ": "i",
  10965. "آ": "aa",
  10966. "ؤ": "u",
  10967. "ئ": "e",
  10968. "ء": "a",
  10969. "ب": "b",
  10970. "ت": "t",
  10971. "ث": "th",
  10972. "ج": "j",
  10973. "ح": "h",
  10974. "خ": "kh",
  10975. "د": "d",
  10976. "ذ": "th",
  10977. "ر": "r",
  10978. "ز": "z",
  10979. "س": "s",
  10980. "ش": "sh",
  10981. "ص": "s",
  10982. "ض": "dh",
  10983. "ط": "t",
  10984. "ظ": "z",
  10985. "ع": "a",
  10986. "غ": "gh",
  10987. "ف": "f",
  10988. "ق": "q",
  10989. "ك": "k",
  10990. "ل": "l",
  10991. "م": "m",
  10992. "ن": "n",
  10993. "ه": "h",
  10994. "و": "w",
  10995. "ي": "y",
  10996. "ى": "a",
  10997. "ة": "h",
  10998. "ﻻ": "la",
  10999. "ﻷ": "laa",
  11000. "ﻹ": "lai",
  11001. "ﻵ": "laa",
  11002. // Persian additional characters than Arabic
  11003. "گ": "g",
  11004. "چ": "ch",
  11005. "پ": "p",
  11006. "ژ": "zh",
  11007. "ک": "k",
  11008. "ی": "y",
  11009. // Arabic diactrics
  11010. "َ": "a",
  11011. "ً": "an",
  11012. "ِ": "e",
  11013. "ٍ": "en",
  11014. "ُ": "u",
  11015. "ٌ": "on",
  11016. "ْ": "",
  11017. // Arabic numbers
  11018. "٠": "0",
  11019. "١": "1",
  11020. "٢": "2",
  11021. "٣": "3",
  11022. "٤": "4",
  11023. "٥": "5",
  11024. "٦": "6",
  11025. "٧": "7",
  11026. "٨": "8",
  11027. "٩": "9",
  11028. // Persian numbers
  11029. "۰": "0",
  11030. "۱": "1",
  11031. "۲": "2",
  11032. "۳": "3",
  11033. "۴": "4",
  11034. "۵": "5",
  11035. "۶": "6",
  11036. "۷": "7",
  11037. "۸": "8",
  11038. "۹": "9",
  11039. // Burmese consonants
  11040. "က": "k",
  11041. "ခ": "kh",
  11042. "ဂ": "g",
  11043. "ဃ": "ga",
  11044. "င": "ng",
  11045. "စ": "s",
  11046. "ဆ": "sa",
  11047. "ဇ": "z",
  11048. "စျ": "za",
  11049. "ည": "ny",
  11050. "ဋ": "t",
  11051. "ဌ": "ta",
  11052. "ဍ": "d",
  11053. "ဎ": "da",
  11054. "ဏ": "na",
  11055. "တ": "t",
  11056. "ထ": "ta",
  11057. "ဒ": "d",
  11058. "ဓ": "da",
  11059. "န": "n",
  11060. "ပ": "p",
  11061. "ဖ": "pa",
  11062. "ဗ": "b",
  11063. "ဘ": "ba",
  11064. "မ": "m",
  11065. "ယ": "y",
  11066. "ရ": "ya",
  11067. "လ": "l",
  11068. "ဝ": "w",
  11069. "သ": "th",
  11070. "ဟ": "h",
  11071. "ဠ": "la",
  11072. "အ": "a",
  11073. // consonant character combos
  11074. "ြ": "y",
  11075. "ျ": "ya",
  11076. "ွ": "w",
  11077. "ြွ": "yw",
  11078. "ျွ": "ywa",
  11079. "ှ": "h",
  11080. // independent vowels
  11081. "ဧ": "e",
  11082. "၏": "-e",
  11083. "ဣ": "i",
  11084. "ဤ": "-i",
  11085. "ဉ": "u",
  11086. "ဦ": "-u",
  11087. "ဩ": "aw",
  11088. "သြော": "aw",
  11089. "ဪ": "aw",
  11090. // numbers
  11091. "၀": "0",
  11092. "၁": "1",
  11093. "၂": "2",
  11094. "၃": "3",
  11095. "၄": "4",
  11096. "၅": "5",
  11097. "၆": "6",
  11098. "၇": "7",
  11099. "၈": "8",
  11100. "၉": "9",
  11101. // virama and tone marks which are silent in transliteration
  11102. "္": "",
  11103. "့": "",
  11104. "း": "",
  11105. // Czech
  11106. "č": "c",
  11107. "ď": "d",
  11108. "ě": "e",
  11109. "ň": "n",
  11110. "ř": "r",
  11111. "š": "s",
  11112. "ť": "t",
  11113. "ů": "u",
  11114. "ž": "z",
  11115. "Č": "C",
  11116. "Ď": "D",
  11117. "Ě": "E",
  11118. "Ň": "N",
  11119. "Ř": "R",
  11120. "Š": "S",
  11121. "Ť": "T",
  11122. "Ů": "U",
  11123. "Ž": "Z",
  11124. // Dhivehi
  11125. "ހ": "h",
  11126. "ށ": "sh",
  11127. "ނ": "n",
  11128. "ރ": "r",
  11129. "ބ": "b",
  11130. "ޅ": "lh",
  11131. "ކ": "k",
  11132. "އ": "a",
  11133. "ވ": "v",
  11134. "މ": "m",
  11135. "ފ": "f",
  11136. "ދ": "dh",
  11137. "ތ": "th",
  11138. "ލ": "l",
  11139. "ގ": "g",
  11140. "ޏ": "gn",
  11141. "ސ": "s",
  11142. "ޑ": "d",
  11143. "ޒ": "z",
  11144. "ޓ": "t",
  11145. "ޔ": "y",
  11146. "ޕ": "p",
  11147. "ޖ": "j",
  11148. "ޗ": "ch",
  11149. "ޘ": "tt",
  11150. "ޙ": "hh",
  11151. "ޚ": "kh",
  11152. "ޛ": "th",
  11153. "ޜ": "z",
  11154. "ޝ": "sh",
  11155. "ޞ": "s",
  11156. "ޟ": "d",
  11157. "ޠ": "t",
  11158. "ޡ": "z",
  11159. "ޢ": "a",
  11160. "ޣ": "gh",
  11161. "ޤ": "q",
  11162. "ޥ": "w",
  11163. "ަ": "a",
  11164. "ާ": "aa",
  11165. "ި": "i",
  11166. "ީ": "ee",
  11167. "ު": "u",
  11168. "ޫ": "oo",
  11169. "ެ": "e",
  11170. "ޭ": "ey",
  11171. "ޮ": "o",
  11172. "ޯ": "oa",
  11173. "ް": "",
  11174. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  11175. // National system (2002)
  11176. "ა": "a",
  11177. "ბ": "b",
  11178. "გ": "g",
  11179. "დ": "d",
  11180. "ე": "e",
  11181. "ვ": "v",
  11182. "ზ": "z",
  11183. "თ": "t",
  11184. "ი": "i",
  11185. "კ": "k",
  11186. "ლ": "l",
  11187. "მ": "m",
  11188. "ნ": "n",
  11189. "ო": "o",
  11190. "პ": "p",
  11191. "ჟ": "zh",
  11192. "რ": "r",
  11193. "ს": "s",
  11194. "ტ": "t",
  11195. "უ": "u",
  11196. "ფ": "p",
  11197. "ქ": "k",
  11198. "ღ": "gh",
  11199. "ყ": "q",
  11200. "შ": "sh",
  11201. "ჩ": "ch",
  11202. "ც": "ts",
  11203. "ძ": "dz",
  11204. "წ": "ts",
  11205. "ჭ": "ch",
  11206. "ხ": "kh",
  11207. "ჯ": "j",
  11208. "ჰ": "h",
  11209. // Greek
  11210. "α": "a",
  11211. "β": "v",
  11212. "γ": "g",
  11213. "δ": "d",
  11214. "ε": "e",
  11215. "ζ": "z",
  11216. "η": "i",
  11217. "θ": "th",
  11218. "ι": "i",
  11219. "κ": "k",
  11220. "λ": "l",
  11221. "μ": "m",
  11222. "ν": "n",
  11223. "ξ": "ks",
  11224. "ο": "o",
  11225. "π": "p",
  11226. "ρ": "r",
  11227. "σ": "s",
  11228. "τ": "t",
  11229. "υ": "y",
  11230. "φ": "f",
  11231. "χ": "x",
  11232. "ψ": "ps",
  11233. "ω": "o",
  11234. "ά": "a",
  11235. "έ": "e",
  11236. "ί": "i",
  11237. "ό": "o",
  11238. "ύ": "y",
  11239. "ή": "i",
  11240. "ώ": "o",
  11241. "ς": "s",
  11242. "ϊ": "i",
  11243. "ΰ": "y",
  11244. "ϋ": "y",
  11245. "ΐ": "i",
  11246. "Α": "A",
  11247. "Β": "B",
  11248. "Γ": "G",
  11249. "Δ": "D",
  11250. "Ε": "E",
  11251. "Ζ": "Z",
  11252. "Η": "I",
  11253. "Θ": "TH",
  11254. "Ι": "I",
  11255. "Κ": "K",
  11256. "Λ": "L",
  11257. "Μ": "M",
  11258. "Ν": "N",
  11259. "Ξ": "KS",
  11260. "Ο": "O",
  11261. "Π": "P",
  11262. "Ρ": "R",
  11263. "Σ": "S",
  11264. "Τ": "T",
  11265. "Υ": "Y",
  11266. "Φ": "F",
  11267. "Χ": "X",
  11268. "Ψ": "PS",
  11269. "Ω": "O",
  11270. "Ά": "A",
  11271. "Έ": "E",
  11272. "Ί": "I",
  11273. "Ό": "O",
  11274. "Ύ": "Y",
  11275. "Ή": "I",
  11276. "Ώ": "O",
  11277. "Ϊ": "I",
  11278. "Ϋ": "Y",
  11279. // Latvian
  11280. "ā": "a",
  11281. // 'č': 'c', // duplicate
  11282. "ē": "e",
  11283. "ģ": "g",
  11284. "ī": "i",
  11285. "ķ": "k",
  11286. "ļ": "l",
  11287. "ņ": "n",
  11288. // 'š': 's', // duplicate
  11289. "ū": "u",
  11290. // 'ž': 'z', // duplicate
  11291. "Ā": "A",
  11292. // 'Č': 'C', // duplicate
  11293. "Ē": "E",
  11294. "Ģ": "G",
  11295. "Ī": "I",
  11296. "Ķ": "k",
  11297. "Ļ": "L",
  11298. "Ņ": "N",
  11299. // 'Š': 'S', // duplicate
  11300. "Ū": "U",
  11301. // 'Ž': 'Z', // duplicate
  11302. // Macedonian
  11303. "Ќ": "Kj",
  11304. "ќ": "kj",
  11305. "Љ": "Lj",
  11306. "љ": "lj",
  11307. "Њ": "Nj",
  11308. "њ": "nj",
  11309. "Тс": "Ts",
  11310. "тс": "ts",
  11311. // Polish
  11312. "ą": "a",
  11313. "ć": "c",
  11314. "ę": "e",
  11315. "ł": "l",
  11316. "ń": "n",
  11317. // 'ó': 'o', // duplicate
  11318. "ś": "s",
  11319. "ź": "z",
  11320. "ż": "z",
  11321. "Ą": "A",
  11322. "Ć": "C",
  11323. "Ę": "E",
  11324. "Ł": "L",
  11325. "Ń": "N",
  11326. "Ś": "S",
  11327. "Ź": "Z",
  11328. "Ż": "Z",
  11329. // Ukranian
  11330. "Є": "Ye",
  11331. "І": "I",
  11332. "Ї": "Yi",
  11333. "Ґ": "G",
  11334. "є": "ye",
  11335. "і": "i",
  11336. "ї": "yi",
  11337. "ґ": "g",
  11338. // Romanian
  11339. "ă": "a",
  11340. "Ă": "A",
  11341. "ș": "s",
  11342. "Ș": "S",
  11343. // 'ş': 's', // duplicate
  11344. // 'Ş': 'S', // duplicate
  11345. "ț": "t",
  11346. "Ț": "T",
  11347. "ţ": "t",
  11348. "Ţ": "T",
  11349. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  11350. // ICAO
  11351. "а": "a",
  11352. "б": "b",
  11353. "в": "v",
  11354. "г": "g",
  11355. "д": "d",
  11356. "е": "e",
  11357. "ё": "yo",
  11358. "ж": "zh",
  11359. "з": "z",
  11360. "и": "i",
  11361. "й": "i",
  11362. "к": "k",
  11363. "л": "l",
  11364. "м": "m",
  11365. "н": "n",
  11366. "о": "o",
  11367. "п": "p",
  11368. "р": "r",
  11369. "с": "s",
  11370. "т": "t",
  11371. "у": "u",
  11372. "ф": "f",
  11373. "х": "kh",
  11374. "ц": "c",
  11375. "ч": "ch",
  11376. "ш": "sh",
  11377. "щ": "sh",
  11378. "ъ": "",
  11379. "ы": "y",
  11380. "ь": "",
  11381. "э": "e",
  11382. "ю": "yu",
  11383. "я": "ya",
  11384. "А": "A",
  11385. "Б": "B",
  11386. "В": "V",
  11387. "Г": "G",
  11388. "Д": "D",
  11389. "Е": "E",
  11390. "Ё": "Yo",
  11391. "Ж": "Zh",
  11392. "З": "Z",
  11393. "И": "I",
  11394. "Й": "I",
  11395. "К": "K",
  11396. "Л": "L",
  11397. "М": "M",
  11398. "Н": "N",
  11399. "О": "O",
  11400. "П": "P",
  11401. "Р": "R",
  11402. "С": "S",
  11403. "Т": "T",
  11404. "У": "U",
  11405. "Ф": "F",
  11406. "Х": "Kh",
  11407. "Ц": "C",
  11408. "Ч": "Ch",
  11409. "Ш": "Sh",
  11410. "Щ": "Sh",
  11411. "Ъ": "",
  11412. "Ы": "Y",
  11413. "Ь": "",
  11414. "Э": "E",
  11415. "Ю": "Yu",
  11416. "Я": "Ya",
  11417. // Serbian
  11418. "ђ": "dj",
  11419. "ј": "j",
  11420. // 'љ': 'lj', // duplicate
  11421. // 'њ': 'nj', // duplicate
  11422. "ћ": "c",
  11423. "џ": "dz",
  11424. "Ђ": "Dj",
  11425. "Ј": "j",
  11426. // 'Љ': 'Lj', // duplicate
  11427. // 'Њ': 'Nj', // duplicate
  11428. "Ћ": "C",
  11429. "Џ": "Dz",
  11430. // Slovak
  11431. "ľ": "l",
  11432. "ĺ": "l",
  11433. "ŕ": "r",
  11434. "Ľ": "L",
  11435. "Ĺ": "L",
  11436. "Ŕ": "R",
  11437. // Turkish
  11438. "ş": "s",
  11439. "Ş": "S",
  11440. "ı": "i",
  11441. "İ": "I",
  11442. // 'ç': 'c', // duplicate
  11443. // 'Ç': 'C', // duplicate
  11444. // 'ü': 'u', // duplicate, see langCharMap
  11445. // 'Ü': 'U', // duplicate, see langCharMap
  11446. // 'ö': 'o', // duplicate, see langCharMap
  11447. // 'Ö': 'O', // duplicate, see langCharMap
  11448. "ğ": "g",
  11449. "Ğ": "G",
  11450. // Vietnamese
  11451. "ả": "a",
  11452. "Ả": "A",
  11453. "ẳ": "a",
  11454. "Ẳ": "A",
  11455. "ẩ": "a",
  11456. "Ẩ": "A",
  11457. "đ": "d",
  11458. "Đ": "D",
  11459. "ẹ": "e",
  11460. "Ẹ": "E",
  11461. "ẽ": "e",
  11462. "Ẽ": "E",
  11463. "ẻ": "e",
  11464. "Ẻ": "E",
  11465. "ế": "e",
  11466. "Ế": "E",
  11467. "ề": "e",
  11468. "Ề": "E",
  11469. "ệ": "e",
  11470. "Ệ": "E",
  11471. "ễ": "e",
  11472. "Ễ": "E",
  11473. "ể": "e",
  11474. "Ể": "E",
  11475. "ỏ": "o",
  11476. "ọ": "o",
  11477. "Ọ": "o",
  11478. "ố": "o",
  11479. "Ố": "O",
  11480. "ồ": "o",
  11481. "Ồ": "O",
  11482. "ổ": "o",
  11483. "Ổ": "O",
  11484. "ộ": "o",
  11485. "Ộ": "O",
  11486. "ỗ": "o",
  11487. "Ỗ": "O",
  11488. "ơ": "o",
  11489. "Ơ": "O",
  11490. "ớ": "o",
  11491. "Ớ": "O",
  11492. "ờ": "o",
  11493. "Ờ": "O",
  11494. "ợ": "o",
  11495. "Ợ": "O",
  11496. "ỡ": "o",
  11497. "Ỡ": "O",
  11498. "Ở": "o",
  11499. "ở": "o",
  11500. "ị": "i",
  11501. "Ị": "I",
  11502. "ĩ": "i",
  11503. "Ĩ": "I",
  11504. "ỉ": "i",
  11505. "Ỉ": "i",
  11506. "ủ": "u",
  11507. "Ủ": "U",
  11508. "ụ": "u",
  11509. "Ụ": "U",
  11510. "ũ": "u",
  11511. "Ũ": "U",
  11512. "ư": "u",
  11513. "Ư": "U",
  11514. "ứ": "u",
  11515. "Ứ": "U",
  11516. "ừ": "u",
  11517. "Ừ": "U",
  11518. "ự": "u",
  11519. "Ự": "U",
  11520. "ữ": "u",
  11521. "Ữ": "U",
  11522. "ử": "u",
  11523. "Ử": "ư",
  11524. "ỷ": "y",
  11525. "Ỷ": "y",
  11526. "ỳ": "y",
  11527. "Ỳ": "Y",
  11528. "ỵ": "y",
  11529. "Ỵ": "Y",
  11530. "ỹ": "y",
  11531. "Ỹ": "Y",
  11532. "ạ": "a",
  11533. "Ạ": "A",
  11534. "ấ": "a",
  11535. "Ấ": "A",
  11536. "ầ": "a",
  11537. "Ầ": "A",
  11538. "ậ": "a",
  11539. "Ậ": "A",
  11540. "ẫ": "a",
  11541. "Ẫ": "A",
  11542. // 'ă': 'a', // duplicate
  11543. // 'Ă': 'A', // duplicate
  11544. "ắ": "a",
  11545. "Ắ": "A",
  11546. "ằ": "a",
  11547. "Ằ": "A",
  11548. "ặ": "a",
  11549. "Ặ": "A",
  11550. "ẵ": "a",
  11551. "Ẵ": "A",
  11552. "⓪": "0",
  11553. "①": "1",
  11554. "②": "2",
  11555. "③": "3",
  11556. "④": "4",
  11557. "⑤": "5",
  11558. "⑥": "6",
  11559. "⑦": "7",
  11560. "⑧": "8",
  11561. "⑨": "9",
  11562. "⑩": "10",
  11563. "⑪": "11",
  11564. "⑫": "12",
  11565. "⑬": "13",
  11566. "⑭": "14",
  11567. "⑮": "15",
  11568. "⑯": "16",
  11569. "⑰": "17",
  11570. "⑱": "18",
  11571. "⑲": "18",
  11572. "⑳": "18",
  11573. "⓵": "1",
  11574. "⓶": "2",
  11575. "⓷": "3",
  11576. "⓸": "4",
  11577. "⓹": "5",
  11578. "⓺": "6",
  11579. "⓻": "7",
  11580. "⓼": "8",
  11581. "⓽": "9",
  11582. "⓾": "10",
  11583. "⓿": "0",
  11584. "⓫": "11",
  11585. "⓬": "12",
  11586. "⓭": "13",
  11587. "⓮": "14",
  11588. "⓯": "15",
  11589. "⓰": "16",
  11590. "⓱": "17",
  11591. "⓲": "18",
  11592. "⓳": "19",
  11593. "⓴": "20",
  11594. "Ⓐ": "A",
  11595. "Ⓑ": "B",
  11596. "Ⓒ": "C",
  11597. "Ⓓ": "D",
  11598. "Ⓔ": "E",
  11599. "Ⓕ": "F",
  11600. "Ⓖ": "G",
  11601. "Ⓗ": "H",
  11602. "Ⓘ": "I",
  11603. "Ⓙ": "J",
  11604. "Ⓚ": "K",
  11605. "Ⓛ": "L",
  11606. "Ⓜ": "M",
  11607. "Ⓝ": "N",
  11608. "Ⓞ": "O",
  11609. "Ⓟ": "P",
  11610. "Ⓠ": "Q",
  11611. "Ⓡ": "R",
  11612. "Ⓢ": "S",
  11613. "Ⓣ": "T",
  11614. "Ⓤ": "U",
  11615. "Ⓥ": "V",
  11616. "Ⓦ": "W",
  11617. "Ⓧ": "X",
  11618. "Ⓨ": "Y",
  11619. "Ⓩ": "Z",
  11620. "ⓐ": "a",
  11621. "ⓑ": "b",
  11622. "ⓒ": "c",
  11623. "ⓓ": "d",
  11624. "ⓔ": "e",
  11625. "ⓕ": "f",
  11626. "ⓖ": "g",
  11627. "ⓗ": "h",
  11628. "ⓘ": "i",
  11629. "ⓙ": "j",
  11630. "ⓚ": "k",
  11631. "ⓛ": "l",
  11632. "ⓜ": "m",
  11633. "ⓝ": "n",
  11634. "ⓞ": "o",
  11635. "ⓟ": "p",
  11636. "ⓠ": "q",
  11637. "ⓡ": "r",
  11638. "ⓢ": "s",
  11639. "ⓣ": "t",
  11640. "ⓤ": "u",
  11641. "ⓦ": "v",
  11642. "ⓥ": "w",
  11643. "ⓧ": "x",
  11644. "ⓨ": "y",
  11645. "ⓩ": "z",
  11646. // symbols
  11647. "“": '"',
  11648. "”": '"',
  11649. "‘": "'",
  11650. "’": "'",
  11651. "∂": "d",
  11652. "ƒ": "f",
  11653. "™": "(TM)",
  11654. "©": "(C)",
  11655. "œ": "oe",
  11656. "Œ": "OE",
  11657. "®": "(R)",
  11658. "†": "+",
  11659. "℠": "(SM)",
  11660. "…": "...",
  11661. "˚": "o",
  11662. "º": "o",
  11663. "ª": "a",
  11664. "•": "*",
  11665. "၊": ",",
  11666. "။": ".",
  11667. // currency
  11668. "$": "USD",
  11669. "€": "EUR",
  11670. "₢": "BRN",
  11671. "₣": "FRF",
  11672. "£": "GBP",
  11673. "₤": "ITL",
  11674. "₦": "NGN",
  11675. "₧": "ESP",
  11676. "₩": "KRW",
  11677. "₪": "ILS",
  11678. "₫": "VND",
  11679. "₭": "LAK",
  11680. "₮": "MNT",
  11681. "₯": "GRD",
  11682. "₱": "ARS",
  11683. "₲": "PYG",
  11684. "₳": "ARA",
  11685. "₴": "UAH",
  11686. "₵": "GHS",
  11687. "¢": "cent",
  11688. "¥": "CNY",
  11689. "元": "CNY",
  11690. "円": "YEN",
  11691. "﷼": "IRR",
  11692. "₠": "EWE",
  11693. "฿": "THB",
  11694. "₨": "INR",
  11695. "₹": "INR",
  11696. "₰": "PF",
  11697. "₺": "TRY",
  11698. "؋": "AFN",
  11699. "₼": "AZN",
  11700. "лв": "BGN",
  11701. "៛": "KHR",
  11702. "₡": "CRC",
  11703. "₸": "KZT",
  11704. "ден": "MKD",
  11705. "zł": "PLN",
  11706. "₽": "RUB",
  11707. "₾": "GEL"
  11708. };
  11709. var lookAheadCharArray = [
  11710. // burmese
  11711. "်",
  11712. // Dhivehi
  11713. "ް"
  11714. ];
  11715. var diatricMap = {
  11716. // Burmese
  11717. // dependent vowels
  11718. "ာ": "a",
  11719. "ါ": "a",
  11720. "ေ": "e",
  11721. "ဲ": "e",
  11722. "ိ": "i",
  11723. "ီ": "i",
  11724. "ို": "o",
  11725. "ု": "u",
  11726. "ူ": "u",
  11727. "ေါင်": "aung",
  11728. "ော": "aw",
  11729. "ော်": "aw",
  11730. "ေါ": "aw",
  11731. "ေါ်": "aw",
  11732. "်": "်",
  11733. // this is special case but the character will be converted to latin in the code
  11734. "က်": "et",
  11735. "ိုက်": "aik",
  11736. "ောက်": "auk",
  11737. "င်": "in",
  11738. "ိုင်": "aing",
  11739. "ောင်": "aung",
  11740. "စ်": "it",
  11741. "ည်": "i",
  11742. "တ်": "at",
  11743. "ိတ်": "eik",
  11744. "ုတ်": "ok",
  11745. "ွတ်": "ut",
  11746. "ေတ်": "it",
  11747. "ဒ်": "d",
  11748. "ိုဒ်": "ok",
  11749. "ုဒ်": "ait",
  11750. "န်": "an",
  11751. "ာန်": "an",
  11752. "ိန်": "ein",
  11753. "ုန်": "on",
  11754. "ွန်": "un",
  11755. "ပ်": "at",
  11756. "ိပ်": "eik",
  11757. "ုပ်": "ok",
  11758. "ွပ်": "ut",
  11759. "န်ုပ်": "nub",
  11760. "မ်": "an",
  11761. "ိမ်": "ein",
  11762. "ုမ်": "on",
  11763. "ွမ်": "un",
  11764. "ယ်": "e",
  11765. "ိုလ်": "ol",
  11766. "ဉ်": "in",
  11767. "ံ": "an",
  11768. "ိံ": "ein",
  11769. "ုံ": "on",
  11770. // Dhivehi
  11771. "ައް": "ah",
  11772. "ަށް": "ah"
  11773. };
  11774. var langCharMap = {
  11775. "en": {},
  11776. // default language
  11777. "az": {
  11778. // Azerbaijani
  11779. "ç": "c",
  11780. "ə": "e",
  11781. "ğ": "g",
  11782. "ı": "i",
  11783. "ö": "o",
  11784. "ş": "s",
  11785. "ü": "u",
  11786. "Ç": "C",
  11787. "Ə": "E",
  11788. "Ğ": "G",
  11789. "İ": "I",
  11790. "Ö": "O",
  11791. "Ş": "S",
  11792. "Ü": "U"
  11793. },
  11794. "cs": {
  11795. // Czech
  11796. "č": "c",
  11797. "ď": "d",
  11798. "ě": "e",
  11799. "ň": "n",
  11800. "ř": "r",
  11801. "š": "s",
  11802. "ť": "t",
  11803. "ů": "u",
  11804. "ž": "z",
  11805. "Č": "C",
  11806. "Ď": "D",
  11807. "Ě": "E",
  11808. "Ň": "N",
  11809. "Ř": "R",
  11810. "Š": "S",
  11811. "Ť": "T",
  11812. "Ů": "U",
  11813. "Ž": "Z"
  11814. },
  11815. "fi": {
  11816. // Finnish
  11817. // 'å': 'a', duplicate see charMap/latin
  11818. // 'Å': 'A', duplicate see charMap/latin
  11819. "ä": "a",
  11820. // ok
  11821. "Ä": "A",
  11822. // ok
  11823. "ö": "o",
  11824. // ok
  11825. "Ö": "O"
  11826. // ok
  11827. },
  11828. "hu": {
  11829. // Hungarian
  11830. "ä": "a",
  11831. // ok
  11832. "Ä": "A",
  11833. // ok
  11834. // 'á': 'a', duplicate see charMap/latin
  11835. // 'Á': 'A', duplicate see charMap/latin
  11836. "ö": "o",
  11837. // ok
  11838. "Ö": "O",
  11839. // ok
  11840. // 'ő': 'o', duplicate see charMap/latin
  11841. // 'Ő': 'O', duplicate see charMap/latin
  11842. "ü": "u",
  11843. "Ü": "U",
  11844. "ű": "u",
  11845. "Ű": "U"
  11846. },
  11847. "lt": {
  11848. // Lithuanian
  11849. "ą": "a",
  11850. "č": "c",
  11851. "ę": "e",
  11852. "ė": "e",
  11853. "į": "i",
  11854. "š": "s",
  11855. "ų": "u",
  11856. "ū": "u",
  11857. "ž": "z",
  11858. "Ą": "A",
  11859. "Č": "C",
  11860. "Ę": "E",
  11861. "Ė": "E",
  11862. "Į": "I",
  11863. "Š": "S",
  11864. "Ų": "U",
  11865. "Ū": "U"
  11866. },
  11867. "lv": {
  11868. // Latvian
  11869. "ā": "a",
  11870. "č": "c",
  11871. "ē": "e",
  11872. "ģ": "g",
  11873. "ī": "i",
  11874. "ķ": "k",
  11875. "ļ": "l",
  11876. "ņ": "n",
  11877. "š": "s",
  11878. "ū": "u",
  11879. "ž": "z",
  11880. "Ā": "A",
  11881. "Č": "C",
  11882. "Ē": "E",
  11883. "Ģ": "G",
  11884. "Ī": "i",
  11885. "Ķ": "k",
  11886. "Ļ": "L",
  11887. "Ņ": "N",
  11888. "Š": "S",
  11889. "Ū": "u",
  11890. "Ž": "Z"
  11891. },
  11892. "pl": {
  11893. // Polish
  11894. "ą": "a",
  11895. "ć": "c",
  11896. "ę": "e",
  11897. "ł": "l",
  11898. "ń": "n",
  11899. "ó": "o",
  11900. "ś": "s",
  11901. "ź": "z",
  11902. "ż": "z",
  11903. "Ą": "A",
  11904. "Ć": "C",
  11905. "Ę": "e",
  11906. "Ł": "L",
  11907. "Ń": "N",
  11908. "Ó": "O",
  11909. "Ś": "S",
  11910. "Ź": "Z",
  11911. "Ż": "Z"
  11912. },
  11913. "sv": {
  11914. // Swedish
  11915. // 'å': 'a', duplicate see charMap/latin
  11916. // 'Å': 'A', duplicate see charMap/latin
  11917. "ä": "a",
  11918. // ok
  11919. "Ä": "A",
  11920. // ok
  11921. "ö": "o",
  11922. // ok
  11923. "Ö": "O"
  11924. // ok
  11925. },
  11926. "sk": {
  11927. // Slovak
  11928. "ä": "a",
  11929. "Ä": "A"
  11930. },
  11931. "sr": {
  11932. // Serbian
  11933. "љ": "lj",
  11934. "њ": "nj",
  11935. "Љ": "Lj",
  11936. "Њ": "Nj",
  11937. "đ": "dj",
  11938. "Đ": "Dj"
  11939. },
  11940. "tr": {
  11941. // Turkish
  11942. "Ü": "U",
  11943. "Ö": "O",
  11944. "ü": "u",
  11945. "ö": "o"
  11946. }
  11947. };
  11948. var symbolMap = {
  11949. "ar": {
  11950. "∆": "delta",
  11951. "∞": "la-nihaya",
  11952. "♥": "hob",
  11953. "&": "wa",
  11954. "|": "aw",
  11955. "<": "aqal-men",
  11956. ">": "akbar-men",
  11957. "∑": "majmou",
  11958. "¤": "omla"
  11959. },
  11960. "az": {},
  11961. "ca": {
  11962. "∆": "delta",
  11963. "∞": "infinit",
  11964. "♥": "amor",
  11965. "&": "i",
  11966. "|": "o",
  11967. "<": "menys que",
  11968. ">": "mes que",
  11969. "∑": "suma dels",
  11970. "¤": "moneda"
  11971. },
  11972. "cs": {
  11973. "∆": "delta",
  11974. "∞": "nekonecno",
  11975. "♥": "laska",
  11976. "&": "a",
  11977. "|": "nebo",
  11978. "<": "mensi nez",
  11979. ">": "vetsi nez",
  11980. "∑": "soucet",
  11981. "¤": "mena"
  11982. },
  11983. "de": {
  11984. "∆": "delta",
  11985. "∞": "unendlich",
  11986. "♥": "Liebe",
  11987. "&": "und",
  11988. "|": "oder",
  11989. "<": "kleiner als",
  11990. ">": "groesser als",
  11991. "∑": "Summe von",
  11992. "¤": "Waehrung"
  11993. },
  11994. "dv": {
  11995. "∆": "delta",
  11996. "∞": "kolunulaa",
  11997. "♥": "loabi",
  11998. "&": "aai",
  11999. "|": "noonee",
  12000. "<": "ah vure kuda",
  12001. ">": "ah vure bodu",
  12002. "∑": "jumula",
  12003. "¤": "faisaa"
  12004. },
  12005. "en": {
  12006. "∆": "delta",
  12007. "∞": "infinity",
  12008. "♥": "love",
  12009. "&": "and",
  12010. "|": "or",
  12011. "<": "less than",
  12012. ">": "greater than",
  12013. "∑": "sum",
  12014. "¤": "currency"
  12015. },
  12016. "es": {
  12017. "∆": "delta",
  12018. "∞": "infinito",
  12019. "♥": "amor",
  12020. "&": "y",
  12021. "|": "u",
  12022. "<": "menos que",
  12023. ">": "mas que",
  12024. "∑": "suma de los",
  12025. "¤": "moneda"
  12026. },
  12027. "fa": {
  12028. "∆": "delta",
  12029. "∞": "bi-nahayat",
  12030. "♥": "eshgh",
  12031. "&": "va",
  12032. "|": "ya",
  12033. "<": "kamtar-az",
  12034. ">": "bishtar-az",
  12035. "∑": "majmooe",
  12036. "¤": "vahed"
  12037. },
  12038. "fi": {
  12039. "∆": "delta",
  12040. "∞": "aarettomyys",
  12041. "♥": "rakkaus",
  12042. "&": "ja",
  12043. "|": "tai",
  12044. "<": "pienempi kuin",
  12045. ">": "suurempi kuin",
  12046. "∑": "summa",
  12047. "¤": "valuutta"
  12048. },
  12049. "fr": {
  12050. "∆": "delta",
  12051. "∞": "infiniment",
  12052. "♥": "Amour",
  12053. "&": "et",
  12054. "|": "ou",
  12055. "<": "moins que",
  12056. ">": "superieure a",
  12057. "∑": "somme des",
  12058. "¤": "monnaie"
  12059. },
  12060. "ge": {
  12061. "∆": "delta",
  12062. "∞": "usasruloba",
  12063. "♥": "siqvaruli",
  12064. "&": "da",
  12065. "|": "an",
  12066. "<": "naklebi",
  12067. ">": "meti",
  12068. "∑": "jami",
  12069. "¤": "valuta"
  12070. },
  12071. "gr": {},
  12072. "hu": {
  12073. "∆": "delta",
  12074. "∞": "vegtelen",
  12075. "♥": "szerelem",
  12076. "&": "es",
  12077. "|": "vagy",
  12078. "<": "kisebb mint",
  12079. ">": "nagyobb mint",
  12080. "∑": "szumma",
  12081. "¤": "penznem"
  12082. },
  12083. "it": {
  12084. "∆": "delta",
  12085. "∞": "infinito",
  12086. "♥": "amore",
  12087. "&": "e",
  12088. "|": "o",
  12089. "<": "minore di",
  12090. ">": "maggiore di",
  12091. "∑": "somma",
  12092. "¤": "moneta"
  12093. },
  12094. "lt": {
  12095. "∆": "delta",
  12096. "∞": "begalybe",
  12097. "♥": "meile",
  12098. "&": "ir",
  12099. "|": "ar",
  12100. "<": "maziau nei",
  12101. ">": "daugiau nei",
  12102. "∑": "suma",
  12103. "¤": "valiuta"
  12104. },
  12105. "lv": {
  12106. "∆": "delta",
  12107. "∞": "bezgaliba",
  12108. "♥": "milestiba",
  12109. "&": "un",
  12110. "|": "vai",
  12111. "<": "mazak neka",
  12112. ">": "lielaks neka",
  12113. "∑": "summa",
  12114. "¤": "valuta"
  12115. },
  12116. "my": {
  12117. "∆": "kwahkhyaet",
  12118. "∞": "asaonasme",
  12119. "♥": "akhyait",
  12120. "&": "nhin",
  12121. "|": "tho",
  12122. "<": "ngethaw",
  12123. ">": "kyithaw",
  12124. "∑": "paungld",
  12125. "¤": "ngwekye"
  12126. },
  12127. "mk": {},
  12128. "nl": {
  12129. "∆": "delta",
  12130. "∞": "oneindig",
  12131. "♥": "liefde",
  12132. "&": "en",
  12133. "|": "of",
  12134. "<": "kleiner dan",
  12135. ">": "groter dan",
  12136. "∑": "som",
  12137. "¤": "valuta"
  12138. },
  12139. "pl": {
  12140. "∆": "delta",
  12141. "∞": "nieskonczonosc",
  12142. "♥": "milosc",
  12143. "&": "i",
  12144. "|": "lub",
  12145. "<": "mniejsze niz",
  12146. ">": "wieksze niz",
  12147. "∑": "suma",
  12148. "¤": "waluta"
  12149. },
  12150. "pt": {
  12151. "∆": "delta",
  12152. "∞": "infinito",
  12153. "♥": "amor",
  12154. "&": "e",
  12155. "|": "ou",
  12156. "<": "menor que",
  12157. ">": "maior que",
  12158. "∑": "soma",
  12159. "¤": "moeda"
  12160. },
  12161. "ro": {
  12162. "∆": "delta",
  12163. "∞": "infinit",
  12164. "♥": "dragoste",
  12165. "&": "si",
  12166. "|": "sau",
  12167. "<": "mai mic ca",
  12168. ">": "mai mare ca",
  12169. "∑": "suma",
  12170. "¤": "valuta"
  12171. },
  12172. "ru": {
  12173. "∆": "delta",
  12174. "∞": "beskonechno",
  12175. "♥": "lubov",
  12176. "&": "i",
  12177. "|": "ili",
  12178. "<": "menshe",
  12179. ">": "bolshe",
  12180. "∑": "summa",
  12181. "¤": "valjuta"
  12182. },
  12183. "sk": {
  12184. "∆": "delta",
  12185. "∞": "nekonecno",
  12186. "♥": "laska",
  12187. "&": "a",
  12188. "|": "alebo",
  12189. "<": "menej ako",
  12190. ">": "viac ako",
  12191. "∑": "sucet",
  12192. "¤": "mena"
  12193. },
  12194. "sr": {},
  12195. "tr": {
  12196. "∆": "delta",
  12197. "∞": "sonsuzluk",
  12198. "♥": "ask",
  12199. "&": "ve",
  12200. "|": "veya",
  12201. "<": "kucuktur",
  12202. ">": "buyuktur",
  12203. "∑": "toplam",
  12204. "¤": "para birimi"
  12205. },
  12206. "uk": {
  12207. "∆": "delta",
  12208. "∞": "bezkinechnist",
  12209. "♥": "lubov",
  12210. "&": "i",
  12211. "|": "abo",
  12212. "<": "menshe",
  12213. ">": "bilshe",
  12214. "∑": "suma",
  12215. "¤": "valjuta"
  12216. },
  12217. "vn": {
  12218. "∆": "delta",
  12219. "∞": "vo cuc",
  12220. "♥": "yeu",
  12221. "&": "va",
  12222. "|": "hoac",
  12223. "<": "nho hon",
  12224. ">": "lon hon",
  12225. "∑": "tong",
  12226. "¤": "tien te"
  12227. }
  12228. };
  12229. var uricChars = [";", "?", ":", "@", "&", "=", "+", "$", ",", "/"].join("");
  12230. var uricNoSlashChars = [";", "?", ":", "@", "&", "=", "+", "$", ","].join("");
  12231. var markChars = [".", "!", "~", "*", "'", "(", ")"].join("");
  12232. var getSlug = function getSlug2(input, opts) {
  12233. var separator = "-";
  12234. var result = "";
  12235. var diatricString = "";
  12236. var convertSymbols = true;
  12237. var customReplacements = {};
  12238. var maintainCase;
  12239. var titleCase;
  12240. var truncate;
  12241. var uricFlag;
  12242. var uricNoSlashFlag;
  12243. var markFlag;
  12244. var symbol;
  12245. var langChar;
  12246. var lucky;
  12247. var i;
  12248. var ch;
  12249. var l;
  12250. var lastCharWasSymbol;
  12251. var lastCharWasDiatric;
  12252. var allowedChars = "";
  12253. if (typeof input !== "string") {
  12254. return "";
  12255. }
  12256. if (typeof opts === "string") {
  12257. separator = opts;
  12258. }
  12259. symbol = symbolMap.en;
  12260. langChar = langCharMap.en;
  12261. if (typeof opts === "object") {
  12262. maintainCase = opts.maintainCase || false;
  12263. customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
  12264. truncate = +opts.truncate > 1 && opts.truncate || false;
  12265. uricFlag = opts.uric || false;
  12266. uricNoSlashFlag = opts.uricNoSlash || false;
  12267. markFlag = opts.mark || false;
  12268. convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
  12269. separator = opts.separator || separator;
  12270. if (uricFlag) {
  12271. allowedChars += uricChars;
  12272. }
  12273. if (uricNoSlashFlag) {
  12274. allowedChars += uricNoSlashChars;
  12275. }
  12276. if (markFlag) {
  12277. allowedChars += markChars;
  12278. }
  12279. symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
  12280. langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  12281. if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
  12282. opts.titleCase.forEach(function(v) {
  12283. customReplacements[v + ""] = v + "";
  12284. });
  12285. titleCase = true;
  12286. } else {
  12287. titleCase = !!opts.titleCase;
  12288. }
  12289. if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) {
  12290. opts.custom.forEach(function(v) {
  12291. customReplacements[v + ""] = v + "";
  12292. });
  12293. }
  12294. Object.keys(customReplacements).forEach(function(v) {
  12295. var r;
  12296. if (v.length > 1) {
  12297. r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
  12298. } else {
  12299. r = new RegExp(escapeChars(v), "gi");
  12300. }
  12301. input = input.replace(r, customReplacements[v]);
  12302. });
  12303. for (ch in customReplacements) {
  12304. allowedChars += ch;
  12305. }
  12306. }
  12307. allowedChars += separator;
  12308. allowedChars = escapeChars(allowedChars);
  12309. input = input.replace(/(^\s+|\s+$)/g, "");
  12310. lastCharWasSymbol = false;
  12311. lastCharWasDiatric = false;
  12312. for (i = 0, l = input.length; i < l; i++) {
  12313. ch = input[i];
  12314. if (isReplacedCustomChar(ch, customReplacements)) {
  12315. lastCharWasSymbol = false;
  12316. } else if (langChar[ch]) {
  12317. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
  12318. lastCharWasSymbol = false;
  12319. } else if (ch in charMap) {
  12320. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  12321. diatricString += ch;
  12322. ch = "";
  12323. } else if (lastCharWasDiatric === true) {
  12324. ch = diatricMap[diatricString] + charMap[ch];
  12325. diatricString = "";
  12326. } else {
  12327. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
  12328. }
  12329. lastCharWasSymbol = false;
  12330. lastCharWasDiatric = false;
  12331. } else if (ch in diatricMap) {
  12332. diatricString += ch;
  12333. ch = "";
  12334. if (i === l - 1) {
  12335. ch = diatricMap[diatricString];
  12336. }
  12337. lastCharWasDiatric = true;
  12338. } else if (
  12339. // process symbol chars
  12340. symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)
  12341. ) {
  12342. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  12343. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
  12344. lastCharWasSymbol = true;
  12345. } else {
  12346. if (lastCharWasDiatric === true) {
  12347. ch = diatricMap[diatricString] + ch;
  12348. diatricString = "";
  12349. lastCharWasDiatric = false;
  12350. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  12351. ch = " " + ch;
  12352. }
  12353. lastCharWasSymbol = false;
  12354. }
  12355. result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
  12356. }
  12357. if (titleCase) {
  12358. result = result.replace(/(\w)(\S*)/g, function(_, i2, r) {
  12359. var j = i2.toUpperCase() + (r !== null ? r : "");
  12360. return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
  12361. });
  12362. }
  12363. result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
  12364. if (truncate && result.length > truncate) {
  12365. lucky = result.charAt(truncate) === separator;
  12366. result = result.slice(0, truncate);
  12367. if (!lucky) {
  12368. result = result.slice(0, result.lastIndexOf(separator));
  12369. }
  12370. }
  12371. if (!maintainCase && !titleCase) {
  12372. result = result.toLowerCase();
  12373. }
  12374. return result;
  12375. };
  12376. var createSlug = function createSlug2(opts) {
  12377. return function getSlugWithConfig(input) {
  12378. return getSlug(input, opts);
  12379. };
  12380. };
  12381. var escapeChars = function escapeChars2(input) {
  12382. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
  12383. };
  12384. var isReplacedCustomChar = function(ch, customReplacements) {
  12385. for (var c in customReplacements) {
  12386. if (customReplacements[c] === ch) {
  12387. return true;
  12388. }
  12389. }
  12390. };
  12391. if (module.exports) {
  12392. module.exports = getSlug;
  12393. module.exports.createSlug = createSlug;
  12394. } else {
  12395. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  12396. return getSlug;
  12397. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  12398. }
  12399. })();
  12400. }
  12401. )
  12402. /******/
  12403. };
  12404. var __webpack_module_cache__ = {};
  12405. function __webpack_require__(moduleId) {
  12406. var cachedModule = __webpack_module_cache__[moduleId];
  12407. if (cachedModule !== void 0) {
  12408. return cachedModule.exports;
  12409. }
  12410. var module = __webpack_module_cache__[moduleId] = {
  12411. /******/
  12412. // no module.id needed
  12413. /******/
  12414. // no module.loaded needed
  12415. /******/
  12416. exports: {}
  12417. /******/
  12418. };
  12419. __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  12420. return module.exports;
  12421. }
  12422. (() => {
  12423. __webpack_require__.n = (module) => {
  12424. var getter = module && module.__esModule ? (
  12425. /******/
  12426. () => module["default"]
  12427. ) : (
  12428. /******/
  12429. () => module
  12430. );
  12431. __webpack_require__.d(getter, { a: getter });
  12432. return getter;
  12433. };
  12434. })();
  12435. (() => {
  12436. __webpack_require__.d = (exports, definition) => {
  12437. for (var key in definition) {
  12438. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  12439. Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  12440. }
  12441. }
  12442. };
  12443. })();
  12444. (() => {
  12445. __webpack_require__.g = function() {
  12446. if (typeof globalThis === "object")
  12447. return globalThis;
  12448. try {
  12449. return this || new Function("return this")();
  12450. } catch (e) {
  12451. if (typeof window === "object")
  12452. return window;
  12453. }
  12454. }();
  12455. })();
  12456. (() => {
  12457. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  12458. })();
  12459. (() => {
  12460. __webpack_require__.r = (exports) => {
  12461. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  12462. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  12463. }
  12464. Object.defineProperty(exports, "__esModule", { value: true });
  12465. };
  12466. })();
  12467. var __webpack_exports__ = {};
  12468. (() => {
  12469. /*!************************!*\
  12470. !*** ./src/backend.ts ***!
  12471. \************************/
  12472. __webpack_require__.r(__webpack_exports__);
  12473. var _back_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
  12474. /*! @back/index */
  12475. "../app-backend-core/lib/index.js"
  12476. );
  12477. var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
  12478. /*! @vue-devtools/shared-utils */
  12479. "../shared-utils/lib/index.js"
  12480. );
  12481. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_ON_SOCKET_READY__(() => {
  12482. const socket = _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_SOCKET__;
  12483. const connectedMessage = () => {
  12484. if (_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__) {
  12485. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__("Remote Devtools Connected", "normal");
  12486. }
  12487. };
  12488. const disconnectedMessage = () => {
  12489. if (_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__) {
  12490. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__("Remote Devtools Disconnected", "error");
  12491. }
  12492. };
  12493. socket.on("connect", () => {
  12494. connectedMessage();
  12495. (0, _back_index__WEBPACK_IMPORTED_MODULE_0__.initBackend)(bridge);
  12496. socket.emit("vue-devtools-init");
  12497. });
  12498. socket.on("disconnect", () => {
  12499. socket.disconnect();
  12500. disconnectedMessage();
  12501. });
  12502. socket.on("vue-devtools-disconnect-backend", () => {
  12503. socket.disconnect();
  12504. });
  12505. const bridge = new _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.Bridge({
  12506. listen(fn) {
  12507. socket.on("vue-message", (data) => fn(data));
  12508. },
  12509. send(data) {
  12510. socket.emit("vue-message", data);
  12511. }
  12512. });
  12513. bridge.on("shutdown", () => {
  12514. socket.disconnect();
  12515. disconnectedMessage();
  12516. });
  12517. });
  12518. })();
  12519. })();
  12520. Promise.resolve("./app.css.js").then(() => {
  12521. });