app-service.js 1008 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381
  1. if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
  2. Promise.prototype.finally = function(callback) {
  3. const promise = this.constructor;
  4. return this.then(
  5. (value) => promise.resolve(callback()).then(() => value),
  6. (reason) => promise.resolve(callback()).then(() => {
  7. throw reason;
  8. })
  9. );
  10. };
  11. }
  12. ;
  13. if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
  14. const global2 = uni.requireGlobal();
  15. ArrayBuffer = global2.ArrayBuffer;
  16. Int8Array = global2.Int8Array;
  17. Uint8Array = global2.Uint8Array;
  18. Uint8ClampedArray = global2.Uint8ClampedArray;
  19. Int16Array = global2.Int16Array;
  20. Uint16Array = global2.Uint16Array;
  21. Int32Array = global2.Int32Array;
  22. Uint32Array = global2.Uint32Array;
  23. Float32Array = global2.Float32Array;
  24. Float64Array = global2.Float64Array;
  25. BigInt64Array = global2.BigInt64Array;
  26. BigUint64Array = global2.BigUint64Array;
  27. }
  28. ;
  29. if (uni.restoreGlobal) {
  30. uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
  31. }
  32. (function(vue) {
  33. "use strict";
  34. function getTarget() {
  35. if (typeof window !== "undefined") {
  36. return window;
  37. }
  38. if (typeof globalThis !== "undefined") {
  39. return globalThis;
  40. }
  41. if (typeof global !== "undefined") {
  42. return global;
  43. }
  44. if (typeof my !== "undefined") {
  45. return my;
  46. }
  47. }
  48. class Socket {
  49. constructor(host) {
  50. this.sid = "";
  51. this.ackTimeout = 5e3;
  52. this.closed = false;
  53. this._ackTimer = 0;
  54. this._onCallbacks = {};
  55. this.host = host;
  56. setTimeout(() => {
  57. this.connect();
  58. }, 50);
  59. }
  60. connect() {
  61. this._socket = uni.connectSocket({
  62. url: `ws://${this.host}/socket.io/?EIO=4&transport=websocket`,
  63. multiple: true,
  64. complete(res) {
  65. }
  66. });
  67. this._socket.onOpen((res) => {
  68. });
  69. this._socket.onMessage(({ data }) => {
  70. if (typeof my !== "undefined") {
  71. data = data.data;
  72. }
  73. if (typeof data !== "string") {
  74. return;
  75. }
  76. if (data[0] === "0") {
  77. this._send("40");
  78. const res = JSON.parse(data.slice(1));
  79. this.sid = res.sid;
  80. } else if (data[0] + data[1] === "40") {
  81. this.sid = JSON.parse(data.slice(2)).sid;
  82. this._trigger("connect");
  83. } else if (data === "3") {
  84. this._send("2");
  85. } else if (data === "2") {
  86. this._send("3");
  87. } else {
  88. const match = /\[.*\]/.exec(data);
  89. if (!match)
  90. return;
  91. try {
  92. const [event, args] = JSON.parse(match[0]);
  93. this._trigger(event, args);
  94. } catch (err) {
  95. console.error("Vue DevTools onMessage: ", err);
  96. }
  97. }
  98. });
  99. this._socket.onClose((res) => {
  100. this.closed = true;
  101. this._trigger("disconnect", res);
  102. });
  103. this._socket.onError((res) => {
  104. console.error(res.errMsg);
  105. });
  106. }
  107. on(event, callback) {
  108. (this._onCallbacks[event] || (this._onCallbacks[event] = [])).push(callback);
  109. }
  110. emit(event, data) {
  111. if (this.closed) {
  112. return;
  113. }
  114. this._heartbeat();
  115. this._send(`42${JSON.stringify(typeof data !== "undefined" ? [event, data] : [event])}`);
  116. }
  117. disconnect() {
  118. clearTimeout(this._ackTimer);
  119. if (this._socket && !this.closed) {
  120. this._send("41");
  121. this._socket.close({});
  122. }
  123. }
  124. _heartbeat() {
  125. clearTimeout(this._ackTimer);
  126. this._ackTimer = setTimeout(() => {
  127. this._socket && this._socket.send({ data: "3" });
  128. }, this.ackTimeout);
  129. }
  130. _send(data) {
  131. this._socket && this._socket.send({ data });
  132. }
  133. _trigger(event, args) {
  134. const callbacks = this._onCallbacks[event];
  135. if (callbacks) {
  136. callbacks.forEach((callback) => {
  137. callback(args);
  138. });
  139. }
  140. }
  141. }
  142. let socketReadyCallback;
  143. getTarget().__VUE_DEVTOOLS_ON_SOCKET_READY__ = (callback) => {
  144. socketReadyCallback = callback;
  145. };
  146. let targetHost = "";
  147. const hosts = "169.254.83.107,192.168.0.196,192.168.192.38,192.168.56.1,192.168.119.1,172.26.240.1".split(",");
  148. setTimeout(() => {
  149. uni.request({
  150. url: `http://${"localhost"}:${9500}`,
  151. timeout: 1e3,
  152. success() {
  153. targetHost = "localhost";
  154. initSocket();
  155. },
  156. fail() {
  157. if (!targetHost && hosts.length) {
  158. hosts.forEach((host) => {
  159. uni.request({
  160. url: `http://${host}:${9500}`,
  161. timeout: 1e3,
  162. success() {
  163. if (!targetHost) {
  164. targetHost = host;
  165. initSocket();
  166. }
  167. }
  168. });
  169. });
  170. }
  171. }
  172. });
  173. }, 0);
  174. throwConnectionError();
  175. function throwConnectionError() {
  176. setTimeout(() => {
  177. if (!targetHost) {
  178. throw new Error("未能获取局域网地址,本地调试服务不可用");
  179. }
  180. }, (hosts.length + 1) * 1100);
  181. }
  182. function initSocket() {
  183. getTarget().__VUE_DEVTOOLS_SOCKET__ = new Socket(targetHost + ":8098");
  184. socketReadyCallback();
  185. }
  186. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  187. function getDefaultExportFromCjs(x) {
  188. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  189. }
  190. (function() {
  191. var __webpack_modules__ = {
  192. /***/
  193. "../app-backend-core/lib/hook.js": (
  194. /*!***************************************!*\
  195. !*** ../app-backend-core/lib/hook.js ***!
  196. \***************************************/
  197. /***/
  198. (__unused_webpack_module, exports, __webpack_require__2) => {
  199. Object.defineProperty(exports, "__esModule", {
  200. value: true
  201. });
  202. exports.installHook = void 0;
  203. function installHook(target, isIframe = false) {
  204. const devtoolsVersion = "6.0";
  205. let listeners = {};
  206. function injectIframeHook(iframe) {
  207. if (iframe.__vdevtools__injected)
  208. return;
  209. try {
  210. iframe.__vdevtools__injected = true;
  211. const inject = () => {
  212. try {
  213. iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
  214. const script = iframe.contentDocument.createElement("script");
  215. script.textContent = ";(" + installHook.toString() + ")(window, true)";
  216. iframe.contentDocument.documentElement.appendChild(script);
  217. script.parentNode.removeChild(script);
  218. } catch (e2) {
  219. }
  220. };
  221. inject();
  222. iframe.addEventListener("load", () => inject());
  223. } catch (e2) {
  224. }
  225. }
  226. let iframeChecks = 0;
  227. function injectToIframes() {
  228. if (typeof window === "undefined")
  229. return;
  230. const iframes = document.querySelectorAll("iframe:not([data-vue-devtools-ignore])");
  231. for (const iframe of iframes) {
  232. injectIframeHook(iframe);
  233. }
  234. }
  235. injectToIframes();
  236. const iframeTimer = setInterval(() => {
  237. injectToIframes();
  238. iframeChecks++;
  239. if (iframeChecks >= 5) {
  240. clearInterval(iframeTimer);
  241. }
  242. }, 1e3);
  243. if (Object.prototype.hasOwnProperty.call(target, "__VUE_DEVTOOLS_GLOBAL_HOOK__")) {
  244. if (target.__VUE_DEVTOOLS_GLOBAL_HOOK__.devtoolsVersion !== devtoolsVersion) {
  245. console.error(`Another version of Vue Devtools seems to be installed. Please enable only one version at a time.`);
  246. }
  247. return;
  248. }
  249. let hook;
  250. if (isIframe) {
  251. const sendToParent = (cb) => {
  252. try {
  253. const hook2 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  254. if (hook2) {
  255. return cb(hook2);
  256. } else {
  257. console.warn("[Vue Devtools] No hook in parent window");
  258. }
  259. } catch (e2) {
  260. console.warn("[Vue Devtools] Failed to send message to parent window", e2);
  261. }
  262. };
  263. hook = {
  264. devtoolsVersion,
  265. // eslint-disable-next-line accessor-pairs
  266. set Vue(value) {
  267. sendToParent((hook2) => {
  268. hook2.Vue = value;
  269. });
  270. },
  271. // eslint-disable-next-line accessor-pairs
  272. set enabled(value) {
  273. sendToParent((hook2) => {
  274. hook2.enabled = value;
  275. });
  276. },
  277. on(event, fn) {
  278. sendToParent((hook2) => hook2.on(event, fn));
  279. },
  280. once(event, fn) {
  281. sendToParent((hook2) => hook2.once(event, fn));
  282. },
  283. off(event, fn) {
  284. sendToParent((hook2) => hook2.off(event, fn));
  285. },
  286. emit(event, ...args) {
  287. sendToParent((hook2) => hook2.emit(event, ...args));
  288. },
  289. cleanupBuffer(matchArg) {
  290. var _a;
  291. return (_a = sendToParent((hook2) => hook2.cleanupBuffer(matchArg))) !== null && _a !== void 0 ? _a : false;
  292. }
  293. };
  294. } else {
  295. hook = {
  296. devtoolsVersion,
  297. Vue: null,
  298. enabled: void 0,
  299. _buffer: [],
  300. store: null,
  301. initialState: null,
  302. storeModules: null,
  303. flushStoreModules: null,
  304. apps: [],
  305. _replayBuffer(event) {
  306. const buffer = this._buffer;
  307. this._buffer = [];
  308. for (let i2 = 0, l2 = buffer.length; i2 < l2; i2++) {
  309. const allArgs = buffer[i2];
  310. allArgs[0] === event ? this.emit.apply(this, allArgs) : this._buffer.push(allArgs);
  311. }
  312. },
  313. on(event, fn) {
  314. const $event = "$" + event;
  315. if (listeners[$event]) {
  316. listeners[$event].push(fn);
  317. } else {
  318. listeners[$event] = [fn];
  319. this._replayBuffer(event);
  320. }
  321. },
  322. once(event, fn) {
  323. const on = (...args) => {
  324. this.off(event, on);
  325. return fn.apply(this, args);
  326. };
  327. this.on(event, on);
  328. },
  329. off(event, fn) {
  330. event = "$" + event;
  331. if (!arguments.length) {
  332. listeners = {};
  333. } else {
  334. const cbs = listeners[event];
  335. if (cbs) {
  336. if (!fn) {
  337. listeners[event] = null;
  338. } else {
  339. for (let i2 = 0, l2 = cbs.length; i2 < l2; i2++) {
  340. const cb = cbs[i2];
  341. if (cb === fn || cb.fn === fn) {
  342. cbs.splice(i2, 1);
  343. break;
  344. }
  345. }
  346. }
  347. }
  348. }
  349. },
  350. emit(event, ...args) {
  351. const $event = "$" + event;
  352. let cbs = listeners[$event];
  353. if (cbs) {
  354. cbs = cbs.slice();
  355. for (let i2 = 0, l2 = cbs.length; i2 < l2; i2++) {
  356. try {
  357. const result = cbs[i2].apply(this, args);
  358. if (typeof (result === null || result === void 0 ? void 0 : result.catch) === "function") {
  359. result.catch((e2) => {
  360. console.error(`[Hook] Error in async event handler for ${event} with args:`, args);
  361. console.error(e2);
  362. });
  363. }
  364. } catch (e2) {
  365. console.error(`[Hook] Error in event handler for ${event} with args:`, args);
  366. console.error(e2);
  367. }
  368. }
  369. } else {
  370. this._buffer.push([event, ...args]);
  371. }
  372. },
  373. /**
  374. * Remove buffered events with any argument that is equal to the given value.
  375. * @param matchArg Given value to match.
  376. */
  377. cleanupBuffer(matchArg) {
  378. let wasBuffered = false;
  379. this._buffer = this._buffer.filter((item) => {
  380. if (item.some((arg) => arg === matchArg)) {
  381. wasBuffered = true;
  382. return false;
  383. }
  384. return true;
  385. });
  386. return wasBuffered;
  387. }
  388. };
  389. hook.once("init", (Vue2) => {
  390. hook.Vue = Vue2;
  391. if (Vue2) {
  392. Vue2.prototype.$inspect = function() {
  393. const fn = target.__VUE_DEVTOOLS_INSPECT__;
  394. fn && fn(this);
  395. };
  396. }
  397. });
  398. hook.on("app:init", (app, version, types2) => {
  399. const appRecord = {
  400. app,
  401. version,
  402. types: types2
  403. };
  404. hook.apps.push(appRecord);
  405. hook.emit("app:add", appRecord);
  406. });
  407. hook.once("vuex:init", (store) => {
  408. hook.store = store;
  409. hook.initialState = clone(store.state);
  410. const origReplaceState = store.replaceState.bind(store);
  411. store.replaceState = (state) => {
  412. hook.initialState = clone(state);
  413. origReplaceState(state);
  414. };
  415. let origRegister, origUnregister;
  416. if (store.registerModule) {
  417. hook.storeModules = [];
  418. origRegister = store.registerModule.bind(store);
  419. store.registerModule = (path, module, options) => {
  420. if (typeof path === "string")
  421. path = [path];
  422. hook.storeModules.push({
  423. path,
  424. module,
  425. options
  426. });
  427. origRegister(path, module, options);
  428. {
  429. console.log("early register module", path, module, options);
  430. }
  431. };
  432. origUnregister = store.unregisterModule.bind(store);
  433. store.unregisterModule = (path) => {
  434. if (typeof path === "string")
  435. path = [path];
  436. const key = path.join("/");
  437. const index = hook.storeModules.findIndex((m2) => m2.path.join("/") === key);
  438. if (index !== -1)
  439. hook.storeModules.splice(index, 1);
  440. origUnregister(path);
  441. {
  442. console.log("early unregister module", path);
  443. }
  444. };
  445. }
  446. hook.flushStoreModules = () => {
  447. store.replaceState = origReplaceState;
  448. if (store.registerModule) {
  449. store.registerModule = origRegister;
  450. store.unregisterModule = origUnregister;
  451. }
  452. return hook.storeModules || [];
  453. };
  454. });
  455. }
  456. {
  457. uni.syncDataToGlobal({
  458. __VUE_DEVTOOLS_GLOBAL_HOOK__: hook
  459. });
  460. }
  461. Object.defineProperty(target, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
  462. get() {
  463. return hook;
  464. }
  465. });
  466. if (target.__VUE_DEVTOOLS_HOOK_REPLAY__) {
  467. try {
  468. target.__VUE_DEVTOOLS_HOOK_REPLAY__.forEach((cb) => cb(hook));
  469. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = [];
  470. } catch (e2) {
  471. console.error("[vue-devtools] Error during hook replay", e2);
  472. }
  473. }
  474. const {
  475. toString: toStringFunction
  476. } = Function.prototype;
  477. const {
  478. create,
  479. defineProperty,
  480. getOwnPropertyDescriptor,
  481. getOwnPropertyNames,
  482. getOwnPropertySymbols,
  483. getPrototypeOf
  484. } = Object;
  485. const {
  486. hasOwnProperty: hasOwnProperty2,
  487. propertyIsEnumerable
  488. } = Object.prototype;
  489. const SUPPORTS = {
  490. SYMBOL_PROPERTIES: typeof getOwnPropertySymbols === "function",
  491. WEAKSET: typeof WeakSet === "function"
  492. };
  493. const createCache = () => {
  494. if (SUPPORTS.WEAKSET) {
  495. return /* @__PURE__ */ new WeakSet();
  496. }
  497. const object = create({
  498. add: (value) => object._values.push(value),
  499. has: (value) => !!~object._values.indexOf(value)
  500. });
  501. object._values = [];
  502. return object;
  503. };
  504. const getCleanClone = (object, realm) => {
  505. if (!object.constructor) {
  506. return create(null);
  507. }
  508. const prototype = object.__proto__ || getPrototypeOf(object);
  509. if (object.constructor === realm.Object) {
  510. return prototype === realm.Object.prototype ? {} : create(prototype);
  511. }
  512. if (~toStringFunction.call(object.constructor).indexOf("[native code]")) {
  513. try {
  514. return new object.constructor();
  515. } catch (e2) {
  516. }
  517. }
  518. return create(prototype);
  519. };
  520. const getObjectCloneLoose = (object, realm, handleCopy, cache) => {
  521. const clone2 = getCleanClone(object, realm);
  522. for (const key in object) {
  523. if (hasOwnProperty2.call(object, key)) {
  524. clone2[key] = handleCopy(object[key], cache);
  525. }
  526. }
  527. if (SUPPORTS.SYMBOL_PROPERTIES) {
  528. const symbols = getOwnPropertySymbols(object);
  529. if (symbols.length) {
  530. for (let index = 0, symbol; index < symbols.length; index++) {
  531. symbol = symbols[index];
  532. if (propertyIsEnumerable.call(object, symbol)) {
  533. clone2[symbol] = handleCopy(object[symbol], cache);
  534. }
  535. }
  536. }
  537. }
  538. return clone2;
  539. };
  540. const getObjectCloneStrict = (object, realm, handleCopy, cache) => {
  541. const clone2 = getCleanClone(object, realm);
  542. const properties = SUPPORTS.SYMBOL_PROPERTIES ? [].concat(getOwnPropertyNames(object), getOwnPropertySymbols(object)) : getOwnPropertyNames(object);
  543. if (properties.length) {
  544. for (let index = 0, property, descriptor; index < properties.length; index++) {
  545. property = properties[index];
  546. if (property !== "callee" && property !== "caller") {
  547. descriptor = getOwnPropertyDescriptor(object, property);
  548. descriptor.value = handleCopy(object[property], cache);
  549. defineProperty(clone2, property, descriptor);
  550. }
  551. }
  552. }
  553. return clone2;
  554. };
  555. const getRegExpFlags = (regExp) => {
  556. let flags = "";
  557. if (regExp.global) {
  558. flags += "g";
  559. }
  560. if (regExp.ignoreCase) {
  561. flags += "i";
  562. }
  563. if (regExp.multiline) {
  564. flags += "m";
  565. }
  566. if (regExp.unicode) {
  567. flags += "u";
  568. }
  569. if (regExp.sticky) {
  570. flags += "y";
  571. }
  572. return flags;
  573. };
  574. const {
  575. isArray
  576. } = Array;
  577. const GLOBAL_THIS = (() => {
  578. if (typeof self !== "undefined") {
  579. return self;
  580. }
  581. if (typeof window !== "undefined") {
  582. return window;
  583. }
  584. if (typeof __webpack_require__2.g !== "undefined") {
  585. return __webpack_require__2.g;
  586. }
  587. if (console && console.error) {
  588. console.error('Unable to locate global object, returning "this".');
  589. }
  590. })();
  591. function clone(object, options = null) {
  592. const isStrict = !!(options && options.isStrict);
  593. const realm = options && options.realm || GLOBAL_THIS;
  594. const getObjectClone = isStrict ? getObjectCloneStrict : getObjectCloneLoose;
  595. const handleCopy = (object2, cache) => {
  596. if (!object2 || typeof object2 !== "object" || cache.has(object2)) {
  597. return object2;
  598. }
  599. if (typeof HTMLElement !== "undefined" && object2 instanceof HTMLElement) {
  600. return object2.cloneNode(false);
  601. }
  602. const Constructor = object2.constructor;
  603. if (Constructor === realm.Object) {
  604. cache.add(object2);
  605. return getObjectClone(object2, realm, handleCopy, cache);
  606. }
  607. let clone2;
  608. if (isArray(object2)) {
  609. cache.add(object2);
  610. if (isStrict) {
  611. return getObjectCloneStrict(object2, realm, handleCopy, cache);
  612. }
  613. clone2 = new Constructor();
  614. for (let index = 0; index < object2.length; index++) {
  615. clone2[index] = handleCopy(object2[index], cache);
  616. }
  617. return clone2;
  618. }
  619. if (object2 instanceof realm.Date) {
  620. return new Constructor(object2.getTime());
  621. }
  622. if (object2 instanceof realm.RegExp) {
  623. clone2 = new Constructor(object2.source, object2.flags || getRegExpFlags(object2));
  624. clone2.lastIndex = object2.lastIndex;
  625. return clone2;
  626. }
  627. if (realm.Map && object2 instanceof realm.Map) {
  628. cache.add(object2);
  629. clone2 = new Constructor();
  630. object2.forEach((value, key) => {
  631. clone2.set(key, handleCopy(value, cache));
  632. });
  633. return clone2;
  634. }
  635. if (realm.Set && object2 instanceof realm.Set) {
  636. cache.add(object2);
  637. clone2 = new Constructor();
  638. object2.forEach((value) => {
  639. clone2.add(handleCopy(value, cache));
  640. });
  641. return clone2;
  642. }
  643. if (realm.Buffer && realm.Buffer.isBuffer(object2)) {
  644. clone2 = realm.Buffer.allocUnsafe ? realm.Buffer.allocUnsafe(object2.length) : new Constructor(object2.length);
  645. object2.copy(clone2);
  646. return clone2;
  647. }
  648. if (realm.ArrayBuffer) {
  649. if (realm.ArrayBuffer.isView(object2)) {
  650. return new Constructor(object2.buffer.slice(0));
  651. }
  652. if (object2 instanceof realm.ArrayBuffer) {
  653. return object2.slice(0);
  654. }
  655. }
  656. if (
  657. // promise-like
  658. hasOwnProperty2.call(object2, "then") && typeof object2.then === "function" || // errors
  659. object2 instanceof Error || // weakmaps
  660. realm.WeakMap && object2 instanceof realm.WeakMap || // weaksets
  661. realm.WeakSet && object2 instanceof realm.WeakSet
  662. ) {
  663. return object2;
  664. }
  665. cache.add(object2);
  666. return getObjectClone(object2, realm, handleCopy, cache);
  667. };
  668. return handleCopy(object, createCache());
  669. }
  670. }
  671. exports.installHook = installHook;
  672. }
  673. ),
  674. /***/
  675. "../shared-utils/lib/backend.js": (
  676. /*!**************************************!*\
  677. !*** ../shared-utils/lib/backend.js ***!
  678. \**************************************/
  679. /***/
  680. (__unused_webpack_module, exports) => {
  681. Object.defineProperty(exports, "__esModule", {
  682. value: true
  683. });
  684. exports.getCatchedGetters = exports.getCustomStoreDetails = exports.getCustomRouterDetails = exports.isVueInstance = exports.getCustomObjectDetails = exports.getCustomInstanceDetails = exports.getInstanceMap = exports.backendInjections = void 0;
  685. exports.backendInjections = {
  686. instanceMap: /* @__PURE__ */ new Map(),
  687. isVueInstance: () => false,
  688. getCustomInstanceDetails: () => ({}),
  689. getCustomObjectDetails: () => void 0
  690. };
  691. function getInstanceMap() {
  692. return exports.backendInjections.instanceMap;
  693. }
  694. exports.getInstanceMap = getInstanceMap;
  695. function getCustomInstanceDetails(instance) {
  696. return exports.backendInjections.getCustomInstanceDetails(instance);
  697. }
  698. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  699. function getCustomObjectDetails(value, proto) {
  700. return exports.backendInjections.getCustomObjectDetails(value, proto);
  701. }
  702. exports.getCustomObjectDetails = getCustomObjectDetails;
  703. function isVueInstance(value) {
  704. return exports.backendInjections.isVueInstance(value);
  705. }
  706. exports.isVueInstance = isVueInstance;
  707. function getCustomRouterDetails(router) {
  708. return {
  709. _custom: {
  710. type: "router",
  711. display: "VueRouter",
  712. value: {
  713. options: router.options,
  714. currentRoute: router.currentRoute
  715. },
  716. fields: {
  717. abstract: true
  718. }
  719. }
  720. };
  721. }
  722. exports.getCustomRouterDetails = getCustomRouterDetails;
  723. function getCustomStoreDetails(store) {
  724. return {
  725. _custom: {
  726. type: "store",
  727. display: "Store",
  728. value: {
  729. state: store.state,
  730. getters: getCatchedGetters(store)
  731. },
  732. fields: {
  733. abstract: true
  734. }
  735. }
  736. };
  737. }
  738. exports.getCustomStoreDetails = getCustomStoreDetails;
  739. function getCatchedGetters(store) {
  740. const getters = {};
  741. const origGetters = store.getters || {};
  742. const keys = Object.keys(origGetters);
  743. for (let i2 = 0; i2 < keys.length; i2++) {
  744. const key = keys[i2];
  745. Object.defineProperty(getters, key, {
  746. enumerable: true,
  747. get: () => {
  748. try {
  749. return origGetters[key];
  750. } catch (e2) {
  751. return e2;
  752. }
  753. }
  754. });
  755. }
  756. return getters;
  757. }
  758. exports.getCatchedGetters = getCatchedGetters;
  759. }
  760. ),
  761. /***/
  762. "../shared-utils/lib/bridge.js": (
  763. /*!*************************************!*\
  764. !*** ../shared-utils/lib/bridge.js ***!
  765. \*************************************/
  766. /***/
  767. (__unused_webpack_module, exports, __webpack_require__2) => {
  768. Object.defineProperty(exports, "__esModule", {
  769. value: true
  770. });
  771. exports.Bridge = void 0;
  772. const events_1 = __webpack_require__2(
  773. /*! events */
  774. "../../node_modules/events/events.js"
  775. );
  776. const raf_1 = __webpack_require__2(
  777. /*! ./raf */
  778. "../shared-utils/lib/raf.js"
  779. );
  780. const BATCH_DURATION = 100;
  781. class Bridge extends events_1.EventEmitter {
  782. constructor(wall) {
  783. super();
  784. this.setMaxListeners(Infinity);
  785. this.wall = wall;
  786. wall.listen((messages2) => {
  787. if (Array.isArray(messages2)) {
  788. messages2.forEach((message) => this._emit(message));
  789. } else {
  790. this._emit(messages2);
  791. }
  792. });
  793. this._batchingQueue = [];
  794. this._sendingQueue = [];
  795. this._receivingQueue = [];
  796. this._sending = false;
  797. }
  798. on(event, listener) {
  799. const wrappedListener = async (...args) => {
  800. try {
  801. await listener(...args);
  802. } catch (e2) {
  803. console.error(`[Bridge] Error in listener for event ${event.toString()} with args:`, args);
  804. console.error(e2);
  805. }
  806. };
  807. return super.on(event, wrappedListener);
  808. }
  809. send(event, payload) {
  810. this._batchingQueue.push({
  811. event,
  812. payload
  813. });
  814. if (this._timer == null) {
  815. this._timer = setTimeout(() => this._flush(), BATCH_DURATION);
  816. }
  817. }
  818. /**
  819. * Log a message to the devtools background page.
  820. */
  821. log(message) {
  822. this.send("log", message);
  823. }
  824. _flush() {
  825. if (this._batchingQueue.length)
  826. this._send(this._batchingQueue);
  827. clearTimeout(this._timer);
  828. this._timer = null;
  829. this._batchingQueue = [];
  830. }
  831. // @TODO types
  832. _emit(message) {
  833. if (typeof message === "string") {
  834. this.emit(message);
  835. } else if (message._chunk) {
  836. this._receivingQueue.push(message._chunk);
  837. if (message.last) {
  838. this.emit(message.event, this._receivingQueue);
  839. this._receivingQueue = [];
  840. }
  841. } else if (message.event) {
  842. this.emit(message.event, message.payload);
  843. }
  844. }
  845. // @TODO types
  846. _send(messages2) {
  847. this._sendingQueue.push(messages2);
  848. this._nextSend();
  849. }
  850. _nextSend() {
  851. if (!this._sendingQueue.length || this._sending)
  852. return;
  853. this._sending = true;
  854. const messages2 = this._sendingQueue.shift();
  855. try {
  856. this.wall.send(messages2);
  857. } catch (err) {
  858. if (err.message === "Message length exceeded maximum allowed length.") {
  859. this._sendingQueue.splice(0, 0, messages2.map((message) => [message]));
  860. }
  861. }
  862. this._sending = false;
  863. (0, raf_1.raf)(() => this._nextSend());
  864. }
  865. }
  866. exports.Bridge = Bridge;
  867. }
  868. ),
  869. /***/
  870. "../shared-utils/lib/consts.js": (
  871. /*!*************************************!*\
  872. !*** ../shared-utils/lib/consts.js ***!
  873. \*************************************/
  874. /***/
  875. (__unused_webpack_module, exports) => {
  876. Object.defineProperty(exports, "__esModule", {
  877. value: true
  878. });
  879. exports.HookEvents = exports.BridgeSubscriptions = exports.BridgeEvents = exports.BuiltinTabs = void 0;
  880. (function(BuiltinTabs) {
  881. BuiltinTabs["COMPONENTS"] = "components";
  882. BuiltinTabs["TIMELINE"] = "timeline";
  883. BuiltinTabs["PLUGINS"] = "plugins";
  884. BuiltinTabs["SETTINGS"] = "settings";
  885. })(exports.BuiltinTabs || (exports.BuiltinTabs = {}));
  886. (function(BridgeEvents) {
  887. BridgeEvents["TO_BACK_SUBSCRIBE"] = "b:subscribe";
  888. BridgeEvents["TO_BACK_UNSUBSCRIBE"] = "b:unsubscribe";
  889. BridgeEvents["TO_FRONT_READY"] = "f:ready";
  890. BridgeEvents["TO_BACK_LOG_DETECTED_VUE"] = "b:log-detected-vue";
  891. BridgeEvents["TO_BACK_REFRESH"] = "b:refresh";
  892. BridgeEvents["TO_BACK_TAB_SWITCH"] = "b:tab:switch";
  893. BridgeEvents["TO_BACK_LOG"] = "b:log";
  894. BridgeEvents["TO_FRONT_RECONNECTED"] = "f:reconnected";
  895. BridgeEvents["TO_FRONT_TITLE"] = "f:title";
  896. BridgeEvents["TO_FRONT_APP_ADD"] = "f:app:add";
  897. BridgeEvents["TO_BACK_APP_LIST"] = "b:app:list";
  898. BridgeEvents["TO_FRONT_APP_LIST"] = "f:app:list";
  899. BridgeEvents["TO_FRONT_APP_REMOVE"] = "f:app:remove";
  900. BridgeEvents["TO_BACK_APP_SELECT"] = "b:app:select";
  901. BridgeEvents["TO_FRONT_APP_SELECTED"] = "f:app:selected";
  902. BridgeEvents["TO_BACK_SCAN_LEGACY_APPS"] = "b:app:scan-legacy";
  903. BridgeEvents["TO_BACK_COMPONENT_TREE"] = "b:component:tree";
  904. BridgeEvents["TO_FRONT_COMPONENT_TREE"] = "f:component:tree";
  905. BridgeEvents["TO_BACK_COMPONENT_SELECTED_DATA"] = "b:component:selected-data";
  906. BridgeEvents["TO_FRONT_COMPONENT_SELECTED_DATA"] = "f:component:selected-data";
  907. BridgeEvents["TO_BACK_COMPONENT_EXPAND"] = "b:component:expand";
  908. BridgeEvents["TO_FRONT_COMPONENT_EXPAND"] = "f:component:expand";
  909. BridgeEvents["TO_BACK_COMPONENT_SCROLL_TO"] = "b:component:scroll-to";
  910. BridgeEvents["TO_BACK_COMPONENT_FILTER"] = "b:component:filter";
  911. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OVER"] = "b:component:mouse-over";
  912. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OUT"] = "b:component:mouse-out";
  913. BridgeEvents["TO_BACK_COMPONENT_CONTEXT_MENU_TARGET"] = "b:component:context-menu-target";
  914. BridgeEvents["TO_BACK_COMPONENT_EDIT_STATE"] = "b:component:edit-state";
  915. BridgeEvents["TO_BACK_COMPONENT_PICK"] = "b:component:pick";
  916. BridgeEvents["TO_FRONT_COMPONENT_PICK"] = "f:component:pick";
  917. BridgeEvents["TO_BACK_COMPONENT_PICK_CANCELED"] = "b:component:pick-canceled";
  918. BridgeEvents["TO_FRONT_COMPONENT_PICK_CANCELED"] = "f:component:pick-canceled";
  919. BridgeEvents["TO_BACK_COMPONENT_INSPECT_DOM"] = "b:component:inspect-dom";
  920. BridgeEvents["TO_FRONT_COMPONENT_INSPECT_DOM"] = "f:component:inspect-dom";
  921. BridgeEvents["TO_BACK_COMPONENT_RENDER_CODE"] = "b:component:render-code";
  922. BridgeEvents["TO_FRONT_COMPONENT_RENDER_CODE"] = "f:component:render-code";
  923. BridgeEvents["TO_FRONT_COMPONENT_UPDATED"] = "f:component:updated";
  924. BridgeEvents["TO_FRONT_TIMELINE_EVENT"] = "f:timeline:event";
  925. BridgeEvents["TO_BACK_TIMELINE_LAYER_LIST"] = "b:timeline:layer-list";
  926. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LIST"] = "f:timeline:layer-list";
  927. BridgeEvents["TO_FRONT_TIMELINE_LAYER_ADD"] = "f:timeline:layer-add";
  928. BridgeEvents["TO_BACK_TIMELINE_SHOW_SCREENSHOT"] = "b:timeline:show-screenshot";
  929. BridgeEvents["TO_BACK_TIMELINE_CLEAR"] = "b:timeline:clear";
  930. BridgeEvents["TO_BACK_TIMELINE_EVENT_DATA"] = "b:timeline:event-data";
  931. BridgeEvents["TO_FRONT_TIMELINE_EVENT_DATA"] = "f:timeline:event-data";
  932. BridgeEvents["TO_BACK_TIMELINE_LAYER_LOAD_EVENTS"] = "b:timeline:layer-load-events";
  933. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS"] = "f:timeline:layer-load-events";
  934. BridgeEvents["TO_BACK_TIMELINE_LOAD_MARKERS"] = "b:timeline:load-markers";
  935. BridgeEvents["TO_FRONT_TIMELINE_LOAD_MARKERS"] = "f:timeline:load-markers";
  936. BridgeEvents["TO_FRONT_TIMELINE_MARKER"] = "f:timeline:marker";
  937. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_LIST"] = "b:devtools-plugin:list";
  938. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_LIST"] = "f:devtools-plugin:list";
  939. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_ADD"] = "f:devtools-plugin:add";
  940. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED"] = "b:devtools-plugin:setting-updated";
  941. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_LIST"] = "b:custom-inspector:list";
  942. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_LIST"] = "f:custom-inspector:list";
  943. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_ADD"] = "f:custom-inspector:add";
  944. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_TREE"] = "b:custom-inspector:tree";
  945. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_TREE"] = "f:custom-inspector:tree";
  946. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_STATE"] = "b:custom-inspector:state";
  947. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_STATE"] = "f:custom-inspector:state";
  948. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE"] = "b:custom-inspector:edit-state";
  949. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_ACTION"] = "b:custom-inspector:action";
  950. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_NODE_ACTION"] = "b:custom-inspector:node-action";
  951. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE"] = "f:custom-inspector:select-node";
  952. BridgeEvents["TO_BACK_CUSTOM_STATE_ACTION"] = "b:custom-state:action";
  953. })(exports.BridgeEvents || (exports.BridgeEvents = {}));
  954. (function(BridgeSubscriptions) {
  955. BridgeSubscriptions["SELECTED_COMPONENT_DATA"] = "component:selected-data";
  956. BridgeSubscriptions["COMPONENT_TREE"] = "component:tree";
  957. })(exports.BridgeSubscriptions || (exports.BridgeSubscriptions = {}));
  958. (function(HookEvents) {
  959. HookEvents["INIT"] = "init";
  960. HookEvents["APP_INIT"] = "app:init";
  961. HookEvents["APP_ADD"] = "app:add";
  962. HookEvents["APP_UNMOUNT"] = "app:unmount";
  963. HookEvents["COMPONENT_UPDATED"] = "component:updated";
  964. HookEvents["COMPONENT_ADDED"] = "component:added";
  965. HookEvents["COMPONENT_REMOVED"] = "component:removed";
  966. HookEvents["COMPONENT_EMIT"] = "component:emit";
  967. HookEvents["COMPONENT_HIGHLIGHT"] = "component:highlight";
  968. HookEvents["COMPONENT_UNHIGHLIGHT"] = "component:unhighlight";
  969. HookEvents["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
  970. HookEvents["TIMELINE_LAYER_ADDED"] = "timeline:layer-added";
  971. HookEvents["TIMELINE_EVENT_ADDED"] = "timeline:event-added";
  972. HookEvents["CUSTOM_INSPECTOR_ADD"] = "custom-inspector:add";
  973. HookEvents["CUSTOM_INSPECTOR_SEND_TREE"] = "custom-inspector:send-tree";
  974. HookEvents["CUSTOM_INSPECTOR_SEND_STATE"] = "custom-inspector:send-state";
  975. HookEvents["CUSTOM_INSPECTOR_SELECT_NODE"] = "custom-inspector:select-node";
  976. HookEvents["PERFORMANCE_START"] = "perf:start";
  977. HookEvents["PERFORMANCE_END"] = "perf:end";
  978. HookEvents["PLUGIN_SETTINGS_SET"] = "plugin:settings:set";
  979. HookEvents["FLUSH"] = "flush";
  980. HookEvents["TRACK_UPDATE"] = "_track-update";
  981. HookEvents["FLASH_UPDATE"] = "_flash-update";
  982. })(exports.HookEvents || (exports.HookEvents = {}));
  983. }
  984. ),
  985. /***/
  986. "../shared-utils/lib/edit.js": (
  987. /*!***********************************!*\
  988. !*** ../shared-utils/lib/edit.js ***!
  989. \***********************************/
  990. /***/
  991. (__unused_webpack_module, exports) => {
  992. Object.defineProperty(exports, "__esModule", {
  993. value: true
  994. });
  995. exports.StateEditor = void 0;
  996. class StateEditor {
  997. set(object, path, value, cb = null) {
  998. const sections = Array.isArray(path) ? path : path.split(".");
  999. while (sections.length > 1) {
  1000. object = object[sections.shift()];
  1001. if (this.isRef(object)) {
  1002. object = this.getRefValue(object);
  1003. }
  1004. }
  1005. const field = sections[0];
  1006. if (cb) {
  1007. cb(object, field, value);
  1008. } else if (this.isRef(object[field])) {
  1009. this.setRefValue(object[field], value);
  1010. } else {
  1011. object[field] = value;
  1012. }
  1013. }
  1014. get(object, path) {
  1015. const sections = Array.isArray(path) ? path : path.split(".");
  1016. for (let i2 = 0; i2 < sections.length; i2++) {
  1017. object = object[sections[i2]];
  1018. if (this.isRef(object)) {
  1019. object = this.getRefValue(object);
  1020. }
  1021. if (!object) {
  1022. return void 0;
  1023. }
  1024. }
  1025. return object;
  1026. }
  1027. has(object, path, parent = false) {
  1028. if (typeof object === "undefined") {
  1029. return false;
  1030. }
  1031. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  1032. const size = !parent ? 1 : 2;
  1033. while (object && sections.length > size) {
  1034. object = object[sections.shift()];
  1035. if (this.isRef(object)) {
  1036. object = this.getRefValue(object);
  1037. }
  1038. }
  1039. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  1040. }
  1041. createDefaultSetCallback(state) {
  1042. return (obj, field, value) => {
  1043. if (state.remove || state.newKey) {
  1044. if (Array.isArray(obj)) {
  1045. obj.splice(field, 1);
  1046. } else {
  1047. delete obj[field];
  1048. }
  1049. }
  1050. if (!state.remove) {
  1051. const target = obj[state.newKey || field];
  1052. if (this.isRef(target)) {
  1053. this.setRefValue(target, value);
  1054. } else {
  1055. obj[state.newKey || field] = value;
  1056. }
  1057. }
  1058. };
  1059. }
  1060. isRef(ref) {
  1061. return false;
  1062. }
  1063. setRefValue(ref, value) {
  1064. }
  1065. getRefValue(ref) {
  1066. return ref;
  1067. }
  1068. }
  1069. exports.StateEditor = StateEditor;
  1070. }
  1071. ),
  1072. /***/
  1073. "../shared-utils/lib/env.js": (
  1074. /*!**********************************!*\
  1075. !*** ../shared-utils/lib/env.js ***!
  1076. \**********************************/
  1077. /***/
  1078. (__unused_webpack_module, exports) => {
  1079. Object.defineProperty(exports, "__esModule", {
  1080. value: true
  1081. });
  1082. exports.initEnv = exports.keys = exports.isLinux = exports.isMac = exports.isWindows = exports.isFirefox = exports.isChrome = exports.target = exports.isBrowser = void 0;
  1083. exports.isBrowser = typeof navigator !== "undefined" && typeof window !== "undefined";
  1084. exports.target = exports.isBrowser ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  1085. exports.isChrome = typeof exports.target.chrome !== "undefined" && !!exports.target.chrome.devtools;
  1086. exports.isFirefox = exports.isBrowser && navigator.userAgent && navigator.userAgent.indexOf("Firefox") > -1;
  1087. exports.isWindows = exports.isBrowser && navigator.platform.indexOf("Win") === 0;
  1088. exports.isMac = exports.isBrowser && navigator.platform === "MacIntel";
  1089. exports.isLinux = exports.isBrowser && navigator.platform.indexOf("Linux") === 0;
  1090. exports.keys = {
  1091. ctrl: exports.isMac ? "&#8984;" : "Ctrl",
  1092. shift: "Shift",
  1093. alt: exports.isMac ? "&#8997;" : "Alt",
  1094. del: "Del",
  1095. enter: "Enter",
  1096. esc: "Esc"
  1097. };
  1098. function initEnv(Vue2) {
  1099. if (Vue2.prototype.hasOwnProperty("$isChrome"))
  1100. return;
  1101. Object.defineProperties(Vue2.prototype, {
  1102. $isChrome: {
  1103. get: () => exports.isChrome
  1104. },
  1105. $isFirefox: {
  1106. get: () => exports.isFirefox
  1107. },
  1108. $isWindows: {
  1109. get: () => exports.isWindows
  1110. },
  1111. $isMac: {
  1112. get: () => exports.isMac
  1113. },
  1114. $isLinux: {
  1115. get: () => exports.isLinux
  1116. },
  1117. $keys: {
  1118. get: () => exports.keys
  1119. }
  1120. });
  1121. if (exports.isWindows)
  1122. document.body.classList.add("platform-windows");
  1123. if (exports.isMac)
  1124. document.body.classList.add("platform-mac");
  1125. if (exports.isLinux)
  1126. document.body.classList.add("platform-linux");
  1127. }
  1128. exports.initEnv = initEnv;
  1129. }
  1130. ),
  1131. /***/
  1132. "../shared-utils/lib/index.js": (
  1133. /*!************************************!*\
  1134. !*** ../shared-utils/lib/index.js ***!
  1135. \************************************/
  1136. /***/
  1137. function(__unused_webpack_module, exports, __webpack_require__2) {
  1138. var __createBinding = this && this.__createBinding || (Object.create ? function(o2, m2, k, k2) {
  1139. if (k2 === void 0)
  1140. k2 = k;
  1141. var desc = Object.getOwnPropertyDescriptor(m2, k);
  1142. if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
  1143. desc = {
  1144. enumerable: true,
  1145. get: function() {
  1146. return m2[k];
  1147. }
  1148. };
  1149. }
  1150. Object.defineProperty(o2, k2, desc);
  1151. } : function(o2, m2, k, k2) {
  1152. if (k2 === void 0)
  1153. k2 = k;
  1154. o2[k2] = m2[k];
  1155. });
  1156. var __exportStar = this && this.__exportStar || function(m2, exports2) {
  1157. for (var p2 in m2)
  1158. if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2))
  1159. __createBinding(exports2, m2, p2);
  1160. };
  1161. Object.defineProperty(exports, "__esModule", {
  1162. value: true
  1163. });
  1164. __exportStar(__webpack_require__2(
  1165. /*! ./backend */
  1166. "../shared-utils/lib/backend.js"
  1167. ), exports);
  1168. __exportStar(__webpack_require__2(
  1169. /*! ./bridge */
  1170. "../shared-utils/lib/bridge.js"
  1171. ), exports);
  1172. __exportStar(__webpack_require__2(
  1173. /*! ./consts */
  1174. "../shared-utils/lib/consts.js"
  1175. ), exports);
  1176. __exportStar(__webpack_require__2(
  1177. /*! ./edit */
  1178. "../shared-utils/lib/edit.js"
  1179. ), exports);
  1180. __exportStar(__webpack_require__2(
  1181. /*! ./env */
  1182. "../shared-utils/lib/env.js"
  1183. ), exports);
  1184. __exportStar(__webpack_require__2(
  1185. /*! ./plugin-permissions */
  1186. "../shared-utils/lib/plugin-permissions.js"
  1187. ), exports);
  1188. __exportStar(__webpack_require__2(
  1189. /*! ./plugin-settings */
  1190. "../shared-utils/lib/plugin-settings.js"
  1191. ), exports);
  1192. __exportStar(__webpack_require__2(
  1193. /*! ./shared-data */
  1194. "../shared-utils/lib/shared-data.js"
  1195. ), exports);
  1196. __exportStar(__webpack_require__2(
  1197. /*! ./shell */
  1198. "../shared-utils/lib/shell.js"
  1199. ), exports);
  1200. __exportStar(__webpack_require__2(
  1201. /*! ./storage */
  1202. "../shared-utils/lib/storage.js"
  1203. ), exports);
  1204. __exportStar(__webpack_require__2(
  1205. /*! ./transfer */
  1206. "../shared-utils/lib/transfer.js"
  1207. ), exports);
  1208. __exportStar(__webpack_require__2(
  1209. /*! ./util */
  1210. "../shared-utils/lib/util.js"
  1211. ), exports);
  1212. __exportStar(__webpack_require__2(
  1213. /*! ./raf */
  1214. "../shared-utils/lib/raf.js"
  1215. ), exports);
  1216. }
  1217. ),
  1218. /***/
  1219. "../shared-utils/lib/plugin-permissions.js": (
  1220. /*!*************************************************!*\
  1221. !*** ../shared-utils/lib/plugin-permissions.js ***!
  1222. \*************************************************/
  1223. /***/
  1224. (__unused_webpack_module, exports, __webpack_require__2) => {
  1225. Object.defineProperty(exports, "__esModule", {
  1226. value: true
  1227. });
  1228. exports.setPluginPermission = exports.hasPluginPermission = exports.PluginPermission = void 0;
  1229. const shared_data_1 = __webpack_require__2(
  1230. /*! ./shared-data */
  1231. "../shared-utils/lib/shared-data.js"
  1232. );
  1233. (function(PluginPermission) {
  1234. PluginPermission["ENABLED"] = "enabled";
  1235. PluginPermission["COMPONENTS"] = "components";
  1236. PluginPermission["CUSTOM_INSPECTOR"] = "custom-inspector";
  1237. PluginPermission["TIMELINE"] = "timeline";
  1238. })(exports.PluginPermission || (exports.PluginPermission = {}));
  1239. function hasPluginPermission(pluginId, permission2) {
  1240. const result = shared_data_1.SharedData.pluginPermissions[`${pluginId}:${permission2}`];
  1241. if (result == null)
  1242. return true;
  1243. return !!result;
  1244. }
  1245. exports.hasPluginPermission = hasPluginPermission;
  1246. function setPluginPermission(pluginId, permission2, active) {
  1247. shared_data_1.SharedData.pluginPermissions = {
  1248. ...shared_data_1.SharedData.pluginPermissions,
  1249. [`${pluginId}:${permission2}`]: active
  1250. };
  1251. }
  1252. exports.setPluginPermission = setPluginPermission;
  1253. }
  1254. ),
  1255. /***/
  1256. "../shared-utils/lib/plugin-settings.js": (
  1257. /*!**********************************************!*\
  1258. !*** ../shared-utils/lib/plugin-settings.js ***!
  1259. \**********************************************/
  1260. /***/
  1261. (__unused_webpack_module, exports, __webpack_require__2) => {
  1262. Object.defineProperty(exports, "__esModule", {
  1263. value: true
  1264. });
  1265. exports.getPluginDefaultSettings = exports.setPluginSettings = exports.getPluginSettings = void 0;
  1266. const shared_data_1 = __webpack_require__2(
  1267. /*! ./shared-data */
  1268. "../shared-utils/lib/shared-data.js"
  1269. );
  1270. function getPluginSettings(pluginId, defaultSettings) {
  1271. var _a;
  1272. return {
  1273. ...defaultSettings !== null && defaultSettings !== void 0 ? defaultSettings : {},
  1274. ...(_a = shared_data_1.SharedData.pluginSettings[pluginId]) !== null && _a !== void 0 ? _a : {}
  1275. };
  1276. }
  1277. exports.getPluginSettings = getPluginSettings;
  1278. function setPluginSettings(pluginId, settings) {
  1279. shared_data_1.SharedData.pluginSettings = {
  1280. ...shared_data_1.SharedData.pluginSettings,
  1281. [pluginId]: settings
  1282. };
  1283. }
  1284. exports.setPluginSettings = setPluginSettings;
  1285. function getPluginDefaultSettings(schema) {
  1286. const result = {};
  1287. if (schema) {
  1288. for (const id in schema) {
  1289. const item = schema[id];
  1290. result[id] = item.defaultValue;
  1291. }
  1292. }
  1293. return result;
  1294. }
  1295. exports.getPluginDefaultSettings = getPluginDefaultSettings;
  1296. }
  1297. ),
  1298. /***/
  1299. "../shared-utils/lib/raf.js": (
  1300. /*!**********************************!*\
  1301. !*** ../shared-utils/lib/raf.js ***!
  1302. \**********************************/
  1303. /***/
  1304. (__unused_webpack_module, exports) => {
  1305. Object.defineProperty(exports, "__esModule", {
  1306. value: true
  1307. });
  1308. exports.raf = void 0;
  1309. let pendingCallbacks = [];
  1310. exports.raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : typeof setImmediate === "function" ? (fn) => {
  1311. if (!pendingCallbacks.length) {
  1312. setImmediate(() => {
  1313. const now = performance.now();
  1314. const cbs = pendingCallbacks;
  1315. pendingCallbacks = [];
  1316. cbs.forEach((cb) => cb(now));
  1317. });
  1318. }
  1319. pendingCallbacks.push(fn);
  1320. } : function(callback) {
  1321. return setTimeout(function() {
  1322. callback(Date.now());
  1323. }, 1e3 / 60);
  1324. };
  1325. }
  1326. ),
  1327. /***/
  1328. "../shared-utils/lib/shared-data.js": (
  1329. /*!******************************************!*\
  1330. !*** ../shared-utils/lib/shared-data.js ***!
  1331. \******************************************/
  1332. /***/
  1333. (__unused_webpack_module, exports, __webpack_require__2) => {
  1334. Object.defineProperty(exports, "__esModule", {
  1335. value: true
  1336. });
  1337. exports.SharedData = exports.watchSharedData = exports.destroySharedData = exports.onSharedDataInit = exports.initSharedData = void 0;
  1338. const storage_1 = __webpack_require__2(
  1339. /*! ./storage */
  1340. "../shared-utils/lib/storage.js"
  1341. );
  1342. const env_1 = __webpack_require__2(
  1343. /*! ./env */
  1344. "../shared-utils/lib/env.js"
  1345. );
  1346. const internalSharedData = {
  1347. openInEditorHost: "/",
  1348. componentNameStyle: "class",
  1349. theme: "auto",
  1350. displayDensity: "low",
  1351. timeFormat: "default",
  1352. recordVuex: true,
  1353. cacheVuexSnapshotsEvery: 50,
  1354. cacheVuexSnapshotsLimit: 10,
  1355. snapshotLoading: false,
  1356. componentEventsEnabled: true,
  1357. performanceMonitoringEnabled: true,
  1358. editableProps: false,
  1359. logDetected: true,
  1360. vuexNewBackend: false,
  1361. vuexAutoload: false,
  1362. vuexGroupGettersByModule: true,
  1363. showMenuScrollTip: true,
  1364. timelineTimeGrid: true,
  1365. timelineScreenshots: true,
  1366. menuStepScrolling: env_1.isMac,
  1367. pluginPermissions: {},
  1368. pluginSettings: {},
  1369. pageConfig: {},
  1370. legacyApps: false,
  1371. trackUpdates: true,
  1372. flashUpdates: false,
  1373. debugInfo: false,
  1374. isBrowser: env_1.isBrowser
  1375. };
  1376. const persisted = ["componentNameStyle", "theme", "displayDensity", "recordVuex", "editableProps", "logDetected", "vuexNewBackend", "vuexAutoload", "vuexGroupGettersByModule", "timeFormat", "showMenuScrollTip", "timelineTimeGrid", "timelineScreenshots", "menuStepScrolling", "pluginPermissions", "pluginSettings", "performanceMonitoringEnabled", "componentEventsEnabled", "trackUpdates", "flashUpdates", "debugInfo"];
  1377. const storageVersion = "6.0.0-alpha.1";
  1378. let bridge;
  1379. let persist = false;
  1380. let data;
  1381. let initRetryInterval;
  1382. let initRetryCount = 0;
  1383. const initCbs = [];
  1384. function initSharedData(params) {
  1385. return new Promise((resolve) => {
  1386. bridge = params.bridge;
  1387. persist = !!params.persist;
  1388. if (persist) {
  1389. {
  1390. console.log("[shared data] Master init in progress...");
  1391. }
  1392. persisted.forEach((key) => {
  1393. const value = (0, storage_1.getStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`);
  1394. if (value !== null) {
  1395. internalSharedData[key] = value;
  1396. }
  1397. });
  1398. bridge.on("shared-data:load", () => {
  1399. Object.keys(internalSharedData).forEach((key) => {
  1400. sendValue(key, internalSharedData[key]);
  1401. });
  1402. bridge.send("shared-data:load-complete");
  1403. });
  1404. bridge.on("shared-data:init-complete", () => {
  1405. {
  1406. console.log("[shared data] Master init complete");
  1407. }
  1408. clearInterval(initRetryInterval);
  1409. resolve();
  1410. });
  1411. bridge.send("shared-data:master-init-waiting");
  1412. bridge.on("shared-data:minion-init-waiting", () => {
  1413. bridge.send("shared-data:master-init-waiting");
  1414. });
  1415. initRetryCount = 0;
  1416. clearInterval(initRetryInterval);
  1417. initRetryInterval = setInterval(() => {
  1418. {
  1419. console.log("[shared data] Master init retrying...");
  1420. }
  1421. bridge.send("shared-data:master-init-waiting");
  1422. initRetryCount++;
  1423. if (initRetryCount > 30) {
  1424. clearInterval(initRetryInterval);
  1425. console.error("[shared data] Master init failed");
  1426. }
  1427. }, 2e3);
  1428. } else {
  1429. bridge.on("shared-data:master-init-waiting", () => {
  1430. bridge.send("shared-data:load");
  1431. bridge.once("shared-data:load-complete", () => {
  1432. bridge.send("shared-data:init-complete");
  1433. resolve();
  1434. });
  1435. });
  1436. bridge.send("shared-data:minion-init-waiting");
  1437. }
  1438. data = {
  1439. ...internalSharedData
  1440. };
  1441. if (params.Vue) {
  1442. data = params.Vue.observable(data);
  1443. }
  1444. bridge.on("shared-data:set", ({
  1445. key,
  1446. value
  1447. }) => {
  1448. setValue(key, value);
  1449. });
  1450. initCbs.forEach((cb) => cb());
  1451. });
  1452. }
  1453. exports.initSharedData = initSharedData;
  1454. function onSharedDataInit(cb) {
  1455. initCbs.push(cb);
  1456. return () => {
  1457. const index = initCbs.indexOf(cb);
  1458. if (index !== -1)
  1459. initCbs.splice(index, 1);
  1460. };
  1461. }
  1462. exports.onSharedDataInit = onSharedDataInit;
  1463. function destroySharedData() {
  1464. bridge.removeAllListeners("shared-data:set");
  1465. watchers = {};
  1466. }
  1467. exports.destroySharedData = destroySharedData;
  1468. let watchers = {};
  1469. function setValue(key, value) {
  1470. if (persist && persisted.includes(key)) {
  1471. (0, storage_1.setStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`, value);
  1472. }
  1473. const oldValue = data[key];
  1474. data[key] = value;
  1475. const handlers = watchers[key];
  1476. if (handlers) {
  1477. handlers.forEach((h2) => h2(value, oldValue));
  1478. }
  1479. return true;
  1480. }
  1481. function sendValue(key, value) {
  1482. bridge && bridge.send("shared-data:set", {
  1483. key,
  1484. value
  1485. });
  1486. }
  1487. function watchSharedData(prop, handler) {
  1488. const list = watchers[prop] || (watchers[prop] = []);
  1489. list.push(handler);
  1490. return () => {
  1491. const index = list.indexOf(handler);
  1492. if (index !== -1)
  1493. list.splice(index, 1);
  1494. };
  1495. }
  1496. exports.watchSharedData = watchSharedData;
  1497. const proxy = {};
  1498. Object.keys(internalSharedData).forEach((key) => {
  1499. Object.defineProperty(proxy, key, {
  1500. configurable: false,
  1501. get: () => data[key],
  1502. set: (value) => {
  1503. sendValue(key, value);
  1504. setValue(key, value);
  1505. }
  1506. });
  1507. });
  1508. exports.SharedData = proxy;
  1509. }
  1510. ),
  1511. /***/
  1512. "../shared-utils/lib/shell.js": (
  1513. /*!************************************!*\
  1514. !*** ../shared-utils/lib/shell.js ***!
  1515. \************************************/
  1516. /***/
  1517. (__unused_webpack_module, exports) => {
  1518. Object.defineProperty(exports, "__esModule", {
  1519. value: true
  1520. });
  1521. }
  1522. ),
  1523. /***/
  1524. "../shared-utils/lib/storage.js": (
  1525. /*!**************************************!*\
  1526. !*** ../shared-utils/lib/storage.js ***!
  1527. \**************************************/
  1528. /***/
  1529. (__unused_webpack_module, exports, __webpack_require__2) => {
  1530. Object.defineProperty(exports, "__esModule", {
  1531. value: true
  1532. });
  1533. exports.clearStorage = exports.removeStorage = exports.setStorage = exports.getStorage = exports.initStorage = void 0;
  1534. const env_1 = __webpack_require__2(
  1535. /*! ./env */
  1536. "../shared-utils/lib/env.js"
  1537. );
  1538. const useStorage = typeof env_1.target.chrome !== "undefined" && typeof env_1.target.chrome.storage !== "undefined";
  1539. let storageData = null;
  1540. function initStorage() {
  1541. return new Promise((resolve) => {
  1542. if (useStorage) {
  1543. env_1.target.chrome.storage.local.get(null, (result) => {
  1544. storageData = result;
  1545. resolve();
  1546. });
  1547. } else {
  1548. storageData = {};
  1549. resolve();
  1550. }
  1551. });
  1552. }
  1553. exports.initStorage = initStorage;
  1554. function getStorage(key, defaultValue = null) {
  1555. checkStorage();
  1556. if (useStorage) {
  1557. return getDefaultValue(storageData[key], defaultValue);
  1558. } else {
  1559. try {
  1560. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue);
  1561. } catch (e2) {
  1562. }
  1563. }
  1564. }
  1565. exports.getStorage = getStorage;
  1566. function setStorage(key, val) {
  1567. checkStorage();
  1568. if (useStorage) {
  1569. storageData[key] = val;
  1570. env_1.target.chrome.storage.local.set({
  1571. [key]: val
  1572. });
  1573. } else {
  1574. try {
  1575. localStorage.setItem(key, JSON.stringify(val));
  1576. } catch (e2) {
  1577. }
  1578. }
  1579. }
  1580. exports.setStorage = setStorage;
  1581. function removeStorage(key) {
  1582. checkStorage();
  1583. if (useStorage) {
  1584. delete storageData[key];
  1585. env_1.target.chrome.storage.local.remove([key]);
  1586. } else {
  1587. try {
  1588. localStorage.removeItem(key);
  1589. } catch (e2) {
  1590. }
  1591. }
  1592. }
  1593. exports.removeStorage = removeStorage;
  1594. function clearStorage() {
  1595. checkStorage();
  1596. if (useStorage) {
  1597. storageData = {};
  1598. env_1.target.chrome.storage.local.clear();
  1599. } else {
  1600. try {
  1601. localStorage.clear();
  1602. } catch (e2) {
  1603. }
  1604. }
  1605. }
  1606. exports.clearStorage = clearStorage;
  1607. function checkStorage() {
  1608. if (!storageData) {
  1609. throw new Error("Storage wasn't initialized with 'init()'");
  1610. }
  1611. }
  1612. function getDefaultValue(value, defaultValue) {
  1613. if (value == null) {
  1614. return defaultValue;
  1615. }
  1616. return value;
  1617. }
  1618. }
  1619. ),
  1620. /***/
  1621. "../shared-utils/lib/transfer.js": (
  1622. /*!***************************************!*\
  1623. !*** ../shared-utils/lib/transfer.js ***!
  1624. \***************************************/
  1625. /***/
  1626. (__unused_webpack_module, exports) => {
  1627. Object.defineProperty(exports, "__esModule", {
  1628. value: true
  1629. });
  1630. exports.stringifyStrictCircularAutoChunks = exports.parseCircularAutoChunks = exports.stringifyCircularAutoChunks = void 0;
  1631. const MAX_SERIALIZED_SIZE = 512 * 1024;
  1632. function encode(data, replacer, list, seen) {
  1633. let stored, key, value, i2, l2;
  1634. const seenIndex = seen.get(data);
  1635. if (seenIndex != null) {
  1636. return seenIndex;
  1637. }
  1638. const index = list.length;
  1639. const proto = Object.prototype.toString.call(data);
  1640. if (proto === "[object Object]") {
  1641. stored = {};
  1642. seen.set(data, index);
  1643. list.push(stored);
  1644. const keys = Object.keys(data);
  1645. for (i2 = 0, l2 = keys.length; i2 < l2; i2++) {
  1646. key = keys[i2];
  1647. try {
  1648. value = data[key];
  1649. if (replacer)
  1650. value = replacer.call(data, key, value);
  1651. } catch (e2) {
  1652. value = e2;
  1653. }
  1654. stored[key] = encode(value, replacer, list, seen);
  1655. }
  1656. } else if (proto === "[object Array]") {
  1657. stored = [];
  1658. seen.set(data, index);
  1659. list.push(stored);
  1660. for (i2 = 0, l2 = data.length; i2 < l2; i2++) {
  1661. try {
  1662. value = data[i2];
  1663. if (replacer)
  1664. value = replacer.call(data, i2, value);
  1665. } catch (e2) {
  1666. value = e2;
  1667. }
  1668. stored[i2] = encode(value, replacer, list, seen);
  1669. }
  1670. } else {
  1671. list.push(data);
  1672. }
  1673. return index;
  1674. }
  1675. function decode(list, reviver) {
  1676. let i2 = list.length;
  1677. let j2, k, data, key, value, proto;
  1678. while (i2--) {
  1679. data = list[i2];
  1680. proto = Object.prototype.toString.call(data);
  1681. if (proto === "[object Object]") {
  1682. const keys = Object.keys(data);
  1683. for (j2 = 0, k = keys.length; j2 < k; j2++) {
  1684. key = keys[j2];
  1685. value = list[data[key]];
  1686. if (reviver)
  1687. value = reviver.call(data, key, value);
  1688. data[key] = value;
  1689. }
  1690. } else if (proto === "[object Array]") {
  1691. for (j2 = 0, k = data.length; j2 < k; j2++) {
  1692. value = list[data[j2]];
  1693. if (reviver)
  1694. value = reviver.call(data, j2, value);
  1695. data[j2] = value;
  1696. }
  1697. }
  1698. }
  1699. }
  1700. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  1701. let result;
  1702. try {
  1703. result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, replacer, space);
  1704. } catch (e2) {
  1705. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  1706. }
  1707. if (result.length > MAX_SERIALIZED_SIZE) {
  1708. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  1709. const chunks = [];
  1710. for (let i2 = 0; i2 < chunkCount; i2++) {
  1711. chunks.push(result.slice(i2 * MAX_SERIALIZED_SIZE, (i2 + 1) * MAX_SERIALIZED_SIZE));
  1712. }
  1713. return chunks;
  1714. }
  1715. return result;
  1716. }
  1717. exports.stringifyCircularAutoChunks = stringifyCircularAutoChunks;
  1718. function parseCircularAutoChunks(data, reviver = null) {
  1719. if (Array.isArray(data)) {
  1720. data = data.join("");
  1721. }
  1722. const hasCircular = /^\s/.test(data);
  1723. if (!hasCircular) {
  1724. return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver);
  1725. } else {
  1726. const list = JSON.parse(data);
  1727. decode(list, reviver);
  1728. return list[0];
  1729. }
  1730. }
  1731. exports.parseCircularAutoChunks = parseCircularAutoChunks;
  1732. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  1733. const list = [];
  1734. encode(data, replacer, list, /* @__PURE__ */ new Map());
  1735. return space ? " " + JSON.stringify(list, null, space) : " " + JSON.stringify(list);
  1736. }
  1737. exports.stringifyStrictCircularAutoChunks = stringifyStrictCircularAutoChunks;
  1738. }
  1739. ),
  1740. /***/
  1741. "../shared-utils/lib/util.js": (
  1742. /*!***********************************!*\
  1743. !*** ../shared-utils/lib/util.js ***!
  1744. \***********************************/
  1745. /***/
  1746. function(__unused_webpack_module, exports, __webpack_require__2) {
  1747. var __importDefault = this && this.__importDefault || function(mod) {
  1748. return mod && mod.__esModule ? mod : {
  1749. "default": mod
  1750. };
  1751. };
  1752. Object.defineProperty(exports, "__esModule", {
  1753. value: true
  1754. });
  1755. 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;
  1756. const path_1 = __importDefault(__webpack_require__2(
  1757. /*! path */
  1758. "../../node_modules/path-browserify/index.js"
  1759. ));
  1760. const transfer_1 = __webpack_require__2(
  1761. /*! ./transfer */
  1762. "../shared-utils/lib/transfer.js"
  1763. );
  1764. const backend_1 = __webpack_require__2(
  1765. /*! ./backend */
  1766. "../shared-utils/lib/backend.js"
  1767. );
  1768. const shared_data_1 = __webpack_require__2(
  1769. /*! ./shared-data */
  1770. "../shared-utils/lib/shared-data.js"
  1771. );
  1772. const env_1 = __webpack_require__2(
  1773. /*! ./env */
  1774. "../shared-utils/lib/env.js"
  1775. );
  1776. function cached(fn) {
  1777. const cache = /* @__PURE__ */ Object.create(null);
  1778. return function cachedFn(str) {
  1779. const hit = cache[str];
  1780. return hit || (cache[str] = fn(str));
  1781. };
  1782. }
  1783. const classifyRE = /(?:^|[-_/])(\w)/g;
  1784. exports.classify = cached((str) => {
  1785. return str && ("" + str).replace(classifyRE, toUpper);
  1786. });
  1787. const camelizeRE = /-(\w)/g;
  1788. exports.camelize = cached((str) => {
  1789. return str && str.replace(camelizeRE, toUpper);
  1790. });
  1791. const kebabizeRE = /([a-z0-9])([A-Z])/g;
  1792. exports.kebabize = cached((str) => {
  1793. return str && str.replace(kebabizeRE, (_2, lowerCaseCharacter, upperCaseLetter) => {
  1794. return `${lowerCaseCharacter}-${upperCaseLetter}`;
  1795. }).toLowerCase();
  1796. });
  1797. function toUpper(_2, c2) {
  1798. return c2 ? c2.toUpperCase() : "";
  1799. }
  1800. function getComponentDisplayName(originalName, style = "class") {
  1801. switch (style) {
  1802. case "class":
  1803. return (0, exports.classify)(originalName);
  1804. case "kebab":
  1805. return (0, exports.kebabize)(originalName);
  1806. case "original":
  1807. default:
  1808. return originalName;
  1809. }
  1810. }
  1811. exports.getComponentDisplayName = getComponentDisplayName;
  1812. function inDoc(node) {
  1813. if (!node)
  1814. return false;
  1815. const doc = node.ownerDocument.documentElement;
  1816. const parent = node.parentNode;
  1817. return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  1818. }
  1819. exports.inDoc = inDoc;
  1820. exports.UNDEFINED = "__vue_devtool_undefined__";
  1821. exports.INFINITY = "__vue_devtool_infinity__";
  1822. exports.NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  1823. exports.NAN = "__vue_devtool_nan__";
  1824. exports.SPECIAL_TOKENS = {
  1825. true: true,
  1826. false: false,
  1827. undefined: exports.UNDEFINED,
  1828. null: null,
  1829. "-Infinity": exports.NEGATIVE_INFINITY,
  1830. Infinity: exports.INFINITY,
  1831. NaN: exports.NAN
  1832. };
  1833. exports.MAX_STRING_SIZE = 1e4;
  1834. exports.MAX_ARRAY_SIZE = 5e3;
  1835. function specialTokenToString(value) {
  1836. if (value === null) {
  1837. return "null";
  1838. } else if (value === exports.UNDEFINED) {
  1839. return "undefined";
  1840. } else if (value === exports.NAN) {
  1841. return "NaN";
  1842. } else if (value === exports.INFINITY) {
  1843. return "Infinity";
  1844. } else if (value === exports.NEGATIVE_INFINITY) {
  1845. return "-Infinity";
  1846. }
  1847. return false;
  1848. }
  1849. exports.specialTokenToString = specialTokenToString;
  1850. class EncodeCache {
  1851. constructor() {
  1852. this.map = /* @__PURE__ */ new Map();
  1853. }
  1854. /**
  1855. * Returns a result unique to each input data
  1856. * @param {*} data Input data
  1857. * @param {*} factory Function used to create the unique result
  1858. */
  1859. cache(data, factory) {
  1860. const cached2 = this.map.get(data);
  1861. if (cached2) {
  1862. return cached2;
  1863. } else {
  1864. const result = factory(data);
  1865. this.map.set(data, result);
  1866. return result;
  1867. }
  1868. }
  1869. clear() {
  1870. this.map.clear();
  1871. }
  1872. }
  1873. const encodeCache = new EncodeCache();
  1874. class ReviveCache {
  1875. constructor(maxSize) {
  1876. this.maxSize = maxSize;
  1877. this.map = /* @__PURE__ */ new Map();
  1878. this.index = 0;
  1879. this.size = 0;
  1880. }
  1881. cache(value) {
  1882. const currentIndex = this.index;
  1883. this.map.set(currentIndex, value);
  1884. this.size++;
  1885. if (this.size > this.maxSize) {
  1886. this.map.delete(currentIndex - this.size);
  1887. this.size--;
  1888. }
  1889. this.index++;
  1890. return currentIndex;
  1891. }
  1892. read(id) {
  1893. return this.map.get(id);
  1894. }
  1895. }
  1896. const reviveCache = new ReviveCache(1e3);
  1897. const replacers = {
  1898. internal: replacerForInternal,
  1899. user: replaceForUser
  1900. };
  1901. function stringify(data, target = "internal") {
  1902. encodeCache.clear();
  1903. return (0, transfer_1.stringifyCircularAutoChunks)(data, replacers[target]);
  1904. }
  1905. exports.stringify = stringify;
  1906. function replacerForInternal(key) {
  1907. var _a;
  1908. const val = this[key];
  1909. const type = typeof val;
  1910. if (Array.isArray(val)) {
  1911. const l2 = val.length;
  1912. if (l2 > exports.MAX_ARRAY_SIZE) {
  1913. return {
  1914. _isArray: true,
  1915. length: l2,
  1916. items: val.slice(0, exports.MAX_ARRAY_SIZE)
  1917. };
  1918. }
  1919. return val;
  1920. } else if (typeof val === "string") {
  1921. if (val.length > exports.MAX_STRING_SIZE) {
  1922. return val.substring(0, exports.MAX_STRING_SIZE) + `... (${val.length} total length)`;
  1923. } else {
  1924. return val;
  1925. }
  1926. } else if (type === "undefined") {
  1927. return exports.UNDEFINED;
  1928. } else if (val === Infinity) {
  1929. return exports.INFINITY;
  1930. } else if (val === -Infinity) {
  1931. return exports.NEGATIVE_INFINITY;
  1932. } else if (type === "function") {
  1933. return getCustomFunctionDetails(val);
  1934. } else if (type === "symbol") {
  1935. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  1936. } else if (val !== null && type === "object") {
  1937. const proto = Object.prototype.toString.call(val);
  1938. if (proto === "[object Map]") {
  1939. return encodeCache.cache(val, () => getCustomMapDetails(val));
  1940. } else if (proto === "[object Set]") {
  1941. return encodeCache.cache(val, () => getCustomSetDetails(val));
  1942. } else if (proto === "[object RegExp]") {
  1943. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  1944. } else if (proto === "[object Date]") {
  1945. return `[native Date ${Date.prototype.toString.call(val)}]`;
  1946. } else if (proto === "[object Error]") {
  1947. return `[native Error ${val.message}<>${val.stack}]`;
  1948. } else if (val.state && val._vm) {
  1949. return encodeCache.cache(val, () => (0, backend_1.getCustomStoreDetails)(val));
  1950. } else if (val.constructor && val.constructor.name === "VueRouter") {
  1951. return encodeCache.cache(val, () => (0, backend_1.getCustomRouterDetails)(val));
  1952. } else if ((0, backend_1.isVueInstance)(val)) {
  1953. return encodeCache.cache(val, () => (0, backend_1.getCustomInstanceDetails)(val));
  1954. } else if (typeof val.render === "function") {
  1955. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val));
  1956. } else if (val.constructor && val.constructor.name === "VNode") {
  1957. return `[native VNode <${val.tag}>]`;
  1958. } else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
  1959. return encodeCache.cache(val, () => getCustomHTMLElementDetails(val));
  1960. } else if (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) === "Store" && val._wrappedGetters) {
  1961. return `[object Store]`;
  1962. } else if (val.currentRoute) {
  1963. return `[object Router]`;
  1964. }
  1965. const customDetails = (0, backend_1.getCustomObjectDetails)(val, proto);
  1966. if (customDetails != null)
  1967. return customDetails;
  1968. } else if (Number.isNaN(val)) {
  1969. return exports.NAN;
  1970. }
  1971. return sanitize(val);
  1972. }
  1973. function replaceForUser(key) {
  1974. let val = this[key];
  1975. const type = typeof val;
  1976. if ((val === null || val === void 0 ? void 0 : val._custom) && "value" in val._custom) {
  1977. val = val._custom.value;
  1978. }
  1979. if (type !== "object") {
  1980. if (val === exports.UNDEFINED) {
  1981. return void 0;
  1982. } else if (val === exports.INFINITY) {
  1983. return Infinity;
  1984. } else if (val === exports.NEGATIVE_INFINITY) {
  1985. return -Infinity;
  1986. } else if (val === exports.NAN) {
  1987. return NaN;
  1988. }
  1989. return val;
  1990. }
  1991. return sanitize(val);
  1992. }
  1993. function getCustomMapDetails(val) {
  1994. const list = [];
  1995. val.forEach((value, key) => list.push({
  1996. key,
  1997. value
  1998. }));
  1999. return {
  2000. _custom: {
  2001. type: "map",
  2002. display: "Map",
  2003. value: list,
  2004. readOnly: true,
  2005. fields: {
  2006. abstract: true
  2007. }
  2008. }
  2009. };
  2010. }
  2011. exports.getCustomMapDetails = getCustomMapDetails;
  2012. function reviveMap(val) {
  2013. const result = /* @__PURE__ */ new Map();
  2014. const list = val._custom.value;
  2015. for (let i2 = 0; i2 < list.length; i2++) {
  2016. const {
  2017. key,
  2018. value
  2019. } = list[i2];
  2020. result.set(key, revive(value));
  2021. }
  2022. return result;
  2023. }
  2024. exports.reviveMap = reviveMap;
  2025. function getCustomSetDetails(val) {
  2026. const list = Array.from(val);
  2027. return {
  2028. _custom: {
  2029. type: "set",
  2030. display: `Set[${list.length}]`,
  2031. value: list,
  2032. readOnly: true
  2033. }
  2034. };
  2035. }
  2036. exports.getCustomSetDetails = getCustomSetDetails;
  2037. function reviveSet(val) {
  2038. const result = /* @__PURE__ */ new Set();
  2039. const list = val._custom.value;
  2040. for (let i2 = 0; i2 < list.length; i2++) {
  2041. const value = list[i2];
  2042. result.add(revive(value));
  2043. }
  2044. return result;
  2045. }
  2046. exports.reviveSet = reviveSet;
  2047. function basename(filename, ext) {
  2048. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  2049. }
  2050. function getComponentName(options) {
  2051. const name = options.displayName || options.name || options._componentTag;
  2052. if (name) {
  2053. return name;
  2054. }
  2055. const file = options.__file;
  2056. if (file) {
  2057. return (0, exports.classify)(basename(file, ".vue"));
  2058. }
  2059. }
  2060. exports.getComponentName = getComponentName;
  2061. function getCustomComponentDefinitionDetails(def) {
  2062. let display = getComponentName(def);
  2063. if (display) {
  2064. if (def.name && def.__file) {
  2065. display += ` <span>(${def.__file})</span>`;
  2066. }
  2067. } else {
  2068. display = "<i>Unknown Component</i>";
  2069. }
  2070. return {
  2071. _custom: {
  2072. type: "component-definition",
  2073. display,
  2074. tooltip: "Component definition",
  2075. ...def.__file ? {
  2076. file: def.__file
  2077. } : {}
  2078. }
  2079. };
  2080. }
  2081. exports.getCustomComponentDefinitionDetails = getCustomComponentDefinitionDetails;
  2082. function getCustomFunctionDetails(func) {
  2083. let string = "";
  2084. let matches = null;
  2085. try {
  2086. string = Function.prototype.toString.call(func);
  2087. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  2088. } catch (e2) {
  2089. }
  2090. const match = matches && matches[0];
  2091. const args = typeof match === "string" ? match : "(?)";
  2092. const name = typeof func.name === "string" ? func.name : "";
  2093. return {
  2094. _custom: {
  2095. type: "function",
  2096. display: `<span style="opacity:.5;">function</span> ${escape2(name)}${args}`,
  2097. tooltip: string.trim() ? `<pre>${string}</pre>` : null,
  2098. _reviveId: reviveCache.cache(func)
  2099. }
  2100. };
  2101. }
  2102. exports.getCustomFunctionDetails = getCustomFunctionDetails;
  2103. function getCustomHTMLElementDetails(value) {
  2104. try {
  2105. return {
  2106. _custom: {
  2107. type: "HTMLElement",
  2108. display: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  2109. value: namedNodeMapToObject(value.attributes),
  2110. actions: [{
  2111. icon: "input",
  2112. tooltip: "Log element to console",
  2113. action: () => {
  2114. console.log(value);
  2115. }
  2116. }]
  2117. }
  2118. };
  2119. } catch (e2) {
  2120. return {
  2121. _custom: {
  2122. type: "HTMLElement",
  2123. display: `<span class="text-blue-500">${String(value)}</span>`
  2124. }
  2125. };
  2126. }
  2127. }
  2128. exports.getCustomHTMLElementDetails = getCustomHTMLElementDetails;
  2129. function namedNodeMapToObject(map) {
  2130. const result = {};
  2131. const l2 = map.length;
  2132. for (let i2 = 0; i2 < l2; i2++) {
  2133. const node = map.item(i2);
  2134. result[node.name] = node.value;
  2135. }
  2136. return result;
  2137. }
  2138. function getCustomRefDetails(instance, key, ref) {
  2139. let value;
  2140. if (Array.isArray(ref)) {
  2141. value = ref.map((r2) => getCustomRefDetails(instance, key, r2)).map((data) => data.value);
  2142. } else {
  2143. let name;
  2144. if (ref._isVue) {
  2145. name = getComponentName(ref.$options);
  2146. } else {
  2147. name = ref.tagName.toLowerCase();
  2148. }
  2149. value = {
  2150. _custom: {
  2151. display: `&lt;${name}` + (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : "") + (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : "") + "&gt;",
  2152. uid: instance.__VUE_DEVTOOLS_UID__,
  2153. type: "reference"
  2154. }
  2155. };
  2156. }
  2157. return {
  2158. type: "$refs",
  2159. key,
  2160. value,
  2161. editable: false
  2162. };
  2163. }
  2164. exports.getCustomRefDetails = getCustomRefDetails;
  2165. function parse2(data, revive2 = false) {
  2166. return revive2 ? (0, transfer_1.parseCircularAutoChunks)(data, reviver) : (0, transfer_1.parseCircularAutoChunks)(data);
  2167. }
  2168. exports.parse = parse2;
  2169. const specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
  2170. const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  2171. function reviver(key, val) {
  2172. return revive(val);
  2173. }
  2174. function revive(val) {
  2175. if (val === exports.UNDEFINED) {
  2176. return void 0;
  2177. } else if (val === exports.INFINITY) {
  2178. return Infinity;
  2179. } else if (val === exports.NEGATIVE_INFINITY) {
  2180. return -Infinity;
  2181. } else if (val === exports.NAN) {
  2182. return NaN;
  2183. } else if (val && val._custom) {
  2184. const {
  2185. _custom: custom
  2186. } = val;
  2187. if (custom.type === "component") {
  2188. return (0, backend_1.getInstanceMap)().get(custom.id);
  2189. } else if (custom.type === "map") {
  2190. return reviveMap(val);
  2191. } else if (custom.type === "set") {
  2192. return reviveSet(val);
  2193. } else if (custom._reviveId) {
  2194. return reviveCache.read(custom._reviveId);
  2195. } else {
  2196. return revive(custom.value);
  2197. }
  2198. } else if (symbolRE.test(val)) {
  2199. const [, string] = symbolRE.exec(val);
  2200. return Symbol.for(string);
  2201. } else if (specialTypeRE.test(val)) {
  2202. const [, type, string, , details] = specialTypeRE.exec(val);
  2203. const result = new env_1.target[type](string);
  2204. if (type === "Error" && details) {
  2205. result.stack = details;
  2206. }
  2207. return result;
  2208. } else {
  2209. return val;
  2210. }
  2211. }
  2212. exports.revive = revive;
  2213. function sanitize(data) {
  2214. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  2215. return Object.prototype.toString.call(data);
  2216. } else {
  2217. return data;
  2218. }
  2219. }
  2220. function isPlainObject(obj) {
  2221. return Object.prototype.toString.call(obj) === "[object Object]";
  2222. }
  2223. exports.isPlainObject = isPlainObject;
  2224. function isPrimitive(data) {
  2225. if (data == null) {
  2226. return true;
  2227. }
  2228. const type = typeof data;
  2229. return type === "string" || type === "number" || type === "boolean";
  2230. }
  2231. function searchDeepInObject(obj, searchTerm) {
  2232. const seen = /* @__PURE__ */ new Map();
  2233. const result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0);
  2234. seen.clear();
  2235. return result;
  2236. }
  2237. exports.searchDeepInObject = searchDeepInObject;
  2238. const SEARCH_MAX_DEPTH = 10;
  2239. function internalSearchObject(obj, searchTerm, seen, depth) {
  2240. if (depth > SEARCH_MAX_DEPTH) {
  2241. return false;
  2242. }
  2243. let match = false;
  2244. const keys = Object.keys(obj);
  2245. let key, value;
  2246. for (let i2 = 0; i2 < keys.length; i2++) {
  2247. key = keys[i2];
  2248. value = obj[key];
  2249. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1);
  2250. if (match) {
  2251. break;
  2252. }
  2253. }
  2254. return match;
  2255. }
  2256. function internalSearchArray(array, searchTerm, seen, depth) {
  2257. if (depth > SEARCH_MAX_DEPTH) {
  2258. return false;
  2259. }
  2260. let match = false;
  2261. let value;
  2262. for (let i2 = 0; i2 < array.length; i2++) {
  2263. value = array[i2];
  2264. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1);
  2265. if (match) {
  2266. break;
  2267. }
  2268. }
  2269. return match;
  2270. }
  2271. function internalSearchCheck(searchTerm, key, value, seen, depth) {
  2272. let match = false;
  2273. let result;
  2274. if (key === "_custom") {
  2275. key = value.display;
  2276. value = value.value;
  2277. }
  2278. (result = specialTokenToString(value)) && (value = result);
  2279. if (key && compare(key, searchTerm)) {
  2280. match = true;
  2281. seen.set(value, true);
  2282. } else if (seen.has(value)) {
  2283. match = seen.get(value);
  2284. } else if (Array.isArray(value)) {
  2285. seen.set(value, null);
  2286. match = internalSearchArray(value, searchTerm, seen, depth);
  2287. seen.set(value, match);
  2288. } else if (isPlainObject(value)) {
  2289. seen.set(value, null);
  2290. match = internalSearchObject(value, searchTerm, seen, depth);
  2291. seen.set(value, match);
  2292. } else if (compare(value, searchTerm)) {
  2293. match = true;
  2294. seen.set(value, true);
  2295. }
  2296. return match;
  2297. }
  2298. function compare(value, searchTerm) {
  2299. return ("" + value).toLowerCase().indexOf(searchTerm) !== -1;
  2300. }
  2301. function sortByKey(state) {
  2302. return state && state.slice().sort((a2, b2) => {
  2303. if (a2.key < b2.key)
  2304. return -1;
  2305. if (a2.key > b2.key)
  2306. return 1;
  2307. return 0;
  2308. });
  2309. }
  2310. exports.sortByKey = sortByKey;
  2311. function simpleGet(object, path) {
  2312. const sections = Array.isArray(path) ? path : path.split(".");
  2313. for (let i2 = 0; i2 < sections.length; i2++) {
  2314. object = object[sections[i2]];
  2315. if (!object) {
  2316. return void 0;
  2317. }
  2318. }
  2319. return object;
  2320. }
  2321. exports.simpleGet = simpleGet;
  2322. function focusInput(el) {
  2323. el.focus();
  2324. el.setSelectionRange(0, el.value.length);
  2325. }
  2326. exports.focusInput = focusInput;
  2327. function openInEditor(file) {
  2328. const fileName = file.replace(/\\/g, "\\\\");
  2329. const src = `fetch('${shared_data_1.SharedData.openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  2330. if (response.ok) {
  2331. console.log('File ${fileName} opened in editor')
  2332. } else {
  2333. const msg = 'Opening component ${fileName} failed'
  2334. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  2335. if (target.__VUE_DEVTOOLS_TOAST__) {
  2336. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  2337. } else {
  2338. console.log('%c' + msg, 'color:red')
  2339. }
  2340. console.log('Check the setup of your project, see https://devtools.vuejs.org/guide/open-in-editor.html')
  2341. }
  2342. })`;
  2343. if (env_1.isChrome) {
  2344. env_1.target.chrome.devtools.inspectedWindow.eval(src);
  2345. } else {
  2346. [eval][0](src);
  2347. }
  2348. }
  2349. exports.openInEditor = openInEditor;
  2350. const ESC = {
  2351. "<": "&lt;",
  2352. ">": "&gt;",
  2353. '"': "&quot;",
  2354. "&": "&amp;"
  2355. };
  2356. function escape2(s2) {
  2357. return s2.replace(/[<>"&]/g, escapeChar);
  2358. }
  2359. exports.escape = escape2;
  2360. function escapeChar(a2) {
  2361. return ESC[a2] || a2;
  2362. }
  2363. function copyToClipboard(state) {
  2364. let text;
  2365. if (typeof state !== "object") {
  2366. text = String(state);
  2367. } else {
  2368. text = stringify(state, "user");
  2369. }
  2370. if (typeof document === "undefined")
  2371. return;
  2372. const dummyTextArea = document.createElement("textarea");
  2373. dummyTextArea.textContent = text;
  2374. document.body.appendChild(dummyTextArea);
  2375. dummyTextArea.select();
  2376. document.execCommand("copy");
  2377. document.body.removeChild(dummyTextArea);
  2378. }
  2379. exports.copyToClipboard = copyToClipboard;
  2380. function isEmptyObject(obj) {
  2381. return obj === exports.UNDEFINED || !obj || Object.keys(obj).length === 0;
  2382. }
  2383. exports.isEmptyObject = isEmptyObject;
  2384. }
  2385. ),
  2386. /***/
  2387. "../../node_modules/events/events.js": (
  2388. /*!*******************************************!*\
  2389. !*** ../../node_modules/events/events.js ***!
  2390. \*******************************************/
  2391. /***/
  2392. (module) => {
  2393. var R2 = typeof Reflect === "object" ? Reflect : null;
  2394. var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
  2395. return Function.prototype.apply.call(target, receiver, args);
  2396. };
  2397. var ReflectOwnKeys;
  2398. if (R2 && typeof R2.ownKeys === "function") {
  2399. ReflectOwnKeys = R2.ownKeys;
  2400. } else if (Object.getOwnPropertySymbols) {
  2401. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  2402. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  2403. };
  2404. } else {
  2405. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  2406. return Object.getOwnPropertyNames(target);
  2407. };
  2408. }
  2409. function ProcessEmitWarning(warning) {
  2410. if (console && console.warn)
  2411. console.warn(warning);
  2412. }
  2413. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  2414. return value !== value;
  2415. };
  2416. function EventEmitter() {
  2417. EventEmitter.init.call(this);
  2418. }
  2419. module.exports = EventEmitter;
  2420. module.exports.once = once;
  2421. EventEmitter.EventEmitter = EventEmitter;
  2422. EventEmitter.prototype._events = void 0;
  2423. EventEmitter.prototype._eventsCount = 0;
  2424. EventEmitter.prototype._maxListeners = void 0;
  2425. var defaultMaxListeners = 10;
  2426. function checkListener(listener) {
  2427. if (typeof listener !== "function") {
  2428. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  2429. }
  2430. }
  2431. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  2432. enumerable: true,
  2433. get: function() {
  2434. return defaultMaxListeners;
  2435. },
  2436. set: function(arg) {
  2437. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  2438. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  2439. }
  2440. defaultMaxListeners = arg;
  2441. }
  2442. });
  2443. EventEmitter.init = function() {
  2444. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  2445. this._events = /* @__PURE__ */ Object.create(null);
  2446. this._eventsCount = 0;
  2447. }
  2448. this._maxListeners = this._maxListeners || void 0;
  2449. };
  2450. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n2) {
  2451. if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
  2452. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
  2453. }
  2454. this._maxListeners = n2;
  2455. return this;
  2456. };
  2457. function _getMaxListeners(that) {
  2458. if (that._maxListeners === void 0)
  2459. return EventEmitter.defaultMaxListeners;
  2460. return that._maxListeners;
  2461. }
  2462. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  2463. return _getMaxListeners(this);
  2464. };
  2465. EventEmitter.prototype.emit = function emit(type) {
  2466. var args = [];
  2467. for (var i2 = 1; i2 < arguments.length; i2++)
  2468. args.push(arguments[i2]);
  2469. var doError = type === "error";
  2470. var events = this._events;
  2471. if (events !== void 0)
  2472. doError = doError && events.error === void 0;
  2473. else if (!doError)
  2474. return false;
  2475. if (doError) {
  2476. var er;
  2477. if (args.length > 0)
  2478. er = args[0];
  2479. if (er instanceof Error) {
  2480. throw er;
  2481. }
  2482. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  2483. err.context = er;
  2484. throw err;
  2485. }
  2486. var handler = events[type];
  2487. if (handler === void 0)
  2488. return false;
  2489. if (typeof handler === "function") {
  2490. ReflectApply(handler, this, args);
  2491. } else {
  2492. var len = handler.length;
  2493. var listeners = arrayClone(handler, len);
  2494. for (var i2 = 0; i2 < len; ++i2)
  2495. ReflectApply(listeners[i2], this, args);
  2496. }
  2497. return true;
  2498. };
  2499. function _addListener(target, type, listener, prepend) {
  2500. var m2;
  2501. var events;
  2502. var existing;
  2503. checkListener(listener);
  2504. events = target._events;
  2505. if (events === void 0) {
  2506. events = target._events = /* @__PURE__ */ Object.create(null);
  2507. target._eventsCount = 0;
  2508. } else {
  2509. if (events.newListener !== void 0) {
  2510. target.emit(
  2511. "newListener",
  2512. type,
  2513. listener.listener ? listener.listener : listener
  2514. );
  2515. events = target._events;
  2516. }
  2517. existing = events[type];
  2518. }
  2519. if (existing === void 0) {
  2520. existing = events[type] = listener;
  2521. ++target._eventsCount;
  2522. } else {
  2523. if (typeof existing === "function") {
  2524. existing = events[type] = prepend ? [listener, existing] : [existing, listener];
  2525. } else if (prepend) {
  2526. existing.unshift(listener);
  2527. } else {
  2528. existing.push(listener);
  2529. }
  2530. m2 = _getMaxListeners(target);
  2531. if (m2 > 0 && existing.length > m2 && !existing.warned) {
  2532. existing.warned = true;
  2533. var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  2534. w2.name = "MaxListenersExceededWarning";
  2535. w2.emitter = target;
  2536. w2.type = type;
  2537. w2.count = existing.length;
  2538. ProcessEmitWarning(w2);
  2539. }
  2540. }
  2541. return target;
  2542. }
  2543. EventEmitter.prototype.addListener = function addListener(type, listener) {
  2544. return _addListener(this, type, listener, false);
  2545. };
  2546. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  2547. EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  2548. return _addListener(this, type, listener, true);
  2549. };
  2550. function onceWrapper() {
  2551. if (!this.fired) {
  2552. this.target.removeListener(this.type, this.wrapFn);
  2553. this.fired = true;
  2554. if (arguments.length === 0)
  2555. return this.listener.call(this.target);
  2556. return this.listener.apply(this.target, arguments);
  2557. }
  2558. }
  2559. function _onceWrap(target, type, listener) {
  2560. var state = { fired: false, wrapFn: void 0, target, type, listener };
  2561. var wrapped = onceWrapper.bind(state);
  2562. wrapped.listener = listener;
  2563. state.wrapFn = wrapped;
  2564. return wrapped;
  2565. }
  2566. EventEmitter.prototype.once = function once2(type, listener) {
  2567. checkListener(listener);
  2568. this.on(type, _onceWrap(this, type, listener));
  2569. return this;
  2570. };
  2571. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  2572. checkListener(listener);
  2573. this.prependListener(type, _onceWrap(this, type, listener));
  2574. return this;
  2575. };
  2576. EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  2577. var list, events, position, i2, originalListener;
  2578. checkListener(listener);
  2579. events = this._events;
  2580. if (events === void 0)
  2581. return this;
  2582. list = events[type];
  2583. if (list === void 0)
  2584. return this;
  2585. if (list === listener || list.listener === listener) {
  2586. if (--this._eventsCount === 0)
  2587. this._events = /* @__PURE__ */ Object.create(null);
  2588. else {
  2589. delete events[type];
  2590. if (events.removeListener)
  2591. this.emit("removeListener", type, list.listener || listener);
  2592. }
  2593. } else if (typeof list !== "function") {
  2594. position = -1;
  2595. for (i2 = list.length - 1; i2 >= 0; i2--) {
  2596. if (list[i2] === listener || list[i2].listener === listener) {
  2597. originalListener = list[i2].listener;
  2598. position = i2;
  2599. break;
  2600. }
  2601. }
  2602. if (position < 0)
  2603. return this;
  2604. if (position === 0)
  2605. list.shift();
  2606. else {
  2607. spliceOne(list, position);
  2608. }
  2609. if (list.length === 1)
  2610. events[type] = list[0];
  2611. if (events.removeListener !== void 0)
  2612. this.emit("removeListener", type, originalListener || listener);
  2613. }
  2614. return this;
  2615. };
  2616. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  2617. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  2618. var listeners, events, i2;
  2619. events = this._events;
  2620. if (events === void 0)
  2621. return this;
  2622. if (events.removeListener === void 0) {
  2623. if (arguments.length === 0) {
  2624. this._events = /* @__PURE__ */ Object.create(null);
  2625. this._eventsCount = 0;
  2626. } else if (events[type] !== void 0) {
  2627. if (--this._eventsCount === 0)
  2628. this._events = /* @__PURE__ */ Object.create(null);
  2629. else
  2630. delete events[type];
  2631. }
  2632. return this;
  2633. }
  2634. if (arguments.length === 0) {
  2635. var keys = Object.keys(events);
  2636. var key;
  2637. for (i2 = 0; i2 < keys.length; ++i2) {
  2638. key = keys[i2];
  2639. if (key === "removeListener")
  2640. continue;
  2641. this.removeAllListeners(key);
  2642. }
  2643. this.removeAllListeners("removeListener");
  2644. this._events = /* @__PURE__ */ Object.create(null);
  2645. this._eventsCount = 0;
  2646. return this;
  2647. }
  2648. listeners = events[type];
  2649. if (typeof listeners === "function") {
  2650. this.removeListener(type, listeners);
  2651. } else if (listeners !== void 0) {
  2652. for (i2 = listeners.length - 1; i2 >= 0; i2--) {
  2653. this.removeListener(type, listeners[i2]);
  2654. }
  2655. }
  2656. return this;
  2657. };
  2658. function _listeners(target, type, unwrap) {
  2659. var events = target._events;
  2660. if (events === void 0)
  2661. return [];
  2662. var evlistener = events[type];
  2663. if (evlistener === void 0)
  2664. return [];
  2665. if (typeof evlistener === "function")
  2666. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  2667. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  2668. }
  2669. EventEmitter.prototype.listeners = function listeners(type) {
  2670. return _listeners(this, type, true);
  2671. };
  2672. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  2673. return _listeners(this, type, false);
  2674. };
  2675. EventEmitter.listenerCount = function(emitter, type) {
  2676. if (typeof emitter.listenerCount === "function") {
  2677. return emitter.listenerCount(type);
  2678. } else {
  2679. return listenerCount.call(emitter, type);
  2680. }
  2681. };
  2682. EventEmitter.prototype.listenerCount = listenerCount;
  2683. function listenerCount(type) {
  2684. var events = this._events;
  2685. if (events !== void 0) {
  2686. var evlistener = events[type];
  2687. if (typeof evlistener === "function") {
  2688. return 1;
  2689. } else if (evlistener !== void 0) {
  2690. return evlistener.length;
  2691. }
  2692. }
  2693. return 0;
  2694. }
  2695. EventEmitter.prototype.eventNames = function eventNames() {
  2696. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  2697. };
  2698. function arrayClone(arr, n2) {
  2699. var copy = new Array(n2);
  2700. for (var i2 = 0; i2 < n2; ++i2)
  2701. copy[i2] = arr[i2];
  2702. return copy;
  2703. }
  2704. function spliceOne(list, index) {
  2705. for (; index + 1 < list.length; index++)
  2706. list[index] = list[index + 1];
  2707. list.pop();
  2708. }
  2709. function unwrapListeners(arr) {
  2710. var ret = new Array(arr.length);
  2711. for (var i2 = 0; i2 < ret.length; ++i2) {
  2712. ret[i2] = arr[i2].listener || arr[i2];
  2713. }
  2714. return ret;
  2715. }
  2716. function once(emitter, name) {
  2717. return new Promise(function(resolve, reject) {
  2718. function errorListener(err) {
  2719. emitter.removeListener(name, resolver);
  2720. reject(err);
  2721. }
  2722. function resolver() {
  2723. if (typeof emitter.removeListener === "function") {
  2724. emitter.removeListener("error", errorListener);
  2725. }
  2726. resolve([].slice.call(arguments));
  2727. }
  2728. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  2729. if (name !== "error") {
  2730. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  2731. }
  2732. });
  2733. }
  2734. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  2735. if (typeof emitter.on === "function") {
  2736. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  2737. }
  2738. }
  2739. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  2740. if (typeof emitter.on === "function") {
  2741. if (flags.once) {
  2742. emitter.once(name, listener);
  2743. } else {
  2744. emitter.on(name, listener);
  2745. }
  2746. } else if (typeof emitter.addEventListener === "function") {
  2747. emitter.addEventListener(name, function wrapListener(arg) {
  2748. if (flags.once) {
  2749. emitter.removeEventListener(name, wrapListener);
  2750. }
  2751. listener(arg);
  2752. });
  2753. } else {
  2754. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  2755. }
  2756. }
  2757. }
  2758. ),
  2759. /***/
  2760. "../../node_modules/path-browserify/index.js": (
  2761. /*!***************************************************!*\
  2762. !*** ../../node_modules/path-browserify/index.js ***!
  2763. \***************************************************/
  2764. /***/
  2765. (module) => {
  2766. function assertPath(path) {
  2767. if (typeof path !== "string") {
  2768. throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
  2769. }
  2770. }
  2771. function normalizeStringPosix(path, allowAboveRoot) {
  2772. var res = "";
  2773. var lastSegmentLength = 0;
  2774. var lastSlash = -1;
  2775. var dots = 0;
  2776. var code;
  2777. for (var i2 = 0; i2 <= path.length; ++i2) {
  2778. if (i2 < path.length)
  2779. code = path.charCodeAt(i2);
  2780. else if (code === 47)
  2781. break;
  2782. else
  2783. code = 47;
  2784. if (code === 47) {
  2785. if (lastSlash === i2 - 1 || dots === 1)
  2786. ;
  2787. else if (lastSlash !== i2 - 1 && dots === 2) {
  2788. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
  2789. if (res.length > 2) {
  2790. var lastSlashIndex = res.lastIndexOf("/");
  2791. if (lastSlashIndex !== res.length - 1) {
  2792. if (lastSlashIndex === -1) {
  2793. res = "";
  2794. lastSegmentLength = 0;
  2795. } else {
  2796. res = res.slice(0, lastSlashIndex);
  2797. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  2798. }
  2799. lastSlash = i2;
  2800. dots = 0;
  2801. continue;
  2802. }
  2803. } else if (res.length === 2 || res.length === 1) {
  2804. res = "";
  2805. lastSegmentLength = 0;
  2806. lastSlash = i2;
  2807. dots = 0;
  2808. continue;
  2809. }
  2810. }
  2811. if (allowAboveRoot) {
  2812. if (res.length > 0)
  2813. res += "/..";
  2814. else
  2815. res = "..";
  2816. lastSegmentLength = 2;
  2817. }
  2818. } else {
  2819. if (res.length > 0)
  2820. res += "/" + path.slice(lastSlash + 1, i2);
  2821. else
  2822. res = path.slice(lastSlash + 1, i2);
  2823. lastSegmentLength = i2 - lastSlash - 1;
  2824. }
  2825. lastSlash = i2;
  2826. dots = 0;
  2827. } else if (code === 46 && dots !== -1) {
  2828. ++dots;
  2829. } else {
  2830. dots = -1;
  2831. }
  2832. }
  2833. return res;
  2834. }
  2835. function _format(sep, pathObject) {
  2836. var dir = pathObject.dir || pathObject.root;
  2837. var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  2838. if (!dir) {
  2839. return base;
  2840. }
  2841. if (dir === pathObject.root) {
  2842. return dir + base;
  2843. }
  2844. return dir + sep + base;
  2845. }
  2846. var posix = {
  2847. // path.resolve([from ...], to)
  2848. resolve: function resolve() {
  2849. var resolvedPath = "";
  2850. var resolvedAbsolute = false;
  2851. var cwd;
  2852. for (var i2 = arguments.length - 1; i2 >= -1 && !resolvedAbsolute; i2--) {
  2853. var path;
  2854. if (i2 >= 0)
  2855. path = arguments[i2];
  2856. else {
  2857. if (cwd === void 0)
  2858. cwd = process.cwd();
  2859. path = cwd;
  2860. }
  2861. assertPath(path);
  2862. if (path.length === 0) {
  2863. continue;
  2864. }
  2865. resolvedPath = path + "/" + resolvedPath;
  2866. resolvedAbsolute = path.charCodeAt(0) === 47;
  2867. }
  2868. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  2869. if (resolvedAbsolute) {
  2870. if (resolvedPath.length > 0)
  2871. return "/" + resolvedPath;
  2872. else
  2873. return "/";
  2874. } else if (resolvedPath.length > 0) {
  2875. return resolvedPath;
  2876. } else {
  2877. return ".";
  2878. }
  2879. },
  2880. normalize: function normalize(path) {
  2881. assertPath(path);
  2882. if (path.length === 0)
  2883. return ".";
  2884. var isAbsolute = path.charCodeAt(0) === 47;
  2885. var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  2886. path = normalizeStringPosix(path, !isAbsolute);
  2887. if (path.length === 0 && !isAbsolute)
  2888. path = ".";
  2889. if (path.length > 0 && trailingSeparator)
  2890. path += "/";
  2891. if (isAbsolute)
  2892. return "/" + path;
  2893. return path;
  2894. },
  2895. isAbsolute: function isAbsolute(path) {
  2896. assertPath(path);
  2897. return path.length > 0 && path.charCodeAt(0) === 47;
  2898. },
  2899. join: function join() {
  2900. if (arguments.length === 0)
  2901. return ".";
  2902. var joined;
  2903. for (var i2 = 0; i2 < arguments.length; ++i2) {
  2904. var arg = arguments[i2];
  2905. assertPath(arg);
  2906. if (arg.length > 0) {
  2907. if (joined === void 0)
  2908. joined = arg;
  2909. else
  2910. joined += "/" + arg;
  2911. }
  2912. }
  2913. if (joined === void 0)
  2914. return ".";
  2915. return posix.normalize(joined);
  2916. },
  2917. relative: function relative(from, to) {
  2918. assertPath(from);
  2919. assertPath(to);
  2920. if (from === to)
  2921. return "";
  2922. from = posix.resolve(from);
  2923. to = posix.resolve(to);
  2924. if (from === to)
  2925. return "";
  2926. var fromStart = 1;
  2927. for (; fromStart < from.length; ++fromStart) {
  2928. if (from.charCodeAt(fromStart) !== 47)
  2929. break;
  2930. }
  2931. var fromEnd = from.length;
  2932. var fromLen = fromEnd - fromStart;
  2933. var toStart = 1;
  2934. for (; toStart < to.length; ++toStart) {
  2935. if (to.charCodeAt(toStart) !== 47)
  2936. break;
  2937. }
  2938. var toEnd = to.length;
  2939. var toLen = toEnd - toStart;
  2940. var length = fromLen < toLen ? fromLen : toLen;
  2941. var lastCommonSep = -1;
  2942. var i2 = 0;
  2943. for (; i2 <= length; ++i2) {
  2944. if (i2 === length) {
  2945. if (toLen > length) {
  2946. if (to.charCodeAt(toStart + i2) === 47) {
  2947. return to.slice(toStart + i2 + 1);
  2948. } else if (i2 === 0) {
  2949. return to.slice(toStart + i2);
  2950. }
  2951. } else if (fromLen > length) {
  2952. if (from.charCodeAt(fromStart + i2) === 47) {
  2953. lastCommonSep = i2;
  2954. } else if (i2 === 0) {
  2955. lastCommonSep = 0;
  2956. }
  2957. }
  2958. break;
  2959. }
  2960. var fromCode = from.charCodeAt(fromStart + i2);
  2961. var toCode = to.charCodeAt(toStart + i2);
  2962. if (fromCode !== toCode)
  2963. break;
  2964. else if (fromCode === 47)
  2965. lastCommonSep = i2;
  2966. }
  2967. var out = "";
  2968. for (i2 = fromStart + lastCommonSep + 1; i2 <= fromEnd; ++i2) {
  2969. if (i2 === fromEnd || from.charCodeAt(i2) === 47) {
  2970. if (out.length === 0)
  2971. out += "..";
  2972. else
  2973. out += "/..";
  2974. }
  2975. }
  2976. if (out.length > 0)
  2977. return out + to.slice(toStart + lastCommonSep);
  2978. else {
  2979. toStart += lastCommonSep;
  2980. if (to.charCodeAt(toStart) === 47)
  2981. ++toStart;
  2982. return to.slice(toStart);
  2983. }
  2984. },
  2985. _makeLong: function _makeLong(path) {
  2986. return path;
  2987. },
  2988. dirname: function dirname(path) {
  2989. assertPath(path);
  2990. if (path.length === 0)
  2991. return ".";
  2992. var code = path.charCodeAt(0);
  2993. var hasRoot = code === 47;
  2994. var end = -1;
  2995. var matchedSlash = true;
  2996. for (var i2 = path.length - 1; i2 >= 1; --i2) {
  2997. code = path.charCodeAt(i2);
  2998. if (code === 47) {
  2999. if (!matchedSlash) {
  3000. end = i2;
  3001. break;
  3002. }
  3003. } else {
  3004. matchedSlash = false;
  3005. }
  3006. }
  3007. if (end === -1)
  3008. return hasRoot ? "/" : ".";
  3009. if (hasRoot && end === 1)
  3010. return "//";
  3011. return path.slice(0, end);
  3012. },
  3013. basename: function basename(path, ext) {
  3014. if (ext !== void 0 && typeof ext !== "string")
  3015. throw new TypeError('"ext" argument must be a string');
  3016. assertPath(path);
  3017. var start = 0;
  3018. var end = -1;
  3019. var matchedSlash = true;
  3020. var i2;
  3021. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  3022. if (ext.length === path.length && ext === path)
  3023. return "";
  3024. var extIdx = ext.length - 1;
  3025. var firstNonSlashEnd = -1;
  3026. for (i2 = path.length - 1; i2 >= 0; --i2) {
  3027. var code = path.charCodeAt(i2);
  3028. if (code === 47) {
  3029. if (!matchedSlash) {
  3030. start = i2 + 1;
  3031. break;
  3032. }
  3033. } else {
  3034. if (firstNonSlashEnd === -1) {
  3035. matchedSlash = false;
  3036. firstNonSlashEnd = i2 + 1;
  3037. }
  3038. if (extIdx >= 0) {
  3039. if (code === ext.charCodeAt(extIdx)) {
  3040. if (--extIdx === -1) {
  3041. end = i2;
  3042. }
  3043. } else {
  3044. extIdx = -1;
  3045. end = firstNonSlashEnd;
  3046. }
  3047. }
  3048. }
  3049. }
  3050. if (start === end)
  3051. end = firstNonSlashEnd;
  3052. else if (end === -1)
  3053. end = path.length;
  3054. return path.slice(start, end);
  3055. } else {
  3056. for (i2 = path.length - 1; i2 >= 0; --i2) {
  3057. if (path.charCodeAt(i2) === 47) {
  3058. if (!matchedSlash) {
  3059. start = i2 + 1;
  3060. break;
  3061. }
  3062. } else if (end === -1) {
  3063. matchedSlash = false;
  3064. end = i2 + 1;
  3065. }
  3066. }
  3067. if (end === -1)
  3068. return "";
  3069. return path.slice(start, end);
  3070. }
  3071. },
  3072. extname: function extname(path) {
  3073. assertPath(path);
  3074. var startDot = -1;
  3075. var startPart = 0;
  3076. var end = -1;
  3077. var matchedSlash = true;
  3078. var preDotState = 0;
  3079. for (var i2 = path.length - 1; i2 >= 0; --i2) {
  3080. var code = path.charCodeAt(i2);
  3081. if (code === 47) {
  3082. if (!matchedSlash) {
  3083. startPart = i2 + 1;
  3084. break;
  3085. }
  3086. continue;
  3087. }
  3088. if (end === -1) {
  3089. matchedSlash = false;
  3090. end = i2 + 1;
  3091. }
  3092. if (code === 46) {
  3093. if (startDot === -1)
  3094. startDot = i2;
  3095. else if (preDotState !== 1)
  3096. preDotState = 1;
  3097. } else if (startDot !== -1) {
  3098. preDotState = -1;
  3099. }
  3100. }
  3101. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  3102. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  3103. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3104. return "";
  3105. }
  3106. return path.slice(startDot, end);
  3107. },
  3108. format: function format(pathObject) {
  3109. if (pathObject === null || typeof pathObject !== "object") {
  3110. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  3111. }
  3112. return _format("/", pathObject);
  3113. },
  3114. parse: function parse2(path) {
  3115. assertPath(path);
  3116. var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  3117. if (path.length === 0)
  3118. return ret;
  3119. var code = path.charCodeAt(0);
  3120. var isAbsolute = code === 47;
  3121. var start;
  3122. if (isAbsolute) {
  3123. ret.root = "/";
  3124. start = 1;
  3125. } else {
  3126. start = 0;
  3127. }
  3128. var startDot = -1;
  3129. var startPart = 0;
  3130. var end = -1;
  3131. var matchedSlash = true;
  3132. var i2 = path.length - 1;
  3133. var preDotState = 0;
  3134. for (; i2 >= start; --i2) {
  3135. code = path.charCodeAt(i2);
  3136. if (code === 47) {
  3137. if (!matchedSlash) {
  3138. startPart = i2 + 1;
  3139. break;
  3140. }
  3141. continue;
  3142. }
  3143. if (end === -1) {
  3144. matchedSlash = false;
  3145. end = i2 + 1;
  3146. }
  3147. if (code === 46) {
  3148. if (startDot === -1)
  3149. startDot = i2;
  3150. else if (preDotState !== 1)
  3151. preDotState = 1;
  3152. } else if (startDot !== -1) {
  3153. preDotState = -1;
  3154. }
  3155. }
  3156. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  3157. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  3158. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3159. if (end !== -1) {
  3160. if (startPart === 0 && isAbsolute)
  3161. ret.base = ret.name = path.slice(1, end);
  3162. else
  3163. ret.base = ret.name = path.slice(startPart, end);
  3164. }
  3165. } else {
  3166. if (startPart === 0 && isAbsolute) {
  3167. ret.name = path.slice(1, startDot);
  3168. ret.base = path.slice(1, end);
  3169. } else {
  3170. ret.name = path.slice(startPart, startDot);
  3171. ret.base = path.slice(startPart, end);
  3172. }
  3173. ret.ext = path.slice(startDot, end);
  3174. }
  3175. if (startPart > 0)
  3176. ret.dir = path.slice(0, startPart - 1);
  3177. else if (isAbsolute)
  3178. ret.dir = "/";
  3179. return ret;
  3180. },
  3181. sep: "/",
  3182. delimiter: ":",
  3183. win32: null,
  3184. posix: null
  3185. };
  3186. posix.posix = posix;
  3187. module.exports = posix;
  3188. }
  3189. )
  3190. /******/
  3191. };
  3192. var __webpack_module_cache__ = {};
  3193. function __webpack_require__(moduleId) {
  3194. var cachedModule = __webpack_module_cache__[moduleId];
  3195. if (cachedModule !== void 0) {
  3196. return cachedModule.exports;
  3197. }
  3198. var module = __webpack_module_cache__[moduleId] = {
  3199. /******/
  3200. // no module.id needed
  3201. /******/
  3202. // no module.loaded needed
  3203. /******/
  3204. exports: {}
  3205. /******/
  3206. };
  3207. __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  3208. return module.exports;
  3209. }
  3210. (() => {
  3211. __webpack_require__.n = (module) => {
  3212. var getter = module && module.__esModule ? (
  3213. /******/
  3214. () => module["default"]
  3215. ) : (
  3216. /******/
  3217. () => module
  3218. );
  3219. __webpack_require__.d(getter, { a: getter });
  3220. return getter;
  3221. };
  3222. })();
  3223. (() => {
  3224. __webpack_require__.d = (exports, definition) => {
  3225. for (var key in definition) {
  3226. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  3227. Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  3228. }
  3229. }
  3230. };
  3231. })();
  3232. (() => {
  3233. __webpack_require__.g = function() {
  3234. if (typeof globalThis === "object")
  3235. return globalThis;
  3236. try {
  3237. return this || new Function("return this")();
  3238. } catch (e2) {
  3239. if (typeof window === "object")
  3240. return window;
  3241. }
  3242. }();
  3243. })();
  3244. (() => {
  3245. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  3246. })();
  3247. (() => {
  3248. __webpack_require__.r = (exports) => {
  3249. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  3250. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  3251. }
  3252. Object.defineProperty(exports, "__esModule", { value: true });
  3253. };
  3254. })();
  3255. var __webpack_exports__ = {};
  3256. (() => {
  3257. /*!*********************!*\
  3258. !*** ./src/hook.ts ***!
  3259. \*********************/
  3260. __webpack_require__.r(__webpack_exports__);
  3261. var _back_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
  3262. /*! @back/hook */
  3263. "../app-backend-core/lib/hook.js"
  3264. );
  3265. var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
  3266. /*! @vue-devtools/shared-utils */
  3267. "../shared-utils/lib/index.js"
  3268. );
  3269. (0, _back_hook__WEBPACK_IMPORTED_MODULE_0__.installHook)(_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target);
  3270. })();
  3271. })();
  3272. (function() {
  3273. var __webpack_modules__ = {
  3274. /***/
  3275. "../api/lib/esm/const.js": (
  3276. /*!*******************************!*\
  3277. !*** ../api/lib/esm/const.js ***!
  3278. \*******************************/
  3279. /***/
  3280. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3281. __webpack_require__2.r(__webpack_exports__2);
  3282. __webpack_require__2.d(__webpack_exports__2, {
  3283. /* harmony export */
  3284. "HOOK_PLUGIN_SETTINGS_SET": () => (
  3285. /* binding */
  3286. HOOK_PLUGIN_SETTINGS_SET
  3287. ),
  3288. /* harmony export */
  3289. "HOOK_SETUP": () => (
  3290. /* binding */
  3291. HOOK_SETUP
  3292. )
  3293. /* harmony export */
  3294. });
  3295. const HOOK_SETUP = "devtools-plugin:setup";
  3296. const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
  3297. }
  3298. ),
  3299. /***/
  3300. "../api/lib/esm/env.js": (
  3301. /*!*****************************!*\
  3302. !*** ../api/lib/esm/env.js ***!
  3303. \*****************************/
  3304. /***/
  3305. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3306. __webpack_require__2.r(__webpack_exports__2);
  3307. __webpack_require__2.d(__webpack_exports__2, {
  3308. /* harmony export */
  3309. "getDevtoolsGlobalHook": () => (
  3310. /* binding */
  3311. getDevtoolsGlobalHook
  3312. ),
  3313. /* harmony export */
  3314. "getTarget": () => (
  3315. /* binding */
  3316. getTarget2
  3317. ),
  3318. /* harmony export */
  3319. "isProxyAvailable": () => (
  3320. /* binding */
  3321. isProxyAvailable
  3322. )
  3323. /* harmony export */
  3324. });
  3325. function getDevtoolsGlobalHook() {
  3326. return getTarget2().__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3327. }
  3328. function getTarget2() {
  3329. return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  3330. }
  3331. const isProxyAvailable = typeof Proxy === "function";
  3332. }
  3333. ),
  3334. /***/
  3335. "../api/lib/esm/index.js": (
  3336. /*!*******************************!*\
  3337. !*** ../api/lib/esm/index.js ***!
  3338. \*******************************/
  3339. /***/
  3340. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3341. __webpack_require__2.r(__webpack_exports__2);
  3342. __webpack_require__2.d(__webpack_exports__2, {
  3343. /* harmony export */
  3344. "isPerformanceSupported": () => (
  3345. /* reexport safe */
  3346. _time_js__WEBPACK_IMPORTED_MODULE_0__.isPerformanceSupported
  3347. ),
  3348. /* harmony export */
  3349. "now": () => (
  3350. /* reexport safe */
  3351. _time_js__WEBPACK_IMPORTED_MODULE_0__.now
  3352. ),
  3353. /* harmony export */
  3354. "setupDevtoolsPlugin": () => (
  3355. /* binding */
  3356. setupDevtoolsPlugin
  3357. )
  3358. /* harmony export */
  3359. });
  3360. var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2(
  3361. /*! ./env.js */
  3362. "../api/lib/esm/env.js"
  3363. );
  3364. var _const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2(
  3365. /*! ./const.js */
  3366. "../api/lib/esm/const.js"
  3367. );
  3368. var _proxy_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2(
  3369. /*! ./proxy.js */
  3370. "../api/lib/esm/proxy.js"
  3371. );
  3372. var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2(
  3373. /*! ./time.js */
  3374. "../api/lib/esm/time.js"
  3375. );
  3376. function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  3377. const descriptor = pluginDescriptor;
  3378. const target = (0, _env_js__WEBPACK_IMPORTED_MODULE_1__.getTarget)();
  3379. const hook = (0, _env_js__WEBPACK_IMPORTED_MODULE_1__.getDevtoolsGlobalHook)();
  3380. const enableProxy = _env_js__WEBPACK_IMPORTED_MODULE_1__.isProxyAvailable && descriptor.enableEarlyProxy;
  3381. if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
  3382. hook.emit(_const_js__WEBPACK_IMPORTED_MODULE_2__.HOOK_SETUP, pluginDescriptor, setupFn);
  3383. } else {
  3384. const proxy = enableProxy ? new _proxy_js__WEBPACK_IMPORTED_MODULE_3__.ApiProxy(descriptor, hook) : null;
  3385. const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
  3386. list.push({
  3387. pluginDescriptor: descriptor,
  3388. setupFn,
  3389. proxy
  3390. });
  3391. if (proxy)
  3392. setupFn(proxy.proxiedTarget);
  3393. }
  3394. }
  3395. }
  3396. ),
  3397. /***/
  3398. "../api/lib/esm/proxy.js": (
  3399. /*!*******************************!*\
  3400. !*** ../api/lib/esm/proxy.js ***!
  3401. \*******************************/
  3402. /***/
  3403. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3404. __webpack_require__2.r(__webpack_exports__2);
  3405. __webpack_require__2.d(__webpack_exports__2, {
  3406. /* harmony export */
  3407. "ApiProxy": () => (
  3408. /* binding */
  3409. ApiProxy
  3410. )
  3411. /* harmony export */
  3412. });
  3413. var _const_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2(
  3414. /*! ./const.js */
  3415. "../api/lib/esm/const.js"
  3416. );
  3417. var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2(
  3418. /*! ./time.js */
  3419. "../api/lib/esm/time.js"
  3420. );
  3421. class ApiProxy {
  3422. constructor(plugin, hook) {
  3423. this.target = null;
  3424. this.targetQueue = [];
  3425. this.onQueue = [];
  3426. this.plugin = plugin;
  3427. this.hook = hook;
  3428. const defaultSettings = {};
  3429. if (plugin.settings) {
  3430. for (const id in plugin.settings) {
  3431. const item = plugin.settings[id];
  3432. defaultSettings[id] = item.defaultValue;
  3433. }
  3434. }
  3435. const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
  3436. let currentSettings = Object.assign({}, defaultSettings);
  3437. try {
  3438. const raw = localStorage.getItem(localSettingsSaveId);
  3439. const data = JSON.parse(raw);
  3440. Object.assign(currentSettings, data);
  3441. } catch (e2) {
  3442. }
  3443. this.fallbacks = {
  3444. getSettings() {
  3445. return currentSettings;
  3446. },
  3447. setSettings(value) {
  3448. try {
  3449. localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
  3450. } catch (e2) {
  3451. }
  3452. currentSettings = value;
  3453. },
  3454. now() {
  3455. return (0, _time_js__WEBPACK_IMPORTED_MODULE_0__.now)();
  3456. }
  3457. };
  3458. if (hook) {
  3459. hook.on(_const_js__WEBPACK_IMPORTED_MODULE_1__.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
  3460. if (pluginId === this.plugin.id) {
  3461. this.fallbacks.setSettings(value);
  3462. }
  3463. });
  3464. }
  3465. this.proxiedOn = new Proxy({}, {
  3466. get: (_target, prop) => {
  3467. if (this.target) {
  3468. return this.target.on[prop];
  3469. } else {
  3470. return (...args) => {
  3471. this.onQueue.push({
  3472. method: prop,
  3473. args
  3474. });
  3475. };
  3476. }
  3477. }
  3478. });
  3479. this.proxiedTarget = new Proxy({}, {
  3480. get: (_target, prop) => {
  3481. if (this.target) {
  3482. return this.target[prop];
  3483. } else if (prop === "on") {
  3484. return this.proxiedOn;
  3485. } else if (Object.keys(this.fallbacks).includes(prop)) {
  3486. return (...args) => {
  3487. this.targetQueue.push({
  3488. method: prop,
  3489. args,
  3490. resolve: () => {
  3491. }
  3492. });
  3493. return this.fallbacks[prop](...args);
  3494. };
  3495. } else {
  3496. return (...args) => {
  3497. return new Promise((resolve) => {
  3498. this.targetQueue.push({
  3499. method: prop,
  3500. args,
  3501. resolve
  3502. });
  3503. });
  3504. };
  3505. }
  3506. }
  3507. });
  3508. }
  3509. async setRealTarget(target) {
  3510. this.target = target;
  3511. for (const item of this.onQueue) {
  3512. this.target.on[item.method](...item.args);
  3513. }
  3514. for (const item of this.targetQueue) {
  3515. item.resolve(await this.target[item.method](...item.args));
  3516. }
  3517. }
  3518. }
  3519. }
  3520. ),
  3521. /***/
  3522. "../api/lib/esm/time.js": (
  3523. /*!******************************!*\
  3524. !*** ../api/lib/esm/time.js ***!
  3525. \******************************/
  3526. /***/
  3527. (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => {
  3528. __webpack_require__2.r(__webpack_exports__2);
  3529. __webpack_require__2.d(__webpack_exports__2, {
  3530. /* harmony export */
  3531. "isPerformanceSupported": () => (
  3532. /* binding */
  3533. isPerformanceSupported
  3534. ),
  3535. /* harmony export */
  3536. "now": () => (
  3537. /* binding */
  3538. now
  3539. )
  3540. /* harmony export */
  3541. });
  3542. let supported;
  3543. let perf;
  3544. function isPerformanceSupported() {
  3545. var _a;
  3546. if (supported !== void 0) {
  3547. return supported;
  3548. }
  3549. if (typeof window !== "undefined" && window.performance) {
  3550. supported = true;
  3551. perf = window.performance;
  3552. } else if (typeof __webpack_require__2.g !== "undefined" && ((_a = __webpack_require__2.g.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
  3553. supported = true;
  3554. perf = __webpack_require__2.g.perf_hooks.performance;
  3555. } else {
  3556. supported = false;
  3557. }
  3558. return supported;
  3559. }
  3560. function now() {
  3561. return isPerformanceSupported() ? perf.now() : Date.now();
  3562. }
  3563. }
  3564. ),
  3565. /***/
  3566. "../app-backend-api/lib/api.js": (
  3567. /*!*************************************!*\
  3568. !*** ../app-backend-api/lib/api.js ***!
  3569. \*************************************/
  3570. /***/
  3571. (__unused_webpack_module, exports, __webpack_require__2) => {
  3572. Object.defineProperty(exports, "__esModule", {
  3573. value: true
  3574. });
  3575. exports.DevtoolsPluginApiInstance = exports.DevtoolsApi = void 0;
  3576. const shared_utils_1 = __webpack_require__2(
  3577. /*! @vue-devtools/shared-utils */
  3578. "../shared-utils/lib/index.js"
  3579. );
  3580. const devtools_api_1 = __webpack_require__2(
  3581. /*! @vue/devtools-api */
  3582. "../api/lib/esm/index.js"
  3583. );
  3584. const hooks_1 = __webpack_require__2(
  3585. /*! ./hooks */
  3586. "../app-backend-api/lib/hooks.js"
  3587. );
  3588. const pluginOn = [];
  3589. class DevtoolsApi {
  3590. constructor(backend, ctx) {
  3591. this.stateEditor = new shared_utils_1.StateEditor();
  3592. this.backend = backend;
  3593. this.ctx = ctx;
  3594. this.bridge = ctx.bridge;
  3595. this.on = new hooks_1.DevtoolsHookable(ctx);
  3596. }
  3597. async callHook(eventType, payload, ctx = this.ctx) {
  3598. payload = await this.on.callHandlers(eventType, payload, ctx);
  3599. for (const on of pluginOn) {
  3600. payload = await on.callHandlers(eventType, payload, ctx);
  3601. }
  3602. return payload;
  3603. }
  3604. async transformCall(callName, ...args) {
  3605. const payload = await this.callHook(
  3606. "transformCall",
  3607. {
  3608. callName,
  3609. inArgs: args,
  3610. outArgs: args.slice()
  3611. }
  3612. );
  3613. return payload.outArgs;
  3614. }
  3615. async getAppRecordName(app, defaultName) {
  3616. const payload = await this.callHook(
  3617. "getAppRecordName",
  3618. {
  3619. app,
  3620. name: null
  3621. }
  3622. );
  3623. if (payload.name) {
  3624. return payload.name;
  3625. } else {
  3626. return `App ${defaultName}`;
  3627. }
  3628. }
  3629. async getAppRootInstance(app) {
  3630. const payload = await this.callHook(
  3631. "getAppRootInstance",
  3632. {
  3633. app,
  3634. root: null
  3635. }
  3636. );
  3637. return payload.root;
  3638. }
  3639. async registerApplication(app) {
  3640. await this.callHook(
  3641. "registerApplication",
  3642. {
  3643. app
  3644. }
  3645. );
  3646. }
  3647. async walkComponentTree(instance, maxDepth = -1, filter = null, recursively = false) {
  3648. const payload = await this.callHook(
  3649. "walkComponentTree",
  3650. {
  3651. componentInstance: instance,
  3652. componentTreeData: null,
  3653. maxDepth,
  3654. filter,
  3655. recursively
  3656. }
  3657. );
  3658. return payload.componentTreeData;
  3659. }
  3660. async visitComponentTree(instance, treeNode, filter = null, app) {
  3661. const payload = await this.callHook(
  3662. "visitComponentTree",
  3663. {
  3664. app,
  3665. componentInstance: instance,
  3666. treeNode,
  3667. filter
  3668. }
  3669. );
  3670. return payload.treeNode;
  3671. }
  3672. async walkComponentParents(instance) {
  3673. const payload = await this.callHook(
  3674. "walkComponentParents",
  3675. {
  3676. componentInstance: instance,
  3677. parentInstances: []
  3678. }
  3679. );
  3680. return payload.parentInstances;
  3681. }
  3682. async inspectComponent(instance, app) {
  3683. const payload = await this.callHook(
  3684. "inspectComponent",
  3685. {
  3686. app,
  3687. componentInstance: instance,
  3688. instanceData: null
  3689. }
  3690. );
  3691. return payload.instanceData;
  3692. }
  3693. async getComponentBounds(instance) {
  3694. const payload = await this.callHook(
  3695. "getComponentBounds",
  3696. {
  3697. componentInstance: instance,
  3698. bounds: null
  3699. }
  3700. );
  3701. return payload.bounds;
  3702. }
  3703. async getComponentName(instance) {
  3704. const payload = await this.callHook(
  3705. "getComponentName",
  3706. {
  3707. componentInstance: instance,
  3708. name: null
  3709. }
  3710. );
  3711. return payload.name;
  3712. }
  3713. async getComponentInstances(app) {
  3714. const payload = await this.callHook(
  3715. "getComponentInstances",
  3716. {
  3717. app,
  3718. componentInstances: []
  3719. }
  3720. );
  3721. return payload.componentInstances;
  3722. }
  3723. async getElementComponent(element) {
  3724. const payload = await this.callHook(
  3725. "getElementComponent",
  3726. {
  3727. element,
  3728. componentInstance: null
  3729. }
  3730. );
  3731. return payload.componentInstance;
  3732. }
  3733. async getComponentRootElements(instance) {
  3734. const payload = await this.callHook(
  3735. "getComponentRootElements",
  3736. {
  3737. componentInstance: instance,
  3738. rootElements: []
  3739. }
  3740. );
  3741. return payload.rootElements;
  3742. }
  3743. async editComponentState(instance, dotPath, type, state, app) {
  3744. const arrayPath = dotPath.split(".");
  3745. const payload = await this.callHook(
  3746. "editComponentState",
  3747. {
  3748. app,
  3749. componentInstance: instance,
  3750. path: arrayPath,
  3751. type,
  3752. state,
  3753. set: (object, path = arrayPath, value = state.value, cb) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
  3754. }
  3755. );
  3756. return payload.componentInstance;
  3757. }
  3758. async getComponentDevtoolsOptions(instance) {
  3759. const payload = await this.callHook(
  3760. "getAppDevtoolsOptions",
  3761. {
  3762. componentInstance: instance,
  3763. options: null
  3764. }
  3765. );
  3766. return payload.options || {};
  3767. }
  3768. async getComponentRenderCode(instance) {
  3769. const payload = await this.callHook(
  3770. "getComponentRenderCode",
  3771. {
  3772. componentInstance: instance,
  3773. code: null
  3774. }
  3775. );
  3776. return {
  3777. code: payload.code
  3778. };
  3779. }
  3780. async inspectTimelineEvent(eventData, app) {
  3781. const payload = await this.callHook(
  3782. "inspectTimelineEvent",
  3783. {
  3784. event: eventData.event,
  3785. layerId: eventData.layerId,
  3786. app,
  3787. data: eventData.event.data,
  3788. all: eventData.all
  3789. }
  3790. );
  3791. return payload.data;
  3792. }
  3793. async clearTimeline() {
  3794. await this.callHook(
  3795. "timelineCleared",
  3796. {}
  3797. );
  3798. }
  3799. async getInspectorTree(inspectorId, app, filter) {
  3800. const payload = await this.callHook(
  3801. "getInspectorTree",
  3802. {
  3803. inspectorId,
  3804. app,
  3805. filter,
  3806. rootNodes: []
  3807. }
  3808. );
  3809. return payload.rootNodes;
  3810. }
  3811. async getInspectorState(inspectorId, app, nodeId) {
  3812. const payload = await this.callHook(
  3813. "getInspectorState",
  3814. {
  3815. inspectorId,
  3816. app,
  3817. nodeId,
  3818. state: null
  3819. }
  3820. );
  3821. return payload.state;
  3822. }
  3823. async editInspectorState(inspectorId, app, nodeId, dotPath, type, state) {
  3824. const arrayPath = dotPath.split(".");
  3825. await this.callHook(
  3826. "editInspectorState",
  3827. {
  3828. inspectorId,
  3829. app,
  3830. nodeId,
  3831. path: arrayPath,
  3832. type,
  3833. state,
  3834. set: (object, path = arrayPath, value = state.value, cb) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
  3835. }
  3836. );
  3837. }
  3838. now() {
  3839. return (0, devtools_api_1.now)();
  3840. }
  3841. }
  3842. exports.DevtoolsApi = DevtoolsApi;
  3843. class DevtoolsPluginApiInstance {
  3844. constructor(plugin, appRecord, ctx) {
  3845. this.bridge = ctx.bridge;
  3846. this.ctx = ctx;
  3847. this.plugin = plugin;
  3848. this.appRecord = appRecord;
  3849. this.backendApi = appRecord.backend.api;
  3850. this.defaultSettings = (0, shared_utils_1.getPluginDefaultSettings)(plugin.descriptor.settings);
  3851. this.on = new hooks_1.DevtoolsHookable(ctx, plugin);
  3852. pluginOn.push(this.on);
  3853. }
  3854. // Plugin API
  3855. async notifyComponentUpdate(instance = null) {
  3856. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3857. return;
  3858. if (instance) {
  3859. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UPDATED, ...await this.backendApi.transformCall(shared_utils_1.HookEvents.COMPONENT_UPDATED, instance));
  3860. } else {
  3861. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UPDATED);
  3862. }
  3863. }
  3864. addTimelineLayer(options) {
  3865. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.TIMELINE))
  3866. return false;
  3867. this.ctx.hook.emit(shared_utils_1.HookEvents.TIMELINE_LAYER_ADDED, options, this.plugin);
  3868. return true;
  3869. }
  3870. addTimelineEvent(options) {
  3871. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.TIMELINE))
  3872. return false;
  3873. this.ctx.hook.emit(shared_utils_1.HookEvents.TIMELINE_EVENT_ADDED, options, this.plugin);
  3874. return true;
  3875. }
  3876. addInspector(options) {
  3877. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3878. return false;
  3879. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_ADD, options, this.plugin);
  3880. return true;
  3881. }
  3882. sendInspectorTree(inspectorId) {
  3883. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3884. return false;
  3885. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_TREE, inspectorId, this.plugin);
  3886. return true;
  3887. }
  3888. sendInspectorState(inspectorId) {
  3889. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3890. return false;
  3891. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_STATE, inspectorId, this.plugin);
  3892. return true;
  3893. }
  3894. selectInspectorNode(inspectorId, nodeId) {
  3895. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.CUSTOM_INSPECTOR))
  3896. return false;
  3897. this.ctx.hook.emit(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SELECT_NODE, inspectorId, nodeId, this.plugin);
  3898. return true;
  3899. }
  3900. getComponentBounds(instance) {
  3901. return this.backendApi.getComponentBounds(instance);
  3902. }
  3903. getComponentName(instance) {
  3904. return this.backendApi.getComponentName(instance);
  3905. }
  3906. getComponentInstances(app) {
  3907. return this.backendApi.getComponentInstances(app);
  3908. }
  3909. highlightElement(instance) {
  3910. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3911. return false;
  3912. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_HIGHLIGHT, instance.__VUE_DEVTOOLS_UID__, this.plugin);
  3913. return true;
  3914. }
  3915. unhighlightElement() {
  3916. if (!this.enabled || !this.hasPermission(shared_utils_1.PluginPermission.COMPONENTS))
  3917. return false;
  3918. this.ctx.hook.emit(shared_utils_1.HookEvents.COMPONENT_UNHIGHLIGHT, this.plugin);
  3919. return true;
  3920. }
  3921. getSettings(pluginId) {
  3922. return (0, shared_utils_1.getPluginSettings)(pluginId !== null && pluginId !== void 0 ? pluginId : this.plugin.descriptor.id, this.defaultSettings);
  3923. }
  3924. setSettings(value, pluginId) {
  3925. (0, shared_utils_1.setPluginSettings)(pluginId !== null && pluginId !== void 0 ? pluginId : this.plugin.descriptor.id, value);
  3926. }
  3927. now() {
  3928. return (0, devtools_api_1.now)();
  3929. }
  3930. get enabled() {
  3931. return (0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, shared_utils_1.PluginPermission.ENABLED);
  3932. }
  3933. hasPermission(permission2) {
  3934. return (0, shared_utils_1.hasPluginPermission)(this.plugin.descriptor.id, permission2);
  3935. }
  3936. }
  3937. exports.DevtoolsPluginApiInstance = DevtoolsPluginApiInstance;
  3938. }
  3939. ),
  3940. /***/
  3941. "../app-backend-api/lib/app-record.js": (
  3942. /*!********************************************!*\
  3943. !*** ../app-backend-api/lib/app-record.js ***!
  3944. \********************************************/
  3945. /***/
  3946. (__unused_webpack_module, exports) => {
  3947. Object.defineProperty(exports, "__esModule", {
  3948. value: true
  3949. });
  3950. }
  3951. ),
  3952. /***/
  3953. "../app-backend-api/lib/backend-context.js": (
  3954. /*!*************************************************!*\
  3955. !*** ../app-backend-api/lib/backend-context.js ***!
  3956. \*************************************************/
  3957. /***/
  3958. (__unused_webpack_module, exports) => {
  3959. Object.defineProperty(exports, "__esModule", {
  3960. value: true
  3961. });
  3962. exports.createBackendContext = void 0;
  3963. function createBackendContext(options) {
  3964. return {
  3965. bridge: options.bridge,
  3966. hook: options.hook,
  3967. backends: [],
  3968. appRecords: [],
  3969. currentTab: null,
  3970. currentAppRecord: null,
  3971. currentInspectedComponentId: null,
  3972. plugins: [],
  3973. currentPlugin: null,
  3974. timelineLayers: [],
  3975. nextTimelineEventId: 0,
  3976. timelineEventMap: /* @__PURE__ */ new Map(),
  3977. perfUniqueGroupId: 0,
  3978. customInspectors: [],
  3979. timelineMarkers: []
  3980. };
  3981. }
  3982. exports.createBackendContext = createBackendContext;
  3983. }
  3984. ),
  3985. /***/
  3986. "../app-backend-api/lib/backend.js": (
  3987. /*!*****************************************!*\
  3988. !*** ../app-backend-api/lib/backend.js ***!
  3989. \*****************************************/
  3990. /***/
  3991. (__unused_webpack_module, exports, __webpack_require__2) => {
  3992. Object.defineProperty(exports, "__esModule", {
  3993. value: true
  3994. });
  3995. exports.createBackend = exports.defineBackend = exports.BuiltinBackendFeature = void 0;
  3996. const api_1 = __webpack_require__2(
  3997. /*! ./api */
  3998. "../app-backend-api/lib/api.js"
  3999. );
  4000. (function(BuiltinBackendFeature) {
  4001. BuiltinBackendFeature["FLUSH"] = "flush";
  4002. })(exports.BuiltinBackendFeature || (exports.BuiltinBackendFeature = {}));
  4003. function defineBackend(options) {
  4004. return options;
  4005. }
  4006. exports.defineBackend = defineBackend;
  4007. function createBackend(options, ctx) {
  4008. const backend = {
  4009. options,
  4010. api: null
  4011. };
  4012. backend.api = new api_1.DevtoolsApi(backend, ctx);
  4013. options.setup(backend.api);
  4014. return backend;
  4015. }
  4016. exports.createBackend = createBackend;
  4017. }
  4018. ),
  4019. /***/
  4020. "../app-backend-api/lib/global-hook.js": (
  4021. /*!*********************************************!*\
  4022. !*** ../app-backend-api/lib/global-hook.js ***!
  4023. \*********************************************/
  4024. /***/
  4025. (__unused_webpack_module, exports) => {
  4026. Object.defineProperty(exports, "__esModule", {
  4027. value: true
  4028. });
  4029. }
  4030. ),
  4031. /***/
  4032. "../app-backend-api/lib/hooks.js": (
  4033. /*!***************************************!*\
  4034. !*** ../app-backend-api/lib/hooks.js ***!
  4035. \***************************************/
  4036. /***/
  4037. (__unused_webpack_module, exports, __webpack_require__2) => {
  4038. Object.defineProperty(exports, "__esModule", {
  4039. value: true
  4040. });
  4041. exports.DevtoolsHookable = void 0;
  4042. const shared_utils_1 = __webpack_require__2(
  4043. /*! @vue-devtools/shared-utils */
  4044. "../shared-utils/lib/index.js"
  4045. );
  4046. class DevtoolsHookable {
  4047. constructor(ctx, plugin = null) {
  4048. this.handlers = {};
  4049. this.ctx = ctx;
  4050. this.plugin = plugin;
  4051. }
  4052. hook(eventType, handler, pluginPermision = null) {
  4053. const handlers = this.handlers[eventType] = this.handlers[eventType] || [];
  4054. if (this.plugin) {
  4055. const originalHandler = handler;
  4056. handler = (...args) => {
  4057. var _a;
  4058. 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))
  4059. return;
  4060. if (!this.plugin.descriptor.disableAppScope && ((_a = this.ctx.currentAppRecord) === null || _a === void 0 ? void 0 : _a.options.app) !== this.plugin.descriptor.app)
  4061. return;
  4062. if (!this.plugin.descriptor.disablePluginScope && args[0].pluginId != null && args[0].pluginId !== this.plugin.descriptor.id)
  4063. return;
  4064. return originalHandler(...args);
  4065. };
  4066. }
  4067. handlers.push({
  4068. handler,
  4069. plugin: this.ctx.currentPlugin
  4070. });
  4071. }
  4072. async callHandlers(eventType, payload, ctx) {
  4073. if (this.handlers[eventType]) {
  4074. const handlers = this.handlers[eventType];
  4075. for (let i2 = 0; i2 < handlers.length; i2++) {
  4076. const {
  4077. handler,
  4078. plugin
  4079. } = handlers[i2];
  4080. try {
  4081. await handler(payload, ctx);
  4082. } catch (e2) {
  4083. console.error(`An error occurred in hook '${eventType}'${plugin ? ` registered by plugin '${plugin.descriptor.id}'` : ""} with payload:`, payload);
  4084. console.error(e2);
  4085. }
  4086. }
  4087. }
  4088. return payload;
  4089. }
  4090. transformCall(handler) {
  4091. this.hook(
  4092. "transformCall",
  4093. handler
  4094. );
  4095. }
  4096. getAppRecordName(handler) {
  4097. this.hook(
  4098. "getAppRecordName",
  4099. handler
  4100. );
  4101. }
  4102. getAppRootInstance(handler) {
  4103. this.hook(
  4104. "getAppRootInstance",
  4105. handler
  4106. );
  4107. }
  4108. registerApplication(handler) {
  4109. this.hook(
  4110. "registerApplication",
  4111. handler
  4112. );
  4113. }
  4114. walkComponentTree(handler) {
  4115. this.hook(
  4116. "walkComponentTree",
  4117. handler,
  4118. shared_utils_1.PluginPermission.COMPONENTS
  4119. );
  4120. }
  4121. visitComponentTree(handler) {
  4122. this.hook(
  4123. "visitComponentTree",
  4124. handler,
  4125. shared_utils_1.PluginPermission.COMPONENTS
  4126. );
  4127. }
  4128. walkComponentParents(handler) {
  4129. this.hook(
  4130. "walkComponentParents",
  4131. handler,
  4132. shared_utils_1.PluginPermission.COMPONENTS
  4133. );
  4134. }
  4135. inspectComponent(handler) {
  4136. this.hook(
  4137. "inspectComponent",
  4138. handler,
  4139. shared_utils_1.PluginPermission.COMPONENTS
  4140. );
  4141. }
  4142. getComponentBounds(handler) {
  4143. this.hook(
  4144. "getComponentBounds",
  4145. handler,
  4146. shared_utils_1.PluginPermission.COMPONENTS
  4147. );
  4148. }
  4149. getComponentName(handler) {
  4150. this.hook(
  4151. "getComponentName",
  4152. handler,
  4153. shared_utils_1.PluginPermission.COMPONENTS
  4154. );
  4155. }
  4156. getComponentInstances(handler) {
  4157. this.hook(
  4158. "getComponentInstances",
  4159. handler,
  4160. shared_utils_1.PluginPermission.COMPONENTS
  4161. );
  4162. }
  4163. getElementComponent(handler) {
  4164. this.hook(
  4165. "getElementComponent",
  4166. handler,
  4167. shared_utils_1.PluginPermission.COMPONENTS
  4168. );
  4169. }
  4170. getComponentRootElements(handler) {
  4171. this.hook(
  4172. "getComponentRootElements",
  4173. handler,
  4174. shared_utils_1.PluginPermission.COMPONENTS
  4175. );
  4176. }
  4177. editComponentState(handler) {
  4178. this.hook(
  4179. "editComponentState",
  4180. handler,
  4181. shared_utils_1.PluginPermission.COMPONENTS
  4182. );
  4183. }
  4184. getComponentDevtoolsOptions(handler) {
  4185. this.hook(
  4186. "getAppDevtoolsOptions",
  4187. handler,
  4188. shared_utils_1.PluginPermission.COMPONENTS
  4189. );
  4190. }
  4191. getComponentRenderCode(handler) {
  4192. this.hook(
  4193. "getComponentRenderCode",
  4194. handler,
  4195. shared_utils_1.PluginPermission.COMPONENTS
  4196. );
  4197. }
  4198. inspectTimelineEvent(handler) {
  4199. this.hook(
  4200. "inspectTimelineEvent",
  4201. handler,
  4202. shared_utils_1.PluginPermission.TIMELINE
  4203. );
  4204. }
  4205. timelineCleared(handler) {
  4206. this.hook(
  4207. "timelineCleared",
  4208. handler,
  4209. shared_utils_1.PluginPermission.TIMELINE
  4210. );
  4211. }
  4212. getInspectorTree(handler) {
  4213. this.hook(
  4214. "getInspectorTree",
  4215. handler,
  4216. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4217. );
  4218. }
  4219. getInspectorState(handler) {
  4220. this.hook(
  4221. "getInspectorState",
  4222. handler,
  4223. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4224. );
  4225. }
  4226. editInspectorState(handler) {
  4227. this.hook(
  4228. "editInspectorState",
  4229. handler,
  4230. shared_utils_1.PluginPermission.CUSTOM_INSPECTOR
  4231. );
  4232. }
  4233. setPluginSettings(handler) {
  4234. this.hook(
  4235. "setPluginSettings",
  4236. handler
  4237. );
  4238. }
  4239. }
  4240. exports.DevtoolsHookable = DevtoolsHookable;
  4241. }
  4242. ),
  4243. /***/
  4244. "../app-backend-api/lib/index.js": (
  4245. /*!***************************************!*\
  4246. !*** ../app-backend-api/lib/index.js ***!
  4247. \***************************************/
  4248. /***/
  4249. function(__unused_webpack_module, exports, __webpack_require__2) {
  4250. var __createBinding = this && this.__createBinding || (Object.create ? function(o2, m2, k, k2) {
  4251. if (k2 === void 0)
  4252. k2 = k;
  4253. var desc = Object.getOwnPropertyDescriptor(m2, k);
  4254. if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
  4255. desc = {
  4256. enumerable: true,
  4257. get: function() {
  4258. return m2[k];
  4259. }
  4260. };
  4261. }
  4262. Object.defineProperty(o2, k2, desc);
  4263. } : function(o2, m2, k, k2) {
  4264. if (k2 === void 0)
  4265. k2 = k;
  4266. o2[k2] = m2[k];
  4267. });
  4268. var __exportStar = this && this.__exportStar || function(m2, exports2) {
  4269. for (var p2 in m2)
  4270. if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2))
  4271. __createBinding(exports2, m2, p2);
  4272. };
  4273. Object.defineProperty(exports, "__esModule", {
  4274. value: true
  4275. });
  4276. __exportStar(__webpack_require__2(
  4277. /*! ./api */
  4278. "../app-backend-api/lib/api.js"
  4279. ), exports);
  4280. __exportStar(__webpack_require__2(
  4281. /*! ./app-record */
  4282. "../app-backend-api/lib/app-record.js"
  4283. ), exports);
  4284. __exportStar(__webpack_require__2(
  4285. /*! ./backend */
  4286. "../app-backend-api/lib/backend.js"
  4287. ), exports);
  4288. __exportStar(__webpack_require__2(
  4289. /*! ./backend-context */
  4290. "../app-backend-api/lib/backend-context.js"
  4291. ), exports);
  4292. __exportStar(__webpack_require__2(
  4293. /*! ./global-hook */
  4294. "../app-backend-api/lib/global-hook.js"
  4295. ), exports);
  4296. __exportStar(__webpack_require__2(
  4297. /*! ./hooks */
  4298. "../app-backend-api/lib/hooks.js"
  4299. ), exports);
  4300. __exportStar(__webpack_require__2(
  4301. /*! ./plugin */
  4302. "../app-backend-api/lib/plugin.js"
  4303. ), exports);
  4304. }
  4305. ),
  4306. /***/
  4307. "../app-backend-api/lib/plugin.js": (
  4308. /*!****************************************!*\
  4309. !*** ../app-backend-api/lib/plugin.js ***!
  4310. \****************************************/
  4311. /***/
  4312. (__unused_webpack_module, exports) => {
  4313. Object.defineProperty(exports, "__esModule", {
  4314. value: true
  4315. });
  4316. }
  4317. ),
  4318. /***/
  4319. "../app-backend-core/lib/app.js": (
  4320. /*!**************************************!*\
  4321. !*** ../app-backend-core/lib/app.js ***!
  4322. \**************************************/
  4323. /***/
  4324. function(__unused_webpack_module, exports, __webpack_require__2) {
  4325. var __importDefault = this && this.__importDefault || function(mod) {
  4326. return mod && mod.__esModule ? mod : {
  4327. "default": mod
  4328. };
  4329. };
  4330. Object.defineProperty(exports, "__esModule", {
  4331. value: true
  4332. });
  4333. exports._legacy_getAndRegisterApps = exports.removeApp = exports.sendApps = exports.waitForAppsRegistration = exports.getAppRecord = exports.getAppRecordId = exports.mapAppRecord = exports.selectApp = exports.registerApp = void 0;
  4334. const shared_utils_1 = __webpack_require__2(
  4335. /*! @vue-devtools/shared-utils */
  4336. "../shared-utils/lib/index.js"
  4337. );
  4338. const speakingurl_1 = __importDefault(__webpack_require__2(
  4339. /*! speakingurl */
  4340. "../../node_modules/speakingurl/index.js"
  4341. ));
  4342. const queue_1 = __webpack_require__2(
  4343. /*! ./util/queue */
  4344. "../app-backend-core/lib/util/queue.js"
  4345. );
  4346. const scan_1 = __webpack_require__2(
  4347. /*! ./legacy/scan */
  4348. "../app-backend-core/lib/legacy/scan.js"
  4349. );
  4350. const timeline_1 = __webpack_require__2(
  4351. /*! ./timeline */
  4352. "../app-backend-core/lib/timeline.js"
  4353. );
  4354. const backend_1 = __webpack_require__2(
  4355. /*! ./backend */
  4356. "../app-backend-core/lib/backend.js"
  4357. );
  4358. const global_hook_js_1 = __webpack_require__2(
  4359. /*! ./global-hook.js */
  4360. "../app-backend-core/lib/global-hook.js"
  4361. );
  4362. const jobs = new queue_1.JobQueue();
  4363. let recordId = 0;
  4364. const appRecordPromises = /* @__PURE__ */ new Map();
  4365. async function registerApp(options, ctx) {
  4366. return jobs.queue("regiserApp", () => registerAppJob(options, ctx));
  4367. }
  4368. exports.registerApp = registerApp;
  4369. async function registerAppJob(options, ctx) {
  4370. if (ctx.appRecords.find((a2) => a2.options.app === options.app)) {
  4371. return;
  4372. }
  4373. if (!options.version) {
  4374. throw new Error("[Vue Devtools] Vue version not found");
  4375. }
  4376. const baseFrameworkVersion = parseInt(options.version.substring(0, options.version.indexOf(".")));
  4377. for (let i2 = 0; i2 < backend_1.availableBackends.length; i2++) {
  4378. const backendOptions = backend_1.availableBackends[i2];
  4379. if (backendOptions.frameworkVersion === baseFrameworkVersion) {
  4380. const backend = (0, backend_1.getBackend)(backendOptions, ctx);
  4381. await createAppRecord(options, backend, ctx);
  4382. break;
  4383. }
  4384. }
  4385. }
  4386. async function createAppRecord(options, backend, ctx) {
  4387. var _a, _b, _c;
  4388. const rootInstance = await backend.api.getAppRootInstance(options.app);
  4389. if (rootInstance) {
  4390. if ((await backend.api.getComponentDevtoolsOptions(rootInstance)).hide) {
  4391. options.app._vueDevtools_hidden_ = true;
  4392. return;
  4393. }
  4394. recordId++;
  4395. const name = await backend.api.getAppRecordName(options.app, recordId.toString());
  4396. const id = getAppRecordId(options.app, (0, speakingurl_1.default)(name));
  4397. const [el] = await backend.api.getComponentRootElements(rootInstance);
  4398. const record2 = {
  4399. id,
  4400. name,
  4401. options,
  4402. backend,
  4403. lastInspectedComponentId: null,
  4404. instanceMap: /* @__PURE__ */ new Map(),
  4405. rootInstance,
  4406. perfGroupIds: /* @__PURE__ */ new Map(),
  4407. 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,
  4408. meta: (_c = options.meta) !== null && _c !== void 0 ? _c : {}
  4409. };
  4410. options.app.__VUE_DEVTOOLS_APP_RECORD__ = record2;
  4411. const rootId = `${record2.id}:root`;
  4412. record2.instanceMap.set(rootId, record2.rootInstance);
  4413. record2.rootInstance.__VUE_DEVTOOLS_UID__ = rootId;
  4414. (0, timeline_1.addBuiltinLayers)(record2, ctx);
  4415. ctx.appRecords.push(record2);
  4416. if (backend.options.setupApp) {
  4417. backend.options.setupApp(backend.api, record2);
  4418. }
  4419. await backend.api.registerApplication(options.app);
  4420. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_ADD, {
  4421. appRecord: mapAppRecord(record2)
  4422. });
  4423. if (appRecordPromises.has(options.app)) {
  4424. for (const r2 of appRecordPromises.get(options.app)) {
  4425. await r2(record2);
  4426. }
  4427. }
  4428. if (ctx.currentAppRecord == null) {
  4429. await selectApp(record2, ctx);
  4430. }
  4431. } else if (shared_utils_1.SharedData.debugInfo) {
  4432. console.warn("[Vue devtools] No root instance found for app, it might have been unmounted", options.app);
  4433. }
  4434. }
  4435. async function selectApp(record2, ctx) {
  4436. ctx.currentAppRecord = record2;
  4437. ctx.currentInspectedComponentId = record2.lastInspectedComponentId;
  4438. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_SELECTED, {
  4439. id: record2.id,
  4440. lastInspectedComponentId: record2.lastInspectedComponentId
  4441. });
  4442. }
  4443. exports.selectApp = selectApp;
  4444. function mapAppRecord(record2) {
  4445. return {
  4446. id: record2.id,
  4447. name: record2.name,
  4448. version: record2.options.version,
  4449. iframe: record2.iframe
  4450. };
  4451. }
  4452. exports.mapAppRecord = mapAppRecord;
  4453. const appIds = /* @__PURE__ */ new Set();
  4454. function getAppRecordId(app, defaultId) {
  4455. if (app.__VUE_DEVTOOLS_APP_RECORD_ID__ != null) {
  4456. return app.__VUE_DEVTOOLS_APP_RECORD_ID__;
  4457. }
  4458. let id = defaultId !== null && defaultId !== void 0 ? defaultId : (recordId++).toString();
  4459. if (defaultId && appIds.has(id)) {
  4460. let count = 1;
  4461. while (appIds.has(`${defaultId}_${count}`)) {
  4462. count++;
  4463. }
  4464. id = `${defaultId}_${count}`;
  4465. }
  4466. appIds.add(id);
  4467. app.__VUE_DEVTOOLS_APP_RECORD_ID__ = id;
  4468. return id;
  4469. }
  4470. exports.getAppRecordId = getAppRecordId;
  4471. async function getAppRecord(app, ctx) {
  4472. var _a;
  4473. const record2 = (_a = app.__VUE_DEVTOOLS_APP_RECORD__) !== null && _a !== void 0 ? _a : ctx.appRecords.find((ar) => ar.options.app === app);
  4474. if (record2) {
  4475. return record2;
  4476. }
  4477. if (app._vueDevtools_hidden_)
  4478. return null;
  4479. return new Promise((resolve, reject) => {
  4480. let resolvers = appRecordPromises.get(app);
  4481. let timedOut = false;
  4482. if (!resolvers) {
  4483. resolvers = [];
  4484. appRecordPromises.set(app, resolvers);
  4485. }
  4486. const fn = (record3) => {
  4487. if (!timedOut) {
  4488. clearTimeout(timer);
  4489. resolve(record3);
  4490. }
  4491. };
  4492. resolvers.push(fn);
  4493. const timer = setTimeout(() => {
  4494. timedOut = true;
  4495. const index = resolvers.indexOf(fn);
  4496. if (index !== -1)
  4497. resolvers.splice(index, 1);
  4498. if (shared_utils_1.SharedData.debugInfo) {
  4499. console.log("Timed out waiting for app record", app);
  4500. }
  4501. reject(new Error(`Timed out getting app record for app`));
  4502. }, 6e4);
  4503. });
  4504. }
  4505. exports.getAppRecord = getAppRecord;
  4506. function waitForAppsRegistration() {
  4507. return jobs.queue("waitForAppsRegistrationNoop", async () => {
  4508. });
  4509. }
  4510. exports.waitForAppsRegistration = waitForAppsRegistration;
  4511. async function sendApps(ctx) {
  4512. const appRecords = [];
  4513. for (const appRecord of ctx.appRecords) {
  4514. appRecords.push(appRecord);
  4515. }
  4516. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_LIST, {
  4517. apps: appRecords.map(mapAppRecord)
  4518. });
  4519. }
  4520. exports.sendApps = sendApps;
  4521. function removeAppRecord(appRecord, ctx) {
  4522. try {
  4523. appIds.delete(appRecord.id);
  4524. const index = ctx.appRecords.indexOf(appRecord);
  4525. if (index !== -1)
  4526. ctx.appRecords.splice(index, 1);
  4527. (0, timeline_1.removeLayersForApp)(appRecord.options.app, ctx);
  4528. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_APP_REMOVE, {
  4529. id: appRecord.id
  4530. });
  4531. } catch (e2) {
  4532. if (shared_utils_1.SharedData.debugInfo) {
  4533. console.error(e2);
  4534. }
  4535. }
  4536. }
  4537. async function removeApp(app, ctx) {
  4538. try {
  4539. const appRecord = await getAppRecord(app, ctx);
  4540. if (appRecord) {
  4541. removeAppRecord(appRecord, ctx);
  4542. }
  4543. } catch (e2) {
  4544. if (shared_utils_1.SharedData.debugInfo) {
  4545. console.error(e2);
  4546. }
  4547. }
  4548. }
  4549. exports.removeApp = removeApp;
  4550. let scanTimeout;
  4551. function _legacy_getAndRegisterApps(ctx, clear = false) {
  4552. setTimeout(() => {
  4553. try {
  4554. if (clear) {
  4555. ctx.appRecords.forEach((appRecord) => {
  4556. if (appRecord.meta.Vue) {
  4557. removeAppRecord(appRecord, ctx);
  4558. }
  4559. });
  4560. }
  4561. const apps = (0, scan_1.scan)();
  4562. clearTimeout(scanTimeout);
  4563. if (!apps.length) {
  4564. scanTimeout = setTimeout(() => _legacy_getAndRegisterApps(ctx), 1e3);
  4565. }
  4566. apps.forEach((app) => {
  4567. const Vue2 = global_hook_js_1.hook.Vue;
  4568. registerApp({
  4569. app,
  4570. types: {},
  4571. version: Vue2 === null || Vue2 === void 0 ? void 0 : Vue2.version,
  4572. meta: {
  4573. Vue: Vue2
  4574. }
  4575. }, ctx);
  4576. });
  4577. } catch (e2) {
  4578. console.error(`Error scanning for legacy apps:`);
  4579. console.error(e2);
  4580. }
  4581. }, 0);
  4582. }
  4583. exports._legacy_getAndRegisterApps = _legacy_getAndRegisterApps;
  4584. }
  4585. ),
  4586. /***/
  4587. "../app-backend-core/lib/backend.js": (
  4588. /*!******************************************!*\
  4589. !*** ../app-backend-core/lib/backend.js ***!
  4590. \******************************************/
  4591. /***/
  4592. (__unused_webpack_module, exports, __webpack_require__2) => {
  4593. Object.defineProperty(exports, "__esModule", {
  4594. value: true
  4595. });
  4596. exports.getBackend = exports.availableBackends = void 0;
  4597. const app_backend_api_1 = __webpack_require__2(
  4598. /*! @vue-devtools/app-backend-api */
  4599. "../app-backend-api/lib/index.js"
  4600. );
  4601. const app_backend_vue3_1 = __webpack_require__2(
  4602. /*! @vue-devtools/app-backend-vue3 */
  4603. "../app-backend-vue3/lib/index.js"
  4604. );
  4605. const perf_1 = __webpack_require__2(
  4606. /*! ./perf */
  4607. "../app-backend-core/lib/perf.js"
  4608. );
  4609. exports.availableBackends = [
  4610. // backendVue1,
  4611. // backendVue2,
  4612. app_backend_vue3_1.backend
  4613. ];
  4614. const enabledBackends = /* @__PURE__ */ new Map();
  4615. function getBackend(backendOptions, ctx) {
  4616. let backend;
  4617. if (!enabledBackends.has(backendOptions)) {
  4618. backend = (0, app_backend_api_1.createBackend)(backendOptions, ctx);
  4619. (0, perf_1.handleAddPerformanceTag)(backend, ctx);
  4620. enabledBackends.set(backendOptions, backend);
  4621. ctx.backends.push(backend);
  4622. } else {
  4623. backend = enabledBackends.get(backendOptions);
  4624. }
  4625. return backend;
  4626. }
  4627. exports.getBackend = getBackend;
  4628. }
  4629. ),
  4630. /***/
  4631. "../app-backend-core/lib/component-pick.js": (
  4632. /*!*************************************************!*\
  4633. !*** ../app-backend-core/lib/component-pick.js ***!
  4634. \*************************************************/
  4635. /***/
  4636. (__unused_webpack_module, exports, __webpack_require__2) => {
  4637. Object.defineProperty(exports, "__esModule", {
  4638. value: true
  4639. });
  4640. const shared_utils_1 = __webpack_require__2(
  4641. /*! @vue-devtools/shared-utils */
  4642. "../shared-utils/lib/index.js"
  4643. );
  4644. const highlighter_1 = __webpack_require__2(
  4645. /*! ./highlighter */
  4646. "../app-backend-core/lib/highlighter.js"
  4647. );
  4648. class ComponentPicker {
  4649. constructor(ctx) {
  4650. this.ctx = ctx;
  4651. this.bindMethods();
  4652. }
  4653. /**
  4654. * Adds event listeners for mouseover and mouseup
  4655. */
  4656. startSelecting() {
  4657. if (!shared_utils_1.isBrowser)
  4658. return;
  4659. window.addEventListener("mouseover", this.elementMouseOver, true);
  4660. window.addEventListener("click", this.elementClicked, true);
  4661. window.addEventListener("mouseout", this.cancelEvent, true);
  4662. window.addEventListener("mouseenter", this.cancelEvent, true);
  4663. window.addEventListener("mouseleave", this.cancelEvent, true);
  4664. window.addEventListener("mousedown", this.cancelEvent, true);
  4665. window.addEventListener("mouseup", this.cancelEvent, true);
  4666. }
  4667. /**
  4668. * Removes event listeners
  4669. */
  4670. stopSelecting() {
  4671. if (!shared_utils_1.isBrowser)
  4672. return;
  4673. window.removeEventListener("mouseover", this.elementMouseOver, true);
  4674. window.removeEventListener("click", this.elementClicked, true);
  4675. window.removeEventListener("mouseout", this.cancelEvent, true);
  4676. window.removeEventListener("mouseenter", this.cancelEvent, true);
  4677. window.removeEventListener("mouseleave", this.cancelEvent, true);
  4678. window.removeEventListener("mousedown", this.cancelEvent, true);
  4679. window.removeEventListener("mouseup", this.cancelEvent, true);
  4680. (0, highlighter_1.unHighlight)();
  4681. }
  4682. /**
  4683. * Highlights a component on element mouse over
  4684. */
  4685. async elementMouseOver(e2) {
  4686. this.cancelEvent(e2);
  4687. const el = e2.target;
  4688. if (el) {
  4689. await this.selectElementComponent(el);
  4690. }
  4691. (0, highlighter_1.unHighlight)();
  4692. if (this.selectedInstance) {
  4693. (0, highlighter_1.highlight)(this.selectedInstance, this.selectedBackend, this.ctx);
  4694. }
  4695. }
  4696. async selectElementComponent(el) {
  4697. for (const backend of this.ctx.backends) {
  4698. const instance = await backend.api.getElementComponent(el);
  4699. if (instance) {
  4700. this.selectedInstance = instance;
  4701. this.selectedBackend = backend;
  4702. return;
  4703. }
  4704. }
  4705. this.selectedInstance = null;
  4706. this.selectedBackend = null;
  4707. }
  4708. /**
  4709. * Selects an instance in the component view
  4710. */
  4711. async elementClicked(e2) {
  4712. this.cancelEvent(e2);
  4713. if (this.selectedInstance && this.selectedBackend) {
  4714. const parentInstances = await this.selectedBackend.api.walkComponentParents(this.selectedInstance);
  4715. this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK, {
  4716. id: this.selectedInstance.__VUE_DEVTOOLS_UID__,
  4717. parentIds: parentInstances.map((i2) => i2.__VUE_DEVTOOLS_UID__)
  4718. });
  4719. } else {
  4720. this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK_CANCELED, null);
  4721. }
  4722. this.stopSelecting();
  4723. }
  4724. /**
  4725. * Cancel a mouse event
  4726. */
  4727. cancelEvent(e2) {
  4728. e2.stopImmediatePropagation();
  4729. e2.preventDefault();
  4730. }
  4731. /**
  4732. * Bind class methods to the class scope to avoid rebind for event listeners
  4733. */
  4734. bindMethods() {
  4735. this.startSelecting = this.startSelecting.bind(this);
  4736. this.stopSelecting = this.stopSelecting.bind(this);
  4737. this.elementMouseOver = this.elementMouseOver.bind(this);
  4738. this.elementClicked = this.elementClicked.bind(this);
  4739. }
  4740. }
  4741. exports["default"] = ComponentPicker;
  4742. }
  4743. ),
  4744. /***/
  4745. "../app-backend-core/lib/component.js": (
  4746. /*!********************************************!*\
  4747. !*** ../app-backend-core/lib/component.js ***!
  4748. \********************************************/
  4749. /***/
  4750. (__unused_webpack_module, exports, __webpack_require__2) => {
  4751. Object.defineProperty(exports, "__esModule", {
  4752. value: true
  4753. });
  4754. exports.sendComponentUpdateTracking = exports.refreshComponentTreeSearch = exports.getComponentInstance = exports.getComponentId = exports.editComponentState = exports.sendEmptyComponentData = exports.markSelectedInstance = exports.sendSelectedComponentData = exports.sendComponentTreeData = void 0;
  4755. const shared_utils_1 = __webpack_require__2(
  4756. /*! @vue-devtools/shared-utils */
  4757. "../shared-utils/lib/index.js"
  4758. );
  4759. const app_backend_api_1 = __webpack_require__2(
  4760. /*! @vue-devtools/app-backend-api */
  4761. "../app-backend-api/lib/index.js"
  4762. );
  4763. const app_1 = __webpack_require__2(
  4764. /*! ./app */
  4765. "../app-backend-core/lib/app.js"
  4766. );
  4767. const MAX_$VM = 10;
  4768. const $vmQueue = [];
  4769. async function sendComponentTreeData(appRecord, instanceId, filter = "", maxDepth = null, recursively = false, ctx) {
  4770. if (!instanceId || appRecord !== ctx.currentAppRecord)
  4771. return;
  4772. if (instanceId !== "_root" && ctx.currentAppRecord.backend.options.features.includes(app_backend_api_1.BuiltinBackendFeature.FLUSH)) {
  4773. return;
  4774. }
  4775. const instance = getComponentInstance(appRecord, instanceId);
  4776. if (!instance) {
  4777. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_TREE, {
  4778. instanceId,
  4779. treeData: null,
  4780. notFound: true
  4781. });
  4782. } else {
  4783. if (filter)
  4784. filter = filter.toLowerCase();
  4785. if (maxDepth == null) {
  4786. maxDepth = instance === ctx.currentAppRecord.rootInstance ? 2 : 1;
  4787. }
  4788. const data = await appRecord.backend.api.walkComponentTree(instance, maxDepth, filter, recursively);
  4789. const payload = {
  4790. instanceId,
  4791. treeData: (0, shared_utils_1.stringify)(data)
  4792. };
  4793. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_TREE, payload);
  4794. }
  4795. }
  4796. exports.sendComponentTreeData = sendComponentTreeData;
  4797. async function sendSelectedComponentData(appRecord, instanceId, ctx) {
  4798. if (!instanceId || appRecord !== ctx.currentAppRecord)
  4799. return;
  4800. const instance = getComponentInstance(appRecord, instanceId);
  4801. if (!instance) {
  4802. sendEmptyComponentData(instanceId, ctx);
  4803. } else {
  4804. if (typeof window !== "undefined") {
  4805. const win = window;
  4806. win.$vm = instance;
  4807. if ($vmQueue[0] !== instance) {
  4808. if ($vmQueue.length >= MAX_$VM) {
  4809. $vmQueue.pop();
  4810. }
  4811. for (let i2 = $vmQueue.length; i2 > 0; i2--) {
  4812. win[`$vm${i2}`] = $vmQueue[i2] = $vmQueue[i2 - 1];
  4813. }
  4814. win.$vm0 = $vmQueue[0] = instance;
  4815. }
  4816. }
  4817. if (shared_utils_1.SharedData.debugInfo) {
  4818. console.log("[DEBUG] inspect", instance);
  4819. }
  4820. const parentInstances = await appRecord.backend.api.walkComponentParents(instance);
  4821. const payload = {
  4822. instanceId,
  4823. data: await appRecord.backend.api.inspectComponent(instance, ctx.currentAppRecord.options.app),
  4824. parentIds: parentInstances.map((i2) => i2.__VUE_DEVTOOLS_UID__)
  4825. };
  4826. {
  4827. payload.data.isSetup = !!instance.type.setup && !instance.type.render;
  4828. }
  4829. payload.data = (0, shared_utils_1.stringify)(payload.data);
  4830. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_SELECTED_DATA, payload);
  4831. markSelectedInstance(instanceId, ctx);
  4832. }
  4833. }
  4834. exports.sendSelectedComponentData = sendSelectedComponentData;
  4835. function markSelectedInstance(instanceId, ctx) {
  4836. ctx.currentInspectedComponentId = instanceId;
  4837. ctx.currentAppRecord.lastInspectedComponentId = instanceId;
  4838. }
  4839. exports.markSelectedInstance = markSelectedInstance;
  4840. function sendEmptyComponentData(instanceId, ctx) {
  4841. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_SELECTED_DATA, {
  4842. instanceId,
  4843. data: null
  4844. });
  4845. }
  4846. exports.sendEmptyComponentData = sendEmptyComponentData;
  4847. async function editComponentState(instanceId, dotPath, type, state, ctx) {
  4848. if (!instanceId)
  4849. return;
  4850. const instance = getComponentInstance(ctx.currentAppRecord, instanceId);
  4851. if (instance) {
  4852. if ("value" in state && state.value != null) {
  4853. state.value = (0, shared_utils_1.parse)(state.value, true);
  4854. }
  4855. await ctx.currentAppRecord.backend.api.editComponentState(instance, dotPath, type, state, ctx.currentAppRecord.options.app);
  4856. await sendSelectedComponentData(ctx.currentAppRecord, instanceId, ctx);
  4857. }
  4858. }
  4859. exports.editComponentState = editComponentState;
  4860. async function getComponentId(app, uid, instance, ctx) {
  4861. try {
  4862. if (instance.__VUE_DEVTOOLS_UID__)
  4863. return instance.__VUE_DEVTOOLS_UID__;
  4864. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  4865. if (!appRecord)
  4866. return null;
  4867. const isRoot = appRecord.rootInstance === instance;
  4868. return `${appRecord.id}:${isRoot ? "root" : uid}`;
  4869. } catch (e2) {
  4870. if (shared_utils_1.SharedData.debugInfo) {
  4871. console.error(e2);
  4872. }
  4873. return null;
  4874. }
  4875. }
  4876. exports.getComponentId = getComponentId;
  4877. function getComponentInstance(appRecord, instanceId, ctx) {
  4878. if (instanceId === "_root") {
  4879. instanceId = `${appRecord.id}:root`;
  4880. }
  4881. const instance = appRecord.instanceMap.get(instanceId);
  4882. if (!instance && shared_utils_1.SharedData.debugInfo) {
  4883. console.warn(`Instance uid=${instanceId} not found`);
  4884. }
  4885. return instance;
  4886. }
  4887. exports.getComponentInstance = getComponentInstance;
  4888. async function refreshComponentTreeSearch(ctx) {
  4889. if (!ctx.currentAppRecord.componentFilter)
  4890. return;
  4891. await sendComponentTreeData(ctx.currentAppRecord, "_root", ctx.currentAppRecord.componentFilter, null, false, ctx);
  4892. }
  4893. exports.refreshComponentTreeSearch = refreshComponentTreeSearch;
  4894. async function sendComponentUpdateTracking(instanceId, ctx) {
  4895. if (!instanceId)
  4896. return;
  4897. const payload = {
  4898. instanceId,
  4899. time: Date.now()
  4900. // Use normal date
  4901. };
  4902. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_UPDATED, payload);
  4903. }
  4904. exports.sendComponentUpdateTracking = sendComponentUpdateTracking;
  4905. }
  4906. ),
  4907. /***/
  4908. "../app-backend-core/lib/flash.js": (
  4909. /*!****************************************!*\
  4910. !*** ../app-backend-core/lib/flash.js ***!
  4911. \****************************************/
  4912. /***/
  4913. (__unused_webpack_module, exports) => {
  4914. Object.defineProperty(exports, "__esModule", {
  4915. value: true
  4916. });
  4917. exports.flashComponent = void 0;
  4918. async function flashComponent(instance, backend) {
  4919. const bounds = await backend.api.getComponentBounds(instance);
  4920. if (bounds) {
  4921. let overlay = instance.__VUE_DEVTOOLS_FLASH;
  4922. if (!overlay) {
  4923. overlay = document.createElement("div");
  4924. instance.__VUE_DEVTOOLS_FLASH = overlay;
  4925. overlay.style.border = "2px rgba(65, 184, 131, 0.7) solid";
  4926. overlay.style.position = "fixed";
  4927. overlay.style.zIndex = "99999999999998";
  4928. overlay.style.pointerEvents = "none";
  4929. overlay.style.borderRadius = "3px";
  4930. overlay.style.boxSizing = "border-box";
  4931. document.body.appendChild(overlay);
  4932. }
  4933. overlay.style.opacity = "1";
  4934. overlay.style.transition = null;
  4935. overlay.style.width = Math.round(bounds.width) + "px";
  4936. overlay.style.height = Math.round(bounds.height) + "px";
  4937. overlay.style.left = Math.round(bounds.left) + "px";
  4938. overlay.style.top = Math.round(bounds.top) + "px";
  4939. requestAnimationFrame(() => {
  4940. overlay.style.transition = "opacity 1s";
  4941. overlay.style.opacity = "0";
  4942. });
  4943. clearTimeout(overlay._timer);
  4944. overlay._timer = setTimeout(() => {
  4945. document.body.removeChild(overlay);
  4946. instance.__VUE_DEVTOOLS_FLASH = null;
  4947. }, 1e3);
  4948. }
  4949. }
  4950. exports.flashComponent = flashComponent;
  4951. }
  4952. ),
  4953. /***/
  4954. "../app-backend-core/lib/global-hook.js": (
  4955. /*!**********************************************!*\
  4956. !*** ../app-backend-core/lib/global-hook.js ***!
  4957. \**********************************************/
  4958. /***/
  4959. (__unused_webpack_module, exports, __webpack_require__2) => {
  4960. Object.defineProperty(exports, "__esModule", {
  4961. value: true
  4962. });
  4963. exports.hook = void 0;
  4964. const shared_utils_1 = __webpack_require__2(
  4965. /*! @vue-devtools/shared-utils */
  4966. "../shared-utils/lib/index.js"
  4967. );
  4968. exports.hook = shared_utils_1.target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4969. }
  4970. ),
  4971. /***/
  4972. "../app-backend-core/lib/highlighter.js": (
  4973. /*!**********************************************!*\
  4974. !*** ../app-backend-core/lib/highlighter.js ***!
  4975. \**********************************************/
  4976. /***/
  4977. (__unused_webpack_module, exports, __webpack_require__2) => {
  4978. Object.defineProperty(exports, "__esModule", {
  4979. value: true
  4980. });
  4981. exports.unHighlight = exports.highlight = void 0;
  4982. const shared_utils_1 = __webpack_require__2(
  4983. /*! @vue-devtools/shared-utils */
  4984. "../shared-utils/lib/index.js"
  4985. );
  4986. const queue_1 = __webpack_require__2(
  4987. /*! ./util/queue */
  4988. "../app-backend-core/lib/util/queue.js"
  4989. );
  4990. let overlay;
  4991. let overlayContent;
  4992. let currentInstance;
  4993. function createOverlay() {
  4994. if (overlay || !shared_utils_1.isBrowser)
  4995. return;
  4996. overlay = document.createElement("div");
  4997. overlay.style.backgroundColor = "rgba(65, 184, 131, 0.35)";
  4998. overlay.style.position = "fixed";
  4999. overlay.style.zIndex = "99999999999998";
  5000. overlay.style.pointerEvents = "none";
  5001. overlay.style.borderRadius = "3px";
  5002. overlayContent = document.createElement("div");
  5003. overlayContent.style.position = "fixed";
  5004. overlayContent.style.zIndex = "99999999999999";
  5005. overlayContent.style.pointerEvents = "none";
  5006. overlayContent.style.backgroundColor = "white";
  5007. overlayContent.style.fontFamily = "monospace";
  5008. overlayContent.style.fontSize = "11px";
  5009. overlayContent.style.padding = "4px 8px";
  5010. overlayContent.style.borderRadius = "3px";
  5011. overlayContent.style.color = "#333";
  5012. overlayContent.style.textAlign = "center";
  5013. overlayContent.style.border = "rgba(65, 184, 131, 0.5) 1px solid";
  5014. overlayContent.style.backgroundClip = "padding-box";
  5015. }
  5016. const jobQueue = new queue_1.JobQueue();
  5017. async function highlight(instance, backend, ctx) {
  5018. await jobQueue.queue("highlight", async () => {
  5019. if (!instance)
  5020. return;
  5021. const bounds = await backend.api.getComponentBounds(instance);
  5022. if (bounds) {
  5023. createOverlay();
  5024. const name = await backend.api.getComponentName(instance) || "Anonymous";
  5025. const pre = document.createElement("span");
  5026. pre.style.opacity = "0.6";
  5027. pre.innerText = "<";
  5028. const text = document.createElement("span");
  5029. text.style.fontWeight = "bold";
  5030. text.style.color = "#09ab56";
  5031. text.innerText = name;
  5032. const post = document.createElement("span");
  5033. post.style.opacity = "0.6";
  5034. post.innerText = ">";
  5035. const size = document.createElement("span");
  5036. size.style.opacity = "0.5";
  5037. size.style.marginLeft = "6px";
  5038. size.appendChild(document.createTextNode((Math.round(bounds.width * 100) / 100).toString()));
  5039. const multiply = document.createElement("span");
  5040. multiply.style.marginLeft = multiply.style.marginRight = "2px";
  5041. multiply.innerText = "×";
  5042. size.appendChild(multiply);
  5043. size.appendChild(document.createTextNode((Math.round(bounds.height * 100) / 100).toString()));
  5044. currentInstance = instance;
  5045. await showOverlay(bounds, [pre, text, post, size]);
  5046. }
  5047. startUpdateTimer(backend);
  5048. });
  5049. }
  5050. exports.highlight = highlight;
  5051. async function unHighlight() {
  5052. await jobQueue.queue("unHighlight", async () => {
  5053. var _a, _b;
  5054. (_a = overlay === null || overlay === void 0 ? void 0 : overlay.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(overlay);
  5055. (_b = overlayContent === null || overlayContent === void 0 ? void 0 : overlayContent.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(overlayContent);
  5056. currentInstance = null;
  5057. stopUpdateTimer();
  5058. });
  5059. }
  5060. exports.unHighlight = unHighlight;
  5061. function showOverlay(bounds, children = null) {
  5062. if (!shared_utils_1.isBrowser || !children.length)
  5063. return;
  5064. positionOverlay(bounds);
  5065. document.body.appendChild(overlay);
  5066. overlayContent.innerHTML = "";
  5067. children.forEach((child) => overlayContent.appendChild(child));
  5068. document.body.appendChild(overlayContent);
  5069. positionOverlayContent(bounds);
  5070. }
  5071. function positionOverlay({
  5072. width = 0,
  5073. height = 0,
  5074. top = 0,
  5075. left = 0
  5076. }) {
  5077. overlay.style.width = Math.round(width) + "px";
  5078. overlay.style.height = Math.round(height) + "px";
  5079. overlay.style.left = Math.round(left) + "px";
  5080. overlay.style.top = Math.round(top) + "px";
  5081. }
  5082. function positionOverlayContent({
  5083. height = 0,
  5084. top = 0,
  5085. left = 0
  5086. }) {
  5087. const contentWidth = overlayContent.offsetWidth;
  5088. const contentHeight = overlayContent.offsetHeight;
  5089. let contentLeft = left;
  5090. if (contentLeft < 0) {
  5091. contentLeft = 0;
  5092. } else if (contentLeft + contentWidth > window.innerWidth) {
  5093. contentLeft = window.innerWidth - contentWidth;
  5094. }
  5095. let contentTop = top - contentHeight - 2;
  5096. if (contentTop < 0) {
  5097. contentTop = top + height + 2;
  5098. }
  5099. if (contentTop < 0) {
  5100. contentTop = 0;
  5101. } else if (contentTop + contentHeight > window.innerHeight) {
  5102. contentTop = window.innerHeight - contentHeight;
  5103. }
  5104. overlayContent.style.left = ~~contentLeft + "px";
  5105. overlayContent.style.top = ~~contentTop + "px";
  5106. }
  5107. async function updateOverlay(backend, ctx) {
  5108. if (currentInstance) {
  5109. const bounds = await backend.api.getComponentBounds(currentInstance);
  5110. if (bounds) {
  5111. const sizeEl = overlayContent.children.item(3);
  5112. const widthEl = sizeEl.childNodes[0];
  5113. widthEl.textContent = (Math.round(bounds.width * 100) / 100).toString();
  5114. const heightEl = sizeEl.childNodes[2];
  5115. heightEl.textContent = (Math.round(bounds.height * 100) / 100).toString();
  5116. positionOverlay(bounds);
  5117. positionOverlayContent(bounds);
  5118. }
  5119. }
  5120. }
  5121. let updateTimer;
  5122. function startUpdateTimer(backend, ctx) {
  5123. stopUpdateTimer();
  5124. updateTimer = setInterval(() => {
  5125. jobQueue.queue("updateOverlay", async () => {
  5126. await updateOverlay(backend);
  5127. });
  5128. }, 1e3 / 30);
  5129. }
  5130. function stopUpdateTimer() {
  5131. clearInterval(updateTimer);
  5132. }
  5133. }
  5134. ),
  5135. /***/
  5136. "../app-backend-core/lib/index.js": (
  5137. /*!****************************************!*\
  5138. !*** ../app-backend-core/lib/index.js ***!
  5139. \****************************************/
  5140. /***/
  5141. function(__unused_webpack_module, exports, __webpack_require__2) {
  5142. var __importDefault = this && this.__importDefault || function(mod) {
  5143. return mod && mod.__esModule ? mod : {
  5144. "default": mod
  5145. };
  5146. };
  5147. var _a, _b;
  5148. Object.defineProperty(exports, "__esModule", {
  5149. value: true
  5150. });
  5151. exports.initBackend = void 0;
  5152. const app_backend_api_1 = __webpack_require__2(
  5153. /*! @vue-devtools/app-backend-api */
  5154. "../app-backend-api/lib/index.js"
  5155. );
  5156. const shared_utils_1 = __webpack_require__2(
  5157. /*! @vue-devtools/shared-utils */
  5158. "../shared-utils/lib/index.js"
  5159. );
  5160. const debounce_1 = __importDefault(__webpack_require__2(
  5161. /*! lodash/debounce */
  5162. "../../node_modules/lodash/debounce.js"
  5163. ));
  5164. const throttle_1 = __importDefault(__webpack_require__2(
  5165. /*! lodash/throttle */
  5166. "../../node_modules/lodash/throttle.js"
  5167. ));
  5168. const global_hook_1 = __webpack_require__2(
  5169. /*! ./global-hook */
  5170. "../app-backend-core/lib/global-hook.js"
  5171. );
  5172. const subscriptions_1 = __webpack_require__2(
  5173. /*! ./util/subscriptions */
  5174. "../app-backend-core/lib/util/subscriptions.js"
  5175. );
  5176. const highlighter_1 = __webpack_require__2(
  5177. /*! ./highlighter */
  5178. "../app-backend-core/lib/highlighter.js"
  5179. );
  5180. const timeline_1 = __webpack_require__2(
  5181. /*! ./timeline */
  5182. "../app-backend-core/lib/timeline.js"
  5183. );
  5184. const component_pick_1 = __importDefault(__webpack_require__2(
  5185. /*! ./component-pick */
  5186. "../app-backend-core/lib/component-pick.js"
  5187. ));
  5188. const component_1 = __webpack_require__2(
  5189. /*! ./component */
  5190. "../app-backend-core/lib/component.js"
  5191. );
  5192. const plugin_1 = __webpack_require__2(
  5193. /*! ./plugin */
  5194. "../app-backend-core/lib/plugin.js"
  5195. );
  5196. const devtools_api_1 = __webpack_require__2(
  5197. /*! @vue/devtools-api */
  5198. "../api/lib/esm/index.js"
  5199. );
  5200. const app_1 = __webpack_require__2(
  5201. /*! ./app */
  5202. "../app-backend-core/lib/app.js"
  5203. );
  5204. const inspector_1 = __webpack_require__2(
  5205. /*! ./inspector */
  5206. "../app-backend-core/lib/inspector.js"
  5207. );
  5208. const timeline_screenshot_1 = __webpack_require__2(
  5209. /*! ./timeline-screenshot */
  5210. "../app-backend-core/lib/timeline-screenshot.js"
  5211. );
  5212. const perf_1 = __webpack_require__2(
  5213. /*! ./perf */
  5214. "../app-backend-core/lib/perf.js"
  5215. );
  5216. const page_config_1 = __webpack_require__2(
  5217. /*! ./page-config */
  5218. "../app-backend-core/lib/page-config.js"
  5219. );
  5220. const timeline_marker_1 = __webpack_require__2(
  5221. /*! ./timeline-marker */
  5222. "../app-backend-core/lib/timeline-marker.js"
  5223. );
  5224. const flash_js_1 = __webpack_require__2(
  5225. /*! ./flash.js */
  5226. "../app-backend-core/lib/flash.js"
  5227. );
  5228. let ctx = (_a = shared_utils_1.target.__vdevtools_ctx) !== null && _a !== void 0 ? _a : null;
  5229. let connected = (_b = shared_utils_1.target.__vdevtools_connected) !== null && _b !== void 0 ? _b : false;
  5230. async function initBackend(bridge) {
  5231. await (0, shared_utils_1.initSharedData)({
  5232. bridge,
  5233. persist: false
  5234. });
  5235. shared_utils_1.SharedData.isBrowser = shared_utils_1.isBrowser;
  5236. (0, page_config_1.initOnPageConfig)();
  5237. if (!connected) {
  5238. ctx = shared_utils_1.target.__vdevtools_ctx = (0, app_backend_api_1.createBackendContext)({
  5239. bridge,
  5240. hook: global_hook_1.hook
  5241. });
  5242. shared_utils_1.SharedData.legacyApps = false;
  5243. if (global_hook_1.hook.Vue) {
  5244. connect();
  5245. (0, app_1._legacy_getAndRegisterApps)(ctx, true);
  5246. shared_utils_1.SharedData.legacyApps = true;
  5247. }
  5248. global_hook_1.hook.on(shared_utils_1.HookEvents.INIT, () => {
  5249. (0, app_1._legacy_getAndRegisterApps)(ctx, true);
  5250. shared_utils_1.SharedData.legacyApps = true;
  5251. });
  5252. global_hook_1.hook.on(shared_utils_1.HookEvents.APP_ADD, async (app) => {
  5253. await (0, app_1.registerApp)(app, ctx);
  5254. connect();
  5255. });
  5256. if (global_hook_1.hook.apps.length) {
  5257. global_hook_1.hook.apps.forEach((app) => {
  5258. (0, app_1.registerApp)(app, ctx);
  5259. connect();
  5260. });
  5261. }
  5262. } else {
  5263. ctx.bridge = bridge;
  5264. connectBridge();
  5265. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_RECONNECTED);
  5266. }
  5267. }
  5268. exports.initBackend = initBackend;
  5269. async function connect() {
  5270. if (connected) {
  5271. return;
  5272. }
  5273. connected = shared_utils_1.target.__vdevtools_connected = true;
  5274. await (0, app_1.waitForAppsRegistration)();
  5275. connectBridge();
  5276. ctx.currentTab = shared_utils_1.BuiltinTabs.COMPONENTS;
  5277. global_hook_1.hook.on(shared_utils_1.HookEvents.APP_UNMOUNT, async (app) => {
  5278. await (0, app_1.removeApp)(app, ctx);
  5279. });
  5280. const _sendComponentUpdate = async (appRecord, id) => {
  5281. try {
  5282. if (id && (0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.SELECTED_COMPONENT_DATA, (sub) => sub.payload.instanceId === id)) {
  5283. await (0, component_1.sendSelectedComponentData)(appRecord, id, ctx);
  5284. }
  5285. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === id)) {
  5286. await (0, component_1.sendComponentTreeData)(appRecord, id, appRecord.componentFilter, 0, false, ctx);
  5287. }
  5288. } catch (e2) {
  5289. if (shared_utils_1.SharedData.debugInfo) {
  5290. console.error(e2);
  5291. }
  5292. }
  5293. };
  5294. const sendComponentUpdate = (0, throttle_1.default)(_sendComponentUpdate, 100);
  5295. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_UPDATED, async (app, uid, parentUid, component) => {
  5296. try {
  5297. if (!app || typeof uid !== "number" && !uid || !component)
  5298. return;
  5299. let id;
  5300. let appRecord;
  5301. if (app && uid != null) {
  5302. id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5303. appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5304. } else {
  5305. id = ctx.currentInspectedComponentId;
  5306. appRecord = ctx.currentAppRecord;
  5307. }
  5308. if (shared_utils_1.SharedData.trackUpdates) {
  5309. await (0, component_1.sendComponentUpdateTracking)(id, ctx);
  5310. }
  5311. if (shared_utils_1.SharedData.flashUpdates) {
  5312. await (0, flash_js_1.flashComponent)(component, appRecord.backend);
  5313. }
  5314. await sendComponentUpdate(appRecord, id);
  5315. } catch (e2) {
  5316. if (shared_utils_1.SharedData.debugInfo) {
  5317. console.error(e2);
  5318. }
  5319. }
  5320. });
  5321. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_ADDED, async (app, uid, parentUid, component) => {
  5322. try {
  5323. if (!app || typeof uid !== "number" && !uid || !component)
  5324. return;
  5325. const id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5326. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5327. if (component) {
  5328. if (component.__VUE_DEVTOOLS_UID__ == null) {
  5329. component.__VUE_DEVTOOLS_UID__ = id;
  5330. }
  5331. if (!appRecord.instanceMap.has(id)) {
  5332. appRecord.instanceMap.set(id, component);
  5333. }
  5334. }
  5335. if (uid !== 0 && parentUid === void 0) {
  5336. const parentId = `${id.split(":")[0]}:root`;
  5337. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5338. }
  5339. if (false)
  5340. ;
  5341. if (parentUid != null) {
  5342. const parentInstances = await appRecord.backend.api.walkComponentParents(component);
  5343. if (parentInstances.length) {
  5344. for (let i2 = 0; i2 < parentInstances.length; i2++) {
  5345. const parentId = await (0, component_1.getComponentId)(app, parentUid, parentInstances[i2], ctx);
  5346. if (i2 < 2 && (0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === parentId)) {
  5347. (0, shared_utils_1.raf)(() => {
  5348. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5349. });
  5350. }
  5351. if (shared_utils_1.SharedData.trackUpdates) {
  5352. await (0, component_1.sendComponentUpdateTracking)(parentId, ctx);
  5353. }
  5354. }
  5355. }
  5356. }
  5357. if (ctx.currentInspectedComponentId === id) {
  5358. await (0, component_1.sendSelectedComponentData)(appRecord, id, ctx);
  5359. }
  5360. if (shared_utils_1.SharedData.trackUpdates) {
  5361. await (0, component_1.sendComponentUpdateTracking)(id, ctx);
  5362. }
  5363. if (shared_utils_1.SharedData.flashUpdates) {
  5364. await (0, flash_js_1.flashComponent)(component, appRecord.backend);
  5365. }
  5366. await (0, component_1.refreshComponentTreeSearch)(ctx);
  5367. } catch (e2) {
  5368. if (shared_utils_1.SharedData.debugInfo) {
  5369. console.error(e2);
  5370. }
  5371. }
  5372. });
  5373. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_REMOVED, async (app, uid, parentUid, component) => {
  5374. try {
  5375. if (!app || typeof uid !== "number" && !uid || !component)
  5376. return;
  5377. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  5378. if (uid !== 0 && parentUid === void 0) {
  5379. const id2 = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5380. const parentId = `${id2.split(":")[0]}:root`;
  5381. (0, component_1.sendComponentTreeData)(appRecord, parentId, appRecord.componentFilter, null, false, ctx);
  5382. }
  5383. if (parentUid != null) {
  5384. const parentInstances = await appRecord.backend.api.walkComponentParents(component);
  5385. if (parentInstances.length) {
  5386. const parentId = await (0, component_1.getComponentId)(app, parentUid, parentInstances[0], ctx);
  5387. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === parentId)) {
  5388. (0, shared_utils_1.raf)(async () => {
  5389. try {
  5390. (0, component_1.sendComponentTreeData)(await (0, app_1.getAppRecord)(app, ctx), parentId, appRecord.componentFilter, null, false, ctx);
  5391. } catch (e2) {
  5392. if (shared_utils_1.SharedData.debugInfo) {
  5393. console.error(e2);
  5394. }
  5395. }
  5396. });
  5397. }
  5398. }
  5399. }
  5400. const id = await (0, component_1.getComponentId)(app, uid, component, ctx);
  5401. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.SELECTED_COMPONENT_DATA, (sub) => sub.payload.instanceId === id)) {
  5402. await (0, component_1.sendEmptyComponentData)(id, ctx);
  5403. }
  5404. appRecord.instanceMap.delete(id);
  5405. await (0, component_1.refreshComponentTreeSearch)(ctx);
  5406. } catch (e2) {
  5407. if (shared_utils_1.SharedData.debugInfo) {
  5408. console.error(e2);
  5409. }
  5410. }
  5411. });
  5412. global_hook_1.hook.on(shared_utils_1.HookEvents.TRACK_UPDATE, (id, ctx2) => {
  5413. (0, component_1.sendComponentUpdateTracking)(id, ctx2);
  5414. });
  5415. global_hook_1.hook.on(shared_utils_1.HookEvents.FLASH_UPDATE, (instance, backend) => {
  5416. (0, flash_js_1.flashComponent)(instance, backend);
  5417. });
  5418. global_hook_1.hook.on(shared_utils_1.HookEvents.PERFORMANCE_START, async (app, uid, vm, type, time) => {
  5419. await (0, perf_1.performanceMarkStart)(app, uid, vm, type, time, ctx);
  5420. });
  5421. global_hook_1.hook.on(shared_utils_1.HookEvents.PERFORMANCE_END, async (app, uid, vm, type, time) => {
  5422. await (0, perf_1.performanceMarkEnd)(app, uid, vm, type, time, ctx);
  5423. });
  5424. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_HIGHLIGHT, async (instanceId) => {
  5425. await (0, highlighter_1.highlight)(ctx.currentAppRecord.instanceMap.get(instanceId), ctx.currentAppRecord.backend, ctx);
  5426. });
  5427. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_UNHIGHLIGHT, async () => {
  5428. await (0, highlighter_1.unHighlight)();
  5429. });
  5430. (0, timeline_1.setupTimeline)(ctx);
  5431. global_hook_1.hook.on(shared_utils_1.HookEvents.TIMELINE_LAYER_ADDED, async (options, plugin) => {
  5432. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  5433. ctx.timelineLayers.push({
  5434. ...options,
  5435. appRecord,
  5436. plugin,
  5437. events: []
  5438. });
  5439. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_ADD, {});
  5440. });
  5441. global_hook_1.hook.on(shared_utils_1.HookEvents.TIMELINE_EVENT_ADDED, async (options, plugin) => {
  5442. await (0, timeline_1.addTimelineEvent)(options, plugin.descriptor.app, ctx);
  5443. });
  5444. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_ADD, async (options, plugin) => {
  5445. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  5446. ctx.customInspectors.push({
  5447. ...options,
  5448. appRecord,
  5449. plugin,
  5450. treeFilter: "",
  5451. selectedNodeId: null
  5452. });
  5453. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_ADD, {});
  5454. });
  5455. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_TREE, async (inspectorId, plugin) => {
  5456. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5457. if (inspector) {
  5458. await (0, inspector_1.sendInspectorTree)(inspector, ctx);
  5459. } else if (shared_utils_1.SharedData.debugInfo) {
  5460. console.warn(`Inspector ${inspectorId} not found`);
  5461. }
  5462. });
  5463. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SEND_STATE, async (inspectorId, plugin) => {
  5464. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5465. if (inspector) {
  5466. await (0, inspector_1.sendInspectorState)(inspector, ctx);
  5467. } else if (shared_utils_1.SharedData.debugInfo) {
  5468. console.warn(`Inspector ${inspectorId} not found`);
  5469. }
  5470. });
  5471. global_hook_1.hook.on(shared_utils_1.HookEvents.CUSTOM_INSPECTOR_SELECT_NODE, async (inspectorId, nodeId, plugin) => {
  5472. const inspector = (0, inspector_1.getInspector)(inspectorId, plugin.descriptor.app, ctx);
  5473. if (inspector) {
  5474. await (0, inspector_1.selectInspectorNode)(inspector, nodeId, ctx);
  5475. } else if (shared_utils_1.SharedData.debugInfo) {
  5476. console.warn(`Inspector ${inspectorId} not found`);
  5477. }
  5478. });
  5479. try {
  5480. await (0, plugin_1.addPreviouslyRegisteredPlugins)(ctx);
  5481. } catch (e2) {
  5482. console.error(`Error adding previously registered plugins:`);
  5483. console.error(e2);
  5484. }
  5485. try {
  5486. await (0, plugin_1.addQueuedPlugins)(ctx);
  5487. } catch (e2) {
  5488. console.error(`Error adding queued plugins:`);
  5489. console.error(e2);
  5490. }
  5491. global_hook_1.hook.on(shared_utils_1.HookEvents.SETUP_DEVTOOLS_PLUGIN, async (pluginDescriptor, setupFn) => {
  5492. await (0, plugin_1.addPlugin)({
  5493. pluginDescriptor,
  5494. setupFn
  5495. }, ctx);
  5496. });
  5497. shared_utils_1.target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ = true;
  5498. const handleFlush = (0, debounce_1.default)(async () => {
  5499. var _a2;
  5500. if ((_a2 = ctx.currentAppRecord) === null || _a2 === void 0 ? void 0 : _a2.backend.options.features.includes(app_backend_api_1.BuiltinBackendFeature.FLUSH)) {
  5501. await (0, component_1.sendComponentTreeData)(ctx.currentAppRecord, "_root", ctx.currentAppRecord.componentFilter, null, false, ctx);
  5502. if (ctx.currentInspectedComponentId) {
  5503. await (0, component_1.sendSelectedComponentData)(ctx.currentAppRecord, ctx.currentInspectedComponentId, ctx);
  5504. }
  5505. }
  5506. }, 500);
  5507. global_hook_1.hook.off(shared_utils_1.HookEvents.FLUSH);
  5508. global_hook_1.hook.on(shared_utils_1.HookEvents.FLUSH, handleFlush);
  5509. try {
  5510. await (0, timeline_marker_1.addTimelineMarker)({
  5511. id: "vue-devtools-init-backend",
  5512. time: (0, devtools_api_1.now)(),
  5513. label: "Vue Devtools connected",
  5514. color: 4307075,
  5515. all: true
  5516. }, ctx);
  5517. } catch (e2) {
  5518. console.error(`Error while adding devtools connected timeline marker:`);
  5519. console.error(e2);
  5520. }
  5521. }
  5522. function connectBridge() {
  5523. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_SUBSCRIBE, ({
  5524. type,
  5525. payload
  5526. }) => {
  5527. (0, subscriptions_1.subscribe)(type, payload);
  5528. });
  5529. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_UNSUBSCRIBE, ({
  5530. type,
  5531. payload
  5532. }) => {
  5533. (0, subscriptions_1.unsubscribe)(type, payload);
  5534. });
  5535. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TAB_SWITCH, async (tab) => {
  5536. ctx.currentTab = tab;
  5537. await (0, highlighter_1.unHighlight)();
  5538. });
  5539. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_APP_LIST, async () => {
  5540. await (0, app_1.sendApps)(ctx);
  5541. });
  5542. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_APP_SELECT, async (id) => {
  5543. if (id == null)
  5544. return;
  5545. const record2 = ctx.appRecords.find((r2) => r2.id === id);
  5546. if (record2) {
  5547. await (0, app_1.selectApp)(record2, ctx);
  5548. } else if (shared_utils_1.SharedData.debugInfo) {
  5549. console.warn(`App with id ${id} not found`);
  5550. }
  5551. });
  5552. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_SCAN_LEGACY_APPS, () => {
  5553. if (global_hook_1.hook.Vue) {
  5554. (0, app_1._legacy_getAndRegisterApps)(ctx);
  5555. }
  5556. });
  5557. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_TREE, async ({
  5558. instanceId,
  5559. filter,
  5560. recursively
  5561. }) => {
  5562. ctx.currentAppRecord.componentFilter = filter;
  5563. (0, subscriptions_1.subscribe)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, {
  5564. instanceId
  5565. });
  5566. await (0, component_1.sendComponentTreeData)(ctx.currentAppRecord, instanceId, filter, null, recursively, ctx);
  5567. });
  5568. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_SELECTED_DATA, async (instanceId) => {
  5569. await (0, component_1.sendSelectedComponentData)(ctx.currentAppRecord, instanceId, ctx);
  5570. });
  5571. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_EDIT_STATE, async ({
  5572. instanceId,
  5573. dotPath,
  5574. type,
  5575. value,
  5576. newKey,
  5577. remove
  5578. }) => {
  5579. await (0, component_1.editComponentState)(instanceId, dotPath, type, {
  5580. value,
  5581. newKey,
  5582. remove
  5583. }, ctx);
  5584. });
  5585. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_INSPECT_DOM, async ({
  5586. instanceId
  5587. }) => {
  5588. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5589. if (instance) {
  5590. const [el] = await ctx.currentAppRecord.backend.api.getComponentRootElements(instance);
  5591. if (el) {
  5592. shared_utils_1.target.__VUE_DEVTOOLS_INSPECT_TARGET__ = el;
  5593. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_INSPECT_DOM, null);
  5594. }
  5595. }
  5596. });
  5597. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_SCROLL_TO, async ({
  5598. instanceId
  5599. }) => {
  5600. if (!shared_utils_1.isBrowser)
  5601. return;
  5602. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5603. if (instance) {
  5604. const [el] = await ctx.currentAppRecord.backend.api.getComponentRootElements(instance);
  5605. if (el) {
  5606. if (typeof el.scrollIntoView === "function") {
  5607. el.scrollIntoView({
  5608. behavior: "smooth",
  5609. block: "center",
  5610. inline: "center"
  5611. });
  5612. } else {
  5613. const bounds = await ctx.currentAppRecord.backend.api.getComponentBounds(instance);
  5614. const scrollTarget = document.createElement("div");
  5615. scrollTarget.style.position = "absolute";
  5616. scrollTarget.style.width = `${bounds.width}px`;
  5617. scrollTarget.style.height = `${bounds.height}px`;
  5618. scrollTarget.style.top = `${bounds.top}px`;
  5619. scrollTarget.style.left = `${bounds.left}px`;
  5620. document.body.appendChild(scrollTarget);
  5621. scrollTarget.scrollIntoView({
  5622. behavior: "smooth",
  5623. block: "center",
  5624. inline: "center"
  5625. });
  5626. setTimeout(() => {
  5627. document.body.removeChild(scrollTarget);
  5628. }, 2e3);
  5629. }
  5630. (0, highlighter_1.highlight)(instance, ctx.currentAppRecord.backend, ctx);
  5631. setTimeout(() => {
  5632. (0, highlighter_1.unHighlight)();
  5633. }, 2e3);
  5634. }
  5635. }
  5636. });
  5637. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_RENDER_CODE, async ({
  5638. instanceId
  5639. }) => {
  5640. if (!shared_utils_1.isBrowser)
  5641. return;
  5642. const instance = (0, component_1.getComponentInstance)(ctx.currentAppRecord, instanceId, ctx);
  5643. if (instance) {
  5644. const {
  5645. code
  5646. } = await ctx.currentAppRecord.backend.api.getComponentRenderCode(instance);
  5647. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_RENDER_CODE, {
  5648. instanceId,
  5649. code
  5650. });
  5651. }
  5652. });
  5653. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_STATE_ACTION, async ({
  5654. value,
  5655. actionIndex
  5656. }) => {
  5657. const rawAction = value._custom.actions[actionIndex];
  5658. const action = (0, shared_utils_1.revive)(rawAction === null || rawAction === void 0 ? void 0 : rawAction.action);
  5659. if (action) {
  5660. try {
  5661. await action();
  5662. } catch (e2) {
  5663. console.error(e2);
  5664. }
  5665. } else {
  5666. console.warn(`Couldn't revive action ${actionIndex} from`, value);
  5667. }
  5668. });
  5669. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_MOUSE_OVER, async (instanceId) => {
  5670. await (0, highlighter_1.highlight)(ctx.currentAppRecord.instanceMap.get(instanceId), ctx.currentAppRecord.backend, ctx);
  5671. });
  5672. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_MOUSE_OUT, async () => {
  5673. await (0, highlighter_1.unHighlight)();
  5674. });
  5675. const componentPicker = new component_pick_1.default(ctx);
  5676. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_PICK, () => {
  5677. componentPicker.startSelecting();
  5678. });
  5679. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_COMPONENT_PICK_CANCELED, () => {
  5680. componentPicker.stopSelecting();
  5681. });
  5682. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LAYER_LIST, async () => {
  5683. await (0, timeline_1.sendTimelineLayers)(ctx);
  5684. });
  5685. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_SHOW_SCREENSHOT, async ({
  5686. screenshot
  5687. }) => {
  5688. await (0, timeline_screenshot_1.showScreenshot)(screenshot, ctx);
  5689. });
  5690. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_CLEAR, async () => {
  5691. await (0, timeline_1.clearTimeline)(ctx);
  5692. });
  5693. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_EVENT_DATA, async ({
  5694. id
  5695. }) => {
  5696. await (0, timeline_1.sendTimelineEventData)(id, ctx);
  5697. });
  5698. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LAYER_LOAD_EVENTS, async ({
  5699. appId,
  5700. layerId
  5701. }) => {
  5702. await (0, timeline_1.sendTimelineLayerEvents)(appId, layerId, ctx);
  5703. });
  5704. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_TIMELINE_LOAD_MARKERS, async () => {
  5705. await (0, timeline_marker_1.sendTimelineMarkers)(ctx);
  5706. });
  5707. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_LIST, async () => {
  5708. await (0, inspector_1.sendCustomInspectors)(ctx);
  5709. });
  5710. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_TREE, async ({
  5711. inspectorId,
  5712. appId,
  5713. treeFilter
  5714. }) => {
  5715. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5716. if (inspector) {
  5717. inspector.treeFilter = treeFilter;
  5718. (0, inspector_1.sendInspectorTree)(inspector, ctx);
  5719. } else if (shared_utils_1.SharedData.debugInfo) {
  5720. console.warn(`Inspector ${inspectorId} not found`);
  5721. }
  5722. });
  5723. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_STATE, async ({
  5724. inspectorId,
  5725. appId,
  5726. nodeId
  5727. }) => {
  5728. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5729. if (inspector) {
  5730. inspector.selectedNodeId = nodeId;
  5731. (0, inspector_1.sendInspectorState)(inspector, ctx);
  5732. } else if (shared_utils_1.SharedData.debugInfo) {
  5733. console.warn(`Inspector ${inspectorId} not found`);
  5734. }
  5735. });
  5736. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE, async ({
  5737. inspectorId,
  5738. appId,
  5739. nodeId,
  5740. path,
  5741. type,
  5742. payload
  5743. }) => {
  5744. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5745. if (inspector) {
  5746. await (0, inspector_1.editInspectorState)(inspector, nodeId, path, type, payload, ctx);
  5747. inspector.selectedNodeId = nodeId;
  5748. await (0, inspector_1.sendInspectorState)(inspector, ctx);
  5749. } else if (shared_utils_1.SharedData.debugInfo) {
  5750. console.warn(`Inspector ${inspectorId} not found`);
  5751. }
  5752. });
  5753. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_CUSTOM_INSPECTOR_ACTION, async ({
  5754. inspectorId,
  5755. appId,
  5756. actionIndex,
  5757. actionType,
  5758. args
  5759. }) => {
  5760. const inspector = await (0, inspector_1.getInspectorWithAppId)(inspectorId, appId, ctx);
  5761. if (inspector) {
  5762. const action = inspector[actionType !== null && actionType !== void 0 ? actionType : "actions"][actionIndex];
  5763. try {
  5764. await action.action(...args !== null && args !== void 0 ? args : []);
  5765. } catch (e2) {
  5766. if (shared_utils_1.SharedData.debugInfo) {
  5767. console.error(e2);
  5768. }
  5769. }
  5770. } else if (shared_utils_1.SharedData.debugInfo) {
  5771. console.warn(`Inspector ${inspectorId} not found`);
  5772. }
  5773. });
  5774. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_LOG, (payload) => {
  5775. let value = payload.value;
  5776. if (payload.serialized) {
  5777. value = (0, shared_utils_1.parse)(value, payload.revive);
  5778. } else if (payload.revive) {
  5779. value = (0, shared_utils_1.revive)(value);
  5780. }
  5781. console[payload.level](value);
  5782. });
  5783. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_DEVTOOLS_PLUGIN_LIST, async () => {
  5784. await (0, plugin_1.sendPluginList)(ctx);
  5785. });
  5786. ctx.bridge.on(shared_utils_1.BridgeEvents.TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED, ({
  5787. pluginId,
  5788. key,
  5789. newValue,
  5790. oldValue
  5791. }) => {
  5792. const settings = (0, shared_utils_1.getPluginSettings)(pluginId);
  5793. ctx.hook.emit(shared_utils_1.HookEvents.PLUGIN_SETTINGS_SET, pluginId, settings);
  5794. ctx.currentAppRecord.backend.api.callHook(
  5795. "setPluginSettings",
  5796. {
  5797. app: ctx.currentAppRecord.options.app,
  5798. pluginId,
  5799. key,
  5800. newValue,
  5801. oldValue,
  5802. settings
  5803. }
  5804. );
  5805. });
  5806. }
  5807. }
  5808. ),
  5809. /***/
  5810. "../app-backend-core/lib/inspector.js": (
  5811. /*!********************************************!*\
  5812. !*** ../app-backend-core/lib/inspector.js ***!
  5813. \********************************************/
  5814. /***/
  5815. (__unused_webpack_module, exports, __webpack_require__2) => {
  5816. Object.defineProperty(exports, "__esModule", {
  5817. value: true
  5818. });
  5819. exports.selectInspectorNode = exports.sendCustomInspectors = exports.editInspectorState = exports.sendInspectorState = exports.sendInspectorTree = exports.getInspectorWithAppId = exports.getInspector = void 0;
  5820. const shared_utils_1 = __webpack_require__2(
  5821. /*! @vue-devtools/shared-utils */
  5822. "../shared-utils/lib/index.js"
  5823. );
  5824. function getInspector(inspectorId, app, ctx) {
  5825. return ctx.customInspectors.find((i2) => i2.id === inspectorId && i2.appRecord.options.app === app);
  5826. }
  5827. exports.getInspector = getInspector;
  5828. async function getInspectorWithAppId(inspectorId, appId, ctx) {
  5829. for (const i2 of ctx.customInspectors) {
  5830. if (i2.id === inspectorId && i2.appRecord.id === appId) {
  5831. return i2;
  5832. }
  5833. }
  5834. return null;
  5835. }
  5836. exports.getInspectorWithAppId = getInspectorWithAppId;
  5837. async function sendInspectorTree(inspector, ctx) {
  5838. const rootNodes = await inspector.appRecord.backend.api.getInspectorTree(inspector.id, inspector.appRecord.options.app, inspector.treeFilter);
  5839. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_TREE, {
  5840. appId: inspector.appRecord.id,
  5841. inspectorId: inspector.id,
  5842. rootNodes
  5843. });
  5844. }
  5845. exports.sendInspectorTree = sendInspectorTree;
  5846. async function sendInspectorState(inspector, ctx) {
  5847. const state = inspector.selectedNodeId ? await inspector.appRecord.backend.api.getInspectorState(inspector.id, inspector.appRecord.options.app, inspector.selectedNodeId) : null;
  5848. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_STATE, {
  5849. appId: inspector.appRecord.id,
  5850. inspectorId: inspector.id,
  5851. state: (0, shared_utils_1.stringify)(state)
  5852. });
  5853. }
  5854. exports.sendInspectorState = sendInspectorState;
  5855. async function editInspectorState(inspector, nodeId, dotPath, type, state, ctx) {
  5856. await inspector.appRecord.backend.api.editInspectorState(inspector.id, inspector.appRecord.options.app, nodeId, dotPath, type, {
  5857. ...state,
  5858. value: state.value != null ? (0, shared_utils_1.parse)(state.value, true) : state.value
  5859. });
  5860. }
  5861. exports.editInspectorState = editInspectorState;
  5862. async function sendCustomInspectors(ctx) {
  5863. var _a, _b;
  5864. const inspectors = [];
  5865. for (const i2 of ctx.customInspectors) {
  5866. inspectors.push({
  5867. id: i2.id,
  5868. appId: i2.appRecord.id,
  5869. pluginId: i2.plugin.descriptor.id,
  5870. label: i2.label,
  5871. icon: i2.icon,
  5872. treeFilterPlaceholder: i2.treeFilterPlaceholder,
  5873. stateFilterPlaceholder: i2.stateFilterPlaceholder,
  5874. noSelectionText: i2.noSelectionText,
  5875. actions: (_a = i2.actions) === null || _a === void 0 ? void 0 : _a.map((a2) => ({
  5876. icon: a2.icon,
  5877. tooltip: a2.tooltip
  5878. })),
  5879. nodeActions: (_b = i2.nodeActions) === null || _b === void 0 ? void 0 : _b.map((a2) => ({
  5880. icon: a2.icon,
  5881. tooltip: a2.tooltip
  5882. }))
  5883. });
  5884. }
  5885. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_LIST, {
  5886. inspectors
  5887. });
  5888. }
  5889. exports.sendCustomInspectors = sendCustomInspectors;
  5890. async function selectInspectorNode(inspector, nodeId, ctx) {
  5891. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE, {
  5892. appId: inspector.appRecord.id,
  5893. inspectorId: inspector.id,
  5894. nodeId
  5895. });
  5896. }
  5897. exports.selectInspectorNode = selectInspectorNode;
  5898. }
  5899. ),
  5900. /***/
  5901. "../app-backend-core/lib/legacy/scan.js": (
  5902. /*!**********************************************!*\
  5903. !*** ../app-backend-core/lib/legacy/scan.js ***!
  5904. \**********************************************/
  5905. /***/
  5906. (__unused_webpack_module, exports, __webpack_require__2) => {
  5907. Object.defineProperty(exports, "__esModule", {
  5908. value: true
  5909. });
  5910. exports.scan = void 0;
  5911. const shared_utils_1 = __webpack_require__2(
  5912. /*! @vue-devtools/shared-utils */
  5913. "../shared-utils/lib/index.js"
  5914. );
  5915. const page_config_1 = __webpack_require__2(
  5916. /*! ../page-config */
  5917. "../app-backend-core/lib/page-config.js"
  5918. );
  5919. const rootInstances = [];
  5920. function scan() {
  5921. rootInstances.length = 0;
  5922. let inFragment = false;
  5923. let currentFragment = null;
  5924. function processInstance(instance) {
  5925. if (instance) {
  5926. if (rootInstances.indexOf(instance.$root) === -1) {
  5927. instance = instance.$root;
  5928. }
  5929. if (instance._isFragment) {
  5930. inFragment = true;
  5931. currentFragment = instance;
  5932. }
  5933. let baseVue = instance.constructor;
  5934. while (baseVue.super) {
  5935. baseVue = baseVue.super;
  5936. }
  5937. if (baseVue.config && baseVue.config.devtools) {
  5938. rootInstances.push(instance);
  5939. }
  5940. return true;
  5941. }
  5942. }
  5943. if (shared_utils_1.isBrowser) {
  5944. const walkDocument = (document2) => {
  5945. walk(document2, function(node) {
  5946. if (inFragment) {
  5947. if (node === currentFragment._fragmentEnd) {
  5948. inFragment = false;
  5949. currentFragment = null;
  5950. }
  5951. return true;
  5952. }
  5953. const instance = node.__vue__;
  5954. return processInstance(instance);
  5955. });
  5956. };
  5957. walkDocument(document);
  5958. const iframes = document.querySelectorAll("iframe");
  5959. for (const iframe of iframes) {
  5960. try {
  5961. walkDocument(iframe.contentDocument);
  5962. } catch (e2) {
  5963. }
  5964. }
  5965. const {
  5966. customVue2ScanSelector
  5967. } = (0, page_config_1.getPageConfig)();
  5968. const customTargets = customVue2ScanSelector ? document.querySelectorAll(customVue2ScanSelector) : [];
  5969. for (const customTarget of customTargets) {
  5970. try {
  5971. walkDocument(customTarget);
  5972. } catch (e2) {
  5973. }
  5974. }
  5975. } else {
  5976. if (Array.isArray(shared_utils_1.target.__VUE_ROOT_INSTANCES__)) {
  5977. shared_utils_1.target.__VUE_ROOT_INSTANCES__.map(processInstance);
  5978. }
  5979. }
  5980. return rootInstances;
  5981. }
  5982. exports.scan = scan;
  5983. function walk(node, fn) {
  5984. if (node.childNodes) {
  5985. for (let i2 = 0, l2 = node.childNodes.length; i2 < l2; i2++) {
  5986. const child = node.childNodes[i2];
  5987. const stop = fn(child);
  5988. if (!stop) {
  5989. walk(child, fn);
  5990. }
  5991. }
  5992. }
  5993. if (node.shadowRoot) {
  5994. walk(node.shadowRoot, fn);
  5995. }
  5996. }
  5997. }
  5998. ),
  5999. /***/
  6000. "../app-backend-core/lib/page-config.js": (
  6001. /*!**********************************************!*\
  6002. !*** ../app-backend-core/lib/page-config.js ***!
  6003. \**********************************************/
  6004. /***/
  6005. (__unused_webpack_module, exports, __webpack_require__2) => {
  6006. Object.defineProperty(exports, "__esModule", {
  6007. value: true
  6008. });
  6009. exports.initOnPageConfig = exports.getPageConfig = void 0;
  6010. const shared_utils_1 = __webpack_require__2(
  6011. /*! @vue-devtools/shared-utils */
  6012. "../shared-utils/lib/index.js"
  6013. );
  6014. let config = {};
  6015. function getPageConfig() {
  6016. return config;
  6017. }
  6018. exports.getPageConfig = getPageConfig;
  6019. function initOnPageConfig() {
  6020. if (Object.hasOwnProperty.call(shared_utils_1.target, "VUE_DEVTOOLS_CONFIG")) {
  6021. config = shared_utils_1.SharedData.pageConfig = shared_utils_1.target.VUE_DEVTOOLS_CONFIG;
  6022. if (Object.hasOwnProperty.call(config, "openInEditorHost")) {
  6023. shared_utils_1.SharedData.openInEditorHost = config.openInEditorHost;
  6024. }
  6025. }
  6026. }
  6027. exports.initOnPageConfig = initOnPageConfig;
  6028. }
  6029. ),
  6030. /***/
  6031. "../app-backend-core/lib/perf.js": (
  6032. /*!***************************************!*\
  6033. !*** ../app-backend-core/lib/perf.js ***!
  6034. \***************************************/
  6035. /***/
  6036. (__unused_webpack_module, exports, __webpack_require__2) => {
  6037. Object.defineProperty(exports, "__esModule", {
  6038. value: true
  6039. });
  6040. exports.handleAddPerformanceTag = exports.performanceMarkEnd = exports.performanceMarkStart = void 0;
  6041. const shared_utils_1 = __webpack_require__2(
  6042. /*! @vue-devtools/shared-utils */
  6043. "../shared-utils/lib/index.js"
  6044. );
  6045. const timeline_1 = __webpack_require__2(
  6046. /*! ./timeline */
  6047. "../app-backend-core/lib/timeline.js"
  6048. );
  6049. const app_1 = __webpack_require__2(
  6050. /*! ./app */
  6051. "../app-backend-core/lib/app.js"
  6052. );
  6053. const component_1 = __webpack_require__2(
  6054. /*! ./component */
  6055. "../app-backend-core/lib/component.js"
  6056. );
  6057. const subscriptions_1 = __webpack_require__2(
  6058. /*! ./util/subscriptions */
  6059. "../app-backend-core/lib/util/subscriptions.js"
  6060. );
  6061. async function performanceMarkStart(app, uid, instance, type, time, ctx) {
  6062. try {
  6063. if (!shared_utils_1.SharedData.performanceMonitoringEnabled)
  6064. return;
  6065. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6066. const componentName = await appRecord.backend.api.getComponentName(instance);
  6067. const groupId = ctx.perfUniqueGroupId++;
  6068. const groupKey = `${uid}-${type}`;
  6069. appRecord.perfGroupIds.set(groupKey, {
  6070. groupId,
  6071. time
  6072. });
  6073. await (0, timeline_1.addTimelineEvent)({
  6074. layerId: "performance",
  6075. event: {
  6076. time,
  6077. data: {
  6078. component: componentName,
  6079. type,
  6080. measure: "start"
  6081. },
  6082. title: componentName,
  6083. subtitle: type,
  6084. groupId
  6085. }
  6086. }, app, ctx);
  6087. if (markEndQueue.has(groupKey)) {
  6088. const {
  6089. app: app2,
  6090. uid: uid2,
  6091. instance: instance2,
  6092. type: type2,
  6093. time: time2
  6094. } = markEndQueue.get(groupKey);
  6095. markEndQueue.delete(groupKey);
  6096. await performanceMarkEnd(app2, uid2, instance2, type2, time2, ctx);
  6097. }
  6098. } catch (e2) {
  6099. if (shared_utils_1.SharedData.debugInfo) {
  6100. console.error(e2);
  6101. }
  6102. }
  6103. }
  6104. exports.performanceMarkStart = performanceMarkStart;
  6105. const markEndQueue = /* @__PURE__ */ new Map();
  6106. async function performanceMarkEnd(app, uid, instance, type, time, ctx) {
  6107. try {
  6108. if (!shared_utils_1.SharedData.performanceMonitoringEnabled)
  6109. return;
  6110. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6111. const componentName = await appRecord.backend.api.getComponentName(instance);
  6112. const groupKey = `${uid}-${type}`;
  6113. const groupInfo = appRecord.perfGroupIds.get(groupKey);
  6114. if (!groupInfo) {
  6115. markEndQueue.set(groupKey, {
  6116. app,
  6117. uid,
  6118. instance,
  6119. type,
  6120. time
  6121. });
  6122. return;
  6123. }
  6124. const {
  6125. groupId,
  6126. time: startTime
  6127. } = groupInfo;
  6128. const duration = time - startTime;
  6129. await (0, timeline_1.addTimelineEvent)({
  6130. layerId: "performance",
  6131. event: {
  6132. time,
  6133. data: {
  6134. component: componentName,
  6135. type,
  6136. measure: "end",
  6137. duration: {
  6138. _custom: {
  6139. type: "Duration",
  6140. value: duration,
  6141. display: `${duration} ms`
  6142. }
  6143. }
  6144. },
  6145. title: componentName,
  6146. subtitle: type,
  6147. groupId
  6148. }
  6149. }, app, ctx);
  6150. const tooSlow = duration > 10;
  6151. if (tooSlow || instance.__VUE_DEVTOOLS_SLOW__) {
  6152. let change = false;
  6153. if (tooSlow && !instance.__VUE_DEVTOOLS_SLOW__) {
  6154. instance.__VUE_DEVTOOLS_SLOW__ = {
  6155. duration: null,
  6156. measures: {}
  6157. };
  6158. }
  6159. const data = instance.__VUE_DEVTOOLS_SLOW__;
  6160. if (tooSlow && (data.duration == null || data.duration < duration)) {
  6161. data.duration = duration;
  6162. change = true;
  6163. }
  6164. if (data.measures[type] == null || data.measures[type] < duration) {
  6165. data.measures[type] = duration;
  6166. change = true;
  6167. }
  6168. if (change) {
  6169. const id = await (0, component_1.getComponentId)(app, uid, instance, ctx);
  6170. if ((0, subscriptions_1.isSubscribed)(shared_utils_1.BridgeSubscriptions.COMPONENT_TREE, (sub) => sub.payload.instanceId === id)) {
  6171. (0, shared_utils_1.raf)(() => {
  6172. (0, component_1.sendComponentTreeData)(appRecord, id, ctx.currentAppRecord.componentFilter, null, false, ctx);
  6173. });
  6174. }
  6175. }
  6176. }
  6177. } catch (e2) {
  6178. if (shared_utils_1.SharedData.debugInfo) {
  6179. console.error(e2);
  6180. }
  6181. }
  6182. }
  6183. exports.performanceMarkEnd = performanceMarkEnd;
  6184. function handleAddPerformanceTag(backend, ctx) {
  6185. backend.api.on.visitComponentTree((payload) => {
  6186. if (payload.componentInstance.__VUE_DEVTOOLS_SLOW__) {
  6187. const {
  6188. duration,
  6189. measures
  6190. } = payload.componentInstance.__VUE_DEVTOOLS_SLOW__;
  6191. let tooltip = '<div class="grid grid-cols-2 gap-2 font-mono text-xs">';
  6192. for (const type in measures) {
  6193. const d2 = measures[type];
  6194. tooltip += `<div>${type}</div><div class="text-right text-black rounded px-1 ${d2 > 30 ? "bg-red-400" : d2 > 10 ? "bg-yellow-400" : "bg-green-400"}">${Math.round(d2 * 1e3) / 1e3} ms</div>`;
  6195. }
  6196. tooltip += "</div>";
  6197. payload.treeNode.tags.push({
  6198. backgroundColor: duration > 30 ? 16281969 : 16498468,
  6199. textColor: 0,
  6200. label: `${Math.round(duration * 1e3) / 1e3} ms`,
  6201. tooltip
  6202. });
  6203. }
  6204. });
  6205. }
  6206. exports.handleAddPerformanceTag = handleAddPerformanceTag;
  6207. }
  6208. ),
  6209. /***/
  6210. "../app-backend-core/lib/plugin.js": (
  6211. /*!*****************************************!*\
  6212. !*** ../app-backend-core/lib/plugin.js ***!
  6213. \*****************************************/
  6214. /***/
  6215. (__unused_webpack_module, exports, __webpack_require__2) => {
  6216. Object.defineProperty(exports, "__esModule", {
  6217. value: true
  6218. });
  6219. exports.serializePlugin = exports.sendPluginList = exports.addPreviouslyRegisteredPlugins = exports.addQueuedPlugins = exports.addPlugin = void 0;
  6220. const app_backend_api_1 = __webpack_require__2(
  6221. /*! @vue-devtools/app-backend-api */
  6222. "../app-backend-api/lib/index.js"
  6223. );
  6224. const shared_utils_1 = __webpack_require__2(
  6225. /*! @vue-devtools/shared-utils */
  6226. "../shared-utils/lib/index.js"
  6227. );
  6228. const app_1 = __webpack_require__2(
  6229. /*! ./app */
  6230. "../app-backend-core/lib/app.js"
  6231. );
  6232. async function addPlugin(pluginQueueItem, ctx) {
  6233. const {
  6234. pluginDescriptor,
  6235. setupFn
  6236. } = pluginQueueItem;
  6237. const plugin = {
  6238. descriptor: pluginDescriptor,
  6239. setupFn,
  6240. error: null
  6241. };
  6242. ctx.currentPlugin = plugin;
  6243. try {
  6244. const appRecord = await (0, app_1.getAppRecord)(plugin.descriptor.app, ctx);
  6245. const api = new app_backend_api_1.DevtoolsPluginApiInstance(plugin, appRecord, ctx);
  6246. if (pluginQueueItem.proxy) {
  6247. await pluginQueueItem.proxy.setRealTarget(api);
  6248. } else {
  6249. setupFn(api);
  6250. }
  6251. } catch (e2) {
  6252. plugin.error = e2;
  6253. if (shared_utils_1.SharedData.debugInfo) {
  6254. console.error(e2);
  6255. }
  6256. }
  6257. ctx.currentPlugin = null;
  6258. ctx.plugins.push(plugin);
  6259. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_DEVTOOLS_PLUGIN_ADD, {
  6260. plugin: await serializePlugin(plugin)
  6261. });
  6262. const targetList = shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ = shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ || [];
  6263. targetList.push({
  6264. pluginDescriptor,
  6265. setupFn
  6266. });
  6267. }
  6268. exports.addPlugin = addPlugin;
  6269. async function addQueuedPlugins(ctx) {
  6270. if (shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__ && Array.isArray(shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__)) {
  6271. for (const queueItem of shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__) {
  6272. await addPlugin(queueItem, ctx);
  6273. }
  6274. shared_utils_1.target.__VUE_DEVTOOLS_PLUGINS__ = null;
  6275. }
  6276. }
  6277. exports.addQueuedPlugins = addQueuedPlugins;
  6278. async function addPreviouslyRegisteredPlugins(ctx) {
  6279. if (shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__ && Array.isArray(shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__)) {
  6280. for (const queueItem of shared_utils_1.target.__VUE_DEVTOOLS_REGISTERED_PLUGINS__) {
  6281. await addPlugin(queueItem, ctx);
  6282. }
  6283. }
  6284. }
  6285. exports.addPreviouslyRegisteredPlugins = addPreviouslyRegisteredPlugins;
  6286. async function sendPluginList(ctx) {
  6287. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_DEVTOOLS_PLUGIN_LIST, {
  6288. plugins: await Promise.all(ctx.plugins.map((p2) => serializePlugin(p2)))
  6289. });
  6290. }
  6291. exports.sendPluginList = sendPluginList;
  6292. async function serializePlugin(plugin) {
  6293. return {
  6294. id: plugin.descriptor.id,
  6295. label: plugin.descriptor.label,
  6296. appId: (0, app_1.getAppRecordId)(plugin.descriptor.app),
  6297. packageName: plugin.descriptor.packageName,
  6298. homepage: plugin.descriptor.homepage,
  6299. logo: plugin.descriptor.logo,
  6300. componentStateTypes: plugin.descriptor.componentStateTypes,
  6301. settingsSchema: plugin.descriptor.settings
  6302. };
  6303. }
  6304. exports.serializePlugin = serializePlugin;
  6305. }
  6306. ),
  6307. /***/
  6308. "../app-backend-core/lib/timeline-builtins.js": (
  6309. /*!****************************************************!*\
  6310. !*** ../app-backend-core/lib/timeline-builtins.js ***!
  6311. \****************************************************/
  6312. /***/
  6313. (__unused_webpack_module, exports) => {
  6314. Object.defineProperty(exports, "__esModule", {
  6315. value: true
  6316. });
  6317. exports.builtinLayers = void 0;
  6318. exports.builtinLayers = [{
  6319. id: "mouse",
  6320. label: "Mouse",
  6321. color: 10768815,
  6322. screenshotOverlayRender(event, {
  6323. events
  6324. }) {
  6325. const samePositionEvent = events.find((e2) => e2 !== event && e2.renderMeta.textEl && e2.data.x === event.data.x && e2.data.y === event.data.y);
  6326. if (samePositionEvent) {
  6327. const text2 = document.createElement("div");
  6328. text2.innerText = event.data.type;
  6329. samePositionEvent.renderMeta.textEl.appendChild(text2);
  6330. return false;
  6331. }
  6332. const div = document.createElement("div");
  6333. div.style.position = "absolute";
  6334. div.style.left = `${event.data.x - 4}px`;
  6335. div.style.top = `${event.data.y - 4}px`;
  6336. div.style.width = "8px";
  6337. div.style.height = "8px";
  6338. div.style.borderRadius = "100%";
  6339. div.style.backgroundColor = "rgba(164, 81, 175, 0.5)";
  6340. const text = document.createElement("div");
  6341. text.innerText = event.data.type;
  6342. text.style.color = "#541e5b";
  6343. text.style.fontFamily = "monospace";
  6344. text.style.fontSize = "9px";
  6345. text.style.position = "absolute";
  6346. text.style.left = "10px";
  6347. text.style.top = "10px";
  6348. text.style.padding = "1px";
  6349. text.style.backgroundColor = "rgba(255, 255, 255, 0.9)";
  6350. text.style.borderRadius = "3px";
  6351. div.appendChild(text);
  6352. event.renderMeta.textEl = text;
  6353. return div;
  6354. }
  6355. }, {
  6356. id: "keyboard",
  6357. label: "Keyboard",
  6358. color: 8475055
  6359. }, {
  6360. id: "component-event",
  6361. label: "Component events",
  6362. color: 4307075,
  6363. screenshotOverlayRender: (event, {
  6364. events
  6365. }) => {
  6366. if (!event.meta.bounds || events.some((e2) => e2 !== event && e2.layerId === event.layerId && e2.renderMeta.drawn && (e2.meta.componentId === event.meta.componentId || e2.meta.bounds.left === event.meta.bounds.left && e2.meta.bounds.top === event.meta.bounds.top && e2.meta.bounds.width === event.meta.bounds.width && e2.meta.bounds.height === event.meta.bounds.height))) {
  6367. return false;
  6368. }
  6369. const div = document.createElement("div");
  6370. div.style.position = "absolute";
  6371. div.style.left = `${event.meta.bounds.left - 4}px`;
  6372. div.style.top = `${event.meta.bounds.top - 4}px`;
  6373. div.style.width = `${event.meta.bounds.width}px`;
  6374. div.style.height = `${event.meta.bounds.height}px`;
  6375. div.style.borderRadius = "8px";
  6376. div.style.borderStyle = "solid";
  6377. div.style.borderWidth = "4px";
  6378. div.style.borderColor = "rgba(65, 184, 131, 0.5)";
  6379. div.style.textAlign = "center";
  6380. div.style.display = "flex";
  6381. div.style.alignItems = "center";
  6382. div.style.justifyContent = "center";
  6383. div.style.overflow = "hidden";
  6384. const text = document.createElement("div");
  6385. text.style.color = "#267753";
  6386. text.style.fontFamily = "monospace";
  6387. text.style.fontSize = "9px";
  6388. text.style.padding = "1px";
  6389. text.style.backgroundColor = "rgba(255, 255, 255, 0.9)";
  6390. text.style.borderRadius = "3px";
  6391. text.innerText = event.data.event;
  6392. div.appendChild(text);
  6393. event.renderMeta.drawn = true;
  6394. return div;
  6395. }
  6396. }, {
  6397. id: "performance",
  6398. label: "Performance",
  6399. color: 4307050,
  6400. groupsOnly: true,
  6401. skipScreenshots: true,
  6402. ignoreNoDurationGroups: true
  6403. }];
  6404. }
  6405. ),
  6406. /***/
  6407. "../app-backend-core/lib/timeline-marker.js": (
  6408. /*!**************************************************!*\
  6409. !*** ../app-backend-core/lib/timeline-marker.js ***!
  6410. \**************************************************/
  6411. /***/
  6412. (__unused_webpack_module, exports, __webpack_require__2) => {
  6413. Object.defineProperty(exports, "__esModule", {
  6414. value: true
  6415. });
  6416. exports.sendTimelineMarkers = exports.addTimelineMarker = void 0;
  6417. const shared_utils_1 = __webpack_require__2(
  6418. /*! @vue-devtools/shared-utils */
  6419. "../shared-utils/lib/index.js"
  6420. );
  6421. const devtools_api_1 = __webpack_require__2(
  6422. /*! @vue/devtools-api */
  6423. "../api/lib/esm/index.js"
  6424. );
  6425. const timeline_1 = __webpack_require__2(
  6426. /*! ./timeline */
  6427. "../app-backend-core/lib/timeline.js"
  6428. );
  6429. async function addTimelineMarker(options, ctx) {
  6430. var _a;
  6431. if (!ctx.currentAppRecord) {
  6432. options.all = true;
  6433. }
  6434. const marker = {
  6435. ...options,
  6436. appRecord: options.all ? null : ctx.currentAppRecord
  6437. };
  6438. ctx.timelineMarkers.push(marker);
  6439. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_MARKER, {
  6440. marker: await serializeMarker(marker),
  6441. appId: (_a = ctx.currentAppRecord) === null || _a === void 0 ? void 0 : _a.id
  6442. });
  6443. }
  6444. exports.addTimelineMarker = addTimelineMarker;
  6445. async function sendTimelineMarkers(ctx) {
  6446. if (!ctx.currentAppRecord)
  6447. return;
  6448. const markers = ctx.timelineMarkers.filter((marker) => marker.all || marker.appRecord === ctx.currentAppRecord);
  6449. const result = [];
  6450. for (const marker of markers) {
  6451. result.push(await serializeMarker(marker));
  6452. }
  6453. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LOAD_MARKERS, {
  6454. markers: result,
  6455. appId: ctx.currentAppRecord.id
  6456. });
  6457. }
  6458. exports.sendTimelineMarkers = sendTimelineMarkers;
  6459. async function serializeMarker(marker) {
  6460. var _a;
  6461. let time = marker.time;
  6462. if ((0, devtools_api_1.isPerformanceSupported)() && time < timeline_1.dateThreshold) {
  6463. time += timeline_1.perfTimeDiff;
  6464. }
  6465. return {
  6466. id: marker.id,
  6467. appId: (_a = marker.appRecord) === null || _a === void 0 ? void 0 : _a.id,
  6468. all: marker.all,
  6469. time: Math.round(time * 1e3),
  6470. label: marker.label,
  6471. color: marker.color
  6472. };
  6473. }
  6474. }
  6475. ),
  6476. /***/
  6477. "../app-backend-core/lib/timeline-screenshot.js": (
  6478. /*!******************************************************!*\
  6479. !*** ../app-backend-core/lib/timeline-screenshot.js ***!
  6480. \******************************************************/
  6481. /***/
  6482. (__unused_webpack_module, exports, __webpack_require__2) => {
  6483. Object.defineProperty(exports, "__esModule", {
  6484. value: true
  6485. });
  6486. exports.showScreenshot = void 0;
  6487. const shared_utils_1 = __webpack_require__2(
  6488. /*! @vue-devtools/shared-utils */
  6489. "../shared-utils/lib/index.js"
  6490. );
  6491. const queue_1 = __webpack_require__2(
  6492. /*! ./util/queue */
  6493. "../app-backend-core/lib/util/queue.js"
  6494. );
  6495. const timeline_builtins_1 = __webpack_require__2(
  6496. /*! ./timeline-builtins */
  6497. "../app-backend-core/lib/timeline-builtins.js"
  6498. );
  6499. let overlay;
  6500. let image;
  6501. let container;
  6502. const jobQueue = new queue_1.JobQueue();
  6503. async function showScreenshot(screenshot, ctx) {
  6504. await jobQueue.queue("showScreenshot", async () => {
  6505. if (screenshot) {
  6506. if (!container) {
  6507. createElements();
  6508. }
  6509. image.src = screenshot.image;
  6510. image.style.visibility = screenshot.image ? "visible" : "hidden";
  6511. clearContent();
  6512. const events = screenshot.events.map((id) => ctx.timelineEventMap.get(id)).filter(Boolean).map((eventData) => ({
  6513. layer: timeline_builtins_1.builtinLayers.concat(ctx.timelineLayers).find((layer) => layer.id === eventData.layerId),
  6514. event: {
  6515. ...eventData.event,
  6516. layerId: eventData.layerId,
  6517. renderMeta: {}
  6518. }
  6519. }));
  6520. const renderContext = {
  6521. screenshot,
  6522. events: events.map(({
  6523. event
  6524. }) => event),
  6525. index: 0
  6526. };
  6527. for (let i2 = 0; i2 < events.length; i2++) {
  6528. const {
  6529. layer,
  6530. event
  6531. } = events[i2];
  6532. if (layer.screenshotOverlayRender) {
  6533. renderContext.index = i2;
  6534. try {
  6535. const result = await layer.screenshotOverlayRender(event, renderContext);
  6536. if (result !== false) {
  6537. if (typeof result === "string") {
  6538. container.innerHTML += result;
  6539. } else {
  6540. container.appendChild(result);
  6541. }
  6542. }
  6543. } catch (e2) {
  6544. if (shared_utils_1.SharedData.debugInfo) {
  6545. console.error(e2);
  6546. }
  6547. }
  6548. }
  6549. }
  6550. showElement();
  6551. } else {
  6552. hideElement();
  6553. }
  6554. });
  6555. }
  6556. exports.showScreenshot = showScreenshot;
  6557. function createElements() {
  6558. overlay = document.createElement("div");
  6559. overlay.style.position = "fixed";
  6560. overlay.style.zIndex = "9999999999999";
  6561. overlay.style.pointerEvents = "none";
  6562. overlay.style.left = "0";
  6563. overlay.style.top = "0";
  6564. overlay.style.width = "100vw";
  6565. overlay.style.height = "100vh";
  6566. overlay.style.backgroundColor = "rgba(0,0,0,0.5)";
  6567. overlay.style.overflow = "hidden";
  6568. const imageBox = document.createElement("div");
  6569. imageBox.style.position = "relative";
  6570. overlay.appendChild(imageBox);
  6571. image = document.createElement("img");
  6572. imageBox.appendChild(image);
  6573. container = document.createElement("div");
  6574. container.style.position = "absolute";
  6575. container.style.left = "0";
  6576. container.style.top = "0";
  6577. imageBox.appendChild(container);
  6578. const style = document.createElement("style");
  6579. style.innerHTML = ".__vuedevtools_no-scroll { overflow: hidden; }";
  6580. document.head.appendChild(style);
  6581. }
  6582. function showElement() {
  6583. if (!overlay.parentNode) {
  6584. document.body.appendChild(overlay);
  6585. document.body.classList.add("__vuedevtools_no-scroll");
  6586. }
  6587. }
  6588. function hideElement() {
  6589. if (overlay && overlay.parentNode) {
  6590. overlay.parentNode.removeChild(overlay);
  6591. document.body.classList.remove("__vuedevtools_no-scroll");
  6592. clearContent();
  6593. }
  6594. }
  6595. function clearContent() {
  6596. while (container.firstChild) {
  6597. container.removeChild(container.lastChild);
  6598. }
  6599. }
  6600. }
  6601. ),
  6602. /***/
  6603. "../app-backend-core/lib/timeline.js": (
  6604. /*!*******************************************!*\
  6605. !*** ../app-backend-core/lib/timeline.js ***!
  6606. \*******************************************/
  6607. /***/
  6608. (__unused_webpack_module, exports, __webpack_require__2) => {
  6609. Object.defineProperty(exports, "__esModule", {
  6610. value: true
  6611. });
  6612. exports.sendTimelineLayerEvents = exports.removeLayersForApp = exports.sendTimelineEventData = exports.clearTimeline = exports.perfTimeDiff = exports.dateThreshold = exports.addTimelineEvent = exports.sendTimelineLayers = exports.addBuiltinLayers = exports.setupTimeline = void 0;
  6613. const shared_utils_1 = __webpack_require__2(
  6614. /*! @vue-devtools/shared-utils */
  6615. "../shared-utils/lib/index.js"
  6616. );
  6617. const devtools_api_1 = __webpack_require__2(
  6618. /*! @vue/devtools-api */
  6619. "../api/lib/esm/index.js"
  6620. );
  6621. const global_hook_1 = __webpack_require__2(
  6622. /*! ./global-hook */
  6623. "../app-backend-core/lib/global-hook.js"
  6624. );
  6625. const app_1 = __webpack_require__2(
  6626. /*! ./app */
  6627. "../app-backend-core/lib/app.js"
  6628. );
  6629. const timeline_builtins_1 = __webpack_require__2(
  6630. /*! ./timeline-builtins */
  6631. "../app-backend-core/lib/timeline-builtins.js"
  6632. );
  6633. function setupTimeline(ctx) {
  6634. setupBuiltinLayers(ctx);
  6635. }
  6636. exports.setupTimeline = setupTimeline;
  6637. function addBuiltinLayers(appRecord, ctx) {
  6638. for (const layerDef of timeline_builtins_1.builtinLayers) {
  6639. ctx.timelineLayers.push({
  6640. ...layerDef,
  6641. appRecord,
  6642. plugin: null,
  6643. events: []
  6644. });
  6645. }
  6646. }
  6647. exports.addBuiltinLayers = addBuiltinLayers;
  6648. function setupBuiltinLayers(ctx) {
  6649. if (shared_utils_1.isBrowser) {
  6650. ["mousedown", "mouseup", "click", "dblclick"].forEach((eventType) => {
  6651. window.addEventListener(eventType, async (event) => {
  6652. await addTimelineEvent({
  6653. layerId: "mouse",
  6654. event: {
  6655. time: (0, devtools_api_1.now)(),
  6656. data: {
  6657. type: eventType,
  6658. x: event.clientX,
  6659. y: event.clientY
  6660. },
  6661. title: eventType
  6662. }
  6663. }, null, ctx);
  6664. }, {
  6665. capture: true,
  6666. passive: true
  6667. });
  6668. });
  6669. ["keyup", "keydown", "keypress"].forEach((eventType) => {
  6670. window.addEventListener(eventType, async (event) => {
  6671. await addTimelineEvent({
  6672. layerId: "keyboard",
  6673. event: {
  6674. time: (0, devtools_api_1.now)(),
  6675. data: {
  6676. type: eventType,
  6677. key: event.key,
  6678. ctrlKey: event.ctrlKey,
  6679. shiftKey: event.shiftKey,
  6680. altKey: event.altKey,
  6681. metaKey: event.metaKey
  6682. },
  6683. title: event.key
  6684. }
  6685. }, null, ctx);
  6686. }, {
  6687. capture: true,
  6688. passive: true
  6689. });
  6690. });
  6691. }
  6692. global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_EMIT, async (app, instance, event, params) => {
  6693. try {
  6694. if (!shared_utils_1.SharedData.componentEventsEnabled)
  6695. return;
  6696. const appRecord = await (0, app_1.getAppRecord)(app, ctx);
  6697. const componentId = `${appRecord.id}:${instance.uid}`;
  6698. const componentDisplay = await appRecord.backend.api.getComponentName(instance) || "<i>Unknown Component</i>";
  6699. await addTimelineEvent({
  6700. layerId: "component-event",
  6701. event: {
  6702. time: (0, devtools_api_1.now)(),
  6703. data: {
  6704. component: {
  6705. _custom: {
  6706. type: "component-definition",
  6707. display: componentDisplay
  6708. }
  6709. },
  6710. event,
  6711. params
  6712. },
  6713. title: event,
  6714. subtitle: `by ${componentDisplay}`,
  6715. meta: {
  6716. componentId,
  6717. bounds: await appRecord.backend.api.getComponentBounds(instance)
  6718. }
  6719. }
  6720. }, app, ctx);
  6721. } catch (e2) {
  6722. if (shared_utils_1.SharedData.debugInfo) {
  6723. console.error(e2);
  6724. }
  6725. }
  6726. });
  6727. }
  6728. async function sendTimelineLayers(ctx) {
  6729. var _a, _b;
  6730. const layers = [];
  6731. for (const layer of ctx.timelineLayers) {
  6732. try {
  6733. layers.push({
  6734. id: layer.id,
  6735. label: layer.label,
  6736. color: layer.color,
  6737. appId: (_a = layer.appRecord) === null || _a === void 0 ? void 0 : _a.id,
  6738. pluginId: (_b = layer.plugin) === null || _b === void 0 ? void 0 : _b.descriptor.id,
  6739. groupsOnly: layer.groupsOnly,
  6740. skipScreenshots: layer.skipScreenshots,
  6741. ignoreNoDurationGroups: layer.ignoreNoDurationGroups
  6742. });
  6743. } catch (e2) {
  6744. if (shared_utils_1.SharedData.debugInfo) {
  6745. console.error(e2);
  6746. }
  6747. }
  6748. }
  6749. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_LIST, {
  6750. layers
  6751. });
  6752. }
  6753. exports.sendTimelineLayers = sendTimelineLayers;
  6754. async function addTimelineEvent(options, app, ctx) {
  6755. const appId = app ? (0, app_1.getAppRecordId)(app) : null;
  6756. const isAllApps = options.all || !app || appId == null;
  6757. const id = ctx.nextTimelineEventId++;
  6758. const eventData = {
  6759. id,
  6760. ...options,
  6761. all: isAllApps
  6762. };
  6763. ctx.timelineEventMap.set(eventData.id, eventData);
  6764. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_EVENT, {
  6765. appId: eventData.all ? "all" : appId,
  6766. layerId: eventData.layerId,
  6767. event: mapTimelineEvent(eventData)
  6768. });
  6769. const layer = ctx.timelineLayers.find((l2) => {
  6770. var _a;
  6771. return (isAllApps || ((_a = l2.appRecord) === null || _a === void 0 ? void 0 : _a.options.app) === app) && l2.id === options.layerId;
  6772. });
  6773. if (layer) {
  6774. layer.events.push(eventData);
  6775. } else if (shared_utils_1.SharedData.debugInfo) {
  6776. console.warn(`Timeline layer ${options.layerId} not found`);
  6777. }
  6778. }
  6779. exports.addTimelineEvent = addTimelineEvent;
  6780. const initialTime = Date.now();
  6781. exports.dateThreshold = initialTime - 1e6;
  6782. exports.perfTimeDiff = initialTime - (0, devtools_api_1.now)();
  6783. function mapTimelineEvent(eventData) {
  6784. let time = eventData.event.time;
  6785. if ((0, devtools_api_1.isPerformanceSupported)() && time < exports.dateThreshold) {
  6786. time += exports.perfTimeDiff;
  6787. }
  6788. return {
  6789. id: eventData.id,
  6790. time: Math.round(time * 1e3),
  6791. logType: eventData.event.logType,
  6792. groupId: eventData.event.groupId,
  6793. title: eventData.event.title,
  6794. subtitle: eventData.event.subtitle
  6795. };
  6796. }
  6797. async function clearTimeline(ctx) {
  6798. ctx.timelineEventMap.clear();
  6799. for (const layer of ctx.timelineLayers) {
  6800. layer.events = [];
  6801. }
  6802. for (const backend of ctx.backends) {
  6803. await backend.api.clearTimeline();
  6804. }
  6805. }
  6806. exports.clearTimeline = clearTimeline;
  6807. async function sendTimelineEventData(id, ctx) {
  6808. let data = null;
  6809. const eventData = ctx.timelineEventMap.get(id);
  6810. if (eventData) {
  6811. data = await ctx.currentAppRecord.backend.api.inspectTimelineEvent(eventData, ctx.currentAppRecord.options.app);
  6812. data = (0, shared_utils_1.stringify)(data);
  6813. } else if (shared_utils_1.SharedData.debugInfo) {
  6814. console.warn(`Event ${id} not found`, ctx.timelineEventMap.keys());
  6815. }
  6816. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_EVENT_DATA, {
  6817. eventId: id,
  6818. data
  6819. });
  6820. }
  6821. exports.sendTimelineEventData = sendTimelineEventData;
  6822. function removeLayersForApp(app, ctx) {
  6823. const layers = ctx.timelineLayers.filter((l2) => {
  6824. var _a;
  6825. return ((_a = l2.appRecord) === null || _a === void 0 ? void 0 : _a.options.app) === app;
  6826. });
  6827. for (const layer of layers) {
  6828. const index = ctx.timelineLayers.indexOf(layer);
  6829. if (index !== -1)
  6830. ctx.timelineLayers.splice(index, 1);
  6831. for (const e2 of layer.events) {
  6832. ctx.timelineEventMap.delete(e2.id);
  6833. }
  6834. }
  6835. }
  6836. exports.removeLayersForApp = removeLayersForApp;
  6837. function sendTimelineLayerEvents(appId, layerId, ctx) {
  6838. var _a;
  6839. const app = (_a = ctx.appRecords.find((ar) => ar.id === appId)) === null || _a === void 0 ? void 0 : _a.options.app;
  6840. if (!app)
  6841. return;
  6842. const layer = ctx.timelineLayers.find((l2) => {
  6843. var _a2;
  6844. return ((_a2 = l2.appRecord) === null || _a2 === void 0 ? void 0 : _a2.options.app) === app && l2.id === layerId;
  6845. });
  6846. if (!layer)
  6847. return;
  6848. ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS, {
  6849. appId,
  6850. layerId,
  6851. events: layer.events.map((e2) => mapTimelineEvent(e2))
  6852. });
  6853. }
  6854. exports.sendTimelineLayerEvents = sendTimelineLayerEvents;
  6855. }
  6856. ),
  6857. /***/
  6858. "../app-backend-core/lib/util/queue.js": (
  6859. /*!*********************************************!*\
  6860. !*** ../app-backend-core/lib/util/queue.js ***!
  6861. \*********************************************/
  6862. /***/
  6863. (__unused_webpack_module, exports) => {
  6864. Object.defineProperty(exports, "__esModule", {
  6865. value: true
  6866. });
  6867. exports.JobQueue = void 0;
  6868. class JobQueue {
  6869. constructor() {
  6870. this.jobs = [];
  6871. }
  6872. queue(id, fn) {
  6873. const job = {
  6874. id,
  6875. fn
  6876. };
  6877. return new Promise((resolve) => {
  6878. const onDone = () => {
  6879. this.currentJob = null;
  6880. const nextJob = this.jobs.shift();
  6881. if (nextJob) {
  6882. nextJob.fn();
  6883. }
  6884. resolve();
  6885. };
  6886. const run = () => {
  6887. this.currentJob = job;
  6888. return job.fn().then(onDone).catch((e2) => {
  6889. console.error(`Job ${job.id} failed:`);
  6890. console.error(e2);
  6891. });
  6892. };
  6893. if (this.currentJob) {
  6894. this.jobs.push({
  6895. id: job.id,
  6896. fn: () => run()
  6897. });
  6898. } else {
  6899. run();
  6900. }
  6901. });
  6902. }
  6903. }
  6904. exports.JobQueue = JobQueue;
  6905. }
  6906. ),
  6907. /***/
  6908. "../app-backend-core/lib/util/subscriptions.js": (
  6909. /*!*****************************************************!*\
  6910. !*** ../app-backend-core/lib/util/subscriptions.js ***!
  6911. \*****************************************************/
  6912. /***/
  6913. (__unused_webpack_module, exports) => {
  6914. Object.defineProperty(exports, "__esModule", {
  6915. value: true
  6916. });
  6917. exports.isSubscribed = exports.unsubscribe = exports.subscribe = void 0;
  6918. const activeSubs = /* @__PURE__ */ new Map();
  6919. function getSubs(type) {
  6920. let subs = activeSubs.get(type);
  6921. if (!subs) {
  6922. subs = [];
  6923. activeSubs.set(type, subs);
  6924. }
  6925. return subs;
  6926. }
  6927. function subscribe(type, payload) {
  6928. const rawPayload = getRawPayload(payload);
  6929. getSubs(type).push({
  6930. payload,
  6931. rawPayload
  6932. });
  6933. }
  6934. exports.subscribe = subscribe;
  6935. function unsubscribe(type, payload) {
  6936. const rawPayload = getRawPayload(payload);
  6937. const subs = getSubs(type);
  6938. let index;
  6939. while ((index = subs.findIndex((sub) => sub.rawPayload === rawPayload)) !== -1) {
  6940. subs.splice(index, 1);
  6941. }
  6942. }
  6943. exports.unsubscribe = unsubscribe;
  6944. function getRawPayload(payload) {
  6945. const data = Object.keys(payload).sort().reduce((acc, key) => {
  6946. acc[key] = payload[key];
  6947. return acc;
  6948. }, {});
  6949. return JSON.stringify(data);
  6950. }
  6951. function isSubscribed(type, predicate = () => true) {
  6952. return getSubs(type).some(predicate);
  6953. }
  6954. exports.isSubscribed = isSubscribed;
  6955. }
  6956. ),
  6957. /***/
  6958. "../app-backend-vue3/lib/components/data.js": (
  6959. /*!**************************************************!*\
  6960. !*** ../app-backend-vue3/lib/components/data.js ***!
  6961. \**************************************************/
  6962. /***/
  6963. (__unused_webpack_module, exports, __webpack_require__2) => {
  6964. Object.defineProperty(exports, "__esModule", {
  6965. value: true
  6966. });
  6967. exports.getCustomInstanceDetails = exports.editState = exports.getCustomObjectDetails = exports.getInstanceDetails = void 0;
  6968. const util_1 = __webpack_require__2(
  6969. /*! ./util */
  6970. "../app-backend-vue3/lib/components/util.js"
  6971. );
  6972. const shared_utils_1 = __webpack_require__2(
  6973. /*! @vue-devtools/shared-utils */
  6974. "../shared-utils/lib/index.js"
  6975. );
  6976. const util_2 = __webpack_require__2(
  6977. /*! ../util */
  6978. "../app-backend-vue3/lib/util.js"
  6979. );
  6980. 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"];
  6981. function getInstanceDetails(instance, ctx) {
  6982. var _a;
  6983. return {
  6984. id: (0, util_1.getUniqueComponentId)(instance, ctx),
  6985. name: (0, util_1.getInstanceName)(instance),
  6986. file: (_a = instance.type) === null || _a === void 0 ? void 0 : _a.__file,
  6987. state: getInstanceState(instance)
  6988. };
  6989. }
  6990. exports.getInstanceDetails = getInstanceDetails;
  6991. function getInstanceState(instance) {
  6992. const mergedType = resolveMergedOptions(instance);
  6993. return processProps(instance).concat(processState(instance), processSetupState(instance), processComputed(instance, mergedType), processAttrs(instance), processProvide(instance), processInject(instance, mergedType), processRefs(instance));
  6994. }
  6995. function processProps(instance) {
  6996. const propsData = [];
  6997. const propDefinitions = instance.type.props;
  6998. for (let key in instance.props) {
  6999. const propDefinition = propDefinitions ? propDefinitions[key] : null;
  7000. key = (0, shared_utils_1.camelize)(key);
  7001. propsData.push({
  7002. type: "props",
  7003. key,
  7004. value: (0, util_2.returnError)(() => instance.props[key]),
  7005. meta: propDefinition ? {
  7006. type: propDefinition.type ? getPropType(propDefinition.type) : "any",
  7007. required: !!propDefinition.required,
  7008. ...propDefinition.default != null ? {
  7009. default: propDefinition.default.toString()
  7010. } : {}
  7011. } : {
  7012. type: "invalid"
  7013. },
  7014. editable: shared_utils_1.SharedData.editableProps
  7015. });
  7016. }
  7017. return propsData;
  7018. }
  7019. const fnTypeRE = /^(?:function|class) (\w+)/;
  7020. function getPropType(type) {
  7021. if (Array.isArray(type)) {
  7022. return type.map((t2) => getPropType(t2)).join(" or ");
  7023. }
  7024. if (type == null) {
  7025. return "null";
  7026. }
  7027. const match = type.toString().match(fnTypeRE);
  7028. return typeof type === "function" ? match && match[1] || "any" : "any";
  7029. }
  7030. function processState(instance) {
  7031. const type = instance.type;
  7032. const props = type.props;
  7033. const getters = type.vuex && type.vuex.getters;
  7034. const computedDefs = type.computed;
  7035. const data = {
  7036. ...instance.data,
  7037. ...instance.renderContext
  7038. };
  7039. return Object.keys(data).filter((key) => !(props && key in props) && !(getters && key in getters) && !(computedDefs && key in computedDefs)).map((key) => ({
  7040. key,
  7041. type: "data",
  7042. value: (0, util_2.returnError)(() => data[key]),
  7043. editable: true
  7044. }));
  7045. }
  7046. function processSetupState(instance) {
  7047. const raw = instance.devtoolsRawSetupState || {};
  7048. return Object.keys(instance.setupState).filter((key) => !vueBuiltins.includes(key) && !key.startsWith("use")).map((key) => {
  7049. var _a, _b, _c, _d;
  7050. const value = (0, util_2.returnError)(() => toRaw(instance.setupState[key]));
  7051. const rawData2 = raw[key];
  7052. let result;
  7053. 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";
  7054. if (rawData2) {
  7055. const info = getSetupStateInfo(rawData2);
  7056. const objectType = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
  7057. const isState = info.ref || info.computed || info.reactive;
  7058. const raw2 = ((_b = (_a = rawData2.effect) === null || _a === void 0 ? void 0 : _a.raw) === null || _b === void 0 ? void 0 : _b.toString()) || ((_d = (_c = rawData2.effect) === null || _c === void 0 ? void 0 : _c.fn) === null || _d === void 0 ? void 0 : _d.toString());
  7059. if (objectType) {
  7060. isOther = false;
  7061. }
  7062. result = {
  7063. ...objectType ? {
  7064. objectType
  7065. } : {},
  7066. ...raw2 ? {
  7067. raw: raw2
  7068. } : {},
  7069. editable: isState && !info.readonly
  7070. };
  7071. }
  7072. const type = isOther ? "setup (other)" : "setup";
  7073. return {
  7074. key,
  7075. value,
  7076. type,
  7077. ...result
  7078. };
  7079. });
  7080. }
  7081. function isRef(raw) {
  7082. return !!raw.__v_isRef;
  7083. }
  7084. function isComputed(raw) {
  7085. return isRef(raw) && !!raw.effect;
  7086. }
  7087. function isReactive(raw) {
  7088. return !!raw.__v_isReactive;
  7089. }
  7090. function isReadOnly(raw) {
  7091. return !!raw.__v_isReadonly;
  7092. }
  7093. function toRaw(value) {
  7094. if (value === null || value === void 0 ? void 0 : value.__v_raw) {
  7095. return value.__v_raw;
  7096. }
  7097. return value;
  7098. }
  7099. function getSetupStateInfo(raw) {
  7100. return {
  7101. ref: isRef(raw),
  7102. computed: isComputed(raw),
  7103. reactive: isReactive(raw),
  7104. readonly: isReadOnly(raw)
  7105. };
  7106. }
  7107. function getCustomObjectDetails(object, proto) {
  7108. var _a, _b, _c, _d;
  7109. const info = getSetupStateInfo(object);
  7110. const isState = info.ref || info.computed || info.reactive;
  7111. if (isState) {
  7112. const objectType = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
  7113. const value = toRaw(info.reactive ? object : object._value);
  7114. 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());
  7115. return {
  7116. _custom: {
  7117. type: objectType.toLowerCase(),
  7118. objectType,
  7119. value,
  7120. ...raw ? {
  7121. tooltip: `<span class="font-mono">${raw}</span>`
  7122. } : {}
  7123. }
  7124. };
  7125. }
  7126. if (typeof object.__asyncLoader === "function") {
  7127. return {
  7128. _custom: {
  7129. type: "component-definition",
  7130. display: "Async component definition"
  7131. }
  7132. };
  7133. }
  7134. }
  7135. exports.getCustomObjectDetails = getCustomObjectDetails;
  7136. function processComputed(instance, mergedType) {
  7137. const type = mergedType;
  7138. const computed = [];
  7139. const defs = type.computed || {};
  7140. for (const key in defs) {
  7141. const def = defs[key];
  7142. const type2 = typeof def === "function" && def.vuex ? "vuex bindings" : "computed";
  7143. computed.push({
  7144. type: type2,
  7145. key,
  7146. value: (0, util_2.returnError)(() => instance.proxy[key]),
  7147. editable: typeof def.set === "function"
  7148. });
  7149. }
  7150. return computed;
  7151. }
  7152. function processAttrs(instance) {
  7153. return Object.keys(instance.attrs).map((key) => ({
  7154. type: "attrs",
  7155. key,
  7156. value: (0, util_2.returnError)(() => instance.attrs[key])
  7157. }));
  7158. }
  7159. function processProvide(instance) {
  7160. return Reflect.ownKeys(instance.provides).map((key) => ({
  7161. type: "provided",
  7162. key: key.toString(),
  7163. value: (0, util_2.returnError)(() => instance.provides[key])
  7164. }));
  7165. }
  7166. function processInject(instance, mergedType) {
  7167. if (!(mergedType === null || mergedType === void 0 ? void 0 : mergedType.inject))
  7168. return [];
  7169. let keys = [];
  7170. let defaultValue;
  7171. if (Array.isArray(mergedType.inject)) {
  7172. keys = mergedType.inject.map((key) => ({
  7173. key,
  7174. originalKey: key
  7175. }));
  7176. } else {
  7177. keys = Reflect.ownKeys(mergedType.inject).map((key) => {
  7178. const value = mergedType.inject[key];
  7179. let originalKey;
  7180. if (typeof value === "string" || typeof value === "symbol") {
  7181. originalKey = value;
  7182. } else {
  7183. originalKey = value.from;
  7184. defaultValue = value.default;
  7185. }
  7186. return {
  7187. key,
  7188. originalKey
  7189. };
  7190. });
  7191. }
  7192. return keys.map(({
  7193. key,
  7194. originalKey
  7195. }) => ({
  7196. type: "injected",
  7197. key: originalKey && key !== originalKey ? `${originalKey.toString()} ➞ ${key.toString()}` : key.toString(),
  7198. value: (0, util_2.returnError)(() => instance.ctx[key] || instance.provides[originalKey] || defaultValue)
  7199. }));
  7200. }
  7201. function processRefs(instance) {
  7202. return Object.keys(instance.refs).map((key) => ({
  7203. type: "refs",
  7204. key,
  7205. value: (0, util_2.returnError)(() => instance.refs[key])
  7206. }));
  7207. }
  7208. function editState({
  7209. componentInstance,
  7210. path,
  7211. state,
  7212. type
  7213. }, stateEditor, ctx) {
  7214. if (!["data", "props", "computed", "setup"].includes(type))
  7215. return;
  7216. let target;
  7217. const targetPath = path.slice();
  7218. if (Object.keys(componentInstance.props).includes(path[0])) {
  7219. target = componentInstance.props;
  7220. } else if (componentInstance.devtoolsRawSetupState && Object.keys(componentInstance.devtoolsRawSetupState).includes(path[0])) {
  7221. target = componentInstance.devtoolsRawSetupState;
  7222. const currentValue = stateEditor.get(componentInstance.devtoolsRawSetupState, path);
  7223. if (currentValue != null) {
  7224. const info = getSetupStateInfo(currentValue);
  7225. if (info.readonly)
  7226. return;
  7227. }
  7228. } else {
  7229. target = componentInstance.proxy;
  7230. }
  7231. if (target && targetPath) {
  7232. stateEditor.set(target, targetPath, "value" in state ? state.value : void 0, stateEditor.createDefaultSetCallback(state));
  7233. }
  7234. }
  7235. exports.editState = editState;
  7236. function reduceStateList(list) {
  7237. if (!list.length) {
  7238. return void 0;
  7239. }
  7240. return list.reduce((map, item) => {
  7241. const key = item.type || "data";
  7242. const obj = map[key] = map[key] || {};
  7243. obj[item.key] = item.value;
  7244. return map;
  7245. }, {});
  7246. }
  7247. function getCustomInstanceDetails(instance) {
  7248. if (instance._)
  7249. instance = instance._;
  7250. const state = getInstanceState(instance);
  7251. return {
  7252. _custom: {
  7253. type: "component",
  7254. id: instance.__VUE_DEVTOOLS_UID__,
  7255. display: (0, util_1.getInstanceName)(instance),
  7256. tooltip: "Component instance",
  7257. value: reduceStateList(state),
  7258. fields: {
  7259. abstract: true
  7260. }
  7261. }
  7262. };
  7263. }
  7264. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  7265. function resolveMergedOptions(instance) {
  7266. const raw = instance.type;
  7267. const {
  7268. mixins,
  7269. extends: extendsOptions
  7270. } = raw;
  7271. const globalMixins = instance.appContext.mixins;
  7272. if (!globalMixins.length && !mixins && !extendsOptions)
  7273. return raw;
  7274. const options = {};
  7275. globalMixins.forEach((m2) => mergeOptions(options, m2));
  7276. mergeOptions(options, raw);
  7277. return options;
  7278. }
  7279. function mergeOptions(to, from, instance) {
  7280. if (typeof from === "function") {
  7281. from = from.options;
  7282. }
  7283. if (!from)
  7284. return to;
  7285. const {
  7286. mixins,
  7287. extends: extendsOptions
  7288. } = from;
  7289. extendsOptions && mergeOptions(to, extendsOptions);
  7290. mixins && mixins.forEach((m2) => mergeOptions(to, m2));
  7291. for (const key of ["computed", "inject"]) {
  7292. if (Object.prototype.hasOwnProperty.call(from, key)) {
  7293. if (!to[key]) {
  7294. to[key] = from[key];
  7295. } else {
  7296. Object.assign(to[key], from[key]);
  7297. }
  7298. }
  7299. }
  7300. return to;
  7301. }
  7302. }
  7303. ),
  7304. /***/
  7305. "../app-backend-vue3/lib/components/el.js": (
  7306. /*!************************************************!*\
  7307. !*** ../app-backend-vue3/lib/components/el.js ***!
  7308. \************************************************/
  7309. /***/
  7310. (__unused_webpack_module, exports, __webpack_require__2) => {
  7311. Object.defineProperty(exports, "__esModule", {
  7312. value: true
  7313. });
  7314. exports.getInstanceOrVnodeRect = exports.getRootElementsFromComponentInstance = exports.getComponentInstanceFromElement = void 0;
  7315. const shared_utils_1 = __webpack_require__2(
  7316. /*! @vue-devtools/shared-utils */
  7317. "../shared-utils/lib/index.js"
  7318. );
  7319. const util_1 = __webpack_require__2(
  7320. /*! ./util */
  7321. "../app-backend-vue3/lib/components/util.js"
  7322. );
  7323. function getComponentInstanceFromElement(element) {
  7324. return element.__vueParentComponent;
  7325. }
  7326. exports.getComponentInstanceFromElement = getComponentInstanceFromElement;
  7327. function getRootElementsFromComponentInstance(instance) {
  7328. if ((0, util_1.isFragment)(instance)) {
  7329. return getFragmentRootElements(instance.subTree);
  7330. }
  7331. if (!instance.subTree)
  7332. return [];
  7333. return [instance.subTree.el];
  7334. }
  7335. exports.getRootElementsFromComponentInstance = getRootElementsFromComponentInstance;
  7336. function getFragmentRootElements(vnode) {
  7337. if (!vnode.children)
  7338. return [];
  7339. const list = [];
  7340. for (let i2 = 0, l2 = vnode.children.length; i2 < l2; i2++) {
  7341. const childVnode = vnode.children[i2];
  7342. if (childVnode.component) {
  7343. list.push(...getRootElementsFromComponentInstance(childVnode.component));
  7344. } else if (childVnode.el) {
  7345. list.push(childVnode.el);
  7346. }
  7347. }
  7348. return list;
  7349. }
  7350. function getInstanceOrVnodeRect(instance) {
  7351. const el = instance.subTree.el;
  7352. if (!shared_utils_1.isBrowser) {
  7353. return;
  7354. }
  7355. if (!(0, shared_utils_1.inDoc)(el)) {
  7356. return;
  7357. }
  7358. if ((0, util_1.isFragment)(instance)) {
  7359. return addIframePosition(getFragmentRect(instance.subTree), getElWindow(el));
  7360. } else if (el.nodeType === 1) {
  7361. return addIframePosition(el.getBoundingClientRect(), getElWindow(el));
  7362. } else if (instance.subTree.component) {
  7363. return getInstanceOrVnodeRect(instance.subTree.component);
  7364. }
  7365. }
  7366. exports.getInstanceOrVnodeRect = getInstanceOrVnodeRect;
  7367. function createRect() {
  7368. const rect = {
  7369. top: 0,
  7370. bottom: 0,
  7371. left: 0,
  7372. right: 0,
  7373. get width() {
  7374. return rect.right - rect.left;
  7375. },
  7376. get height() {
  7377. return rect.bottom - rect.top;
  7378. }
  7379. };
  7380. return rect;
  7381. }
  7382. function mergeRects(a2, b2) {
  7383. if (!a2.top || b2.top < a2.top) {
  7384. a2.top = b2.top;
  7385. }
  7386. if (!a2.bottom || b2.bottom > a2.bottom) {
  7387. a2.bottom = b2.bottom;
  7388. }
  7389. if (!a2.left || b2.left < a2.left) {
  7390. a2.left = b2.left;
  7391. }
  7392. if (!a2.right || b2.right > a2.right) {
  7393. a2.right = b2.right;
  7394. }
  7395. return a2;
  7396. }
  7397. let range;
  7398. function getTextRect(node) {
  7399. if (!shared_utils_1.isBrowser)
  7400. return;
  7401. if (!range)
  7402. range = document.createRange();
  7403. range.selectNode(node);
  7404. return range.getBoundingClientRect();
  7405. }
  7406. function getFragmentRect(vnode) {
  7407. const rect = createRect();
  7408. if (!vnode.children)
  7409. return rect;
  7410. for (let i2 = 0, l2 = vnode.children.length; i2 < l2; i2++) {
  7411. const childVnode = vnode.children[i2];
  7412. let childRect;
  7413. if (childVnode.component) {
  7414. childRect = getInstanceOrVnodeRect(childVnode.component);
  7415. } else if (childVnode.el) {
  7416. const el = childVnode.el;
  7417. if (el.nodeType === 1 || el.getBoundingClientRect) {
  7418. childRect = el.getBoundingClientRect();
  7419. } else if (el.nodeType === 3 && el.data.trim()) {
  7420. childRect = getTextRect(el);
  7421. }
  7422. }
  7423. if (childRect) {
  7424. mergeRects(rect, childRect);
  7425. }
  7426. }
  7427. return rect;
  7428. }
  7429. function getElWindow(el) {
  7430. return el.ownerDocument.defaultView;
  7431. }
  7432. function addIframePosition(bounds, win) {
  7433. if (win.__VUE_DEVTOOLS_IFRAME__) {
  7434. const rect = mergeRects(createRect(), bounds);
  7435. const iframeBounds = win.__VUE_DEVTOOLS_IFRAME__.getBoundingClientRect();
  7436. rect.top += iframeBounds.top;
  7437. rect.bottom += iframeBounds.top;
  7438. rect.left += iframeBounds.left;
  7439. rect.right += iframeBounds.left;
  7440. if (win.parent) {
  7441. return addIframePosition(rect, win.parent);
  7442. }
  7443. return rect;
  7444. }
  7445. return bounds;
  7446. }
  7447. }
  7448. ),
  7449. /***/
  7450. "../app-backend-vue3/lib/components/filter.js": (
  7451. /*!****************************************************!*\
  7452. !*** ../app-backend-vue3/lib/components/filter.js ***!
  7453. \****************************************************/
  7454. /***/
  7455. (__unused_webpack_module, exports, __webpack_require__2) => {
  7456. Object.defineProperty(exports, "__esModule", {
  7457. value: true
  7458. });
  7459. exports.ComponentFilter = void 0;
  7460. const shared_utils_1 = __webpack_require__2(
  7461. /*! @vue-devtools/shared-utils */
  7462. "../shared-utils/lib/index.js"
  7463. );
  7464. const util_1 = __webpack_require__2(
  7465. /*! ./util */
  7466. "../app-backend-vue3/lib/components/util.js"
  7467. );
  7468. class ComponentFilter {
  7469. constructor(filter) {
  7470. this.filter = filter || "";
  7471. }
  7472. /**
  7473. * Check if an instance is qualified.
  7474. *
  7475. * @param {Vue|Vnode} instance
  7476. * @return {Boolean}
  7477. */
  7478. isQualified(instance) {
  7479. const name = (0, util_1.getInstanceName)(instance);
  7480. return (0, shared_utils_1.classify)(name).toLowerCase().indexOf(this.filter) > -1 || (0, shared_utils_1.kebabize)(name).toLowerCase().indexOf(this.filter) > -1;
  7481. }
  7482. }
  7483. exports.ComponentFilter = ComponentFilter;
  7484. }
  7485. ),
  7486. /***/
  7487. "../app-backend-vue3/lib/components/tree.js": (
  7488. /*!**************************************************!*\
  7489. !*** ../app-backend-vue3/lib/components/tree.js ***!
  7490. \**************************************************/
  7491. /***/
  7492. (__unused_webpack_module, exports, __webpack_require__2) => {
  7493. Object.defineProperty(exports, "__esModule", {
  7494. value: true
  7495. });
  7496. exports.ComponentWalker = void 0;
  7497. const util_1 = __webpack_require__2(
  7498. /*! ./util */
  7499. "../app-backend-vue3/lib/components/util.js"
  7500. );
  7501. const filter_1 = __webpack_require__2(
  7502. /*! ./filter */
  7503. "../app-backend-vue3/lib/components/filter.js"
  7504. );
  7505. const el_1 = __webpack_require__2(
  7506. /*! ./el */
  7507. "../app-backend-vue3/lib/components/el.js"
  7508. );
  7509. class ComponentWalker {
  7510. constructor(maxDepth, filter, recursively, api, ctx) {
  7511. this.ctx = ctx;
  7512. this.api = api;
  7513. this.maxDepth = maxDepth;
  7514. this.recursively = recursively;
  7515. this.componentFilter = new filter_1.ComponentFilter(filter);
  7516. this.uniAppPageNames = ["Page", "KeepAlive", "AsyncComponentWrapper", "BaseTransition", "Transition"];
  7517. }
  7518. getComponentTree(instance) {
  7519. this.captureIds = /* @__PURE__ */ new Map();
  7520. return this.findQualifiedChildren(instance, 0);
  7521. }
  7522. getComponentParents(instance) {
  7523. this.captureIds = /* @__PURE__ */ new Map();
  7524. const parents = [];
  7525. this.captureId(instance);
  7526. let parent = instance;
  7527. {
  7528. while (parent = parent.parent) {
  7529. this.captureId(parent);
  7530. parents.push(parent);
  7531. }
  7532. }
  7533. return parents;
  7534. }
  7535. /**
  7536. * Find qualified children from a single instance.
  7537. * If the instance itself is qualified, just return itself.
  7538. * This is ok because [].concat works in both cases.
  7539. *
  7540. * @param {Vue|Vnode} instance
  7541. * @return {Vue|Array}
  7542. */
  7543. async findQualifiedChildren(instance, depth) {
  7544. var _a;
  7545. if (this.componentFilter.isQualified(instance) && !((_a = instance.type.devtools) === null || _a === void 0 ? void 0 : _a.hide)) {
  7546. return [await this.capture(instance, null, depth)];
  7547. } else if (instance.subTree) {
  7548. const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildrenByInstance(instance);
  7549. return this.findQualifiedChildrenFromList(list, depth);
  7550. } else {
  7551. return [];
  7552. }
  7553. }
  7554. /**
  7555. * Iterate through an array of instances and flatten it into
  7556. * an array of qualified instances. This is a depth-first
  7557. * traversal - e.g. if an instance is not matched, we will
  7558. * recursively go deeper until a qualified child is found.
  7559. *
  7560. * @param {Array} instances
  7561. * @return {Array}
  7562. */
  7563. async findQualifiedChildrenFromList(instances, depth) {
  7564. instances = instances.filter((child) => {
  7565. var _a;
  7566. return !(0, util_1.isBeingDestroyed)(child) && !((_a = child.type.devtools) === null || _a === void 0 ? void 0 : _a.hide);
  7567. });
  7568. if (!this.componentFilter.filter) {
  7569. return Promise.all(instances.map((child, index, list) => this.capture(child, list, depth)));
  7570. } else {
  7571. return Array.prototype.concat.apply([], await Promise.all(instances.map((i2) => this.findQualifiedChildren(i2, depth))));
  7572. }
  7573. }
  7574. /**
  7575. * fixed by xxxxxx
  7576. * @param instance
  7577. * @param suspense
  7578. * @returns
  7579. */
  7580. getInternalInstanceChildrenByInstance(instance, suspense = null) {
  7581. if (instance.ctx.$children) {
  7582. return instance.ctx.$children.map((proxy) => proxy.$);
  7583. }
  7584. return this.getInternalInstanceChildren(instance.subTree, suspense);
  7585. }
  7586. /**
  7587. * Get children from a component instance.
  7588. */
  7589. getInternalInstanceChildren(subTree, suspense = null) {
  7590. const list = [];
  7591. if (subTree) {
  7592. if (subTree.component) {
  7593. this.getInstanceChildrenBySubTreeComponent(list, subTree, suspense);
  7594. } else if (subTree.suspense) {
  7595. const suspenseKey = !subTree.suspense.isInFallback ? "suspense default" : "suspense fallback";
  7596. list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, {
  7597. ...subTree.suspense,
  7598. suspenseKey
  7599. }));
  7600. } else if (Array.isArray(subTree.children)) {
  7601. subTree.children.forEach((childSubTree) => {
  7602. if (childSubTree.component) {
  7603. this.getInstanceChildrenBySubTreeComponent(list, childSubTree, suspense);
  7604. } else {
  7605. list.push(...this.getInternalInstanceChildren(childSubTree, suspense));
  7606. }
  7607. });
  7608. }
  7609. }
  7610. return list.filter((child) => {
  7611. var _a;
  7612. return !(0, util_1.isBeingDestroyed)(child) && !((_a = child.type.devtools) === null || _a === void 0 ? void 0 : _a.hide);
  7613. });
  7614. }
  7615. /**
  7616. * getInternalInstanceChildren by subTree component for uni-app defineSystemComponent
  7617. */
  7618. getInstanceChildrenBySubTreeComponent(list, subTree, suspense) {
  7619. if (subTree.type.__reserved || this.uniAppPageNames.includes(subTree.type.name)) {
  7620. list.push(...this.getInternalInstanceChildren(subTree.component.subTree));
  7621. } else {
  7622. !suspense ? list.push(subTree.component) : list.push({
  7623. ...subTree.component,
  7624. suspense
  7625. });
  7626. }
  7627. }
  7628. captureId(instance) {
  7629. if (!instance)
  7630. return null;
  7631. const id = instance.__VUE_DEVTOOLS_UID__ != null ? instance.__VUE_DEVTOOLS_UID__ : (0, util_1.getUniqueComponentId)(instance, this.ctx);
  7632. instance.__VUE_DEVTOOLS_UID__ = id;
  7633. if (this.captureIds.has(id)) {
  7634. return;
  7635. } else {
  7636. this.captureIds.set(id, void 0);
  7637. }
  7638. this.mark(instance);
  7639. return id;
  7640. }
  7641. /**
  7642. * Capture the meta information of an instance. (recursive)
  7643. *
  7644. * @param {Vue} instance
  7645. * @return {Object}
  7646. */
  7647. async capture(instance, list, depth) {
  7648. var _b;
  7649. if (!instance)
  7650. return null;
  7651. const id = this.captureId(instance);
  7652. const name = (0, util_1.getInstanceName)(instance);
  7653. const children = this.getInternalInstanceChildrenByInstance(instance).filter((child) => !(0, util_1.isBeingDestroyed)(child));
  7654. const parents = this.getComponentParents(instance) || [];
  7655. const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);
  7656. const treeNode = {
  7657. uid: instance.uid,
  7658. id,
  7659. name,
  7660. renderKey: (0, util_1.getRenderKey)(instance.vnode ? instance.vnode.key : null),
  7661. inactive,
  7662. hasChildren: !!children.length,
  7663. children: [],
  7664. isFragment: (0, util_1.isFragment)(instance),
  7665. tags: typeof instance.type !== "function" ? [] : [{
  7666. label: "functional",
  7667. textColor: 5592405,
  7668. backgroundColor: 15658734
  7669. }],
  7670. autoOpen: this.recursively
  7671. };
  7672. {
  7673. treeNode.route = instance.attrs.__pagePath || "";
  7674. }
  7675. if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {
  7676. treeNode.children = await Promise.all(children.map((child, index, list2) => this.capture(child, list2, depth + 1)).filter(Boolean));
  7677. }
  7678. if (this.isKeepAlive(instance)) {
  7679. const cachedComponents = this.getKeepAliveCachedInstances(instance);
  7680. const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_UID__);
  7681. for (const cachedChild of cachedComponents) {
  7682. if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_UID__)) {
  7683. const node = await this.capture({
  7684. ...cachedChild,
  7685. isDeactivated: true
  7686. }, null, depth + 1);
  7687. if (node) {
  7688. treeNode.children.push(node);
  7689. }
  7690. }
  7691. }
  7692. }
  7693. const rootElements = (0, el_1.getRootElementsFromComponentInstance)(instance);
  7694. const firstElement = rootElements[0];
  7695. if (firstElement === null || firstElement === void 0 ? void 0 : firstElement.parentElement) {
  7696. const parentInstance = instance.parent;
  7697. const parentRootElements = parentInstance ? (0, el_1.getRootElementsFromComponentInstance)(parentInstance) : [];
  7698. let el = firstElement;
  7699. const indexList = [];
  7700. do {
  7701. indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));
  7702. el = el.parentElement;
  7703. } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));
  7704. treeNode.domOrder = indexList.reverse();
  7705. } else {
  7706. treeNode.domOrder = [-1];
  7707. }
  7708. if ((_b = instance.suspense) === null || _b === void 0 ? void 0 : _b.suspenseKey) {
  7709. treeNode.tags.push({
  7710. label: instance.suspense.suspenseKey,
  7711. backgroundColor: 14979812,
  7712. textColor: 16777215
  7713. });
  7714. this.mark(instance, true);
  7715. }
  7716. return this.api.visitComponentTree(instance, treeNode, this.componentFilter.filter, this.ctx.currentAppRecord.options.app);
  7717. }
  7718. /**
  7719. * Mark an instance as captured and store it in the instance map.
  7720. *
  7721. * @param {Vue} instance
  7722. */
  7723. mark(instance, force = false) {
  7724. const instanceMap = this.ctx.currentAppRecord.instanceMap;
  7725. if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
  7726. instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance);
  7727. }
  7728. }
  7729. isKeepAlive(instance) {
  7730. return instance.type.__isKeepAlive && instance.__v_cache;
  7731. }
  7732. getKeepAliveCachedInstances(instance) {
  7733. return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);
  7734. }
  7735. }
  7736. exports.ComponentWalker = ComponentWalker;
  7737. }
  7738. ),
  7739. /***/
  7740. "../app-backend-vue3/lib/components/util.js": (
  7741. /*!**************************************************!*\
  7742. !*** ../app-backend-vue3/lib/components/util.js ***!
  7743. \**************************************************/
  7744. /***/
  7745. (__unused_webpack_module, exports, __webpack_require__2) => {
  7746. Object.defineProperty(exports, "__esModule", {
  7747. value: true
  7748. });
  7749. exports.getComponentInstances = exports.getRenderKey = exports.getUniqueComponentId = exports.getInstanceName = exports.isFragment = exports.getAppRecord = exports.isBeingDestroyed = void 0;
  7750. const shared_utils_1 = __webpack_require__2(
  7751. /*! @vue-devtools/shared-utils */
  7752. "../shared-utils/lib/index.js"
  7753. );
  7754. const util_1 = __webpack_require__2(
  7755. /*! ../util */
  7756. "../app-backend-vue3/lib/util.js"
  7757. );
  7758. function isBeingDestroyed(instance) {
  7759. return instance._isBeingDestroyed || instance.isUnmounted;
  7760. }
  7761. exports.isBeingDestroyed = isBeingDestroyed;
  7762. function getAppRecord(instance) {
  7763. if (instance.root) {
  7764. return instance.appContext.app.__VUE_DEVTOOLS_APP_RECORD__;
  7765. }
  7766. }
  7767. exports.getAppRecord = getAppRecord;
  7768. function isFragment(instance) {
  7769. var _a;
  7770. const appRecord = getAppRecord(instance);
  7771. if (appRecord) {
  7772. return appRecord.options.types.Fragment === ((_a = instance.subTree) === null || _a === void 0 ? void 0 : _a.type);
  7773. }
  7774. }
  7775. exports.isFragment = isFragment;
  7776. function getInstanceName(instance) {
  7777. var _a, _b, _c;
  7778. const name = getComponentTypeName(instance.type || {});
  7779. if (name)
  7780. return name;
  7781. if (isAppRoot(instance))
  7782. return "Root";
  7783. for (const key in (_b = (_a = instance.parent) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.components) {
  7784. if (instance.parent.type.components[key] === instance.type)
  7785. return saveComponentName(instance, key);
  7786. }
  7787. for (const key in (_c = instance.appContext) === null || _c === void 0 ? void 0 : _c.components) {
  7788. if (instance.appContext.components[key] === instance.type)
  7789. return saveComponentName(instance, key);
  7790. }
  7791. return "Anonymous Component";
  7792. }
  7793. exports.getInstanceName = getInstanceName;
  7794. function saveComponentName(instance, key) {
  7795. instance.type.__vdevtools_guessedName = key;
  7796. return key;
  7797. }
  7798. function getComponentTypeName(options) {
  7799. const name = options.name || options._componentTag || options.__vdevtools_guessedName;
  7800. if (name) {
  7801. return name;
  7802. }
  7803. const file = options.__file;
  7804. if (file) {
  7805. return (0, shared_utils_1.classify)((0, util_1.basename)(file, ".vue"));
  7806. }
  7807. }
  7808. function isAppRoot(instance) {
  7809. return instance.ctx.$mpType === "app";
  7810. }
  7811. function getUniqueComponentId(instance, ctx) {
  7812. const appId = instance.appContext.app.__VUE_DEVTOOLS_APP_RECORD_ID__;
  7813. const instanceId = isAppRoot(instance) ? "root" : instance.uid;
  7814. return `${appId}:${instanceId}`;
  7815. }
  7816. exports.getUniqueComponentId = getUniqueComponentId;
  7817. function getRenderKey(value) {
  7818. if (value == null)
  7819. return;
  7820. const type = typeof value;
  7821. if (type === "number") {
  7822. return value;
  7823. } else if (type === "string") {
  7824. return `'${value}'`;
  7825. } else if (Array.isArray(value)) {
  7826. return "Array";
  7827. } else {
  7828. return "Object";
  7829. }
  7830. }
  7831. exports.getRenderKey = getRenderKey;
  7832. function getComponentInstances(app) {
  7833. const appRecord = app.__VUE_DEVTOOLS_APP_RECORD__;
  7834. const appId = appRecord.id.toString();
  7835. return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
  7836. }
  7837. exports.getComponentInstances = getComponentInstances;
  7838. }
  7839. ),
  7840. /***/
  7841. "../app-backend-vue3/lib/index.js": (
  7842. /*!****************************************!*\
  7843. !*** ../app-backend-vue3/lib/index.js ***!
  7844. \****************************************/
  7845. /***/
  7846. (__unused_webpack_module, exports, __webpack_require__2) => {
  7847. Object.defineProperty(exports, "__esModule", {
  7848. value: true
  7849. });
  7850. exports.backend = void 0;
  7851. const app_backend_api_1 = __webpack_require__2(
  7852. /*! @vue-devtools/app-backend-api */
  7853. "../app-backend-api/lib/index.js"
  7854. );
  7855. const tree_1 = __webpack_require__2(
  7856. /*! ./components/tree */
  7857. "../app-backend-vue3/lib/components/tree.js"
  7858. );
  7859. const data_1 = __webpack_require__2(
  7860. /*! ./components/data */
  7861. "../app-backend-vue3/lib/components/data.js"
  7862. );
  7863. const util_1 = __webpack_require__2(
  7864. /*! ./components/util */
  7865. "../app-backend-vue3/lib/components/util.js"
  7866. );
  7867. const el_1 = __webpack_require__2(
  7868. /*! ./components/el */
  7869. "../app-backend-vue3/lib/components/el.js"
  7870. );
  7871. const shared_utils_1 = __webpack_require__2(
  7872. /*! @vue-devtools/shared-utils */
  7873. "../shared-utils/lib/index.js"
  7874. );
  7875. exports.backend = (0, app_backend_api_1.defineBackend)({
  7876. frameworkVersion: 3,
  7877. features: [],
  7878. setup(api) {
  7879. api.on.getAppRecordName((payload) => {
  7880. if (payload.app._component) {
  7881. payload.name = payload.app._component.name;
  7882. }
  7883. });
  7884. api.on.getAppRootInstance((payload) => {
  7885. var _a, _b, _c, _d;
  7886. if (payload.app._instance) {
  7887. payload.root = payload.app._instance;
  7888. } else if ((_b = (_a = payload.app._container) === null || _a === void 0 ? void 0 : _a._vnode) === null || _b === void 0 ? void 0 : _b.component) {
  7889. payload.root = (_d = (_c = payload.app._container) === null || _c === void 0 ? void 0 : _c._vnode) === null || _d === void 0 ? void 0 : _d.component;
  7890. }
  7891. });
  7892. api.on.walkComponentTree(async (payload, ctx) => {
  7893. const walker = new tree_1.ComponentWalker(payload.maxDepth, payload.filter, payload.recursively, api, ctx);
  7894. payload.componentTreeData = await walker.getComponentTree(payload.componentInstance);
  7895. });
  7896. api.on.walkComponentParents((payload, ctx) => {
  7897. const walker = new tree_1.ComponentWalker(0, null, false, api, ctx);
  7898. payload.parentInstances = walker.getComponentParents(payload.componentInstance);
  7899. });
  7900. api.on.inspectComponent((payload, ctx) => {
  7901. shared_utils_1.backendInjections.getCustomInstanceDetails = data_1.getCustomInstanceDetails;
  7902. shared_utils_1.backendInjections.getCustomObjectDetails = data_1.getCustomObjectDetails;
  7903. shared_utils_1.backendInjections.instanceMap = ctx.currentAppRecord.instanceMap;
  7904. shared_utils_1.backendInjections.isVueInstance = (val) => val._ && Object.keys(val._).includes("vnode");
  7905. payload.instanceData = (0, data_1.getInstanceDetails)(payload.componentInstance, ctx);
  7906. });
  7907. api.on.getComponentName((payload) => {
  7908. payload.name = (0, util_1.getInstanceName)(payload.componentInstance);
  7909. });
  7910. api.on.getComponentBounds((payload) => {
  7911. payload.bounds = (0, el_1.getInstanceOrVnodeRect)(payload.componentInstance);
  7912. });
  7913. api.on.getElementComponent((payload) => {
  7914. payload.componentInstance = (0, el_1.getComponentInstanceFromElement)(payload.element);
  7915. });
  7916. api.on.getComponentInstances((payload) => {
  7917. payload.componentInstances = (0, util_1.getComponentInstances)(payload.app);
  7918. });
  7919. api.on.getComponentRootElements((payload) => {
  7920. payload.rootElements = (0, el_1.getRootElementsFromComponentInstance)(payload.componentInstance);
  7921. });
  7922. api.on.editComponentState((payload, ctx) => {
  7923. (0, data_1.editState)(payload, api.stateEditor, ctx);
  7924. });
  7925. api.on.getComponentDevtoolsOptions((payload) => {
  7926. payload.options = payload.componentInstance.type.devtools;
  7927. });
  7928. api.on.getComponentRenderCode((payload) => {
  7929. payload.code = !(payload.componentInstance.type instanceof Function) ? payload.componentInstance.render.toString() : payload.componentInstance.type.toString();
  7930. });
  7931. api.on.transformCall((payload) => {
  7932. if (payload.callName === shared_utils_1.HookEvents.COMPONENT_UPDATED) {
  7933. const component = payload.inArgs[0];
  7934. payload.outArgs = [component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component];
  7935. }
  7936. });
  7937. api.stateEditor.isRef = (value) => !!(value === null || value === void 0 ? void 0 : value.__v_isRef);
  7938. api.stateEditor.getRefValue = (ref) => ref.value;
  7939. api.stateEditor.setRefValue = (ref, value) => {
  7940. ref.value = value;
  7941. };
  7942. }
  7943. });
  7944. }
  7945. ),
  7946. /***/
  7947. "../app-backend-vue3/lib/util.js": (
  7948. /*!***************************************!*\
  7949. !*** ../app-backend-vue3/lib/util.js ***!
  7950. \***************************************/
  7951. /***/
  7952. function(__unused_webpack_module, exports, __webpack_require__2) {
  7953. var __importDefault = this && this.__importDefault || function(mod) {
  7954. return mod && mod.__esModule ? mod : {
  7955. "default": mod
  7956. };
  7957. };
  7958. Object.defineProperty(exports, "__esModule", {
  7959. value: true
  7960. });
  7961. exports.returnError = exports.basename = exports.flatten = void 0;
  7962. const path_1 = __importDefault(__webpack_require__2(
  7963. /*! path */
  7964. "../../node_modules/path-browserify/index.js"
  7965. ));
  7966. function flatten(items) {
  7967. return items.reduce((acc, item) => {
  7968. if (item instanceof Array)
  7969. acc.push(...flatten(item));
  7970. else if (item)
  7971. acc.push(item);
  7972. return acc;
  7973. }, []);
  7974. }
  7975. exports.flatten = flatten;
  7976. function basename(filename, ext) {
  7977. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  7978. }
  7979. exports.basename = basename;
  7980. function returnError(cb) {
  7981. try {
  7982. return cb();
  7983. } catch (e2) {
  7984. return e2;
  7985. }
  7986. }
  7987. exports.returnError = returnError;
  7988. }
  7989. ),
  7990. /***/
  7991. "../shared-utils/lib/backend.js": (
  7992. /*!**************************************!*\
  7993. !*** ../shared-utils/lib/backend.js ***!
  7994. \**************************************/
  7995. /***/
  7996. (__unused_webpack_module, exports) => {
  7997. Object.defineProperty(exports, "__esModule", {
  7998. value: true
  7999. });
  8000. exports.getCatchedGetters = exports.getCustomStoreDetails = exports.getCustomRouterDetails = exports.isVueInstance = exports.getCustomObjectDetails = exports.getCustomInstanceDetails = exports.getInstanceMap = exports.backendInjections = void 0;
  8001. exports.backendInjections = {
  8002. instanceMap: /* @__PURE__ */ new Map(),
  8003. isVueInstance: () => false,
  8004. getCustomInstanceDetails: () => ({}),
  8005. getCustomObjectDetails: () => void 0
  8006. };
  8007. function getInstanceMap() {
  8008. return exports.backendInjections.instanceMap;
  8009. }
  8010. exports.getInstanceMap = getInstanceMap;
  8011. function getCustomInstanceDetails(instance) {
  8012. return exports.backendInjections.getCustomInstanceDetails(instance);
  8013. }
  8014. exports.getCustomInstanceDetails = getCustomInstanceDetails;
  8015. function getCustomObjectDetails(value, proto) {
  8016. return exports.backendInjections.getCustomObjectDetails(value, proto);
  8017. }
  8018. exports.getCustomObjectDetails = getCustomObjectDetails;
  8019. function isVueInstance(value) {
  8020. return exports.backendInjections.isVueInstance(value);
  8021. }
  8022. exports.isVueInstance = isVueInstance;
  8023. function getCustomRouterDetails(router) {
  8024. return {
  8025. _custom: {
  8026. type: "router",
  8027. display: "VueRouter",
  8028. value: {
  8029. options: router.options,
  8030. currentRoute: router.currentRoute
  8031. },
  8032. fields: {
  8033. abstract: true
  8034. }
  8035. }
  8036. };
  8037. }
  8038. exports.getCustomRouterDetails = getCustomRouterDetails;
  8039. function getCustomStoreDetails(store) {
  8040. return {
  8041. _custom: {
  8042. type: "store",
  8043. display: "Store",
  8044. value: {
  8045. state: store.state,
  8046. getters: getCatchedGetters(store)
  8047. },
  8048. fields: {
  8049. abstract: true
  8050. }
  8051. }
  8052. };
  8053. }
  8054. exports.getCustomStoreDetails = getCustomStoreDetails;
  8055. function getCatchedGetters(store) {
  8056. const getters = {};
  8057. const origGetters = store.getters || {};
  8058. const keys = Object.keys(origGetters);
  8059. for (let i2 = 0; i2 < keys.length; i2++) {
  8060. const key = keys[i2];
  8061. Object.defineProperty(getters, key, {
  8062. enumerable: true,
  8063. get: () => {
  8064. try {
  8065. return origGetters[key];
  8066. } catch (e2) {
  8067. return e2;
  8068. }
  8069. }
  8070. });
  8071. }
  8072. return getters;
  8073. }
  8074. exports.getCatchedGetters = getCatchedGetters;
  8075. }
  8076. ),
  8077. /***/
  8078. "../shared-utils/lib/bridge.js": (
  8079. /*!*************************************!*\
  8080. !*** ../shared-utils/lib/bridge.js ***!
  8081. \*************************************/
  8082. /***/
  8083. (__unused_webpack_module, exports, __webpack_require__2) => {
  8084. Object.defineProperty(exports, "__esModule", {
  8085. value: true
  8086. });
  8087. exports.Bridge = void 0;
  8088. const events_1 = __webpack_require__2(
  8089. /*! events */
  8090. "../../node_modules/events/events.js"
  8091. );
  8092. const raf_1 = __webpack_require__2(
  8093. /*! ./raf */
  8094. "../shared-utils/lib/raf.js"
  8095. );
  8096. const BATCH_DURATION = 100;
  8097. class Bridge extends events_1.EventEmitter {
  8098. constructor(wall) {
  8099. super();
  8100. this.setMaxListeners(Infinity);
  8101. this.wall = wall;
  8102. wall.listen((messages2) => {
  8103. if (Array.isArray(messages2)) {
  8104. messages2.forEach((message) => this._emit(message));
  8105. } else {
  8106. this._emit(messages2);
  8107. }
  8108. });
  8109. this._batchingQueue = [];
  8110. this._sendingQueue = [];
  8111. this._receivingQueue = [];
  8112. this._sending = false;
  8113. }
  8114. on(event, listener) {
  8115. const wrappedListener = async (...args) => {
  8116. try {
  8117. await listener(...args);
  8118. } catch (e2) {
  8119. console.error(`[Bridge] Error in listener for event ${event.toString()} with args:`, args);
  8120. console.error(e2);
  8121. }
  8122. };
  8123. return super.on(event, wrappedListener);
  8124. }
  8125. send(event, payload) {
  8126. this._batchingQueue.push({
  8127. event,
  8128. payload
  8129. });
  8130. if (this._timer == null) {
  8131. this._timer = setTimeout(() => this._flush(), BATCH_DURATION);
  8132. }
  8133. }
  8134. /**
  8135. * Log a message to the devtools background page.
  8136. */
  8137. log(message) {
  8138. this.send("log", message);
  8139. }
  8140. _flush() {
  8141. if (this._batchingQueue.length)
  8142. this._send(this._batchingQueue);
  8143. clearTimeout(this._timer);
  8144. this._timer = null;
  8145. this._batchingQueue = [];
  8146. }
  8147. // @TODO types
  8148. _emit(message) {
  8149. if (typeof message === "string") {
  8150. this.emit(message);
  8151. } else if (message._chunk) {
  8152. this._receivingQueue.push(message._chunk);
  8153. if (message.last) {
  8154. this.emit(message.event, this._receivingQueue);
  8155. this._receivingQueue = [];
  8156. }
  8157. } else if (message.event) {
  8158. this.emit(message.event, message.payload);
  8159. }
  8160. }
  8161. // @TODO types
  8162. _send(messages2) {
  8163. this._sendingQueue.push(messages2);
  8164. this._nextSend();
  8165. }
  8166. _nextSend() {
  8167. if (!this._sendingQueue.length || this._sending)
  8168. return;
  8169. this._sending = true;
  8170. const messages2 = this._sendingQueue.shift();
  8171. try {
  8172. this.wall.send(messages2);
  8173. } catch (err) {
  8174. if (err.message === "Message length exceeded maximum allowed length.") {
  8175. this._sendingQueue.splice(0, 0, messages2.map((message) => [message]));
  8176. }
  8177. }
  8178. this._sending = false;
  8179. (0, raf_1.raf)(() => this._nextSend());
  8180. }
  8181. }
  8182. exports.Bridge = Bridge;
  8183. }
  8184. ),
  8185. /***/
  8186. "../shared-utils/lib/consts.js": (
  8187. /*!*************************************!*\
  8188. !*** ../shared-utils/lib/consts.js ***!
  8189. \*************************************/
  8190. /***/
  8191. (__unused_webpack_module, exports) => {
  8192. Object.defineProperty(exports, "__esModule", {
  8193. value: true
  8194. });
  8195. exports.HookEvents = exports.BridgeSubscriptions = exports.BridgeEvents = exports.BuiltinTabs = void 0;
  8196. (function(BuiltinTabs) {
  8197. BuiltinTabs["COMPONENTS"] = "components";
  8198. BuiltinTabs["TIMELINE"] = "timeline";
  8199. BuiltinTabs["PLUGINS"] = "plugins";
  8200. BuiltinTabs["SETTINGS"] = "settings";
  8201. })(exports.BuiltinTabs || (exports.BuiltinTabs = {}));
  8202. (function(BridgeEvents) {
  8203. BridgeEvents["TO_BACK_SUBSCRIBE"] = "b:subscribe";
  8204. BridgeEvents["TO_BACK_UNSUBSCRIBE"] = "b:unsubscribe";
  8205. BridgeEvents["TO_FRONT_READY"] = "f:ready";
  8206. BridgeEvents["TO_BACK_LOG_DETECTED_VUE"] = "b:log-detected-vue";
  8207. BridgeEvents["TO_BACK_REFRESH"] = "b:refresh";
  8208. BridgeEvents["TO_BACK_TAB_SWITCH"] = "b:tab:switch";
  8209. BridgeEvents["TO_BACK_LOG"] = "b:log";
  8210. BridgeEvents["TO_FRONT_RECONNECTED"] = "f:reconnected";
  8211. BridgeEvents["TO_FRONT_TITLE"] = "f:title";
  8212. BridgeEvents["TO_FRONT_APP_ADD"] = "f:app:add";
  8213. BridgeEvents["TO_BACK_APP_LIST"] = "b:app:list";
  8214. BridgeEvents["TO_FRONT_APP_LIST"] = "f:app:list";
  8215. BridgeEvents["TO_FRONT_APP_REMOVE"] = "f:app:remove";
  8216. BridgeEvents["TO_BACK_APP_SELECT"] = "b:app:select";
  8217. BridgeEvents["TO_FRONT_APP_SELECTED"] = "f:app:selected";
  8218. BridgeEvents["TO_BACK_SCAN_LEGACY_APPS"] = "b:app:scan-legacy";
  8219. BridgeEvents["TO_BACK_COMPONENT_TREE"] = "b:component:tree";
  8220. BridgeEvents["TO_FRONT_COMPONENT_TREE"] = "f:component:tree";
  8221. BridgeEvents["TO_BACK_COMPONENT_SELECTED_DATA"] = "b:component:selected-data";
  8222. BridgeEvents["TO_FRONT_COMPONENT_SELECTED_DATA"] = "f:component:selected-data";
  8223. BridgeEvents["TO_BACK_COMPONENT_EXPAND"] = "b:component:expand";
  8224. BridgeEvents["TO_FRONT_COMPONENT_EXPAND"] = "f:component:expand";
  8225. BridgeEvents["TO_BACK_COMPONENT_SCROLL_TO"] = "b:component:scroll-to";
  8226. BridgeEvents["TO_BACK_COMPONENT_FILTER"] = "b:component:filter";
  8227. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OVER"] = "b:component:mouse-over";
  8228. BridgeEvents["TO_BACK_COMPONENT_MOUSE_OUT"] = "b:component:mouse-out";
  8229. BridgeEvents["TO_BACK_COMPONENT_CONTEXT_MENU_TARGET"] = "b:component:context-menu-target";
  8230. BridgeEvents["TO_BACK_COMPONENT_EDIT_STATE"] = "b:component:edit-state";
  8231. BridgeEvents["TO_BACK_COMPONENT_PICK"] = "b:component:pick";
  8232. BridgeEvents["TO_FRONT_COMPONENT_PICK"] = "f:component:pick";
  8233. BridgeEvents["TO_BACK_COMPONENT_PICK_CANCELED"] = "b:component:pick-canceled";
  8234. BridgeEvents["TO_FRONT_COMPONENT_PICK_CANCELED"] = "f:component:pick-canceled";
  8235. BridgeEvents["TO_BACK_COMPONENT_INSPECT_DOM"] = "b:component:inspect-dom";
  8236. BridgeEvents["TO_FRONT_COMPONENT_INSPECT_DOM"] = "f:component:inspect-dom";
  8237. BridgeEvents["TO_BACK_COMPONENT_RENDER_CODE"] = "b:component:render-code";
  8238. BridgeEvents["TO_FRONT_COMPONENT_RENDER_CODE"] = "f:component:render-code";
  8239. BridgeEvents["TO_FRONT_COMPONENT_UPDATED"] = "f:component:updated";
  8240. BridgeEvents["TO_FRONT_TIMELINE_EVENT"] = "f:timeline:event";
  8241. BridgeEvents["TO_BACK_TIMELINE_LAYER_LIST"] = "b:timeline:layer-list";
  8242. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LIST"] = "f:timeline:layer-list";
  8243. BridgeEvents["TO_FRONT_TIMELINE_LAYER_ADD"] = "f:timeline:layer-add";
  8244. BridgeEvents["TO_BACK_TIMELINE_SHOW_SCREENSHOT"] = "b:timeline:show-screenshot";
  8245. BridgeEvents["TO_BACK_TIMELINE_CLEAR"] = "b:timeline:clear";
  8246. BridgeEvents["TO_BACK_TIMELINE_EVENT_DATA"] = "b:timeline:event-data";
  8247. BridgeEvents["TO_FRONT_TIMELINE_EVENT_DATA"] = "f:timeline:event-data";
  8248. BridgeEvents["TO_BACK_TIMELINE_LAYER_LOAD_EVENTS"] = "b:timeline:layer-load-events";
  8249. BridgeEvents["TO_FRONT_TIMELINE_LAYER_LOAD_EVENTS"] = "f:timeline:layer-load-events";
  8250. BridgeEvents["TO_BACK_TIMELINE_LOAD_MARKERS"] = "b:timeline:load-markers";
  8251. BridgeEvents["TO_FRONT_TIMELINE_LOAD_MARKERS"] = "f:timeline:load-markers";
  8252. BridgeEvents["TO_FRONT_TIMELINE_MARKER"] = "f:timeline:marker";
  8253. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_LIST"] = "b:devtools-plugin:list";
  8254. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_LIST"] = "f:devtools-plugin:list";
  8255. BridgeEvents["TO_FRONT_DEVTOOLS_PLUGIN_ADD"] = "f:devtools-plugin:add";
  8256. BridgeEvents["TO_BACK_DEVTOOLS_PLUGIN_SETTING_UPDATED"] = "b:devtools-plugin:setting-updated";
  8257. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_LIST"] = "b:custom-inspector:list";
  8258. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_LIST"] = "f:custom-inspector:list";
  8259. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_ADD"] = "f:custom-inspector:add";
  8260. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_TREE"] = "b:custom-inspector:tree";
  8261. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_TREE"] = "f:custom-inspector:tree";
  8262. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_STATE"] = "b:custom-inspector:state";
  8263. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_STATE"] = "f:custom-inspector:state";
  8264. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_EDIT_STATE"] = "b:custom-inspector:edit-state";
  8265. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_ACTION"] = "b:custom-inspector:action";
  8266. BridgeEvents["TO_BACK_CUSTOM_INSPECTOR_NODE_ACTION"] = "b:custom-inspector:node-action";
  8267. BridgeEvents["TO_FRONT_CUSTOM_INSPECTOR_SELECT_NODE"] = "f:custom-inspector:select-node";
  8268. BridgeEvents["TO_BACK_CUSTOM_STATE_ACTION"] = "b:custom-state:action";
  8269. })(exports.BridgeEvents || (exports.BridgeEvents = {}));
  8270. (function(BridgeSubscriptions) {
  8271. BridgeSubscriptions["SELECTED_COMPONENT_DATA"] = "component:selected-data";
  8272. BridgeSubscriptions["COMPONENT_TREE"] = "component:tree";
  8273. })(exports.BridgeSubscriptions || (exports.BridgeSubscriptions = {}));
  8274. (function(HookEvents) {
  8275. HookEvents["INIT"] = "init";
  8276. HookEvents["APP_INIT"] = "app:init";
  8277. HookEvents["APP_ADD"] = "app:add";
  8278. HookEvents["APP_UNMOUNT"] = "app:unmount";
  8279. HookEvents["COMPONENT_UPDATED"] = "component:updated";
  8280. HookEvents["COMPONENT_ADDED"] = "component:added";
  8281. HookEvents["COMPONENT_REMOVED"] = "component:removed";
  8282. HookEvents["COMPONENT_EMIT"] = "component:emit";
  8283. HookEvents["COMPONENT_HIGHLIGHT"] = "component:highlight";
  8284. HookEvents["COMPONENT_UNHIGHLIGHT"] = "component:unhighlight";
  8285. HookEvents["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
  8286. HookEvents["TIMELINE_LAYER_ADDED"] = "timeline:layer-added";
  8287. HookEvents["TIMELINE_EVENT_ADDED"] = "timeline:event-added";
  8288. HookEvents["CUSTOM_INSPECTOR_ADD"] = "custom-inspector:add";
  8289. HookEvents["CUSTOM_INSPECTOR_SEND_TREE"] = "custom-inspector:send-tree";
  8290. HookEvents["CUSTOM_INSPECTOR_SEND_STATE"] = "custom-inspector:send-state";
  8291. HookEvents["CUSTOM_INSPECTOR_SELECT_NODE"] = "custom-inspector:select-node";
  8292. HookEvents["PERFORMANCE_START"] = "perf:start";
  8293. HookEvents["PERFORMANCE_END"] = "perf:end";
  8294. HookEvents["PLUGIN_SETTINGS_SET"] = "plugin:settings:set";
  8295. HookEvents["FLUSH"] = "flush";
  8296. HookEvents["TRACK_UPDATE"] = "_track-update";
  8297. HookEvents["FLASH_UPDATE"] = "_flash-update";
  8298. })(exports.HookEvents || (exports.HookEvents = {}));
  8299. }
  8300. ),
  8301. /***/
  8302. "../shared-utils/lib/edit.js": (
  8303. /*!***********************************!*\
  8304. !*** ../shared-utils/lib/edit.js ***!
  8305. \***********************************/
  8306. /***/
  8307. (__unused_webpack_module, exports) => {
  8308. Object.defineProperty(exports, "__esModule", {
  8309. value: true
  8310. });
  8311. exports.StateEditor = void 0;
  8312. class StateEditor {
  8313. set(object, path, value, cb = null) {
  8314. const sections = Array.isArray(path) ? path : path.split(".");
  8315. while (sections.length > 1) {
  8316. object = object[sections.shift()];
  8317. if (this.isRef(object)) {
  8318. object = this.getRefValue(object);
  8319. }
  8320. }
  8321. const field = sections[0];
  8322. if (cb) {
  8323. cb(object, field, value);
  8324. } else if (this.isRef(object[field])) {
  8325. this.setRefValue(object[field], value);
  8326. } else {
  8327. object[field] = value;
  8328. }
  8329. }
  8330. get(object, path) {
  8331. const sections = Array.isArray(path) ? path : path.split(".");
  8332. for (let i2 = 0; i2 < sections.length; i2++) {
  8333. object = object[sections[i2]];
  8334. if (this.isRef(object)) {
  8335. object = this.getRefValue(object);
  8336. }
  8337. if (!object) {
  8338. return void 0;
  8339. }
  8340. }
  8341. return object;
  8342. }
  8343. has(object, path, parent = false) {
  8344. if (typeof object === "undefined") {
  8345. return false;
  8346. }
  8347. const sections = Array.isArray(path) ? path.slice() : path.split(".");
  8348. const size = !parent ? 1 : 2;
  8349. while (object && sections.length > size) {
  8350. object = object[sections.shift()];
  8351. if (this.isRef(object)) {
  8352. object = this.getRefValue(object);
  8353. }
  8354. }
  8355. return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
  8356. }
  8357. createDefaultSetCallback(state) {
  8358. return (obj, field, value) => {
  8359. if (state.remove || state.newKey) {
  8360. if (Array.isArray(obj)) {
  8361. obj.splice(field, 1);
  8362. } else {
  8363. delete obj[field];
  8364. }
  8365. }
  8366. if (!state.remove) {
  8367. const target = obj[state.newKey || field];
  8368. if (this.isRef(target)) {
  8369. this.setRefValue(target, value);
  8370. } else {
  8371. obj[state.newKey || field] = value;
  8372. }
  8373. }
  8374. };
  8375. }
  8376. isRef(ref) {
  8377. return false;
  8378. }
  8379. setRefValue(ref, value) {
  8380. }
  8381. getRefValue(ref) {
  8382. return ref;
  8383. }
  8384. }
  8385. exports.StateEditor = StateEditor;
  8386. }
  8387. ),
  8388. /***/
  8389. "../shared-utils/lib/env.js": (
  8390. /*!**********************************!*\
  8391. !*** ../shared-utils/lib/env.js ***!
  8392. \**********************************/
  8393. /***/
  8394. (__unused_webpack_module, exports) => {
  8395. Object.defineProperty(exports, "__esModule", {
  8396. value: true
  8397. });
  8398. exports.initEnv = exports.keys = exports.isLinux = exports.isMac = exports.isWindows = exports.isFirefox = exports.isChrome = exports.target = exports.isBrowser = void 0;
  8399. exports.isBrowser = typeof navigator !== "undefined" && typeof window !== "undefined";
  8400. exports.target = exports.isBrowser ? window : typeof globalThis !== "undefined" ? globalThis : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof my !== "undefined" ? my : {};
  8401. exports.isChrome = typeof exports.target.chrome !== "undefined" && !!exports.target.chrome.devtools;
  8402. exports.isFirefox = exports.isBrowser && navigator.userAgent && navigator.userAgent.indexOf("Firefox") > -1;
  8403. exports.isWindows = exports.isBrowser && navigator.platform.indexOf("Win") === 0;
  8404. exports.isMac = exports.isBrowser && navigator.platform === "MacIntel";
  8405. exports.isLinux = exports.isBrowser && navigator.platform.indexOf("Linux") === 0;
  8406. exports.keys = {
  8407. ctrl: exports.isMac ? "&#8984;" : "Ctrl",
  8408. shift: "Shift",
  8409. alt: exports.isMac ? "&#8997;" : "Alt",
  8410. del: "Del",
  8411. enter: "Enter",
  8412. esc: "Esc"
  8413. };
  8414. function initEnv(Vue2) {
  8415. if (Vue2.prototype.hasOwnProperty("$isChrome"))
  8416. return;
  8417. Object.defineProperties(Vue2.prototype, {
  8418. $isChrome: {
  8419. get: () => exports.isChrome
  8420. },
  8421. $isFirefox: {
  8422. get: () => exports.isFirefox
  8423. },
  8424. $isWindows: {
  8425. get: () => exports.isWindows
  8426. },
  8427. $isMac: {
  8428. get: () => exports.isMac
  8429. },
  8430. $isLinux: {
  8431. get: () => exports.isLinux
  8432. },
  8433. $keys: {
  8434. get: () => exports.keys
  8435. }
  8436. });
  8437. if (exports.isWindows)
  8438. document.body.classList.add("platform-windows");
  8439. if (exports.isMac)
  8440. document.body.classList.add("platform-mac");
  8441. if (exports.isLinux)
  8442. document.body.classList.add("platform-linux");
  8443. }
  8444. exports.initEnv = initEnv;
  8445. }
  8446. ),
  8447. /***/
  8448. "../shared-utils/lib/index.js": (
  8449. /*!************************************!*\
  8450. !*** ../shared-utils/lib/index.js ***!
  8451. \************************************/
  8452. /***/
  8453. function(__unused_webpack_module, exports, __webpack_require__2) {
  8454. var __createBinding = this && this.__createBinding || (Object.create ? function(o2, m2, k, k2) {
  8455. if (k2 === void 0)
  8456. k2 = k;
  8457. var desc = Object.getOwnPropertyDescriptor(m2, k);
  8458. if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
  8459. desc = {
  8460. enumerable: true,
  8461. get: function() {
  8462. return m2[k];
  8463. }
  8464. };
  8465. }
  8466. Object.defineProperty(o2, k2, desc);
  8467. } : function(o2, m2, k, k2) {
  8468. if (k2 === void 0)
  8469. k2 = k;
  8470. o2[k2] = m2[k];
  8471. });
  8472. var __exportStar = this && this.__exportStar || function(m2, exports2) {
  8473. for (var p2 in m2)
  8474. if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2))
  8475. __createBinding(exports2, m2, p2);
  8476. };
  8477. Object.defineProperty(exports, "__esModule", {
  8478. value: true
  8479. });
  8480. __exportStar(__webpack_require__2(
  8481. /*! ./backend */
  8482. "../shared-utils/lib/backend.js"
  8483. ), exports);
  8484. __exportStar(__webpack_require__2(
  8485. /*! ./bridge */
  8486. "../shared-utils/lib/bridge.js"
  8487. ), exports);
  8488. __exportStar(__webpack_require__2(
  8489. /*! ./consts */
  8490. "../shared-utils/lib/consts.js"
  8491. ), exports);
  8492. __exportStar(__webpack_require__2(
  8493. /*! ./edit */
  8494. "../shared-utils/lib/edit.js"
  8495. ), exports);
  8496. __exportStar(__webpack_require__2(
  8497. /*! ./env */
  8498. "../shared-utils/lib/env.js"
  8499. ), exports);
  8500. __exportStar(__webpack_require__2(
  8501. /*! ./plugin-permissions */
  8502. "../shared-utils/lib/plugin-permissions.js"
  8503. ), exports);
  8504. __exportStar(__webpack_require__2(
  8505. /*! ./plugin-settings */
  8506. "../shared-utils/lib/plugin-settings.js"
  8507. ), exports);
  8508. __exportStar(__webpack_require__2(
  8509. /*! ./shared-data */
  8510. "../shared-utils/lib/shared-data.js"
  8511. ), exports);
  8512. __exportStar(__webpack_require__2(
  8513. /*! ./shell */
  8514. "../shared-utils/lib/shell.js"
  8515. ), exports);
  8516. __exportStar(__webpack_require__2(
  8517. /*! ./storage */
  8518. "../shared-utils/lib/storage.js"
  8519. ), exports);
  8520. __exportStar(__webpack_require__2(
  8521. /*! ./transfer */
  8522. "../shared-utils/lib/transfer.js"
  8523. ), exports);
  8524. __exportStar(__webpack_require__2(
  8525. /*! ./util */
  8526. "../shared-utils/lib/util.js"
  8527. ), exports);
  8528. __exportStar(__webpack_require__2(
  8529. /*! ./raf */
  8530. "../shared-utils/lib/raf.js"
  8531. ), exports);
  8532. }
  8533. ),
  8534. /***/
  8535. "../shared-utils/lib/plugin-permissions.js": (
  8536. /*!*************************************************!*\
  8537. !*** ../shared-utils/lib/plugin-permissions.js ***!
  8538. \*************************************************/
  8539. /***/
  8540. (__unused_webpack_module, exports, __webpack_require__2) => {
  8541. Object.defineProperty(exports, "__esModule", {
  8542. value: true
  8543. });
  8544. exports.setPluginPermission = exports.hasPluginPermission = exports.PluginPermission = void 0;
  8545. const shared_data_1 = __webpack_require__2(
  8546. /*! ./shared-data */
  8547. "../shared-utils/lib/shared-data.js"
  8548. );
  8549. (function(PluginPermission) {
  8550. PluginPermission["ENABLED"] = "enabled";
  8551. PluginPermission["COMPONENTS"] = "components";
  8552. PluginPermission["CUSTOM_INSPECTOR"] = "custom-inspector";
  8553. PluginPermission["TIMELINE"] = "timeline";
  8554. })(exports.PluginPermission || (exports.PluginPermission = {}));
  8555. function hasPluginPermission(pluginId, permission2) {
  8556. const result = shared_data_1.SharedData.pluginPermissions[`${pluginId}:${permission2}`];
  8557. if (result == null)
  8558. return true;
  8559. return !!result;
  8560. }
  8561. exports.hasPluginPermission = hasPluginPermission;
  8562. function setPluginPermission(pluginId, permission2, active) {
  8563. shared_data_1.SharedData.pluginPermissions = {
  8564. ...shared_data_1.SharedData.pluginPermissions,
  8565. [`${pluginId}:${permission2}`]: active
  8566. };
  8567. }
  8568. exports.setPluginPermission = setPluginPermission;
  8569. }
  8570. ),
  8571. /***/
  8572. "../shared-utils/lib/plugin-settings.js": (
  8573. /*!**********************************************!*\
  8574. !*** ../shared-utils/lib/plugin-settings.js ***!
  8575. \**********************************************/
  8576. /***/
  8577. (__unused_webpack_module, exports, __webpack_require__2) => {
  8578. Object.defineProperty(exports, "__esModule", {
  8579. value: true
  8580. });
  8581. exports.getPluginDefaultSettings = exports.setPluginSettings = exports.getPluginSettings = void 0;
  8582. const shared_data_1 = __webpack_require__2(
  8583. /*! ./shared-data */
  8584. "../shared-utils/lib/shared-data.js"
  8585. );
  8586. function getPluginSettings(pluginId, defaultSettings) {
  8587. var _a;
  8588. return {
  8589. ...defaultSettings !== null && defaultSettings !== void 0 ? defaultSettings : {},
  8590. ...(_a = shared_data_1.SharedData.pluginSettings[pluginId]) !== null && _a !== void 0 ? _a : {}
  8591. };
  8592. }
  8593. exports.getPluginSettings = getPluginSettings;
  8594. function setPluginSettings(pluginId, settings) {
  8595. shared_data_1.SharedData.pluginSettings = {
  8596. ...shared_data_1.SharedData.pluginSettings,
  8597. [pluginId]: settings
  8598. };
  8599. }
  8600. exports.setPluginSettings = setPluginSettings;
  8601. function getPluginDefaultSettings(schema) {
  8602. const result = {};
  8603. if (schema) {
  8604. for (const id in schema) {
  8605. const item = schema[id];
  8606. result[id] = item.defaultValue;
  8607. }
  8608. }
  8609. return result;
  8610. }
  8611. exports.getPluginDefaultSettings = getPluginDefaultSettings;
  8612. }
  8613. ),
  8614. /***/
  8615. "../shared-utils/lib/raf.js": (
  8616. /*!**********************************!*\
  8617. !*** ../shared-utils/lib/raf.js ***!
  8618. \**********************************/
  8619. /***/
  8620. (__unused_webpack_module, exports) => {
  8621. Object.defineProperty(exports, "__esModule", {
  8622. value: true
  8623. });
  8624. exports.raf = void 0;
  8625. let pendingCallbacks = [];
  8626. exports.raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : typeof setImmediate === "function" ? (fn) => {
  8627. if (!pendingCallbacks.length) {
  8628. setImmediate(() => {
  8629. const now = performance.now();
  8630. const cbs = pendingCallbacks;
  8631. pendingCallbacks = [];
  8632. cbs.forEach((cb) => cb(now));
  8633. });
  8634. }
  8635. pendingCallbacks.push(fn);
  8636. } : function(callback) {
  8637. return setTimeout(function() {
  8638. callback(Date.now());
  8639. }, 1e3 / 60);
  8640. };
  8641. }
  8642. ),
  8643. /***/
  8644. "../shared-utils/lib/shared-data.js": (
  8645. /*!******************************************!*\
  8646. !*** ../shared-utils/lib/shared-data.js ***!
  8647. \******************************************/
  8648. /***/
  8649. (__unused_webpack_module, exports, __webpack_require__2) => {
  8650. Object.defineProperty(exports, "__esModule", {
  8651. value: true
  8652. });
  8653. exports.SharedData = exports.watchSharedData = exports.destroySharedData = exports.onSharedDataInit = exports.initSharedData = void 0;
  8654. const storage_1 = __webpack_require__2(
  8655. /*! ./storage */
  8656. "../shared-utils/lib/storage.js"
  8657. );
  8658. const env_1 = __webpack_require__2(
  8659. /*! ./env */
  8660. "../shared-utils/lib/env.js"
  8661. );
  8662. const internalSharedData = {
  8663. openInEditorHost: "/",
  8664. componentNameStyle: "class",
  8665. theme: "auto",
  8666. displayDensity: "low",
  8667. timeFormat: "default",
  8668. recordVuex: true,
  8669. cacheVuexSnapshotsEvery: 50,
  8670. cacheVuexSnapshotsLimit: 10,
  8671. snapshotLoading: false,
  8672. componentEventsEnabled: true,
  8673. performanceMonitoringEnabled: true,
  8674. editableProps: false,
  8675. logDetected: true,
  8676. vuexNewBackend: false,
  8677. vuexAutoload: false,
  8678. vuexGroupGettersByModule: true,
  8679. showMenuScrollTip: true,
  8680. timelineTimeGrid: true,
  8681. timelineScreenshots: true,
  8682. menuStepScrolling: env_1.isMac,
  8683. pluginPermissions: {},
  8684. pluginSettings: {},
  8685. pageConfig: {},
  8686. legacyApps: false,
  8687. trackUpdates: true,
  8688. flashUpdates: false,
  8689. debugInfo: false,
  8690. isBrowser: env_1.isBrowser
  8691. };
  8692. const persisted = ["componentNameStyle", "theme", "displayDensity", "recordVuex", "editableProps", "logDetected", "vuexNewBackend", "vuexAutoload", "vuexGroupGettersByModule", "timeFormat", "showMenuScrollTip", "timelineTimeGrid", "timelineScreenshots", "menuStepScrolling", "pluginPermissions", "pluginSettings", "performanceMonitoringEnabled", "componentEventsEnabled", "trackUpdates", "flashUpdates", "debugInfo"];
  8693. const storageVersion = "6.0.0-alpha.1";
  8694. let bridge;
  8695. let persist = false;
  8696. let data;
  8697. let initRetryInterval;
  8698. let initRetryCount = 0;
  8699. const initCbs = [];
  8700. function initSharedData(params) {
  8701. return new Promise((resolve) => {
  8702. bridge = params.bridge;
  8703. persist = !!params.persist;
  8704. if (persist) {
  8705. {
  8706. console.log("[shared data] Master init in progress...");
  8707. }
  8708. persisted.forEach((key) => {
  8709. const value = (0, storage_1.getStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`);
  8710. if (value !== null) {
  8711. internalSharedData[key] = value;
  8712. }
  8713. });
  8714. bridge.on("shared-data:load", () => {
  8715. Object.keys(internalSharedData).forEach((key) => {
  8716. sendValue(key, internalSharedData[key]);
  8717. });
  8718. bridge.send("shared-data:load-complete");
  8719. });
  8720. bridge.on("shared-data:init-complete", () => {
  8721. {
  8722. console.log("[shared data] Master init complete");
  8723. }
  8724. clearInterval(initRetryInterval);
  8725. resolve();
  8726. });
  8727. bridge.send("shared-data:master-init-waiting");
  8728. bridge.on("shared-data:minion-init-waiting", () => {
  8729. bridge.send("shared-data:master-init-waiting");
  8730. });
  8731. initRetryCount = 0;
  8732. clearInterval(initRetryInterval);
  8733. initRetryInterval = setInterval(() => {
  8734. {
  8735. console.log("[shared data] Master init retrying...");
  8736. }
  8737. bridge.send("shared-data:master-init-waiting");
  8738. initRetryCount++;
  8739. if (initRetryCount > 30) {
  8740. clearInterval(initRetryInterval);
  8741. console.error("[shared data] Master init failed");
  8742. }
  8743. }, 2e3);
  8744. } else {
  8745. bridge.on("shared-data:master-init-waiting", () => {
  8746. bridge.send("shared-data:load");
  8747. bridge.once("shared-data:load-complete", () => {
  8748. bridge.send("shared-data:init-complete");
  8749. resolve();
  8750. });
  8751. });
  8752. bridge.send("shared-data:minion-init-waiting");
  8753. }
  8754. data = {
  8755. ...internalSharedData
  8756. };
  8757. if (params.Vue) {
  8758. data = params.Vue.observable(data);
  8759. }
  8760. bridge.on("shared-data:set", ({
  8761. key,
  8762. value
  8763. }) => {
  8764. setValue(key, value);
  8765. });
  8766. initCbs.forEach((cb) => cb());
  8767. });
  8768. }
  8769. exports.initSharedData = initSharedData;
  8770. function onSharedDataInit(cb) {
  8771. initCbs.push(cb);
  8772. return () => {
  8773. const index = initCbs.indexOf(cb);
  8774. if (index !== -1)
  8775. initCbs.splice(index, 1);
  8776. };
  8777. }
  8778. exports.onSharedDataInit = onSharedDataInit;
  8779. function destroySharedData() {
  8780. bridge.removeAllListeners("shared-data:set");
  8781. watchers = {};
  8782. }
  8783. exports.destroySharedData = destroySharedData;
  8784. let watchers = {};
  8785. function setValue(key, value) {
  8786. if (persist && persisted.includes(key)) {
  8787. (0, storage_1.setStorage)(`vue-devtools-${storageVersion}:shared-data:${key}`, value);
  8788. }
  8789. const oldValue = data[key];
  8790. data[key] = value;
  8791. const handlers = watchers[key];
  8792. if (handlers) {
  8793. handlers.forEach((h2) => h2(value, oldValue));
  8794. }
  8795. return true;
  8796. }
  8797. function sendValue(key, value) {
  8798. bridge && bridge.send("shared-data:set", {
  8799. key,
  8800. value
  8801. });
  8802. }
  8803. function watchSharedData(prop, handler) {
  8804. const list = watchers[prop] || (watchers[prop] = []);
  8805. list.push(handler);
  8806. return () => {
  8807. const index = list.indexOf(handler);
  8808. if (index !== -1)
  8809. list.splice(index, 1);
  8810. };
  8811. }
  8812. exports.watchSharedData = watchSharedData;
  8813. const proxy = {};
  8814. Object.keys(internalSharedData).forEach((key) => {
  8815. Object.defineProperty(proxy, key, {
  8816. configurable: false,
  8817. get: () => data[key],
  8818. set: (value) => {
  8819. sendValue(key, value);
  8820. setValue(key, value);
  8821. }
  8822. });
  8823. });
  8824. exports.SharedData = proxy;
  8825. }
  8826. ),
  8827. /***/
  8828. "../shared-utils/lib/shell.js": (
  8829. /*!************************************!*\
  8830. !*** ../shared-utils/lib/shell.js ***!
  8831. \************************************/
  8832. /***/
  8833. (__unused_webpack_module, exports) => {
  8834. Object.defineProperty(exports, "__esModule", {
  8835. value: true
  8836. });
  8837. }
  8838. ),
  8839. /***/
  8840. "../shared-utils/lib/storage.js": (
  8841. /*!**************************************!*\
  8842. !*** ../shared-utils/lib/storage.js ***!
  8843. \**************************************/
  8844. /***/
  8845. (__unused_webpack_module, exports, __webpack_require__2) => {
  8846. Object.defineProperty(exports, "__esModule", {
  8847. value: true
  8848. });
  8849. exports.clearStorage = exports.removeStorage = exports.setStorage = exports.getStorage = exports.initStorage = void 0;
  8850. const env_1 = __webpack_require__2(
  8851. /*! ./env */
  8852. "../shared-utils/lib/env.js"
  8853. );
  8854. const useStorage = typeof env_1.target.chrome !== "undefined" && typeof env_1.target.chrome.storage !== "undefined";
  8855. let storageData = null;
  8856. function initStorage() {
  8857. return new Promise((resolve) => {
  8858. if (useStorage) {
  8859. env_1.target.chrome.storage.local.get(null, (result) => {
  8860. storageData = result;
  8861. resolve();
  8862. });
  8863. } else {
  8864. storageData = {};
  8865. resolve();
  8866. }
  8867. });
  8868. }
  8869. exports.initStorage = initStorage;
  8870. function getStorage(key, defaultValue = null) {
  8871. checkStorage();
  8872. if (useStorage) {
  8873. return getDefaultValue(storageData[key], defaultValue);
  8874. } else {
  8875. try {
  8876. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue);
  8877. } catch (e2) {
  8878. }
  8879. }
  8880. }
  8881. exports.getStorage = getStorage;
  8882. function setStorage(key, val) {
  8883. checkStorage();
  8884. if (useStorage) {
  8885. storageData[key] = val;
  8886. env_1.target.chrome.storage.local.set({
  8887. [key]: val
  8888. });
  8889. } else {
  8890. try {
  8891. localStorage.setItem(key, JSON.stringify(val));
  8892. } catch (e2) {
  8893. }
  8894. }
  8895. }
  8896. exports.setStorage = setStorage;
  8897. function removeStorage(key) {
  8898. checkStorage();
  8899. if (useStorage) {
  8900. delete storageData[key];
  8901. env_1.target.chrome.storage.local.remove([key]);
  8902. } else {
  8903. try {
  8904. localStorage.removeItem(key);
  8905. } catch (e2) {
  8906. }
  8907. }
  8908. }
  8909. exports.removeStorage = removeStorage;
  8910. function clearStorage() {
  8911. checkStorage();
  8912. if (useStorage) {
  8913. storageData = {};
  8914. env_1.target.chrome.storage.local.clear();
  8915. } else {
  8916. try {
  8917. localStorage.clear();
  8918. } catch (e2) {
  8919. }
  8920. }
  8921. }
  8922. exports.clearStorage = clearStorage;
  8923. function checkStorage() {
  8924. if (!storageData) {
  8925. throw new Error("Storage wasn't initialized with 'init()'");
  8926. }
  8927. }
  8928. function getDefaultValue(value, defaultValue) {
  8929. if (value == null) {
  8930. return defaultValue;
  8931. }
  8932. return value;
  8933. }
  8934. }
  8935. ),
  8936. /***/
  8937. "../shared-utils/lib/transfer.js": (
  8938. /*!***************************************!*\
  8939. !*** ../shared-utils/lib/transfer.js ***!
  8940. \***************************************/
  8941. /***/
  8942. (__unused_webpack_module, exports) => {
  8943. Object.defineProperty(exports, "__esModule", {
  8944. value: true
  8945. });
  8946. exports.stringifyStrictCircularAutoChunks = exports.parseCircularAutoChunks = exports.stringifyCircularAutoChunks = void 0;
  8947. const MAX_SERIALIZED_SIZE = 512 * 1024;
  8948. function encode(data, replacer, list, seen) {
  8949. let stored, key, value, i2, l2;
  8950. const seenIndex = seen.get(data);
  8951. if (seenIndex != null) {
  8952. return seenIndex;
  8953. }
  8954. const index = list.length;
  8955. const proto = Object.prototype.toString.call(data);
  8956. if (proto === "[object Object]") {
  8957. stored = {};
  8958. seen.set(data, index);
  8959. list.push(stored);
  8960. const keys = Object.keys(data);
  8961. for (i2 = 0, l2 = keys.length; i2 < l2; i2++) {
  8962. key = keys[i2];
  8963. try {
  8964. value = data[key];
  8965. if (replacer)
  8966. value = replacer.call(data, key, value);
  8967. } catch (e2) {
  8968. value = e2;
  8969. }
  8970. stored[key] = encode(value, replacer, list, seen);
  8971. }
  8972. } else if (proto === "[object Array]") {
  8973. stored = [];
  8974. seen.set(data, index);
  8975. list.push(stored);
  8976. for (i2 = 0, l2 = data.length; i2 < l2; i2++) {
  8977. try {
  8978. value = data[i2];
  8979. if (replacer)
  8980. value = replacer.call(data, i2, value);
  8981. } catch (e2) {
  8982. value = e2;
  8983. }
  8984. stored[i2] = encode(value, replacer, list, seen);
  8985. }
  8986. } else {
  8987. list.push(data);
  8988. }
  8989. return index;
  8990. }
  8991. function decode(list, reviver) {
  8992. let i2 = list.length;
  8993. let j2, k, data, key, value, proto;
  8994. while (i2--) {
  8995. data = list[i2];
  8996. proto = Object.prototype.toString.call(data);
  8997. if (proto === "[object Object]") {
  8998. const keys = Object.keys(data);
  8999. for (j2 = 0, k = keys.length; j2 < k; j2++) {
  9000. key = keys[j2];
  9001. value = list[data[key]];
  9002. if (reviver)
  9003. value = reviver.call(data, key, value);
  9004. data[key] = value;
  9005. }
  9006. } else if (proto === "[object Array]") {
  9007. for (j2 = 0, k = data.length; j2 < k; j2++) {
  9008. value = list[data[j2]];
  9009. if (reviver)
  9010. value = reviver.call(data, j2, value);
  9011. data[j2] = value;
  9012. }
  9013. }
  9014. }
  9015. }
  9016. function stringifyCircularAutoChunks(data, replacer = null, space = null) {
  9017. let result;
  9018. try {
  9019. result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, replacer, space);
  9020. } catch (e2) {
  9021. result = stringifyStrictCircularAutoChunks(data, replacer, space);
  9022. }
  9023. if (result.length > MAX_SERIALIZED_SIZE) {
  9024. const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);
  9025. const chunks = [];
  9026. for (let i2 = 0; i2 < chunkCount; i2++) {
  9027. chunks.push(result.slice(i2 * MAX_SERIALIZED_SIZE, (i2 + 1) * MAX_SERIALIZED_SIZE));
  9028. }
  9029. return chunks;
  9030. }
  9031. return result;
  9032. }
  9033. exports.stringifyCircularAutoChunks = stringifyCircularAutoChunks;
  9034. function parseCircularAutoChunks(data, reviver = null) {
  9035. if (Array.isArray(data)) {
  9036. data = data.join("");
  9037. }
  9038. const hasCircular = /^\s/.test(data);
  9039. if (!hasCircular) {
  9040. return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver);
  9041. } else {
  9042. const list = JSON.parse(data);
  9043. decode(list, reviver);
  9044. return list[0];
  9045. }
  9046. }
  9047. exports.parseCircularAutoChunks = parseCircularAutoChunks;
  9048. function stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {
  9049. const list = [];
  9050. encode(data, replacer, list, /* @__PURE__ */ new Map());
  9051. return space ? " " + JSON.stringify(list, null, space) : " " + JSON.stringify(list);
  9052. }
  9053. exports.stringifyStrictCircularAutoChunks = stringifyStrictCircularAutoChunks;
  9054. }
  9055. ),
  9056. /***/
  9057. "../shared-utils/lib/util.js": (
  9058. /*!***********************************!*\
  9059. !*** ../shared-utils/lib/util.js ***!
  9060. \***********************************/
  9061. /***/
  9062. function(__unused_webpack_module, exports, __webpack_require__2) {
  9063. var __importDefault = this && this.__importDefault || function(mod) {
  9064. return mod && mod.__esModule ? mod : {
  9065. "default": mod
  9066. };
  9067. };
  9068. Object.defineProperty(exports, "__esModule", {
  9069. value: true
  9070. });
  9071. 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;
  9072. const path_1 = __importDefault(__webpack_require__2(
  9073. /*! path */
  9074. "../../node_modules/path-browserify/index.js"
  9075. ));
  9076. const transfer_1 = __webpack_require__2(
  9077. /*! ./transfer */
  9078. "../shared-utils/lib/transfer.js"
  9079. );
  9080. const backend_1 = __webpack_require__2(
  9081. /*! ./backend */
  9082. "../shared-utils/lib/backend.js"
  9083. );
  9084. const shared_data_1 = __webpack_require__2(
  9085. /*! ./shared-data */
  9086. "../shared-utils/lib/shared-data.js"
  9087. );
  9088. const env_1 = __webpack_require__2(
  9089. /*! ./env */
  9090. "../shared-utils/lib/env.js"
  9091. );
  9092. function cached(fn) {
  9093. const cache = /* @__PURE__ */ Object.create(null);
  9094. return function cachedFn(str) {
  9095. const hit = cache[str];
  9096. return hit || (cache[str] = fn(str));
  9097. };
  9098. }
  9099. const classifyRE = /(?:^|[-_/])(\w)/g;
  9100. exports.classify = cached((str) => {
  9101. return str && ("" + str).replace(classifyRE, toUpper);
  9102. });
  9103. const camelizeRE = /-(\w)/g;
  9104. exports.camelize = cached((str) => {
  9105. return str && str.replace(camelizeRE, toUpper);
  9106. });
  9107. const kebabizeRE = /([a-z0-9])([A-Z])/g;
  9108. exports.kebabize = cached((str) => {
  9109. return str && str.replace(kebabizeRE, (_2, lowerCaseCharacter, upperCaseLetter) => {
  9110. return `${lowerCaseCharacter}-${upperCaseLetter}`;
  9111. }).toLowerCase();
  9112. });
  9113. function toUpper(_2, c2) {
  9114. return c2 ? c2.toUpperCase() : "";
  9115. }
  9116. function getComponentDisplayName(originalName, style = "class") {
  9117. switch (style) {
  9118. case "class":
  9119. return (0, exports.classify)(originalName);
  9120. case "kebab":
  9121. return (0, exports.kebabize)(originalName);
  9122. case "original":
  9123. default:
  9124. return originalName;
  9125. }
  9126. }
  9127. exports.getComponentDisplayName = getComponentDisplayName;
  9128. function inDoc(node) {
  9129. if (!node)
  9130. return false;
  9131. const doc = node.ownerDocument.documentElement;
  9132. const parent = node.parentNode;
  9133. return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
  9134. }
  9135. exports.inDoc = inDoc;
  9136. exports.UNDEFINED = "__vue_devtool_undefined__";
  9137. exports.INFINITY = "__vue_devtool_infinity__";
  9138. exports.NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
  9139. exports.NAN = "__vue_devtool_nan__";
  9140. exports.SPECIAL_TOKENS = {
  9141. true: true,
  9142. false: false,
  9143. undefined: exports.UNDEFINED,
  9144. null: null,
  9145. "-Infinity": exports.NEGATIVE_INFINITY,
  9146. Infinity: exports.INFINITY,
  9147. NaN: exports.NAN
  9148. };
  9149. exports.MAX_STRING_SIZE = 1e4;
  9150. exports.MAX_ARRAY_SIZE = 5e3;
  9151. function specialTokenToString(value) {
  9152. if (value === null) {
  9153. return "null";
  9154. } else if (value === exports.UNDEFINED) {
  9155. return "undefined";
  9156. } else if (value === exports.NAN) {
  9157. return "NaN";
  9158. } else if (value === exports.INFINITY) {
  9159. return "Infinity";
  9160. } else if (value === exports.NEGATIVE_INFINITY) {
  9161. return "-Infinity";
  9162. }
  9163. return false;
  9164. }
  9165. exports.specialTokenToString = specialTokenToString;
  9166. class EncodeCache {
  9167. constructor() {
  9168. this.map = /* @__PURE__ */ new Map();
  9169. }
  9170. /**
  9171. * Returns a result unique to each input data
  9172. * @param {*} data Input data
  9173. * @param {*} factory Function used to create the unique result
  9174. */
  9175. cache(data, factory) {
  9176. const cached2 = this.map.get(data);
  9177. if (cached2) {
  9178. return cached2;
  9179. } else {
  9180. const result = factory(data);
  9181. this.map.set(data, result);
  9182. return result;
  9183. }
  9184. }
  9185. clear() {
  9186. this.map.clear();
  9187. }
  9188. }
  9189. const encodeCache = new EncodeCache();
  9190. class ReviveCache {
  9191. constructor(maxSize) {
  9192. this.maxSize = maxSize;
  9193. this.map = /* @__PURE__ */ new Map();
  9194. this.index = 0;
  9195. this.size = 0;
  9196. }
  9197. cache(value) {
  9198. const currentIndex = this.index;
  9199. this.map.set(currentIndex, value);
  9200. this.size++;
  9201. if (this.size > this.maxSize) {
  9202. this.map.delete(currentIndex - this.size);
  9203. this.size--;
  9204. }
  9205. this.index++;
  9206. return currentIndex;
  9207. }
  9208. read(id) {
  9209. return this.map.get(id);
  9210. }
  9211. }
  9212. const reviveCache = new ReviveCache(1e3);
  9213. const replacers = {
  9214. internal: replacerForInternal,
  9215. user: replaceForUser
  9216. };
  9217. function stringify(data, target = "internal") {
  9218. encodeCache.clear();
  9219. return (0, transfer_1.stringifyCircularAutoChunks)(data, replacers[target]);
  9220. }
  9221. exports.stringify = stringify;
  9222. function replacerForInternal(key) {
  9223. var _a;
  9224. const val = this[key];
  9225. const type = typeof val;
  9226. if (Array.isArray(val)) {
  9227. const l2 = val.length;
  9228. if (l2 > exports.MAX_ARRAY_SIZE) {
  9229. return {
  9230. _isArray: true,
  9231. length: l2,
  9232. items: val.slice(0, exports.MAX_ARRAY_SIZE)
  9233. };
  9234. }
  9235. return val;
  9236. } else if (typeof val === "string") {
  9237. if (val.length > exports.MAX_STRING_SIZE) {
  9238. return val.substring(0, exports.MAX_STRING_SIZE) + `... (${val.length} total length)`;
  9239. } else {
  9240. return val;
  9241. }
  9242. } else if (type === "undefined") {
  9243. return exports.UNDEFINED;
  9244. } else if (val === Infinity) {
  9245. return exports.INFINITY;
  9246. } else if (val === -Infinity) {
  9247. return exports.NEGATIVE_INFINITY;
  9248. } else if (type === "function") {
  9249. return getCustomFunctionDetails(val);
  9250. } else if (type === "symbol") {
  9251. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;
  9252. } else if (val !== null && type === "object") {
  9253. const proto = Object.prototype.toString.call(val);
  9254. if (proto === "[object Map]") {
  9255. return encodeCache.cache(val, () => getCustomMapDetails(val));
  9256. } else if (proto === "[object Set]") {
  9257. return encodeCache.cache(val, () => getCustomSetDetails(val));
  9258. } else if (proto === "[object RegExp]") {
  9259. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
  9260. } else if (proto === "[object Date]") {
  9261. return `[native Date ${Date.prototype.toString.call(val)}]`;
  9262. } else if (proto === "[object Error]") {
  9263. return `[native Error ${val.message}<>${val.stack}]`;
  9264. } else if (val.state && val._vm) {
  9265. return encodeCache.cache(val, () => (0, backend_1.getCustomStoreDetails)(val));
  9266. } else if (val.constructor && val.constructor.name === "VueRouter") {
  9267. return encodeCache.cache(val, () => (0, backend_1.getCustomRouterDetails)(val));
  9268. } else if ((0, backend_1.isVueInstance)(val)) {
  9269. return encodeCache.cache(val, () => (0, backend_1.getCustomInstanceDetails)(val));
  9270. } else if (typeof val.render === "function") {
  9271. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val));
  9272. } else if (val.constructor && val.constructor.name === "VNode") {
  9273. return `[native VNode <${val.tag}>]`;
  9274. } else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
  9275. return encodeCache.cache(val, () => getCustomHTMLElementDetails(val));
  9276. } else if (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) === "Store" && val._wrappedGetters) {
  9277. return `[object Store]`;
  9278. } else if (val.currentRoute) {
  9279. return `[object Router]`;
  9280. }
  9281. const customDetails = (0, backend_1.getCustomObjectDetails)(val, proto);
  9282. if (customDetails != null)
  9283. return customDetails;
  9284. } else if (Number.isNaN(val)) {
  9285. return exports.NAN;
  9286. }
  9287. return sanitize(val);
  9288. }
  9289. function replaceForUser(key) {
  9290. let val = this[key];
  9291. const type = typeof val;
  9292. if ((val === null || val === void 0 ? void 0 : val._custom) && "value" in val._custom) {
  9293. val = val._custom.value;
  9294. }
  9295. if (type !== "object") {
  9296. if (val === exports.UNDEFINED) {
  9297. return void 0;
  9298. } else if (val === exports.INFINITY) {
  9299. return Infinity;
  9300. } else if (val === exports.NEGATIVE_INFINITY) {
  9301. return -Infinity;
  9302. } else if (val === exports.NAN) {
  9303. return NaN;
  9304. }
  9305. return val;
  9306. }
  9307. return sanitize(val);
  9308. }
  9309. function getCustomMapDetails(val) {
  9310. const list = [];
  9311. val.forEach((value, key) => list.push({
  9312. key,
  9313. value
  9314. }));
  9315. return {
  9316. _custom: {
  9317. type: "map",
  9318. display: "Map",
  9319. value: list,
  9320. readOnly: true,
  9321. fields: {
  9322. abstract: true
  9323. }
  9324. }
  9325. };
  9326. }
  9327. exports.getCustomMapDetails = getCustomMapDetails;
  9328. function reviveMap(val) {
  9329. const result = /* @__PURE__ */ new Map();
  9330. const list = val._custom.value;
  9331. for (let i2 = 0; i2 < list.length; i2++) {
  9332. const {
  9333. key,
  9334. value
  9335. } = list[i2];
  9336. result.set(key, revive(value));
  9337. }
  9338. return result;
  9339. }
  9340. exports.reviveMap = reviveMap;
  9341. function getCustomSetDetails(val) {
  9342. const list = Array.from(val);
  9343. return {
  9344. _custom: {
  9345. type: "set",
  9346. display: `Set[${list.length}]`,
  9347. value: list,
  9348. readOnly: true
  9349. }
  9350. };
  9351. }
  9352. exports.getCustomSetDetails = getCustomSetDetails;
  9353. function reviveSet(val) {
  9354. const result = /* @__PURE__ */ new Set();
  9355. const list = val._custom.value;
  9356. for (let i2 = 0; i2 < list.length; i2++) {
  9357. const value = list[i2];
  9358. result.add(revive(value));
  9359. }
  9360. return result;
  9361. }
  9362. exports.reviveSet = reviveSet;
  9363. function basename(filename, ext) {
  9364. return path_1.default.basename(filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/"), ext);
  9365. }
  9366. function getComponentName(options) {
  9367. const name = options.displayName || options.name || options._componentTag;
  9368. if (name) {
  9369. return name;
  9370. }
  9371. const file = options.__file;
  9372. if (file) {
  9373. return (0, exports.classify)(basename(file, ".vue"));
  9374. }
  9375. }
  9376. exports.getComponentName = getComponentName;
  9377. function getCustomComponentDefinitionDetails(def) {
  9378. let display = getComponentName(def);
  9379. if (display) {
  9380. if (def.name && def.__file) {
  9381. display += ` <span>(${def.__file})</span>`;
  9382. }
  9383. } else {
  9384. display = "<i>Unknown Component</i>";
  9385. }
  9386. return {
  9387. _custom: {
  9388. type: "component-definition",
  9389. display,
  9390. tooltip: "Component definition",
  9391. ...def.__file ? {
  9392. file: def.__file
  9393. } : {}
  9394. }
  9395. };
  9396. }
  9397. exports.getCustomComponentDefinitionDetails = getCustomComponentDefinitionDetails;
  9398. function getCustomFunctionDetails(func) {
  9399. let string = "";
  9400. let matches = null;
  9401. try {
  9402. string = Function.prototype.toString.call(func);
  9403. matches = String.prototype.match.call(string, /\([\s\S]*?\)/);
  9404. } catch (e2) {
  9405. }
  9406. const match = matches && matches[0];
  9407. const args = typeof match === "string" ? match : "(?)";
  9408. const name = typeof func.name === "string" ? func.name : "";
  9409. return {
  9410. _custom: {
  9411. type: "function",
  9412. display: `<span style="opacity:.5;">function</span> ${escape2(name)}${args}`,
  9413. tooltip: string.trim() ? `<pre>${string}</pre>` : null,
  9414. _reviveId: reviveCache.cache(func)
  9415. }
  9416. };
  9417. }
  9418. exports.getCustomFunctionDetails = getCustomFunctionDetails;
  9419. function getCustomHTMLElementDetails(value) {
  9420. try {
  9421. return {
  9422. _custom: {
  9423. type: "HTMLElement",
  9424. display: `<span class="opacity-30">&lt;</span><span class="text-blue-500">${value.tagName.toLowerCase()}</span><span class="opacity-30">&gt;</span>`,
  9425. value: namedNodeMapToObject(value.attributes),
  9426. actions: [{
  9427. icon: "input",
  9428. tooltip: "Log element to console",
  9429. action: () => {
  9430. console.log(value);
  9431. }
  9432. }]
  9433. }
  9434. };
  9435. } catch (e2) {
  9436. return {
  9437. _custom: {
  9438. type: "HTMLElement",
  9439. display: `<span class="text-blue-500">${String(value)}</span>`
  9440. }
  9441. };
  9442. }
  9443. }
  9444. exports.getCustomHTMLElementDetails = getCustomHTMLElementDetails;
  9445. function namedNodeMapToObject(map) {
  9446. const result = {};
  9447. const l2 = map.length;
  9448. for (let i2 = 0; i2 < l2; i2++) {
  9449. const node = map.item(i2);
  9450. result[node.name] = node.value;
  9451. }
  9452. return result;
  9453. }
  9454. function getCustomRefDetails(instance, key, ref) {
  9455. let value;
  9456. if (Array.isArray(ref)) {
  9457. value = ref.map((r2) => getCustomRefDetails(instance, key, r2)).map((data) => data.value);
  9458. } else {
  9459. let name;
  9460. if (ref._isVue) {
  9461. name = getComponentName(ref.$options);
  9462. } else {
  9463. name = ref.tagName.toLowerCase();
  9464. }
  9465. value = {
  9466. _custom: {
  9467. display: `&lt;${name}` + (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : "") + (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : "") + "&gt;",
  9468. uid: instance.__VUE_DEVTOOLS_UID__,
  9469. type: "reference"
  9470. }
  9471. };
  9472. }
  9473. return {
  9474. type: "$refs",
  9475. key,
  9476. value,
  9477. editable: false
  9478. };
  9479. }
  9480. exports.getCustomRefDetails = getCustomRefDetails;
  9481. function parse2(data, revive2 = false) {
  9482. return revive2 ? (0, transfer_1.parseCircularAutoChunks)(data, reviver) : (0, transfer_1.parseCircularAutoChunks)(data);
  9483. }
  9484. exports.parse = parse2;
  9485. const specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
  9486. const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
  9487. function reviver(key, val) {
  9488. return revive(val);
  9489. }
  9490. function revive(val) {
  9491. if (val === exports.UNDEFINED) {
  9492. return void 0;
  9493. } else if (val === exports.INFINITY) {
  9494. return Infinity;
  9495. } else if (val === exports.NEGATIVE_INFINITY) {
  9496. return -Infinity;
  9497. } else if (val === exports.NAN) {
  9498. return NaN;
  9499. } else if (val && val._custom) {
  9500. const {
  9501. _custom: custom
  9502. } = val;
  9503. if (custom.type === "component") {
  9504. return (0, backend_1.getInstanceMap)().get(custom.id);
  9505. } else if (custom.type === "map") {
  9506. return reviveMap(val);
  9507. } else if (custom.type === "set") {
  9508. return reviveSet(val);
  9509. } else if (custom._reviveId) {
  9510. return reviveCache.read(custom._reviveId);
  9511. } else {
  9512. return revive(custom.value);
  9513. }
  9514. } else if (symbolRE.test(val)) {
  9515. const [, string] = symbolRE.exec(val);
  9516. return Symbol.for(string);
  9517. } else if (specialTypeRE.test(val)) {
  9518. const [, type, string, , details] = specialTypeRE.exec(val);
  9519. const result = new env_1.target[type](string);
  9520. if (type === "Error" && details) {
  9521. result.stack = details;
  9522. }
  9523. return result;
  9524. } else {
  9525. return val;
  9526. }
  9527. }
  9528. exports.revive = revive;
  9529. function sanitize(data) {
  9530. if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {
  9531. return Object.prototype.toString.call(data);
  9532. } else {
  9533. return data;
  9534. }
  9535. }
  9536. function isPlainObject(obj) {
  9537. return Object.prototype.toString.call(obj) === "[object Object]";
  9538. }
  9539. exports.isPlainObject = isPlainObject;
  9540. function isPrimitive(data) {
  9541. if (data == null) {
  9542. return true;
  9543. }
  9544. const type = typeof data;
  9545. return type === "string" || type === "number" || type === "boolean";
  9546. }
  9547. function searchDeepInObject(obj, searchTerm) {
  9548. const seen = /* @__PURE__ */ new Map();
  9549. const result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0);
  9550. seen.clear();
  9551. return result;
  9552. }
  9553. exports.searchDeepInObject = searchDeepInObject;
  9554. const SEARCH_MAX_DEPTH = 10;
  9555. function internalSearchObject(obj, searchTerm, seen, depth) {
  9556. if (depth > SEARCH_MAX_DEPTH) {
  9557. return false;
  9558. }
  9559. let match = false;
  9560. const keys = Object.keys(obj);
  9561. let key, value;
  9562. for (let i2 = 0; i2 < keys.length; i2++) {
  9563. key = keys[i2];
  9564. value = obj[key];
  9565. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1);
  9566. if (match) {
  9567. break;
  9568. }
  9569. }
  9570. return match;
  9571. }
  9572. function internalSearchArray(array, searchTerm, seen, depth) {
  9573. if (depth > SEARCH_MAX_DEPTH) {
  9574. return false;
  9575. }
  9576. let match = false;
  9577. let value;
  9578. for (let i2 = 0; i2 < array.length; i2++) {
  9579. value = array[i2];
  9580. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1);
  9581. if (match) {
  9582. break;
  9583. }
  9584. }
  9585. return match;
  9586. }
  9587. function internalSearchCheck(searchTerm, key, value, seen, depth) {
  9588. let match = false;
  9589. let result;
  9590. if (key === "_custom") {
  9591. key = value.display;
  9592. value = value.value;
  9593. }
  9594. (result = specialTokenToString(value)) && (value = result);
  9595. if (key && compare(key, searchTerm)) {
  9596. match = true;
  9597. seen.set(value, true);
  9598. } else if (seen.has(value)) {
  9599. match = seen.get(value);
  9600. } else if (Array.isArray(value)) {
  9601. seen.set(value, null);
  9602. match = internalSearchArray(value, searchTerm, seen, depth);
  9603. seen.set(value, match);
  9604. } else if (isPlainObject(value)) {
  9605. seen.set(value, null);
  9606. match = internalSearchObject(value, searchTerm, seen, depth);
  9607. seen.set(value, match);
  9608. } else if (compare(value, searchTerm)) {
  9609. match = true;
  9610. seen.set(value, true);
  9611. }
  9612. return match;
  9613. }
  9614. function compare(value, searchTerm) {
  9615. return ("" + value).toLowerCase().indexOf(searchTerm) !== -1;
  9616. }
  9617. function sortByKey(state) {
  9618. return state && state.slice().sort((a2, b2) => {
  9619. if (a2.key < b2.key)
  9620. return -1;
  9621. if (a2.key > b2.key)
  9622. return 1;
  9623. return 0;
  9624. });
  9625. }
  9626. exports.sortByKey = sortByKey;
  9627. function simpleGet(object, path) {
  9628. const sections = Array.isArray(path) ? path : path.split(".");
  9629. for (let i2 = 0; i2 < sections.length; i2++) {
  9630. object = object[sections[i2]];
  9631. if (!object) {
  9632. return void 0;
  9633. }
  9634. }
  9635. return object;
  9636. }
  9637. exports.simpleGet = simpleGet;
  9638. function focusInput(el) {
  9639. el.focus();
  9640. el.setSelectionRange(0, el.value.length);
  9641. }
  9642. exports.focusInput = focusInput;
  9643. function openInEditor(file) {
  9644. const fileName = file.replace(/\\/g, "\\\\");
  9645. const src = `fetch('${shared_data_1.SharedData.openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  9646. if (response.ok) {
  9647. console.log('File ${fileName} opened in editor')
  9648. } else {
  9649. const msg = 'Opening component ${fileName} failed'
  9650. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  9651. if (target.__VUE_DEVTOOLS_TOAST__) {
  9652. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  9653. } else {
  9654. console.log('%c' + msg, 'color:red')
  9655. }
  9656. console.log('Check the setup of your project, see https://devtools.vuejs.org/guide/open-in-editor.html')
  9657. }
  9658. })`;
  9659. if (env_1.isChrome) {
  9660. env_1.target.chrome.devtools.inspectedWindow.eval(src);
  9661. } else {
  9662. [eval][0](src);
  9663. }
  9664. }
  9665. exports.openInEditor = openInEditor;
  9666. const ESC = {
  9667. "<": "&lt;",
  9668. ">": "&gt;",
  9669. '"': "&quot;",
  9670. "&": "&amp;"
  9671. };
  9672. function escape2(s2) {
  9673. return s2.replace(/[<>"&]/g, escapeChar);
  9674. }
  9675. exports.escape = escape2;
  9676. function escapeChar(a2) {
  9677. return ESC[a2] || a2;
  9678. }
  9679. function copyToClipboard(state) {
  9680. let text;
  9681. if (typeof state !== "object") {
  9682. text = String(state);
  9683. } else {
  9684. text = stringify(state, "user");
  9685. }
  9686. if (typeof document === "undefined")
  9687. return;
  9688. const dummyTextArea = document.createElement("textarea");
  9689. dummyTextArea.textContent = text;
  9690. document.body.appendChild(dummyTextArea);
  9691. dummyTextArea.select();
  9692. document.execCommand("copy");
  9693. document.body.removeChild(dummyTextArea);
  9694. }
  9695. exports.copyToClipboard = copyToClipboard;
  9696. function isEmptyObject(obj) {
  9697. return obj === exports.UNDEFINED || !obj || Object.keys(obj).length === 0;
  9698. }
  9699. exports.isEmptyObject = isEmptyObject;
  9700. }
  9701. ),
  9702. /***/
  9703. "../../node_modules/events/events.js": (
  9704. /*!*******************************************!*\
  9705. !*** ../../node_modules/events/events.js ***!
  9706. \*******************************************/
  9707. /***/
  9708. (module) => {
  9709. var R2 = typeof Reflect === "object" ? Reflect : null;
  9710. var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
  9711. return Function.prototype.apply.call(target, receiver, args);
  9712. };
  9713. var ReflectOwnKeys;
  9714. if (R2 && typeof R2.ownKeys === "function") {
  9715. ReflectOwnKeys = R2.ownKeys;
  9716. } else if (Object.getOwnPropertySymbols) {
  9717. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  9718. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  9719. };
  9720. } else {
  9721. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  9722. return Object.getOwnPropertyNames(target);
  9723. };
  9724. }
  9725. function ProcessEmitWarning(warning) {
  9726. if (console && console.warn)
  9727. console.warn(warning);
  9728. }
  9729. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  9730. return value !== value;
  9731. };
  9732. function EventEmitter() {
  9733. EventEmitter.init.call(this);
  9734. }
  9735. module.exports = EventEmitter;
  9736. module.exports.once = once;
  9737. EventEmitter.EventEmitter = EventEmitter;
  9738. EventEmitter.prototype._events = void 0;
  9739. EventEmitter.prototype._eventsCount = 0;
  9740. EventEmitter.prototype._maxListeners = void 0;
  9741. var defaultMaxListeners = 10;
  9742. function checkListener(listener) {
  9743. if (typeof listener !== "function") {
  9744. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  9745. }
  9746. }
  9747. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  9748. enumerable: true,
  9749. get: function() {
  9750. return defaultMaxListeners;
  9751. },
  9752. set: function(arg) {
  9753. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  9754. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  9755. }
  9756. defaultMaxListeners = arg;
  9757. }
  9758. });
  9759. EventEmitter.init = function() {
  9760. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  9761. this._events = /* @__PURE__ */ Object.create(null);
  9762. this._eventsCount = 0;
  9763. }
  9764. this._maxListeners = this._maxListeners || void 0;
  9765. };
  9766. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n2) {
  9767. if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
  9768. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
  9769. }
  9770. this._maxListeners = n2;
  9771. return this;
  9772. };
  9773. function _getMaxListeners(that) {
  9774. if (that._maxListeners === void 0)
  9775. return EventEmitter.defaultMaxListeners;
  9776. return that._maxListeners;
  9777. }
  9778. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  9779. return _getMaxListeners(this);
  9780. };
  9781. EventEmitter.prototype.emit = function emit(type) {
  9782. var args = [];
  9783. for (var i2 = 1; i2 < arguments.length; i2++)
  9784. args.push(arguments[i2]);
  9785. var doError = type === "error";
  9786. var events = this._events;
  9787. if (events !== void 0)
  9788. doError = doError && events.error === void 0;
  9789. else if (!doError)
  9790. return false;
  9791. if (doError) {
  9792. var er;
  9793. if (args.length > 0)
  9794. er = args[0];
  9795. if (er instanceof Error) {
  9796. throw er;
  9797. }
  9798. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  9799. err.context = er;
  9800. throw err;
  9801. }
  9802. var handler = events[type];
  9803. if (handler === void 0)
  9804. return false;
  9805. if (typeof handler === "function") {
  9806. ReflectApply(handler, this, args);
  9807. } else {
  9808. var len = handler.length;
  9809. var listeners = arrayClone(handler, len);
  9810. for (var i2 = 0; i2 < len; ++i2)
  9811. ReflectApply(listeners[i2], this, args);
  9812. }
  9813. return true;
  9814. };
  9815. function _addListener(target, type, listener, prepend) {
  9816. var m2;
  9817. var events;
  9818. var existing;
  9819. checkListener(listener);
  9820. events = target._events;
  9821. if (events === void 0) {
  9822. events = target._events = /* @__PURE__ */ Object.create(null);
  9823. target._eventsCount = 0;
  9824. } else {
  9825. if (events.newListener !== void 0) {
  9826. target.emit(
  9827. "newListener",
  9828. type,
  9829. listener.listener ? listener.listener : listener
  9830. );
  9831. events = target._events;
  9832. }
  9833. existing = events[type];
  9834. }
  9835. if (existing === void 0) {
  9836. existing = events[type] = listener;
  9837. ++target._eventsCount;
  9838. } else {
  9839. if (typeof existing === "function") {
  9840. existing = events[type] = prepend ? [listener, existing] : [existing, listener];
  9841. } else if (prepend) {
  9842. existing.unshift(listener);
  9843. } else {
  9844. existing.push(listener);
  9845. }
  9846. m2 = _getMaxListeners(target);
  9847. if (m2 > 0 && existing.length > m2 && !existing.warned) {
  9848. existing.warned = true;
  9849. var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  9850. w2.name = "MaxListenersExceededWarning";
  9851. w2.emitter = target;
  9852. w2.type = type;
  9853. w2.count = existing.length;
  9854. ProcessEmitWarning(w2);
  9855. }
  9856. }
  9857. return target;
  9858. }
  9859. EventEmitter.prototype.addListener = function addListener(type, listener) {
  9860. return _addListener(this, type, listener, false);
  9861. };
  9862. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  9863. EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  9864. return _addListener(this, type, listener, true);
  9865. };
  9866. function onceWrapper() {
  9867. if (!this.fired) {
  9868. this.target.removeListener(this.type, this.wrapFn);
  9869. this.fired = true;
  9870. if (arguments.length === 0)
  9871. return this.listener.call(this.target);
  9872. return this.listener.apply(this.target, arguments);
  9873. }
  9874. }
  9875. function _onceWrap(target, type, listener) {
  9876. var state = { fired: false, wrapFn: void 0, target, type, listener };
  9877. var wrapped = onceWrapper.bind(state);
  9878. wrapped.listener = listener;
  9879. state.wrapFn = wrapped;
  9880. return wrapped;
  9881. }
  9882. EventEmitter.prototype.once = function once2(type, listener) {
  9883. checkListener(listener);
  9884. this.on(type, _onceWrap(this, type, listener));
  9885. return this;
  9886. };
  9887. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  9888. checkListener(listener);
  9889. this.prependListener(type, _onceWrap(this, type, listener));
  9890. return this;
  9891. };
  9892. EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  9893. var list, events, position, i2, originalListener;
  9894. checkListener(listener);
  9895. events = this._events;
  9896. if (events === void 0)
  9897. return this;
  9898. list = events[type];
  9899. if (list === void 0)
  9900. return this;
  9901. if (list === listener || list.listener === listener) {
  9902. if (--this._eventsCount === 0)
  9903. this._events = /* @__PURE__ */ Object.create(null);
  9904. else {
  9905. delete events[type];
  9906. if (events.removeListener)
  9907. this.emit("removeListener", type, list.listener || listener);
  9908. }
  9909. } else if (typeof list !== "function") {
  9910. position = -1;
  9911. for (i2 = list.length - 1; i2 >= 0; i2--) {
  9912. if (list[i2] === listener || list[i2].listener === listener) {
  9913. originalListener = list[i2].listener;
  9914. position = i2;
  9915. break;
  9916. }
  9917. }
  9918. if (position < 0)
  9919. return this;
  9920. if (position === 0)
  9921. list.shift();
  9922. else {
  9923. spliceOne(list, position);
  9924. }
  9925. if (list.length === 1)
  9926. events[type] = list[0];
  9927. if (events.removeListener !== void 0)
  9928. this.emit("removeListener", type, originalListener || listener);
  9929. }
  9930. return this;
  9931. };
  9932. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  9933. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  9934. var listeners, events, i2;
  9935. events = this._events;
  9936. if (events === void 0)
  9937. return this;
  9938. if (events.removeListener === void 0) {
  9939. if (arguments.length === 0) {
  9940. this._events = /* @__PURE__ */ Object.create(null);
  9941. this._eventsCount = 0;
  9942. } else if (events[type] !== void 0) {
  9943. if (--this._eventsCount === 0)
  9944. this._events = /* @__PURE__ */ Object.create(null);
  9945. else
  9946. delete events[type];
  9947. }
  9948. return this;
  9949. }
  9950. if (arguments.length === 0) {
  9951. var keys = Object.keys(events);
  9952. var key;
  9953. for (i2 = 0; i2 < keys.length; ++i2) {
  9954. key = keys[i2];
  9955. if (key === "removeListener")
  9956. continue;
  9957. this.removeAllListeners(key);
  9958. }
  9959. this.removeAllListeners("removeListener");
  9960. this._events = /* @__PURE__ */ Object.create(null);
  9961. this._eventsCount = 0;
  9962. return this;
  9963. }
  9964. listeners = events[type];
  9965. if (typeof listeners === "function") {
  9966. this.removeListener(type, listeners);
  9967. } else if (listeners !== void 0) {
  9968. for (i2 = listeners.length - 1; i2 >= 0; i2--) {
  9969. this.removeListener(type, listeners[i2]);
  9970. }
  9971. }
  9972. return this;
  9973. };
  9974. function _listeners(target, type, unwrap) {
  9975. var events = target._events;
  9976. if (events === void 0)
  9977. return [];
  9978. var evlistener = events[type];
  9979. if (evlistener === void 0)
  9980. return [];
  9981. if (typeof evlistener === "function")
  9982. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  9983. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  9984. }
  9985. EventEmitter.prototype.listeners = function listeners(type) {
  9986. return _listeners(this, type, true);
  9987. };
  9988. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  9989. return _listeners(this, type, false);
  9990. };
  9991. EventEmitter.listenerCount = function(emitter, type) {
  9992. if (typeof emitter.listenerCount === "function") {
  9993. return emitter.listenerCount(type);
  9994. } else {
  9995. return listenerCount.call(emitter, type);
  9996. }
  9997. };
  9998. EventEmitter.prototype.listenerCount = listenerCount;
  9999. function listenerCount(type) {
  10000. var events = this._events;
  10001. if (events !== void 0) {
  10002. var evlistener = events[type];
  10003. if (typeof evlistener === "function") {
  10004. return 1;
  10005. } else if (evlistener !== void 0) {
  10006. return evlistener.length;
  10007. }
  10008. }
  10009. return 0;
  10010. }
  10011. EventEmitter.prototype.eventNames = function eventNames() {
  10012. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  10013. };
  10014. function arrayClone(arr, n2) {
  10015. var copy = new Array(n2);
  10016. for (var i2 = 0; i2 < n2; ++i2)
  10017. copy[i2] = arr[i2];
  10018. return copy;
  10019. }
  10020. function spliceOne(list, index) {
  10021. for (; index + 1 < list.length; index++)
  10022. list[index] = list[index + 1];
  10023. list.pop();
  10024. }
  10025. function unwrapListeners(arr) {
  10026. var ret = new Array(arr.length);
  10027. for (var i2 = 0; i2 < ret.length; ++i2) {
  10028. ret[i2] = arr[i2].listener || arr[i2];
  10029. }
  10030. return ret;
  10031. }
  10032. function once(emitter, name) {
  10033. return new Promise(function(resolve, reject) {
  10034. function errorListener(err) {
  10035. emitter.removeListener(name, resolver);
  10036. reject(err);
  10037. }
  10038. function resolver() {
  10039. if (typeof emitter.removeListener === "function") {
  10040. emitter.removeListener("error", errorListener);
  10041. }
  10042. resolve([].slice.call(arguments));
  10043. }
  10044. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  10045. if (name !== "error") {
  10046. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  10047. }
  10048. });
  10049. }
  10050. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  10051. if (typeof emitter.on === "function") {
  10052. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  10053. }
  10054. }
  10055. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  10056. if (typeof emitter.on === "function") {
  10057. if (flags.once) {
  10058. emitter.once(name, listener);
  10059. } else {
  10060. emitter.on(name, listener);
  10061. }
  10062. } else if (typeof emitter.addEventListener === "function") {
  10063. emitter.addEventListener(name, function wrapListener(arg) {
  10064. if (flags.once) {
  10065. emitter.removeEventListener(name, wrapListener);
  10066. }
  10067. listener(arg);
  10068. });
  10069. } else {
  10070. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  10071. }
  10072. }
  10073. }
  10074. ),
  10075. /***/
  10076. "../../node_modules/lodash/_Symbol.js": (
  10077. /*!********************************************!*\
  10078. !*** ../../node_modules/lodash/_Symbol.js ***!
  10079. \********************************************/
  10080. /***/
  10081. (module, __unused_webpack_exports, __webpack_require__2) => {
  10082. var root = __webpack_require__2(
  10083. /*! ./_root */
  10084. "../../node_modules/lodash/_root.js"
  10085. );
  10086. var Symbol2 = root.Symbol;
  10087. module.exports = Symbol2;
  10088. }
  10089. ),
  10090. /***/
  10091. "../../node_modules/lodash/_baseGetTag.js": (
  10092. /*!************************************************!*\
  10093. !*** ../../node_modules/lodash/_baseGetTag.js ***!
  10094. \************************************************/
  10095. /***/
  10096. (module, __unused_webpack_exports, __webpack_require__2) => {
  10097. var Symbol2 = __webpack_require__2(
  10098. /*! ./_Symbol */
  10099. "../../node_modules/lodash/_Symbol.js"
  10100. ), getRawTag = __webpack_require__2(
  10101. /*! ./_getRawTag */
  10102. "../../node_modules/lodash/_getRawTag.js"
  10103. ), objectToString = __webpack_require__2(
  10104. /*! ./_objectToString */
  10105. "../../node_modules/lodash/_objectToString.js"
  10106. );
  10107. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  10108. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  10109. function baseGetTag(value) {
  10110. if (value == null) {
  10111. return value === void 0 ? undefinedTag : nullTag;
  10112. }
  10113. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  10114. }
  10115. module.exports = baseGetTag;
  10116. }
  10117. ),
  10118. /***/
  10119. "../../node_modules/lodash/_baseTrim.js": (
  10120. /*!**********************************************!*\
  10121. !*** ../../node_modules/lodash/_baseTrim.js ***!
  10122. \**********************************************/
  10123. /***/
  10124. (module, __unused_webpack_exports, __webpack_require__2) => {
  10125. var trimmedEndIndex = __webpack_require__2(
  10126. /*! ./_trimmedEndIndex */
  10127. "../../node_modules/lodash/_trimmedEndIndex.js"
  10128. );
  10129. var reTrimStart = /^\s+/;
  10130. function baseTrim(string) {
  10131. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  10132. }
  10133. module.exports = baseTrim;
  10134. }
  10135. ),
  10136. /***/
  10137. "../../node_modules/lodash/_freeGlobal.js": (
  10138. /*!************************************************!*\
  10139. !*** ../../node_modules/lodash/_freeGlobal.js ***!
  10140. \************************************************/
  10141. /***/
  10142. (module, __unused_webpack_exports, __webpack_require__2) => {
  10143. var freeGlobal = typeof __webpack_require__2.g == "object" && __webpack_require__2.g && __webpack_require__2.g.Object === Object && __webpack_require__2.g;
  10144. module.exports = freeGlobal;
  10145. }
  10146. ),
  10147. /***/
  10148. "../../node_modules/lodash/_getRawTag.js": (
  10149. /*!***********************************************!*\
  10150. !*** ../../node_modules/lodash/_getRawTag.js ***!
  10151. \***********************************************/
  10152. /***/
  10153. (module, __unused_webpack_exports, __webpack_require__2) => {
  10154. var Symbol2 = __webpack_require__2(
  10155. /*! ./_Symbol */
  10156. "../../node_modules/lodash/_Symbol.js"
  10157. );
  10158. var objectProto = Object.prototype;
  10159. var hasOwnProperty2 = objectProto.hasOwnProperty;
  10160. var nativeObjectToString = objectProto.toString;
  10161. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  10162. function getRawTag(value) {
  10163. var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
  10164. try {
  10165. value[symToStringTag] = void 0;
  10166. var unmasked = true;
  10167. } catch (e2) {
  10168. }
  10169. var result = nativeObjectToString.call(value);
  10170. if (unmasked) {
  10171. if (isOwn) {
  10172. value[symToStringTag] = tag;
  10173. } else {
  10174. delete value[symToStringTag];
  10175. }
  10176. }
  10177. return result;
  10178. }
  10179. module.exports = getRawTag;
  10180. }
  10181. ),
  10182. /***/
  10183. "../../node_modules/lodash/_objectToString.js": (
  10184. /*!****************************************************!*\
  10185. !*** ../../node_modules/lodash/_objectToString.js ***!
  10186. \****************************************************/
  10187. /***/
  10188. (module) => {
  10189. var objectProto = Object.prototype;
  10190. var nativeObjectToString = objectProto.toString;
  10191. function objectToString(value) {
  10192. return nativeObjectToString.call(value);
  10193. }
  10194. module.exports = objectToString;
  10195. }
  10196. ),
  10197. /***/
  10198. "../../node_modules/lodash/_root.js": (
  10199. /*!******************************************!*\
  10200. !*** ../../node_modules/lodash/_root.js ***!
  10201. \******************************************/
  10202. /***/
  10203. (module, __unused_webpack_exports, __webpack_require__2) => {
  10204. var freeGlobal = __webpack_require__2(
  10205. /*! ./_freeGlobal */
  10206. "../../node_modules/lodash/_freeGlobal.js"
  10207. );
  10208. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  10209. var root = freeGlobal || freeSelf || Function("return this")();
  10210. module.exports = root;
  10211. }
  10212. ),
  10213. /***/
  10214. "../../node_modules/lodash/_trimmedEndIndex.js": (
  10215. /*!*****************************************************!*\
  10216. !*** ../../node_modules/lodash/_trimmedEndIndex.js ***!
  10217. \*****************************************************/
  10218. /***/
  10219. (module) => {
  10220. var reWhitespace = /\s/;
  10221. function trimmedEndIndex(string) {
  10222. var index = string.length;
  10223. while (index-- && reWhitespace.test(string.charAt(index))) {
  10224. }
  10225. return index;
  10226. }
  10227. module.exports = trimmedEndIndex;
  10228. }
  10229. ),
  10230. /***/
  10231. "../../node_modules/lodash/debounce.js": (
  10232. /*!*********************************************!*\
  10233. !*** ../../node_modules/lodash/debounce.js ***!
  10234. \*********************************************/
  10235. /***/
  10236. (module, __unused_webpack_exports, __webpack_require__2) => {
  10237. var isObject2 = __webpack_require__2(
  10238. /*! ./isObject */
  10239. "../../node_modules/lodash/isObject.js"
  10240. ), now = __webpack_require__2(
  10241. /*! ./now */
  10242. "../../node_modules/lodash/now.js"
  10243. ), toNumber = __webpack_require__2(
  10244. /*! ./toNumber */
  10245. "../../node_modules/lodash/toNumber.js"
  10246. );
  10247. var FUNC_ERROR_TEXT = "Expected a function";
  10248. var nativeMax = Math.max, nativeMin = Math.min;
  10249. function debounce(func, wait, options) {
  10250. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  10251. if (typeof func != "function") {
  10252. throw new TypeError(FUNC_ERROR_TEXT);
  10253. }
  10254. wait = toNumber(wait) || 0;
  10255. if (isObject2(options)) {
  10256. leading = !!options.leading;
  10257. maxing = "maxWait" in options;
  10258. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10259. trailing = "trailing" in options ? !!options.trailing : trailing;
  10260. }
  10261. function invokeFunc(time) {
  10262. var args = lastArgs, thisArg = lastThis;
  10263. lastArgs = lastThis = void 0;
  10264. lastInvokeTime = time;
  10265. result = func.apply(thisArg, args);
  10266. return result;
  10267. }
  10268. function leadingEdge(time) {
  10269. lastInvokeTime = time;
  10270. timerId = setTimeout(timerExpired, wait);
  10271. return leading ? invokeFunc(time) : result;
  10272. }
  10273. function remainingWait(time) {
  10274. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  10275. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  10276. }
  10277. function shouldInvoke(time) {
  10278. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  10279. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  10280. }
  10281. function timerExpired() {
  10282. var time = now();
  10283. if (shouldInvoke(time)) {
  10284. return trailingEdge(time);
  10285. }
  10286. timerId = setTimeout(timerExpired, remainingWait(time));
  10287. }
  10288. function trailingEdge(time) {
  10289. timerId = void 0;
  10290. if (trailing && lastArgs) {
  10291. return invokeFunc(time);
  10292. }
  10293. lastArgs = lastThis = void 0;
  10294. return result;
  10295. }
  10296. function cancel() {
  10297. if (timerId !== void 0) {
  10298. clearTimeout(timerId);
  10299. }
  10300. lastInvokeTime = 0;
  10301. lastArgs = lastCallTime = lastThis = timerId = void 0;
  10302. }
  10303. function flush() {
  10304. return timerId === void 0 ? result : trailingEdge(now());
  10305. }
  10306. function debounced() {
  10307. var time = now(), isInvoking = shouldInvoke(time);
  10308. lastArgs = arguments;
  10309. lastThis = this;
  10310. lastCallTime = time;
  10311. if (isInvoking) {
  10312. if (timerId === void 0) {
  10313. return leadingEdge(lastCallTime);
  10314. }
  10315. if (maxing) {
  10316. clearTimeout(timerId);
  10317. timerId = setTimeout(timerExpired, wait);
  10318. return invokeFunc(lastCallTime);
  10319. }
  10320. }
  10321. if (timerId === void 0) {
  10322. timerId = setTimeout(timerExpired, wait);
  10323. }
  10324. return result;
  10325. }
  10326. debounced.cancel = cancel;
  10327. debounced.flush = flush;
  10328. return debounced;
  10329. }
  10330. module.exports = debounce;
  10331. }
  10332. ),
  10333. /***/
  10334. "../../node_modules/lodash/isObject.js": (
  10335. /*!*********************************************!*\
  10336. !*** ../../node_modules/lodash/isObject.js ***!
  10337. \*********************************************/
  10338. /***/
  10339. (module) => {
  10340. function isObject2(value) {
  10341. var type = typeof value;
  10342. return value != null && (type == "object" || type == "function");
  10343. }
  10344. module.exports = isObject2;
  10345. }
  10346. ),
  10347. /***/
  10348. "../../node_modules/lodash/isObjectLike.js": (
  10349. /*!*************************************************!*\
  10350. !*** ../../node_modules/lodash/isObjectLike.js ***!
  10351. \*************************************************/
  10352. /***/
  10353. (module) => {
  10354. function isObjectLike(value) {
  10355. return value != null && typeof value == "object";
  10356. }
  10357. module.exports = isObjectLike;
  10358. }
  10359. ),
  10360. /***/
  10361. "../../node_modules/lodash/isSymbol.js": (
  10362. /*!*********************************************!*\
  10363. !*** ../../node_modules/lodash/isSymbol.js ***!
  10364. \*********************************************/
  10365. /***/
  10366. (module, __unused_webpack_exports, __webpack_require__2) => {
  10367. var baseGetTag = __webpack_require__2(
  10368. /*! ./_baseGetTag */
  10369. "../../node_modules/lodash/_baseGetTag.js"
  10370. ), isObjectLike = __webpack_require__2(
  10371. /*! ./isObjectLike */
  10372. "../../node_modules/lodash/isObjectLike.js"
  10373. );
  10374. var symbolTag = "[object Symbol]";
  10375. function isSymbol(value) {
  10376. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  10377. }
  10378. module.exports = isSymbol;
  10379. }
  10380. ),
  10381. /***/
  10382. "../../node_modules/lodash/now.js": (
  10383. /*!****************************************!*\
  10384. !*** ../../node_modules/lodash/now.js ***!
  10385. \****************************************/
  10386. /***/
  10387. (module, __unused_webpack_exports, __webpack_require__2) => {
  10388. var root = __webpack_require__2(
  10389. /*! ./_root */
  10390. "../../node_modules/lodash/_root.js"
  10391. );
  10392. var now = function() {
  10393. return root.Date.now();
  10394. };
  10395. module.exports = now;
  10396. }
  10397. ),
  10398. /***/
  10399. "../../node_modules/lodash/throttle.js": (
  10400. /*!*********************************************!*\
  10401. !*** ../../node_modules/lodash/throttle.js ***!
  10402. \*********************************************/
  10403. /***/
  10404. (module, __unused_webpack_exports, __webpack_require__2) => {
  10405. var debounce = __webpack_require__2(
  10406. /*! ./debounce */
  10407. "../../node_modules/lodash/debounce.js"
  10408. ), isObject2 = __webpack_require__2(
  10409. /*! ./isObject */
  10410. "../../node_modules/lodash/isObject.js"
  10411. );
  10412. var FUNC_ERROR_TEXT = "Expected a function";
  10413. function throttle(func, wait, options) {
  10414. var leading = true, trailing = true;
  10415. if (typeof func != "function") {
  10416. throw new TypeError(FUNC_ERROR_TEXT);
  10417. }
  10418. if (isObject2(options)) {
  10419. leading = "leading" in options ? !!options.leading : leading;
  10420. trailing = "trailing" in options ? !!options.trailing : trailing;
  10421. }
  10422. return debounce(func, wait, {
  10423. "leading": leading,
  10424. "maxWait": wait,
  10425. "trailing": trailing
  10426. });
  10427. }
  10428. module.exports = throttle;
  10429. }
  10430. ),
  10431. /***/
  10432. "../../node_modules/lodash/toNumber.js": (
  10433. /*!*********************************************!*\
  10434. !*** ../../node_modules/lodash/toNumber.js ***!
  10435. \*********************************************/
  10436. /***/
  10437. (module, __unused_webpack_exports, __webpack_require__2) => {
  10438. var baseTrim = __webpack_require__2(
  10439. /*! ./_baseTrim */
  10440. "../../node_modules/lodash/_baseTrim.js"
  10441. ), isObject2 = __webpack_require__2(
  10442. /*! ./isObject */
  10443. "../../node_modules/lodash/isObject.js"
  10444. ), isSymbol = __webpack_require__2(
  10445. /*! ./isSymbol */
  10446. "../../node_modules/lodash/isSymbol.js"
  10447. );
  10448. var NAN = 0 / 0;
  10449. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  10450. var reIsBinary = /^0b[01]+$/i;
  10451. var reIsOctal = /^0o[0-7]+$/i;
  10452. var freeParseInt = parseInt;
  10453. function toNumber(value) {
  10454. if (typeof value == "number") {
  10455. return value;
  10456. }
  10457. if (isSymbol(value)) {
  10458. return NAN;
  10459. }
  10460. if (isObject2(value)) {
  10461. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  10462. value = isObject2(other) ? other + "" : other;
  10463. }
  10464. if (typeof value != "string") {
  10465. return value === 0 ? value : +value;
  10466. }
  10467. value = baseTrim(value);
  10468. var isBinary = reIsBinary.test(value);
  10469. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  10470. }
  10471. module.exports = toNumber;
  10472. }
  10473. ),
  10474. /***/
  10475. "../../node_modules/path-browserify/index.js": (
  10476. /*!***************************************************!*\
  10477. !*** ../../node_modules/path-browserify/index.js ***!
  10478. \***************************************************/
  10479. /***/
  10480. (module) => {
  10481. function assertPath(path) {
  10482. if (typeof path !== "string") {
  10483. throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
  10484. }
  10485. }
  10486. function normalizeStringPosix(path, allowAboveRoot) {
  10487. var res = "";
  10488. var lastSegmentLength = 0;
  10489. var lastSlash = -1;
  10490. var dots = 0;
  10491. var code;
  10492. for (var i2 = 0; i2 <= path.length; ++i2) {
  10493. if (i2 < path.length)
  10494. code = path.charCodeAt(i2);
  10495. else if (code === 47)
  10496. break;
  10497. else
  10498. code = 47;
  10499. if (code === 47) {
  10500. if (lastSlash === i2 - 1 || dots === 1)
  10501. ;
  10502. else if (lastSlash !== i2 - 1 && dots === 2) {
  10503. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
  10504. if (res.length > 2) {
  10505. var lastSlashIndex = res.lastIndexOf("/");
  10506. if (lastSlashIndex !== res.length - 1) {
  10507. if (lastSlashIndex === -1) {
  10508. res = "";
  10509. lastSegmentLength = 0;
  10510. } else {
  10511. res = res.slice(0, lastSlashIndex);
  10512. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  10513. }
  10514. lastSlash = i2;
  10515. dots = 0;
  10516. continue;
  10517. }
  10518. } else if (res.length === 2 || res.length === 1) {
  10519. res = "";
  10520. lastSegmentLength = 0;
  10521. lastSlash = i2;
  10522. dots = 0;
  10523. continue;
  10524. }
  10525. }
  10526. if (allowAboveRoot) {
  10527. if (res.length > 0)
  10528. res += "/..";
  10529. else
  10530. res = "..";
  10531. lastSegmentLength = 2;
  10532. }
  10533. } else {
  10534. if (res.length > 0)
  10535. res += "/" + path.slice(lastSlash + 1, i2);
  10536. else
  10537. res = path.slice(lastSlash + 1, i2);
  10538. lastSegmentLength = i2 - lastSlash - 1;
  10539. }
  10540. lastSlash = i2;
  10541. dots = 0;
  10542. } else if (code === 46 && dots !== -1) {
  10543. ++dots;
  10544. } else {
  10545. dots = -1;
  10546. }
  10547. }
  10548. return res;
  10549. }
  10550. function _format(sep, pathObject) {
  10551. var dir = pathObject.dir || pathObject.root;
  10552. var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  10553. if (!dir) {
  10554. return base;
  10555. }
  10556. if (dir === pathObject.root) {
  10557. return dir + base;
  10558. }
  10559. return dir + sep + base;
  10560. }
  10561. var posix = {
  10562. // path.resolve([from ...], to)
  10563. resolve: function resolve() {
  10564. var resolvedPath = "";
  10565. var resolvedAbsolute = false;
  10566. var cwd;
  10567. for (var i2 = arguments.length - 1; i2 >= -1 && !resolvedAbsolute; i2--) {
  10568. var path;
  10569. if (i2 >= 0)
  10570. path = arguments[i2];
  10571. else {
  10572. if (cwd === void 0)
  10573. cwd = process.cwd();
  10574. path = cwd;
  10575. }
  10576. assertPath(path);
  10577. if (path.length === 0) {
  10578. continue;
  10579. }
  10580. resolvedPath = path + "/" + resolvedPath;
  10581. resolvedAbsolute = path.charCodeAt(0) === 47;
  10582. }
  10583. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  10584. if (resolvedAbsolute) {
  10585. if (resolvedPath.length > 0)
  10586. return "/" + resolvedPath;
  10587. else
  10588. return "/";
  10589. } else if (resolvedPath.length > 0) {
  10590. return resolvedPath;
  10591. } else {
  10592. return ".";
  10593. }
  10594. },
  10595. normalize: function normalize(path) {
  10596. assertPath(path);
  10597. if (path.length === 0)
  10598. return ".";
  10599. var isAbsolute = path.charCodeAt(0) === 47;
  10600. var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  10601. path = normalizeStringPosix(path, !isAbsolute);
  10602. if (path.length === 0 && !isAbsolute)
  10603. path = ".";
  10604. if (path.length > 0 && trailingSeparator)
  10605. path += "/";
  10606. if (isAbsolute)
  10607. return "/" + path;
  10608. return path;
  10609. },
  10610. isAbsolute: function isAbsolute(path) {
  10611. assertPath(path);
  10612. return path.length > 0 && path.charCodeAt(0) === 47;
  10613. },
  10614. join: function join() {
  10615. if (arguments.length === 0)
  10616. return ".";
  10617. var joined;
  10618. for (var i2 = 0; i2 < arguments.length; ++i2) {
  10619. var arg = arguments[i2];
  10620. assertPath(arg);
  10621. if (arg.length > 0) {
  10622. if (joined === void 0)
  10623. joined = arg;
  10624. else
  10625. joined += "/" + arg;
  10626. }
  10627. }
  10628. if (joined === void 0)
  10629. return ".";
  10630. return posix.normalize(joined);
  10631. },
  10632. relative: function relative(from, to) {
  10633. assertPath(from);
  10634. assertPath(to);
  10635. if (from === to)
  10636. return "";
  10637. from = posix.resolve(from);
  10638. to = posix.resolve(to);
  10639. if (from === to)
  10640. return "";
  10641. var fromStart = 1;
  10642. for (; fromStart < from.length; ++fromStart) {
  10643. if (from.charCodeAt(fromStart) !== 47)
  10644. break;
  10645. }
  10646. var fromEnd = from.length;
  10647. var fromLen = fromEnd - fromStart;
  10648. var toStart = 1;
  10649. for (; toStart < to.length; ++toStart) {
  10650. if (to.charCodeAt(toStart) !== 47)
  10651. break;
  10652. }
  10653. var toEnd = to.length;
  10654. var toLen = toEnd - toStart;
  10655. var length = fromLen < toLen ? fromLen : toLen;
  10656. var lastCommonSep = -1;
  10657. var i2 = 0;
  10658. for (; i2 <= length; ++i2) {
  10659. if (i2 === length) {
  10660. if (toLen > length) {
  10661. if (to.charCodeAt(toStart + i2) === 47) {
  10662. return to.slice(toStart + i2 + 1);
  10663. } else if (i2 === 0) {
  10664. return to.slice(toStart + i2);
  10665. }
  10666. } else if (fromLen > length) {
  10667. if (from.charCodeAt(fromStart + i2) === 47) {
  10668. lastCommonSep = i2;
  10669. } else if (i2 === 0) {
  10670. lastCommonSep = 0;
  10671. }
  10672. }
  10673. break;
  10674. }
  10675. var fromCode = from.charCodeAt(fromStart + i2);
  10676. var toCode = to.charCodeAt(toStart + i2);
  10677. if (fromCode !== toCode)
  10678. break;
  10679. else if (fromCode === 47)
  10680. lastCommonSep = i2;
  10681. }
  10682. var out = "";
  10683. for (i2 = fromStart + lastCommonSep + 1; i2 <= fromEnd; ++i2) {
  10684. if (i2 === fromEnd || from.charCodeAt(i2) === 47) {
  10685. if (out.length === 0)
  10686. out += "..";
  10687. else
  10688. out += "/..";
  10689. }
  10690. }
  10691. if (out.length > 0)
  10692. return out + to.slice(toStart + lastCommonSep);
  10693. else {
  10694. toStart += lastCommonSep;
  10695. if (to.charCodeAt(toStart) === 47)
  10696. ++toStart;
  10697. return to.slice(toStart);
  10698. }
  10699. },
  10700. _makeLong: function _makeLong(path) {
  10701. return path;
  10702. },
  10703. dirname: function dirname(path) {
  10704. assertPath(path);
  10705. if (path.length === 0)
  10706. return ".";
  10707. var code = path.charCodeAt(0);
  10708. var hasRoot = code === 47;
  10709. var end = -1;
  10710. var matchedSlash = true;
  10711. for (var i2 = path.length - 1; i2 >= 1; --i2) {
  10712. code = path.charCodeAt(i2);
  10713. if (code === 47) {
  10714. if (!matchedSlash) {
  10715. end = i2;
  10716. break;
  10717. }
  10718. } else {
  10719. matchedSlash = false;
  10720. }
  10721. }
  10722. if (end === -1)
  10723. return hasRoot ? "/" : ".";
  10724. if (hasRoot && end === 1)
  10725. return "//";
  10726. return path.slice(0, end);
  10727. },
  10728. basename: function basename(path, ext) {
  10729. if (ext !== void 0 && typeof ext !== "string")
  10730. throw new TypeError('"ext" argument must be a string');
  10731. assertPath(path);
  10732. var start = 0;
  10733. var end = -1;
  10734. var matchedSlash = true;
  10735. var i2;
  10736. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  10737. if (ext.length === path.length && ext === path)
  10738. return "";
  10739. var extIdx = ext.length - 1;
  10740. var firstNonSlashEnd = -1;
  10741. for (i2 = path.length - 1; i2 >= 0; --i2) {
  10742. var code = path.charCodeAt(i2);
  10743. if (code === 47) {
  10744. if (!matchedSlash) {
  10745. start = i2 + 1;
  10746. break;
  10747. }
  10748. } else {
  10749. if (firstNonSlashEnd === -1) {
  10750. matchedSlash = false;
  10751. firstNonSlashEnd = i2 + 1;
  10752. }
  10753. if (extIdx >= 0) {
  10754. if (code === ext.charCodeAt(extIdx)) {
  10755. if (--extIdx === -1) {
  10756. end = i2;
  10757. }
  10758. } else {
  10759. extIdx = -1;
  10760. end = firstNonSlashEnd;
  10761. }
  10762. }
  10763. }
  10764. }
  10765. if (start === end)
  10766. end = firstNonSlashEnd;
  10767. else if (end === -1)
  10768. end = path.length;
  10769. return path.slice(start, end);
  10770. } else {
  10771. for (i2 = path.length - 1; i2 >= 0; --i2) {
  10772. if (path.charCodeAt(i2) === 47) {
  10773. if (!matchedSlash) {
  10774. start = i2 + 1;
  10775. break;
  10776. }
  10777. } else if (end === -1) {
  10778. matchedSlash = false;
  10779. end = i2 + 1;
  10780. }
  10781. }
  10782. if (end === -1)
  10783. return "";
  10784. return path.slice(start, end);
  10785. }
  10786. },
  10787. extname: function extname(path) {
  10788. assertPath(path);
  10789. var startDot = -1;
  10790. var startPart = 0;
  10791. var end = -1;
  10792. var matchedSlash = true;
  10793. var preDotState = 0;
  10794. for (var i2 = path.length - 1; i2 >= 0; --i2) {
  10795. var code = path.charCodeAt(i2);
  10796. if (code === 47) {
  10797. if (!matchedSlash) {
  10798. startPart = i2 + 1;
  10799. break;
  10800. }
  10801. continue;
  10802. }
  10803. if (end === -1) {
  10804. matchedSlash = false;
  10805. end = i2 + 1;
  10806. }
  10807. if (code === 46) {
  10808. if (startDot === -1)
  10809. startDot = i2;
  10810. else if (preDotState !== 1)
  10811. preDotState = 1;
  10812. } else if (startDot !== -1) {
  10813. preDotState = -1;
  10814. }
  10815. }
  10816. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  10817. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  10818. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10819. return "";
  10820. }
  10821. return path.slice(startDot, end);
  10822. },
  10823. format: function format(pathObject) {
  10824. if (pathObject === null || typeof pathObject !== "object") {
  10825. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  10826. }
  10827. return _format("/", pathObject);
  10828. },
  10829. parse: function parse2(path) {
  10830. assertPath(path);
  10831. var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  10832. if (path.length === 0)
  10833. return ret;
  10834. var code = path.charCodeAt(0);
  10835. var isAbsolute = code === 47;
  10836. var start;
  10837. if (isAbsolute) {
  10838. ret.root = "/";
  10839. start = 1;
  10840. } else {
  10841. start = 0;
  10842. }
  10843. var startDot = -1;
  10844. var startPart = 0;
  10845. var end = -1;
  10846. var matchedSlash = true;
  10847. var i2 = path.length - 1;
  10848. var preDotState = 0;
  10849. for (; i2 >= start; --i2) {
  10850. code = path.charCodeAt(i2);
  10851. if (code === 47) {
  10852. if (!matchedSlash) {
  10853. startPart = i2 + 1;
  10854. break;
  10855. }
  10856. continue;
  10857. }
  10858. if (end === -1) {
  10859. matchedSlash = false;
  10860. end = i2 + 1;
  10861. }
  10862. if (code === 46) {
  10863. if (startDot === -1)
  10864. startDot = i2;
  10865. else if (preDotState !== 1)
  10866. preDotState = 1;
  10867. } else if (startDot !== -1) {
  10868. preDotState = -1;
  10869. }
  10870. }
  10871. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  10872. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  10873. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10874. if (end !== -1) {
  10875. if (startPart === 0 && isAbsolute)
  10876. ret.base = ret.name = path.slice(1, end);
  10877. else
  10878. ret.base = ret.name = path.slice(startPart, end);
  10879. }
  10880. } else {
  10881. if (startPart === 0 && isAbsolute) {
  10882. ret.name = path.slice(1, startDot);
  10883. ret.base = path.slice(1, end);
  10884. } else {
  10885. ret.name = path.slice(startPart, startDot);
  10886. ret.base = path.slice(startPart, end);
  10887. }
  10888. ret.ext = path.slice(startDot, end);
  10889. }
  10890. if (startPart > 0)
  10891. ret.dir = path.slice(0, startPart - 1);
  10892. else if (isAbsolute)
  10893. ret.dir = "/";
  10894. return ret;
  10895. },
  10896. sep: "/",
  10897. delimiter: ":",
  10898. win32: null,
  10899. posix: null
  10900. };
  10901. posix.posix = posix;
  10902. module.exports = posix;
  10903. }
  10904. ),
  10905. /***/
  10906. "../../node_modules/speakingurl/index.js": (
  10907. /*!***********************************************!*\
  10908. !*** ../../node_modules/speakingurl/index.js ***!
  10909. \***********************************************/
  10910. /***/
  10911. (module, __unused_webpack_exports, __webpack_require__2) => {
  10912. module.exports = __webpack_require__2(
  10913. /*! ./lib/speakingurl */
  10914. "../../node_modules/speakingurl/lib/speakingurl.js"
  10915. );
  10916. }
  10917. ),
  10918. /***/
  10919. "../../node_modules/speakingurl/lib/speakingurl.js": (
  10920. /*!*********************************************************!*\
  10921. !*** ../../node_modules/speakingurl/lib/speakingurl.js ***!
  10922. \*********************************************************/
  10923. /***/
  10924. function(module, exports) {
  10925. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  10926. (function(root) {
  10927. var charMap = {
  10928. // latin
  10929. "À": "A",
  10930. "Á": "A",
  10931. "Â": "A",
  10932. "Ã": "A",
  10933. "Ä": "Ae",
  10934. "Å": "A",
  10935. "Æ": "AE",
  10936. "Ç": "C",
  10937. "È": "E",
  10938. "É": "E",
  10939. "Ê": "E",
  10940. "Ë": "E",
  10941. "Ì": "I",
  10942. "Í": "I",
  10943. "Î": "I",
  10944. "Ï": "I",
  10945. "Ð": "D",
  10946. "Ñ": "N",
  10947. "Ò": "O",
  10948. "Ó": "O",
  10949. "Ô": "O",
  10950. "Õ": "O",
  10951. "Ö": "Oe",
  10952. "Ő": "O",
  10953. "Ø": "O",
  10954. "Ù": "U",
  10955. "Ú": "U",
  10956. "Û": "U",
  10957. "Ü": "Ue",
  10958. "Ű": "U",
  10959. "Ý": "Y",
  10960. "Þ": "TH",
  10961. "ß": "ss",
  10962. "à": "a",
  10963. "á": "a",
  10964. "â": "a",
  10965. "ã": "a",
  10966. "ä": "ae",
  10967. "å": "a",
  10968. "æ": "ae",
  10969. "ç": "c",
  10970. "è": "e",
  10971. "é": "e",
  10972. "ê": "e",
  10973. "ë": "e",
  10974. "ì": "i",
  10975. "í": "i",
  10976. "î": "i",
  10977. "ï": "i",
  10978. "ð": "d",
  10979. "ñ": "n",
  10980. "ò": "o",
  10981. "ó": "o",
  10982. "ô": "o",
  10983. "õ": "o",
  10984. "ö": "oe",
  10985. "ő": "o",
  10986. "ø": "o",
  10987. "ù": "u",
  10988. "ú": "u",
  10989. "û": "u",
  10990. "ü": "ue",
  10991. "ű": "u",
  10992. "ý": "y",
  10993. "þ": "th",
  10994. "ÿ": "y",
  10995. "ẞ": "SS",
  10996. // language specific
  10997. // Arabic
  10998. "ا": "a",
  10999. "أ": "a",
  11000. "إ": "i",
  11001. "آ": "aa",
  11002. "ؤ": "u",
  11003. "ئ": "e",
  11004. "ء": "a",
  11005. "ب": "b",
  11006. "ت": "t",
  11007. "ث": "th",
  11008. "ج": "j",
  11009. "ح": "h",
  11010. "خ": "kh",
  11011. "د": "d",
  11012. "ذ": "th",
  11013. "ر": "r",
  11014. "ز": "z",
  11015. "س": "s",
  11016. "ش": "sh",
  11017. "ص": "s",
  11018. "ض": "dh",
  11019. "ط": "t",
  11020. "ظ": "z",
  11021. "ع": "a",
  11022. "غ": "gh",
  11023. "ف": "f",
  11024. "ق": "q",
  11025. "ك": "k",
  11026. "ل": "l",
  11027. "م": "m",
  11028. "ن": "n",
  11029. "ه": "h",
  11030. "و": "w",
  11031. "ي": "y",
  11032. "ى": "a",
  11033. "ة": "h",
  11034. "ﻻ": "la",
  11035. "ﻷ": "laa",
  11036. "ﻹ": "lai",
  11037. "ﻵ": "laa",
  11038. // Persian additional characters than Arabic
  11039. "گ": "g",
  11040. "چ": "ch",
  11041. "پ": "p",
  11042. "ژ": "zh",
  11043. "ک": "k",
  11044. "ی": "y",
  11045. // Arabic diactrics
  11046. "َ": "a",
  11047. "ً": "an",
  11048. "ِ": "e",
  11049. "ٍ": "en",
  11050. "ُ": "u",
  11051. "ٌ": "on",
  11052. "ْ": "",
  11053. // Arabic numbers
  11054. "٠": "0",
  11055. "١": "1",
  11056. "٢": "2",
  11057. "٣": "3",
  11058. "٤": "4",
  11059. "٥": "5",
  11060. "٦": "6",
  11061. "٧": "7",
  11062. "٨": "8",
  11063. "٩": "9",
  11064. // Persian numbers
  11065. "۰": "0",
  11066. "۱": "1",
  11067. "۲": "2",
  11068. "۳": "3",
  11069. "۴": "4",
  11070. "۵": "5",
  11071. "۶": "6",
  11072. "۷": "7",
  11073. "۸": "8",
  11074. "۹": "9",
  11075. // Burmese consonants
  11076. "က": "k",
  11077. "ခ": "kh",
  11078. "ဂ": "g",
  11079. "ဃ": "ga",
  11080. "င": "ng",
  11081. "စ": "s",
  11082. "ဆ": "sa",
  11083. "ဇ": "z",
  11084. "စျ": "za",
  11085. "ည": "ny",
  11086. "ဋ": "t",
  11087. "ဌ": "ta",
  11088. "ဍ": "d",
  11089. "ဎ": "da",
  11090. "ဏ": "na",
  11091. "တ": "t",
  11092. "ထ": "ta",
  11093. "ဒ": "d",
  11094. "ဓ": "da",
  11095. "န": "n",
  11096. "ပ": "p",
  11097. "ဖ": "pa",
  11098. "ဗ": "b",
  11099. "ဘ": "ba",
  11100. "မ": "m",
  11101. "ယ": "y",
  11102. "ရ": "ya",
  11103. "လ": "l",
  11104. "ဝ": "w",
  11105. "သ": "th",
  11106. "ဟ": "h",
  11107. "ဠ": "la",
  11108. "အ": "a",
  11109. // consonant character combos
  11110. "ြ": "y",
  11111. "ျ": "ya",
  11112. "ွ": "w",
  11113. "ြွ": "yw",
  11114. "ျွ": "ywa",
  11115. "ှ": "h",
  11116. // independent vowels
  11117. "ဧ": "e",
  11118. "၏": "-e",
  11119. "ဣ": "i",
  11120. "ဤ": "-i",
  11121. "ဉ": "u",
  11122. "ဦ": "-u",
  11123. "ဩ": "aw",
  11124. "သြော": "aw",
  11125. "ဪ": "aw",
  11126. // numbers
  11127. "၀": "0",
  11128. "၁": "1",
  11129. "၂": "2",
  11130. "၃": "3",
  11131. "၄": "4",
  11132. "၅": "5",
  11133. "၆": "6",
  11134. "၇": "7",
  11135. "၈": "8",
  11136. "၉": "9",
  11137. // virama and tone marks which are silent in transliteration
  11138. "္": "",
  11139. "့": "",
  11140. "း": "",
  11141. // Czech
  11142. "č": "c",
  11143. "ď": "d",
  11144. "ě": "e",
  11145. "ň": "n",
  11146. "ř": "r",
  11147. "š": "s",
  11148. "ť": "t",
  11149. "ů": "u",
  11150. "ž": "z",
  11151. "Č": "C",
  11152. "Ď": "D",
  11153. "Ě": "E",
  11154. "Ň": "N",
  11155. "Ř": "R",
  11156. "Š": "S",
  11157. "Ť": "T",
  11158. "Ů": "U",
  11159. "Ž": "Z",
  11160. // Dhivehi
  11161. "ހ": "h",
  11162. "ށ": "sh",
  11163. "ނ": "n",
  11164. "ރ": "r",
  11165. "ބ": "b",
  11166. "ޅ": "lh",
  11167. "ކ": "k",
  11168. "އ": "a",
  11169. "ވ": "v",
  11170. "މ": "m",
  11171. "ފ": "f",
  11172. "ދ": "dh",
  11173. "ތ": "th",
  11174. "ލ": "l",
  11175. "ގ": "g",
  11176. "ޏ": "gn",
  11177. "ސ": "s",
  11178. "ޑ": "d",
  11179. "ޒ": "z",
  11180. "ޓ": "t",
  11181. "ޔ": "y",
  11182. "ޕ": "p",
  11183. "ޖ": "j",
  11184. "ޗ": "ch",
  11185. "ޘ": "tt",
  11186. "ޙ": "hh",
  11187. "ޚ": "kh",
  11188. "ޛ": "th",
  11189. "ޜ": "z",
  11190. "ޝ": "sh",
  11191. "ޞ": "s",
  11192. "ޟ": "d",
  11193. "ޠ": "t",
  11194. "ޡ": "z",
  11195. "ޢ": "a",
  11196. "ޣ": "gh",
  11197. "ޤ": "q",
  11198. "ޥ": "w",
  11199. "ަ": "a",
  11200. "ާ": "aa",
  11201. "ި": "i",
  11202. "ީ": "ee",
  11203. "ު": "u",
  11204. "ޫ": "oo",
  11205. "ެ": "e",
  11206. "ޭ": "ey",
  11207. "ޮ": "o",
  11208. "ޯ": "oa",
  11209. "ް": "",
  11210. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  11211. // National system (2002)
  11212. "ა": "a",
  11213. "ბ": "b",
  11214. "გ": "g",
  11215. "დ": "d",
  11216. "ე": "e",
  11217. "ვ": "v",
  11218. "ზ": "z",
  11219. "თ": "t",
  11220. "ი": "i",
  11221. "კ": "k",
  11222. "ლ": "l",
  11223. "მ": "m",
  11224. "ნ": "n",
  11225. "ო": "o",
  11226. "პ": "p",
  11227. "ჟ": "zh",
  11228. "რ": "r",
  11229. "ს": "s",
  11230. "ტ": "t",
  11231. "უ": "u",
  11232. "ფ": "p",
  11233. "ქ": "k",
  11234. "ღ": "gh",
  11235. "ყ": "q",
  11236. "შ": "sh",
  11237. "ჩ": "ch",
  11238. "ც": "ts",
  11239. "ძ": "dz",
  11240. "წ": "ts",
  11241. "ჭ": "ch",
  11242. "ხ": "kh",
  11243. "ჯ": "j",
  11244. "ჰ": "h",
  11245. // Greek
  11246. "α": "a",
  11247. "β": "v",
  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. "ς": "s",
  11278. "ϊ": "i",
  11279. "ΰ": "y",
  11280. "ϋ": "y",
  11281. "ΐ": "i",
  11282. "Α": "A",
  11283. "Β": "B",
  11284. "Γ": "G",
  11285. "Δ": "D",
  11286. "Ε": "E",
  11287. "Ζ": "Z",
  11288. "Η": "I",
  11289. "Θ": "TH",
  11290. "Ι": "I",
  11291. "Κ": "K",
  11292. "Λ": "L",
  11293. "Μ": "M",
  11294. "Ν": "N",
  11295. "Ξ": "KS",
  11296. "Ο": "O",
  11297. "Π": "P",
  11298. "Ρ": "R",
  11299. "Σ": "S",
  11300. "Τ": "T",
  11301. "Υ": "Y",
  11302. "Φ": "F",
  11303. "Χ": "X",
  11304. "Ψ": "PS",
  11305. "Ω": "O",
  11306. "Ά": "A",
  11307. "Έ": "E",
  11308. "Ί": "I",
  11309. "Ό": "O",
  11310. "Ύ": "Y",
  11311. "Ή": "I",
  11312. "Ώ": "O",
  11313. "Ϊ": "I",
  11314. "Ϋ": "Y",
  11315. // Latvian
  11316. "ā": "a",
  11317. // 'č': 'c', // duplicate
  11318. "ē": "e",
  11319. "ģ": "g",
  11320. "ī": "i",
  11321. "ķ": "k",
  11322. "ļ": "l",
  11323. "ņ": "n",
  11324. // 'š': 's', // duplicate
  11325. "ū": "u",
  11326. // 'ž': 'z', // duplicate
  11327. "Ā": "A",
  11328. // 'Č': 'C', // duplicate
  11329. "Ē": "E",
  11330. "Ģ": "G",
  11331. "Ī": "I",
  11332. "Ķ": "k",
  11333. "Ļ": "L",
  11334. "Ņ": "N",
  11335. // 'Š': 'S', // duplicate
  11336. "Ū": "U",
  11337. // 'Ž': 'Z', // duplicate
  11338. // Macedonian
  11339. "Ќ": "Kj",
  11340. "ќ": "kj",
  11341. "Љ": "Lj",
  11342. "љ": "lj",
  11343. "Њ": "Nj",
  11344. "њ": "nj",
  11345. "Тс": "Ts",
  11346. "тс": "ts",
  11347. // Polish
  11348. "ą": "a",
  11349. "ć": "c",
  11350. "ę": "e",
  11351. "ł": "l",
  11352. "ń": "n",
  11353. // 'ó': 'o', // duplicate
  11354. "ś": "s",
  11355. "ź": "z",
  11356. "ż": "z",
  11357. "Ą": "A",
  11358. "Ć": "C",
  11359. "Ę": "E",
  11360. "Ł": "L",
  11361. "Ń": "N",
  11362. "Ś": "S",
  11363. "Ź": "Z",
  11364. "Ż": "Z",
  11365. // Ukranian
  11366. "Є": "Ye",
  11367. "І": "I",
  11368. "Ї": "Yi",
  11369. "Ґ": "G",
  11370. "є": "ye",
  11371. "і": "i",
  11372. "ї": "yi",
  11373. "ґ": "g",
  11374. // Romanian
  11375. "ă": "a",
  11376. "Ă": "A",
  11377. "ș": "s",
  11378. "Ș": "S",
  11379. // 'ş': 's', // duplicate
  11380. // 'Ş': 'S', // duplicate
  11381. "ț": "t",
  11382. "Ț": "T",
  11383. "ţ": "t",
  11384. "Ţ": "T",
  11385. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  11386. // ICAO
  11387. "а": "a",
  11388. "б": "b",
  11389. "в": "v",
  11390. "г": "g",
  11391. "д": "d",
  11392. "е": "e",
  11393. "ё": "yo",
  11394. "ж": "zh",
  11395. "з": "z",
  11396. "и": "i",
  11397. "й": "i",
  11398. "к": "k",
  11399. "л": "l",
  11400. "м": "m",
  11401. "н": "n",
  11402. "о": "o",
  11403. "п": "p",
  11404. "р": "r",
  11405. "с": "s",
  11406. "т": "t",
  11407. "у": "u",
  11408. "ф": "f",
  11409. "х": "kh",
  11410. "ц": "c",
  11411. "ч": "ch",
  11412. "ш": "sh",
  11413. "щ": "sh",
  11414. "ъ": "",
  11415. "ы": "y",
  11416. "ь": "",
  11417. "э": "e",
  11418. "ю": "yu",
  11419. "я": "ya",
  11420. "А": "A",
  11421. "Б": "B",
  11422. "В": "V",
  11423. "Г": "G",
  11424. "Д": "D",
  11425. "Е": "E",
  11426. "Ё": "Yo",
  11427. "Ж": "Zh",
  11428. "З": "Z",
  11429. "И": "I",
  11430. "Й": "I",
  11431. "К": "K",
  11432. "Л": "L",
  11433. "М": "M",
  11434. "Н": "N",
  11435. "О": "O",
  11436. "П": "P",
  11437. "Р": "R",
  11438. "С": "S",
  11439. "Т": "T",
  11440. "У": "U",
  11441. "Ф": "F",
  11442. "Х": "Kh",
  11443. "Ц": "C",
  11444. "Ч": "Ch",
  11445. "Ш": "Sh",
  11446. "Щ": "Sh",
  11447. "Ъ": "",
  11448. "Ы": "Y",
  11449. "Ь": "",
  11450. "Э": "E",
  11451. "Ю": "Yu",
  11452. "Я": "Ya",
  11453. // Serbian
  11454. "ђ": "dj",
  11455. "ј": "j",
  11456. // 'љ': 'lj', // duplicate
  11457. // 'њ': 'nj', // duplicate
  11458. "ћ": "c",
  11459. "џ": "dz",
  11460. "Ђ": "Dj",
  11461. "Ј": "j",
  11462. // 'Љ': 'Lj', // duplicate
  11463. // 'Њ': 'Nj', // duplicate
  11464. "Ћ": "C",
  11465. "Џ": "Dz",
  11466. // Slovak
  11467. "ľ": "l",
  11468. "ĺ": "l",
  11469. "ŕ": "r",
  11470. "Ľ": "L",
  11471. "Ĺ": "L",
  11472. "Ŕ": "R",
  11473. // Turkish
  11474. "ş": "s",
  11475. "Ş": "S",
  11476. "ı": "i",
  11477. "İ": "I",
  11478. // 'ç': 'c', // duplicate
  11479. // 'Ç': 'C', // duplicate
  11480. // 'ü': 'u', // duplicate, see langCharMap
  11481. // 'Ü': 'U', // duplicate, see langCharMap
  11482. // 'ö': 'o', // duplicate, see langCharMap
  11483. // 'Ö': 'O', // duplicate, see langCharMap
  11484. "ğ": "g",
  11485. "Ğ": "G",
  11486. // Vietnamese
  11487. "ả": "a",
  11488. "Ả": "A",
  11489. "ẳ": "a",
  11490. "Ẳ": "A",
  11491. "ẩ": "a",
  11492. "Ẩ": "A",
  11493. "đ": "d",
  11494. "Đ": "D",
  11495. "ẹ": "e",
  11496. "Ẹ": "E",
  11497. "ẽ": "e",
  11498. "Ẽ": "E",
  11499. "ẻ": "e",
  11500. "Ẻ": "E",
  11501. "ế": "e",
  11502. "Ế": "E",
  11503. "ề": "e",
  11504. "Ề": "E",
  11505. "ệ": "e",
  11506. "Ệ": "E",
  11507. "ễ": "e",
  11508. "Ễ": "E",
  11509. "ể": "e",
  11510. "Ể": "E",
  11511. "ỏ": "o",
  11512. "ọ": "o",
  11513. "Ọ": "o",
  11514. "ố": "o",
  11515. "Ố": "O",
  11516. "ồ": "o",
  11517. "Ồ": "O",
  11518. "ổ": "o",
  11519. "Ổ": "O",
  11520. "ộ": "o",
  11521. "Ộ": "O",
  11522. "ỗ": "o",
  11523. "Ỗ": "O",
  11524. "ơ": "o",
  11525. "Ơ": "O",
  11526. "ớ": "o",
  11527. "Ớ": "O",
  11528. "ờ": "o",
  11529. "Ờ": "O",
  11530. "ợ": "o",
  11531. "Ợ": "O",
  11532. "ỡ": "o",
  11533. "Ỡ": "O",
  11534. "Ở": "o",
  11535. "ở": "o",
  11536. "ị": "i",
  11537. "Ị": "I",
  11538. "ĩ": "i",
  11539. "Ĩ": "I",
  11540. "ỉ": "i",
  11541. "Ỉ": "i",
  11542. "ủ": "u",
  11543. "Ủ": "U",
  11544. "ụ": "u",
  11545. "Ụ": "U",
  11546. "ũ": "u",
  11547. "Ũ": "U",
  11548. "ư": "u",
  11549. "Ư": "U",
  11550. "ứ": "u",
  11551. "Ứ": "U",
  11552. "ừ": "u",
  11553. "Ừ": "U",
  11554. "ự": "u",
  11555. "Ự": "U",
  11556. "ữ": "u",
  11557. "Ữ": "U",
  11558. "ử": "u",
  11559. "Ử": "ư",
  11560. "ỷ": "y",
  11561. "Ỷ": "y",
  11562. "ỳ": "y",
  11563. "Ỳ": "Y",
  11564. "ỵ": "y",
  11565. "Ỵ": "Y",
  11566. "ỹ": "y",
  11567. "Ỹ": "Y",
  11568. "ạ": "a",
  11569. "Ạ": "A",
  11570. "ấ": "a",
  11571. "Ấ": "A",
  11572. "ầ": "a",
  11573. "Ầ": "A",
  11574. "ậ": "a",
  11575. "Ậ": "A",
  11576. "ẫ": "a",
  11577. "Ẫ": "A",
  11578. // 'ă': 'a', // duplicate
  11579. // 'Ă': 'A', // duplicate
  11580. "ắ": "a",
  11581. "Ắ": "A",
  11582. "ằ": "a",
  11583. "Ằ": "A",
  11584. "ặ": "a",
  11585. "Ặ": "A",
  11586. "ẵ": "a",
  11587. "Ẵ": "A",
  11588. "⓪": "0",
  11589. "①": "1",
  11590. "②": "2",
  11591. "③": "3",
  11592. "④": "4",
  11593. "⑤": "5",
  11594. "⑥": "6",
  11595. "⑦": "7",
  11596. "⑧": "8",
  11597. "⑨": "9",
  11598. "⑩": "10",
  11599. "⑪": "11",
  11600. "⑫": "12",
  11601. "⑬": "13",
  11602. "⑭": "14",
  11603. "⑮": "15",
  11604. "⑯": "16",
  11605. "⑰": "17",
  11606. "⑱": "18",
  11607. "⑲": "18",
  11608. "⑳": "18",
  11609. "⓵": "1",
  11610. "⓶": "2",
  11611. "⓷": "3",
  11612. "⓸": "4",
  11613. "⓹": "5",
  11614. "⓺": "6",
  11615. "⓻": "7",
  11616. "⓼": "8",
  11617. "⓽": "9",
  11618. "⓾": "10",
  11619. "⓿": "0",
  11620. "⓫": "11",
  11621. "⓬": "12",
  11622. "⓭": "13",
  11623. "⓮": "14",
  11624. "⓯": "15",
  11625. "⓰": "16",
  11626. "⓱": "17",
  11627. "⓲": "18",
  11628. "⓳": "19",
  11629. "⓴": "20",
  11630. "Ⓐ": "A",
  11631. "Ⓑ": "B",
  11632. "Ⓒ": "C",
  11633. "Ⓓ": "D",
  11634. "Ⓔ": "E",
  11635. "Ⓕ": "F",
  11636. "Ⓖ": "G",
  11637. "Ⓗ": "H",
  11638. "Ⓘ": "I",
  11639. "Ⓙ": "J",
  11640. "Ⓚ": "K",
  11641. "Ⓛ": "L",
  11642. "Ⓜ": "M",
  11643. "Ⓝ": "N",
  11644. "Ⓞ": "O",
  11645. "Ⓟ": "P",
  11646. "Ⓠ": "Q",
  11647. "Ⓡ": "R",
  11648. "Ⓢ": "S",
  11649. "Ⓣ": "T",
  11650. "Ⓤ": "U",
  11651. "Ⓥ": "V",
  11652. "Ⓦ": "W",
  11653. "Ⓧ": "X",
  11654. "Ⓨ": "Y",
  11655. "Ⓩ": "Z",
  11656. "ⓐ": "a",
  11657. "ⓑ": "b",
  11658. "ⓒ": "c",
  11659. "ⓓ": "d",
  11660. "ⓔ": "e",
  11661. "ⓕ": "f",
  11662. "ⓖ": "g",
  11663. "ⓗ": "h",
  11664. "ⓘ": "i",
  11665. "ⓙ": "j",
  11666. "ⓚ": "k",
  11667. "ⓛ": "l",
  11668. "ⓜ": "m",
  11669. "ⓝ": "n",
  11670. "ⓞ": "o",
  11671. "ⓟ": "p",
  11672. "ⓠ": "q",
  11673. "ⓡ": "r",
  11674. "ⓢ": "s",
  11675. "ⓣ": "t",
  11676. "ⓤ": "u",
  11677. "ⓦ": "v",
  11678. "ⓥ": "w",
  11679. "ⓧ": "x",
  11680. "ⓨ": "y",
  11681. "ⓩ": "z",
  11682. // symbols
  11683. "“": '"',
  11684. "”": '"',
  11685. "‘": "'",
  11686. "’": "'",
  11687. "∂": "d",
  11688. "ƒ": "f",
  11689. "™": "(TM)",
  11690. "©": "(C)",
  11691. "œ": "oe",
  11692. "Œ": "OE",
  11693. "®": "(R)",
  11694. "†": "+",
  11695. "℠": "(SM)",
  11696. "…": "...",
  11697. "˚": "o",
  11698. "º": "o",
  11699. "ª": "a",
  11700. "•": "*",
  11701. "၊": ",",
  11702. "။": ".",
  11703. // currency
  11704. "$": "USD",
  11705. "€": "EUR",
  11706. "₢": "BRN",
  11707. "₣": "FRF",
  11708. "£": "GBP",
  11709. "₤": "ITL",
  11710. "₦": "NGN",
  11711. "₧": "ESP",
  11712. "₩": "KRW",
  11713. "₪": "ILS",
  11714. "₫": "VND",
  11715. "₭": "LAK",
  11716. "₮": "MNT",
  11717. "₯": "GRD",
  11718. "₱": "ARS",
  11719. "₲": "PYG",
  11720. "₳": "ARA",
  11721. "₴": "UAH",
  11722. "₵": "GHS",
  11723. "¢": "cent",
  11724. "¥": "CNY",
  11725. "元": "CNY",
  11726. "円": "YEN",
  11727. "﷼": "IRR",
  11728. "₠": "EWE",
  11729. "฿": "THB",
  11730. "₨": "INR",
  11731. "₹": "INR",
  11732. "₰": "PF",
  11733. "₺": "TRY",
  11734. "؋": "AFN",
  11735. "₼": "AZN",
  11736. "лв": "BGN",
  11737. "៛": "KHR",
  11738. "₡": "CRC",
  11739. "₸": "KZT",
  11740. "ден": "MKD",
  11741. "zł": "PLN",
  11742. "₽": "RUB",
  11743. "₾": "GEL"
  11744. };
  11745. var lookAheadCharArray = [
  11746. // burmese
  11747. "်",
  11748. // Dhivehi
  11749. "ް"
  11750. ];
  11751. var diatricMap = {
  11752. // Burmese
  11753. // dependent vowels
  11754. "ာ": "a",
  11755. "ါ": "a",
  11756. "ေ": "e",
  11757. "ဲ": "e",
  11758. "ိ": "i",
  11759. "ီ": "i",
  11760. "ို": "o",
  11761. "ု": "u",
  11762. "ူ": "u",
  11763. "ေါင်": "aung",
  11764. "ော": "aw",
  11765. "ော်": "aw",
  11766. "ေါ": "aw",
  11767. "ေါ်": "aw",
  11768. "်": "်",
  11769. // this is special case but the character will be converted to latin in the code
  11770. "က်": "et",
  11771. "ိုက်": "aik",
  11772. "ောက်": "auk",
  11773. "င်": "in",
  11774. "ိုင်": "aing",
  11775. "ောင်": "aung",
  11776. "စ်": "it",
  11777. "ည်": "i",
  11778. "တ်": "at",
  11779. "ိတ်": "eik",
  11780. "ုတ်": "ok",
  11781. "ွတ်": "ut",
  11782. "ေတ်": "it",
  11783. "ဒ်": "d",
  11784. "ိုဒ်": "ok",
  11785. "ုဒ်": "ait",
  11786. "န်": "an",
  11787. "ာန်": "an",
  11788. "ိန်": "ein",
  11789. "ုန်": "on",
  11790. "ွန်": "un",
  11791. "ပ်": "at",
  11792. "ိပ်": "eik",
  11793. "ုပ်": "ok",
  11794. "ွပ်": "ut",
  11795. "န်ုပ်": "nub",
  11796. "မ်": "an",
  11797. "ိမ်": "ein",
  11798. "ုမ်": "on",
  11799. "ွမ်": "un",
  11800. "ယ်": "e",
  11801. "ိုလ်": "ol",
  11802. "ဉ်": "in",
  11803. "ံ": "an",
  11804. "ိံ": "ein",
  11805. "ုံ": "on",
  11806. // Dhivehi
  11807. "ައް": "ah",
  11808. "ަށް": "ah"
  11809. };
  11810. var langCharMap = {
  11811. "en": {},
  11812. // default language
  11813. "az": {
  11814. // Azerbaijani
  11815. "ç": "c",
  11816. "ə": "e",
  11817. "ğ": "g",
  11818. "ı": "i",
  11819. "ö": "o",
  11820. "ş": "s",
  11821. "ü": "u",
  11822. "Ç": "C",
  11823. "Ə": "E",
  11824. "Ğ": "G",
  11825. "İ": "I",
  11826. "Ö": "O",
  11827. "Ş": "S",
  11828. "Ü": "U"
  11829. },
  11830. "cs": {
  11831. // Czech
  11832. "č": "c",
  11833. "ď": "d",
  11834. "ě": "e",
  11835. "ň": "n",
  11836. "ř": "r",
  11837. "š": "s",
  11838. "ť": "t",
  11839. "ů": "u",
  11840. "ž": "z",
  11841. "Č": "C",
  11842. "Ď": "D",
  11843. "Ě": "E",
  11844. "Ň": "N",
  11845. "Ř": "R",
  11846. "Š": "S",
  11847. "Ť": "T",
  11848. "Ů": "U",
  11849. "Ž": "Z"
  11850. },
  11851. "fi": {
  11852. // Finnish
  11853. // 'å': 'a', duplicate see charMap/latin
  11854. // 'Å': 'A', duplicate see charMap/latin
  11855. "ä": "a",
  11856. // ok
  11857. "Ä": "A",
  11858. // ok
  11859. "ö": "o",
  11860. // ok
  11861. "Ö": "O"
  11862. // ok
  11863. },
  11864. "hu": {
  11865. // Hungarian
  11866. "ä": "a",
  11867. // ok
  11868. "Ä": "A",
  11869. // ok
  11870. // 'á': 'a', duplicate see charMap/latin
  11871. // 'Á': 'A', duplicate see charMap/latin
  11872. "ö": "o",
  11873. // ok
  11874. "Ö": "O",
  11875. // ok
  11876. // 'ő': 'o', duplicate see charMap/latin
  11877. // 'Ő': 'O', duplicate see charMap/latin
  11878. "ü": "u",
  11879. "Ü": "U",
  11880. "ű": "u",
  11881. "Ű": "U"
  11882. },
  11883. "lt": {
  11884. // Lithuanian
  11885. "ą": "a",
  11886. "č": "c",
  11887. "ę": "e",
  11888. "ė": "e",
  11889. "į": "i",
  11890. "š": "s",
  11891. "ų": "u",
  11892. "ū": "u",
  11893. "ž": "z",
  11894. "Ą": "A",
  11895. "Č": "C",
  11896. "Ę": "E",
  11897. "Ė": "E",
  11898. "Į": "I",
  11899. "Š": "S",
  11900. "Ų": "U",
  11901. "Ū": "U"
  11902. },
  11903. "lv": {
  11904. // Latvian
  11905. "ā": "a",
  11906. "č": "c",
  11907. "ē": "e",
  11908. "ģ": "g",
  11909. "ī": "i",
  11910. "ķ": "k",
  11911. "ļ": "l",
  11912. "ņ": "n",
  11913. "š": "s",
  11914. "ū": "u",
  11915. "ž": "z",
  11916. "Ā": "A",
  11917. "Č": "C",
  11918. "Ē": "E",
  11919. "Ģ": "G",
  11920. "Ī": "i",
  11921. "Ķ": "k",
  11922. "Ļ": "L",
  11923. "Ņ": "N",
  11924. "Š": "S",
  11925. "Ū": "u",
  11926. "Ž": "Z"
  11927. },
  11928. "pl": {
  11929. // Polish
  11930. "ą": "a",
  11931. "ć": "c",
  11932. "ę": "e",
  11933. "ł": "l",
  11934. "ń": "n",
  11935. "ó": "o",
  11936. "ś": "s",
  11937. "ź": "z",
  11938. "ż": "z",
  11939. "Ą": "A",
  11940. "Ć": "C",
  11941. "Ę": "e",
  11942. "Ł": "L",
  11943. "Ń": "N",
  11944. "Ó": "O",
  11945. "Ś": "S",
  11946. "Ź": "Z",
  11947. "Ż": "Z"
  11948. },
  11949. "sv": {
  11950. // Swedish
  11951. // 'å': 'a', duplicate see charMap/latin
  11952. // 'Å': 'A', duplicate see charMap/latin
  11953. "ä": "a",
  11954. // ok
  11955. "Ä": "A",
  11956. // ok
  11957. "ö": "o",
  11958. // ok
  11959. "Ö": "O"
  11960. // ok
  11961. },
  11962. "sk": {
  11963. // Slovak
  11964. "ä": "a",
  11965. "Ä": "A"
  11966. },
  11967. "sr": {
  11968. // Serbian
  11969. "љ": "lj",
  11970. "њ": "nj",
  11971. "Љ": "Lj",
  11972. "Њ": "Nj",
  11973. "đ": "dj",
  11974. "Đ": "Dj"
  11975. },
  11976. "tr": {
  11977. // Turkish
  11978. "Ü": "U",
  11979. "Ö": "O",
  11980. "ü": "u",
  11981. "ö": "o"
  11982. }
  11983. };
  11984. var symbolMap = {
  11985. "ar": {
  11986. "∆": "delta",
  11987. "∞": "la-nihaya",
  11988. "♥": "hob",
  11989. "&": "wa",
  11990. "|": "aw",
  11991. "<": "aqal-men",
  11992. ">": "akbar-men",
  11993. "∑": "majmou",
  11994. "¤": "omla"
  11995. },
  11996. "az": {},
  11997. "ca": {
  11998. "∆": "delta",
  11999. "∞": "infinit",
  12000. "♥": "amor",
  12001. "&": "i",
  12002. "|": "o",
  12003. "<": "menys que",
  12004. ">": "mes que",
  12005. "∑": "suma dels",
  12006. "¤": "moneda"
  12007. },
  12008. "cs": {
  12009. "∆": "delta",
  12010. "∞": "nekonecno",
  12011. "♥": "laska",
  12012. "&": "a",
  12013. "|": "nebo",
  12014. "<": "mensi nez",
  12015. ">": "vetsi nez",
  12016. "∑": "soucet",
  12017. "¤": "mena"
  12018. },
  12019. "de": {
  12020. "∆": "delta",
  12021. "∞": "unendlich",
  12022. "♥": "Liebe",
  12023. "&": "und",
  12024. "|": "oder",
  12025. "<": "kleiner als",
  12026. ">": "groesser als",
  12027. "∑": "Summe von",
  12028. "¤": "Waehrung"
  12029. },
  12030. "dv": {
  12031. "∆": "delta",
  12032. "∞": "kolunulaa",
  12033. "♥": "loabi",
  12034. "&": "aai",
  12035. "|": "noonee",
  12036. "<": "ah vure kuda",
  12037. ">": "ah vure bodu",
  12038. "∑": "jumula",
  12039. "¤": "faisaa"
  12040. },
  12041. "en": {
  12042. "∆": "delta",
  12043. "∞": "infinity",
  12044. "♥": "love",
  12045. "&": "and",
  12046. "|": "or",
  12047. "<": "less than",
  12048. ">": "greater than",
  12049. "∑": "sum",
  12050. "¤": "currency"
  12051. },
  12052. "es": {
  12053. "∆": "delta",
  12054. "∞": "infinito",
  12055. "♥": "amor",
  12056. "&": "y",
  12057. "|": "u",
  12058. "<": "menos que",
  12059. ">": "mas que",
  12060. "∑": "suma de los",
  12061. "¤": "moneda"
  12062. },
  12063. "fa": {
  12064. "∆": "delta",
  12065. "∞": "bi-nahayat",
  12066. "♥": "eshgh",
  12067. "&": "va",
  12068. "|": "ya",
  12069. "<": "kamtar-az",
  12070. ">": "bishtar-az",
  12071. "∑": "majmooe",
  12072. "¤": "vahed"
  12073. },
  12074. "fi": {
  12075. "∆": "delta",
  12076. "∞": "aarettomyys",
  12077. "♥": "rakkaus",
  12078. "&": "ja",
  12079. "|": "tai",
  12080. "<": "pienempi kuin",
  12081. ">": "suurempi kuin",
  12082. "∑": "summa",
  12083. "¤": "valuutta"
  12084. },
  12085. "fr": {
  12086. "∆": "delta",
  12087. "∞": "infiniment",
  12088. "♥": "Amour",
  12089. "&": "et",
  12090. "|": "ou",
  12091. "<": "moins que",
  12092. ">": "superieure a",
  12093. "∑": "somme des",
  12094. "¤": "monnaie"
  12095. },
  12096. "ge": {
  12097. "∆": "delta",
  12098. "∞": "usasruloba",
  12099. "♥": "siqvaruli",
  12100. "&": "da",
  12101. "|": "an",
  12102. "<": "naklebi",
  12103. ">": "meti",
  12104. "∑": "jami",
  12105. "¤": "valuta"
  12106. },
  12107. "gr": {},
  12108. "hu": {
  12109. "∆": "delta",
  12110. "∞": "vegtelen",
  12111. "♥": "szerelem",
  12112. "&": "es",
  12113. "|": "vagy",
  12114. "<": "kisebb mint",
  12115. ">": "nagyobb mint",
  12116. "∑": "szumma",
  12117. "¤": "penznem"
  12118. },
  12119. "it": {
  12120. "∆": "delta",
  12121. "∞": "infinito",
  12122. "♥": "amore",
  12123. "&": "e",
  12124. "|": "o",
  12125. "<": "minore di",
  12126. ">": "maggiore di",
  12127. "∑": "somma",
  12128. "¤": "moneta"
  12129. },
  12130. "lt": {
  12131. "∆": "delta",
  12132. "∞": "begalybe",
  12133. "♥": "meile",
  12134. "&": "ir",
  12135. "|": "ar",
  12136. "<": "maziau nei",
  12137. ">": "daugiau nei",
  12138. "∑": "suma",
  12139. "¤": "valiuta"
  12140. },
  12141. "lv": {
  12142. "∆": "delta",
  12143. "∞": "bezgaliba",
  12144. "♥": "milestiba",
  12145. "&": "un",
  12146. "|": "vai",
  12147. "<": "mazak neka",
  12148. ">": "lielaks neka",
  12149. "∑": "summa",
  12150. "¤": "valuta"
  12151. },
  12152. "my": {
  12153. "∆": "kwahkhyaet",
  12154. "∞": "asaonasme",
  12155. "♥": "akhyait",
  12156. "&": "nhin",
  12157. "|": "tho",
  12158. "<": "ngethaw",
  12159. ">": "kyithaw",
  12160. "∑": "paungld",
  12161. "¤": "ngwekye"
  12162. },
  12163. "mk": {},
  12164. "nl": {
  12165. "∆": "delta",
  12166. "∞": "oneindig",
  12167. "♥": "liefde",
  12168. "&": "en",
  12169. "|": "of",
  12170. "<": "kleiner dan",
  12171. ">": "groter dan",
  12172. "∑": "som",
  12173. "¤": "valuta"
  12174. },
  12175. "pl": {
  12176. "∆": "delta",
  12177. "∞": "nieskonczonosc",
  12178. "♥": "milosc",
  12179. "&": "i",
  12180. "|": "lub",
  12181. "<": "mniejsze niz",
  12182. ">": "wieksze niz",
  12183. "∑": "suma",
  12184. "¤": "waluta"
  12185. },
  12186. "pt": {
  12187. "∆": "delta",
  12188. "∞": "infinito",
  12189. "♥": "amor",
  12190. "&": "e",
  12191. "|": "ou",
  12192. "<": "menor que",
  12193. ">": "maior que",
  12194. "∑": "soma",
  12195. "¤": "moeda"
  12196. },
  12197. "ro": {
  12198. "∆": "delta",
  12199. "∞": "infinit",
  12200. "♥": "dragoste",
  12201. "&": "si",
  12202. "|": "sau",
  12203. "<": "mai mic ca",
  12204. ">": "mai mare ca",
  12205. "∑": "suma",
  12206. "¤": "valuta"
  12207. },
  12208. "ru": {
  12209. "∆": "delta",
  12210. "∞": "beskonechno",
  12211. "♥": "lubov",
  12212. "&": "i",
  12213. "|": "ili",
  12214. "<": "menshe",
  12215. ">": "bolshe",
  12216. "∑": "summa",
  12217. "¤": "valjuta"
  12218. },
  12219. "sk": {
  12220. "∆": "delta",
  12221. "∞": "nekonecno",
  12222. "♥": "laska",
  12223. "&": "a",
  12224. "|": "alebo",
  12225. "<": "menej ako",
  12226. ">": "viac ako",
  12227. "∑": "sucet",
  12228. "¤": "mena"
  12229. },
  12230. "sr": {},
  12231. "tr": {
  12232. "∆": "delta",
  12233. "∞": "sonsuzluk",
  12234. "♥": "ask",
  12235. "&": "ve",
  12236. "|": "veya",
  12237. "<": "kucuktur",
  12238. ">": "buyuktur",
  12239. "∑": "toplam",
  12240. "¤": "para birimi"
  12241. },
  12242. "uk": {
  12243. "∆": "delta",
  12244. "∞": "bezkinechnist",
  12245. "♥": "lubov",
  12246. "&": "i",
  12247. "|": "abo",
  12248. "<": "menshe",
  12249. ">": "bilshe",
  12250. "∑": "suma",
  12251. "¤": "valjuta"
  12252. },
  12253. "vn": {
  12254. "∆": "delta",
  12255. "∞": "vo cuc",
  12256. "♥": "yeu",
  12257. "&": "va",
  12258. "|": "hoac",
  12259. "<": "nho hon",
  12260. ">": "lon hon",
  12261. "∑": "tong",
  12262. "¤": "tien te"
  12263. }
  12264. };
  12265. var uricChars = [";", "?", ":", "@", "&", "=", "+", "$", ",", "/"].join("");
  12266. var uricNoSlashChars = [";", "?", ":", "@", "&", "=", "+", "$", ","].join("");
  12267. var markChars = [".", "!", "~", "*", "'", "(", ")"].join("");
  12268. var getSlug = function getSlug2(input, opts) {
  12269. var separator = "-";
  12270. var result = "";
  12271. var diatricString = "";
  12272. var convertSymbols = true;
  12273. var customReplacements = {};
  12274. var maintainCase;
  12275. var titleCase;
  12276. var truncate;
  12277. var uricFlag;
  12278. var uricNoSlashFlag;
  12279. var markFlag;
  12280. var symbol;
  12281. var langChar;
  12282. var lucky;
  12283. var i2;
  12284. var ch;
  12285. var l2;
  12286. var lastCharWasSymbol;
  12287. var lastCharWasDiatric;
  12288. var allowedChars = "";
  12289. if (typeof input !== "string") {
  12290. return "";
  12291. }
  12292. if (typeof opts === "string") {
  12293. separator = opts;
  12294. }
  12295. symbol = symbolMap.en;
  12296. langChar = langCharMap.en;
  12297. if (typeof opts === "object") {
  12298. maintainCase = opts.maintainCase || false;
  12299. customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
  12300. truncate = +opts.truncate > 1 && opts.truncate || false;
  12301. uricFlag = opts.uric || false;
  12302. uricNoSlashFlag = opts.uricNoSlash || false;
  12303. markFlag = opts.mark || false;
  12304. convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
  12305. separator = opts.separator || separator;
  12306. if (uricFlag) {
  12307. allowedChars += uricChars;
  12308. }
  12309. if (uricNoSlashFlag) {
  12310. allowedChars += uricNoSlashChars;
  12311. }
  12312. if (markFlag) {
  12313. allowedChars += markChars;
  12314. }
  12315. symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
  12316. langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  12317. if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
  12318. opts.titleCase.forEach(function(v2) {
  12319. customReplacements[v2 + ""] = v2 + "";
  12320. });
  12321. titleCase = true;
  12322. } else {
  12323. titleCase = !!opts.titleCase;
  12324. }
  12325. if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) {
  12326. opts.custom.forEach(function(v2) {
  12327. customReplacements[v2 + ""] = v2 + "";
  12328. });
  12329. }
  12330. Object.keys(customReplacements).forEach(function(v2) {
  12331. var r2;
  12332. if (v2.length > 1) {
  12333. r2 = new RegExp("\\b" + escapeChars(v2) + "\\b", "gi");
  12334. } else {
  12335. r2 = new RegExp(escapeChars(v2), "gi");
  12336. }
  12337. input = input.replace(r2, customReplacements[v2]);
  12338. });
  12339. for (ch in customReplacements) {
  12340. allowedChars += ch;
  12341. }
  12342. }
  12343. allowedChars += separator;
  12344. allowedChars = escapeChars(allowedChars);
  12345. input = input.replace(/(^\s+|\s+$)/g, "");
  12346. lastCharWasSymbol = false;
  12347. lastCharWasDiatric = false;
  12348. for (i2 = 0, l2 = input.length; i2 < l2; i2++) {
  12349. ch = input[i2];
  12350. if (isReplacedCustomChar(ch, customReplacements)) {
  12351. lastCharWasSymbol = false;
  12352. } else if (langChar[ch]) {
  12353. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
  12354. lastCharWasSymbol = false;
  12355. } else if (ch in charMap) {
  12356. if (i2 + 1 < l2 && lookAheadCharArray.indexOf(input[i2 + 1]) >= 0) {
  12357. diatricString += ch;
  12358. ch = "";
  12359. } else if (lastCharWasDiatric === true) {
  12360. ch = diatricMap[diatricString] + charMap[ch];
  12361. diatricString = "";
  12362. } else {
  12363. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
  12364. }
  12365. lastCharWasSymbol = false;
  12366. lastCharWasDiatric = false;
  12367. } else if (ch in diatricMap) {
  12368. diatricString += ch;
  12369. ch = "";
  12370. if (i2 === l2 - 1) {
  12371. ch = diatricMap[diatricString];
  12372. }
  12373. lastCharWasDiatric = true;
  12374. } else if (
  12375. // process symbol chars
  12376. symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)
  12377. ) {
  12378. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  12379. ch += input[i2 + 1] !== void 0 && input[i2 + 1].match(/[A-Za-z0-9]/) ? separator : "";
  12380. lastCharWasSymbol = true;
  12381. } else {
  12382. if (lastCharWasDiatric === true) {
  12383. ch = diatricMap[diatricString] + ch;
  12384. diatricString = "";
  12385. lastCharWasDiatric = false;
  12386. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  12387. ch = " " + ch;
  12388. }
  12389. lastCharWasSymbol = false;
  12390. }
  12391. result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
  12392. }
  12393. if (titleCase) {
  12394. result = result.replace(/(\w)(\S*)/g, function(_2, i3, r2) {
  12395. var j2 = i3.toUpperCase() + (r2 !== null ? r2 : "");
  12396. return Object.keys(customReplacements).indexOf(j2.toLowerCase()) < 0 ? j2 : j2.toLowerCase();
  12397. });
  12398. }
  12399. result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
  12400. if (truncate && result.length > truncate) {
  12401. lucky = result.charAt(truncate) === separator;
  12402. result = result.slice(0, truncate);
  12403. if (!lucky) {
  12404. result = result.slice(0, result.lastIndexOf(separator));
  12405. }
  12406. }
  12407. if (!maintainCase && !titleCase) {
  12408. result = result.toLowerCase();
  12409. }
  12410. return result;
  12411. };
  12412. var createSlug = function createSlug2(opts) {
  12413. return function getSlugWithConfig(input) {
  12414. return getSlug(input, opts);
  12415. };
  12416. };
  12417. var escapeChars = function escapeChars2(input) {
  12418. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
  12419. };
  12420. var isReplacedCustomChar = function(ch, customReplacements) {
  12421. for (var c2 in customReplacements) {
  12422. if (customReplacements[c2] === ch) {
  12423. return true;
  12424. }
  12425. }
  12426. };
  12427. if (module.exports) {
  12428. module.exports = getSlug;
  12429. module.exports.createSlug = createSlug;
  12430. } else {
  12431. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  12432. return getSlug;
  12433. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  12434. }
  12435. })();
  12436. }
  12437. )
  12438. /******/
  12439. };
  12440. var __webpack_module_cache__ = {};
  12441. function __webpack_require__(moduleId) {
  12442. var cachedModule = __webpack_module_cache__[moduleId];
  12443. if (cachedModule !== void 0) {
  12444. return cachedModule.exports;
  12445. }
  12446. var module = __webpack_module_cache__[moduleId] = {
  12447. /******/
  12448. // no module.id needed
  12449. /******/
  12450. // no module.loaded needed
  12451. /******/
  12452. exports: {}
  12453. /******/
  12454. };
  12455. __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  12456. return module.exports;
  12457. }
  12458. (() => {
  12459. __webpack_require__.n = (module) => {
  12460. var getter = module && module.__esModule ? (
  12461. /******/
  12462. () => module["default"]
  12463. ) : (
  12464. /******/
  12465. () => module
  12466. );
  12467. __webpack_require__.d(getter, { a: getter });
  12468. return getter;
  12469. };
  12470. })();
  12471. (() => {
  12472. __webpack_require__.d = (exports, definition) => {
  12473. for (var key in definition) {
  12474. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  12475. Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  12476. }
  12477. }
  12478. };
  12479. })();
  12480. (() => {
  12481. __webpack_require__.g = function() {
  12482. if (typeof globalThis === "object")
  12483. return globalThis;
  12484. try {
  12485. return this || new Function("return this")();
  12486. } catch (e2) {
  12487. if (typeof window === "object")
  12488. return window;
  12489. }
  12490. }();
  12491. })();
  12492. (() => {
  12493. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  12494. })();
  12495. (() => {
  12496. __webpack_require__.r = (exports) => {
  12497. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  12498. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  12499. }
  12500. Object.defineProperty(exports, "__esModule", { value: true });
  12501. };
  12502. })();
  12503. var __webpack_exports__ = {};
  12504. (() => {
  12505. /*!************************!*\
  12506. !*** ./src/backend.ts ***!
  12507. \************************/
  12508. __webpack_require__.r(__webpack_exports__);
  12509. var _back_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
  12510. /*! @back/index */
  12511. "../app-backend-core/lib/index.js"
  12512. );
  12513. var _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
  12514. /*! @vue-devtools/shared-utils */
  12515. "../shared-utils/lib/index.js"
  12516. );
  12517. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_ON_SOCKET_READY__(() => {
  12518. const socket = _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_SOCKET__;
  12519. const connectedMessage = () => {
  12520. if (_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__) {
  12521. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__("Remote Devtools Connected", "normal");
  12522. }
  12523. };
  12524. const disconnectedMessage = () => {
  12525. if (_vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__) {
  12526. _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.target.__VUE_DEVTOOLS_TOAST__("Remote Devtools Disconnected", "error");
  12527. }
  12528. };
  12529. socket.on("connect", () => {
  12530. connectedMessage();
  12531. (0, _back_index__WEBPACK_IMPORTED_MODULE_0__.initBackend)(bridge);
  12532. socket.emit("vue-devtools-init");
  12533. });
  12534. socket.on("disconnect", () => {
  12535. socket.disconnect();
  12536. disconnectedMessage();
  12537. });
  12538. socket.on("vue-devtools-disconnect-backend", () => {
  12539. socket.disconnect();
  12540. });
  12541. const bridge = new _vue_devtools_shared_utils__WEBPACK_IMPORTED_MODULE_1__.Bridge({
  12542. listen(fn) {
  12543. socket.on("vue-message", (data) => fn(data));
  12544. },
  12545. send(data) {
  12546. socket.emit("vue-message", data);
  12547. }
  12548. });
  12549. bridge.on("shutdown", () => {
  12550. socket.disconnect();
  12551. disconnectedMessage();
  12552. });
  12553. });
  12554. })();
  12555. })();
  12556. const _export_sfc = (sfc, props) => {
  12557. const target = sfc.__vccOpts || sfc;
  12558. for (const [key, val] of props) {
  12559. target[key] = val;
  12560. }
  12561. return target;
  12562. };
  12563. const _sfc_main$A = {
  12564. name: "UniGridItem",
  12565. inject: ["grid"],
  12566. props: {
  12567. index: {
  12568. type: Number,
  12569. default: 0
  12570. }
  12571. },
  12572. data() {
  12573. return {
  12574. column: 0,
  12575. showBorder: true,
  12576. square: true,
  12577. highlight: true,
  12578. left: 0,
  12579. top: 0,
  12580. openNum: 2,
  12581. width: 0,
  12582. borderColor: "#e5e5e5"
  12583. };
  12584. },
  12585. created() {
  12586. this.column = this.grid.column;
  12587. this.showBorder = this.grid.showBorder;
  12588. this.square = this.grid.square;
  12589. this.highlight = this.grid.highlight;
  12590. this.top = this.hor === 0 ? this.grid.hor : this.hor;
  12591. this.left = this.ver === 0 ? this.grid.ver : this.ver;
  12592. this.borderColor = this.grid.borderColor;
  12593. this.grid.children.push(this);
  12594. this.width = this.grid.width;
  12595. },
  12596. beforeDestroy() {
  12597. this.grid.children.forEach((item, index) => {
  12598. if (item === this) {
  12599. this.grid.children.splice(index, 1);
  12600. }
  12601. });
  12602. },
  12603. methods: {
  12604. _onClick() {
  12605. this.grid.change({
  12606. detail: {
  12607. index: this.index
  12608. }
  12609. });
  12610. }
  12611. }
  12612. };
  12613. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  12614. return $data.width ? (vue.openBlock(), vue.createElementBlock(
  12615. "view",
  12616. {
  12617. key: 0,
  12618. style: vue.normalizeStyle("width:" + $data.width + ";" + ($data.square ? "height:" + $data.width : "")),
  12619. class: "uni-grid-item"
  12620. },
  12621. [
  12622. vue.createElementVNode(
  12623. "view",
  12624. {
  12625. class: vue.normalizeClass([{ "uni-grid-item--border": $data.showBorder, "uni-grid-item--border-top": $data.showBorder && $props.index < $data.column, "uni-highlight": $data.highlight }, "uni-grid-item__box"]),
  12626. style: vue.normalizeStyle({ "border-right-color": $data.borderColor, "border-bottom-color": $data.borderColor, "border-top-color": $data.borderColor }),
  12627. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  12628. },
  12629. [
  12630. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  12631. ],
  12632. 6
  12633. /* CLASS, STYLE */
  12634. )
  12635. ],
  12636. 4
  12637. /* STYLE */
  12638. )) : vue.createCommentVNode("v-if", true);
  12639. }
  12640. const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-7a807eb7"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue"]]);
  12641. const ON_SHOW = "onShow";
  12642. const ON_HIDE = "onHide";
  12643. const ON_LOAD = "onLoad";
  12644. const ON_UNLOAD = "onUnload";
  12645. const ON_BACK_PRESS = "onBackPress";
  12646. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  12647. function formatAppLog(type, filename, ...args) {
  12648. if (uni.__log__) {
  12649. uni.__log__(type, filename, ...args);
  12650. } else {
  12651. console[type].apply(console, [...args, filename]);
  12652. }
  12653. }
  12654. function resolveEasycom(component, easycom) {
  12655. return typeof component === "string" ? easycom : component;
  12656. }
  12657. const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
  12658. !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
  12659. };
  12660. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  12661. const onHide = /* @__PURE__ */ createHook(ON_HIDE);
  12662. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  12663. const onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
  12664. const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
  12665. const onNavigationBarButtonTap = /* @__PURE__ */ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
  12666. const _sfc_main$z = {
  12667. name: "UniGrid",
  12668. emits: ["change"],
  12669. props: {
  12670. // 每列显示个数
  12671. column: {
  12672. type: Number,
  12673. default: 3
  12674. },
  12675. // 是否显示边框
  12676. showBorder: {
  12677. type: Boolean,
  12678. default: true
  12679. },
  12680. // 边框颜色
  12681. borderColor: {
  12682. type: String,
  12683. default: "#D2D2D2"
  12684. },
  12685. // 是否正方形显示,默认为 true
  12686. square: {
  12687. type: Boolean,
  12688. default: true
  12689. },
  12690. highlight: {
  12691. type: Boolean,
  12692. default: true
  12693. }
  12694. },
  12695. provide() {
  12696. return {
  12697. grid: this
  12698. };
  12699. },
  12700. data() {
  12701. const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
  12702. return {
  12703. elId,
  12704. width: 0
  12705. };
  12706. },
  12707. created() {
  12708. this.children = [];
  12709. },
  12710. mounted() {
  12711. this.$nextTick(() => {
  12712. this.init();
  12713. });
  12714. },
  12715. methods: {
  12716. init() {
  12717. setTimeout(() => {
  12718. this._getSize((width) => {
  12719. this.children.forEach((item, index) => {
  12720. item.width = width;
  12721. });
  12722. });
  12723. }, 50);
  12724. },
  12725. change(e2) {
  12726. this.$emit("change", e2);
  12727. },
  12728. _getSize(fn) {
  12729. uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
  12730. this.width = parseInt((ret[0].width - 1) / this.column) + "px";
  12731. fn(this.width);
  12732. });
  12733. }
  12734. }
  12735. };
  12736. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  12737. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-grid-wrap" }, [
  12738. vue.createElementVNode("view", {
  12739. id: $data.elId,
  12740. ref: "uni-grid",
  12741. class: vue.normalizeClass(["uni-grid", { "uni-grid--border": $props.showBorder }]),
  12742. style: vue.normalizeStyle({ "border-left-color": $props.borderColor })
  12743. }, [
  12744. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  12745. ], 14, ["id"])
  12746. ]);
  12747. }
  12748. const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-07acefee"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-grid/components/uni-grid/uni-grid.vue"]]);
  12749. const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
  12750. __name: "index",
  12751. setup(__props, { expose: __expose }) {
  12752. __expose();
  12753. const token = vue.ref(null);
  12754. const user = vue.ref(null);
  12755. const list = vue.ref([
  12756. // {
  12757. // url: '/pages/scan/index',
  12758. // src: '/static/scan_fill.png',
  12759. // text: '扫描入库'
  12760. // },
  12761. {
  12762. url: "/pages/instock/index",
  12763. src: "/static/weigh_fill.png",
  12764. text: "称重"
  12765. },
  12766. {
  12767. url: "/pages/warehouseScan/index",
  12768. src: "/static/houscan.png",
  12769. text: "仓库扫描"
  12770. },
  12771. {
  12772. url: "/pages/printer/index",
  12773. src: "/static/houscan.png",
  12774. text: "打印"
  12775. },
  12776. {
  12777. url: "/pages/scanLotno/index",
  12778. src: "/static/link.png",
  12779. text: "托盘/批次"
  12780. },
  12781. {
  12782. url: "/pages/waybillNo/index",
  12783. src: "/static/link.png",
  12784. text: "库位绑定"
  12785. },
  12786. {
  12787. url: "/pages/waybillDeliveryOrder/index",
  12788. src: "/static/dispatch.png",
  12789. text: "派送单"
  12790. }
  12791. ]);
  12792. onShow(() => {
  12793. token.value = uni.getStorageSync("token");
  12794. user.value = uni.getStorageSync("user");
  12795. formatAppLog("log", "at pages/home/index.vue:60", "show---", { token: token.value, user: user.value });
  12796. });
  12797. const itemClick = (url) => {
  12798. formatAppLog("log", "at pages/home/index.vue:63", url);
  12799. if (token.value) {
  12800. uni.navigateTo({
  12801. url
  12802. });
  12803. } else {
  12804. uni.navigateTo({
  12805. url: "/pages/login/index"
  12806. });
  12807. }
  12808. };
  12809. const change = () => {
  12810. };
  12811. const logout = () => {
  12812. uni.removeStorageSync("token");
  12813. uni.removeStorageSync("user");
  12814. token.value = uni.getStorageSync("token");
  12815. user.value = uni.getStorageSync("user");
  12816. };
  12817. const __returned__ = { token, user, list, itemClick, change, logout };
  12818. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  12819. return __returned__;
  12820. }
  12821. });
  12822. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  12823. const _component_uni_grid_item = resolveEasycom(vue.resolveDynamicComponent("uni-grid-item"), __easycom_0$7);
  12824. const _component_uni_grid = resolveEasycom(vue.resolveDynamicComponent("uni-grid"), __easycom_1$2);
  12825. return vue.openBlock(), vue.createElementBlock("view", { class: "warp" }, [
  12826. vue.createVNode(_component_uni_grid, {
  12827. class: "grid",
  12828. column: 3,
  12829. "show-border": false,
  12830. square: false,
  12831. onChange: $setup.change
  12832. }, {
  12833. default: vue.withCtx(() => [
  12834. (vue.openBlock(true), vue.createElementBlock(
  12835. vue.Fragment,
  12836. null,
  12837. vue.renderList($setup.list, (item, index) => {
  12838. return vue.openBlock(), vue.createBlock(_component_uni_grid_item, {
  12839. index,
  12840. key: index
  12841. }, {
  12842. default: vue.withCtx(() => [
  12843. vue.createElementVNode("view", {
  12844. class: "grid-item-box",
  12845. onClick: ($event) => $setup.itemClick(item.url)
  12846. }, [
  12847. vue.createElementVNode("image", {
  12848. class: "image",
  12849. src: item.src,
  12850. mode: "aspectFill"
  12851. }, null, 8, ["src"]),
  12852. vue.createElementVNode(
  12853. "text",
  12854. { class: "text" },
  12855. vue.toDisplayString(item.text),
  12856. 1
  12857. /* TEXT */
  12858. )
  12859. ], 8, ["onClick"])
  12860. ]),
  12861. _: 2
  12862. /* DYNAMIC */
  12863. }, 1032, ["index"]);
  12864. }),
  12865. 128
  12866. /* KEYED_FRAGMENT */
  12867. ))
  12868. ]),
  12869. _: 1
  12870. /* STABLE */
  12871. })
  12872. ]);
  12873. }
  12874. const PagesHomeIndex = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__file", "E:/HBuilderProjects/YTAPP/pages/home/index.vue"]]);
  12875. const fontData = [
  12876. {
  12877. "font_class": "arrow-down",
  12878. "unicode": ""
  12879. },
  12880. {
  12881. "font_class": "arrow-left",
  12882. "unicode": ""
  12883. },
  12884. {
  12885. "font_class": "arrow-right",
  12886. "unicode": ""
  12887. },
  12888. {
  12889. "font_class": "arrow-up",
  12890. "unicode": ""
  12891. },
  12892. {
  12893. "font_class": "auth",
  12894. "unicode": ""
  12895. },
  12896. {
  12897. "font_class": "auth-filled",
  12898. "unicode": ""
  12899. },
  12900. {
  12901. "font_class": "back",
  12902. "unicode": ""
  12903. },
  12904. {
  12905. "font_class": "bars",
  12906. "unicode": ""
  12907. },
  12908. {
  12909. "font_class": "calendar",
  12910. "unicode": ""
  12911. },
  12912. {
  12913. "font_class": "calendar-filled",
  12914. "unicode": ""
  12915. },
  12916. {
  12917. "font_class": "camera",
  12918. "unicode": ""
  12919. },
  12920. {
  12921. "font_class": "camera-filled",
  12922. "unicode": ""
  12923. },
  12924. {
  12925. "font_class": "cart",
  12926. "unicode": ""
  12927. },
  12928. {
  12929. "font_class": "cart-filled",
  12930. "unicode": ""
  12931. },
  12932. {
  12933. "font_class": "chat",
  12934. "unicode": ""
  12935. },
  12936. {
  12937. "font_class": "chat-filled",
  12938. "unicode": ""
  12939. },
  12940. {
  12941. "font_class": "chatboxes",
  12942. "unicode": ""
  12943. },
  12944. {
  12945. "font_class": "chatboxes-filled",
  12946. "unicode": ""
  12947. },
  12948. {
  12949. "font_class": "chatbubble",
  12950. "unicode": ""
  12951. },
  12952. {
  12953. "font_class": "chatbubble-filled",
  12954. "unicode": ""
  12955. },
  12956. {
  12957. "font_class": "checkbox",
  12958. "unicode": ""
  12959. },
  12960. {
  12961. "font_class": "checkbox-filled",
  12962. "unicode": ""
  12963. },
  12964. {
  12965. "font_class": "checkmarkempty",
  12966. "unicode": ""
  12967. },
  12968. {
  12969. "font_class": "circle",
  12970. "unicode": ""
  12971. },
  12972. {
  12973. "font_class": "circle-filled",
  12974. "unicode": ""
  12975. },
  12976. {
  12977. "font_class": "clear",
  12978. "unicode": ""
  12979. },
  12980. {
  12981. "font_class": "close",
  12982. "unicode": ""
  12983. },
  12984. {
  12985. "font_class": "closeempty",
  12986. "unicode": ""
  12987. },
  12988. {
  12989. "font_class": "cloud-download",
  12990. "unicode": ""
  12991. },
  12992. {
  12993. "font_class": "cloud-download-filled",
  12994. "unicode": ""
  12995. },
  12996. {
  12997. "font_class": "cloud-upload",
  12998. "unicode": ""
  12999. },
  13000. {
  13001. "font_class": "cloud-upload-filled",
  13002. "unicode": ""
  13003. },
  13004. {
  13005. "font_class": "color",
  13006. "unicode": ""
  13007. },
  13008. {
  13009. "font_class": "color-filled",
  13010. "unicode": ""
  13011. },
  13012. {
  13013. "font_class": "compose",
  13014. "unicode": ""
  13015. },
  13016. {
  13017. "font_class": "contact",
  13018. "unicode": ""
  13019. },
  13020. {
  13021. "font_class": "contact-filled",
  13022. "unicode": ""
  13023. },
  13024. {
  13025. "font_class": "down",
  13026. "unicode": ""
  13027. },
  13028. {
  13029. "font_class": "bottom",
  13030. "unicode": ""
  13031. },
  13032. {
  13033. "font_class": "download",
  13034. "unicode": ""
  13035. },
  13036. {
  13037. "font_class": "download-filled",
  13038. "unicode": ""
  13039. },
  13040. {
  13041. "font_class": "email",
  13042. "unicode": ""
  13043. },
  13044. {
  13045. "font_class": "email-filled",
  13046. "unicode": ""
  13047. },
  13048. {
  13049. "font_class": "eye",
  13050. "unicode": ""
  13051. },
  13052. {
  13053. "font_class": "eye-filled",
  13054. "unicode": ""
  13055. },
  13056. {
  13057. "font_class": "eye-slash",
  13058. "unicode": ""
  13059. },
  13060. {
  13061. "font_class": "eye-slash-filled",
  13062. "unicode": ""
  13063. },
  13064. {
  13065. "font_class": "fire",
  13066. "unicode": ""
  13067. },
  13068. {
  13069. "font_class": "fire-filled",
  13070. "unicode": ""
  13071. },
  13072. {
  13073. "font_class": "flag",
  13074. "unicode": ""
  13075. },
  13076. {
  13077. "font_class": "flag-filled",
  13078. "unicode": ""
  13079. },
  13080. {
  13081. "font_class": "folder-add",
  13082. "unicode": ""
  13083. },
  13084. {
  13085. "font_class": "folder-add-filled",
  13086. "unicode": ""
  13087. },
  13088. {
  13089. "font_class": "font",
  13090. "unicode": ""
  13091. },
  13092. {
  13093. "font_class": "forward",
  13094. "unicode": ""
  13095. },
  13096. {
  13097. "font_class": "gear",
  13098. "unicode": ""
  13099. },
  13100. {
  13101. "font_class": "gear-filled",
  13102. "unicode": ""
  13103. },
  13104. {
  13105. "font_class": "gift",
  13106. "unicode": ""
  13107. },
  13108. {
  13109. "font_class": "gift-filled",
  13110. "unicode": ""
  13111. },
  13112. {
  13113. "font_class": "hand-down",
  13114. "unicode": ""
  13115. },
  13116. {
  13117. "font_class": "hand-down-filled",
  13118. "unicode": ""
  13119. },
  13120. {
  13121. "font_class": "hand-up",
  13122. "unicode": ""
  13123. },
  13124. {
  13125. "font_class": "hand-up-filled",
  13126. "unicode": ""
  13127. },
  13128. {
  13129. "font_class": "headphones",
  13130. "unicode": ""
  13131. },
  13132. {
  13133. "font_class": "heart",
  13134. "unicode": ""
  13135. },
  13136. {
  13137. "font_class": "heart-filled",
  13138. "unicode": ""
  13139. },
  13140. {
  13141. "font_class": "help",
  13142. "unicode": ""
  13143. },
  13144. {
  13145. "font_class": "help-filled",
  13146. "unicode": ""
  13147. },
  13148. {
  13149. "font_class": "home",
  13150. "unicode": ""
  13151. },
  13152. {
  13153. "font_class": "home-filled",
  13154. "unicode": ""
  13155. },
  13156. {
  13157. "font_class": "image",
  13158. "unicode": ""
  13159. },
  13160. {
  13161. "font_class": "image-filled",
  13162. "unicode": ""
  13163. },
  13164. {
  13165. "font_class": "images",
  13166. "unicode": ""
  13167. },
  13168. {
  13169. "font_class": "images-filled",
  13170. "unicode": ""
  13171. },
  13172. {
  13173. "font_class": "info",
  13174. "unicode": ""
  13175. },
  13176. {
  13177. "font_class": "info-filled",
  13178. "unicode": ""
  13179. },
  13180. {
  13181. "font_class": "left",
  13182. "unicode": ""
  13183. },
  13184. {
  13185. "font_class": "link",
  13186. "unicode": ""
  13187. },
  13188. {
  13189. "font_class": "list",
  13190. "unicode": ""
  13191. },
  13192. {
  13193. "font_class": "location",
  13194. "unicode": ""
  13195. },
  13196. {
  13197. "font_class": "location-filled",
  13198. "unicode": ""
  13199. },
  13200. {
  13201. "font_class": "locked",
  13202. "unicode": ""
  13203. },
  13204. {
  13205. "font_class": "locked-filled",
  13206. "unicode": ""
  13207. },
  13208. {
  13209. "font_class": "loop",
  13210. "unicode": ""
  13211. },
  13212. {
  13213. "font_class": "mail-open",
  13214. "unicode": ""
  13215. },
  13216. {
  13217. "font_class": "mail-open-filled",
  13218. "unicode": ""
  13219. },
  13220. {
  13221. "font_class": "map",
  13222. "unicode": ""
  13223. },
  13224. {
  13225. "font_class": "map-filled",
  13226. "unicode": ""
  13227. },
  13228. {
  13229. "font_class": "map-pin",
  13230. "unicode": ""
  13231. },
  13232. {
  13233. "font_class": "map-pin-ellipse",
  13234. "unicode": ""
  13235. },
  13236. {
  13237. "font_class": "medal",
  13238. "unicode": ""
  13239. },
  13240. {
  13241. "font_class": "medal-filled",
  13242. "unicode": ""
  13243. },
  13244. {
  13245. "font_class": "mic",
  13246. "unicode": ""
  13247. },
  13248. {
  13249. "font_class": "mic-filled",
  13250. "unicode": ""
  13251. },
  13252. {
  13253. "font_class": "micoff",
  13254. "unicode": ""
  13255. },
  13256. {
  13257. "font_class": "micoff-filled",
  13258. "unicode": ""
  13259. },
  13260. {
  13261. "font_class": "minus",
  13262. "unicode": ""
  13263. },
  13264. {
  13265. "font_class": "minus-filled",
  13266. "unicode": ""
  13267. },
  13268. {
  13269. "font_class": "more",
  13270. "unicode": ""
  13271. },
  13272. {
  13273. "font_class": "more-filled",
  13274. "unicode": ""
  13275. },
  13276. {
  13277. "font_class": "navigate",
  13278. "unicode": ""
  13279. },
  13280. {
  13281. "font_class": "navigate-filled",
  13282. "unicode": ""
  13283. },
  13284. {
  13285. "font_class": "notification",
  13286. "unicode": ""
  13287. },
  13288. {
  13289. "font_class": "notification-filled",
  13290. "unicode": ""
  13291. },
  13292. {
  13293. "font_class": "paperclip",
  13294. "unicode": ""
  13295. },
  13296. {
  13297. "font_class": "paperplane",
  13298. "unicode": ""
  13299. },
  13300. {
  13301. "font_class": "paperplane-filled",
  13302. "unicode": ""
  13303. },
  13304. {
  13305. "font_class": "person",
  13306. "unicode": ""
  13307. },
  13308. {
  13309. "font_class": "person-filled",
  13310. "unicode": ""
  13311. },
  13312. {
  13313. "font_class": "personadd",
  13314. "unicode": ""
  13315. },
  13316. {
  13317. "font_class": "personadd-filled",
  13318. "unicode": ""
  13319. },
  13320. {
  13321. "font_class": "personadd-filled-copy",
  13322. "unicode": ""
  13323. },
  13324. {
  13325. "font_class": "phone",
  13326. "unicode": ""
  13327. },
  13328. {
  13329. "font_class": "phone-filled",
  13330. "unicode": ""
  13331. },
  13332. {
  13333. "font_class": "plus",
  13334. "unicode": ""
  13335. },
  13336. {
  13337. "font_class": "plus-filled",
  13338. "unicode": ""
  13339. },
  13340. {
  13341. "font_class": "plusempty",
  13342. "unicode": ""
  13343. },
  13344. {
  13345. "font_class": "pulldown",
  13346. "unicode": ""
  13347. },
  13348. {
  13349. "font_class": "pyq",
  13350. "unicode": ""
  13351. },
  13352. {
  13353. "font_class": "qq",
  13354. "unicode": ""
  13355. },
  13356. {
  13357. "font_class": "redo",
  13358. "unicode": ""
  13359. },
  13360. {
  13361. "font_class": "redo-filled",
  13362. "unicode": ""
  13363. },
  13364. {
  13365. "font_class": "refresh",
  13366. "unicode": ""
  13367. },
  13368. {
  13369. "font_class": "refresh-filled",
  13370. "unicode": ""
  13371. },
  13372. {
  13373. "font_class": "refreshempty",
  13374. "unicode": ""
  13375. },
  13376. {
  13377. "font_class": "reload",
  13378. "unicode": ""
  13379. },
  13380. {
  13381. "font_class": "right",
  13382. "unicode": ""
  13383. },
  13384. {
  13385. "font_class": "scan",
  13386. "unicode": ""
  13387. },
  13388. {
  13389. "font_class": "search",
  13390. "unicode": ""
  13391. },
  13392. {
  13393. "font_class": "settings",
  13394. "unicode": ""
  13395. },
  13396. {
  13397. "font_class": "settings-filled",
  13398. "unicode": ""
  13399. },
  13400. {
  13401. "font_class": "shop",
  13402. "unicode": ""
  13403. },
  13404. {
  13405. "font_class": "shop-filled",
  13406. "unicode": ""
  13407. },
  13408. {
  13409. "font_class": "smallcircle",
  13410. "unicode": ""
  13411. },
  13412. {
  13413. "font_class": "smallcircle-filled",
  13414. "unicode": ""
  13415. },
  13416. {
  13417. "font_class": "sound",
  13418. "unicode": ""
  13419. },
  13420. {
  13421. "font_class": "sound-filled",
  13422. "unicode": ""
  13423. },
  13424. {
  13425. "font_class": "spinner-cycle",
  13426. "unicode": ""
  13427. },
  13428. {
  13429. "font_class": "staff",
  13430. "unicode": ""
  13431. },
  13432. {
  13433. "font_class": "staff-filled",
  13434. "unicode": ""
  13435. },
  13436. {
  13437. "font_class": "star",
  13438. "unicode": ""
  13439. },
  13440. {
  13441. "font_class": "star-filled",
  13442. "unicode": ""
  13443. },
  13444. {
  13445. "font_class": "starhalf",
  13446. "unicode": ""
  13447. },
  13448. {
  13449. "font_class": "trash",
  13450. "unicode": ""
  13451. },
  13452. {
  13453. "font_class": "trash-filled",
  13454. "unicode": ""
  13455. },
  13456. {
  13457. "font_class": "tune",
  13458. "unicode": ""
  13459. },
  13460. {
  13461. "font_class": "tune-filled",
  13462. "unicode": ""
  13463. },
  13464. {
  13465. "font_class": "undo",
  13466. "unicode": ""
  13467. },
  13468. {
  13469. "font_class": "undo-filled",
  13470. "unicode": ""
  13471. },
  13472. {
  13473. "font_class": "up",
  13474. "unicode": ""
  13475. },
  13476. {
  13477. "font_class": "top",
  13478. "unicode": ""
  13479. },
  13480. {
  13481. "font_class": "upload",
  13482. "unicode": ""
  13483. },
  13484. {
  13485. "font_class": "upload-filled",
  13486. "unicode": ""
  13487. },
  13488. {
  13489. "font_class": "videocam",
  13490. "unicode": ""
  13491. },
  13492. {
  13493. "font_class": "videocam-filled",
  13494. "unicode": ""
  13495. },
  13496. {
  13497. "font_class": "vip",
  13498. "unicode": ""
  13499. },
  13500. {
  13501. "font_class": "vip-filled",
  13502. "unicode": ""
  13503. },
  13504. {
  13505. "font_class": "wallet",
  13506. "unicode": ""
  13507. },
  13508. {
  13509. "font_class": "wallet-filled",
  13510. "unicode": ""
  13511. },
  13512. {
  13513. "font_class": "weibo",
  13514. "unicode": ""
  13515. },
  13516. {
  13517. "font_class": "weixin",
  13518. "unicode": ""
  13519. }
  13520. ];
  13521. const getVal = (val) => {
  13522. const reg = /^[0-9]*$/g;
  13523. return typeof val === "number" || reg.test(val) ? val + "px" : val;
  13524. };
  13525. const _sfc_main$x = {
  13526. name: "UniIcons",
  13527. emits: ["click"],
  13528. props: {
  13529. type: {
  13530. type: String,
  13531. default: ""
  13532. },
  13533. color: {
  13534. type: String,
  13535. default: "#333333"
  13536. },
  13537. size: {
  13538. type: [Number, String],
  13539. default: 16
  13540. },
  13541. customPrefix: {
  13542. type: String,
  13543. default: ""
  13544. },
  13545. fontFamily: {
  13546. type: String,
  13547. default: ""
  13548. }
  13549. },
  13550. data() {
  13551. return {
  13552. icons: fontData
  13553. };
  13554. },
  13555. computed: {
  13556. unicode() {
  13557. let code = this.icons.find((v2) => v2.font_class === this.type);
  13558. if (code) {
  13559. return code.unicode;
  13560. }
  13561. return "";
  13562. },
  13563. iconSize() {
  13564. return getVal(this.size);
  13565. },
  13566. styleObj() {
  13567. if (this.fontFamily !== "") {
  13568. return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
  13569. }
  13570. return `color: ${this.color}; font-size: ${this.iconSize};`;
  13571. }
  13572. },
  13573. methods: {
  13574. _onClick() {
  13575. this.$emit("click");
  13576. }
  13577. }
  13578. };
  13579. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  13580. return vue.openBlock(), vue.createElementBlock(
  13581. "text",
  13582. {
  13583. style: vue.normalizeStyle($options.styleObj),
  13584. class: vue.normalizeClass(["uni-icons", ["uniui-" + $props.type, $props.customPrefix, $props.customPrefix ? $props.type : ""]]),
  13585. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  13586. },
  13587. [
  13588. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  13589. ],
  13590. 6
  13591. /* CLASS, STYLE */
  13592. );
  13593. }
  13594. const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-d31e1c47"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
  13595. function obj2strClass(obj) {
  13596. let classess = "";
  13597. for (let key in obj) {
  13598. const val = obj[key];
  13599. if (val) {
  13600. classess += `${key} `;
  13601. }
  13602. }
  13603. return classess;
  13604. }
  13605. function obj2strStyle(obj) {
  13606. let style = "";
  13607. for (let key in obj) {
  13608. const val = obj[key];
  13609. style += `${key}:${val};`;
  13610. }
  13611. return style;
  13612. }
  13613. const _sfc_main$w = {
  13614. name: "uni-easyinput",
  13615. emits: ["click", "iconClick", "update:modelValue", "input", "focus", "blur", "confirm", "clear", "eyes", "change", "keyboardheightchange"],
  13616. model: {
  13617. prop: "modelValue",
  13618. event: "update:modelValue"
  13619. },
  13620. options: {
  13621. virtualHost: true
  13622. },
  13623. inject: {
  13624. form: {
  13625. from: "uniForm",
  13626. default: null
  13627. },
  13628. formItem: {
  13629. from: "uniFormItem",
  13630. default: null
  13631. }
  13632. },
  13633. props: {
  13634. name: String,
  13635. value: [Number, String],
  13636. modelValue: [Number, String],
  13637. type: {
  13638. type: String,
  13639. default: "text"
  13640. },
  13641. clearable: {
  13642. type: Boolean,
  13643. default: true
  13644. },
  13645. autoHeight: {
  13646. type: Boolean,
  13647. default: false
  13648. },
  13649. placeholder: {
  13650. type: String,
  13651. default: " "
  13652. },
  13653. placeholderStyle: String,
  13654. focus: {
  13655. type: Boolean,
  13656. default: false
  13657. },
  13658. disabled: {
  13659. type: Boolean,
  13660. default: false
  13661. },
  13662. maxlength: {
  13663. type: [Number, String],
  13664. default: 140
  13665. },
  13666. confirmType: {
  13667. type: String,
  13668. default: "done"
  13669. },
  13670. clearSize: {
  13671. type: [Number, String],
  13672. default: 24
  13673. },
  13674. inputBorder: {
  13675. type: Boolean,
  13676. default: true
  13677. },
  13678. prefixIcon: {
  13679. type: String,
  13680. default: ""
  13681. },
  13682. suffixIcon: {
  13683. type: String,
  13684. default: ""
  13685. },
  13686. trim: {
  13687. type: [Boolean, String],
  13688. default: false
  13689. },
  13690. cursorSpacing: {
  13691. type: Number,
  13692. default: 0
  13693. },
  13694. passwordIcon: {
  13695. type: Boolean,
  13696. default: true
  13697. },
  13698. primaryColor: {
  13699. type: String,
  13700. default: "#2979ff"
  13701. },
  13702. styles: {
  13703. type: Object,
  13704. default() {
  13705. return {
  13706. color: "#333",
  13707. backgroundColor: "#fff",
  13708. disableColor: "#F7F6F6",
  13709. borderColor: "#e5e5e5"
  13710. };
  13711. }
  13712. },
  13713. errorMessage: {
  13714. type: [String, Boolean],
  13715. default: ""
  13716. }
  13717. },
  13718. data() {
  13719. return {
  13720. focused: false,
  13721. val: "",
  13722. showMsg: "",
  13723. border: false,
  13724. isFirstBorder: false,
  13725. showClearIcon: false,
  13726. showPassword: false,
  13727. focusShow: false,
  13728. localMsg: "",
  13729. isEnter: false
  13730. // 用于判断当前是否是使用回车操作
  13731. };
  13732. },
  13733. computed: {
  13734. // 输入框内是否有值
  13735. isVal() {
  13736. const val = this.val;
  13737. if (val || val === 0) {
  13738. return true;
  13739. }
  13740. return false;
  13741. },
  13742. msg() {
  13743. return this.localMsg || this.errorMessage;
  13744. },
  13745. // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
  13746. inputMaxlength() {
  13747. return Number(this.maxlength);
  13748. },
  13749. // 处理外层样式的style
  13750. boxStyle() {
  13751. return `color:${this.inputBorder && this.msg ? "#e43d33" : this.styles.color};`;
  13752. },
  13753. // input 内容的类和样式处理
  13754. inputContentClass() {
  13755. return obj2strClass({
  13756. "is-input-border": this.inputBorder,
  13757. "is-input-error-border": this.inputBorder && this.msg,
  13758. "is-textarea": this.type === "textarea",
  13759. "is-disabled": this.disabled,
  13760. "is-focused": this.focusShow
  13761. });
  13762. },
  13763. inputContentStyle() {
  13764. const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
  13765. const borderColor = this.inputBorder && this.msg ? "#dd524d" : focusColor;
  13766. return obj2strStyle({
  13767. "border-color": borderColor || "#e5e5e5",
  13768. "background-color": this.disabled ? this.styles.disableColor : this.styles.backgroundColor
  13769. });
  13770. },
  13771. // input右侧样式
  13772. inputStyle() {
  13773. const paddingRight = this.type === "password" || this.clearable || this.prefixIcon ? "" : "10px";
  13774. return obj2strStyle({
  13775. "padding-right": paddingRight,
  13776. "padding-left": this.prefixIcon ? "" : "10px"
  13777. });
  13778. }
  13779. },
  13780. watch: {
  13781. value(newVal) {
  13782. this.val = newVal;
  13783. },
  13784. modelValue(newVal) {
  13785. this.val = newVal;
  13786. },
  13787. focus(newVal) {
  13788. this.$nextTick(() => {
  13789. this.focused = this.focus;
  13790. this.focusShow = this.focus;
  13791. });
  13792. }
  13793. },
  13794. created() {
  13795. this.init();
  13796. if (this.form && this.formItem) {
  13797. this.$watch("formItem.errMsg", (newVal) => {
  13798. this.localMsg = newVal;
  13799. });
  13800. }
  13801. },
  13802. mounted() {
  13803. this.$nextTick(() => {
  13804. this.focused = this.focus;
  13805. this.focusShow = this.focus;
  13806. });
  13807. },
  13808. methods: {
  13809. /**
  13810. * 初始化变量值
  13811. */
  13812. init() {
  13813. if (this.value || this.value === 0) {
  13814. this.val = this.value;
  13815. } else if (this.modelValue || this.modelValue === 0 || this.modelValue === "") {
  13816. this.val = this.modelValue;
  13817. } else {
  13818. this.val = null;
  13819. }
  13820. },
  13821. /**
  13822. * 点击图标时触发
  13823. * @param {Object} type
  13824. */
  13825. onClickIcon(type) {
  13826. this.$emit("iconClick", type);
  13827. },
  13828. /**
  13829. * 显示隐藏内容,密码框时生效
  13830. */
  13831. onEyes() {
  13832. this.showPassword = !this.showPassword;
  13833. this.$emit("eyes", this.showPassword);
  13834. },
  13835. /**
  13836. * 输入时触发
  13837. * @param {Object} event
  13838. */
  13839. onInput(event) {
  13840. let value = event.detail.value;
  13841. if (this.trim) {
  13842. if (typeof this.trim === "boolean" && this.trim) {
  13843. value = this.trimStr(value);
  13844. }
  13845. if (typeof this.trim === "string") {
  13846. value = this.trimStr(value, this.trim);
  13847. }
  13848. }
  13849. if (this.errMsg)
  13850. this.errMsg = "";
  13851. this.val = value;
  13852. this.$emit("input", value);
  13853. this.$emit("update:modelValue", value);
  13854. },
  13855. /**
  13856. * 外部调用方法
  13857. * 获取焦点时触发
  13858. * @param {Object} event
  13859. */
  13860. onFocus() {
  13861. this.$nextTick(() => {
  13862. this.focused = true;
  13863. });
  13864. this.$emit("focus", null);
  13865. },
  13866. _Focus(event) {
  13867. this.focusShow = true;
  13868. this.$emit("focus", event);
  13869. },
  13870. /**
  13871. * 外部调用方法
  13872. * 失去焦点时触发
  13873. * @param {Object} event
  13874. */
  13875. onBlur() {
  13876. this.focused = false;
  13877. this.$emit("focus", null);
  13878. },
  13879. _Blur(event) {
  13880. event.detail.value;
  13881. this.focusShow = false;
  13882. this.$emit("blur", event);
  13883. if (this.isEnter === false) {
  13884. this.$emit("change", this.val);
  13885. }
  13886. if (this.form && this.formItem) {
  13887. const { validateTrigger } = this.form;
  13888. if (validateTrigger === "blur") {
  13889. this.formItem.onFieldChange();
  13890. }
  13891. }
  13892. },
  13893. /**
  13894. * 按下键盘的发送键
  13895. * @param {Object} e
  13896. */
  13897. onConfirm(e2) {
  13898. this.$emit("confirm", this.val);
  13899. this.isEnter = true;
  13900. this.$emit("change", this.val);
  13901. this.$nextTick(() => {
  13902. this.isEnter = false;
  13903. });
  13904. },
  13905. /**
  13906. * 清理内容
  13907. * @param {Object} event
  13908. */
  13909. onClear(event) {
  13910. this.val = "";
  13911. this.$emit("input", "");
  13912. this.$emit("update:modelValue", "");
  13913. this.$emit("clear");
  13914. },
  13915. /**
  13916. * 键盘高度发生变化的时候触发此事件
  13917. * 兼容性:微信小程序2.7.0+、App 3.1.0+
  13918. * @param {Object} event
  13919. */
  13920. onkeyboardheightchange(event) {
  13921. this.$emit("keyboardheightchange", event);
  13922. },
  13923. /**
  13924. * 去除空格
  13925. */
  13926. trimStr(str, pos = "both") {
  13927. if (pos === "both") {
  13928. return str.trim();
  13929. } else if (pos === "left") {
  13930. return str.trimLeft();
  13931. } else if (pos === "right") {
  13932. return str.trimRight();
  13933. } else if (pos === "start") {
  13934. return str.trimStart();
  13935. } else if (pos === "end") {
  13936. return str.trimEnd();
  13937. } else if (pos === "all") {
  13938. return str.replace(/\s+/g, "");
  13939. } else if (pos === "none") {
  13940. return str;
  13941. }
  13942. return str;
  13943. }
  13944. }
  13945. };
  13946. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  13947. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  13948. return vue.openBlock(), vue.createElementBlock(
  13949. "view",
  13950. {
  13951. class: vue.normalizeClass(["uni-easyinput", { "uni-easyinput-error": $options.msg }]),
  13952. style: vue.normalizeStyle($options.boxStyle)
  13953. },
  13954. [
  13955. vue.createElementVNode(
  13956. "view",
  13957. {
  13958. class: vue.normalizeClass(["uni-easyinput__content", $options.inputContentClass]),
  13959. style: vue.normalizeStyle($options.inputContentStyle)
  13960. },
  13961. [
  13962. $props.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13963. key: 0,
  13964. class: "content-clear-icon",
  13965. type: $props.prefixIcon,
  13966. color: "#c0c4cc",
  13967. onClick: _cache[0] || (_cache[0] = ($event) => $options.onClickIcon("prefix")),
  13968. size: "22"
  13969. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true),
  13970. $props.type === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
  13971. key: 1,
  13972. class: vue.normalizeClass(["uni-easyinput__content-textarea", { "input-padding": $props.inputBorder }]),
  13973. name: $props.name,
  13974. value: $data.val,
  13975. placeholder: $props.placeholder,
  13976. placeholderStyle: $props.placeholderStyle,
  13977. disabled: $props.disabled,
  13978. "placeholder-class": "uni-easyinput__placeholder-class",
  13979. maxlength: $options.inputMaxlength,
  13980. focus: $data.focused,
  13981. autoHeight: $props.autoHeight,
  13982. "cursor-spacing": $props.cursorSpacing,
  13983. onInput: _cache[1] || (_cache[1] = (...args) => $options.onInput && $options.onInput(...args)),
  13984. onBlur: _cache[2] || (_cache[2] = (...args) => $options._Blur && $options._Blur(...args)),
  13985. onFocus: _cache[3] || (_cache[3] = (...args) => $options._Focus && $options._Focus(...args)),
  13986. onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  13987. onKeyboardheightchange: _cache[5] || (_cache[5] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  13988. }, null, 42, ["name", "value", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "autoHeight", "cursor-spacing"])) : (vue.openBlock(), vue.createElementBlock("input", {
  13989. key: 2,
  13990. type: $props.type === "password" ? "text" : $props.type,
  13991. class: "uni-easyinput__content-input",
  13992. style: vue.normalizeStyle($options.inputStyle),
  13993. name: $props.name,
  13994. value: $data.val,
  13995. password: !$data.showPassword && $props.type === "password",
  13996. placeholder: $props.placeholder,
  13997. placeholderStyle: $props.placeholderStyle,
  13998. "placeholder-class": "uni-easyinput__placeholder-class",
  13999. disabled: $props.disabled,
  14000. maxlength: $options.inputMaxlength,
  14001. focus: $data.focused,
  14002. confirmType: $props.confirmType,
  14003. "cursor-spacing": $props.cursorSpacing,
  14004. onFocus: _cache[6] || (_cache[6] = (...args) => $options._Focus && $options._Focus(...args)),
  14005. onBlur: _cache[7] || (_cache[7] = (...args) => $options._Blur && $options._Blur(...args)),
  14006. onInput: _cache[8] || (_cache[8] = (...args) => $options.onInput && $options.onInput(...args)),
  14007. onConfirm: _cache[9] || (_cache[9] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  14008. onKeyboardheightchange: _cache[10] || (_cache[10] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  14009. }, null, 44, ["type", "name", "value", "password", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "confirmType", "cursor-spacing"])),
  14010. $props.type === "password" && $props.passwordIcon ? (vue.openBlock(), vue.createElementBlock(
  14011. vue.Fragment,
  14012. { key: 3 },
  14013. [
  14014. vue.createCommentVNode(" 开启密码时显示小眼睛 "),
  14015. $options.isVal ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14016. key: 0,
  14017. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  14018. type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
  14019. size: 22,
  14020. color: $data.focusShow ? $props.primaryColor : "#c0c4cc",
  14021. onClick: $options.onEyes
  14022. }, null, 8, ["class", "type", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  14023. ],
  14024. 64
  14025. /* STABLE_FRAGMENT */
  14026. )) : $props.suffixIcon ? (vue.openBlock(), vue.createElementBlock(
  14027. vue.Fragment,
  14028. { key: 4 },
  14029. [
  14030. $props.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14031. key: 0,
  14032. class: "content-clear-icon",
  14033. type: $props.suffixIcon,
  14034. color: "#c0c4cc",
  14035. onClick: _cache[11] || (_cache[11] = ($event) => $options.onClickIcon("suffix")),
  14036. size: "22"
  14037. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
  14038. ],
  14039. 64
  14040. /* STABLE_FRAGMENT */
  14041. )) : (vue.openBlock(), vue.createElementBlock(
  14042. vue.Fragment,
  14043. { key: 5 },
  14044. [
  14045. $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea" ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14046. key: 0,
  14047. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  14048. type: "clear",
  14049. size: $props.clearSize,
  14050. color: $options.msg ? "#dd524d" : $data.focusShow ? $props.primaryColor : "#c0c4cc",
  14051. onClick: $options.onClear
  14052. }, null, 8, ["class", "size", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  14053. ],
  14054. 64
  14055. /* STABLE_FRAGMENT */
  14056. )),
  14057. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  14058. ],
  14059. 6
  14060. /* CLASS, STYLE */
  14061. )
  14062. ],
  14063. 6
  14064. /* CLASS, STYLE */
  14065. );
  14066. }
  14067. const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-09fd5285"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue"]]);
  14068. const _sfc_main$v = {
  14069. name: "uniFormsItem",
  14070. options: {
  14071. virtualHost: true
  14072. },
  14073. provide() {
  14074. return {
  14075. uniFormItem: this
  14076. };
  14077. },
  14078. inject: {
  14079. form: {
  14080. from: "uniForm",
  14081. default: null
  14082. }
  14083. },
  14084. props: {
  14085. // 表单校验规则
  14086. rules: {
  14087. type: Array,
  14088. default() {
  14089. return null;
  14090. }
  14091. },
  14092. // 表单域的属性名,在使用校验规则时必填
  14093. name: {
  14094. type: [String, Array],
  14095. default: ""
  14096. },
  14097. required: {
  14098. type: Boolean,
  14099. default: false
  14100. },
  14101. label: {
  14102. type: String,
  14103. default: ""
  14104. },
  14105. // label的宽度
  14106. labelWidth: {
  14107. type: [String, Number],
  14108. default: ""
  14109. },
  14110. // label 居中方式,默认 left 取值 left/center/right
  14111. labelAlign: {
  14112. type: String,
  14113. default: ""
  14114. },
  14115. // 强制显示错误信息
  14116. errorMessage: {
  14117. type: [String, Boolean],
  14118. default: ""
  14119. },
  14120. // 1.4.0 弃用,统一使用 form 的校验时机
  14121. // validateTrigger: {
  14122. // type: String,
  14123. // default: ''
  14124. // },
  14125. // 1.4.0 弃用,统一使用 form 的label 位置
  14126. // labelPosition: {
  14127. // type: String,
  14128. // default: ''
  14129. // },
  14130. // 1.4.0 以下属性已经废弃,请使用 #label 插槽代替
  14131. leftIcon: String,
  14132. iconColor: {
  14133. type: String,
  14134. default: "#606266"
  14135. }
  14136. },
  14137. data() {
  14138. return {
  14139. errMsg: "",
  14140. userRules: null,
  14141. localLabelAlign: "left",
  14142. localLabelWidth: "70px",
  14143. localLabelPos: "left",
  14144. border: false,
  14145. isFirstBorder: false
  14146. };
  14147. },
  14148. computed: {
  14149. // 处理错误信息
  14150. msg() {
  14151. return this.errorMessage || this.errMsg;
  14152. }
  14153. },
  14154. watch: {
  14155. // 规则发生变化通知子组件更新
  14156. "form.formRules"(val) {
  14157. this.init();
  14158. },
  14159. "form.labelWidth"(val) {
  14160. this.localLabelWidth = this._labelWidthUnit(val);
  14161. },
  14162. "form.labelPosition"(val) {
  14163. this.localLabelPos = this._labelPosition();
  14164. },
  14165. "form.labelAlign"(val) {
  14166. }
  14167. },
  14168. created() {
  14169. this.init(true);
  14170. if (this.name && this.form) {
  14171. this.$watch(
  14172. () => {
  14173. const val = this.form._getDataValue(this.name, this.form.localData);
  14174. return val;
  14175. },
  14176. (value, oldVal) => {
  14177. const isEqual2 = this.form._isEqual(value, oldVal);
  14178. if (!isEqual2) {
  14179. const val = this.itemSetValue(value);
  14180. this.onFieldChange(val, false);
  14181. }
  14182. },
  14183. {
  14184. immediate: false
  14185. }
  14186. );
  14187. }
  14188. },
  14189. unmounted() {
  14190. this.__isUnmounted = true;
  14191. this.unInit();
  14192. },
  14193. methods: {
  14194. /**
  14195. * 外部调用方法
  14196. * 设置规则 ,主要用于小程序自定义检验规则
  14197. * @param {Array} rules 规则源数据
  14198. */
  14199. setRules(rules = null) {
  14200. this.userRules = rules;
  14201. this.init(false);
  14202. },
  14203. // 兼容老版本表单组件
  14204. setValue() {
  14205. },
  14206. /**
  14207. * 外部调用方法
  14208. * 校验数据
  14209. * @param {any} value 需要校验的数据
  14210. * @param {boolean} 是否立即校验
  14211. * @return {Array|null} 校验内容
  14212. */
  14213. async onFieldChange(value, formtrigger = true) {
  14214. const {
  14215. formData,
  14216. localData,
  14217. errShowType,
  14218. validateCheck,
  14219. validateTrigger,
  14220. _isRequiredField,
  14221. _realName
  14222. } = this.form;
  14223. const name = _realName(this.name);
  14224. if (!value) {
  14225. value = this.form.formData[name];
  14226. }
  14227. const ruleLen = this.itemRules.rules && this.itemRules.rules.length;
  14228. if (!this.validator || !ruleLen || ruleLen === 0)
  14229. return;
  14230. const isRequiredField2 = _isRequiredField(this.itemRules.rules || []);
  14231. let result = null;
  14232. if (validateTrigger === "bind" || formtrigger) {
  14233. result = await this.validator.validateUpdate(
  14234. {
  14235. [name]: value
  14236. },
  14237. formData
  14238. );
  14239. if (!isRequiredField2 && (value === void 0 || value === "")) {
  14240. result = null;
  14241. }
  14242. if (result && result.errorMessage) {
  14243. if (errShowType === "undertext") {
  14244. this.errMsg = !result ? "" : result.errorMessage;
  14245. }
  14246. if (errShowType === "toast") {
  14247. uni.showToast({
  14248. title: result.errorMessage || "校验错误",
  14249. icon: "none"
  14250. });
  14251. }
  14252. if (errShowType === "modal") {
  14253. uni.showModal({
  14254. title: "提示",
  14255. content: result.errorMessage || "校验错误"
  14256. });
  14257. }
  14258. } else {
  14259. this.errMsg = "";
  14260. }
  14261. validateCheck(result ? result : null);
  14262. } else {
  14263. this.errMsg = "";
  14264. }
  14265. return result ? result : null;
  14266. },
  14267. /**
  14268. * 初始组件数据
  14269. */
  14270. init(type = false) {
  14271. const {
  14272. validator,
  14273. formRules,
  14274. childrens,
  14275. formData,
  14276. localData,
  14277. _realName,
  14278. labelWidth,
  14279. _getDataValue,
  14280. _setDataValue
  14281. } = this.form || {};
  14282. this.localLabelAlign = this._justifyContent();
  14283. this.localLabelWidth = this._labelWidthUnit(labelWidth);
  14284. this.localLabelPos = this._labelPosition();
  14285. this.form && type && childrens.push(this);
  14286. if (!validator || !formRules)
  14287. return;
  14288. if (!this.form.isFirstBorder) {
  14289. this.form.isFirstBorder = true;
  14290. this.isFirstBorder = true;
  14291. }
  14292. if (this.group) {
  14293. if (!this.group.isFirstBorder) {
  14294. this.group.isFirstBorder = true;
  14295. this.isFirstBorder = true;
  14296. }
  14297. }
  14298. this.border = this.form.border;
  14299. const name = _realName(this.name);
  14300. const itemRule = this.userRules || this.rules;
  14301. if (typeof formRules === "object" && itemRule) {
  14302. formRules[name] = {
  14303. rules: itemRule
  14304. };
  14305. validator.updateSchema(formRules);
  14306. }
  14307. const itemRules = formRules[name] || {};
  14308. this.itemRules = itemRules;
  14309. this.validator = validator;
  14310. this.itemSetValue(_getDataValue(this.name, localData));
  14311. },
  14312. unInit() {
  14313. if (this.form) {
  14314. const {
  14315. childrens,
  14316. formData,
  14317. _realName
  14318. } = this.form;
  14319. childrens.forEach((item, index) => {
  14320. if (item === this) {
  14321. this.form.childrens.splice(index, 1);
  14322. delete formData[_realName(item.name)];
  14323. }
  14324. });
  14325. }
  14326. },
  14327. // 设置item 的值
  14328. itemSetValue(value) {
  14329. const name = this.form._realName(this.name);
  14330. const rules = this.itemRules.rules || [];
  14331. const val = this.form._getValue(name, value, rules);
  14332. this.form._setDataValue(name, this.form.formData, val);
  14333. return val;
  14334. },
  14335. /**
  14336. * 移除该表单项的校验结果
  14337. */
  14338. clearValidate() {
  14339. this.errMsg = "";
  14340. },
  14341. // 是否显示星号
  14342. _isRequired() {
  14343. return this.required;
  14344. },
  14345. // 处理对齐方式
  14346. _justifyContent() {
  14347. if (this.form) {
  14348. const {
  14349. labelAlign
  14350. } = this.form;
  14351. let labelAli = this.labelAlign ? this.labelAlign : labelAlign;
  14352. if (labelAli === "left")
  14353. return "flex-start";
  14354. if (labelAli === "center")
  14355. return "center";
  14356. if (labelAli === "right")
  14357. return "flex-end";
  14358. }
  14359. return "flex-start";
  14360. },
  14361. // 处理 label宽度单位 ,继承父元素的值
  14362. _labelWidthUnit(labelWidth) {
  14363. return this.num2px(this.labelWidth ? this.labelWidth : labelWidth || (this.label ? 70 : "auto"));
  14364. },
  14365. // 处理 label 位置
  14366. _labelPosition() {
  14367. if (this.form)
  14368. return this.form.labelPosition || "left";
  14369. return "left";
  14370. },
  14371. /**
  14372. * 触发时机
  14373. * @param {Object} rule 当前规则内时机
  14374. * @param {Object} itemRlue 当前组件时机
  14375. * @param {Object} parentRule 父组件时机
  14376. */
  14377. isTrigger(rule, itemRlue, parentRule) {
  14378. if (rule === "submit" || !rule) {
  14379. if (rule === void 0) {
  14380. if (itemRlue !== "bind") {
  14381. if (!itemRlue) {
  14382. return parentRule === "" ? "bind" : "submit";
  14383. }
  14384. return "submit";
  14385. }
  14386. return "bind";
  14387. }
  14388. return "submit";
  14389. }
  14390. return "bind";
  14391. },
  14392. num2px(num) {
  14393. if (typeof num === "number") {
  14394. return `${num}px`;
  14395. }
  14396. return num;
  14397. }
  14398. }
  14399. };
  14400. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  14401. return vue.openBlock(), vue.createElementBlock(
  14402. "view",
  14403. {
  14404. class: vue.normalizeClass(["uni-forms-item", ["is-direction-" + $data.localLabelPos, $data.border ? "uni-forms-item--border" : "", $data.border && $data.isFirstBorder ? "is-first-border" : ""]])
  14405. },
  14406. [
  14407. vue.renderSlot(_ctx.$slots, "label", {}, () => [
  14408. vue.createElementVNode(
  14409. "view",
  14410. {
  14411. class: vue.normalizeClass(["uni-forms-item__label", { "no-label": !$props.label && !$props.required }]),
  14412. style: vue.normalizeStyle({ width: $data.localLabelWidth, justifyContent: $data.localLabelAlign })
  14413. },
  14414. [
  14415. $props.required ? (vue.openBlock(), vue.createElementBlock("text", {
  14416. key: 0,
  14417. class: "is-required"
  14418. }, "*")) : vue.createCommentVNode("v-if", true),
  14419. vue.createElementVNode(
  14420. "text",
  14421. null,
  14422. vue.toDisplayString($props.label),
  14423. 1
  14424. /* TEXT */
  14425. )
  14426. ],
  14427. 6
  14428. /* CLASS, STYLE */
  14429. )
  14430. ], true),
  14431. vue.createElementVNode("view", { class: "uni-forms-item__content" }, [
  14432. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  14433. vue.createElementVNode(
  14434. "view",
  14435. {
  14436. class: vue.normalizeClass(["uni-forms-item__error", { "msg--active": $options.msg }])
  14437. },
  14438. [
  14439. vue.createElementVNode(
  14440. "text",
  14441. null,
  14442. vue.toDisplayString($options.msg),
  14443. 1
  14444. /* TEXT */
  14445. )
  14446. ],
  14447. 2
  14448. /* CLASS */
  14449. )
  14450. ])
  14451. ],
  14452. 2
  14453. /* CLASS */
  14454. );
  14455. }
  14456. const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-462874dd"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue"]]);
  14457. const pages = [
  14458. {
  14459. path: "pages/home/index",
  14460. style: {
  14461. navigationBarTitleText: "英途仓库"
  14462. }
  14463. },
  14464. {
  14465. path: "pages/instock/index",
  14466. style: {
  14467. navigationBarTitleText: "称重",
  14468. "app-plus": {
  14469. bounce: "none",
  14470. titleNView: {
  14471. buttons: [
  14472. {
  14473. fontSize: "16px",
  14474. text: "历史"
  14475. }
  14476. ],
  14477. backButton: {
  14478. background: "#00FF00"
  14479. }
  14480. }
  14481. }
  14482. }
  14483. },
  14484. {
  14485. path: "pages/instock/instockLog",
  14486. style: {
  14487. navigationBarTitleText: "录入历史"
  14488. }
  14489. },
  14490. {
  14491. path: "pages/profile/index",
  14492. style: {
  14493. navigationBarTitleText: "我的"
  14494. }
  14495. },
  14496. {
  14497. path: "pages/login/index",
  14498. style: {
  14499. navigationBarTitleText: "登录"
  14500. }
  14501. },
  14502. {
  14503. path: "pages/order/index",
  14504. style: {
  14505. navigationBarTitleText: "ORDER"
  14506. }
  14507. },
  14508. {
  14509. path: "pages/scanLotno/index",
  14510. style: {
  14511. navigationBarTitleText: "托盘/批次",
  14512. "app-plus": {
  14513. bounce: "none",
  14514. titleNView: {
  14515. buttons: [
  14516. {
  14517. fontSize: "16px",
  14518. text: "历史"
  14519. }
  14520. ],
  14521. backButton: {
  14522. background: "#00FF00"
  14523. }
  14524. }
  14525. }
  14526. }
  14527. },
  14528. {
  14529. path: "pages/scanLotno/lotnoLog",
  14530. style: {
  14531. navigationBarTitleText: "录入历史"
  14532. }
  14533. },
  14534. {
  14535. path: "pages/scanLotno/waybillsList",
  14536. style: {
  14537. navigationBarTitleText: "运单列表"
  14538. }
  14539. },
  14540. {
  14541. path: "pages/warehouseScan/index",
  14542. style: {
  14543. navigationBarTitleText: "仓库扫描",
  14544. "app-plus": {
  14545. bounce: "none",
  14546. titleNView: {
  14547. buttons: [
  14548. {
  14549. fontSize: "16px",
  14550. text: "历史"
  14551. }
  14552. ],
  14553. backButton: {
  14554. background: "#00FF00"
  14555. }
  14556. }
  14557. }
  14558. }
  14559. },
  14560. {
  14561. path: "pages/warehouseScan/warehouseLog",
  14562. style: {
  14563. navigationBarTitleText: "录入历史"
  14564. }
  14565. },
  14566. {
  14567. path: "pages/waybillNo/index",
  14568. style: {
  14569. navigationBarTitleText: "库位绑定",
  14570. "app-plus": {
  14571. bounce: "none",
  14572. titleNView: {
  14573. buttons: [
  14574. {
  14575. fontSize: "16px",
  14576. text: "历史"
  14577. }
  14578. ],
  14579. backButton: {
  14580. background: "#00FF00"
  14581. }
  14582. }
  14583. }
  14584. }
  14585. },
  14586. {
  14587. path: "pages/waybillNo/waybillNoLog",
  14588. style: {
  14589. navigationBarTitleText: "录入历史"
  14590. }
  14591. },
  14592. {
  14593. path: "pages/waybillDeliveryOrder/index",
  14594. style: {
  14595. navigationBarTitleText: "派送单",
  14596. "app-plus": {
  14597. bounce: "none",
  14598. titleNView: {
  14599. buttons: [
  14600. {
  14601. fontSize: "16px",
  14602. text: "筛选"
  14603. }
  14604. ],
  14605. backButton: {
  14606. background: "#00FF00"
  14607. }
  14608. }
  14609. }
  14610. }
  14611. },
  14612. {
  14613. path: "pages/waybillDeliveryOrder/orderInfo",
  14614. style: {
  14615. navigationBarTitleText: "派送详情"
  14616. }
  14617. },
  14618. {
  14619. path: "pages/printer/index",
  14620. style: {
  14621. navigationBarTitleText: "打印"
  14622. }
  14623. }
  14624. ];
  14625. const globalStyle = {
  14626. navigationBarTextStyle: "black",
  14627. navigationBarTitleText: "uni-app",
  14628. navigationBarBackgroundColor: "#F8F8F8",
  14629. backgroundColor: "#F8F8F8"
  14630. };
  14631. const tabBar = {
  14632. color: "#7A7E83",
  14633. selectedColor: "#007AFF",
  14634. borderStyle: "black",
  14635. backgroundColor: "#F8F8F8",
  14636. list: [
  14637. {
  14638. pagePath: "pages/home/index",
  14639. iconPath: "static/home.png",
  14640. selectedIconPath: "static/home_fill.png",
  14641. text: "首页"
  14642. },
  14643. {
  14644. pagePath: "pages/profile/index",
  14645. iconPath: "static/people.png",
  14646. selectedIconPath: "static/people_fill.png",
  14647. text: "我的"
  14648. }
  14649. ]
  14650. };
  14651. const uniIdRouter = {};
  14652. const e = {
  14653. pages,
  14654. globalStyle,
  14655. tabBar,
  14656. uniIdRouter
  14657. };
  14658. var define_process_env_UNI_SECURE_NETWORK_CONFIG_default = [];
  14659. function t$2(e2) {
  14660. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  14661. }
  14662. function n(e2, t2, n2) {
  14663. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  14664. return function() {
  14665. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  14666. }(null == t3 && n2.path);
  14667. } }, n2.exports), n2.exports;
  14668. }
  14669. var s = n(function(e2, t2) {
  14670. var n2;
  14671. e2.exports = (n2 = n2 || function(e3, t3) {
  14672. var n3 = Object.create || /* @__PURE__ */ function() {
  14673. function e4() {
  14674. }
  14675. return function(t4) {
  14676. var n4;
  14677. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  14678. };
  14679. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  14680. var t4 = n3(this);
  14681. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  14682. t4.$super.init.apply(this, arguments);
  14683. }), t4.init.prototype = t4, t4.$super = this, t4;
  14684. }, create: function() {
  14685. var e4 = this.extend();
  14686. return e4.init.apply(e4, arguments), e4;
  14687. }, init: function() {
  14688. }, mixIn: function(e4) {
  14689. for (var t4 in e4)
  14690. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  14691. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  14692. }, clone: function() {
  14693. return this.init.prototype.extend(this);
  14694. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  14695. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  14696. }, toString: function(e4) {
  14697. return (e4 || c2).stringify(this);
  14698. }, concat: function(e4) {
  14699. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  14700. if (this.clamp(), s3 % 4)
  14701. for (var i3 = 0; i3 < r3; i3++) {
  14702. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  14703. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  14704. }
  14705. else
  14706. for (i3 = 0; i3 < r3; i3 += 4)
  14707. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  14708. return this.sigBytes += r3, this;
  14709. }, clamp: function() {
  14710. var t4 = this.words, n4 = this.sigBytes;
  14711. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  14712. }, clone: function() {
  14713. var e4 = i2.clone.call(this);
  14714. return e4.words = this.words.slice(0), e4;
  14715. }, random: function(t4) {
  14716. for (var n4, s3 = [], r3 = function(t5) {
  14717. t5 = t5;
  14718. var n5 = 987654321, s4 = 4294967295;
  14719. return function() {
  14720. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  14721. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  14722. };
  14723. }, i3 = 0; i3 < t4; i3 += 4) {
  14724. var a3 = r3(4294967296 * (n4 || e3.random()));
  14725. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  14726. }
  14727. return new o2.init(s3, t4);
  14728. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  14729. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  14730. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  14731. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  14732. }
  14733. return s3.join("");
  14734. }, parse: function(e4) {
  14735. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  14736. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  14737. return new o2.init(n4, t4 / 2);
  14738. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  14739. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  14740. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  14741. s3.push(String.fromCharCode(i3));
  14742. }
  14743. return s3.join("");
  14744. }, parse: function(e4) {
  14745. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  14746. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  14747. return new o2.init(n4, t4);
  14748. } }, l2 = a2.Utf8 = { stringify: function(e4) {
  14749. try {
  14750. return decodeURIComponent(escape(u2.stringify(e4)));
  14751. } catch (e5) {
  14752. throw new Error("Malformed UTF-8 data");
  14753. }
  14754. }, parse: function(e4) {
  14755. return u2.parse(unescape(encodeURIComponent(e4)));
  14756. } }, h2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  14757. this._data = new o2.init(), this._nDataBytes = 0;
  14758. }, _append: function(e4) {
  14759. "string" == typeof e4 && (e4 = l2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  14760. }, _process: function(t4) {
  14761. var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3);
  14762. if (c3) {
  14763. for (var l3 = 0; l3 < c3; l3 += i3)
  14764. this._doProcessBlock(s3, l3);
  14765. var h3 = s3.splice(0, c3);
  14766. n4.sigBytes -= u3;
  14767. }
  14768. return new o2.init(h3, u3);
  14769. }, clone: function() {
  14770. var e4 = i2.clone.call(this);
  14771. return e4._data = this._data.clone(), e4;
  14772. }, _minBufferSize: 0 });
  14773. r2.Hasher = h2.extend({ cfg: i2.extend(), init: function(e4) {
  14774. this.cfg = this.cfg.extend(e4), this.reset();
  14775. }, reset: function() {
  14776. h2.reset.call(this), this._doReset();
  14777. }, update: function(e4) {
  14778. return this._append(e4), this._process(), this;
  14779. }, finalize: function(e4) {
  14780. return e4 && this._append(e4), this._doFinalize();
  14781. }, blockSize: 16, _createHelper: function(e4) {
  14782. return function(t4, n4) {
  14783. return new e4.init(n4).finalize(t4);
  14784. };
  14785. }, _createHmacHelper: function(e4) {
  14786. return function(t4, n4) {
  14787. return new d2.HMAC.init(e4, n4).finalize(t4);
  14788. };
  14789. } });
  14790. var d2 = s2.algo = {};
  14791. return s2;
  14792. }(Math), n2);
  14793. }), r = s, i = (n(function(e2, t2) {
  14794. var n2;
  14795. e2.exports = (n2 = r, function(e3) {
  14796. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  14797. !function() {
  14798. for (var t4 = 0; t4 < 64; t4++)
  14799. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  14800. }();
  14801. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  14802. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  14803. }, _doProcessBlock: function(e4, t4) {
  14804. for (var n3 = 0; n3 < 16; n3++) {
  14805. var s3 = t4 + n3, r3 = e4[s3];
  14806. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  14807. }
  14808. var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], A2 = e4[t4 + 14], C2 = e4[t4 + 15], P2 = i3[0], T2 = i3[1], x2 = i3[2], O2 = i3[3];
  14809. P2 = u2(P2, T2, x2, O2, o3, 7, a2[0]), O2 = u2(O2, P2, T2, x2, c3, 12, a2[1]), x2 = u2(x2, O2, P2, T2, p2, 17, a2[2]), T2 = u2(T2, x2, O2, P2, f2, 22, a2[3]), P2 = u2(P2, T2, x2, O2, g2, 7, a2[4]), O2 = u2(O2, P2, T2, x2, m2, 12, a2[5]), x2 = u2(x2, O2, P2, T2, y2, 17, a2[6]), T2 = u2(T2, x2, O2, P2, _2, 22, a2[7]), P2 = u2(P2, T2, x2, O2, w2, 7, a2[8]), O2 = u2(O2, P2, T2, x2, v2, 12, a2[9]), x2 = u2(x2, O2, P2, T2, I2, 17, a2[10]), T2 = u2(T2, x2, O2, P2, S2, 22, a2[11]), P2 = u2(P2, T2, x2, O2, b2, 7, a2[12]), O2 = u2(O2, P2, T2, x2, k2, 12, a2[13]), x2 = u2(x2, O2, P2, T2, A2, 17, a2[14]), P2 = l2(P2, T2 = u2(T2, x2, O2, P2, C2, 22, a2[15]), x2, O2, c3, 5, a2[16]), O2 = l2(O2, P2, T2, x2, y2, 9, a2[17]), x2 = l2(x2, O2, P2, T2, S2, 14, a2[18]), T2 = l2(T2, x2, O2, P2, o3, 20, a2[19]), P2 = l2(P2, T2, x2, O2, m2, 5, a2[20]), O2 = l2(O2, P2, T2, x2, I2, 9, a2[21]), x2 = l2(x2, O2, P2, T2, C2, 14, a2[22]), T2 = l2(T2, x2, O2, P2, g2, 20, a2[23]), P2 = l2(P2, T2, x2, O2, v2, 5, a2[24]), O2 = l2(O2, P2, T2, x2, A2, 9, a2[25]), x2 = l2(x2, O2, P2, T2, f2, 14, a2[26]), T2 = l2(T2, x2, O2, P2, w2, 20, a2[27]), P2 = l2(P2, T2, x2, O2, k2, 5, a2[28]), O2 = l2(O2, P2, T2, x2, p2, 9, a2[29]), x2 = l2(x2, O2, P2, T2, _2, 14, a2[30]), P2 = h2(P2, T2 = l2(T2, x2, O2, P2, b2, 20, a2[31]), x2, O2, m2, 4, a2[32]), O2 = h2(O2, P2, T2, x2, w2, 11, a2[33]), x2 = h2(x2, O2, P2, T2, S2, 16, a2[34]), T2 = h2(T2, x2, O2, P2, A2, 23, a2[35]), P2 = h2(P2, T2, x2, O2, c3, 4, a2[36]), O2 = h2(O2, P2, T2, x2, g2, 11, a2[37]), x2 = h2(x2, O2, P2, T2, _2, 16, a2[38]), T2 = h2(T2, x2, O2, P2, I2, 23, a2[39]), P2 = h2(P2, T2, x2, O2, k2, 4, a2[40]), O2 = h2(O2, P2, T2, x2, o3, 11, a2[41]), x2 = h2(x2, O2, P2, T2, f2, 16, a2[42]), T2 = h2(T2, x2, O2, P2, y2, 23, a2[43]), P2 = h2(P2, T2, x2, O2, v2, 4, a2[44]), O2 = h2(O2, P2, T2, x2, b2, 11, a2[45]), x2 = h2(x2, O2, P2, T2, C2, 16, a2[46]), P2 = d2(P2, T2 = h2(T2, x2, O2, P2, p2, 23, a2[47]), x2, O2, o3, 6, a2[48]), O2 = d2(O2, P2, T2, x2, _2, 10, a2[49]), x2 = d2(x2, O2, P2, T2, A2, 15, a2[50]), T2 = d2(T2, x2, O2, P2, m2, 21, a2[51]), P2 = d2(P2, T2, x2, O2, b2, 6, a2[52]), O2 = d2(O2, P2, T2, x2, f2, 10, a2[53]), x2 = d2(x2, O2, P2, T2, I2, 15, a2[54]), T2 = d2(T2, x2, O2, P2, c3, 21, a2[55]), P2 = d2(P2, T2, x2, O2, w2, 6, a2[56]), O2 = d2(O2, P2, T2, x2, C2, 10, a2[57]), x2 = d2(x2, O2, P2, T2, y2, 15, a2[58]), T2 = d2(T2, x2, O2, P2, k2, 21, a2[59]), P2 = d2(P2, T2, x2, O2, g2, 6, a2[60]), O2 = d2(O2, P2, T2, x2, S2, 10, a2[61]), x2 = d2(x2, O2, P2, T2, p2, 15, a2[62]), T2 = d2(T2, x2, O2, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + T2 | 0, i3[2] = i3[2] + x2 | 0, i3[3] = i3[3] + O2 | 0;
  14810. }, _doFinalize: function() {
  14811. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  14812. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  14813. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  14814. n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process();
  14815. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  14816. var l3 = c3[u3];
  14817. c3[u3] = 16711935 & (l3 << 8 | l3 >>> 24) | 4278255360 & (l3 << 24 | l3 >>> 8);
  14818. }
  14819. return a3;
  14820. }, clone: function() {
  14821. var e4 = i2.clone.call(this);
  14822. return e4._hash = this._hash.clone(), e4;
  14823. } });
  14824. function u2(e4, t4, n3, s3, r3, i3, o3) {
  14825. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  14826. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  14827. }
  14828. function l2(e4, t4, n3, s3, r3, i3, o3) {
  14829. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  14830. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  14831. }
  14832. function h2(e4, t4, n3, s3, r3, i3, o3) {
  14833. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  14834. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  14835. }
  14836. function d2(e4, t4, n3, s3, r3, i3, o3) {
  14837. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  14838. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  14839. }
  14840. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  14841. }(Math), n2.MD5);
  14842. }), n(function(e2, t2) {
  14843. var n2;
  14844. e2.exports = (n2 = r, void function() {
  14845. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  14846. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  14847. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  14848. var n3 = e4.blockSize, r2 = 4 * n3;
  14849. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  14850. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  14851. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  14852. i2.sigBytes = o2.sigBytes = r2, this.reset();
  14853. }, reset: function() {
  14854. var e4 = this._hasher;
  14855. e4.reset(), e4.update(this._iKey);
  14856. }, update: function(e4) {
  14857. return this._hasher.update(e4), this;
  14858. }, finalize: function(e4) {
  14859. var t4 = this._hasher, n3 = t4.finalize(e4);
  14860. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  14861. } });
  14862. }());
  14863. }), n(function(e2, t2) {
  14864. e2.exports = r.HmacMD5;
  14865. })), o = n(function(e2, t2) {
  14866. e2.exports = r.enc.Utf8;
  14867. }), a = n(function(e2, t2) {
  14868. var n2;
  14869. e2.exports = (n2 = r, function() {
  14870. var e3 = n2, t3 = e3.lib.WordArray;
  14871. function s2(e4, n3, s3) {
  14872. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  14873. if (o2 % 4) {
  14874. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  14875. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  14876. }
  14877. return t3.create(r2, i2);
  14878. }
  14879. e3.enc.Base64 = { stringify: function(e4) {
  14880. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  14881. e4.clamp();
  14882. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  14883. for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++)
  14884. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  14885. var c2 = s3.charAt(64);
  14886. if (c2)
  14887. for (; r2.length % 4; )
  14888. r2.push(c2);
  14889. return r2.join("");
  14890. }, parse: function(e4) {
  14891. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  14892. if (!r2) {
  14893. r2 = this._reverseMap = [];
  14894. for (var i2 = 0; i2 < n3.length; i2++)
  14895. r2[n3.charCodeAt(i2)] = i2;
  14896. }
  14897. var o2 = n3.charAt(64);
  14898. if (o2) {
  14899. var a2 = e4.indexOf(o2);
  14900. -1 !== a2 && (t4 = a2);
  14901. }
  14902. return s2(e4, t4, r2);
  14903. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  14904. }(), n2.enc.Base64);
  14905. });
  14906. const c = "FUNCTION", u = "OBJECT", l = "CLIENT_DB", h = "pending", d = "fulfilled", p = "rejected";
  14907. function f(e2) {
  14908. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  14909. }
  14910. function g(e2) {
  14911. return "object" === f(e2);
  14912. }
  14913. function m(e2) {
  14914. return "function" == typeof e2;
  14915. }
  14916. function y(e2) {
  14917. return function() {
  14918. try {
  14919. return e2.apply(e2, arguments);
  14920. } catch (e3) {
  14921. console.error(e3);
  14922. }
  14923. };
  14924. }
  14925. const _ = "REJECTED", w = "NOT_PENDING";
  14926. class v {
  14927. constructor({ createPromise: e2, retryRule: t2 = _ } = {}) {
  14928. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  14929. }
  14930. get needRetry() {
  14931. if (!this.status)
  14932. return true;
  14933. switch (this.retryRule) {
  14934. case _:
  14935. return this.status === p;
  14936. case w:
  14937. return this.status !== h;
  14938. }
  14939. }
  14940. exec() {
  14941. return this.needRetry ? (this.status = h, this.promise = this.createPromise().then((e2) => (this.status = d, Promise.resolve(e2)), (e2) => (this.status = p, Promise.reject(e2))), this.promise) : this.promise;
  14942. }
  14943. }
  14944. function I(e2) {
  14945. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  14946. }
  14947. const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), C = b, P = I(""), T = I("[]") || [];
  14948. let O = "";
  14949. try {
  14950. O = "__UNI__EE98A34";
  14951. } catch (e2) {
  14952. }
  14953. let E = {};
  14954. function L(e2, t2 = {}) {
  14955. var n2, s2;
  14956. return n2 = E, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (E[e2] = t2), E[e2];
  14957. }
  14958. E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {};
  14959. const R = ["invoke", "success", "fail", "complete"], U = L("_globalUniCloudInterceptor");
  14960. function N(e2, t2) {
  14961. U[e2] || (U[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => {
  14962. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  14963. let s2 = U[e3][t3];
  14964. s2 || (s2 = U[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3);
  14965. }(e2, n2, t2[n2]);
  14966. });
  14967. }
  14968. function D(e2, t2) {
  14969. U[e2] || (U[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => {
  14970. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  14971. const s2 = U[e3][t3];
  14972. if (!s2)
  14973. return;
  14974. const r2 = s2.indexOf(n3);
  14975. r2 > -1 && s2.splice(r2, 1);
  14976. }(e2, n2, t2[n2]);
  14977. }) : delete U[e2];
  14978. }
  14979. function M(e2, t2) {
  14980. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  14981. }
  14982. function q(e2, t2) {
  14983. return U[e2] && U[e2][t2] || [];
  14984. }
  14985. function F(e2) {
  14986. N("callObject", e2);
  14987. }
  14988. const K = L("_globalUniCloudListener"), j = "response", $ = "needLogin", B = "refreshToken", W = "clientdb", H = "cloudfunction", J = "cloudobject";
  14989. function z(e2) {
  14990. return K[e2] || (K[e2] = []), K[e2];
  14991. }
  14992. function V(e2, t2) {
  14993. const n2 = z(e2);
  14994. n2.includes(t2) || n2.push(t2);
  14995. }
  14996. function G(e2, t2) {
  14997. const n2 = z(e2), s2 = n2.indexOf(t2);
  14998. -1 !== s2 && n2.splice(s2, 1);
  14999. }
  15000. function Y(e2, t2) {
  15001. const n2 = z(e2);
  15002. for (let e3 = 0; e3 < n2.length; e3++) {
  15003. (0, n2[e3])(t2);
  15004. }
  15005. }
  15006. let Q, X = false;
  15007. function Z() {
  15008. return Q || (Q = new Promise((e2) => {
  15009. X && e2(), function t2() {
  15010. if ("function" == typeof getCurrentPages) {
  15011. const t3 = getCurrentPages();
  15012. t3 && t3[0] && (X = true, e2());
  15013. }
  15014. X || setTimeout(() => {
  15015. t2();
  15016. }, 30);
  15017. }();
  15018. }), Q);
  15019. }
  15020. function ee(e2) {
  15021. const t2 = {};
  15022. for (const n2 in e2) {
  15023. const s2 = e2[n2];
  15024. m(s2) && (t2[n2] = y(s2));
  15025. }
  15026. return t2;
  15027. }
  15028. class te extends Error {
  15029. constructor(e2) {
  15030. super(e2.message), this.errMsg = e2.message || e2.errMsg || "unknown system error", this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId;
  15031. }
  15032. toJson(e2 = 0) {
  15033. if (!(e2 >= 10))
  15034. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  15035. }
  15036. }
  15037. var ne = { request: (e2) => uni.request(e2), uploadFile: (e2) => uni.uploadFile(e2), setStorageSync: (e2, t2) => uni.setStorageSync(e2, t2), getStorageSync: (e2) => uni.getStorageSync(e2), removeStorageSync: (e2) => uni.removeStorageSync(e2), clearStorageSync: () => uni.clearStorageSync(), connectSocket: (e2) => uni.connectSocket(e2) };
  15038. function se(e2) {
  15039. return e2 && se(e2.__v_raw) || e2;
  15040. }
  15041. function re() {
  15042. return { token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"), tokenExpired: ne.getStorageSync("uni_id_token_expired") };
  15043. }
  15044. function ie({ token: e2, tokenExpired: t2 } = {}) {
  15045. e2 && ne.setStorageSync("uni_id_token", e2), t2 && ne.setStorageSync("uni_id_token_expired", t2);
  15046. }
  15047. let oe, ae;
  15048. function ce() {
  15049. return oe || (oe = uni.getSystemInfoSync()), oe;
  15050. }
  15051. function ue() {
  15052. let e2, t2;
  15053. try {
  15054. if (uni.getLaunchOptionsSync) {
  15055. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  15056. return;
  15057. const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync();
  15058. e2 = s2, t2 = n2;
  15059. }
  15060. } catch (e3) {
  15061. }
  15062. return { channel: e2, scene: t2 };
  15063. }
  15064. let le = {};
  15065. function he() {
  15066. const e2 = uni.getLocale && uni.getLocale() || "en";
  15067. if (ae)
  15068. return { ...le, ...ae, locale: e2, LOCALE: e2 };
  15069. const t2 = ce(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
  15070. for (const e3 in t2)
  15071. Object.hasOwnProperty.call(t2, e3) && -1 === o2.indexOf(e3) && delete t2[e3];
  15072. return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...le, ...ae, locale: e2, LOCALE: e2 };
  15073. }
  15074. var de = { sign: function(e2, t2) {
  15075. let n2 = "";
  15076. return Object.keys(e2).sort().forEach(function(t3) {
  15077. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  15078. }), n2 = n2.slice(1), i(n2, t2).toString();
  15079. }, wrappedRequest: function(e2, t2) {
  15080. return new Promise((n2, s2) => {
  15081. t2(Object.assign(e2, { complete(e3) {
  15082. e3 || (e3 = {});
  15083. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  15084. if (!e3.statusCode || e3.statusCode >= 400) {
  15085. const n3 = e3.data && e3.data.error && e3.data.error.code || "SYS_ERR", r3 = e3.data && e3.data.error && e3.data.error.message || e3.errMsg || "request:fail";
  15086. return s2(new te({ code: n3, message: r3, requestId: t3 }));
  15087. }
  15088. const r2 = e3.data;
  15089. if (r2.error)
  15090. return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  15091. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  15092. } }));
  15093. });
  15094. }, toBase64: function(e2) {
  15095. return a.stringify(o.parse(e2));
  15096. } };
  15097. var pe = class {
  15098. constructor(e2) {
  15099. ["spaceId", "clientSecret"].forEach((t2) => {
  15100. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  15101. throw new Error(`${t2} required`);
  15102. }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new v({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  15103. if (!e3.result || !e3.result.accessToken)
  15104. throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  15105. this.setAccessToken(e3.result.accessToken);
  15106. }), retryRule: w });
  15107. }
  15108. get hasAccessToken() {
  15109. return !!this.accessToken;
  15110. }
  15111. setAccessToken(e2) {
  15112. this.accessToken = e2;
  15113. }
  15114. requestWrapped(e2) {
  15115. return de.wrappedRequest(e2, this.adapter.request);
  15116. }
  15117. requestAuth(e2) {
  15118. return this.requestWrapped(e2);
  15119. }
  15120. request(e2, t2) {
  15121. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  15122. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  15123. }).then(() => this.getAccessToken()).then(() => {
  15124. const t4 = this.rebuildRequest(e2);
  15125. return this.request(t4, true);
  15126. })) : this.getAccessToken().then(() => {
  15127. const t3 = this.rebuildRequest(e2);
  15128. return this.request(t3, true);
  15129. }));
  15130. }
  15131. rebuildRequest(e2) {
  15132. const t2 = Object.assign({}, e2);
  15133. return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = de.sign(t2.data, this.config.clientSecret), t2;
  15134. }
  15135. setupRequest(e2, t2) {
  15136. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  15137. return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 };
  15138. }
  15139. getAccessToken() {
  15140. return this._getAccessTokenPromiseHub.exec();
  15141. }
  15142. async authorize() {
  15143. await this.getAccessToken();
  15144. }
  15145. callFunction(e2) {
  15146. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  15147. return this.request({ ...this.setupRequest(t2), timeout: e2.timeout });
  15148. }
  15149. getOSSUploadOptionsFromPath(e2) {
  15150. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  15151. return this.request(this.setupRequest(t2));
  15152. }
  15153. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  15154. return new Promise((o2, a2) => {
  15155. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  15156. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  15157. }, fail(e3) {
  15158. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  15159. } });
  15160. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  15161. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  15162. });
  15163. });
  15164. }
  15165. reportOSSUpload(e2) {
  15166. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  15167. return this.request(this.setupRequest(t2));
  15168. }
  15169. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  15170. if ("string" !== f(t2))
  15171. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  15172. if (!(t2 = t2.trim()))
  15173. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  15174. if (/:\/\//.test(t2))
  15175. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  15176. const o2 = i2 && i2.envType || this.config.envType;
  15177. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  15178. throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  15179. const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: l2, signature: h2, host: d2, ossPath: p2, id: g2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: l2, Signature: h2, host: d2, id: g2, key: p2, policy: m2, success_action_status: 200 };
  15180. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  15181. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  15182. _2.callback = de.toBase64(e3);
  15183. }
  15184. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  15185. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  15186. return { success: true, filePath: e2, fileID: c2 };
  15187. if ((await this.reportOSSUpload({ id: g2 })).success)
  15188. return { success: true, filePath: e2, fileID: c2 };
  15189. throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  15190. }
  15191. getTempFileURL({ fileList: e2 } = {}) {
  15192. return new Promise((t2, n2) => {
  15193. Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  15194. });
  15195. }
  15196. async getFileInfo({ fileList: e2 } = {}) {
  15197. if (!Array.isArray(e2) || 0 === e2.length)
  15198. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  15199. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  15200. return { fileList: (await this.request(this.setupRequest(t2))).result };
  15201. }
  15202. };
  15203. var fe = { init(e2) {
  15204. const t2 = new pe(e2), n2 = { signInAnonymously: function() {
  15205. return t2.authorize();
  15206. }, getLoginState: function() {
  15207. return Promise.resolve(false);
  15208. } };
  15209. return t2.auth = function() {
  15210. return n2;
  15211. }, t2.customAuth = t2.auth, t2;
  15212. } };
  15213. const ge = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  15214. var me;
  15215. !function(e2) {
  15216. e2.local = "local", e2.none = "none", e2.session = "session";
  15217. }(me || (me = {}));
  15218. var ye = function() {
  15219. }, _e = n(function(e2, t2) {
  15220. var n2;
  15221. e2.exports = (n2 = r, function(e3) {
  15222. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
  15223. !function() {
  15224. function t4(t5) {
  15225. for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
  15226. if (!(t5 % s4))
  15227. return false;
  15228. return true;
  15229. }
  15230. function n3(e4) {
  15231. return 4294967296 * (e4 - (0 | e4)) | 0;
  15232. }
  15233. for (var s3 = 2, r3 = 0; r3 < 64; )
  15234. t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
  15235. }();
  15236. var u2 = [], l2 = o2.SHA256 = i2.extend({ _doReset: function() {
  15237. this._hash = new r2.init(a2.slice(0));
  15238. }, _doProcessBlock: function(e4, t4) {
  15239. for (var n3 = this._hash.words, s3 = n3[0], r3 = n3[1], i3 = n3[2], o3 = n3[3], a3 = n3[4], l3 = n3[5], h2 = n3[6], d2 = n3[7], p2 = 0; p2 < 64; p2++) {
  15240. if (p2 < 16)
  15241. u2[p2] = 0 | e4[t4 + p2];
  15242. else {
  15243. var f2 = u2[p2 - 15], g2 = (f2 << 25 | f2 >>> 7) ^ (f2 << 14 | f2 >>> 18) ^ f2 >>> 3, m2 = u2[p2 - 2], y2 = (m2 << 15 | m2 >>> 17) ^ (m2 << 13 | m2 >>> 19) ^ m2 >>> 10;
  15244. u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
  15245. }
  15246. var _2 = s3 & r3 ^ s3 & i3 ^ r3 & i3, w2 = (s3 << 30 | s3 >>> 2) ^ (s3 << 19 | s3 >>> 13) ^ (s3 << 10 | s3 >>> 22), v2 = d2 + ((a3 << 26 | a3 >>> 6) ^ (a3 << 21 | a3 >>> 11) ^ (a3 << 7 | a3 >>> 25)) + (a3 & l3 ^ ~a3 & h2) + c2[p2] + u2[p2];
  15247. d2 = h2, h2 = l3, l3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
  15248. }
  15249. n3[0] = n3[0] + s3 | 0, n3[1] = n3[1] + r3 | 0, n3[2] = n3[2] + i3 | 0, n3[3] = n3[3] + o3 | 0, n3[4] = n3[4] + a3 | 0, n3[5] = n3[5] + l3 | 0, n3[6] = n3[6] + h2 | 0, n3[7] = n3[7] + d2 | 0;
  15250. }, _doFinalize: function() {
  15251. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  15252. return n3[r3 >>> 5] |= 128 << 24 - r3 % 32, n3[14 + (r3 + 64 >>> 9 << 4)] = e3.floor(s3 / 4294967296), n3[15 + (r3 + 64 >>> 9 << 4)] = s3, t4.sigBytes = 4 * n3.length, this._process(), this._hash;
  15253. }, clone: function() {
  15254. var e4 = i2.clone.call(this);
  15255. return e4._hash = this._hash.clone(), e4;
  15256. } });
  15257. t3.SHA256 = i2._createHelper(l2), t3.HmacSHA256 = i2._createHmacHelper(l2);
  15258. }(Math), n2.SHA256);
  15259. }), we = _e, ve = n(function(e2, t2) {
  15260. e2.exports = r.HmacSHA256;
  15261. });
  15262. const Ie = () => {
  15263. let e2;
  15264. if (!Promise) {
  15265. e2 = () => {
  15266. }, e2.promise = {};
  15267. const t3 = () => {
  15268. throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  15269. };
  15270. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  15271. }
  15272. const t2 = new Promise((t3, n2) => {
  15273. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  15274. });
  15275. return e2.promise = t2, e2;
  15276. };
  15277. function Se(e2) {
  15278. return void 0 === e2;
  15279. }
  15280. function be(e2) {
  15281. return "[object Null]" === Object.prototype.toString.call(e2);
  15282. }
  15283. var ke;
  15284. function Ae(e2) {
  15285. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  15286. var n2;
  15287. for (const e3 of t2) {
  15288. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  15289. if (t3())
  15290. return { adapter: n3(), runtime: s2 };
  15291. }
  15292. }
  15293. !function(e2) {
  15294. e2.WEB = "web", e2.WX_MP = "wx_mp";
  15295. }(ke || (ke = {}));
  15296. const Ce = { adapter: null, runtime: void 0 }, Pe = ["anonymousUuidKey"];
  15297. class Te extends ye {
  15298. constructor() {
  15299. super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
  15300. }
  15301. setItem(e2, t2) {
  15302. Ce.adapter.root.tcbObject[e2] = t2;
  15303. }
  15304. getItem(e2) {
  15305. return Ce.adapter.root.tcbObject[e2];
  15306. }
  15307. removeItem(e2) {
  15308. delete Ce.adapter.root.tcbObject[e2];
  15309. }
  15310. clear() {
  15311. delete Ce.adapter.root.tcbObject;
  15312. }
  15313. }
  15314. function xe(e2, t2) {
  15315. switch (e2) {
  15316. case "local":
  15317. return t2.localStorage || new Te();
  15318. case "none":
  15319. return new Te();
  15320. default:
  15321. return t2.sessionStorage || new Te();
  15322. }
  15323. }
  15324. class Oe {
  15325. constructor(e2) {
  15326. if (!this._storage) {
  15327. this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = xe(this._persistence, Ce.adapter);
  15328. const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
  15329. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
  15330. }
  15331. }
  15332. updatePersistence(e2) {
  15333. if (e2 === this._persistence)
  15334. return;
  15335. const t2 = "local" === this._persistence;
  15336. this._persistence = e2;
  15337. const n2 = xe(e2, Ce.adapter);
  15338. for (const e3 in this.keys) {
  15339. const s2 = this.keys[e3];
  15340. if (t2 && Pe.includes(e3))
  15341. continue;
  15342. const r2 = this._storage.getItem(s2);
  15343. Se(r2) || be(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  15344. }
  15345. this._storage = n2;
  15346. }
  15347. setStore(e2, t2, n2) {
  15348. if (!this._storage)
  15349. return;
  15350. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  15351. try {
  15352. this._storage.setItem(e2, r2);
  15353. } catch (e3) {
  15354. throw e3;
  15355. }
  15356. }
  15357. getStore(e2, t2) {
  15358. try {
  15359. if (!this._storage)
  15360. return;
  15361. } catch (e3) {
  15362. return "";
  15363. }
  15364. t2 = t2 || "localCachev1";
  15365. const n2 = this._storage.getItem(e2);
  15366. if (!n2)
  15367. return "";
  15368. if (n2.indexOf(t2) >= 0) {
  15369. return JSON.parse(n2).content;
  15370. }
  15371. return "";
  15372. }
  15373. removeStore(e2) {
  15374. this._storage.removeItem(e2);
  15375. }
  15376. }
  15377. const Ee = {}, Le = {};
  15378. function Re(e2) {
  15379. return Ee[e2];
  15380. }
  15381. class Ue {
  15382. constructor(e2, t2) {
  15383. this.data = t2 || null, this.name = e2;
  15384. }
  15385. }
  15386. class Ne extends Ue {
  15387. constructor(e2, t2) {
  15388. super("error", { error: e2, data: t2 }), this.error = e2;
  15389. }
  15390. }
  15391. const De = new class {
  15392. constructor() {
  15393. this._listeners = {};
  15394. }
  15395. on(e2, t2) {
  15396. return function(e3, t3, n2) {
  15397. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  15398. }(e2, t2, this._listeners), this;
  15399. }
  15400. off(e2, t2) {
  15401. return function(e3, t3, n2) {
  15402. if (n2 && n2[e3]) {
  15403. const s2 = n2[e3].indexOf(t3);
  15404. -1 !== s2 && n2[e3].splice(s2, 1);
  15405. }
  15406. }(e2, t2, this._listeners), this;
  15407. }
  15408. fire(e2, t2) {
  15409. if (e2 instanceof Ne)
  15410. return console.error(e2.error), this;
  15411. const n2 = "string" == typeof e2 ? new Ue(e2, t2 || {}) : e2;
  15412. const s2 = n2.name;
  15413. if (this._listens(s2)) {
  15414. n2.target = this;
  15415. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  15416. for (const t3 of e3)
  15417. t3.call(this, n2);
  15418. }
  15419. return this;
  15420. }
  15421. _listens(e2) {
  15422. return this._listeners[e2] && this._listeners[e2].length > 0;
  15423. }
  15424. }();
  15425. function Me(e2, t2) {
  15426. De.on(e2, t2);
  15427. }
  15428. function qe(e2, t2 = {}) {
  15429. De.fire(e2, t2);
  15430. }
  15431. function Fe(e2, t2) {
  15432. De.off(e2, t2);
  15433. }
  15434. const Ke = "loginStateChanged", je = "loginStateExpire", $e = "loginTypeChanged", Be = "anonymousConverted", We = "refreshAccessToken";
  15435. var He;
  15436. !function(e2) {
  15437. e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL";
  15438. }(He || (He = {}));
  15439. const Je = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], ze = { "X-SDK-Version": "1.3.5" };
  15440. function Ve(e2, t2, n2) {
  15441. const s2 = e2[t2];
  15442. e2[t2] = function(t3) {
  15443. const r2 = {}, i2 = {};
  15444. n2.forEach((n3) => {
  15445. const { data: s3, headers: o3 } = n3.call(e2, t3);
  15446. Object.assign(r2, s3), Object.assign(i2, o3);
  15447. });
  15448. const o2 = t3.data;
  15449. return o2 && (() => {
  15450. var e3;
  15451. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  15452. t3.data = { ...o2, ...r2 };
  15453. else
  15454. for (const e4 in r2)
  15455. o2.append(e4, r2[e4]);
  15456. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  15457. };
  15458. }
  15459. function Ge() {
  15460. const e2 = Math.random().toString(16).slice(2);
  15461. return { data: { seqId: e2 }, headers: { ...ze, "x-seqid": e2 } };
  15462. }
  15463. class Ye {
  15464. constructor(e2 = {}) {
  15465. var t2;
  15466. this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Re(this.config.env), this._localCache = (t2 = this.config.env, Le[t2]), Ve(this._reqClass, "post", [Ge]), Ve(this._reqClass, "upload", [Ge]), Ve(this._reqClass, "download", [Ge]);
  15467. }
  15468. async post(e2) {
  15469. return await this._reqClass.post(e2);
  15470. }
  15471. async upload(e2) {
  15472. return await this._reqClass.upload(e2);
  15473. }
  15474. async download(e2) {
  15475. return await this._reqClass.download(e2);
  15476. }
  15477. async refreshAccessToken() {
  15478. let e2, t2;
  15479. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  15480. try {
  15481. e2 = await this._refreshAccessTokenPromise;
  15482. } catch (e3) {
  15483. t2 = e3;
  15484. }
  15485. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  15486. throw t2;
  15487. return e2;
  15488. }
  15489. async _refreshAccessToken() {
  15490. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  15491. this._cache.removeStore(e2), this._cache.removeStore(t2);
  15492. let i2 = this._cache.getStore(n2);
  15493. if (!i2)
  15494. throw new te({ message: "未登录CloudBase" });
  15495. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  15496. if (a2.data.code) {
  15497. const { code: e3 } = a2.data;
  15498. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  15499. if (this._cache.getStore(s2) === He.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  15500. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  15501. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  15502. }
  15503. qe(je), this._cache.removeStore(n2);
  15504. }
  15505. throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  15506. }
  15507. if (a2.data.access_token)
  15508. return qe(We), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire };
  15509. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  15510. }
  15511. async getAccessToken() {
  15512. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  15513. if (!this._cache.getStore(n2))
  15514. throw new te({ message: "refresh token不存在,登录状态异常" });
  15515. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  15516. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  15517. }
  15518. async request(e2, t2, n2) {
  15519. const s2 = `x-tcb-trace_${this.config.env}`;
  15520. let r2 = "application/x-www-form-urlencoded";
  15521. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  15522. if (-1 === Je.indexOf(e2)) {
  15523. const { refreshTokenKey: e3 } = this._cache.keys;
  15524. this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
  15525. }
  15526. let o2;
  15527. if ("storage.uploadFile" === e2) {
  15528. o2 = new FormData();
  15529. for (let e3 in o2)
  15530. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  15531. r2 = "multipart/form-data";
  15532. } else {
  15533. r2 = "application/json", o2 = {};
  15534. for (let e3 in i2)
  15535. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  15536. }
  15537. let a2 = { headers: { "content-type": r2 } };
  15538. n2 && n2.timeout && (a2.timeout = n2.timeout), n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  15539. const c2 = this._localCache.getStore(s2);
  15540. c2 && (a2.headers["X-TCB-Trace"] = c2);
  15541. const { parse: u2, inQuery: l2, search: h2 } = t2;
  15542. let d2 = { env: this.config.env };
  15543. u2 && (d2.parse = true), l2 && (d2 = { ...l2, ...d2 });
  15544. let p2 = function(e3, t3, n3 = {}) {
  15545. const s3 = /\?/.test(t3);
  15546. let r3 = "";
  15547. for (let e4 in n3)
  15548. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  15549. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  15550. }(ge, "//tcb-api.tencentcloudapi.com/web", d2);
  15551. h2 && (p2 += h2);
  15552. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  15553. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  15554. throw new te({ code: "NETWORK_ERROR", message: "network request error" });
  15555. return f2;
  15556. }
  15557. async send(e2, t2 = {}, n2 = {}) {
  15558. const s2 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
  15559. if ("ACCESS_TOKEN_EXPIRED" === s2.data.code && -1 === Je.indexOf(e2)) {
  15560. await this.refreshAccessToken();
  15561. const s3 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
  15562. if (s3.data.code)
  15563. throw new te({ code: s3.data.code, message: s3.data.message });
  15564. return s3.data;
  15565. }
  15566. if (s2.data.code)
  15567. throw new te({ code: s2.data.code, message: s2.data.message });
  15568. return s2.data;
  15569. }
  15570. setRefreshToken(e2) {
  15571. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  15572. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  15573. }
  15574. }
  15575. const Qe = {};
  15576. function Xe(e2) {
  15577. return Qe[e2];
  15578. }
  15579. class Ze {
  15580. constructor(e2) {
  15581. this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env);
  15582. }
  15583. setRefreshToken(e2) {
  15584. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  15585. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  15586. }
  15587. setAccessToken(e2, t2) {
  15588. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  15589. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  15590. }
  15591. async refreshUserInfo() {
  15592. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  15593. return this.setLocalUserInfo(e2), e2;
  15594. }
  15595. setLocalUserInfo(e2) {
  15596. const { userInfoKey: t2 } = this._cache.keys;
  15597. this._cache.setStore(t2, e2);
  15598. }
  15599. }
  15600. class et {
  15601. constructor(e2) {
  15602. if (!e2)
  15603. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  15604. this._envId = e2, this._cache = Re(this._envId), this._request = Xe(this._envId), this.setUserInfo();
  15605. }
  15606. linkWithTicket(e2) {
  15607. if ("string" != typeof e2)
  15608. throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
  15609. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  15610. }
  15611. linkWithRedirect(e2) {
  15612. e2.signInWithRedirect();
  15613. }
  15614. updatePassword(e2, t2) {
  15615. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  15616. }
  15617. updateEmail(e2) {
  15618. return this._request.send("auth.updateEmail", { newEmail: e2 });
  15619. }
  15620. updateUsername(e2) {
  15621. if ("string" != typeof e2)
  15622. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  15623. return this._request.send("auth.updateUsername", { username: e2 });
  15624. }
  15625. async getLinkedUidList() {
  15626. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  15627. let t2 = false;
  15628. const { users: n2 } = e2;
  15629. return n2.forEach((e3) => {
  15630. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  15631. }), { users: n2, hasPrimaryUid: t2 };
  15632. }
  15633. setPrimaryUid(e2) {
  15634. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  15635. }
  15636. unlink(e2) {
  15637. return this._request.send("auth.unlink", { platform: e2 });
  15638. }
  15639. async update(e2) {
  15640. const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 });
  15641. this.setLocalUserInfo(a2);
  15642. }
  15643. async refresh() {
  15644. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  15645. return this.setLocalUserInfo(e2), e2;
  15646. }
  15647. setUserInfo() {
  15648. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  15649. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  15650. this[e3] = t2[e3];
  15651. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  15652. }
  15653. setLocalUserInfo(e2) {
  15654. const { userInfoKey: t2 } = this._cache.keys;
  15655. this._cache.setStore(t2, e2), this.setUserInfo();
  15656. }
  15657. }
  15658. class tt {
  15659. constructor(e2) {
  15660. if (!e2)
  15661. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  15662. this._cache = Re(e2);
  15663. const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2);
  15664. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new et(e2);
  15665. }
  15666. get isAnonymousAuth() {
  15667. return this.loginType === He.ANONYMOUS;
  15668. }
  15669. get isCustomAuth() {
  15670. return this.loginType === He.CUSTOM;
  15671. }
  15672. get isWeixinAuth() {
  15673. return this.loginType === He.WECHAT || this.loginType === He.WECHAT_OPEN || this.loginType === He.WECHAT_PUBLIC;
  15674. }
  15675. get loginType() {
  15676. return this._cache.getStore(this._cache.keys.loginTypeKey);
  15677. }
  15678. }
  15679. class nt extends Ze {
  15680. async signIn() {
  15681. this._cache.updatePersistence("local");
  15682. const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
  15683. if (r2.uuid && r2.refresh_token) {
  15684. this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.ANONYMOUS, persistence: "local" });
  15685. const e3 = new tt(this.config.env);
  15686. return await e3.user.refresh(), e3;
  15687. }
  15688. throw new te({ message: "匿名登录失败" });
  15689. }
  15690. async linkAndRetrieveDataWithTicket(e2) {
  15691. const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 });
  15692. if (i2.refresh_token)
  15693. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), qe(Be, { env: this.config.env }), qe($e, { loginType: He.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  15694. throw new te({ message: "匿名转化失败" });
  15695. }
  15696. _setAnonymousUUID(e2) {
  15697. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  15698. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, He.ANONYMOUS);
  15699. }
  15700. _clearAnonymousUUID() {
  15701. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  15702. }
  15703. }
  15704. class st extends Ze {
  15705. async signIn(e2) {
  15706. if ("string" != typeof e2)
  15707. throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
  15708. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  15709. if (n2.refresh_token)
  15710. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new tt(this.config.env);
  15711. throw new te({ message: "自定义登录失败" });
  15712. }
  15713. }
  15714. class rt extends Ze {
  15715. async signIn(e2, t2) {
  15716. if ("string" != typeof e2)
  15717. throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
  15718. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2;
  15719. if (r2)
  15720. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.EMAIL, persistence: this.config.persistence }), new tt(this.config.env);
  15721. throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
  15722. }
  15723. async activate(e2) {
  15724. return this._request.send("auth.activateEndUserMail", { token: e2 });
  15725. }
  15726. async resetPasswordWithToken(e2, t2) {
  15727. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  15728. }
  15729. }
  15730. class it extends Ze {
  15731. async signIn(e2, t2) {
  15732. if ("string" != typeof e2)
  15733. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  15734. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  15735. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: He.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  15736. if (r2)
  15737. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.USERNAME, persistence: this.config.persistence }), new tt(this.config.env);
  15738. throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
  15739. }
  15740. }
  15741. class ot {
  15742. constructor(e2) {
  15743. this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Me($e, this._onLoginTypeChanged);
  15744. }
  15745. get currentUser() {
  15746. const e2 = this.hasLoginState();
  15747. return e2 && e2.user || null;
  15748. }
  15749. get loginType() {
  15750. return this._cache.getStore(this._cache.keys.loginTypeKey);
  15751. }
  15752. anonymousAuthProvider() {
  15753. return new nt(this.config);
  15754. }
  15755. customAuthProvider() {
  15756. return new st(this.config);
  15757. }
  15758. emailAuthProvider() {
  15759. return new rt(this.config);
  15760. }
  15761. usernameAuthProvider() {
  15762. return new it(this.config);
  15763. }
  15764. async signInAnonymously() {
  15765. return new nt(this.config).signIn();
  15766. }
  15767. async signInWithEmailAndPassword(e2, t2) {
  15768. return new rt(this.config).signIn(e2, t2);
  15769. }
  15770. signInWithUsernameAndPassword(e2, t2) {
  15771. return new it(this.config).signIn(e2, t2);
  15772. }
  15773. async linkAndRetrieveDataWithTicket(e2) {
  15774. this._anonymousAuthProvider || (this._anonymousAuthProvider = new nt(this.config)), Me(Be, this._onAnonymousConverted);
  15775. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  15776. }
  15777. async signOut() {
  15778. if (this.loginType === He.ANONYMOUS)
  15779. throw new te({ message: "匿名用户不支持登出操作" });
  15780. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  15781. if (!s2)
  15782. return;
  15783. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  15784. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), qe(Ke), qe($e, { env: this.config.env, loginType: He.NULL, persistence: this.config.persistence }), r2;
  15785. }
  15786. async signUpWithEmailAndPassword(e2, t2) {
  15787. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  15788. }
  15789. async sendPasswordResetEmail(e2) {
  15790. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  15791. }
  15792. onLoginStateChanged(e2) {
  15793. Me(Ke, () => {
  15794. const t3 = this.hasLoginState();
  15795. e2.call(this, t3);
  15796. });
  15797. const t2 = this.hasLoginState();
  15798. e2.call(this, t2);
  15799. }
  15800. onLoginStateExpired(e2) {
  15801. Me(je, e2.bind(this));
  15802. }
  15803. onAccessTokenRefreshed(e2) {
  15804. Me(We, e2.bind(this));
  15805. }
  15806. onAnonymousConverted(e2) {
  15807. Me(Be, e2.bind(this));
  15808. }
  15809. onLoginTypeChanged(e2) {
  15810. Me($e, () => {
  15811. const t2 = this.hasLoginState();
  15812. e2.call(this, t2);
  15813. });
  15814. }
  15815. async getAccessToken() {
  15816. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  15817. }
  15818. hasLoginState() {
  15819. const { refreshTokenKey: e2 } = this._cache.keys;
  15820. return this._cache.getStore(e2) ? new tt(this.config.env) : null;
  15821. }
  15822. async isUsernameRegistered(e2) {
  15823. if ("string" != typeof e2)
  15824. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  15825. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  15826. return t2 && t2.isRegistered;
  15827. }
  15828. getLoginState() {
  15829. return Promise.resolve(this.hasLoginState());
  15830. }
  15831. async signInWithTicket(e2) {
  15832. return new st(this.config).signIn(e2);
  15833. }
  15834. shouldRefreshAccessToken(e2) {
  15835. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  15836. }
  15837. getUserInfo() {
  15838. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  15839. }
  15840. getAuthHeader() {
  15841. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  15842. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  15843. }
  15844. _onAnonymousConverted(e2) {
  15845. const { env: t2 } = e2.data;
  15846. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  15847. }
  15848. _onLoginTypeChanged(e2) {
  15849. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  15850. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  15851. }
  15852. }
  15853. const at = function(e2, t2) {
  15854. t2 = t2 || Ie();
  15855. const n2 = Xe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  15856. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  15857. const { data: { url: a2, authorization: c2, token: u2, fileId: l2, cosFileId: h2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": h2, success_action_status: "201", "x-cos-security-token": u2 };
  15858. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  15859. 201 === e4.statusCode ? t2(null, { fileID: l2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  15860. }).catch((e4) => {
  15861. t2(e4);
  15862. });
  15863. }).catch((e3) => {
  15864. t2(e3);
  15865. }), t2.promise;
  15866. }, ct = function(e2, t2) {
  15867. t2 = t2 || Ie();
  15868. const n2 = Xe(this.config.env), { cloudPath: s2 } = e2;
  15869. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  15870. t2(null, e3);
  15871. }).catch((e3) => {
  15872. t2(e3);
  15873. }), t2.promise;
  15874. }, ut = function({ fileList: e2 }, t2) {
  15875. if (t2 = t2 || Ie(), !e2 || !Array.isArray(e2))
  15876. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  15877. for (let t3 of e2)
  15878. if (!t3 || "string" != typeof t3)
  15879. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  15880. const n2 = { fileid_list: e2 };
  15881. return Xe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  15882. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  15883. }).catch((e3) => {
  15884. t2(e3);
  15885. }), t2.promise;
  15886. }, lt = function({ fileList: e2 }, t2) {
  15887. t2 = t2 || Ie(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  15888. let n2 = [];
  15889. for (let s3 of e2)
  15890. "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });
  15891. const s2 = { file_list: n2 };
  15892. return Xe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  15893. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  15894. }).catch((e3) => {
  15895. t2(e3);
  15896. }), t2.promise;
  15897. }, ht = async function({ fileID: e2 }, t2) {
  15898. const n2 = (await lt.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  15899. if ("SUCCESS" !== n2.code)
  15900. return t2 ? t2(n2) : new Promise((e3) => {
  15901. e3(n2);
  15902. });
  15903. const s2 = Xe(this.config.env);
  15904. let r2 = n2.download_url;
  15905. if (r2 = encodeURI(r2), !t2)
  15906. return s2.download({ url: r2 });
  15907. t2(await s2.download({ url: r2 }));
  15908. }, dt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2, timeout: i2 }, o2) {
  15909. const a2 = o2 || Ie();
  15910. let c2;
  15911. try {
  15912. c2 = t2 ? JSON.stringify(t2) : "";
  15913. } catch (e3) {
  15914. return Promise.reject(e3);
  15915. }
  15916. if (!e2)
  15917. return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  15918. const u2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: c2 };
  15919. return Xe(this.config.env).send("functions.invokeFunction", u2, { timeout: i2 }).then((e3) => {
  15920. if (e3.code)
  15921. a2(null, e3);
  15922. else {
  15923. let t3 = e3.data.response_data;
  15924. if (s2)
  15925. a2(null, { result: t3, requestId: e3.requestId });
  15926. else
  15927. try {
  15928. t3 = JSON.parse(e3.data.response_data), a2(null, { result: t3, requestId: e3.requestId });
  15929. } catch (e4) {
  15930. a2(new te({ message: "response data must be json" }));
  15931. }
  15932. }
  15933. return a2.promise;
  15934. }).catch((e3) => {
  15935. a2(e3);
  15936. }), a2.promise;
  15937. }, pt = { timeout: 15e3, persistence: "session" }, ft = {};
  15938. class gt {
  15939. constructor(e2) {
  15940. this.config = e2 || this.config, this.authObj = void 0;
  15941. }
  15942. init(e2) {
  15943. switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...pt, ...e2 }, true) {
  15944. case this.config.timeout > 6e5:
  15945. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  15946. break;
  15947. case this.config.timeout < 100:
  15948. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  15949. }
  15950. return new gt(this.config);
  15951. }
  15952. auth({ persistence: e2 } = {}) {
  15953. if (this.authObj)
  15954. return this.authObj;
  15955. const t2 = e2 || Ce.adapter.primaryStorage || pt.persistence;
  15956. var n2;
  15957. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  15958. const { env: t3 } = e3;
  15959. Ee[t3] = new Oe(e3), Le[t3] = new Oe({ ...e3, persistence: "local" });
  15960. }(this.config), n2 = this.config, Qe[n2.env] = new Ye(n2), this.authObj = new ot(this.config), this.authObj;
  15961. }
  15962. on(e2, t2) {
  15963. return Me.apply(this, [e2, t2]);
  15964. }
  15965. off(e2, t2) {
  15966. return Fe.apply(this, [e2, t2]);
  15967. }
  15968. callFunction(e2, t2) {
  15969. return dt.apply(this, [e2, t2]);
  15970. }
  15971. deleteFile(e2, t2) {
  15972. return ut.apply(this, [e2, t2]);
  15973. }
  15974. getTempFileURL(e2, t2) {
  15975. return lt.apply(this, [e2, t2]);
  15976. }
  15977. downloadFile(e2, t2) {
  15978. return ht.apply(this, [e2, t2]);
  15979. }
  15980. uploadFile(e2, t2) {
  15981. return at.apply(this, [e2, t2]);
  15982. }
  15983. getUploadMetadata(e2, t2) {
  15984. return ct.apply(this, [e2, t2]);
  15985. }
  15986. registerExtension(e2) {
  15987. ft[e2.name] = e2;
  15988. }
  15989. async invokeExtension(e2, t2) {
  15990. const n2 = ft[e2];
  15991. if (!n2)
  15992. throw new te({ message: `扩展${e2} 必须先注册` });
  15993. return await n2.invoke(t2, this);
  15994. }
  15995. useAdapters(e2) {
  15996. const { adapter: t2, runtime: n2 } = Ae(e2) || {};
  15997. t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
  15998. }
  15999. }
  16000. var mt = new gt();
  16001. function yt(e2, t2, n2) {
  16002. void 0 === n2 && (n2 = {});
  16003. var s2 = /\?/.test(t2), r2 = "";
  16004. for (var i2 in n2)
  16005. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  16006. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  16007. }
  16008. class _t {
  16009. post(e2) {
  16010. const { url: t2, data: n2, headers: s2, timeout: r2 } = e2;
  16011. return new Promise((e3, i2) => {
  16012. ne.request({ url: yt("https:", t2), data: n2, method: "POST", header: s2, timeout: r2, success(t3) {
  16013. e3(t3);
  16014. }, fail(e4) {
  16015. i2(e4);
  16016. } });
  16017. });
  16018. }
  16019. upload(e2) {
  16020. return new Promise((t2, n2) => {
  16021. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ne.uploadFile({ url: yt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  16022. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  16023. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  16024. }, fail(e3) {
  16025. n2(new Error(e3.errMsg || "uploadFile:fail"));
  16026. } });
  16027. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  16028. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  16029. });
  16030. });
  16031. }
  16032. }
  16033. const wt = { setItem(e2, t2) {
  16034. ne.setStorageSync(e2, t2);
  16035. }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
  16036. ne.removeStorageSync(e2);
  16037. }, clear() {
  16038. ne.clearStorageSync();
  16039. } };
  16040. var vt = { genAdapter: function() {
  16041. return { root: {}, reqClass: _t, localStorage: wt, primaryStorage: "local" };
  16042. }, isMatch: function() {
  16043. return true;
  16044. }, runtime: "uni_app" };
  16045. mt.useAdapters(vt);
  16046. const It = mt, St = It.init;
  16047. It.init = function(e2) {
  16048. e2.env = e2.spaceId;
  16049. const t2 = St.call(this, e2);
  16050. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  16051. const n2 = t2.auth;
  16052. return t2.auth = function(e3) {
  16053. const t3 = n2.call(this, e3);
  16054. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  16055. var n3;
  16056. t3[e4] = (n3 = t3[e4], function(e5) {
  16057. e5 = e5 || {};
  16058. const { success: t4, fail: s2, complete: r2 } = ee(e5);
  16059. if (!(t4 || s2 || r2))
  16060. return n3.call(this, e5);
  16061. n3.call(this, e5).then((e6) => {
  16062. t4 && t4(e6), r2 && r2(e6);
  16063. }, (e6) => {
  16064. s2 && s2(e6), r2 && r2(e6);
  16065. });
  16066. }).bind(t3);
  16067. }), t3;
  16068. }, t2.customAuth = t2.auth, t2;
  16069. };
  16070. var bt = It;
  16071. async function kt(e2, t2) {
  16072. const n2 = `http://${e2}:${t2}/system/ping`;
  16073. try {
  16074. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  16075. ne.request({ ...s2, success(t4) {
  16076. e4(t4);
  16077. }, fail(e5) {
  16078. t3(e5);
  16079. } });
  16080. }));
  16081. return !(!e3.data || 0 !== e3.data.code);
  16082. } catch (e3) {
  16083. return false;
  16084. }
  16085. var s2;
  16086. }
  16087. async function At(e2, t2) {
  16088. let n2;
  16089. for (let s2 = 0; s2 < e2.length; s2++) {
  16090. const r2 = e2[s2];
  16091. if (await kt(r2, t2)) {
  16092. n2 = r2;
  16093. break;
  16094. }
  16095. }
  16096. return { address: n2, port: t2 };
  16097. }
  16098. const Ct = { "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign", "serverless.file.resource.report": "storage/report", "serverless.file.resource.delete": "storage/delete", "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url" };
  16099. var Pt = class {
  16100. constructor(e2) {
  16101. if (["spaceId", "clientSecret"].forEach((t2) => {
  16102. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  16103. throw new Error(`${t2} required`);
  16104. }), !e2.endpoint)
  16105. throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");
  16106. this.config = Object.assign({}, e2), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ne;
  16107. }
  16108. async request(e2, t2 = true) {
  16109. const n2 = t2;
  16110. return e2 = n2 ? await this.setupLocalRequest(e2) : this.setupRequest(e2), Promise.resolve().then(() => n2 ? this.requestLocal(e2) : de.wrappedRequest(e2, this.adapter.request));
  16111. }
  16112. requestLocal(e2) {
  16113. return new Promise((t2, n2) => {
  16114. this.adapter.request(Object.assign(e2, { complete(e3) {
  16115. if (e3 || (e3 = {}), !e3.statusCode || e3.statusCode >= 400) {
  16116. const t3 = e3.data && e3.data.code || "SYS_ERR", s2 = e3.data && e3.data.message || "request:fail";
  16117. return n2(new te({ code: t3, message: s2 }));
  16118. }
  16119. t2({ success: true, result: e3.data });
  16120. } }));
  16121. });
  16122. }
  16123. setupRequest(e2) {
  16124. const t2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), n2 = { "Content-Type": "application/json" };
  16125. n2["x-serverless-sign"] = de.sign(t2, this.config.clientSecret);
  16126. const s2 = he();
  16127. n2["x-client-info"] = encodeURIComponent(JSON.stringify(s2));
  16128. const { token: r2 } = re();
  16129. return n2["x-client-token"] = r2, { url: this.config.requestUrl, method: "POST", data: t2, dataType: "json", header: JSON.parse(JSON.stringify(n2)) };
  16130. }
  16131. async setupLocalRequest(e2) {
  16132. const t2 = he(), { token: n2 } = re(), s2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now(), clientInfo: t2, token: n2 }), { address: r2, servePort: i2 } = this.__dev__ && this.__dev__.debugInfo || {}, { address: o2 } = await At(r2, i2);
  16133. return { url: `http://${o2}:${i2}/${Ct[e2.method]}`, method: "POST", data: s2, dataType: "json", header: JSON.parse(JSON.stringify({ "Content-Type": "application/json" })) };
  16134. }
  16135. callFunction(e2) {
  16136. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  16137. return this.request(t2, false);
  16138. }
  16139. getUploadFileOptions(e2) {
  16140. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  16141. return this.request(t2);
  16142. }
  16143. reportUploadFile(e2) {
  16144. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  16145. return this.request(t2);
  16146. }
  16147. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  16148. if (!t2)
  16149. throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  16150. let r2;
  16151. return this.getUploadFileOptions({ cloudPath: t2 }).then((t3) => {
  16152. const { url: i2, formData: o2, name: a2 } = t3.result;
  16153. return r2 = t3.result.fileUrl, new Promise((t4, r3) => {
  16154. const c2 = this.adapter.uploadFile({ url: i2, formData: o2, name: a2, filePath: e2, fileType: n2, success(e3) {
  16155. e3 && e3.statusCode < 400 ? t4(e3) : r3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  16156. }, fail(e3) {
  16157. r3(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  16158. } });
  16159. "function" == typeof s2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  16160. s2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  16161. });
  16162. });
  16163. }).then(() => this.reportUploadFile({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  16164. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  16165. }));
  16166. }
  16167. deleteFile({ fileList: e2 }) {
  16168. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  16169. return this.request(t2).then((e3) => {
  16170. if (e3.success)
  16171. return e3.result;
  16172. throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  16173. });
  16174. }
  16175. getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
  16176. if (!Array.isArray(e2) || 0 === e2.length)
  16177. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  16178. const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
  16179. return this.request(n2).then((e3) => {
  16180. if (e3.success)
  16181. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  16182. throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  16183. });
  16184. }
  16185. };
  16186. var Tt = { init(e2) {
  16187. const t2 = new Pt(e2), n2 = { signInAnonymously: function() {
  16188. return Promise.resolve();
  16189. }, getLoginState: function() {
  16190. return Promise.resolve(false);
  16191. } };
  16192. return t2.auth = function() {
  16193. return n2;
  16194. }, t2.customAuth = t2.auth, t2;
  16195. } }, xt = n(function(e2, t2) {
  16196. e2.exports = r.enc.Hex;
  16197. });
  16198. function Ot() {
  16199. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
  16200. var t2 = 16 * Math.random() | 0;
  16201. return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
  16202. });
  16203. }
  16204. function Et(e2 = "", t2 = {}) {
  16205. const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = Date.now(), u2 = Ot(), l2 = Object.assign({}, i2, { "x-from-app-id": a2.spaceAppId, "x-from-env-id": a2.spaceId, "x-to-env-id": a2.spaceId, "x-from-instance-id": c2, "x-from-function-name": s2, "x-client-timestamp": c2, "x-alipay-source": "client", "x-request-id": u2, "x-alipay-callid": u2, "x-trace-id": u2 }), h2 = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o2), [d2 = "", p2 = ""] = e2.split("?") || [], f2 = function(e3) {
  16206. const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
  16207. `).join(""), s3 = we(e3.body).toString(xt), r3 = `${e3.method.toUpperCase()}
  16208. ${e3.path}
  16209. ${e3.query}
  16210. ${n3}
  16211. ${t3}
  16212. ${s3}
  16213. `, i3 = we(r3).toString(xt), o3 = `HMAC-SHA256
  16214. ${e3.timestamp}
  16215. ${i3}
  16216. `, a3 = ve(o3, e3.secretKey).toString(xt);
  16217. return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`;
  16218. }({ path: d2, query: p2, method: r2, headers: l2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: h2.sort() });
  16219. return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, l2, { Authorization: f2 }) };
  16220. }
  16221. function Lt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {}, timeout: r2 }) {
  16222. return new Promise((i2, o2) => {
  16223. ne.request({ url: e2, method: n2, data: "object" == typeof t2 ? JSON.stringify(t2) : t2, header: s2, dataType: "json", timeout: r2, complete: (e3 = {}) => {
  16224. const t3 = s2["x-trace-id"] || "";
  16225. if (!e3.statusCode || e3.statusCode >= 400) {
  16226. const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
  16227. return o2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
  16228. }
  16229. i2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
  16230. } });
  16231. });
  16232. }
  16233. function Rt(e2, t2) {
  16234. const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = Et(n2, { functionName: "", data: s2, method: r2, headers: { "x-alipay-cloud-mode": "oss", "x-data-api-type": "oss", "x-expire-timestamp": Date.now() + 6e4 }, signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"], config: t2 });
  16235. return Lt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
  16236. const t3 = e3.data || {};
  16237. if (!t3.success)
  16238. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  16239. return t3.data || {};
  16240. }).catch((e3) => {
  16241. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  16242. });
  16243. }
  16244. function Ut(e2 = "") {
  16245. const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
  16246. if (n2 <= 0)
  16247. throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
  16248. const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
  16249. return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
  16250. }
  16251. function Nt(e2 = "") {
  16252. return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
  16253. }
  16254. class Dt {
  16255. constructor(e2) {
  16256. this.config = e2;
  16257. }
  16258. signedURL(e2, t2 = {}) {
  16259. const n2 = `/ws/function/${e2}`, s2 = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Ot(), timestamp: "" + Date.now() }), i2 = [n2, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) {
  16260. return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null;
  16261. }).filter(Boolean).join("&"), `host:${s2}`].join("\n"), o2 = ["HMAC-SHA256", we(i2).toString(xt)].join("\n"), a2 = ve(o2, this.config.secretKey).toString(xt), c2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&");
  16262. return `${this.config.wsEndpoint}${n2}?${c2}&signature=${a2}`;
  16263. }
  16264. }
  16265. var Mt = class {
  16266. constructor(e2) {
  16267. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
  16268. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  16269. throw new Error(`${t2} required`);
  16270. }), e2.endpoint) {
  16271. if ("string" != typeof e2.endpoint)
  16272. throw new Error("endpoint must be string");
  16273. if (!/^https:\/\//.test(e2.endpoint))
  16274. throw new Error("endpoint must start with https://");
  16275. e2.endpoint = e2.endpoint.replace(/\/$/, "");
  16276. }
  16277. this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn`, wsEndpoint: e2.wsEndpoint || `wss://${e2.spaceId}.api-hz.cloudbasefunction.cn` }), this._websocket = new Dt(this.config);
  16278. }
  16279. callFunction(e2) {
  16280. return function(e3, t2) {
  16281. const { name: n2, data: s2, async: r2 = false, timeout: i2 } = e3, o2 = "POST", a2 = { "x-to-function-name": n2 };
  16282. r2 && (a2["x-function-invoke-type"] = "async");
  16283. const { url: c2, headers: u2 } = Et("/functions/invokeFunction", { functionName: n2, data: s2, method: o2, headers: a2, signHeaderKeys: ["x-to-function-name"], config: t2 });
  16284. return Lt({ url: c2, data: s2, method: o2, headers: u2, timeout: i2 }).then((e4) => {
  16285. let t3 = 0;
  16286. if (r2) {
  16287. const n3 = e4.data || {};
  16288. t3 = "200" === n3.errCode ? 0 : n3.errCode, e4.data = n3.data || {}, e4.errMsg = n3.errMsg;
  16289. }
  16290. if (0 !== t3)
  16291. throw new te({ code: t3, message: e4.errMsg, requestId: e4.requestId });
  16292. return { errCode: t3, success: 0 === t3, requestId: e4.requestId, result: e4.data };
  16293. }).catch((e4) => {
  16294. throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
  16295. });
  16296. }(e2, this.config);
  16297. }
  16298. uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
  16299. return new Promise((i2, o2) => {
  16300. const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
  16301. e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  16302. }, fail(e3) {
  16303. o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  16304. } });
  16305. "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
  16306. r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  16307. });
  16308. });
  16309. }
  16310. async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
  16311. if ("string" !== f(t2))
  16312. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  16313. if (!(t2 = t2.trim()))
  16314. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  16315. if (/:\/\//.test(t2))
  16316. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  16317. const r2 = await Rt({ path: "/".concat(t2.replace(/^\//, ""), "?post_url") }, this.config), { file_id: i2, upload_url: o2, form_data: a2 } = r2, c2 = a2 && a2.reduce((e3, t3) => (e3[t3.key] = t3.value, e3), {});
  16318. return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
  16319. }
  16320. async getTempFileURL({ fileList: e2 }) {
  16321. return new Promise((t2, n2) => {
  16322. (!e2 || e2.length < 0) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList不能为空数组" })), e2.length > 50 && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList数组长度不能超过50" }));
  16323. const s2 = [];
  16324. for (const t3 of e2) {
  16325. "string" !== f(t3) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList的元素必须是非空的字符串" }));
  16326. const e3 = Ut.call(this, t3);
  16327. s2.push({ file_id: e3, expire: 600 });
  16328. }
  16329. Rt({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
  16330. const { file_list: n3 = [] } = e3;
  16331. t2({ fileList: n3.map((e4) => ({ fileID: Nt.call(this, e4.file_id), tempFileURL: e4.download_url })) });
  16332. }).catch((e3) => n2(e3));
  16333. });
  16334. }
  16335. async connectWebSocket(e2) {
  16336. const { name: t2, query: n2 } = e2;
  16337. return ne.connectSocket({ url: this._websocket.signedURL(t2, n2), complete: () => {
  16338. } });
  16339. }
  16340. };
  16341. var qt = { init: (e2) => {
  16342. e2.provider = "alipay";
  16343. const t2 = new Mt(e2);
  16344. return t2.auth = function() {
  16345. return { signInAnonymously: function() {
  16346. return Promise.resolve();
  16347. }, getLoginState: function() {
  16348. return Promise.resolve(true);
  16349. } };
  16350. }, t2;
  16351. } };
  16352. function Ft({ data: e2 }) {
  16353. let t2;
  16354. t2 = he();
  16355. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  16356. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  16357. const { token: e3 } = re();
  16358. e3 && (n2.uniIdToken = e3);
  16359. }
  16360. return n2;
  16361. }
  16362. async function Kt(e2 = {}) {
  16363. await this.__dev__.initLocalNetwork();
  16364. const { localAddress: t2, localPort: n2 } = this.__dev__, s2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], r2 = this.config.spaceId, i2 = `http://${t2}:${n2}/system/check-function`, o2 = `http://${t2}:${n2}/cloudfunctions/${e2.name}`;
  16365. return new Promise((t3, n3) => {
  16366. ne.request({ method: "POST", url: i2, data: { name: e2.name, platform: C, provider: s2, spaceId: r2 }, timeout: 3e3, success(e3) {
  16367. t3(e3);
  16368. }, fail() {
  16369. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  16370. } });
  16371. }).then(({ data: e3 } = {}) => {
  16372. const { code: t3, message: n3 } = e3 || {};
  16373. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  16374. }).then(({ code: t3, message: n3 }) => {
  16375. if (0 !== t3) {
  16376. switch (t3) {
  16377. case "MODULE_ENCRYPTED":
  16378. console.error(`此云函数(${e2.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  16379. break;
  16380. case "FUNCTION_ENCRYPTED":
  16381. console.error(`此云函数(${e2.name})已加密不可本地调试,自动切换为云端已部署的云函数`);
  16382. break;
  16383. case "ACTION_ENCRYPTED":
  16384. console.error(n3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  16385. break;
  16386. case "NETWORK_ERROR":
  16387. console.error(n3 || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  16388. break;
  16389. case "SWITCH_TO_CLOUD":
  16390. break;
  16391. default: {
  16392. const e3 = `检测本地调试服务出现错误:${n3},请检查网络环境或重启客户端再试`;
  16393. throw console.error(e3), new Error(e3);
  16394. }
  16395. }
  16396. return this._callCloudFunction(e2);
  16397. }
  16398. return new Promise((t4, n4) => {
  16399. const r3 = Ft.call(this, { data: e2.data });
  16400. ne.request({ method: "POST", url: o2, data: { provider: s2, platform: C, param: r3 }, timeout: e2.timeout, success: ({ statusCode: e3, data: s3 } = {}) => !e3 || e3 >= 400 ? n4(new te({ code: s3.code || "SYS_ERR", message: s3.message || "request:fail" })) : t4({ result: s3 }), fail(e3) {
  16401. n4(new te({ code: e3.code || e3.errCode || "SYS_ERR", message: e3.message || e3.errMsg || "request:fail" }));
  16402. } });
  16403. });
  16404. });
  16405. }
  16406. const jt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  16407. var $t = /[\\^$.*+?()[\]{}|]/g, Bt = RegExp($t.source);
  16408. function Wt(e2, t2, n2) {
  16409. return e2.replace(new RegExp((s2 = t2) && Bt.test(s2) ? s2.replace($t, "\\$&") : s2, "g"), n2);
  16410. var s2;
  16411. }
  16412. const Jt = "request", zt = "response", Vt = "both";
  16413. const En = { code: 2e4, message: "System error" }, Ln = { code: 20101, message: "Invalid client" };
  16414. function Nn(e2) {
  16415. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  16416. return new te({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || En.code, message: r2 || o2, cause: a2 });
  16417. }
  16418. let Mn;
  16419. function $n({ secretType: e2 } = {}) {
  16420. return e2 === Jt || e2 === zt || e2 === Vt;
  16421. }
  16422. function Bn({ name: e2, data: t2 = {} } = {}) {
  16423. return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action;
  16424. }
  16425. function Wn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  16426. const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
  16427. let o2 = r2;
  16428. "app" === r2 && (o2 = i2);
  16429. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  16430. const n3 = A;
  16431. if (!n3)
  16432. return {};
  16433. e3 = /* @__PURE__ */ function(e4) {
  16434. return "tencent" === e4 ? "tcb" : e4;
  16435. }(e3);
  16436. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  16437. return s3 && s3.config;
  16438. }({ provider: e2, spaceId: t2 });
  16439. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  16440. return false;
  16441. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  16442. if (0 === u2.length)
  16443. return true;
  16444. const l2 = function(e3, t3) {
  16445. let n3, s3, r3;
  16446. for (let i3 = 0; i3 < e3.length; i3++) {
  16447. const o3 = e3[i3];
  16448. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  16449. }
  16450. return n3 || s3 || r3;
  16451. }(u2, n2);
  16452. if (!l2)
  16453. return false;
  16454. if ((c2[l2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  16455. return true;
  16456. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), Nn(Ln);
  16457. }
  16458. function Hn({ functionName: e2, result: t2, logPvd: n2 }) {
  16459. if (this.__dev__.debugLog && t2 && t2.requestId) {
  16460. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  16461. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  16462. }
  16463. }
  16464. function Jn(e2) {
  16465. const t2 = e2.callFunction, n2 = function(n3) {
  16466. const s2 = n3.name;
  16467. n3.data = Ft.call(e2, { data: n3.data });
  16468. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], i2 = $n(n3), o2 = Bn(n3), a2 = i2 || o2;
  16469. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && Hn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && Hn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  16470. for (let s3 = 0; s3 < n4.length; s3++) {
  16471. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  16472. if (!a3)
  16473. continue;
  16474. let c2 = i3;
  16475. for (let e5 = 1; e5 < a3.length; e5++)
  16476. c2 = Wt(c2, `{$${e5}}`, a3[e5]);
  16477. for (const e5 in t3)
  16478. c2 = Wt(c2, `{${e5}}`, t3[e5]);
  16479. return "replace" === o3 ? c2 : e4 + c2;
  16480. }
  16481. return e4;
  16482. }({ message: `[${n3.name}]: ${e3.message}`, formatter: jt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  16483. };
  16484. e2.callFunction = function(t3) {
  16485. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  16486. let o2, a2;
  16487. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && T ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Kt), o2 = Kt) : o2 = n2, o2 = o2.bind(e2), Bn(t3))
  16488. a2 = n2.call(e2, t3);
  16489. else if ($n(t3)) {
  16490. a2 = new Mn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  16491. } else if (Wn({ provider: s2, spaceId: r2, functionName: i2 })) {
  16492. a2 = new Mn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  16493. } else
  16494. a2 = o2(t3);
  16495. return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2.then((e3) => ("undefined" != typeof UTSJSONObject && (e3.result = new UTSJSONObject(e3.result)), e3));
  16496. };
  16497. }
  16498. Mn = class {
  16499. constructor() {
  16500. throw Nn({ message: `Platform ${C} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  16501. }
  16502. };
  16503. const zn = Symbol("CLIENT_DB_INTERNAL");
  16504. function Vn(e2, t2) {
  16505. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = zn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  16506. if ("_uniClient" === n2)
  16507. return null;
  16508. if ("symbol" == typeof n2)
  16509. return e3[n2];
  16510. if (n2 in e3 || "string" != typeof n2) {
  16511. const t3 = e3[n2];
  16512. return "function" == typeof t3 ? t3.bind(e3) : t3;
  16513. }
  16514. return t2.get(e3, n2, s2);
  16515. } });
  16516. }
  16517. function Gn(e2) {
  16518. return { on: (t2, n2) => {
  16519. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  16520. }, off: (t2, n2) => {
  16521. e2[t2] = e2[t2] || [];
  16522. const s2 = e2[t2].indexOf(n2);
  16523. -1 !== s2 && e2[t2].splice(s2, 1);
  16524. } };
  16525. }
  16526. const Yn = ["db.Geo", "db.command", "command.aggregate"];
  16527. function Qn(e2, t2) {
  16528. return Yn.indexOf(`${e2}.${t2}`) > -1;
  16529. }
  16530. function Xn(e2) {
  16531. switch (f(e2 = se(e2))) {
  16532. case "array":
  16533. return e2.map((e3) => Xn(e3));
  16534. case "object":
  16535. return e2._internalType === zn || Object.keys(e2).forEach((t2) => {
  16536. e2[t2] = Xn(e2[t2]);
  16537. }), e2;
  16538. case "regexp":
  16539. return { $regexp: { source: e2.source, flags: e2.flags } };
  16540. case "date":
  16541. return { $date: e2.toISOString() };
  16542. default:
  16543. return e2;
  16544. }
  16545. }
  16546. function Zn(e2) {
  16547. return e2 && e2.content && e2.content.$method;
  16548. }
  16549. class es {
  16550. constructor(e2, t2, n2) {
  16551. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  16552. }
  16553. toJSON() {
  16554. let e2 = this;
  16555. const t2 = [e2.content];
  16556. for (; e2.prevStage; )
  16557. e2 = e2.prevStage, t2.push(e2.content);
  16558. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: Xn(e3.$param) })) };
  16559. }
  16560. toString() {
  16561. return JSON.stringify(this.toJSON());
  16562. }
  16563. getAction() {
  16564. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  16565. return e2 && e2.$param && e2.$param[0];
  16566. }
  16567. getCommand() {
  16568. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  16569. }
  16570. get isAggregate() {
  16571. let e2 = this;
  16572. for (; e2; ) {
  16573. const t2 = Zn(e2), n2 = Zn(e2.prevStage);
  16574. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  16575. return true;
  16576. e2 = e2.prevStage;
  16577. }
  16578. return false;
  16579. }
  16580. get isCommand() {
  16581. let e2 = this;
  16582. for (; e2; ) {
  16583. if ("command" === Zn(e2))
  16584. return true;
  16585. e2 = e2.prevStage;
  16586. }
  16587. return false;
  16588. }
  16589. get isAggregateCommand() {
  16590. let e2 = this;
  16591. for (; e2; ) {
  16592. const t2 = Zn(e2), n2 = Zn(e2.prevStage);
  16593. if ("aggregate" === t2 && "command" === n2)
  16594. return true;
  16595. e2 = e2.prevStage;
  16596. }
  16597. return false;
  16598. }
  16599. getNextStageFn(e2) {
  16600. const t2 = this;
  16601. return function() {
  16602. return ts({ $method: e2, $param: Xn(Array.from(arguments)) }, t2, t2._database);
  16603. };
  16604. }
  16605. get count() {
  16606. return this.isAggregate ? this.getNextStageFn("count") : function() {
  16607. return this._send("count", Array.from(arguments));
  16608. };
  16609. }
  16610. get remove() {
  16611. return this.isCommand ? this.getNextStageFn("remove") : function() {
  16612. return this._send("remove", Array.from(arguments));
  16613. };
  16614. }
  16615. get() {
  16616. return this._send("get", Array.from(arguments));
  16617. }
  16618. get add() {
  16619. return this.isCommand ? this.getNextStageFn("add") : function() {
  16620. return this._send("add", Array.from(arguments));
  16621. };
  16622. }
  16623. update() {
  16624. return this._send("update", Array.from(arguments));
  16625. }
  16626. end() {
  16627. return this._send("end", Array.from(arguments));
  16628. }
  16629. get set() {
  16630. return this.isCommand ? this.getNextStageFn("set") : function() {
  16631. throw new Error("JQL禁止使用set方法");
  16632. };
  16633. }
  16634. _send(e2, t2) {
  16635. const n2 = this.getAction(), s2 = this.getCommand();
  16636. if (s2.$db.push({ $method: e2, $param: Xn(t2) }), S) {
  16637. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  16638. t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  16639. }
  16640. return this._database._callCloudFunction({ action: n2, command: s2 });
  16641. }
  16642. }
  16643. function ts(e2, t2, n2) {
  16644. return Vn(new es(e2, t2, n2), { get(e3, t3) {
  16645. let s2 = "db";
  16646. return e3 && e3.content && (s2 = e3.content.$method), Qn(s2, t3) ? ts({ $method: t3 }, e3, n2) : function() {
  16647. return ts({ $method: t3, $param: Xn(Array.from(arguments)) }, e3, n2);
  16648. };
  16649. } });
  16650. }
  16651. function ns({ path: e2, method: t2 }) {
  16652. return class {
  16653. constructor() {
  16654. this.param = Array.from(arguments);
  16655. }
  16656. toJSON() {
  16657. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  16658. }
  16659. toString() {
  16660. return JSON.stringify(this.toJSON());
  16661. }
  16662. };
  16663. }
  16664. function ss(e2, t2 = {}) {
  16665. return Vn(new e2(t2), { get: (e3, t3) => Qn("db", t3) ? ts({ $method: t3 }, null, e3) : function() {
  16666. return ts({ $method: t3, $param: Xn(Array.from(arguments)) }, null, e3);
  16667. } });
  16668. }
  16669. class rs extends class {
  16670. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  16671. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Gn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Gn(this._dbCallBacks)), this.env = Vn({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Vn({}, { get: (e3, t3) => ns({ path: ["Geo"], method: t3 }) }), this.serverDate = ns({ path: [], method: "serverDate" }), this.RegExp = ns({ path: [], method: "RegExp" });
  16672. }
  16673. getCloudEnv(e2) {
  16674. if ("string" != typeof e2 || !e2.trim())
  16675. throw new Error("getCloudEnv参数错误");
  16676. return { $env: e2.replace("$cloudEnv_", "") };
  16677. }
  16678. _callback(e2, t2) {
  16679. const n2 = this._dbCallBacks;
  16680. n2[e2] && n2[e2].forEach((e3) => {
  16681. e3(...t2);
  16682. });
  16683. }
  16684. _callbackAuth(e2, t2) {
  16685. const n2 = this._authCallBacks;
  16686. n2[e2] && n2[e2].forEach((e3) => {
  16687. e3(...t2);
  16688. });
  16689. }
  16690. multiSend() {
  16691. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  16692. const t3 = e3.getAction(), n2 = e3.getCommand();
  16693. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  16694. throw new Error("multiSend只支持子命令内使用getTemp");
  16695. return { action: t3, command: n2 };
  16696. });
  16697. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  16698. }
  16699. } {
  16700. _parseResult(e2) {
  16701. return this._isJQL ? e2.result : e2;
  16702. }
  16703. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  16704. function r2(e3, t3) {
  16705. if (n2 && s2)
  16706. for (let n3 = 0; n3 < s2.length; n3++) {
  16707. const r3 = s2[n3];
  16708. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  16709. }
  16710. }
  16711. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  16712. function a2(e3) {
  16713. return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Y(j, { type: W, content: e3 }), Promise.reject(e3)));
  16714. }
  16715. const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
  16716. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  16717. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  16718. if (u3)
  16719. for (let e4 = 0; e4 < u3.length; e4++) {
  16720. const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console["warn" === t4 ? "error" : t4] || console.log;
  16721. let i3 = "[System Info]" + n4;
  16722. s4 && (i3 = `${i3}
  16723. 详细信息:${s4}`), r3(i3);
  16724. }
  16725. if (t3) {
  16726. return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
  16727. }
  16728. e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (ie({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Y(B, { token: s3, tokenExpired: c3 }));
  16729. const l2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  16730. for (let t4 = 0; t4 < l2.length; t4++) {
  16731. const { prop: n4, tips: s4 } = l2[t4];
  16732. if (n4 in e3.result) {
  16733. const t5 = e3.result[n4];
  16734. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  16735. }
  16736. }
  16737. return function(e4) {
  16738. return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
  16739. r2(e4, null);
  16740. const t4 = i2._parseResult(e4);
  16741. return Y(j, { type: W, content: t4 }), Promise.resolve(t4);
  16742. });
  16743. }(e3);
  16744. }, (e3) => {
  16745. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  16746. return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  16747. });
  16748. }
  16749. }
  16750. const is = "token无效,跳转登录页面", os = "token过期,跳转登录页面", as = { TOKEN_INVALID_TOKEN_EXPIRED: os, TOKEN_INVALID_INVALID_CLIENTID: is, TOKEN_INVALID: is, TOKEN_INVALID_WRONG_TOKEN: is, TOKEN_INVALID_ANONYMOUS_USER: is }, cs = { "uni-id-token-expired": os, "uni-id-check-token-failed": is, "uni-id-token-not-exist": is, "uni-id-check-device-feature-failed": is };
  16751. function us(e2, t2) {
  16752. let n2 = "";
  16753. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  16754. }
  16755. function ls(e2 = [], t2 = "") {
  16756. const n2 = [], s2 = [];
  16757. return e2.forEach((e3) => {
  16758. true === e3.needLogin ? n2.push(us(t2, e3.path)) : false === e3.needLogin && s2.push(us(t2, e3.path));
  16759. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  16760. }
  16761. function hs(e2) {
  16762. return e2.split("?")[0].replace(/^\//, "");
  16763. }
  16764. function ds() {
  16765. return function(e2) {
  16766. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  16767. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  16768. }(function() {
  16769. const e2 = getCurrentPages();
  16770. return e2[e2.length - 1];
  16771. }());
  16772. }
  16773. function ps() {
  16774. return hs(ds());
  16775. }
  16776. function fs(e2 = "", t2 = {}) {
  16777. if (!e2)
  16778. return false;
  16779. if (!(t2 && t2.list && t2.list.length))
  16780. return false;
  16781. const n2 = t2.list, s2 = hs(e2);
  16782. return n2.some((e3) => e3.pagePath === s2);
  16783. }
  16784. const gs = !!e.uniIdRouter;
  16785. const { loginPage: ms, routerNeedLogin: ys, resToLogin: _s, needLoginPage: ws, notNeedLoginPage: vs, loginPageInTabBar: Is } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
  16786. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = ls(t2), { needLoginPage: l2, notNeedLoginPage: h2 } = function(e2 = []) {
  16787. const t3 = [], n3 = [];
  16788. return e2.forEach((e3) => {
  16789. const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = ls(r3, s3);
  16790. t3.push(...i3), n3.push(...o3);
  16791. }), { needLoginPage: t3, notNeedLoginPage: n3 };
  16792. }(n2);
  16793. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...l2], notNeedLoginPage: [...u2, ...h2], loginPageInTabBar: fs(i2, r2) };
  16794. }();
  16795. if (ws.indexOf(ms) > -1)
  16796. throw new Error(`Login page [${ms}] should not be "needLogin", please check your pages.json`);
  16797. function Ss(e2) {
  16798. const t2 = ps();
  16799. if ("/" === e2.charAt(0))
  16800. return e2;
  16801. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  16802. i2.pop();
  16803. for (let e3 = 0; e3 < r2.length; e3++) {
  16804. const t3 = r2[e3];
  16805. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  16806. }
  16807. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  16808. }
  16809. function bs(e2) {
  16810. const t2 = hs(Ss(e2));
  16811. return !(vs.indexOf(t2) > -1) && (ws.indexOf(t2) > -1 || ys.some((t3) => function(e3, t4) {
  16812. return new RegExp(t4).test(e3);
  16813. }(e2, t3)));
  16814. }
  16815. function ks({ redirect: e2 }) {
  16816. const t2 = hs(e2), n2 = hs(ms);
  16817. return ps() !== n2 && t2 !== n2;
  16818. }
  16819. function As({ api: e2, redirect: t2 } = {}) {
  16820. if (!t2 || !ks({ redirect: t2 }))
  16821. return;
  16822. const n2 = function(e3, t3) {
  16823. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  16824. }(ms, t2);
  16825. Is ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  16826. const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch };
  16827. setTimeout(() => {
  16828. s2[e2]({ url: n2 });
  16829. }, 0);
  16830. }
  16831. function Cs({ url: e2 } = {}) {
  16832. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  16833. const { token: e3, tokenExpired: t3 } = re();
  16834. let n3;
  16835. if (e3) {
  16836. if (t3 < Date.now()) {
  16837. const e4 = "uni-id-token-expired";
  16838. n3 = { errCode: e4, errMsg: cs[e4] };
  16839. }
  16840. } else {
  16841. const e4 = "uni-id-check-token-failed";
  16842. n3 = { errCode: e4, errMsg: cs[e4] };
  16843. }
  16844. return n3;
  16845. }();
  16846. if (bs(e2) && n2) {
  16847. n2.uniIdRedirectUrl = e2;
  16848. if (z($).length > 0)
  16849. return setTimeout(() => {
  16850. Y($, n2);
  16851. }, 0), t2.abortLoginPageJump = true, t2;
  16852. t2.autoToLoginPage = true;
  16853. }
  16854. return t2;
  16855. }
  16856. function Ps() {
  16857. !function() {
  16858. const e3 = ds(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = Cs({ url: e3 });
  16859. t2 || n2 && As({ api: "redirectTo", redirect: e3 });
  16860. }();
  16861. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  16862. for (let t2 = 0; t2 < e2.length; t2++) {
  16863. const n2 = e2[t2];
  16864. uni.addInterceptor(n2, { invoke(e3) {
  16865. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = Cs({ url: e3.url });
  16866. return t3 ? e3 : s2 ? (As({ api: n2, redirect: Ss(e3.url) }), false) : e3;
  16867. } });
  16868. }
  16869. }
  16870. function Ts() {
  16871. this.onResponse((e2) => {
  16872. const { type: t2, content: n2 } = e2;
  16873. let s2 = false;
  16874. switch (t2) {
  16875. case "cloudobject":
  16876. s2 = function(e3) {
  16877. if ("object" != typeof e3)
  16878. return false;
  16879. const { errCode: t3 } = e3 || {};
  16880. return t3 in cs;
  16881. }(n2);
  16882. break;
  16883. case "clientdb":
  16884. s2 = function(e3) {
  16885. if ("object" != typeof e3)
  16886. return false;
  16887. const { errCode: t3 } = e3 || {};
  16888. return t3 in as;
  16889. }(n2);
  16890. }
  16891. s2 && function(e3 = {}) {
  16892. const t3 = z($);
  16893. Z().then(() => {
  16894. const n3 = ds();
  16895. if (n3 && ks({ redirect: n3 }))
  16896. return t3.length > 0 ? Y($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (ms && As({ api: "navigateTo", redirect: n3 }));
  16897. });
  16898. }(n2);
  16899. });
  16900. }
  16901. function xs(e2) {
  16902. !function(e3) {
  16903. e3.onResponse = function(e4) {
  16904. V(j, e4);
  16905. }, e3.offResponse = function(e4) {
  16906. G(j, e4);
  16907. };
  16908. }(e2), function(e3) {
  16909. e3.onNeedLogin = function(e4) {
  16910. V($, e4);
  16911. }, e3.offNeedLogin = function(e4) {
  16912. G($, e4);
  16913. }, gs && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = true, Z().then(() => {
  16914. Ps.call(e3);
  16915. }), _s && Ts.call(e3)));
  16916. }(e2), function(e3) {
  16917. e3.onRefreshToken = function(e4) {
  16918. V(B, e4);
  16919. }, e3.offRefreshToken = function(e4) {
  16920. G(B, e4);
  16921. };
  16922. }(e2);
  16923. }
  16924. let Os;
  16925. const Es = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Ls = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  16926. function Rs() {
  16927. const e2 = re().token || "", t2 = e2.split(".");
  16928. if (!e2 || 3 !== t2.length)
  16929. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  16930. let n2;
  16931. try {
  16932. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(Os(s2).split("").map(function(e3) {
  16933. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  16934. }).join(""))));
  16935. } catch (e3) {
  16936. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  16937. }
  16938. var s2;
  16939. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  16940. }
  16941. Os = "function" != typeof atob ? function(e2) {
  16942. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !Ls.test(e2))
  16943. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  16944. var t2;
  16945. e2 += "==".slice(2 - (3 & e2.length));
  16946. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  16947. t2 = Es.indexOf(e2.charAt(i2++)) << 18 | Es.indexOf(e2.charAt(i2++)) << 12 | (n2 = Es.indexOf(e2.charAt(i2++))) << 6 | (s2 = Es.indexOf(e2.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2);
  16948. return r2;
  16949. } : atob;
  16950. var Us = n(function(e2, t2) {
  16951. Object.defineProperty(t2, "__esModule", { value: true });
  16952. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  16953. function r2(e3, t3) {
  16954. return e3.tempFiles.forEach((e4, n3) => {
  16955. e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf("."));
  16956. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  16957. }
  16958. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  16959. return t3.then((e4) => {
  16960. if (s3) {
  16961. const t4 = s3(e4);
  16962. if (void 0 !== t4)
  16963. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  16964. }
  16965. return e4;
  16966. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  16967. (t5 = Object.assign({}, t5)).errMsg = n2;
  16968. const i3 = t5.tempFiles, o2 = i3.length;
  16969. let a2 = 0;
  16970. return new Promise((n3) => {
  16971. for (; a2 < s4; )
  16972. c2();
  16973. function c2() {
  16974. const s5 = a2++;
  16975. if (s5 >= o2)
  16976. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  16977. const u2 = i3[s5];
  16978. e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
  16979. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  16980. } }).then((e5) => {
  16981. u2.url = e5.fileID, s5 < o2 && c2();
  16982. }).catch((e5) => {
  16983. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  16984. });
  16985. }
  16986. });
  16987. }(e3, t4, 5, r3));
  16988. }
  16989. t2.initChooseAndUploadFile = function(e3) {
  16990. return function(t3 = { type: "all" }) {
  16991. return "image" === t3.type ? i2(e3, function(e4) {
  16992. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  16993. return new Promise((e5, a2) => {
  16994. uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  16995. e5(r2(t5, "image"));
  16996. }, fail(e6) {
  16997. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  16998. } });
  16999. });
  17000. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  17001. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  17002. return new Promise((e5, c2) => {
  17003. uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  17004. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  17005. e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video"));
  17006. }, fail(e6) {
  17007. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  17008. } });
  17009. });
  17010. }(t3), t3) : i2(e3, function(e4) {
  17011. const { count: t4, extension: n3 } = e4;
  17012. return new Promise((e5, i3) => {
  17013. let o2 = uni.chooseFile;
  17014. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2)
  17015. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  17016. o2({ type: "all", count: t4, extension: n3, success(t5) {
  17017. e5(r2(t5));
  17018. }, fail(e6) {
  17019. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  17020. } });
  17021. });
  17022. }(t3), t3);
  17023. };
  17024. };
  17025. }), Ns = t$2(Us);
  17026. const Ds = "manual";
  17027. function Ms(e2) {
  17028. return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {}, mixinDatacomError: null }), created() {
  17029. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  17030. var e3 = [];
  17031. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  17032. e3.push(this[t2]);
  17033. }), e3;
  17034. }, (e3, t2) => {
  17035. if (this.loadtime === Ds)
  17036. return;
  17037. let n2 = false;
  17038. const s2 = [];
  17039. for (let r2 = 2; r2 < e3.length; r2++)
  17040. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  17041. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  17042. });
  17043. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  17044. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  17045. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
  17046. this.mixinDatacomLoading = false;
  17047. const { data: s2, count: r2 } = n3.result;
  17048. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  17049. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  17050. this.mixinDatacomResData = i2, t2 && t2(i2);
  17051. }).catch((e4) => {
  17052. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
  17053. }));
  17054. }, mixinDatacomGet(t2 = {}) {
  17055. let n2;
  17056. t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
  17057. const s2 = t2.action || this.action;
  17058. s2 && (n2 = n2.action(s2));
  17059. const r2 = t2.collection || this.collection;
  17060. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  17061. const i2 = t2.where || this.where;
  17062. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  17063. const o2 = t2.field || this.field;
  17064. o2 && (n2 = n2.field(o2));
  17065. const a2 = t2.foreignKey || this.foreignKey;
  17066. a2 && (n2 = n2.foreignKey(a2));
  17067. const c2 = t2.groupby || this.groupby;
  17068. c2 && (n2 = n2.groupBy(c2));
  17069. const u2 = t2.groupField || this.groupField;
  17070. u2 && (n2 = n2.groupField(u2));
  17071. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  17072. const l2 = t2.orderby || this.orderby;
  17073. l2 && (n2 = n2.orderBy(l2));
  17074. const h2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith };
  17075. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (h2 - 1)).limit(d2).get(m2), n2;
  17076. } } };
  17077. }
  17078. function qs(e2) {
  17079. return function(t2, n2 = {}) {
  17080. n2 = function(e3, t3 = {}) {
  17081. return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3;
  17082. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  17083. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  17084. return new Proxy({}, { get(s3, c2) {
  17085. switch (c2) {
  17086. case "toString":
  17087. return "[object UniCloudObject]";
  17088. case "toJSON":
  17089. return {};
  17090. }
  17091. return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  17092. return async function(...s4) {
  17093. const r3 = n3 ? n3({ params: s4 }) : {};
  17094. let i3, o3;
  17095. try {
  17096. return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
  17097. } catch (e4) {
  17098. throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
  17099. } finally {
  17100. await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  17101. }
  17102. };
  17103. }({ fn: async function s4(...l2) {
  17104. let h2;
  17105. a2 && uni.showLoading({ title: r2.title, mask: r2.mask });
  17106. const d2 = { name: t2, type: u, data: { method: c2, params: l2 } };
  17107. "object" == typeof n2.secretMethods && function(e3, t3) {
  17108. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  17109. r3 && (t3.secretType = r3);
  17110. }(n2, d2);
  17111. let p2 = false;
  17112. try {
  17113. h2 = await e2.callFunction(d2);
  17114. } catch (e3) {
  17115. p2 = true, h2 = { result: new te(e3) };
  17116. }
  17117. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = h2.result || {};
  17118. if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(B, { ...y2 })), g2) {
  17119. let e3 = m2;
  17120. if (p2 && o2) {
  17121. e3 = (await o2({ objectName: t2, methodName: c2, params: l2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  17122. }
  17123. if (a2)
  17124. if ("toast" === i2.type)
  17125. uni.showToast({ title: e3, icon: "none" });
  17126. else {
  17127. if ("modal" !== i2.type)
  17128. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  17129. {
  17130. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  17131. return new Promise((i3, o3) => {
  17132. uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  17133. i3(e5);
  17134. }, fail() {
  17135. i3({ confirm: false, cancel: true });
  17136. } });
  17137. });
  17138. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  17139. if (i2.retry && t3)
  17140. return s4(...l2);
  17141. }
  17142. }
  17143. const n3 = new te({ subject: f2, code: g2, message: m2, requestId: h2.requestId });
  17144. throw n3.detail = h2.result, Y(j, { type: J, content: n3 }), n3;
  17145. }
  17146. return Y(j, { type: J, content: h2.result }), h2.result;
  17147. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  17148. return { objectName: t2, methodName: c2, params: e3 };
  17149. } });
  17150. } });
  17151. };
  17152. }
  17153. function Fs(e2) {
  17154. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
  17155. }
  17156. async function Ks({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  17157. Fs(this);
  17158. throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${C}\``);
  17159. }
  17160. async function js(e2) {
  17161. const t2 = Fs(this);
  17162. return t2.initPromise || (t2.initPromise = Ks.call(this, e2).then((e3) => e3).catch((e3) => {
  17163. throw delete t2.initPromise, e3;
  17164. })), t2.initPromise;
  17165. }
  17166. function $s(e2) {
  17167. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  17168. return js.call(e2, { openid: t2, callLoginByWeixin: n2 });
  17169. };
  17170. }
  17171. function Bs(e2) {
  17172. !function(e3) {
  17173. le = e3;
  17174. }(e2);
  17175. }
  17176. function Ws(e2) {
  17177. const t2 = { getSystemInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId };
  17178. return function(n2) {
  17179. return new Promise((s2, r2) => {
  17180. t2[e2]({ ...n2, success(e3) {
  17181. s2(e3);
  17182. }, fail(e3) {
  17183. r2(e3);
  17184. } });
  17185. });
  17186. };
  17187. }
  17188. class Hs extends class {
  17189. constructor() {
  17190. this._callback = {};
  17191. }
  17192. addListener(e2, t2) {
  17193. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  17194. }
  17195. on(e2, t2) {
  17196. return this.addListener(e2, t2);
  17197. }
  17198. removeListener(e2, t2) {
  17199. if (!t2)
  17200. throw new Error('The "listener" argument must be of type function. Received undefined');
  17201. const n2 = this._callback[e2];
  17202. if (!n2)
  17203. return;
  17204. const s2 = function(e3, t3) {
  17205. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  17206. if (e3[n3] === t3)
  17207. return n3;
  17208. return -1;
  17209. }(n2, t2);
  17210. n2.splice(s2, 1);
  17211. }
  17212. off(e2, t2) {
  17213. return this.removeListener(e2, t2);
  17214. }
  17215. removeAllListener(e2) {
  17216. delete this._callback[e2];
  17217. }
  17218. emit(e2, ...t2) {
  17219. const n2 = this._callback[e2];
  17220. if (n2)
  17221. for (let e3 = 0; e3 < n2.length; e3++)
  17222. n2[e3](...t2);
  17223. }
  17224. } {
  17225. constructor() {
  17226. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  17227. }
  17228. init() {
  17229. return Promise.all([Ws("getSystemInfo")(), Ws("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  17230. if (!e2)
  17231. throw new Error("Invalid appId, please check the manifest.json file");
  17232. if (!t2)
  17233. throw new Error("Invalid push client id");
  17234. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  17235. }, (e2) => {
  17236. throw this.emit("error", e2), this.close(), e2;
  17237. });
  17238. }
  17239. async open() {
  17240. return this.init();
  17241. }
  17242. _isUniCloudSSE(e2) {
  17243. if ("receive" !== e2.type)
  17244. return false;
  17245. const t2 = e2 && e2.data && e2.data.payload;
  17246. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  17247. }
  17248. _receivePushMessage(e2) {
  17249. if (!this._isUniCloudSSE(e2))
  17250. return;
  17251. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  17252. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  17253. }
  17254. _consumMessage() {
  17255. for (; ; ) {
  17256. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  17257. if (!e2)
  17258. break;
  17259. this._currentMessageId++, this._parseMessagePayload(e2);
  17260. }
  17261. }
  17262. _parseMessagePayload(e2) {
  17263. const { action: t2, messageId: n2, message: s2 } = e2;
  17264. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  17265. }
  17266. _appendMessage({ messageId: e2, message: t2 } = {}) {
  17267. this.emit("message", t2);
  17268. }
  17269. _end({ messageId: e2, message: t2 } = {}) {
  17270. this.emit("end", t2), this.close();
  17271. }
  17272. _initMessageListener() {
  17273. uni.onPushMessage(this._uniPushMessageCallback);
  17274. }
  17275. _destroy() {
  17276. uni.offPushMessage(this._uniPushMessageCallback);
  17277. }
  17278. toJSON() {
  17279. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  17280. }
  17281. close() {
  17282. this._destroy(), this.emit("close");
  17283. }
  17284. }
  17285. async function Js(e2) {
  17286. {
  17287. const { osName: e3, osVersion: t3 } = ce();
  17288. "ios" === e3 && function(e4) {
  17289. if (!e4 || "string" != typeof e4)
  17290. return 0;
  17291. const t4 = e4.match(/^(\d+)./);
  17292. return t4 && t4[1] ? parseInt(t4[1]) : 0;
  17293. }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  17294. }
  17295. const t2 = e2.__dev__;
  17296. if (!t2.debugInfo)
  17297. return;
  17298. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await At(n2, s2);
  17299. if (r2)
  17300. return t2.localAddress = r2, void (t2.localPort = s2);
  17301. const i2 = console["error"];
  17302. let o2 = "";
  17303. if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === C.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
  17304. throw new Error(o2);
  17305. i2(o2);
  17306. }
  17307. function zs(e2) {
  17308. e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() {
  17309. let t2 = Promise.resolve();
  17310. var n2;
  17311. n2 = 1, t2 = new Promise((e3) => {
  17312. setTimeout(() => {
  17313. e3();
  17314. }, n2);
  17315. });
  17316. const s2 = e2.auth();
  17317. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  17318. } }));
  17319. }
  17320. const Vs = { tcb: bt, tencent: bt, aliyun: fe, private: Tt, dcloud: Tt, alipay: qt };
  17321. let Gs = new class {
  17322. init(e2) {
  17323. let t2 = {};
  17324. const n2 = Vs[e2.provider];
  17325. if (!n2)
  17326. throw new Error("未提供正确的provider参数");
  17327. t2 = n2.init(e2), function(e3) {
  17328. const t3 = {};
  17329. e3.__dev__ = t3, t3.debugLog = "app" === C;
  17330. const n3 = P;
  17331. n3 && !n3.code && (t3.debugInfo = n3);
  17332. const s2 = new v({ createPromise: function() {
  17333. return Js(e3);
  17334. } });
  17335. t3.initLocalNetwork = function() {
  17336. return s2.exec();
  17337. };
  17338. }(t2), zs(t2), Jn(t2), function(e3) {
  17339. const t3 = e3.uploadFile;
  17340. e3.uploadFile = function(e4) {
  17341. return t3.call(this, e4);
  17342. };
  17343. }(t2), function(e3) {
  17344. e3.database = function(t3) {
  17345. if (t3 && Object.keys(t3).length > 0)
  17346. return e3.init(t3).database();
  17347. if (this._database)
  17348. return this._database;
  17349. const n3 = ss(rs, { uniClient: e3 });
  17350. return this._database = n3, n3;
  17351. }, e3.databaseForJQL = function(t3) {
  17352. if (t3 && Object.keys(t3).length > 0)
  17353. return e3.init(t3).databaseForJQL();
  17354. if (this._databaseForJQL)
  17355. return this._databaseForJQL;
  17356. const n3 = ss(rs, { uniClient: e3, isJQL: true });
  17357. return this._databaseForJQL = n3, n3;
  17358. };
  17359. }(t2), function(e3) {
  17360. e3.getCurrentUserInfo = Rs, e3.chooseAndUploadFile = Ns.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  17361. return Ms(e3);
  17362. } }), e3.SSEChannel = Hs, e3.initSecureNetworkByWeixin = $s(e3), e3.setCustomClientInfo = Bs, e3.importObject = qs(e3);
  17363. }(t2);
  17364. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  17365. if (!t2[e3])
  17366. return;
  17367. const n3 = t2[e3];
  17368. t2[e3] = function() {
  17369. return n3.apply(t2, Array.from(arguments));
  17370. }, t2[e3] = (/* @__PURE__ */ function(e4, t3) {
  17371. return function(n4) {
  17372. let s2 = false;
  17373. if ("callFunction" === t3) {
  17374. const e5 = n4 && n4.type || c;
  17375. s2 = e5 !== c;
  17376. }
  17377. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  17378. n4 = n4 || {};
  17379. const { success: o2, fail: a2, complete: u2 } = ee(n4), l2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Y(j, { type: H, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Y(j, { type: H, content: e5 }), Promise.reject(e5))));
  17380. if (!(o2 || a2 || u2))
  17381. return l2;
  17382. l2.then((e5) => {
  17383. o2 && o2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  17384. }, (e5) => {
  17385. a2 && a2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  17386. });
  17387. };
  17388. }(t2[e3], e3)).bind(t2);
  17389. }), t2.init = this.init, t2;
  17390. }
  17391. }();
  17392. (() => {
  17393. const e2 = T;
  17394. let t2 = {};
  17395. if (e2 && 1 === e2.length)
  17396. t2 = e2[0], Gs = Gs.init(t2), Gs._isDefault = true;
  17397. else {
  17398. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  17399. let n2;
  17400. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
  17401. Gs[e3] = function() {
  17402. return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
  17403. };
  17404. });
  17405. }
  17406. Object.assign(Gs, { get mixinDatacom() {
  17407. return Ms(Gs);
  17408. } }), xs(Gs), Gs.addInterceptor = N, Gs.removeInterceptor = D, Gs.interceptObject = F;
  17409. })();
  17410. var Ys = Gs;
  17411. const _sfc_main$u = {
  17412. name: "uni-data-select",
  17413. mixins: [Ys.mixinDatacom || {}],
  17414. props: {
  17415. localdata: {
  17416. type: Array,
  17417. default() {
  17418. return [];
  17419. }
  17420. },
  17421. value: {
  17422. type: [String, Number],
  17423. default: ""
  17424. },
  17425. modelValue: {
  17426. type: [String, Number],
  17427. default: ""
  17428. },
  17429. label: {
  17430. type: String,
  17431. default: ""
  17432. },
  17433. placeholder: {
  17434. type: String,
  17435. default: "请选择"
  17436. },
  17437. emptyTips: {
  17438. type: String,
  17439. default: "无选项"
  17440. },
  17441. clear: {
  17442. type: Boolean,
  17443. default: true
  17444. },
  17445. defItem: {
  17446. type: Number,
  17447. default: 0
  17448. },
  17449. disabled: {
  17450. type: Boolean,
  17451. default: false
  17452. },
  17453. // 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
  17454. format: {
  17455. type: String,
  17456. default: ""
  17457. },
  17458. placement: {
  17459. type: String,
  17460. default: "bottom"
  17461. }
  17462. },
  17463. data() {
  17464. return {
  17465. showSelector: false,
  17466. current: "",
  17467. mixinDatacomResData: [],
  17468. apps: [],
  17469. channels: [],
  17470. cacheKey: "uni-data-select-lastSelectedValue"
  17471. };
  17472. },
  17473. created() {
  17474. this.debounceGet = this.debounce(() => {
  17475. this.query();
  17476. }, 300);
  17477. if (this.collection && !this.localdata.length) {
  17478. this.debounceGet();
  17479. }
  17480. },
  17481. computed: {
  17482. typePlaceholder() {
  17483. const text = {
  17484. "opendb-stat-app-versions": "版本",
  17485. "opendb-app-channels": "渠道",
  17486. "opendb-app-list": "应用"
  17487. };
  17488. const common = this.placeholder;
  17489. const placeholder = text[this.collection];
  17490. return placeholder ? common + placeholder : common;
  17491. },
  17492. valueCom() {
  17493. return this.modelValue;
  17494. },
  17495. textShow() {
  17496. let text = this.current;
  17497. if (text.length > 10) {
  17498. return text.slice(0, 25) + "...";
  17499. }
  17500. return text;
  17501. },
  17502. getOffsetByPlacement() {
  17503. switch (this.placement) {
  17504. case "top":
  17505. return "bottom:calc(100% + 12px);";
  17506. case "bottom":
  17507. return "top:calc(100% + 12px);";
  17508. }
  17509. }
  17510. },
  17511. watch: {
  17512. localdata: {
  17513. immediate: true,
  17514. handler(val, old) {
  17515. if (Array.isArray(val) && old !== val) {
  17516. this.mixinDatacomResData = val;
  17517. }
  17518. }
  17519. },
  17520. valueCom(val, old) {
  17521. this.initDefVal();
  17522. },
  17523. mixinDatacomResData: {
  17524. immediate: true,
  17525. handler(val) {
  17526. if (val.length) {
  17527. this.initDefVal();
  17528. }
  17529. }
  17530. }
  17531. },
  17532. methods: {
  17533. debounce(fn, time = 100) {
  17534. let timer = null;
  17535. return function(...args) {
  17536. if (timer)
  17537. clearTimeout(timer);
  17538. timer = setTimeout(() => {
  17539. fn.apply(this, args);
  17540. }, time);
  17541. };
  17542. },
  17543. // 执行数据库查询
  17544. query() {
  17545. this.mixinDatacomEasyGet();
  17546. },
  17547. // 监听查询条件变更事件
  17548. onMixinDatacomPropsChange() {
  17549. if (this.collection) {
  17550. this.debounceGet();
  17551. }
  17552. },
  17553. initDefVal() {
  17554. let defValue = "";
  17555. if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
  17556. defValue = this.valueCom;
  17557. } else {
  17558. let strogeValue;
  17559. if (this.collection) {
  17560. strogeValue = this.getCache();
  17561. }
  17562. if (strogeValue || strogeValue === 0) {
  17563. defValue = strogeValue;
  17564. } else {
  17565. let defItem = "";
  17566. if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
  17567. defItem = this.mixinDatacomResData[this.defItem - 1].value;
  17568. }
  17569. defValue = defItem;
  17570. }
  17571. if (defValue || defValue === 0) {
  17572. this.emit(defValue);
  17573. }
  17574. }
  17575. const def = this.mixinDatacomResData.find((item) => item.value === defValue);
  17576. this.current = def ? this.formatItemName(def) : "";
  17577. },
  17578. /**
  17579. * @param {[String, Number]} value
  17580. * 判断用户给的 value 是否同时为禁用状态
  17581. */
  17582. isDisabled(value) {
  17583. let isDisabled = false;
  17584. this.mixinDatacomResData.forEach((item) => {
  17585. if (item.value === value) {
  17586. isDisabled = item.disable;
  17587. }
  17588. });
  17589. return isDisabled;
  17590. },
  17591. clearVal() {
  17592. this.emit("");
  17593. if (this.collection) {
  17594. this.removeCache();
  17595. }
  17596. },
  17597. change(item) {
  17598. if (!item.disable) {
  17599. this.showSelector = false;
  17600. this.current = this.formatItemName(item);
  17601. this.emit(item.value);
  17602. }
  17603. },
  17604. emit(val) {
  17605. this.$emit("input", val);
  17606. this.$emit("update:modelValue", val);
  17607. this.$emit("change", val);
  17608. if (this.collection) {
  17609. this.setCache(val);
  17610. }
  17611. },
  17612. toggleSelector() {
  17613. if (this.disabled) {
  17614. return;
  17615. }
  17616. this.showSelector = !this.showSelector;
  17617. },
  17618. formatItemName(item) {
  17619. let {
  17620. text,
  17621. value,
  17622. channel_code
  17623. } = item;
  17624. channel_code = channel_code ? `(${channel_code})` : "";
  17625. if (this.format) {
  17626. let str = "";
  17627. str = this.format;
  17628. for (let key in item) {
  17629. str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
  17630. }
  17631. return str;
  17632. } else {
  17633. return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
  17634. }
  17635. },
  17636. // 获取当前加载的数据
  17637. getLoadData() {
  17638. return this.mixinDatacomResData;
  17639. },
  17640. // 获取当前缓存key
  17641. getCurrentCacheKey() {
  17642. return this.collection;
  17643. },
  17644. // 获取缓存
  17645. getCache(name = this.getCurrentCacheKey()) {
  17646. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  17647. return cacheData[name];
  17648. },
  17649. // 设置缓存
  17650. setCache(value, name = this.getCurrentCacheKey()) {
  17651. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  17652. cacheData[name] = value;
  17653. uni.setStorageSync(this.cacheKey, cacheData);
  17654. },
  17655. // 删除缓存
  17656. removeCache(name = this.getCurrentCacheKey()) {
  17657. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  17658. delete cacheData[name];
  17659. uni.setStorageSync(this.cacheKey, cacheData);
  17660. }
  17661. }
  17662. };
  17663. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  17664. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  17665. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-stat__select" }, [
  17666. $props.label ? (vue.openBlock(), vue.createElementBlock(
  17667. "span",
  17668. {
  17669. key: 0,
  17670. class: "uni-label-text hide-on-phone"
  17671. },
  17672. vue.toDisplayString($props.label + ":"),
  17673. 1
  17674. /* TEXT */
  17675. )) : vue.createCommentVNode("v-if", true),
  17676. vue.createElementVNode(
  17677. "view",
  17678. {
  17679. class: vue.normalizeClass(["uni-stat-box", { "uni-stat__actived": $data.current }])
  17680. },
  17681. [
  17682. vue.createElementVNode(
  17683. "view",
  17684. {
  17685. class: vue.normalizeClass(["uni-select", { "uni-select--disabled": $props.disabled }])
  17686. },
  17687. [
  17688. vue.createElementVNode("view", {
  17689. class: "uni-select__input-box",
  17690. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  17691. }, [
  17692. $data.current ? (vue.openBlock(), vue.createElementBlock(
  17693. "view",
  17694. {
  17695. key: 0,
  17696. class: "uni-select__input-text"
  17697. },
  17698. vue.toDisplayString($options.textShow),
  17699. 1
  17700. /* TEXT */
  17701. )) : (vue.openBlock(), vue.createElementBlock(
  17702. "view",
  17703. {
  17704. key: 1,
  17705. class: "uni-select__input-text uni-select__input-placeholder"
  17706. },
  17707. vue.toDisplayString($options.typePlaceholder),
  17708. 1
  17709. /* TEXT */
  17710. )),
  17711. $data.current && $props.clear && !$props.disabled ? (vue.openBlock(), vue.createElementBlock("view", {
  17712. key: 2,
  17713. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clearVal && $options.clearVal(...args), ["stop"]))
  17714. }, [
  17715. vue.createVNode(_component_uni_icons, {
  17716. type: "clear",
  17717. color: "#c0c4cc",
  17718. size: "24"
  17719. })
  17720. ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 3 }, [
  17721. vue.createVNode(_component_uni_icons, {
  17722. type: $data.showSelector ? "top" : "bottom",
  17723. size: "14",
  17724. color: "#999"
  17725. }, null, 8, ["type"])
  17726. ]))
  17727. ]),
  17728. $data.showSelector ? (vue.openBlock(), vue.createElementBlock("view", {
  17729. key: 0,
  17730. class: "uni-select--mask",
  17731. onClick: _cache[2] || (_cache[2] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  17732. })) : vue.createCommentVNode("v-if", true),
  17733. $data.showSelector ? (vue.openBlock(), vue.createElementBlock(
  17734. "view",
  17735. {
  17736. key: 1,
  17737. class: "uni-select__selector",
  17738. style: vue.normalizeStyle($options.getOffsetByPlacement)
  17739. },
  17740. [
  17741. vue.createElementVNode(
  17742. "view",
  17743. {
  17744. class: vue.normalizeClass($props.placement == "bottom" ? "uni-popper__arrow_bottom" : "uni-popper__arrow_top")
  17745. },
  17746. null,
  17747. 2
  17748. /* CLASS */
  17749. ),
  17750. vue.createElementVNode("scroll-view", {
  17751. "scroll-y": "true",
  17752. class: "uni-select__selector-scroll"
  17753. }, [
  17754. $data.mixinDatacomResData.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  17755. key: 0,
  17756. class: "uni-select__selector-empty"
  17757. }, [
  17758. vue.createElementVNode(
  17759. "text",
  17760. null,
  17761. vue.toDisplayString($props.emptyTips),
  17762. 1
  17763. /* TEXT */
  17764. )
  17765. ])) : (vue.openBlock(true), vue.createElementBlock(
  17766. vue.Fragment,
  17767. { key: 1 },
  17768. vue.renderList($data.mixinDatacomResData, (item, index) => {
  17769. return vue.openBlock(), vue.createElementBlock("view", {
  17770. class: "uni-select__selector-item",
  17771. key: index,
  17772. onClick: ($event) => $options.change(item)
  17773. }, [
  17774. vue.createElementVNode(
  17775. "text",
  17776. {
  17777. class: vue.normalizeClass({ "uni-select__selector__disabled": item.disable })
  17778. },
  17779. vue.toDisplayString($options.formatItemName(item)),
  17780. 3
  17781. /* TEXT, CLASS */
  17782. )
  17783. ], 8, ["onClick"]);
  17784. }),
  17785. 128
  17786. /* KEYED_FRAGMENT */
  17787. ))
  17788. ])
  17789. ],
  17790. 4
  17791. /* STYLE */
  17792. )) : vue.createCommentVNode("v-if", true)
  17793. ],
  17794. 2
  17795. /* CLASS */
  17796. )
  17797. ],
  17798. 2
  17799. /* CLASS */
  17800. )
  17801. ]);
  17802. }
  17803. const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-ddf9e0a2"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue"]]);
  17804. const isObject = (val) => val !== null && typeof val === "object";
  17805. const defaultDelimiters = ["{", "}"];
  17806. class BaseFormatter {
  17807. constructor() {
  17808. this._caches = /* @__PURE__ */ Object.create(null);
  17809. }
  17810. interpolate(message, values, delimiters = defaultDelimiters) {
  17811. if (!values) {
  17812. return [message];
  17813. }
  17814. let tokens = this._caches[message];
  17815. if (!tokens) {
  17816. tokens = parse(message, delimiters);
  17817. this._caches[message] = tokens;
  17818. }
  17819. return compile(tokens, values);
  17820. }
  17821. }
  17822. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  17823. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  17824. function parse(format, [startDelimiter, endDelimiter]) {
  17825. const tokens = [];
  17826. let position = 0;
  17827. let text = "";
  17828. while (position < format.length) {
  17829. let char = format[position++];
  17830. if (char === startDelimiter) {
  17831. if (text) {
  17832. tokens.push({ type: "text", value: text });
  17833. }
  17834. text = "";
  17835. let sub = "";
  17836. char = format[position++];
  17837. while (char !== void 0 && char !== endDelimiter) {
  17838. sub += char;
  17839. char = format[position++];
  17840. }
  17841. const isClosed = char === endDelimiter;
  17842. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  17843. tokens.push({ value: sub, type });
  17844. } else {
  17845. text += char;
  17846. }
  17847. }
  17848. text && tokens.push({ type: "text", value: text });
  17849. return tokens;
  17850. }
  17851. function compile(tokens, values) {
  17852. const compiled = [];
  17853. let index = 0;
  17854. const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  17855. if (mode === "unknown") {
  17856. return compiled;
  17857. }
  17858. while (index < tokens.length) {
  17859. const token = tokens[index];
  17860. switch (token.type) {
  17861. case "text":
  17862. compiled.push(token.value);
  17863. break;
  17864. case "list":
  17865. compiled.push(values[parseInt(token.value, 10)]);
  17866. break;
  17867. case "named":
  17868. if (mode === "named") {
  17869. compiled.push(values[token.value]);
  17870. } else {
  17871. {
  17872. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  17873. }
  17874. }
  17875. break;
  17876. case "unknown":
  17877. {
  17878. console.warn(`Detect 'unknown' type of token!`);
  17879. }
  17880. break;
  17881. }
  17882. index++;
  17883. }
  17884. return compiled;
  17885. }
  17886. const LOCALE_ZH_HANS = "zh-Hans";
  17887. const LOCALE_ZH_HANT = "zh-Hant";
  17888. const LOCALE_EN = "en";
  17889. const LOCALE_FR = "fr";
  17890. const LOCALE_ES = "es";
  17891. const hasOwnProperty = Object.prototype.hasOwnProperty;
  17892. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  17893. const defaultFormatter = new BaseFormatter();
  17894. function include(str, parts) {
  17895. return !!parts.find((part) => str.indexOf(part) !== -1);
  17896. }
  17897. function startsWith(str, parts) {
  17898. return parts.find((part) => str.indexOf(part) === 0);
  17899. }
  17900. function normalizeLocale(locale, messages2) {
  17901. if (!locale) {
  17902. return;
  17903. }
  17904. locale = locale.trim().replace(/_/g, "-");
  17905. if (messages2 && messages2[locale]) {
  17906. return locale;
  17907. }
  17908. locale = locale.toLowerCase();
  17909. if (locale === "chinese") {
  17910. return LOCALE_ZH_HANS;
  17911. }
  17912. if (locale.indexOf("zh") === 0) {
  17913. if (locale.indexOf("-hans") > -1) {
  17914. return LOCALE_ZH_HANS;
  17915. }
  17916. if (locale.indexOf("-hant") > -1) {
  17917. return LOCALE_ZH_HANT;
  17918. }
  17919. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  17920. return LOCALE_ZH_HANT;
  17921. }
  17922. return LOCALE_ZH_HANS;
  17923. }
  17924. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  17925. if (messages2 && Object.keys(messages2).length > 0) {
  17926. locales = Object.keys(messages2);
  17927. }
  17928. const lang = startsWith(locale, locales);
  17929. if (lang) {
  17930. return lang;
  17931. }
  17932. }
  17933. class I18n {
  17934. constructor({ locale, fallbackLocale, messages: messages2, watcher, formater: formater2 }) {
  17935. this.locale = LOCALE_EN;
  17936. this.fallbackLocale = LOCALE_EN;
  17937. this.message = {};
  17938. this.messages = {};
  17939. this.watchers = [];
  17940. if (fallbackLocale) {
  17941. this.fallbackLocale = fallbackLocale;
  17942. }
  17943. this.formater = formater2 || defaultFormatter;
  17944. this.messages = messages2 || {};
  17945. this.setLocale(locale || LOCALE_EN);
  17946. if (watcher) {
  17947. this.watchLocale(watcher);
  17948. }
  17949. }
  17950. setLocale(locale) {
  17951. const oldLocale = this.locale;
  17952. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  17953. if (!this.messages[this.locale]) {
  17954. this.messages[this.locale] = {};
  17955. }
  17956. this.message = this.messages[this.locale];
  17957. if (oldLocale !== this.locale) {
  17958. this.watchers.forEach((watcher) => {
  17959. watcher(this.locale, oldLocale);
  17960. });
  17961. }
  17962. }
  17963. getLocale() {
  17964. return this.locale;
  17965. }
  17966. watchLocale(fn) {
  17967. const index = this.watchers.push(fn) - 1;
  17968. return () => {
  17969. this.watchers.splice(index, 1);
  17970. };
  17971. }
  17972. add(locale, message, override = true) {
  17973. const curMessages = this.messages[locale];
  17974. if (curMessages) {
  17975. if (override) {
  17976. Object.assign(curMessages, message);
  17977. } else {
  17978. Object.keys(message).forEach((key) => {
  17979. if (!hasOwn(curMessages, key)) {
  17980. curMessages[key] = message[key];
  17981. }
  17982. });
  17983. }
  17984. } else {
  17985. this.messages[locale] = message;
  17986. }
  17987. }
  17988. f(message, values, delimiters) {
  17989. return this.formater.interpolate(message, values, delimiters).join("");
  17990. }
  17991. t(key, locale, values) {
  17992. let message = this.message;
  17993. if (typeof locale === "string") {
  17994. locale = normalizeLocale(locale, this.messages);
  17995. locale && (message = this.messages[locale]);
  17996. } else {
  17997. values = locale;
  17998. }
  17999. if (!hasOwn(message, key)) {
  18000. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  18001. return key;
  18002. }
  18003. return this.formater.interpolate(message[key], values).join("");
  18004. }
  18005. }
  18006. function watchAppLocale(appVm, i18n) {
  18007. if (appVm.$watchLocale) {
  18008. appVm.$watchLocale((newLocale) => {
  18009. i18n.setLocale(newLocale);
  18010. });
  18011. } else {
  18012. appVm.$watch(() => appVm.$locale, (newLocale) => {
  18013. i18n.setLocale(newLocale);
  18014. });
  18015. }
  18016. }
  18017. function getDefaultLocale() {
  18018. if (typeof uni !== "undefined" && uni.getLocale) {
  18019. return uni.getLocale();
  18020. }
  18021. if (typeof global !== "undefined" && global.getLocale) {
  18022. return global.getLocale();
  18023. }
  18024. return LOCALE_EN;
  18025. }
  18026. function initVueI18n(locale, messages2 = {}, fallbackLocale, watcher) {
  18027. if (typeof locale !== "string") {
  18028. const options = [
  18029. messages2,
  18030. locale
  18031. ];
  18032. locale = options[0];
  18033. messages2 = options[1];
  18034. }
  18035. if (typeof locale !== "string") {
  18036. locale = getDefaultLocale();
  18037. }
  18038. if (typeof fallbackLocale !== "string") {
  18039. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  18040. }
  18041. const i18n = new I18n({
  18042. locale,
  18043. fallbackLocale,
  18044. messages: messages2,
  18045. watcher
  18046. });
  18047. let t2 = (key, values) => {
  18048. if (typeof getApp !== "function") {
  18049. t2 = function(key2, values2) {
  18050. return i18n.t(key2, values2);
  18051. };
  18052. } else {
  18053. let isWatchedAppLocale = false;
  18054. t2 = function(key2, values2) {
  18055. const appVm = getApp().$vm;
  18056. if (appVm) {
  18057. appVm.$locale;
  18058. if (!isWatchedAppLocale) {
  18059. isWatchedAppLocale = true;
  18060. watchAppLocale(appVm, i18n);
  18061. }
  18062. }
  18063. return i18n.t(key2, values2);
  18064. };
  18065. }
  18066. return t2(key, values);
  18067. };
  18068. return {
  18069. i18n,
  18070. f(message, values, delimiters) {
  18071. return i18n.f(message, values, delimiters);
  18072. },
  18073. t(key, values) {
  18074. return t2(key, values);
  18075. },
  18076. add(locale2, message, override = true) {
  18077. return i18n.add(locale2, message, override);
  18078. },
  18079. watch(fn) {
  18080. return i18n.watchLocale(fn);
  18081. },
  18082. getLocale() {
  18083. return i18n.getLocale();
  18084. },
  18085. setLocale(newLocale) {
  18086. return i18n.setLocale(newLocale);
  18087. }
  18088. };
  18089. }
  18090. const en$1 = {
  18091. "uni-load-more.contentdown": "Pull up to show more",
  18092. "uni-load-more.contentrefresh": "loading...",
  18093. "uni-load-more.contentnomore": "No more data"
  18094. };
  18095. const zhHans$1 = {
  18096. "uni-load-more.contentdown": "上拉显示更多",
  18097. "uni-load-more.contentrefresh": "正在加载...",
  18098. "uni-load-more.contentnomore": "没有更多数据了"
  18099. };
  18100. const zhHant$1 = {
  18101. "uni-load-more.contentdown": "上拉顯示更多",
  18102. "uni-load-more.contentrefresh": "正在加載...",
  18103. "uni-load-more.contentnomore": "沒有更多數據了"
  18104. };
  18105. const messages$1 = {
  18106. en: en$1,
  18107. "zh-Hans": zhHans$1,
  18108. "zh-Hant": zhHant$1
  18109. };
  18110. let platform;
  18111. setTimeout(() => {
  18112. platform = uni.getSystemInfoSync().platform;
  18113. }, 16);
  18114. const {
  18115. t: t$1
  18116. } = initVueI18n(messages$1);
  18117. const _sfc_main$t = {
  18118. name: "UniLoadMore",
  18119. emits: ["clickLoadMore"],
  18120. props: {
  18121. status: {
  18122. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  18123. type: String,
  18124. default: "more"
  18125. },
  18126. showIcon: {
  18127. type: Boolean,
  18128. default: true
  18129. },
  18130. iconType: {
  18131. type: String,
  18132. default: "auto"
  18133. },
  18134. iconSize: {
  18135. type: Number,
  18136. default: 24
  18137. },
  18138. color: {
  18139. type: String,
  18140. default: "#777777"
  18141. },
  18142. contentText: {
  18143. type: Object,
  18144. default() {
  18145. return {
  18146. contentdown: "",
  18147. contentrefresh: "",
  18148. contentnomore: ""
  18149. };
  18150. }
  18151. },
  18152. showText: {
  18153. type: Boolean,
  18154. default: true
  18155. }
  18156. },
  18157. data() {
  18158. return {
  18159. webviewHide: false,
  18160. platform,
  18161. imgBase64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZVHb98LM+F5bHL8khA1iSeiyQBCRM+YGqKUnnJTDLGI0BGZlKDIU2MMglUiDApEZvSsZnQtBRJtKwQNKQMFYeRDR10WOLd8ljYXdh+v8v5fR3Od+797t1dnOnO/Ofce77z+J//+b/P+ZqtXbs2sJ9MJhNUV1cHJ06cCJo3bx7EPc2aNcvpy7pWrVoF+/fvDyoqKoI2bdoE9fX1F7TjN8a+EXBn/fkfvw942Tf+wYMHg9mzZwfjxo0LDhw4EPa1x2MbFw/fOGfPng1qa2tzcCkILsLDydq2bRsunpOTMM7TD/W/tZDZhPdeKD+yGxHhdu3aBV27dg3OnDlzMVANMheLAO3btw8KCwuDmpoaX5OxbgUIMEq7K8IcPnw4KCsrC/r37x8cP378/4cAXAB3vqSkJMuiDhTkw+XcuXNhOWbMmKBly5YhUT8xArhyFvP0BfwRsAuwxJZJsm/nzp2DTp06he/OU+cZ64K6o0ePBkOHDg2GDx8e6gEbJ5Q/NHNuAJQ1hgBeHUDlR7nVTkY8rQAvAi4z34vR/mPs1FoRsaCgIJThI0eOBC1atEiFGGV+5MiRoS45efJkqFjJFXV1dQuA012m2WcwTw98fy6CqBdsaiIO4CScrGPHjvk4odhavPquRtFWXEC25VgkREKOCh/qDSq+vn37htzD/mZTOmOc5U7zKzBPEedygWshcDyWvs30igAbU+6oyMgJBCFhwQE0fccxN60Ay9iebbjoDh06hMowjQxT4fXq1SskArmHZpkArvixp/kWzHdMeArExSJEaiXIjjRjRJ4DaAGWpibLzXN3Fm1vA5teBgh3j1Rv3bp1YgKwPdmf2p9zcyNYYgPKMfY0T5f5nNYdw158nJ8QawW4CLKwiOBSEgO/hok2eBydR+3dYH+PLxA5J8Vv0KBBwenTp0P2JWAx6+yFEBfs8lMY+y0SWMBNI9E4ThKi58VKTg3FQZS1RQF1cz27eC0QHMu+3E0SkUowjhVt5VdaWhp07949ZHv2Qd1EjDXM2cla1M0nl3GxAs3J9yREzyTdFVKVFOaE9qRA8GM0WebRuo9JGZKA7Mv2SeS/Z8+eoQ9BArMfFrLGo6jvxbhHbJZnKX2Rzz1O7QhJJ9Cs2ZMaWIyq/zhdeqPNfIoHd58clIQD+JSXl4dKlyIAuBdVXZwFVWKspSSoxE++h8x4k3uCnEhE4I5KwRiFWGOU0QWKiCYLbdoRMRKAu2kQ9vkfLU6dOhX06NEjlH+yMRZSinnuyWnYosVcji8CEA/6Cg2JF+IIUBqnGKUTCNwtwBN4f89RiK1R96DEgO2o0NDmtEdvVFdVVYV+P3UAPUEs6GFwV3PHmXkD4vh74iDFJysVI/MlaQhwKeBNTLYX5VuA8T4/gZxA4MRGFxDB6R7OmYPfyykGRJbyie+XnGYnQIC/coH9+vULiYrxrkL9ZA9+0ykaHIfEpM7ge8TiJ2CsHYwyMfafAF1yCGBHYIbCVDjDjKt7BeB51D+LgQa6OkG7IDYEEtvQ7lnXLKLtLdLuJBpE4gPUXcW2+PkZwOex+4cGDhwYDBkyRL7/HFcEwUGPo/8uWRUpYnfxGHco8HkewLHLyYmAawAPuIFZxhOpDfJQ8gbUv41yORAptMWBNr6oqMhWird5+u+iHmBb2nhjDV7HWBNQTgK8y11l5NetWzc5ULscAtSj7nbNI0skhWeUZCc0W4nyH/jO4Vz0u1IeYhbk4AiwM6tjxIWByHsoZ9qcIBPJd/y+DwPfBESOmCa/QF3WiZHucLlEDpNxcNhmheEOPgdQNx6/VZFQzFZ5TN08AHXQt2Ii3EdyFuUsPtTcGPhW5iMiCNELvz+Gdn9huG4HUJaW/w3g0wxV0XaG7arG2WeKiUWYM4Y7GO5ezshTARbbWGw/DvXkpp/ivVvE0JVoMxN4rpGzJMhE5Pl+xlATsDIqikP9F9D2z3h9nOksEUFhK+qO4rcPkoalMQ/HqJLIyb3F3JdjrCcw1yZ8joyJLR5gCo54etlag7qIoeNh1N1BRYj3DTFJ0elotxPlVzkGuYAmL0VSJVGAJA41c4Z6A3BzTLfn0HYwYKEI6CUAMzZEWvLsIcQOo1AmmyyM72nHJCfYsogflGV6jEk9vyQZXSuq6w4c16NsGcGZbwOPr+H1RkOk2LEzjNepxQkihHSCQ4ynAYNRx2zMKV92CQMWqj8J0BRE8EShxRFN6YrfCRhC0x3r/Zm4IbQCcmJoV0kMamllccR6FjHqUC5F2R/wS2dcymOlfAKOS4KmzQb5cpNC2MC7JhVn5wjXoJ44rYhLh8n0eXOCorJxa7POjbSlCGVczr34/RsAmrcvo9s+wGp3tzVhntxiXiJ4nvEYb4FJkf0O8HocAePmLvCxnL0AORraVekJk6TYjDabRVXfRE2lCN1h6ZQRN1+InUbsCpKwoBZHh0dODN9JBCUffItXxEavTQkUtnfTVAplCWL3JISz29h4NjotnuSsQKJCk8dF+kJR6RARjrqFVmfPnj3ZbK8cIJ0msd6jgHPGtfVTQ8VLmlvh4mct9sobRmPic0DyDQQnx/NlfYUgyz59+oScsH379pAwXABD32nTpoUHIToESeI5mnbE/UqDdyLcafEBf2MCqgC7NwxIbMREJQ0g4D4sfJwnD+AmRrII05cfMWJE+L1169bQr+fip06dGp4oJ83lmYd5wj/EmMa4TaHivo4EeCguYZBnkB5g2aWA69OIEnUHOaGysjIYMGBAMGnSpODYsWPZwCpFmm4lNq+4gSLQA7jcX8DwtjEyRC8wjabnXEx9kfWnTJkSJkAo90xpJVV+FmcVNeYAF5zWngS4C4O91MBxmAv8blLEpbjI5sz9MTdAhcgkCT1RO8mZkAjfiYpTEvStAS53Uw1vAiUGgZ3GpuQEYvoiBqlIan7kSDHnTwJQFNiPu0+5VxCVYhcZIjNrdXUDdp+Eq5AZ3Gkg8QAyVZRZIk4Tl4QAbF9cXJxNYZMAtAokgs4BrNxEpCtteXg7DDTMDKYNSuQdKsnJBek7HxewvxaosWxLYXtw+cJp18217wql4aKCfBNoEu0O5VU+PhctJ0YeXD4C6JQpyrlpSLTojpGGGN5YwNziChdIZLk4lvLcFJ9jMX3QdiImY9bmGQU+TRUL5CHITTRlgF8D9ouD1MfmLoEPl5xokIumZ2cfgMpHt47IW9N64Hsh7wQYYjyIugWuF5fCqYncXRd5vPMWyizzvhi/32+nvG0dZc9vR6fZOu0md5e+uC408FvKSIOZwXlGvxPv95izA2Vtvg1xKFWARI+vMX66HUhpQQb643uW1bSjuTWyw2SBvDrBvjFic1eGGlz5esq3ko9uSIlBRqPuFcCv8F4WIcN12nVaBd0SaYwI6PDDImR11JkqgHcPmQssjxIn6bUshygDFJUTxPMpHk+jfjPgupgdnYV2R/g7xSjtpah8RJBewhwf0gGK6XI92u4wXFEU40afJ4DN4h5LcAd+40HI3JgJecuT0c062W0i2hQJUTcxan3/CMW1PF2K6bbA+Daz4xRs1D3Br1Cm0OihKCqizW78/nXAF/G5TXrEcVzaNMH6CyMswqsAHqDyDLEyou8lwOXnKF8DjI6KjV3KzMBiXkDH8ij/H214J5A596ekrZ3F0zXlWeL7+P5eUrNo3/QwC15uxthuzidy7DzKRwEDaAViiDgKbTbz7CJnzo0bN7pIfIiid8SuPwn25o3QCmpnyjlZkyxPP8EomCJzrGb7GJMx7tNsq4MT2xMUYaiErZOluTzKsnz3gwCeCZyVRZJfYplNEokEjwrPtxlxjeYAk+F1F74VAzPxQRNYYdtpOUvWs8J1sGhBJMNsb7igN8plJs1eSmLIhLKE4rvaCX27gOhLpLOsIzJ7qn/i+wZzcvSOZ23/du8TZjwV8zHIXoP4R3ifBxiFz1dcVpa3aPntPE+c6TmIWE9EtcMmAcPdWAhYhAXxcLOQi9L1WhD1Sc8p1d2oL7XGiRKp8F4A2i8K/nfI+y/gsTDJ/YC/8+AD5Uh04KHiGl+cIFPnBDDrPMjwRGkLXyxO4VGbfQWnDH2v0bVWE3C9QOXlepbgjEfIJQI6XDG3z5ahD9cw2pS78ipB85wyScNTvsVzlzzhL8/jRrnmVjfFJK/m3m4nj9vbgQTguT8XZTjsm672R5uJKEaQmBI/c58gyus8ZDagLpEVSJBIyHp4jn++xqPV71OgQgJYEWOtZ/haxRtKmWOBu8xdBLftWltsY84zE6WIEy/eIOWL+BaayMx+KHtL7EAkqdNDLiEXmEMUHniedtJqg9HmZtfvt26vNi0BdG3Ft3g8ZOf7PAu59TxtzivLNIekyi+wD1i8CuUiD9FXAa8C+/xS3JPmZnomyc7H+fb4/Se0bk41Fel621r4cgVxbq91V4jVqwB7HTe2M7jgB+QWHavZkDRPmZcASoZEmBx6i75bGjPcMdL4/VKGFAGWZkGzPG0XAbdL9A81G5LOmUnC9hHKJeO7dcUMjblSl12867ElFTtaGl20xvvLGPdVz/8TVuU7y0x1PG7vtNg24oz9Uo/Z412++VFWI7Fcog9tu9Lm6gvRmIPv9x1xmQAu6RDkXtbOtlGEmpgD5Nvnyc0dcv0EE6cfdi1HmhMf9wDF3k3gtRvEedhxjpgfqPb9PU9iEJHnyOUA7bQUXh6kq/D7l2iTjWv7XOD530BDr8jIrus+srXjt4MzumJMHuTsBa63YKE1+RR5lBjEikCCnWKWiHdzOgKO+nRIBAF88za/IFmJ3eMZov4CYxGBabcpGL8EYx+SeMXJeRwHNsV/h+vdxeuhEpN3ZyNY78Gm2fknJxVGhyjixPiQvVkNzT1elD9Py/aTAL64Hb9vcYmC9zfdXdT/C1LeGbg4rnBaAihDFJH12W5ulfNCNe/xTsP3bp8ikzJs5BF+5PNfAQYAPaseTdsEcaYAAAAASUVORK5CYII="
  18162. };
  18163. },
  18164. computed: {
  18165. iconSnowWidth() {
  18166. return (Math.floor(this.iconSize / 24) || 1) * 2;
  18167. },
  18168. contentdownText() {
  18169. return this.contentText.contentdown || t$1("uni-load-more.contentdown");
  18170. },
  18171. contentrefreshText() {
  18172. return this.contentText.contentrefresh || t$1("uni-load-more.contentrefresh");
  18173. },
  18174. contentnomoreText() {
  18175. return this.contentText.contentnomore || t$1("uni-load-more.contentnomore");
  18176. }
  18177. },
  18178. mounted() {
  18179. var pages2 = getCurrentPages();
  18180. var page = pages2[pages2.length - 1];
  18181. var currentWebview = page.$getAppWebview();
  18182. currentWebview.addEventListener("hide", () => {
  18183. this.webviewHide = true;
  18184. });
  18185. currentWebview.addEventListener("show", () => {
  18186. this.webviewHide = false;
  18187. });
  18188. },
  18189. methods: {
  18190. onClick() {
  18191. this.$emit("clickLoadMore", {
  18192. detail: {
  18193. status: this.status
  18194. }
  18195. });
  18196. }
  18197. }
  18198. };
  18199. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  18200. return vue.openBlock(), vue.createElementBlock("view", {
  18201. class: "uni-load-more",
  18202. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  18203. }, [
  18204. !$data.webviewHide && ($props.iconType === "circle" || $props.iconType === "auto" && $data.platform === "android") && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  18205. "view",
  18206. {
  18207. key: 0,
  18208. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  18209. class: "uni-load-more__img uni-load-more__img--android-MP"
  18210. },
  18211. [
  18212. vue.createElementVNode(
  18213. "view",
  18214. {
  18215. class: "uni-load-more__img-icon",
  18216. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  18217. },
  18218. null,
  18219. 4
  18220. /* STYLE */
  18221. ),
  18222. vue.createElementVNode(
  18223. "view",
  18224. {
  18225. class: "uni-load-more__img-icon",
  18226. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  18227. },
  18228. null,
  18229. 4
  18230. /* STYLE */
  18231. ),
  18232. vue.createElementVNode(
  18233. "view",
  18234. {
  18235. class: "uni-load-more__img-icon",
  18236. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  18237. },
  18238. null,
  18239. 4
  18240. /* STYLE */
  18241. )
  18242. ],
  18243. 4
  18244. /* STYLE */
  18245. )) : !$data.webviewHide && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  18246. "view",
  18247. {
  18248. key: 1,
  18249. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  18250. class: "uni-load-more__img uni-load-more__img--ios-H5"
  18251. },
  18252. [
  18253. vue.createElementVNode("image", {
  18254. src: $data.imgBase64,
  18255. mode: "widthFix"
  18256. }, null, 8, ["src"])
  18257. ],
  18258. 4
  18259. /* STYLE */
  18260. )) : vue.createCommentVNode("v-if", true),
  18261. $props.showText ? (vue.openBlock(), vue.createElementBlock(
  18262. "text",
  18263. {
  18264. key: 2,
  18265. class: "uni-load-more__text",
  18266. style: vue.normalizeStyle({ color: $props.color })
  18267. },
  18268. vue.toDisplayString($props.status === "more" ? $options.contentdownText : $props.status === "loading" ? $options.contentrefreshText : $options.contentnomoreText),
  18269. 5
  18270. /* TEXT, STYLE */
  18271. )) : vue.createCommentVNode("v-if", true)
  18272. ]);
  18273. }
  18274. const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-9245e42c"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue"]]);
  18275. const _sfc_main$s = {
  18276. name: "uniDataChecklist",
  18277. mixins: [Ys.mixinDatacom || {}],
  18278. emits: ["input", "update:modelValue", "change"],
  18279. props: {
  18280. mode: {
  18281. type: String,
  18282. default: "default"
  18283. },
  18284. multiple: {
  18285. type: Boolean,
  18286. default: false
  18287. },
  18288. value: {
  18289. type: [Array, String, Number],
  18290. default() {
  18291. return "";
  18292. }
  18293. },
  18294. // TODO vue3
  18295. modelValue: {
  18296. type: [Array, String, Number],
  18297. default() {
  18298. return "";
  18299. }
  18300. },
  18301. localdata: {
  18302. type: Array,
  18303. default() {
  18304. return [];
  18305. }
  18306. },
  18307. min: {
  18308. type: [Number, String],
  18309. default: ""
  18310. },
  18311. max: {
  18312. type: [Number, String],
  18313. default: ""
  18314. },
  18315. wrap: {
  18316. type: Boolean,
  18317. default: false
  18318. },
  18319. icon: {
  18320. type: String,
  18321. default: "left"
  18322. },
  18323. selectedColor: {
  18324. type: String,
  18325. default: ""
  18326. },
  18327. selectedTextColor: {
  18328. type: String,
  18329. default: ""
  18330. },
  18331. emptyText: {
  18332. type: String,
  18333. default: "暂无数据"
  18334. },
  18335. disabled: {
  18336. type: Boolean,
  18337. default: false
  18338. },
  18339. map: {
  18340. type: Object,
  18341. default() {
  18342. return {
  18343. text: "text",
  18344. value: "value"
  18345. };
  18346. }
  18347. }
  18348. },
  18349. watch: {
  18350. localdata: {
  18351. handler(newVal) {
  18352. this.range = newVal;
  18353. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  18354. },
  18355. deep: true
  18356. },
  18357. mixinDatacomResData(newVal) {
  18358. this.range = newVal;
  18359. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  18360. },
  18361. value(newVal) {
  18362. this.dataList = this.getDataList(newVal);
  18363. },
  18364. modelValue(newVal) {
  18365. this.dataList = this.getDataList(newVal);
  18366. }
  18367. },
  18368. data() {
  18369. return {
  18370. dataList: [],
  18371. range: [],
  18372. contentText: {
  18373. contentdown: "查看更多",
  18374. contentrefresh: "加载中",
  18375. contentnomore: "没有更多"
  18376. },
  18377. isLocal: true,
  18378. styles: {
  18379. selectedColor: "#2979ff",
  18380. selectedTextColor: "#666"
  18381. },
  18382. isTop: 0
  18383. };
  18384. },
  18385. computed: {
  18386. dataValue() {
  18387. if (this.value === "")
  18388. return this.modelValue;
  18389. if (this.modelValue === "")
  18390. return this.value;
  18391. return this.value;
  18392. }
  18393. },
  18394. created() {
  18395. if (this.localdata && this.localdata.length !== 0) {
  18396. this.isLocal = true;
  18397. this.range = this.localdata;
  18398. this.dataList = this.getDataList(this.getSelectedValue(this.range));
  18399. } else {
  18400. if (this.collection) {
  18401. this.isLocal = false;
  18402. this.loadData();
  18403. }
  18404. }
  18405. },
  18406. methods: {
  18407. loadData() {
  18408. this.mixinDatacomGet().then((res) => {
  18409. this.mixinDatacomResData = res.result.data;
  18410. if (this.mixinDatacomResData.length === 0) {
  18411. this.isLocal = false;
  18412. this.mixinDatacomErrorMessage = this.emptyText;
  18413. } else {
  18414. this.isLocal = true;
  18415. }
  18416. }).catch((err) => {
  18417. this.mixinDatacomErrorMessage = err.message;
  18418. });
  18419. },
  18420. /**
  18421. * 获取父元素实例
  18422. */
  18423. getForm(name = "uniForms") {
  18424. let parent = this.$parent;
  18425. let parentName = parent.$options.name;
  18426. while (parentName !== name) {
  18427. parent = parent.$parent;
  18428. if (!parent)
  18429. return false;
  18430. parentName = parent.$options.name;
  18431. }
  18432. return parent;
  18433. },
  18434. change(e2) {
  18435. const values = e2.detail.value;
  18436. let detail = {
  18437. value: [],
  18438. data: []
  18439. };
  18440. if (this.multiple) {
  18441. this.range.forEach((item) => {
  18442. if (values.includes(item[this.map.value] + "")) {
  18443. detail.value.push(item[this.map.value]);
  18444. detail.data.push(item);
  18445. }
  18446. });
  18447. } else {
  18448. const range = this.range.find((item) => item[this.map.value] + "" === values);
  18449. if (range) {
  18450. detail = {
  18451. value: range[this.map.value],
  18452. data: range
  18453. };
  18454. }
  18455. }
  18456. this.$emit("input", detail.value);
  18457. this.$emit("update:modelValue", detail.value);
  18458. this.$emit("change", {
  18459. detail
  18460. });
  18461. if (this.multiple) {
  18462. this.dataList = this.getDataList(detail.value, true);
  18463. } else {
  18464. this.dataList = this.getDataList(detail.value);
  18465. }
  18466. },
  18467. /**
  18468. * 获取渲染的新数组
  18469. * @param {Object} value 选中内容
  18470. */
  18471. getDataList(value) {
  18472. let dataList = JSON.parse(JSON.stringify(this.range));
  18473. let list = [];
  18474. if (this.multiple) {
  18475. if (!Array.isArray(value)) {
  18476. value = [];
  18477. }
  18478. }
  18479. dataList.forEach((item, index) => {
  18480. item.disabled = item.disable || item.disabled || false;
  18481. if (this.multiple) {
  18482. if (value.length > 0) {
  18483. let have = value.find((val) => val === item[this.map.value]);
  18484. item.selected = have !== void 0;
  18485. } else {
  18486. item.selected = false;
  18487. }
  18488. } else {
  18489. item.selected = value === item[this.map.value];
  18490. }
  18491. list.push(item);
  18492. });
  18493. return this.setRange(list);
  18494. },
  18495. /**
  18496. * 处理最大最小值
  18497. * @param {Object} list
  18498. */
  18499. setRange(list) {
  18500. let selectList = list.filter((item) => item.selected);
  18501. let min = Number(this.min) || 0;
  18502. let max = Number(this.max) || "";
  18503. list.forEach((item, index) => {
  18504. if (this.multiple) {
  18505. if (selectList.length <= min) {
  18506. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  18507. if (have !== void 0) {
  18508. item.disabled = true;
  18509. }
  18510. }
  18511. if (selectList.length >= max && max !== "") {
  18512. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  18513. if (have === void 0) {
  18514. item.disabled = true;
  18515. }
  18516. }
  18517. }
  18518. this.setStyles(item, index);
  18519. list[index] = item;
  18520. });
  18521. return list;
  18522. },
  18523. /**
  18524. * 设置 class
  18525. * @param {Object} item
  18526. * @param {Object} index
  18527. */
  18528. setStyles(item, index) {
  18529. item.styleBackgroud = this.setStyleBackgroud(item);
  18530. item.styleIcon = this.setStyleIcon(item);
  18531. item.styleIconText = this.setStyleIconText(item);
  18532. item.styleRightIcon = this.setStyleRightIcon(item);
  18533. },
  18534. /**
  18535. * 获取选中值
  18536. * @param {Object} range
  18537. */
  18538. getSelectedValue(range) {
  18539. if (!this.multiple)
  18540. return this.dataValue;
  18541. let selectedArr = [];
  18542. range.forEach((item) => {
  18543. if (item.selected) {
  18544. selectedArr.push(item[this.map.value]);
  18545. }
  18546. });
  18547. return this.dataValue.length > 0 ? this.dataValue : selectedArr;
  18548. },
  18549. /**
  18550. * 设置背景样式
  18551. */
  18552. setStyleBackgroud(item) {
  18553. let styles = {};
  18554. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  18555. if (this.selectedColor) {
  18556. if (this.mode !== "list") {
  18557. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  18558. }
  18559. if (this.mode === "tag") {
  18560. styles["background-color"] = item.selected ? selectedColor : "#f5f5f5";
  18561. }
  18562. }
  18563. let classles = "";
  18564. for (let i2 in styles) {
  18565. classles += `${i2}:${styles[i2]};`;
  18566. }
  18567. return classles;
  18568. },
  18569. setStyleIcon(item) {
  18570. let styles = {};
  18571. let classles = "";
  18572. if (this.selectedColor) {
  18573. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  18574. styles["background-color"] = item.selected ? selectedColor : "#fff";
  18575. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  18576. if (!item.selected && item.disabled) {
  18577. styles["background-color"] = "#F2F6FC";
  18578. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  18579. }
  18580. }
  18581. for (let i2 in styles) {
  18582. classles += `${i2}:${styles[i2]};`;
  18583. }
  18584. return classles;
  18585. },
  18586. setStyleIconText(item) {
  18587. let styles = {};
  18588. let classles = "";
  18589. if (this.selectedColor) {
  18590. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  18591. if (this.mode === "tag") {
  18592. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : "#fff" : "#666";
  18593. } else {
  18594. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : selectedColor : "#666";
  18595. }
  18596. if (!item.selected && item.disabled) {
  18597. styles.color = "#999";
  18598. }
  18599. }
  18600. for (let i2 in styles) {
  18601. classles += `${i2}:${styles[i2]};`;
  18602. }
  18603. return classles;
  18604. },
  18605. setStyleRightIcon(item) {
  18606. let styles = {};
  18607. let classles = "";
  18608. if (this.mode === "list") {
  18609. styles["border-color"] = item.selected ? this.styles.selectedColor : "#DCDFE6";
  18610. }
  18611. for (let i2 in styles) {
  18612. classles += `${i2}:${styles[i2]};`;
  18613. }
  18614. return classles;
  18615. }
  18616. }
  18617. };
  18618. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  18619. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$5);
  18620. return vue.openBlock(), vue.createElementBlock(
  18621. "view",
  18622. {
  18623. class: "uni-data-checklist",
  18624. style: vue.normalizeStyle({ "margin-top": $data.isTop + "px" })
  18625. },
  18626. [
  18627. !$data.isLocal ? (vue.openBlock(), vue.createElementBlock("view", {
  18628. key: 0,
  18629. class: "uni-data-loading"
  18630. }, [
  18631. !_ctx.mixinDatacomErrorMessage ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
  18632. key: 0,
  18633. status: "loading",
  18634. iconType: "snow",
  18635. iconSize: 18,
  18636. "content-text": $data.contentText
  18637. }, null, 8, ["content-text"])) : (vue.openBlock(), vue.createElementBlock(
  18638. "text",
  18639. { key: 1 },
  18640. vue.toDisplayString(_ctx.mixinDatacomErrorMessage),
  18641. 1
  18642. /* TEXT */
  18643. ))
  18644. ])) : (vue.openBlock(), vue.createElementBlock(
  18645. vue.Fragment,
  18646. { key: 1 },
  18647. [
  18648. $props.multiple ? (vue.openBlock(), vue.createElementBlock(
  18649. "checkbox-group",
  18650. {
  18651. key: 0,
  18652. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list" || $props.wrap }]),
  18653. onChange: _cache[0] || (_cache[0] = (...args) => $options.change && $options.change(...args))
  18654. },
  18655. [
  18656. (vue.openBlock(true), vue.createElementBlock(
  18657. vue.Fragment,
  18658. null,
  18659. vue.renderList($data.dataList, (item, index) => {
  18660. return vue.openBlock(), vue.createElementBlock(
  18661. "label",
  18662. {
  18663. class: vue.normalizeClass(["checklist-box", ["is--" + $props.mode, item.selected ? "is-checked" : "", $props.disabled || !!item.disabled ? "is-disable" : "", index !== 0 && $props.mode === "list" ? "is-list-border" : ""]]),
  18664. style: vue.normalizeStyle(item.styleBackgroud),
  18665. key: index
  18666. },
  18667. [
  18668. vue.createElementVNode("checkbox", {
  18669. class: "hidden",
  18670. hidden: "",
  18671. disabled: $props.disabled || !!item.disabled,
  18672. value: item[$props.map.value] + "",
  18673. checked: item.selected
  18674. }, null, 8, ["disabled", "value", "checked"]),
  18675. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  18676. "view",
  18677. {
  18678. key: 0,
  18679. class: "checkbox__inner",
  18680. style: vue.normalizeStyle(item.styleIcon)
  18681. },
  18682. [
  18683. vue.createElementVNode("view", { class: "checkbox__inner-icon" })
  18684. ],
  18685. 4
  18686. /* STYLE */
  18687. )) : vue.createCommentVNode("v-if", true),
  18688. vue.createElementVNode(
  18689. "view",
  18690. {
  18691. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  18692. },
  18693. [
  18694. vue.createElementVNode(
  18695. "text",
  18696. {
  18697. class: "checklist-text",
  18698. style: vue.normalizeStyle(item.styleIconText)
  18699. },
  18700. vue.toDisplayString(item[$props.map.text]),
  18701. 5
  18702. /* TEXT, STYLE */
  18703. ),
  18704. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  18705. "view",
  18706. {
  18707. key: 0,
  18708. class: "checkobx__list",
  18709. style: vue.normalizeStyle(item.styleBackgroud)
  18710. },
  18711. null,
  18712. 4
  18713. /* STYLE */
  18714. )) : vue.createCommentVNode("v-if", true)
  18715. ],
  18716. 2
  18717. /* CLASS */
  18718. )
  18719. ],
  18720. 6
  18721. /* CLASS, STYLE */
  18722. );
  18723. }),
  18724. 128
  18725. /* KEYED_FRAGMENT */
  18726. ))
  18727. ],
  18728. 34
  18729. /* CLASS, NEED_HYDRATION */
  18730. )) : (vue.openBlock(), vue.createElementBlock(
  18731. "radio-group",
  18732. {
  18733. key: 1,
  18734. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list", "is-wrap": $props.wrap }]),
  18735. onChange: _cache[1] || (_cache[1] = (...args) => $options.change && $options.change(...args))
  18736. },
  18737. [
  18738. (vue.openBlock(true), vue.createElementBlock(
  18739. vue.Fragment,
  18740. null,
  18741. vue.renderList($data.dataList, (item, index) => {
  18742. return vue.openBlock(), vue.createElementBlock(
  18743. "label",
  18744. {
  18745. class: vue.normalizeClass(["checklist-box", ["is--" + $props.mode, item.selected ? "is-checked" : "", $props.disabled || !!item.disabled ? "is-disable" : "", index !== 0 && $props.mode === "list" ? "is-list-border" : ""]]),
  18746. style: vue.normalizeStyle(item.styleBackgroud),
  18747. key: index
  18748. },
  18749. [
  18750. vue.createElementVNode("radio", {
  18751. class: "hidden",
  18752. hidden: "",
  18753. disabled: $props.disabled || item.disabled,
  18754. value: item[$props.map.value] + "",
  18755. checked: item.selected
  18756. }, null, 8, ["disabled", "value", "checked"]),
  18757. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  18758. "view",
  18759. {
  18760. key: 0,
  18761. class: "radio__inner",
  18762. style: vue.normalizeStyle(item.styleBackgroud)
  18763. },
  18764. [
  18765. vue.createElementVNode(
  18766. "view",
  18767. {
  18768. class: "radio__inner-icon",
  18769. style: vue.normalizeStyle(item.styleIcon)
  18770. },
  18771. null,
  18772. 4
  18773. /* STYLE */
  18774. )
  18775. ],
  18776. 4
  18777. /* STYLE */
  18778. )) : vue.createCommentVNode("v-if", true),
  18779. vue.createElementVNode(
  18780. "view",
  18781. {
  18782. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  18783. },
  18784. [
  18785. vue.createElementVNode(
  18786. "text",
  18787. {
  18788. class: "checklist-text",
  18789. style: vue.normalizeStyle(item.styleIconText)
  18790. },
  18791. vue.toDisplayString(item[$props.map.text]),
  18792. 5
  18793. /* TEXT, STYLE */
  18794. ),
  18795. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  18796. "view",
  18797. {
  18798. key: 0,
  18799. style: vue.normalizeStyle(item.styleRightIcon),
  18800. class: "checkobx__list"
  18801. },
  18802. null,
  18803. 4
  18804. /* STYLE */
  18805. )) : vue.createCommentVNode("v-if", true)
  18806. ],
  18807. 2
  18808. /* CLASS */
  18809. )
  18810. ],
  18811. 6
  18812. /* CLASS, STYLE */
  18813. );
  18814. }),
  18815. 128
  18816. /* KEYED_FRAGMENT */
  18817. ))
  18818. ],
  18819. 34
  18820. /* CLASS, NEED_HYDRATION */
  18821. ))
  18822. ],
  18823. 64
  18824. /* STABLE_FRAGMENT */
  18825. ))
  18826. ],
  18827. 4
  18828. /* STYLE */
  18829. );
  18830. }
  18831. const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-2f788efd"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue"]]);
  18832. var pattern = {
  18833. email: /^\S+?@\S+?\.\S+?$/,
  18834. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  18835. url: new RegExp(
  18836. "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
  18837. "i"
  18838. )
  18839. };
  18840. const FORMAT_MAPPING = {
  18841. "int": "integer",
  18842. "bool": "boolean",
  18843. "double": "number",
  18844. "long": "number",
  18845. "password": "string"
  18846. // "fileurls": 'array'
  18847. };
  18848. function formatMessage(args, resources = "") {
  18849. var defaultMessage = ["label"];
  18850. defaultMessage.forEach((item) => {
  18851. if (args[item] === void 0) {
  18852. args[item] = "";
  18853. }
  18854. });
  18855. let str = resources;
  18856. for (let key in args) {
  18857. let reg = new RegExp("{" + key + "}");
  18858. str = str.replace(reg, args[key]);
  18859. }
  18860. return str;
  18861. }
  18862. function isEmptyValue(value, type) {
  18863. if (value === void 0 || value === null) {
  18864. return true;
  18865. }
  18866. if (typeof value === "string" && !value) {
  18867. return true;
  18868. }
  18869. if (Array.isArray(value) && !value.length) {
  18870. return true;
  18871. }
  18872. if (type === "object" && !Object.keys(value).length) {
  18873. return true;
  18874. }
  18875. return false;
  18876. }
  18877. const types = {
  18878. integer(value) {
  18879. return types.number(value) && parseInt(value, 10) === value;
  18880. },
  18881. string(value) {
  18882. return typeof value === "string";
  18883. },
  18884. number(value) {
  18885. if (isNaN(value)) {
  18886. return false;
  18887. }
  18888. return typeof value === "number";
  18889. },
  18890. "boolean": function(value) {
  18891. return typeof value === "boolean";
  18892. },
  18893. "float": function(value) {
  18894. return types.number(value) && !types.integer(value);
  18895. },
  18896. array(value) {
  18897. return Array.isArray(value);
  18898. },
  18899. object(value) {
  18900. return typeof value === "object" && !types.array(value);
  18901. },
  18902. date(value) {
  18903. return value instanceof Date;
  18904. },
  18905. timestamp(value) {
  18906. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  18907. return false;
  18908. }
  18909. return true;
  18910. },
  18911. file(value) {
  18912. return typeof value.url === "string";
  18913. },
  18914. email(value) {
  18915. return typeof value === "string" && !!value.match(pattern.email) && value.length < 255;
  18916. },
  18917. url(value) {
  18918. return typeof value === "string" && !!value.match(pattern.url);
  18919. },
  18920. pattern(reg, value) {
  18921. try {
  18922. return new RegExp(reg).test(value);
  18923. } catch (e2) {
  18924. return false;
  18925. }
  18926. },
  18927. method(value) {
  18928. return typeof value === "function";
  18929. },
  18930. idcard(value) {
  18931. return typeof value === "string" && !!value.match(pattern.idcard);
  18932. },
  18933. "url-https"(value) {
  18934. return this.url(value) && value.startsWith("https://");
  18935. },
  18936. "url-scheme"(value) {
  18937. return value.startsWith("://");
  18938. },
  18939. "url-web"(value) {
  18940. return false;
  18941. }
  18942. };
  18943. class RuleValidator {
  18944. constructor(message) {
  18945. this._message = message;
  18946. }
  18947. async validateRule(fieldKey, fieldValue, value, data, allData) {
  18948. var result = null;
  18949. let rules = fieldValue.rules;
  18950. let hasRequired = rules.findIndex((item) => {
  18951. return item.required;
  18952. });
  18953. if (hasRequired < 0) {
  18954. if (value === null || value === void 0) {
  18955. return result;
  18956. }
  18957. if (typeof value === "string" && !value.length) {
  18958. return result;
  18959. }
  18960. }
  18961. var message = this._message;
  18962. if (rules === void 0) {
  18963. return message["default"];
  18964. }
  18965. for (var i2 = 0; i2 < rules.length; i2++) {
  18966. let rule = rules[i2];
  18967. let vt2 = this._getValidateType(rule);
  18968. Object.assign(rule, {
  18969. label: fieldValue.label || `["${fieldKey}"]`
  18970. });
  18971. if (RuleValidatorHelper[vt2]) {
  18972. result = RuleValidatorHelper[vt2](rule, value, message);
  18973. if (result != null) {
  18974. break;
  18975. }
  18976. }
  18977. if (rule.validateExpr) {
  18978. let now = Date.now();
  18979. let resultExpr = rule.validateExpr(value, allData, now);
  18980. if (resultExpr === false) {
  18981. result = this._getMessage(rule, rule.errorMessage || this._message["default"]);
  18982. break;
  18983. }
  18984. }
  18985. if (rule.validateFunction) {
  18986. result = await this.validateFunction(rule, value, data, allData, vt2);
  18987. if (result !== null) {
  18988. break;
  18989. }
  18990. }
  18991. }
  18992. if (result !== null) {
  18993. result = message.TAG + result;
  18994. }
  18995. return result;
  18996. }
  18997. async validateFunction(rule, value, data, allData, vt2) {
  18998. let result = null;
  18999. try {
  19000. let callbackMessage = null;
  19001. const res = await rule.validateFunction(rule, value, allData || data, (message) => {
  19002. callbackMessage = message;
  19003. });
  19004. if (callbackMessage || typeof res === "string" && res || res === false) {
  19005. result = this._getMessage(rule, callbackMessage || res, vt2);
  19006. }
  19007. } catch (e2) {
  19008. result = this._getMessage(rule, e2.message, vt2);
  19009. }
  19010. return result;
  19011. }
  19012. _getMessage(rule, message, vt2) {
  19013. return formatMessage(rule, message || rule.errorMessage || this._message[vt2] || message["default"]);
  19014. }
  19015. _getValidateType(rule) {
  19016. var result = "";
  19017. if (rule.required) {
  19018. result = "required";
  19019. } else if (rule.format) {
  19020. result = "format";
  19021. } else if (rule.arrayType) {
  19022. result = "arrayTypeFormat";
  19023. } else if (rule.range) {
  19024. result = "range";
  19025. } else if (rule.maximum !== void 0 || rule.minimum !== void 0) {
  19026. result = "rangeNumber";
  19027. } else if (rule.maxLength !== void 0 || rule.minLength !== void 0) {
  19028. result = "rangeLength";
  19029. } else if (rule.pattern) {
  19030. result = "pattern";
  19031. } else if (rule.validateFunction) {
  19032. result = "validateFunction";
  19033. }
  19034. return result;
  19035. }
  19036. }
  19037. const RuleValidatorHelper = {
  19038. required(rule, value, message) {
  19039. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  19040. return formatMessage(rule, rule.errorMessage || message.required);
  19041. }
  19042. return null;
  19043. },
  19044. range(rule, value, message) {
  19045. const {
  19046. range,
  19047. errorMessage
  19048. } = rule;
  19049. let list = new Array(range.length);
  19050. for (let i2 = 0; i2 < range.length; i2++) {
  19051. const item = range[i2];
  19052. if (types.object(item) && item.value !== void 0) {
  19053. list[i2] = item.value;
  19054. } else {
  19055. list[i2] = item;
  19056. }
  19057. }
  19058. let result = false;
  19059. if (Array.isArray(value)) {
  19060. result = new Set(value.concat(list)).size === list.length;
  19061. } else {
  19062. if (list.indexOf(value) > -1) {
  19063. result = true;
  19064. }
  19065. }
  19066. if (!result) {
  19067. return formatMessage(rule, errorMessage || message["enum"]);
  19068. }
  19069. return null;
  19070. },
  19071. rangeNumber(rule, value, message) {
  19072. if (!types.number(value)) {
  19073. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  19074. }
  19075. let {
  19076. minimum,
  19077. maximum,
  19078. exclusiveMinimum,
  19079. exclusiveMaximum
  19080. } = rule;
  19081. let min = exclusiveMinimum ? value <= minimum : value < minimum;
  19082. let max = exclusiveMaximum ? value >= maximum : value > maximum;
  19083. if (minimum !== void 0 && min) {
  19084. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMinimum ? "exclusiveMinimum" : "minimum"]);
  19085. } else if (maximum !== void 0 && max) {
  19086. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMaximum ? "exclusiveMaximum" : "maximum"]);
  19087. } else if (minimum !== void 0 && maximum !== void 0 && (min || max)) {
  19088. return formatMessage(rule, rule.errorMessage || message["number"].range);
  19089. }
  19090. return null;
  19091. },
  19092. rangeLength(rule, value, message) {
  19093. if (!types.string(value) && !types.array(value)) {
  19094. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  19095. }
  19096. let min = rule.minLength;
  19097. let max = rule.maxLength;
  19098. let val = value.length;
  19099. if (min !== void 0 && val < min) {
  19100. return formatMessage(rule, rule.errorMessage || message["length"].minLength);
  19101. } else if (max !== void 0 && val > max) {
  19102. return formatMessage(rule, rule.errorMessage || message["length"].maxLength);
  19103. } else if (min !== void 0 && max !== void 0 && (val < min || val > max)) {
  19104. return formatMessage(rule, rule.errorMessage || message["length"].range);
  19105. }
  19106. return null;
  19107. },
  19108. pattern(rule, value, message) {
  19109. if (!types["pattern"](rule.pattern, value)) {
  19110. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  19111. }
  19112. return null;
  19113. },
  19114. format(rule, value, message) {
  19115. var customTypes = Object.keys(types);
  19116. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  19117. if (customTypes.indexOf(format) > -1) {
  19118. if (!types[format](value)) {
  19119. return formatMessage(rule, rule.errorMessage || message.typeError);
  19120. }
  19121. }
  19122. return null;
  19123. },
  19124. arrayTypeFormat(rule, value, message) {
  19125. if (!Array.isArray(value)) {
  19126. return formatMessage(rule, rule.errorMessage || message.typeError);
  19127. }
  19128. for (let i2 = 0; i2 < value.length; i2++) {
  19129. const element = value[i2];
  19130. let formatResult = this.format(rule, element, message);
  19131. if (formatResult !== null) {
  19132. return formatResult;
  19133. }
  19134. }
  19135. return null;
  19136. }
  19137. };
  19138. class SchemaValidator extends RuleValidator {
  19139. constructor(schema, options) {
  19140. super(SchemaValidator.message);
  19141. this._schema = schema;
  19142. this._options = options || null;
  19143. }
  19144. updateSchema(schema) {
  19145. this._schema = schema;
  19146. }
  19147. async validate(data, allData) {
  19148. let result = this._checkFieldInSchema(data);
  19149. if (!result) {
  19150. result = await this.invokeValidate(data, false, allData);
  19151. }
  19152. return result.length ? result[0] : null;
  19153. }
  19154. async validateAll(data, allData) {
  19155. let result = this._checkFieldInSchema(data);
  19156. if (!result) {
  19157. result = await this.invokeValidate(data, true, allData);
  19158. }
  19159. return result;
  19160. }
  19161. async validateUpdate(data, allData) {
  19162. let result = this._checkFieldInSchema(data);
  19163. if (!result) {
  19164. result = await this.invokeValidateUpdate(data, false, allData);
  19165. }
  19166. return result.length ? result[0] : null;
  19167. }
  19168. async invokeValidate(data, all, allData) {
  19169. let result = [];
  19170. let schema = this._schema;
  19171. for (let key in schema) {
  19172. let value = schema[key];
  19173. let errorMessage = await this.validateRule(key, value, data[key], data, allData);
  19174. if (errorMessage != null) {
  19175. result.push({
  19176. key,
  19177. errorMessage
  19178. });
  19179. if (!all)
  19180. break;
  19181. }
  19182. }
  19183. return result;
  19184. }
  19185. async invokeValidateUpdate(data, all, allData) {
  19186. let result = [];
  19187. for (let key in data) {
  19188. let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData);
  19189. if (errorMessage != null) {
  19190. result.push({
  19191. key,
  19192. errorMessage
  19193. });
  19194. if (!all)
  19195. break;
  19196. }
  19197. }
  19198. return result;
  19199. }
  19200. _checkFieldInSchema(data) {
  19201. var keys = Object.keys(data);
  19202. var keys2 = Object.keys(this._schema);
  19203. if (new Set(keys.concat(keys2)).size === keys2.length) {
  19204. return "";
  19205. }
  19206. var noExistFields = keys.filter((key) => {
  19207. return keys2.indexOf(key) < 0;
  19208. });
  19209. var errorMessage = formatMessage({
  19210. field: JSON.stringify(noExistFields)
  19211. }, SchemaValidator.message.TAG + SchemaValidator.message["defaultInvalid"]);
  19212. return [{
  19213. key: "invalid",
  19214. errorMessage
  19215. }];
  19216. }
  19217. }
  19218. function Message() {
  19219. return {
  19220. TAG: "",
  19221. default: "验证错误",
  19222. defaultInvalid: "提交的字段{field}在数据库中并不存在",
  19223. validateFunction: "验证无效",
  19224. required: "{label}必填",
  19225. "enum": "{label}超出范围",
  19226. timestamp: "{label}格式无效",
  19227. whitespace: "{label}不能为空",
  19228. typeError: "{label}类型无效",
  19229. date: {
  19230. format: "{label}日期{value}格式无效",
  19231. parse: "{label}日期无法解析,{value}无效",
  19232. invalid: "{label}日期{value}无效"
  19233. },
  19234. length: {
  19235. minLength: "{label}长度不能少于{minLength}",
  19236. maxLength: "{label}长度不能超过{maxLength}",
  19237. range: "{label}必须介于{minLength}和{maxLength}之间"
  19238. },
  19239. number: {
  19240. minimum: "{label}不能小于{minimum}",
  19241. maximum: "{label}不能大于{maximum}",
  19242. exclusiveMinimum: "{label}不能小于等于{minimum}",
  19243. exclusiveMaximum: "{label}不能大于等于{maximum}",
  19244. range: "{label}必须介于{minimum}and{maximum}之间"
  19245. },
  19246. pattern: {
  19247. mismatch: "{label}格式不匹配"
  19248. }
  19249. };
  19250. }
  19251. SchemaValidator.message = new Message();
  19252. const deepCopy = (val) => {
  19253. return JSON.parse(JSON.stringify(val));
  19254. };
  19255. const typeFilter = (format) => {
  19256. return format === "int" || format === "double" || format === "number" || format === "timestamp";
  19257. };
  19258. const getValue = (key, value, rules) => {
  19259. const isRuleNumType = rules.find((val) => val.format && typeFilter(val.format));
  19260. const isRuleBoolType = rules.find((val) => val.format && val.format === "boolean" || val.format === "bool");
  19261. if (!!isRuleNumType) {
  19262. if (!value && value !== 0) {
  19263. value = null;
  19264. } else {
  19265. value = isNumber(Number(value)) ? Number(value) : value;
  19266. }
  19267. }
  19268. if (!!isRuleBoolType) {
  19269. value = isBoolean(value) ? value : false;
  19270. }
  19271. return value;
  19272. };
  19273. const setDataValue = (field, formdata, value) => {
  19274. formdata[field] = value;
  19275. return value || "";
  19276. };
  19277. const getDataValue = (field, data) => {
  19278. return objGet(data, field);
  19279. };
  19280. const realName = (name, data = {}) => {
  19281. const base_name = _basePath(name);
  19282. if (typeof base_name === "object" && Array.isArray(base_name) && base_name.length > 1) {
  19283. const realname = base_name.reduce((a2, b2) => a2 += `#${b2}`, "_formdata_");
  19284. return realname;
  19285. }
  19286. return base_name[0] || name;
  19287. };
  19288. const isRealName = (name) => {
  19289. const reg = /^_formdata_#*/;
  19290. return reg.test(name);
  19291. };
  19292. const rawData = (object = {}, name) => {
  19293. let newData = JSON.parse(JSON.stringify(object));
  19294. let formData = {};
  19295. for (let i2 in newData) {
  19296. let path = name2arr(i2);
  19297. objSet(formData, path, newData[i2]);
  19298. }
  19299. return formData;
  19300. };
  19301. const name2arr = (name) => {
  19302. let field = name.replace("_formdata_#", "");
  19303. field = field.split("#").map((v2) => isNumber(v2) ? Number(v2) : v2);
  19304. return field;
  19305. };
  19306. const objSet = (object, path, value) => {
  19307. if (typeof object !== "object")
  19308. return object;
  19309. _basePath(path).reduce((o2, k, i2, _2) => {
  19310. if (i2 === _2.length - 1) {
  19311. o2[k] = value;
  19312. return null;
  19313. } else if (k in o2) {
  19314. return o2[k];
  19315. } else {
  19316. o2[k] = /^[0-9]{1,}$/.test(_2[i2 + 1]) ? [] : {};
  19317. return o2[k];
  19318. }
  19319. }, object);
  19320. return object;
  19321. };
  19322. function _basePath(path) {
  19323. if (Array.isArray(path))
  19324. return path;
  19325. return path.replace(/\[/g, ".").replace(/\]/g, "").split(".");
  19326. }
  19327. const objGet = (object, path, defaultVal = "undefined") => {
  19328. let newPath = _basePath(path);
  19329. let val = newPath.reduce((o2, k) => {
  19330. return (o2 || {})[k];
  19331. }, object);
  19332. return !val || val !== void 0 ? val : defaultVal;
  19333. };
  19334. const isNumber = (num) => {
  19335. return !isNaN(Number(num));
  19336. };
  19337. const isBoolean = (bool) => {
  19338. return typeof bool === "boolean";
  19339. };
  19340. const isRequiredField = (rules) => {
  19341. let isNoField = false;
  19342. for (let i2 = 0; i2 < rules.length; i2++) {
  19343. const ruleData = rules[i2];
  19344. if (ruleData.required) {
  19345. isNoField = true;
  19346. break;
  19347. }
  19348. }
  19349. return isNoField;
  19350. };
  19351. const isEqual = (a2, b2) => {
  19352. if (a2 === b2) {
  19353. return a2 !== 0 || 1 / a2 === 1 / b2;
  19354. }
  19355. if (a2 == null || b2 == null) {
  19356. return a2 === b2;
  19357. }
  19358. var classNameA = toString.call(a2), classNameB = toString.call(b2);
  19359. if (classNameA !== classNameB) {
  19360. return false;
  19361. }
  19362. switch (classNameA) {
  19363. case "[object RegExp]":
  19364. case "[object String]":
  19365. return "" + a2 === "" + b2;
  19366. case "[object Number]":
  19367. if (+a2 !== +a2) {
  19368. return +b2 !== +b2;
  19369. }
  19370. return +a2 === 0 ? 1 / +a2 === 1 / b2 : +a2 === +b2;
  19371. case "[object Date]":
  19372. case "[object Boolean]":
  19373. return +a2 === +b2;
  19374. }
  19375. if (classNameA == "[object Object]") {
  19376. var propsA = Object.getOwnPropertyNames(a2), propsB = Object.getOwnPropertyNames(b2);
  19377. if (propsA.length != propsB.length) {
  19378. return false;
  19379. }
  19380. for (var i2 = 0; i2 < propsA.length; i2++) {
  19381. var propName = propsA[i2];
  19382. if (a2[propName] !== b2[propName]) {
  19383. return false;
  19384. }
  19385. }
  19386. return true;
  19387. }
  19388. if (classNameA == "[object Array]") {
  19389. if (a2.toString() == b2.toString()) {
  19390. return true;
  19391. }
  19392. return false;
  19393. }
  19394. };
  19395. const _sfc_main$r = {
  19396. name: "uniForms",
  19397. emits: ["validate", "submit"],
  19398. options: {
  19399. virtualHost: true
  19400. },
  19401. props: {
  19402. // 即将弃用
  19403. value: {
  19404. type: Object,
  19405. default() {
  19406. return null;
  19407. }
  19408. },
  19409. // vue3 替换 value 属性
  19410. modelValue: {
  19411. type: Object,
  19412. default() {
  19413. return null;
  19414. }
  19415. },
  19416. // 1.4.0 开始将不支持 v-model ,且废弃 value 和 modelValue
  19417. model: {
  19418. type: Object,
  19419. default() {
  19420. return null;
  19421. }
  19422. },
  19423. // 表单校验规则
  19424. rules: {
  19425. type: Object,
  19426. default() {
  19427. return {};
  19428. }
  19429. },
  19430. //校验错误信息提示方式 默认 undertext 取值 [undertext|toast|modal]
  19431. errShowType: {
  19432. type: String,
  19433. default: "undertext"
  19434. },
  19435. // 校验触发器方式 默认 bind 取值 [bind|submit]
  19436. validateTrigger: {
  19437. type: String,
  19438. default: "submit"
  19439. },
  19440. // label 位置,默认 left 取值 top/left
  19441. labelPosition: {
  19442. type: String,
  19443. default: "left"
  19444. },
  19445. // label 宽度
  19446. labelWidth: {
  19447. type: [String, Number],
  19448. default: ""
  19449. },
  19450. // label 居中方式,默认 left 取值 left/center/right
  19451. labelAlign: {
  19452. type: String,
  19453. default: "left"
  19454. },
  19455. border: {
  19456. type: Boolean,
  19457. default: false
  19458. }
  19459. },
  19460. provide() {
  19461. return {
  19462. uniForm: this
  19463. };
  19464. },
  19465. data() {
  19466. return {
  19467. // 表单本地值的记录,不应该与传如的值进行关联
  19468. formData: {},
  19469. formRules: {}
  19470. };
  19471. },
  19472. computed: {
  19473. // 计算数据源变化的
  19474. localData() {
  19475. const localVal = this.model || this.modelValue || this.value;
  19476. if (localVal) {
  19477. return deepCopy(localVal);
  19478. }
  19479. return {};
  19480. }
  19481. },
  19482. watch: {
  19483. // 监听数据变化 ,暂时不使用,需要单独赋值
  19484. // localData: {},
  19485. // 监听规则变化
  19486. rules: {
  19487. handler: function(val, oldVal) {
  19488. this.setRules(val);
  19489. },
  19490. deep: true,
  19491. immediate: true
  19492. }
  19493. },
  19494. created() {
  19495. let getbinddata = getApp().$vm.$.appContext.config.globalProperties.binddata;
  19496. if (!getbinddata) {
  19497. getApp().$vm.$.appContext.config.globalProperties.binddata = function(name, value, formName) {
  19498. if (formName) {
  19499. this.$refs[formName].setValue(name, value);
  19500. } else {
  19501. let formVm;
  19502. for (let i2 in this.$refs) {
  19503. const vm = this.$refs[i2];
  19504. if (vm && vm.$options && vm.$options.name === "uniForms") {
  19505. formVm = vm;
  19506. break;
  19507. }
  19508. }
  19509. if (!formVm)
  19510. return formatAppLog("error", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182", "当前 uni-froms 组件缺少 ref 属性");
  19511. formVm.setValue(name, value);
  19512. }
  19513. };
  19514. }
  19515. this.childrens = [];
  19516. this.inputChildrens = [];
  19517. this.setRules(this.rules);
  19518. },
  19519. methods: {
  19520. /**
  19521. * 外部调用方法
  19522. * 设置规则 ,主要用于小程序自定义检验规则
  19523. * @param {Array} rules 规则源数据
  19524. */
  19525. setRules(rules) {
  19526. this.formRules = Object.assign({}, this.formRules, rules);
  19527. this.validator = new SchemaValidator(rules);
  19528. },
  19529. /**
  19530. * 外部调用方法
  19531. * 设置数据,用于设置表单数据,公开给用户使用 , 不支持在动态表单中使用
  19532. * @param {Object} key
  19533. * @param {Object} value
  19534. */
  19535. setValue(key, value) {
  19536. let example = this.childrens.find((child) => child.name === key);
  19537. if (!example)
  19538. return null;
  19539. this.formData[key] = getValue(key, value, this.formRules[key] && this.formRules[key].rules || []);
  19540. return example.onFieldChange(this.formData[key]);
  19541. },
  19542. /**
  19543. * 外部调用方法
  19544. * 手动提交校验表单
  19545. * 对整个表单进行校验的方法,参数为一个回调函数。
  19546. * @param {Array} keepitem 保留不参与校验的字段
  19547. * @param {type} callback 方法回调
  19548. */
  19549. validate(keepitem, callback) {
  19550. return this.checkAll(this.formData, keepitem, callback);
  19551. },
  19552. /**
  19553. * 外部调用方法
  19554. * 部分表单校验
  19555. * @param {Array|String} props 需要校验的字段
  19556. * @param {Function} 回调函数
  19557. */
  19558. validateField(props = [], callback) {
  19559. props = [].concat(props);
  19560. let invalidFields = {};
  19561. this.childrens.forEach((item) => {
  19562. const name = realName(item.name);
  19563. if (props.indexOf(name) !== -1) {
  19564. invalidFields = Object.assign({}, invalidFields, {
  19565. [name]: this.formData[name]
  19566. });
  19567. }
  19568. });
  19569. return this.checkAll(invalidFields, [], callback);
  19570. },
  19571. /**
  19572. * 外部调用方法
  19573. * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
  19574. * @param {Array|String} props 需要移除校验的字段 ,不填为所有
  19575. */
  19576. clearValidate(props = []) {
  19577. props = [].concat(props);
  19578. this.childrens.forEach((item) => {
  19579. if (props.length === 0) {
  19580. item.errMsg = "";
  19581. } else {
  19582. const name = realName(item.name);
  19583. if (props.indexOf(name) !== -1) {
  19584. item.errMsg = "";
  19585. }
  19586. }
  19587. });
  19588. },
  19589. /**
  19590. * 外部调用方法 ,即将废弃
  19591. * 手动提交校验表单
  19592. * 对整个表单进行校验的方法,参数为一个回调函数。
  19593. * @param {Array} keepitem 保留不参与校验的字段
  19594. * @param {type} callback 方法回调
  19595. */
  19596. submit(keepitem, callback, type) {
  19597. for (let i2 in this.dataValue) {
  19598. const itemData = this.childrens.find((v2) => v2.name === i2);
  19599. if (itemData) {
  19600. if (this.formData[i2] === void 0) {
  19601. this.formData[i2] = this._getValue(i2, this.dataValue[i2]);
  19602. }
  19603. }
  19604. }
  19605. if (!type) {
  19606. formatAppLog("warn", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289", "submit 方法即将废弃,请使用validate方法代替!");
  19607. }
  19608. return this.checkAll(this.formData, keepitem, callback, "submit");
  19609. },
  19610. // 校验所有
  19611. async checkAll(invalidFields, keepitem, callback, type) {
  19612. if (!this.validator)
  19613. return;
  19614. let childrens = [];
  19615. for (let i2 in invalidFields) {
  19616. const item = this.childrens.find((v2) => realName(v2.name) === i2);
  19617. if (item) {
  19618. childrens.push(item);
  19619. }
  19620. }
  19621. if (!callback && typeof keepitem === "function") {
  19622. callback = keepitem;
  19623. }
  19624. let promise;
  19625. if (!callback && typeof callback !== "function" && Promise) {
  19626. promise = new Promise((resolve, reject) => {
  19627. callback = function(valid, invalidFields2) {
  19628. !valid ? resolve(invalidFields2) : reject(valid);
  19629. };
  19630. });
  19631. }
  19632. let results = [];
  19633. let tempFormData = JSON.parse(JSON.stringify(invalidFields));
  19634. for (let i2 in childrens) {
  19635. const child = childrens[i2];
  19636. let name = realName(child.name);
  19637. const result = await child.onFieldChange(tempFormData[name]);
  19638. if (result) {
  19639. results.push(result);
  19640. if (this.errShowType === "toast" || this.errShowType === "modal")
  19641. break;
  19642. }
  19643. }
  19644. if (Array.isArray(results)) {
  19645. if (results.length === 0)
  19646. results = null;
  19647. }
  19648. if (Array.isArray(keepitem)) {
  19649. keepitem.forEach((v2) => {
  19650. let vName = realName(v2);
  19651. let value = getDataValue(v2, this.localData);
  19652. if (value !== void 0) {
  19653. tempFormData[vName] = value;
  19654. }
  19655. });
  19656. }
  19657. if (type === "submit") {
  19658. this.$emit("submit", {
  19659. detail: {
  19660. value: tempFormData,
  19661. errors: results
  19662. }
  19663. });
  19664. } else {
  19665. this.$emit("validate", results);
  19666. }
  19667. let resetFormData = {};
  19668. resetFormData = rawData(tempFormData, this.name);
  19669. callback && typeof callback === "function" && callback(results, resetFormData);
  19670. if (promise && callback) {
  19671. return promise;
  19672. } else {
  19673. return null;
  19674. }
  19675. },
  19676. /**
  19677. * 返回validate事件
  19678. * @param {Object} result
  19679. */
  19680. validateCheck(result) {
  19681. this.$emit("validate", result);
  19682. },
  19683. _getValue: getValue,
  19684. _isRequiredField: isRequiredField,
  19685. _setDataValue: setDataValue,
  19686. _getDataValue: getDataValue,
  19687. _realName: realName,
  19688. _isRealName: isRealName,
  19689. _isEqual: isEqual
  19690. }
  19691. };
  19692. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  19693. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-forms" }, [
  19694. vue.createElementVNode("form", null, [
  19695. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  19696. ])
  19697. ]);
  19698. }
  19699. const __easycom_3$2 = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-9a1e3c32"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-forms/components/uni-forms/uni-forms.vue"]]);
  19700. const popup = {
  19701. data() {
  19702. return {};
  19703. },
  19704. created() {
  19705. this.popup = this.getParent();
  19706. },
  19707. methods: {
  19708. /**
  19709. * 获取父元素实例
  19710. */
  19711. getParent(name = "uniPopup") {
  19712. let parent = this.$parent;
  19713. let parentName = parent.$options.name;
  19714. while (parentName !== name) {
  19715. parent = parent.$parent;
  19716. if (!parent)
  19717. return false;
  19718. parentName = parent.$options.name;
  19719. }
  19720. return parent;
  19721. }
  19722. }
  19723. };
  19724. const _sfc_main$q = {
  19725. name: "uniPopupMessage",
  19726. mixins: [popup],
  19727. props: {
  19728. /**
  19729. * 主题 success/warning/info/error 默认 success
  19730. */
  19731. type: {
  19732. type: String,
  19733. default: "success"
  19734. },
  19735. /**
  19736. * 消息文字
  19737. */
  19738. message: {
  19739. type: String,
  19740. default: ""
  19741. },
  19742. /**
  19743. * 显示时间,设置为 0 则不会自动关闭
  19744. */
  19745. duration: {
  19746. type: Number,
  19747. default: 3e3
  19748. },
  19749. maskShow: {
  19750. type: Boolean,
  19751. default: false
  19752. }
  19753. },
  19754. data() {
  19755. return {};
  19756. },
  19757. created() {
  19758. this.popup.maskShow = this.maskShow;
  19759. this.popup.messageChild = this;
  19760. },
  19761. methods: {
  19762. timerClose() {
  19763. if (this.duration === 0)
  19764. return;
  19765. clearTimeout(this.timer);
  19766. this.timer = setTimeout(() => {
  19767. this.popup.close();
  19768. }, this.duration);
  19769. }
  19770. }
  19771. };
  19772. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  19773. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-message" }, [
  19774. vue.createElementVNode(
  19775. "view",
  19776. {
  19777. class: vue.normalizeClass(["uni-popup-message__box fixforpc-width", "uni-popup__" + $props.type])
  19778. },
  19779. [
  19780. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  19781. vue.createElementVNode(
  19782. "text",
  19783. {
  19784. class: vue.normalizeClass(["uni-popup-message-text", "uni-popup__" + $props.type + "-text"])
  19785. },
  19786. vue.toDisplayString($props.message),
  19787. 3
  19788. /* TEXT, CLASS */
  19789. )
  19790. ], true)
  19791. ],
  19792. 2
  19793. /* CLASS */
  19794. )
  19795. ]);
  19796. }
  19797. const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-a4566996"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue"]]);
  19798. class MPAnimation {
  19799. constructor(options, _this) {
  19800. this.options = options;
  19801. this.animation = uni.createAnimation({
  19802. ...options
  19803. });
  19804. this.currentStepAnimates = {};
  19805. this.next = 0;
  19806. this.$ = _this;
  19807. }
  19808. _nvuePushAnimates(type, args) {
  19809. let aniObj = this.currentStepAnimates[this.next];
  19810. let styles = {};
  19811. if (!aniObj) {
  19812. styles = {
  19813. styles: {},
  19814. config: {}
  19815. };
  19816. } else {
  19817. styles = aniObj;
  19818. }
  19819. if (animateTypes1.includes(type)) {
  19820. if (!styles.styles.transform) {
  19821. styles.styles.transform = "";
  19822. }
  19823. let unit = "";
  19824. if (type === "rotate") {
  19825. unit = "deg";
  19826. }
  19827. styles.styles.transform += `${type}(${args + unit}) `;
  19828. } else {
  19829. styles.styles[type] = `${args}`;
  19830. }
  19831. this.currentStepAnimates[this.next] = styles;
  19832. }
  19833. _animateRun(styles = {}, config = {}) {
  19834. let ref = this.$.$refs["ani"].ref;
  19835. if (!ref)
  19836. return;
  19837. return new Promise((resolve, reject) => {
  19838. nvueAnimation.transition(ref, {
  19839. styles,
  19840. ...config
  19841. }, (res) => {
  19842. resolve();
  19843. });
  19844. });
  19845. }
  19846. _nvueNextAnimate(animates, step = 0, fn) {
  19847. let obj = animates[step];
  19848. if (obj) {
  19849. let {
  19850. styles,
  19851. config
  19852. } = obj;
  19853. this._animateRun(styles, config).then(() => {
  19854. step += 1;
  19855. this._nvueNextAnimate(animates, step, fn);
  19856. });
  19857. } else {
  19858. this.currentStepAnimates = {};
  19859. typeof fn === "function" && fn();
  19860. this.isEnd = true;
  19861. }
  19862. }
  19863. step(config = {}) {
  19864. this.animation.step(config);
  19865. return this;
  19866. }
  19867. run(fn) {
  19868. this.$.animationData = this.animation.export();
  19869. this.$.timer = setTimeout(() => {
  19870. typeof fn === "function" && fn();
  19871. }, this.$.durationTime);
  19872. }
  19873. }
  19874. const animateTypes1 = [
  19875. "matrix",
  19876. "matrix3d",
  19877. "rotate",
  19878. "rotate3d",
  19879. "rotateX",
  19880. "rotateY",
  19881. "rotateZ",
  19882. "scale",
  19883. "scale3d",
  19884. "scaleX",
  19885. "scaleY",
  19886. "scaleZ",
  19887. "skew",
  19888. "skewX",
  19889. "skewY",
  19890. "translate",
  19891. "translate3d",
  19892. "translateX",
  19893. "translateY",
  19894. "translateZ"
  19895. ];
  19896. const animateTypes2 = ["opacity", "backgroundColor"];
  19897. const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
  19898. animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
  19899. MPAnimation.prototype[type] = function(...args) {
  19900. this.animation[type](...args);
  19901. return this;
  19902. };
  19903. });
  19904. function createAnimation(option, _this) {
  19905. if (!_this)
  19906. return;
  19907. clearTimeout(_this.timer);
  19908. return new MPAnimation(option, _this);
  19909. }
  19910. const _sfc_main$p = {
  19911. name: "uniTransition",
  19912. emits: ["click", "change"],
  19913. props: {
  19914. show: {
  19915. type: Boolean,
  19916. default: false
  19917. },
  19918. modeClass: {
  19919. type: [Array, String],
  19920. default() {
  19921. return "fade";
  19922. }
  19923. },
  19924. duration: {
  19925. type: Number,
  19926. default: 300
  19927. },
  19928. styles: {
  19929. type: Object,
  19930. default() {
  19931. return {};
  19932. }
  19933. },
  19934. customClass: {
  19935. type: String,
  19936. default: ""
  19937. },
  19938. onceRender: {
  19939. type: Boolean,
  19940. default: false
  19941. }
  19942. },
  19943. data() {
  19944. return {
  19945. isShow: false,
  19946. transform: "",
  19947. opacity: 1,
  19948. animationData: {},
  19949. durationTime: 300,
  19950. config: {}
  19951. };
  19952. },
  19953. watch: {
  19954. show: {
  19955. handler(newVal) {
  19956. if (newVal) {
  19957. this.open();
  19958. } else {
  19959. if (this.isShow) {
  19960. this.close();
  19961. }
  19962. }
  19963. },
  19964. immediate: true
  19965. }
  19966. },
  19967. computed: {
  19968. // 生成样式数据
  19969. stylesObject() {
  19970. let styles = {
  19971. ...this.styles,
  19972. "transition-duration": this.duration / 1e3 + "s"
  19973. };
  19974. let transform = "";
  19975. for (let i2 in styles) {
  19976. let line = this.toLine(i2);
  19977. transform += line + ":" + styles[i2] + ";";
  19978. }
  19979. return transform;
  19980. },
  19981. // 初始化动画条件
  19982. transformStyles() {
  19983. return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
  19984. }
  19985. },
  19986. created() {
  19987. this.config = {
  19988. duration: this.duration,
  19989. timingFunction: "ease",
  19990. transformOrigin: "50% 50%",
  19991. delay: 0
  19992. };
  19993. this.durationTime = this.duration;
  19994. },
  19995. methods: {
  19996. /**
  19997. * ref 触发 初始化动画
  19998. */
  19999. init(obj = {}) {
  20000. if (obj.duration) {
  20001. this.durationTime = obj.duration;
  20002. }
  20003. this.animation = createAnimation(Object.assign(this.config, obj), this);
  20004. },
  20005. /**
  20006. * 点击组件触发回调
  20007. */
  20008. onClick() {
  20009. this.$emit("click", {
  20010. detail: this.isShow
  20011. });
  20012. },
  20013. /**
  20014. * ref 触发 动画分组
  20015. * @param {Object} obj
  20016. */
  20017. step(obj, config = {}) {
  20018. if (!this.animation)
  20019. return;
  20020. for (let i2 in obj) {
  20021. try {
  20022. if (typeof obj[i2] === "object") {
  20023. this.animation[i2](...obj[i2]);
  20024. } else {
  20025. this.animation[i2](obj[i2]);
  20026. }
  20027. } catch (e2) {
  20028. formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148", `方法 ${i2} 不存在`);
  20029. }
  20030. }
  20031. this.animation.step(config);
  20032. return this;
  20033. },
  20034. /**
  20035. * ref 触发 执行动画
  20036. */
  20037. run(fn) {
  20038. if (!this.animation)
  20039. return;
  20040. this.animation.run(fn);
  20041. },
  20042. // 开始过度动画
  20043. open() {
  20044. clearTimeout(this.timer);
  20045. this.transform = "";
  20046. this.isShow = true;
  20047. let { opacity, transform } = this.styleInit(false);
  20048. if (typeof opacity !== "undefined") {
  20049. this.opacity = opacity;
  20050. }
  20051. this.transform = transform;
  20052. this.$nextTick(() => {
  20053. this.timer = setTimeout(() => {
  20054. this.animation = createAnimation(this.config, this);
  20055. this.tranfromInit(false).step();
  20056. this.animation.run();
  20057. this.$emit("change", {
  20058. detail: this.isShow
  20059. });
  20060. }, 20);
  20061. });
  20062. },
  20063. // 关闭过度动画
  20064. close(type) {
  20065. if (!this.animation)
  20066. return;
  20067. this.tranfromInit(true).step().run(() => {
  20068. this.isShow = false;
  20069. this.animationData = null;
  20070. this.animation = null;
  20071. let { opacity, transform } = this.styleInit(false);
  20072. this.opacity = opacity || 1;
  20073. this.transform = transform;
  20074. this.$emit("change", {
  20075. detail: this.isShow
  20076. });
  20077. });
  20078. },
  20079. // 处理动画开始前的默认样式
  20080. styleInit(type) {
  20081. let styles = {
  20082. transform: ""
  20083. };
  20084. let buildStyle = (type2, mode) => {
  20085. if (mode === "fade") {
  20086. styles.opacity = this.animationType(type2)[mode];
  20087. } else {
  20088. styles.transform += this.animationType(type2)[mode] + " ";
  20089. }
  20090. };
  20091. if (typeof this.modeClass === "string") {
  20092. buildStyle(type, this.modeClass);
  20093. } else {
  20094. this.modeClass.forEach((mode) => {
  20095. buildStyle(type, mode);
  20096. });
  20097. }
  20098. return styles;
  20099. },
  20100. // 处理内置组合动画
  20101. tranfromInit(type) {
  20102. let buildTranfrom = (type2, mode) => {
  20103. let aniNum = null;
  20104. if (mode === "fade") {
  20105. aniNum = type2 ? 0 : 1;
  20106. } else {
  20107. aniNum = type2 ? "-100%" : "0";
  20108. if (mode === "zoom-in") {
  20109. aniNum = type2 ? 0.8 : 1;
  20110. }
  20111. if (mode === "zoom-out") {
  20112. aniNum = type2 ? 1.2 : 1;
  20113. }
  20114. if (mode === "slide-right") {
  20115. aniNum = type2 ? "100%" : "0";
  20116. }
  20117. if (mode === "slide-bottom") {
  20118. aniNum = type2 ? "100%" : "0";
  20119. }
  20120. }
  20121. this.animation[this.animationMode()[mode]](aniNum);
  20122. };
  20123. if (typeof this.modeClass === "string") {
  20124. buildTranfrom(type, this.modeClass);
  20125. } else {
  20126. this.modeClass.forEach((mode) => {
  20127. buildTranfrom(type, mode);
  20128. });
  20129. }
  20130. return this.animation;
  20131. },
  20132. animationType(type) {
  20133. return {
  20134. fade: type ? 1 : 0,
  20135. "slide-top": `translateY(${type ? "0" : "-100%"})`,
  20136. "slide-right": `translateX(${type ? "0" : "100%"})`,
  20137. "slide-bottom": `translateY(${type ? "0" : "100%"})`,
  20138. "slide-left": `translateX(${type ? "0" : "-100%"})`,
  20139. "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
  20140. "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
  20141. };
  20142. },
  20143. // 内置动画类型与实际动画对应字典
  20144. animationMode() {
  20145. return {
  20146. fade: "opacity",
  20147. "slide-top": "translateY",
  20148. "slide-right": "translateX",
  20149. "slide-bottom": "translateY",
  20150. "slide-left": "translateX",
  20151. "zoom-in": "scale",
  20152. "zoom-out": "scale"
  20153. };
  20154. },
  20155. // 驼峰转中横线
  20156. toLine(name) {
  20157. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  20158. }
  20159. }
  20160. };
  20161. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  20162. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
  20163. ref: "ani",
  20164. animation: $data.animationData,
  20165. class: vue.normalizeClass($props.customClass),
  20166. style: vue.normalizeStyle($options.transformStyles),
  20167. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  20168. }, [
  20169. vue.renderSlot(_ctx.$slots, "default")
  20170. ], 14, ["animation"])), [
  20171. [vue.vShow, $data.isShow]
  20172. ]);
  20173. }
  20174. const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]);
  20175. const _sfc_main$o = {
  20176. name: "uniPopup",
  20177. components: {},
  20178. emits: ["change", "maskClick"],
  20179. props: {
  20180. // 开启动画
  20181. animation: {
  20182. type: Boolean,
  20183. default: true
  20184. },
  20185. // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
  20186. // message: 消息提示 ; dialog : 对话框
  20187. type: {
  20188. type: String,
  20189. default: "center"
  20190. },
  20191. // maskClick
  20192. isMaskClick: {
  20193. type: Boolean,
  20194. default: null
  20195. },
  20196. // TODO 2 个版本后废弃属性 ,使用 isMaskClick
  20197. maskClick: {
  20198. type: Boolean,
  20199. default: null
  20200. },
  20201. backgroundColor: {
  20202. type: String,
  20203. default: "none"
  20204. },
  20205. safeArea: {
  20206. type: Boolean,
  20207. default: true
  20208. },
  20209. maskBackgroundColor: {
  20210. type: String,
  20211. default: "rgba(0, 0, 0, 0.4)"
  20212. }
  20213. },
  20214. watch: {
  20215. /**
  20216. * 监听type类型
  20217. */
  20218. type: {
  20219. handler: function(type) {
  20220. if (!this.config[type])
  20221. return;
  20222. this[this.config[type]](true);
  20223. },
  20224. immediate: true
  20225. },
  20226. isDesktop: {
  20227. handler: function(newVal) {
  20228. if (!this.config[newVal])
  20229. return;
  20230. this[this.config[this.type]](true);
  20231. },
  20232. immediate: true
  20233. },
  20234. /**
  20235. * 监听遮罩是否可点击
  20236. * @param {Object} val
  20237. */
  20238. maskClick: {
  20239. handler: function(val) {
  20240. this.mkclick = val;
  20241. },
  20242. immediate: true
  20243. },
  20244. isMaskClick: {
  20245. handler: function(val) {
  20246. this.mkclick = val;
  20247. },
  20248. immediate: true
  20249. },
  20250. // H5 下禁止底部滚动
  20251. showPopup(show) {
  20252. }
  20253. },
  20254. data() {
  20255. return {
  20256. duration: 300,
  20257. ani: [],
  20258. showPopup: false,
  20259. showTrans: false,
  20260. popupWidth: 0,
  20261. popupHeight: 0,
  20262. config: {
  20263. top: "top",
  20264. bottom: "bottom",
  20265. center: "center",
  20266. left: "left",
  20267. right: "right",
  20268. message: "top",
  20269. dialog: "center",
  20270. share: "bottom"
  20271. },
  20272. maskClass: {
  20273. position: "fixed",
  20274. bottom: 0,
  20275. top: 0,
  20276. left: 0,
  20277. right: 0,
  20278. backgroundColor: "rgba(0, 0, 0, 0.4)"
  20279. },
  20280. transClass: {
  20281. position: "fixed",
  20282. left: 0,
  20283. right: 0
  20284. },
  20285. maskShow: true,
  20286. mkclick: true,
  20287. popupstyle: "top"
  20288. };
  20289. },
  20290. computed: {
  20291. isDesktop() {
  20292. return this.popupWidth >= 500 && this.popupHeight >= 500;
  20293. },
  20294. bg() {
  20295. if (this.backgroundColor === "" || this.backgroundColor === "none") {
  20296. return "transparent";
  20297. }
  20298. return this.backgroundColor;
  20299. }
  20300. },
  20301. mounted() {
  20302. const fixSize = () => {
  20303. const {
  20304. windowWidth,
  20305. windowHeight,
  20306. windowTop,
  20307. safeArea,
  20308. screenHeight,
  20309. safeAreaInsets
  20310. } = uni.getSystemInfoSync();
  20311. this.popupWidth = windowWidth;
  20312. this.popupHeight = windowHeight + (windowTop || 0);
  20313. if (safeArea && this.safeArea) {
  20314. this.safeAreaInsets = safeAreaInsets.bottom;
  20315. } else {
  20316. this.safeAreaInsets = 0;
  20317. }
  20318. };
  20319. fixSize();
  20320. },
  20321. // TODO vue3
  20322. unmounted() {
  20323. this.setH5Visible();
  20324. },
  20325. created() {
  20326. if (this.isMaskClick === null && this.maskClick === null) {
  20327. this.mkclick = true;
  20328. } else {
  20329. this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
  20330. }
  20331. if (this.animation) {
  20332. this.duration = 300;
  20333. } else {
  20334. this.duration = 0;
  20335. }
  20336. this.messageChild = null;
  20337. this.clearPropagation = false;
  20338. this.maskClass.backgroundColor = this.maskBackgroundColor;
  20339. },
  20340. methods: {
  20341. setH5Visible() {
  20342. },
  20343. /**
  20344. * 公用方法,不显示遮罩层
  20345. */
  20346. closeMask() {
  20347. this.maskShow = false;
  20348. },
  20349. /**
  20350. * 公用方法,遮罩层禁止点击
  20351. */
  20352. disableMask() {
  20353. this.mkclick = false;
  20354. },
  20355. // TODO nvue 取消冒泡
  20356. clear(e2) {
  20357. e2.stopPropagation();
  20358. this.clearPropagation = true;
  20359. },
  20360. open(direction) {
  20361. if (this.showPopup) {
  20362. return;
  20363. }
  20364. let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
  20365. if (!(direction && innerType.indexOf(direction) !== -1)) {
  20366. direction = this.type;
  20367. }
  20368. if (!this.config[direction]) {
  20369. formatAppLog("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:279", "缺少类型:", direction);
  20370. return;
  20371. }
  20372. this[this.config[direction]]();
  20373. this.$emit("change", {
  20374. show: true,
  20375. type: direction
  20376. });
  20377. },
  20378. close(type) {
  20379. this.showTrans = false;
  20380. this.$emit("change", {
  20381. show: false,
  20382. type: this.type
  20383. });
  20384. clearTimeout(this.timer);
  20385. this.timer = setTimeout(() => {
  20386. this.showPopup = false;
  20387. }, 300);
  20388. },
  20389. // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
  20390. touchstart() {
  20391. this.clearPropagation = false;
  20392. },
  20393. onTap() {
  20394. if (this.clearPropagation) {
  20395. this.clearPropagation = false;
  20396. return;
  20397. }
  20398. this.$emit("maskClick");
  20399. if (!this.mkclick)
  20400. return;
  20401. this.close();
  20402. },
  20403. /**
  20404. * 顶部弹出样式处理
  20405. */
  20406. top(type) {
  20407. this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
  20408. this.ani = ["slide-top"];
  20409. this.transClass = {
  20410. position: "fixed",
  20411. left: 0,
  20412. right: 0,
  20413. backgroundColor: this.bg
  20414. };
  20415. if (type)
  20416. return;
  20417. this.showPopup = true;
  20418. this.showTrans = true;
  20419. this.$nextTick(() => {
  20420. if (this.messageChild && this.type === "message") {
  20421. this.messageChild.timerClose();
  20422. }
  20423. });
  20424. },
  20425. /**
  20426. * 底部弹出样式处理
  20427. */
  20428. bottom(type) {
  20429. this.popupstyle = "bottom";
  20430. this.ani = ["slide-bottom"];
  20431. this.transClass = {
  20432. position: "fixed",
  20433. left: 0,
  20434. right: 0,
  20435. bottom: 0,
  20436. paddingBottom: this.safeAreaInsets + "px",
  20437. backgroundColor: this.bg
  20438. };
  20439. if (type)
  20440. return;
  20441. this.showPopup = true;
  20442. this.showTrans = true;
  20443. },
  20444. /**
  20445. * 中间弹出样式处理
  20446. */
  20447. center(type) {
  20448. this.popupstyle = "center";
  20449. this.ani = ["zoom-out", "fade"];
  20450. this.transClass = {
  20451. position: "fixed",
  20452. display: "flex",
  20453. flexDirection: "column",
  20454. bottom: 0,
  20455. left: 0,
  20456. right: 0,
  20457. top: 0,
  20458. justifyContent: "center",
  20459. alignItems: "center"
  20460. };
  20461. if (type)
  20462. return;
  20463. this.showPopup = true;
  20464. this.showTrans = true;
  20465. },
  20466. left(type) {
  20467. this.popupstyle = "left";
  20468. this.ani = ["slide-left"];
  20469. this.transClass = {
  20470. position: "fixed",
  20471. left: 0,
  20472. bottom: 0,
  20473. top: 0,
  20474. backgroundColor: this.bg,
  20475. display: "flex",
  20476. flexDirection: "column"
  20477. };
  20478. if (type)
  20479. return;
  20480. this.showPopup = true;
  20481. this.showTrans = true;
  20482. },
  20483. right(type) {
  20484. this.popupstyle = "right";
  20485. this.ani = ["slide-right"];
  20486. this.transClass = {
  20487. position: "fixed",
  20488. bottom: 0,
  20489. right: 0,
  20490. top: 0,
  20491. backgroundColor: this.bg,
  20492. display: "flex",
  20493. flexDirection: "column"
  20494. };
  20495. if (type)
  20496. return;
  20497. this.showPopup = true;
  20498. this.showTrans = true;
  20499. }
  20500. }
  20501. };
  20502. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  20503. const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$3);
  20504. return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
  20505. "view",
  20506. {
  20507. key: 0,
  20508. class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]])
  20509. },
  20510. [
  20511. vue.createElementVNode(
  20512. "view",
  20513. {
  20514. onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
  20515. },
  20516. [
  20517. $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, {
  20518. key: "1",
  20519. name: "mask",
  20520. "mode-class": "fade",
  20521. styles: $data.maskClass,
  20522. duration: $data.duration,
  20523. show: $data.showTrans,
  20524. onClick: $options.onTap
  20525. }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true),
  20526. vue.createVNode(_component_uni_transition, {
  20527. key: "2",
  20528. "mode-class": $data.ani,
  20529. name: "content",
  20530. styles: $data.transClass,
  20531. duration: $data.duration,
  20532. show: $data.showTrans,
  20533. onClick: $options.onTap
  20534. }, {
  20535. default: vue.withCtx(() => [
  20536. vue.createElementVNode(
  20537. "view",
  20538. {
  20539. class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]),
  20540. style: vue.normalizeStyle({ backgroundColor: $options.bg }),
  20541. onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
  20542. },
  20543. [
  20544. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  20545. ],
  20546. 6
  20547. /* CLASS, STYLE */
  20548. )
  20549. ]),
  20550. _: 3
  20551. /* FORWARDED */
  20552. }, 8, ["mode-class", "styles", "duration", "show", "onClick"])
  20553. ],
  20554. 32
  20555. /* NEED_HYDRATION */
  20556. )
  20557. ],
  20558. 2
  20559. /* CLASS */
  20560. )) : vue.createCommentVNode("v-if", true);
  20561. }
  20562. const __easycom_6 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-4dd3c44b"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]);
  20563. const en = {
  20564. "uni-popup.cancel": "cancel",
  20565. "uni-popup.ok": "ok",
  20566. "uni-popup.placeholder": "pleace enter",
  20567. "uni-popup.title": "Hint",
  20568. "uni-popup.shareTitle": "Share to"
  20569. };
  20570. const zhHans = {
  20571. "uni-popup.cancel": "取消",
  20572. "uni-popup.ok": "确定",
  20573. "uni-popup.placeholder": "请输入",
  20574. "uni-popup.title": "提示",
  20575. "uni-popup.shareTitle": "分享到"
  20576. };
  20577. const zhHant = {
  20578. "uni-popup.cancel": "取消",
  20579. "uni-popup.ok": "確定",
  20580. "uni-popup.placeholder": "請輸入",
  20581. "uni-popup.title": "提示",
  20582. "uni-popup.shareTitle": "分享到"
  20583. };
  20584. const messages = {
  20585. en,
  20586. "zh-Hans": zhHans,
  20587. "zh-Hant": zhHant
  20588. };
  20589. const { t } = initVueI18n(messages);
  20590. const _sfc_main$n = {
  20591. name: "uniPopupDialog",
  20592. mixins: [popup],
  20593. emits: ["confirm", "close"],
  20594. props: {
  20595. inputType: {
  20596. type: String,
  20597. default: "text"
  20598. },
  20599. value: {
  20600. type: [String, Number],
  20601. default: ""
  20602. },
  20603. placeholder: {
  20604. type: [String, Number],
  20605. default: ""
  20606. },
  20607. type: {
  20608. type: String,
  20609. default: "error"
  20610. },
  20611. mode: {
  20612. type: String,
  20613. default: "base"
  20614. },
  20615. title: {
  20616. type: String,
  20617. default: ""
  20618. },
  20619. content: {
  20620. type: String,
  20621. default: ""
  20622. },
  20623. beforeClose: {
  20624. type: Boolean,
  20625. default: false
  20626. },
  20627. cancelText: {
  20628. type: String,
  20629. default: ""
  20630. },
  20631. confirmText: {
  20632. type: String,
  20633. default: ""
  20634. }
  20635. },
  20636. data() {
  20637. return {
  20638. dialogType: "error",
  20639. focus: false,
  20640. val: ""
  20641. };
  20642. },
  20643. computed: {
  20644. okText() {
  20645. return this.confirmText || t("uni-popup.ok");
  20646. },
  20647. closeText() {
  20648. return this.cancelText || t("uni-popup.cancel");
  20649. },
  20650. placeholderText() {
  20651. return this.placeholder || t("uni-popup.placeholder");
  20652. },
  20653. titleText() {
  20654. return this.title || t("uni-popup.title");
  20655. }
  20656. },
  20657. watch: {
  20658. type(val) {
  20659. this.dialogType = val;
  20660. },
  20661. mode(val) {
  20662. if (val === "input") {
  20663. this.dialogType = "info";
  20664. }
  20665. },
  20666. value(val) {
  20667. this.val = val;
  20668. }
  20669. },
  20670. created() {
  20671. this.popup.disableMask();
  20672. if (this.mode === "input") {
  20673. this.dialogType = "info";
  20674. this.val = this.value;
  20675. } else {
  20676. this.dialogType = this.type;
  20677. }
  20678. },
  20679. mounted() {
  20680. this.focus = true;
  20681. },
  20682. methods: {
  20683. /**
  20684. * 点击确认按钮
  20685. */
  20686. onOk() {
  20687. if (this.mode === "input") {
  20688. this.$emit("confirm", this.val);
  20689. } else {
  20690. this.$emit("confirm");
  20691. }
  20692. if (this.beforeClose)
  20693. return;
  20694. this.popup.close();
  20695. },
  20696. /**
  20697. * 点击取消按钮
  20698. */
  20699. closeDialog() {
  20700. this.$emit("close");
  20701. if (this.beforeClose)
  20702. return;
  20703. this.popup.close();
  20704. },
  20705. close() {
  20706. this.popup.close();
  20707. }
  20708. }
  20709. };
  20710. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  20711. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-dialog" }, [
  20712. vue.createElementVNode("view", { class: "uni-dialog-title" }, [
  20713. vue.createElementVNode(
  20714. "text",
  20715. {
  20716. class: vue.normalizeClass(["uni-dialog-title-text", ["uni-popup__" + $data.dialogType]])
  20717. },
  20718. vue.toDisplayString($options.titleText),
  20719. 3
  20720. /* TEXT, CLASS */
  20721. )
  20722. ]),
  20723. $props.mode === "base" ? (vue.openBlock(), vue.createElementBlock("view", {
  20724. key: 0,
  20725. class: "uni-dialog-content"
  20726. }, [
  20727. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  20728. vue.createElementVNode(
  20729. "text",
  20730. { class: "uni-dialog-content-text" },
  20731. vue.toDisplayString($props.content),
  20732. 1
  20733. /* TEXT */
  20734. )
  20735. ], true)
  20736. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  20737. key: 1,
  20738. class: "uni-dialog-content"
  20739. }, [
  20740. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  20741. vue.withDirectives(vue.createElementVNode("input", {
  20742. class: "uni-dialog-input",
  20743. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.val = $event),
  20744. type: $props.inputType,
  20745. placeholder: $options.placeholderText,
  20746. focus: $data.focus
  20747. }, null, 8, ["type", "placeholder", "focus"]), [
  20748. [vue.vModelDynamic, $data.val]
  20749. ])
  20750. ], true)
  20751. ])),
  20752. vue.createElementVNode("view", { class: "uni-dialog-button-group" }, [
  20753. vue.createElementVNode("view", {
  20754. class: "uni-dialog-button",
  20755. onClick: _cache[1] || (_cache[1] = (...args) => $options.closeDialog && $options.closeDialog(...args))
  20756. }, [
  20757. vue.createElementVNode(
  20758. "text",
  20759. { class: "uni-dialog-button-text" },
  20760. vue.toDisplayString($options.closeText),
  20761. 1
  20762. /* TEXT */
  20763. )
  20764. ]),
  20765. vue.createElementVNode("view", {
  20766. class: "uni-dialog-button uni-border-left",
  20767. onClick: _cache[2] || (_cache[2] = (...args) => $options.onOk && $options.onOk(...args))
  20768. }, [
  20769. vue.createElementVNode(
  20770. "text",
  20771. { class: "uni-dialog-button-text uni-button-color" },
  20772. vue.toDisplayString($options.okText),
  20773. 1
  20774. /* TEXT */
  20775. )
  20776. ])
  20777. ])
  20778. ]);
  20779. }
  20780. const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-d78c88b7"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue"]]);
  20781. var dayjs_min = { exports: {} };
  20782. (function(module, exports) {
  20783. !function(t2, e2) {
  20784. module.exports = e2();
  20785. }(commonjsGlobal, function() {
  20786. var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
  20787. var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
  20788. return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
  20789. } }, m2 = function(t3, e3, n3) {
  20790. var r3 = String(t3);
  20791. return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
  20792. }, v2 = { s: m2, z: function(t3) {
  20793. var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
  20794. return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
  20795. }, m: function t3(e3, n3) {
  20796. if (e3.date() < n3.date())
  20797. return -t3(n3, e3);
  20798. var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2);
  20799. return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
  20800. }, a: function(t3) {
  20801. return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
  20802. }, p: function(t3) {
  20803. return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
  20804. }, u: function(t3) {
  20805. return void 0 === t3;
  20806. } }, g2 = "en", D2 = {};
  20807. D2[g2] = M2;
  20808. var p2 = "$isDayjsObject", S2 = function(t3) {
  20809. return t3 instanceof _2 || !(!t3 || !t3[p2]);
  20810. }, w2 = function t3(e3, n3, r3) {
  20811. var i3;
  20812. if (!e3)
  20813. return g2;
  20814. if ("string" == typeof e3) {
  20815. var s3 = e3.toLowerCase();
  20816. D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
  20817. var u3 = e3.split("-");
  20818. if (!i3 && u3.length > 1)
  20819. return t3(u3[0]);
  20820. } else {
  20821. var a3 = e3.name;
  20822. D2[a3] = e3, i3 = a3;
  20823. }
  20824. return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
  20825. }, O2 = function(t3, e3) {
  20826. if (S2(t3))
  20827. return t3.clone();
  20828. var n3 = "object" == typeof e3 ? e3 : {};
  20829. return n3.date = t3, n3.args = arguments, new _2(n3);
  20830. }, b2 = v2;
  20831. b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
  20832. return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
  20833. };
  20834. var _2 = function() {
  20835. function M3(t3) {
  20836. this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
  20837. }
  20838. var m3 = M3.prototype;
  20839. return m3.parse = function(t3) {
  20840. this.$d = function(t4) {
  20841. var e3 = t4.date, n3 = t4.utc;
  20842. if (null === e3)
  20843. return /* @__PURE__ */ new Date(NaN);
  20844. if (b2.u(e3))
  20845. return /* @__PURE__ */ new Date();
  20846. if (e3 instanceof Date)
  20847. return new Date(e3);
  20848. if ("string" == typeof e3 && !/Z$/i.test(e3)) {
  20849. var r3 = e3.match($2);
  20850. if (r3) {
  20851. var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
  20852. return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
  20853. }
  20854. }
  20855. return new Date(e3);
  20856. }(t3), this.init();
  20857. }, m3.init = function() {
  20858. var t3 = this.$d;
  20859. this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
  20860. }, m3.$utils = function() {
  20861. return b2;
  20862. }, m3.isValid = function() {
  20863. return !(this.$d.toString() === l2);
  20864. }, m3.isSame = function(t3, e3) {
  20865. var n3 = O2(t3);
  20866. return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
  20867. }, m3.isAfter = function(t3, e3) {
  20868. return O2(t3) < this.startOf(e3);
  20869. }, m3.isBefore = function(t3, e3) {
  20870. return this.endOf(e3) < O2(t3);
  20871. }, m3.$g = function(t3, e3, n3) {
  20872. return b2.u(t3) ? this[e3] : this.set(n3, t3);
  20873. }, m3.unix = function() {
  20874. return Math.floor(this.valueOf() / 1e3);
  20875. }, m3.valueOf = function() {
  20876. return this.$d.getTime();
  20877. }, m3.startOf = function(t3, e3) {
  20878. var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
  20879. var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
  20880. return r3 ? i3 : i3.endOf(a2);
  20881. }, $3 = function(t4, e4) {
  20882. return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
  20883. }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
  20884. switch (f3) {
  20885. case h2:
  20886. return r3 ? l3(1, 0) : l3(31, 11);
  20887. case c2:
  20888. return r3 ? l3(1, M4) : l3(0, M4 + 1);
  20889. case o2:
  20890. var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
  20891. return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
  20892. case a2:
  20893. case d2:
  20894. return $3(v3 + "Hours", 0);
  20895. case u2:
  20896. return $3(v3 + "Minutes", 1);
  20897. case s2:
  20898. return $3(v3 + "Seconds", 2);
  20899. case i2:
  20900. return $3(v3 + "Milliseconds", 3);
  20901. default:
  20902. return this.clone();
  20903. }
  20904. }, m3.endOf = function(t3) {
  20905. return this.startOf(t3, false);
  20906. }, m3.$set = function(t3, e3) {
  20907. var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
  20908. if (o3 === c2 || o3 === h2) {
  20909. var y3 = this.clone().set(d2, 1);
  20910. y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
  20911. } else
  20912. l3 && this.$d[l3]($3);
  20913. return this.init(), this;
  20914. }, m3.set = function(t3, e3) {
  20915. return this.clone().$set(t3, e3);
  20916. }, m3.get = function(t3) {
  20917. return this[b2.p(t3)]();
  20918. }, m3.add = function(r3, f3) {
  20919. var d3, l3 = this;
  20920. r3 = Number(r3);
  20921. var $3 = b2.p(f3), y3 = function(t3) {
  20922. var e3 = O2(l3);
  20923. return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
  20924. };
  20925. if ($3 === c2)
  20926. return this.set(c2, this.$M + r3);
  20927. if ($3 === h2)
  20928. return this.set(h2, this.$y + r3);
  20929. if ($3 === a2)
  20930. return y3(1);
  20931. if ($3 === o2)
  20932. return y3(7);
  20933. var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
  20934. return b2.w(m4, this);
  20935. }, m3.subtract = function(t3, e3) {
  20936. return this.add(-1 * t3, e3);
  20937. }, m3.format = function(t3) {
  20938. var e3 = this, n3 = this.$locale();
  20939. if (!this.isValid())
  20940. return n3.invalidDate || l2;
  20941. var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) {
  20942. return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
  20943. }, d3 = function(t4) {
  20944. return b2.s(s3 % 12 || 12, t4, "0");
  20945. }, $3 = f3 || function(t4, e4, n4) {
  20946. var r4 = t4 < 12 ? "AM" : "PM";
  20947. return n4 ? r4.toLowerCase() : r4;
  20948. };
  20949. return r3.replace(y2, function(t4, r4) {
  20950. return r4 || function(t5) {
  20951. switch (t5) {
  20952. case "YY":
  20953. return String(e3.$y).slice(-2);
  20954. case "YYYY":
  20955. return b2.s(e3.$y, 4, "0");
  20956. case "M":
  20957. return a3 + 1;
  20958. case "MM":
  20959. return b2.s(a3 + 1, 2, "0");
  20960. case "MMM":
  20961. return h3(n3.monthsShort, a3, c3, 3);
  20962. case "MMMM":
  20963. return h3(c3, a3);
  20964. case "D":
  20965. return e3.$D;
  20966. case "DD":
  20967. return b2.s(e3.$D, 2, "0");
  20968. case "d":
  20969. return String(e3.$W);
  20970. case "dd":
  20971. return h3(n3.weekdaysMin, e3.$W, o3, 2);
  20972. case "ddd":
  20973. return h3(n3.weekdaysShort, e3.$W, o3, 3);
  20974. case "dddd":
  20975. return o3[e3.$W];
  20976. case "H":
  20977. return String(s3);
  20978. case "HH":
  20979. return b2.s(s3, 2, "0");
  20980. case "h":
  20981. return d3(1);
  20982. case "hh":
  20983. return d3(2);
  20984. case "a":
  20985. return $3(s3, u3, true);
  20986. case "A":
  20987. return $3(s3, u3, false);
  20988. case "m":
  20989. return String(u3);
  20990. case "mm":
  20991. return b2.s(u3, 2, "0");
  20992. case "s":
  20993. return String(e3.$s);
  20994. case "ss":
  20995. return b2.s(e3.$s, 2, "0");
  20996. case "SSS":
  20997. return b2.s(e3.$ms, 3, "0");
  20998. case "Z":
  20999. return i3;
  21000. }
  21001. return null;
  21002. }(t4) || i3.replace(":", "");
  21003. });
  21004. }, m3.utcOffset = function() {
  21005. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  21006. }, m3.diff = function(r3, d3, l3) {
  21007. var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
  21008. return b2.m(y3, m4);
  21009. };
  21010. switch (M4) {
  21011. case h2:
  21012. $3 = D3() / 12;
  21013. break;
  21014. case c2:
  21015. $3 = D3();
  21016. break;
  21017. case f2:
  21018. $3 = D3() / 3;
  21019. break;
  21020. case o2:
  21021. $3 = (g3 - v3) / 6048e5;
  21022. break;
  21023. case a2:
  21024. $3 = (g3 - v3) / 864e5;
  21025. break;
  21026. case u2:
  21027. $3 = g3 / n2;
  21028. break;
  21029. case s2:
  21030. $3 = g3 / e2;
  21031. break;
  21032. case i2:
  21033. $3 = g3 / t2;
  21034. break;
  21035. default:
  21036. $3 = g3;
  21037. }
  21038. return l3 ? $3 : b2.a($3);
  21039. }, m3.daysInMonth = function() {
  21040. return this.endOf(c2).$D;
  21041. }, m3.$locale = function() {
  21042. return D2[this.$L];
  21043. }, m3.locale = function(t3, e3) {
  21044. if (!t3)
  21045. return this.$L;
  21046. var n3 = this.clone(), r3 = w2(t3, e3, true);
  21047. return r3 && (n3.$L = r3), n3;
  21048. }, m3.clone = function() {
  21049. return b2.w(this.$d, this);
  21050. }, m3.toDate = function() {
  21051. return new Date(this.valueOf());
  21052. }, m3.toJSON = function() {
  21053. return this.isValid() ? this.toISOString() : null;
  21054. }, m3.toISOString = function() {
  21055. return this.$d.toISOString();
  21056. }, m3.toString = function() {
  21057. return this.$d.toUTCString();
  21058. }, M3;
  21059. }(), k = _2.prototype;
  21060. return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
  21061. k[t3[1]] = function(e3) {
  21062. return this.$g(e3, t3[0], t3[1]);
  21063. };
  21064. }), O2.extend = function(t3, e3) {
  21065. return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
  21066. }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
  21067. return O2(1e3 * t3);
  21068. }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
  21069. });
  21070. })(dayjs_min);
  21071. var dayjs_minExports = dayjs_min.exports;
  21072. const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
  21073. var isIOS;
  21074. function album() {
  21075. var result = 0;
  21076. var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
  21077. var authStatus = PHPhotoLibrary.authorizationStatus();
  21078. if (authStatus === 0) {
  21079. result = null;
  21080. } else if (authStatus == 3) {
  21081. result = 1;
  21082. } else {
  21083. result = 0;
  21084. }
  21085. plus.ios.deleteObject(PHPhotoLibrary);
  21086. return result;
  21087. }
  21088. function camera() {
  21089. var result = 0;
  21090. var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
  21091. var authStatus = AVCaptureDevice.authorizationStatusForMediaType("vide");
  21092. if (authStatus === 0) {
  21093. result = null;
  21094. } else if (authStatus == 3) {
  21095. result = 1;
  21096. } else {
  21097. result = 0;
  21098. }
  21099. plus.ios.deleteObject(AVCaptureDevice);
  21100. return result;
  21101. }
  21102. function location$1() {
  21103. var result = 0;
  21104. var cllocationManger = plus.ios.import("CLLocationManager");
  21105. var enable = cllocationManger.locationServicesEnabled();
  21106. var status = cllocationManger.authorizationStatus();
  21107. if (!enable) {
  21108. result = 2;
  21109. } else if (status === 0) {
  21110. result = null;
  21111. } else if (status === 3 || status === 4) {
  21112. result = 1;
  21113. } else {
  21114. result = 0;
  21115. }
  21116. plus.ios.deleteObject(cllocationManger);
  21117. return result;
  21118. }
  21119. function push() {
  21120. var result = 0;
  21121. var UIApplication = plus.ios.import("UIApplication");
  21122. var app = UIApplication.sharedApplication();
  21123. var enabledTypes = 0;
  21124. if (app.currentUserNotificationSettings) {
  21125. var settings = app.currentUserNotificationSettings();
  21126. enabledTypes = settings.plusGetAttribute("types");
  21127. if (enabledTypes == 0) {
  21128. result = 0;
  21129. formatAppLog("log", "at common/permission.js:63", "推送权限没有开启");
  21130. } else {
  21131. result = 1;
  21132. formatAppLog("log", "at common/permission.js:66", "已经开启推送功能!");
  21133. }
  21134. plus.ios.deleteObject(settings);
  21135. } else {
  21136. enabledTypes = app.enabledRemoteNotificationTypes();
  21137. if (enabledTypes == 0) {
  21138. result = 3;
  21139. formatAppLog("log", "at common/permission.js:73", "推送权限没有开启!");
  21140. } else {
  21141. result = 4;
  21142. formatAppLog("log", "at common/permission.js:76", "已经开启推送功能!");
  21143. }
  21144. }
  21145. plus.ios.deleteObject(app);
  21146. plus.ios.deleteObject(UIApplication);
  21147. return result;
  21148. }
  21149. function contact() {
  21150. var result = 0;
  21151. var CNContactStore = plus.ios.import("CNContactStore");
  21152. var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
  21153. if (cnAuthStatus === 0) {
  21154. result = null;
  21155. } else if (cnAuthStatus == 3) {
  21156. result = 1;
  21157. } else {
  21158. result = 0;
  21159. }
  21160. plus.ios.deleteObject(CNContactStore);
  21161. return result;
  21162. }
  21163. function record() {
  21164. var result = null;
  21165. var avaudiosession = plus.ios.import("AVAudioSession");
  21166. var avaudio = avaudiosession.sharedInstance();
  21167. var status = avaudio.recordPermission();
  21168. formatAppLog("log", "at common/permission.js:104", "permissionStatus:" + status);
  21169. if (status === 1970168948) {
  21170. result = null;
  21171. } else if (status === 1735552628) {
  21172. result = 1;
  21173. } else {
  21174. result = 0;
  21175. }
  21176. plus.ios.deleteObject(avaudiosession);
  21177. return result;
  21178. }
  21179. function calendar() {
  21180. var result = null;
  21181. var EKEventStore = plus.ios.import("EKEventStore");
  21182. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
  21183. if (ekAuthStatus == 3) {
  21184. result = 1;
  21185. formatAppLog("log", "at common/permission.js:122", "日历权限已经开启");
  21186. } else {
  21187. formatAppLog("log", "at common/permission.js:124", "日历权限没有开启");
  21188. }
  21189. plus.ios.deleteObject(EKEventStore);
  21190. return result;
  21191. }
  21192. function memo() {
  21193. var result = null;
  21194. var EKEventStore = plus.ios.import("EKEventStore");
  21195. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
  21196. if (ekAuthStatus == 3) {
  21197. result = 1;
  21198. formatAppLog("log", "at common/permission.js:136", "备忘录权限已经开启");
  21199. } else {
  21200. formatAppLog("log", "at common/permission.js:138", "备忘录权限没有开启");
  21201. }
  21202. plus.ios.deleteObject(EKEventStore);
  21203. return result;
  21204. }
  21205. function requestIOS(permissionID) {
  21206. return new Promise((resolve, reject) => {
  21207. switch (permissionID) {
  21208. case "push":
  21209. resolve(push());
  21210. break;
  21211. case "location":
  21212. resolve(location$1());
  21213. break;
  21214. case "record":
  21215. resolve(record());
  21216. break;
  21217. case "camera":
  21218. resolve(camera());
  21219. break;
  21220. case "album":
  21221. resolve(album());
  21222. break;
  21223. case "contact":
  21224. resolve(contact());
  21225. break;
  21226. case "calendar":
  21227. resolve(calendar());
  21228. break;
  21229. case "memo":
  21230. resolve(memo());
  21231. break;
  21232. default:
  21233. resolve(0);
  21234. break;
  21235. }
  21236. });
  21237. }
  21238. function requestAndroid(permissionID) {
  21239. return new Promise((resolve, reject) => {
  21240. plus.android.requestPermissions(
  21241. [permissionID],
  21242. function(resultObj) {
  21243. var result = 0;
  21244. for (var i2 = 0; i2 < resultObj.granted.length; i2++) {
  21245. var grantedPermission = resultObj.granted[i2];
  21246. formatAppLog("log", "at common/permission.js:187", "已获取的权限:" + grantedPermission);
  21247. result = 1;
  21248. }
  21249. for (var i2 = 0; i2 < resultObj.deniedPresent.length; i2++) {
  21250. var deniedPresentPermission = resultObj.deniedPresent[i2];
  21251. formatAppLog("log", "at common/permission.js:192", "拒绝本次申请的权限:" + deniedPresentPermission);
  21252. result = 0;
  21253. }
  21254. for (var i2 = 0; i2 < resultObj.deniedAlways.length; i2++) {
  21255. var deniedAlwaysPermission = resultObj.deniedAlways[i2];
  21256. formatAppLog("log", "at common/permission.js:197", "永久拒绝申请的权限:" + deniedAlwaysPermission);
  21257. result = -1;
  21258. }
  21259. resolve(result);
  21260. },
  21261. function(error) {
  21262. formatAppLog("log", "at common/permission.js:203", "result error: " + error.message);
  21263. resolve({
  21264. code: error.code,
  21265. message: error.message
  21266. });
  21267. }
  21268. );
  21269. });
  21270. }
  21271. function gotoAppPermissionSetting() {
  21272. if (permission.isIOS) {
  21273. var UIApplication = plus.ios.import("UIApplication");
  21274. var application2 = UIApplication.sharedApplication();
  21275. var NSURL2 = plus.ios.import("NSURL");
  21276. var setting2 = NSURL2.URLWithString("app-settings:");
  21277. application2.openURL(setting2);
  21278. plus.ios.deleteObject(setting2);
  21279. plus.ios.deleteObject(NSURL2);
  21280. plus.ios.deleteObject(application2);
  21281. } else {
  21282. var Intent = plus.android.importClass("android.content.Intent");
  21283. var Settings = plus.android.importClass("android.provider.Settings");
  21284. var Uri = plus.android.importClass("android.net.Uri");
  21285. var mainActivity = plus.android.runtimeMainActivity();
  21286. var intent = new Intent();
  21287. intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
  21288. var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
  21289. intent.setData(uri);
  21290. mainActivity.startActivity(intent);
  21291. }
  21292. }
  21293. const permission = {
  21294. get isIOS() {
  21295. return typeof isIOS === "boolean" ? isIOS : isIOS = uni.getSystemInfoSync().platform === "ios";
  21296. },
  21297. requestIOS,
  21298. requestAndroid,
  21299. gotoAppSetting: gotoAppPermissionSetting
  21300. };
  21301. const baseURL = "http://dsg.tms.api.aibasil.cn";
  21302. const warehouseScanURL = baseURL + "/admin/order.sheetOrder/warehouseScan";
  21303. const instockScanURL = baseURL + "/admin/order.scanOrder/instock";
  21304. const outStockScanURL = baseURL + "/admin/order.scanOrder/outStock";
  21305. const checkWaybillGoodsURL = baseURL + "/admin/order.scanOrder/checkWaybillGoods";
  21306. const getWarehouseSpaceURL = baseURL + "/admin/order.ScanOrder/getWarehouseSpace";
  21307. const weighScanURL = baseURL + "/admin/order.scanOrder/weigh";
  21308. const getBindParamsURL = baseURL + "/admin/order.scanOrder/getBindParams";
  21309. const getPrinterListURL = baseURL + "/admin/printer//getPrinterList";
  21310. const bindShippingURL = baseURL + "/admin/order.scanOrder/bindShipping";
  21311. const getWaybillsURL = baseURL + "/admin/order.scanOrder/getWaybills";
  21312. const printWaybillLabelURL = baseURL + "/admin/order.ScanOrder/printWaybillLabel";
  21313. const printCustomerLabelURL = baseURL + "/admin/order.ScanOrder/printCustomerLabel";
  21314. const loginURL = baseURL + "/admin/index/login";
  21315. const getcaptchaURL = baseURL + "/api/common/captcha";
  21316. const pickupWaybillDeliveryOrderURL = baseURL + "/admin/pickup.waybillDeliveryOrder";
  21317. const addWaybillNoURL = baseURL + "/admin/warehouse.waybillNo/add";
  21318. const waybillNoOptions = baseURL + "/admin/warehouse.waybillNo/getOptions";
  21319. const sendOutURL = baseURL + "/admin/pickup.waybillDeliveryOrder/sendOut";
  21320. const deliveredURL = baseURL + "/admin/pickup.waybillDeliveryOrder/delivered";
  21321. const refuseURL = baseURL + "/admin/pickup.waybillDeliveryOrder/refuse";
  21322. const createTrackPodURL = baseURL + "/admin/pickup.waybillDeliveryOrder/createTrackPod";
  21323. const cancelFedExPickUpURL = baseURL + "/admin/pickup.waybillDeliveryOrder/cancelFedExPickUp";
  21324. const getAliyunOssSignatureUrl = baseURL + "/admin/Config/getAliyunOssSignature";
  21325. const hexList = [];
  21326. for (let i2 = 0; i2 <= 15; i2++) {
  21327. hexList[i2] = i2.toString(16);
  21328. }
  21329. function uuid() {
  21330. let uuid2 = "";
  21331. for (let i2 = 1; i2 <= 36; i2++) {
  21332. if (i2 === 9 || i2 === 14 || i2 === 19 || i2 === 24) {
  21333. uuid2 += "-";
  21334. } else if (i2 === 15) {
  21335. uuid2 += 4;
  21336. } else if (i2 === 20) {
  21337. uuid2 += hexList[Math.random() * 4 | 8];
  21338. } else {
  21339. uuid2 += hexList[Math.random() * 16 | 0];
  21340. }
  21341. }
  21342. return uuid2;
  21343. }
  21344. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  21345. __name: "index",
  21346. setup(__props, { expose: __expose }) {
  21347. __expose();
  21348. const alertDialog = vue.ref();
  21349. const message = vue.ref();
  21350. const valiForm = vue.ref();
  21351. const printerDialog = vue.ref();
  21352. const token = vue.ref(null);
  21353. const user = vue.ref(null);
  21354. const loading = vue.ref(false);
  21355. const images = vue.ref([]);
  21356. const messageType = vue.ref("");
  21357. const messageText = vue.ref("");
  21358. const batchOptions = vue.ref([]);
  21359. const spaces = vue.ref([]);
  21360. const previewImage = vue.ref(null);
  21361. const maxImages = vue.ref(6);
  21362. const uploadData = vue.ref([]);
  21363. const imageValue = vue.ref([]);
  21364. const printerList = vue.ref({});
  21365. const instockHistory = vue.ref([]);
  21366. const printers = vue.ref([]);
  21367. const downloadFile = vue.ref([]);
  21368. const sendToPeinter = vue.ref([1]);
  21369. const selectPrinter = vue.ref(0);
  21370. const subLoading = vue.ref(false);
  21371. const focusType = vue.ref(true);
  21372. const result = vue.ref();
  21373. const valiFormData = vue.reactive({
  21374. images: [],
  21375. orderNum: "",
  21376. batch_number: "",
  21377. space_code: "",
  21378. weight: "",
  21379. search_pkg: true,
  21380. typing: true,
  21381. search_order: true,
  21382. search_order_choice: 1
  21383. });
  21384. const searchOrderChoice = vue.reactive([
  21385. {
  21386. text: "更新为已入库,状态为【已入库】",
  21387. value: 1
  21388. },
  21389. {
  21390. text: "更新为已出库,状态为【已出库】",
  21391. value: 2
  21392. },
  21393. {
  21394. text: "称重计费",
  21395. value: 3
  21396. }
  21397. ]);
  21398. const rules = vue.computed(() => {
  21399. return {
  21400. orderNum: {
  21401. rules: [
  21402. {
  21403. required: valiFormData.search_order_choice !== 2,
  21404. errorMessage: "单号不能为空"
  21405. }
  21406. ]
  21407. },
  21408. weight: {
  21409. rules: [
  21410. {
  21411. required: true,
  21412. errorMessage: "重量不能为空"
  21413. },
  21414. {
  21415. format: "number",
  21416. errorMessage: "重量只能输入数字"
  21417. }
  21418. ]
  21419. }
  21420. };
  21421. });
  21422. const spaceRes = vue.computed(() => {
  21423. try {
  21424. const res = spaces.value.find((item) => item.value === valiFormData.space_code);
  21425. return res == null ? void 0 : res.text;
  21426. } catch (e2) {
  21427. formatAppLog("log", "at pages/instock/index.vue:261", e2);
  21428. return "";
  21429. }
  21430. });
  21431. onShow(() => {
  21432. focusType.value = true;
  21433. loading.value = false;
  21434. token.value = uni.getStorageSync("token");
  21435. user.value = uni.getStorageSync("user");
  21436. getWarehouseSpace();
  21437. getBindParams();
  21438. getPrinterList();
  21439. });
  21440. onHide(() => {
  21441. focusType.value = false;
  21442. loading.value = false;
  21443. });
  21444. onNavigationBarButtonTap((event) => {
  21445. if (event.index === 0) {
  21446. uni.navigateTo({
  21447. url: "/pages/instock/instockLog"
  21448. });
  21449. }
  21450. });
  21451. const getWarehouseSpace = () => {
  21452. uni.request({
  21453. url: getWarehouseSpaceURL,
  21454. method: "POST",
  21455. header: {
  21456. batoken: token.value
  21457. },
  21458. data: {
  21459. code: ""
  21460. },
  21461. success: (res) => {
  21462. if (res.data.code === 1) {
  21463. spaces.value = res.data.data.spaces.map((item) => {
  21464. return {
  21465. text: item.name,
  21466. value: item.code
  21467. };
  21468. });
  21469. }
  21470. }
  21471. });
  21472. };
  21473. const getBindParams = () => {
  21474. uni.request({
  21475. url: getBindParamsURL,
  21476. method: "GET",
  21477. header: {
  21478. batoken: token.value
  21479. },
  21480. success: (res) => {
  21481. if (res.data.code === 1) {
  21482. batchOptions.value = res.data.data.batch_number.map((item) => {
  21483. return {
  21484. text: item.name,
  21485. value: item.id
  21486. };
  21487. });
  21488. }
  21489. },
  21490. fail(e2) {
  21491. formatAppLog("log", "at pages/instock/index.vue:327", "fail--", e2);
  21492. }
  21493. });
  21494. };
  21495. const getPrinterList = () => {
  21496. uni.request({
  21497. url: getPrinterListURL,
  21498. method: "GET",
  21499. header: {
  21500. batoken: token.value
  21501. },
  21502. success: (res) => {
  21503. if (res.data.code === 1) {
  21504. printerList.value = res.data.data.printers;
  21505. printers.value = Object.values(printerList.value).map((item) => {
  21506. return {
  21507. text: item.name,
  21508. value: item.value
  21509. };
  21510. });
  21511. }
  21512. },
  21513. fail(e2) {
  21514. formatAppLog("log", "at pages/instock/index.vue:351", "fail--", e2);
  21515. }
  21516. });
  21517. };
  21518. const batchText = (batch_number) => {
  21519. var _a;
  21520. return (_a = batchOptions.value.find((item) => item.value === batch_number)) == null ? void 0 : _a.text;
  21521. };
  21522. const searchPkgChange = () => {
  21523. valiFormData.search_pkg = !valiFormData.search_pkg;
  21524. valiFormData.typing = valiFormData.search_pkg;
  21525. };
  21526. const searchOrderChoiceChange = () => {
  21527. valiFormData.search_order = !valiFormData.search_order;
  21528. valiFormData.search_order_choice = valiFormData.search_order ? 3 : "";
  21529. };
  21530. const reset = () => {
  21531. loading.value = false;
  21532. focusType.value = false;
  21533. images.value = [];
  21534. valiFormData.orderNum = "";
  21535. valiFormData.batch_number = "";
  21536. valiFormData.weight = "";
  21537. valiFormData.search_pkg = true;
  21538. valiFormData.typing = true;
  21539. valiFormData.search_order = true;
  21540. vue.nextTick(() => {
  21541. focusType.value = true;
  21542. });
  21543. };
  21544. const scan = async () => {
  21545. let status = await checkPermission();
  21546. if (status !== 1) {
  21547. return;
  21548. }
  21549. uni.scanCode({
  21550. success: (res) => {
  21551. result.value = res.result;
  21552. valiFormData.orderNum = res.result;
  21553. },
  21554. fail: (err) => {
  21555. }
  21556. });
  21557. };
  21558. const checkPermission = async () => {
  21559. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  21560. if (status === null || status === 1) {
  21561. status = 1;
  21562. } else {
  21563. uni.showModal({
  21564. content: "Camera permission required",
  21565. confirmText: "Setting",
  21566. success: function(res) {
  21567. if (res.confirm) {
  21568. permission.gotoAppSetting();
  21569. }
  21570. }
  21571. });
  21572. }
  21573. return status;
  21574. };
  21575. let st2;
  21576. const warehouseScan = async () => {
  21577. st2 && clearTimeout(st2);
  21578. if (valiFormData.search_order_choice === 1) {
  21579. await checkWaybillGoods();
  21580. } else if (valiFormData.search_order_choice === 2) {
  21581. await scanOutstock();
  21582. } else if (valiFormData.search_order_choice === 3) {
  21583. await weighScan();
  21584. }
  21585. };
  21586. const checkWaybillGoods = async () => {
  21587. loading.value = true;
  21588. uni.request({
  21589. url: checkWaybillGoodsURL,
  21590. method: "POST",
  21591. header: {
  21592. batoken: token.value
  21593. },
  21594. data: {
  21595. order_no: valiFormData.orderNum
  21596. },
  21597. success: (res) => {
  21598. if (res.data.code === 1 && res.data.data.is_goods_empty) {
  21599. alertDialog.value.open();
  21600. } else {
  21601. instockScan(0);
  21602. }
  21603. }
  21604. });
  21605. };
  21606. const instockScan = (is_save_goods) => {
  21607. const images2 = getImages();
  21608. uni.request({
  21609. url: instockScanURL,
  21610. method: "POST",
  21611. header: {
  21612. batoken: token.value
  21613. },
  21614. data: {
  21615. order_no: valiFormData.orderNum,
  21616. weight: valiFormData.weight,
  21617. space_code: valiFormData.space_code,
  21618. is_save_goods,
  21619. images: images2
  21620. },
  21621. success: (res) => {
  21622. loading.value = false;
  21623. if (res.data.code == 1) {
  21624. messageType.value = "success";
  21625. messageText.value = res.data.msg;
  21626. message.value.open();
  21627. formatAppLog("log", "at pages/instock/index.vue:475", "res.data.data---", res.data.data);
  21628. const historyItem = {
  21629. orderNum: valiFormData.orderNum,
  21630. createTime: /* @__PURE__ */ new Date(),
  21631. space: spaceRes.value,
  21632. type: "入库",
  21633. status: true
  21634. };
  21635. instockHistory.value.unshift(historyItem);
  21636. uni.setStorageSync("instockHistory", instockHistory.value);
  21637. if (res.data.data.express_label) {
  21638. formatAppLog("log", "at pages/instock/index.vue:489", "有打印面单");
  21639. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  21640. printerDialog.value.open();
  21641. } else {
  21642. st2 = setTimeout(() => {
  21643. reset();
  21644. st2 && clearTimeout(st2);
  21645. }, 1e3);
  21646. }
  21647. } else {
  21648. messageType.value = "error";
  21649. messageText.value = res.data.msg;
  21650. message.value.open();
  21651. const historyItem = {
  21652. orderNum: valiFormData.orderNum,
  21653. createTime: /* @__PURE__ */ new Date(),
  21654. space: spaceRes.value,
  21655. type: "入库",
  21656. status: false
  21657. };
  21658. instockHistory.value.unshift(historyItem);
  21659. uni.setStorageSync("instockHistory", instockHistory.value);
  21660. st2 = setTimeout(() => {
  21661. reset();
  21662. st2 && clearTimeout(st2);
  21663. }, 1e3);
  21664. }
  21665. }
  21666. });
  21667. };
  21668. const scanOutstock = () => {
  21669. formatAppLog("log", "at pages/instock/index.vue:522", valiFormData.orderNum, valiFormData.batch_number);
  21670. if (valiFormData.orderNum.length === 0 && valiFormData.batch_number.length === 0) {
  21671. messageType.value = "error";
  21672. messageText.value = "单号或批次号至少填一个";
  21673. message.value.open();
  21674. return;
  21675. }
  21676. loading.value = true;
  21677. uni.request({
  21678. url: outStockScanURL,
  21679. method: "POST",
  21680. header: {
  21681. batoken: token.value
  21682. },
  21683. data: {
  21684. order_no: valiFormData.orderNum,
  21685. batch_number: valiFormData.batch_number
  21686. },
  21687. success: (res) => {
  21688. loading.value = false;
  21689. if (res.data.code == 1) {
  21690. messageType.value = "success";
  21691. messageText.value = res.data.msg;
  21692. message.value.open();
  21693. const historyItem = {
  21694. orderNum: valiFormData.orderNum,
  21695. batch_text: batchText(valiFormData.batch_number),
  21696. createTime: /* @__PURE__ */ new Date(),
  21697. type: "出库",
  21698. status: true
  21699. };
  21700. instockHistory.value.unshift(historyItem);
  21701. instockHistory.value.length > 10 && (instockHistory.value.length = 10);
  21702. uni.setStorageSync("instockHistory", instockHistory.value);
  21703. if (res.data.data.labels && res.data.data.labels.length > 0) {
  21704. formatAppLog("log", "at pages/instock/index.vue:559", "有打印面单");
  21705. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  21706. printerDialog.value.open();
  21707. } else {
  21708. st2 = setTimeout(() => {
  21709. reset();
  21710. st2 && clearTimeout(st2);
  21711. }, 700);
  21712. }
  21713. } else {
  21714. messageType.value = "error";
  21715. messageText.value = res.data.msg;
  21716. message.value.open();
  21717. const historyItem = {
  21718. orderNum: valiFormData.orderNum,
  21719. batch_text: batchText(valiFormData.batch_number),
  21720. createTime: /* @__PURE__ */ new Date(),
  21721. type: "出库",
  21722. status: false
  21723. };
  21724. instockHistory.value.unshift(historyItem);
  21725. instockHistory.value.length > 10 && (instockHistory.value.length = 10);
  21726. uni.setStorageSync("instockHistory", instockHistory.value);
  21727. st2 = setTimeout(() => {
  21728. reset();
  21729. st2 && clearTimeout(st2);
  21730. }, 700);
  21731. }
  21732. }
  21733. });
  21734. };
  21735. const weighScan = () => {
  21736. loading.value = true;
  21737. uni.request({
  21738. url: weighScanURL,
  21739. method: "POST",
  21740. header: {
  21741. batoken: token.value
  21742. },
  21743. data: {
  21744. order_no: valiFormData.orderNum,
  21745. weight: valiFormData.weight
  21746. },
  21747. success: (res) => {
  21748. loading.value = false;
  21749. if (res.data.code == 1) {
  21750. messageType.value = "success";
  21751. messageText.value = res.data.msg;
  21752. message.value.open();
  21753. const historyItem = {
  21754. orderNum: valiFormData.orderNum,
  21755. createTime: /* @__PURE__ */ new Date(),
  21756. type: "称重",
  21757. status: true
  21758. };
  21759. instockHistory.value.unshift(historyItem);
  21760. instockHistory.value.length > 10 && (instockHistory.value.length = 10);
  21761. uni.setStorageSync("instockHistory", instockHistory.value);
  21762. } else {
  21763. messageType.value = "error";
  21764. messageText.value = res.data.msg;
  21765. message.value.open();
  21766. const historyItem = {
  21767. orderNum: valiFormData.orderNum,
  21768. createTime: /* @__PURE__ */ new Date(),
  21769. type: "称重",
  21770. status: false
  21771. };
  21772. instockHistory.value.unshift(historyItem);
  21773. instockHistory.value.length > 10 && (instockHistory.value.length = 10);
  21774. uni.setStorageSync("instockHistory", instockHistory.value);
  21775. }
  21776. st2 = setTimeout(() => {
  21777. reset();
  21778. st2 && clearTimeout(st2);
  21779. }, 700);
  21780. }
  21781. });
  21782. };
  21783. const close = () => {
  21784. printerDialog.value.close();
  21785. st2 = setTimeout(() => {
  21786. reset();
  21787. st2 && clearTimeout(st2);
  21788. }, 700);
  21789. };
  21790. const dialogConfirm = () => {
  21791. instockScan(1);
  21792. };
  21793. const dialogClose = () => {
  21794. instockScan(0);
  21795. };
  21796. const sendToPeinterFun = (res) => {
  21797. if (!res.detail.value.length > 0) {
  21798. selectPrinter.value = 0;
  21799. } else {
  21800. selectPrinter.value = printers.value[0].value;
  21801. }
  21802. };
  21803. const printConfirm = () => {
  21804. subLoading.value = true;
  21805. uni.request({
  21806. url: printWaybillLabelURL,
  21807. method: "POST",
  21808. header: {
  21809. batoken: token.value
  21810. },
  21811. data: {
  21812. order_no: valiFormData.orderNum,
  21813. printer_code: selectPrinter
  21814. },
  21815. success: (res) => {
  21816. close();
  21817. subLoading.value = false;
  21818. formatAppLog("log", "at pages/instock/index.vue:678", "打印成功", res);
  21819. messageType.value = "success";
  21820. messageText.value = "打印成功";
  21821. message.value.open();
  21822. }
  21823. });
  21824. };
  21825. const onsubmit = () => {
  21826. valiForm.value.validate().then((res) => {
  21827. warehouseScan();
  21828. }).catch((err) => {
  21829. formatAppLog("log", "at pages/instock/index.vue:692", "err", err);
  21830. });
  21831. };
  21832. const getHistory = () => {
  21833. };
  21834. const getImages = () => {
  21835. const res = images.value.map((item) => {
  21836. return {
  21837. name: item.name,
  21838. savePath: item.serverUrl,
  21839. fileSize: item.size,
  21840. mimeType: item.type
  21841. };
  21842. });
  21843. formatAppLog("log", "at pages/instock/index.vue:707", "res22 ", res);
  21844. return res;
  21845. };
  21846. const getAliyunOssSignature = (rawFiles) => {
  21847. uni.request({
  21848. url: getAliyunOssSignatureUrl,
  21849. method: "GET",
  21850. header: {
  21851. batoken: token.value
  21852. },
  21853. success: ({ data }) => {
  21854. const signature = data.data.signature;
  21855. const uploadPromises = rawFiles.map((image) => {
  21856. return upLoadFile(signature, image);
  21857. });
  21858. Promise.all(uploadPromises).then((results) => {
  21859. formatAppLog("log", "at pages/instock/index.vue:728", "所有图片加载成功:", results);
  21860. uni.showToast({
  21861. title: "加载成功",
  21862. icon: "success"
  21863. });
  21864. }).catch((error) => {
  21865. formatAppLog("error", "at pages/instock/index.vue:735", "加载失败:", error);
  21866. uni.showToast({
  21867. title: "加载失败",
  21868. icon: "none"
  21869. });
  21870. });
  21871. },
  21872. fail: (err) => {
  21873. formatAppLog("log", "at pages/instock/index.vue:743", err);
  21874. }
  21875. });
  21876. };
  21877. const upLoadFile = (signature, image) => {
  21878. const fileData = {
  21879. policy: signature.policy,
  21880. signature: signature.signature,
  21881. ossaccessKeyId: signature.ossAccessKeyId,
  21882. key: signature.dir + dayjs().format("YYYYMMDD") + "/" + uuid() + "_" + image.name,
  21883. dir: signature.dir,
  21884. host: signature.host,
  21885. file: image.file
  21886. };
  21887. return new Promise((resolve, reject) => {
  21888. const uploadTask = uni.uploadFile({
  21889. url: signature.host,
  21890. // 你的上传接口地址
  21891. filePath: image.path,
  21892. name: image.name,
  21893. // 这里根据后端需要的字段来定义
  21894. formData: fileData,
  21895. success: (uploadFileRes) => {
  21896. if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {
  21897. image.serverUrl = fileData.key;
  21898. resolve(uploadFileRes);
  21899. } else {
  21900. reject(uploadFileRes);
  21901. }
  21902. },
  21903. fail: (error) => {
  21904. formatAppLog("log", "at pages/instock/index.vue:772", "error++", error);
  21905. reject(error);
  21906. },
  21907. // 更新上传进度
  21908. complete: () => {
  21909. formatAppLog("log", "at pages/instock/index.vue:777", "complete---");
  21910. image.progress = 100;
  21911. }
  21912. });
  21913. uploadTask.onProgressUpdate((progressEvent) => {
  21914. image.progress = progressEvent.progress;
  21915. });
  21916. });
  21917. };
  21918. const chooseImage = () => {
  21919. uni.chooseImage({
  21920. count: maxImages.value - images.value.length,
  21921. success: (res) => {
  21922. formatAppLog("log", "at pages/instock/index.vue:791", "res---", res);
  21923. images.value = images.value.concat(
  21924. res.tempFiles.map((item) => {
  21925. const res2 = {
  21926. size: item.size,
  21927. path: item.path,
  21928. name: item.name,
  21929. type: item.type,
  21930. progress: 0,
  21931. file: item
  21932. };
  21933. const suffix = item.path.substring(item.path.lastIndexOf(".") + 1);
  21934. const fileName = item.path.substring(item.path.lastIndexOf("/") + 1);
  21935. res2.name = fileName;
  21936. res2.type = suffix;
  21937. return res2;
  21938. })
  21939. );
  21940. const paddingImages = images.value.filter((image) => image.progress === 0);
  21941. vue.nextTick(() => {
  21942. getAliyunOssSignature(paddingImages);
  21943. });
  21944. },
  21945. fail: (err) => {
  21946. formatAppLog("error", "at pages/instock/index.vue:825", err);
  21947. }
  21948. });
  21949. };
  21950. const deleteImage = (index) => {
  21951. images.value.splice(index, 1);
  21952. };
  21953. const openPreview = (image) => {
  21954. previewImage.value = image;
  21955. };
  21956. const closePreview = () => {
  21957. previewImage.value = null;
  21958. };
  21959. const __returned__ = { alertDialog, message, valiForm, printerDialog, token, user, loading, images, messageType, messageText, batchOptions, spaces, previewImage, maxImages, uploadData, imageValue, printerList, instockHistory, printers, downloadFile, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, searchOrderChoice, rules, spaceRes, getWarehouseSpace, getBindParams, getPrinterList, batchText, searchPkgChange, searchOrderChoiceChange, reset, scan, checkPermission, get st() {
  21960. return st2;
  21961. }, set st(v2) {
  21962. st2 = v2;
  21963. }, warehouseScan, checkWaybillGoods, instockScan, scanOutstock, weighScan, close, dialogConfirm, dialogClose, sendToPeinterFun, printConfirm, onsubmit, getHistory, getImages, getAliyunOssSignature, upLoadFile, chooseImage, deleteImage, openPreview, closePreview };
  21964. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  21965. return __returned__;
  21966. }
  21967. });
  21968. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  21969. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  21970. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  21971. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$6);
  21972. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  21973. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$4);
  21974. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  21975. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  21976. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  21977. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_0$2);
  21978. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  21979. vue.createElementVNode("view", { class: "example" }, [
  21980. vue.createCommentVNode(" 基础表单校验 "),
  21981. vue.createVNode(_component_uni_forms, {
  21982. ref: "valiForm",
  21983. "label-align": "right",
  21984. rules: $setup.rules,
  21985. modelValue: $setup.valiFormData
  21986. }, {
  21987. default: vue.withCtx(() => [
  21988. vue.createVNode(_component_uni_forms_item, {
  21989. label: "单号",
  21990. required: $setup.valiFormData.search_order_choice !== 2,
  21991. name: "orderNum"
  21992. }, {
  21993. default: vue.withCtx(() => [
  21994. vue.createVNode(_component_uni_easyinput, {
  21995. modelValue: $setup.valiFormData.orderNum,
  21996. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  21997. placeholder: "请输入单号",
  21998. suffixIcon: "scan",
  21999. focus: $setup.focusType,
  22000. onIconClick: $setup.scan
  22001. }, null, 8, ["modelValue", "focus"])
  22002. ]),
  22003. _: 1
  22004. /* STABLE */
  22005. }, 8, ["required"]),
  22006. $setup.valiFormData.search_order_choice === 2 ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
  22007. key: 0,
  22008. label: "批次号",
  22009. name: "batch_number"
  22010. }, {
  22011. default: vue.withCtx(() => [
  22012. vue.createVNode(_component_uni_data_select, {
  22013. modelValue: $setup.valiFormData.batch_number,
  22014. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.batch_number = $event),
  22015. localdata: $setup.batchOptions,
  22016. placeholder: "请选择批次号"
  22017. }, null, 8, ["modelValue", "localdata"])
  22018. ]),
  22019. _: 1
  22020. /* STABLE */
  22021. })) : vue.createCommentVNode("v-if", true),
  22022. $setup.valiFormData.search_order_choice === 1 ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
  22023. key: 1,
  22024. label: "仓位编码",
  22025. name: "space_code"
  22026. }, {
  22027. default: vue.withCtx(() => [
  22028. vue.createVNode(_component_uni_data_select, {
  22029. modelValue: $setup.valiFormData.space_code,
  22030. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.space_code = $event),
  22031. localdata: $setup.spaces,
  22032. placeholder: "请选择仓位编码"
  22033. }, null, 8, ["modelValue", "localdata"])
  22034. ]),
  22035. _: 1
  22036. /* STABLE */
  22037. })) : vue.createCommentVNode("v-if", true),
  22038. $setup.valiFormData.search_order_choice !== 2 ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
  22039. key: 2,
  22040. label: "重量",
  22041. required: "",
  22042. name: "weight"
  22043. }, {
  22044. default: vue.withCtx(() => [
  22045. vue.createVNode(_component_uni_easyinput, {
  22046. modelValue: $setup.valiFormData.weight,
  22047. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.valiFormData.weight = $event),
  22048. placeholder: "请输入重量",
  22049. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  22050. }, {
  22051. right: vue.withCtx(() => [
  22052. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  22053. ]),
  22054. _: 1
  22055. /* STABLE */
  22056. }, 8, ["modelValue"])
  22057. ]),
  22058. _: 1
  22059. /* STABLE */
  22060. })) : vue.createCommentVNode("v-if", true),
  22061. $setup.valiFormData.search_order_choice === 1 ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
  22062. key: 3,
  22063. label: "图片",
  22064. name: "images"
  22065. }, {
  22066. default: vue.withCtx(() => [
  22067. vue.createElementVNode("view", { class: "upload-container" }, [
  22068. vue.createElementVNode("view", { class: "preview" }, [
  22069. (vue.openBlock(true), vue.createElementBlock(
  22070. vue.Fragment,
  22071. null,
  22072. vue.renderList($setup.images, (img, index) => {
  22073. return vue.openBlock(), vue.createElementBlock("view", {
  22074. key: index,
  22075. class: "image-container"
  22076. }, [
  22077. vue.createElementVNode("image", {
  22078. src: img.path,
  22079. class: "preview-image",
  22080. mode: "aspectFill",
  22081. onClick: ($event) => $setup.openPreview(img.path)
  22082. }, null, 8, ["src", "onClick"]),
  22083. vue.createElementVNode("progress", {
  22084. percent: img.progress || 0,
  22085. activeColor: Number(img.progress || 0) === 100 ? "#00ff00" : "#10AEFF",
  22086. "stroke-width": "3"
  22087. }, null, 8, ["percent", "activeColor"]),
  22088. img.status === "success" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "1")) : vue.createCommentVNode("v-if", true),
  22089. vue.createVNode(_component_uni_icons, {
  22090. class: "delete-icon",
  22091. onClick: ($event) => $setup.deleteImage(index),
  22092. type: "clear",
  22093. size: "20",
  22094. color: "red"
  22095. }, null, 8, ["onClick"])
  22096. ]);
  22097. }),
  22098. 128
  22099. /* KEYED_FRAGMENT */
  22100. )),
  22101. $setup.images.length < $setup.maxImages ? (vue.openBlock(), vue.createElementBlock("view", {
  22102. key: 0,
  22103. class: "choose-image-container",
  22104. onClick: $setup.chooseImage
  22105. }, [
  22106. vue.createVNode(_component_uni_icons, {
  22107. type: "plusempty",
  22108. size: "40",
  22109. color: "#ccc"
  22110. })
  22111. ])) : vue.createCommentVNode("v-if", true)
  22112. ]),
  22113. vue.createElementVNode("text", { style: { "padding-top": "8px" } }, "最多选择6张图片"),
  22114. vue.createCommentVNode(" 放大预览 "),
  22115. $setup.previewImage ? (vue.openBlock(), vue.createElementBlock("view", {
  22116. key: 0,
  22117. class: "preview-modal",
  22118. onClick: $setup.closePreview
  22119. }, [
  22120. vue.createElementVNode("image", {
  22121. src: $setup.previewImage,
  22122. class: "preview-large",
  22123. mode: "aspectFit",
  22124. onClick: vue.withModifiers($setup.closePreview, ["stop"])
  22125. }, null, 8, ["src"])
  22126. ])) : vue.createCommentVNode("v-if", true)
  22127. ])
  22128. ]),
  22129. _: 1
  22130. /* STABLE */
  22131. })) : vue.createCommentVNode("v-if", true),
  22132. vue.createVNode(_component_uni_forms_item, null, {
  22133. default: vue.withCtx(() => [
  22134. vue.createElementVNode(
  22135. "view",
  22136. {
  22137. onClick: $setup.searchPkgChange,
  22138. class: "checkbox-cum",
  22139. style: vue.normalizeStyle({ color: $setup.valiFormData.search_pkg ? "#007AFF" : "gray" })
  22140. },
  22141. [
  22142. vue.createElementVNode("checkbox", {
  22143. checked: $setup.valiFormData.search_pkg,
  22144. onClick: $setup.searchPkgChange
  22145. }, null, 8, ["checked"]),
  22146. vue.createTextVNode(" 搜索寄存包裹 ")
  22147. ],
  22148. 4
  22149. /* STYLE */
  22150. ),
  22151. vue.createElementVNode("view", { class: "sub-choice" }, [
  22152. vue.createElementVNode("checkbox", {
  22153. disabled: !$setup.valiFormData.search_pkg,
  22154. checked: $setup.valiFormData.typing
  22155. }, null, 8, ["disabled", "checked"]),
  22156. vue.createElementVNode(
  22157. "text",
  22158. {
  22159. onClick: _cache[4] || (_cache[4] = () => {
  22160. if ($setup.valiFormData.search_pkg) {
  22161. $setup.valiFormData.typing = !$setup.valiFormData.typing;
  22162. }
  22163. }),
  22164. style: vue.normalizeStyle({
  22165. color: $setup.valiFormData.search_pkg && $setup.valiFormData.typing ? "#007AFF" : "gray"
  22166. })
  22167. },
  22168. " 包裹寄存、代购、运单都找不到时手工添加包裹 ",
  22169. 4
  22170. /* STYLE */
  22171. )
  22172. ]),
  22173. vue.createElementVNode(
  22174. "view",
  22175. {
  22176. onClick: $setup.searchOrderChoiceChange,
  22177. class: "checkbox-cum",
  22178. style: vue.normalizeStyle({ color: $setup.valiFormData.search_order ? "#007AFF" : "gray" })
  22179. },
  22180. [
  22181. vue.createElementVNode("checkbox", {
  22182. checked: $setup.valiFormData.search_order,
  22183. onClick: $setup.searchOrderChoiceChange
  22184. }, null, 8, ["checked"]),
  22185. vue.createTextVNode(" 搜索运单 ")
  22186. ],
  22187. 4
  22188. /* STYLE */
  22189. ),
  22190. vue.createElementVNode("view", null, [
  22191. vue.createVNode(_component_uni_data_checkbox, {
  22192. disabled: !$setup.valiFormData.search_order,
  22193. modelValue: $setup.valiFormData.search_order_choice,
  22194. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.valiFormData.search_order_choice = $event),
  22195. localdata: $setup.searchOrderChoice
  22196. }, null, 8, ["disabled", "modelValue", "localdata"])
  22197. ])
  22198. ]),
  22199. _: 1
  22200. /* STABLE */
  22201. })
  22202. ]),
  22203. _: 1
  22204. /* STABLE */
  22205. }, 8, ["rules", "modelValue"]),
  22206. vue.createElementVNode("view", { class: "button-group" }, [
  22207. vue.createElementVNode("button", {
  22208. type: "info",
  22209. onClick: $setup.reset
  22210. }, "重置"),
  22211. vue.createElementVNode("button", {
  22212. type: "primary",
  22213. onClick: $setup.onsubmit,
  22214. loading: $setup.loading
  22215. }, [
  22216. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  22217. key: 0,
  22218. type: "checkmarkempty",
  22219. size: "18",
  22220. color: "white"
  22221. })) : vue.createCommentVNode("v-if", true),
  22222. vue.createTextVNode(" 提交 ")
  22223. ], 8, ["loading"])
  22224. ])
  22225. ]),
  22226. vue.createElementVNode("view", { class: "history" }, [
  22227. (vue.openBlock(true), vue.createElementBlock(
  22228. vue.Fragment,
  22229. null,
  22230. vue.renderList($setup.instockHistory.slice(0, 5), (item, i2) => {
  22231. return vue.openBlock(), vue.createElementBlock("view", {
  22232. class: "item",
  22233. key: i2
  22234. }, [
  22235. vue.createElementVNode(
  22236. "text",
  22237. {
  22238. class: "code",
  22239. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  22240. },
  22241. [
  22242. vue.createTextVNode(
  22243. vue.toDisplayString(item.orderNum) + " ",
  22244. 1
  22245. /* TEXT */
  22246. ),
  22247. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  22248. "text",
  22249. { key: 0 },
  22250. "批次号: " + vue.toDisplayString(item.batch_text),
  22251. 1
  22252. /* TEXT */
  22253. )) : vue.createCommentVNode("v-if", true),
  22254. item.space ? (vue.openBlock(), vue.createElementBlock(
  22255. "text",
  22256. { key: 1 },
  22257. "仓位编码: " + vue.toDisplayString(item.space),
  22258. 1
  22259. /* TEXT */
  22260. )) : vue.createCommentVNode("v-if", true),
  22261. vue.createTextVNode(
  22262. " " + vue.toDisplayString(item.type),
  22263. 1
  22264. /* TEXT */
  22265. )
  22266. ],
  22267. 4
  22268. /* STYLE */
  22269. ),
  22270. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  22271. key: 0,
  22272. type: "checkmarkempty",
  22273. class: "status",
  22274. size: "16",
  22275. color: "green"
  22276. })) : (vue.openBlock(), vue.createElementBlock("text", {
  22277. key: 1,
  22278. class: "status fail"
  22279. }, "F")),
  22280. vue.createElementVNode(
  22281. "text",
  22282. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  22283. vue.toDisplayString("\r\n" + item.createTime),
  22284. 1
  22285. /* TEXT */
  22286. )
  22287. ]);
  22288. }),
  22289. 128
  22290. /* KEYED_FRAGMENT */
  22291. ))
  22292. ]),
  22293. vue.createVNode(
  22294. _component_uni_popup,
  22295. {
  22296. ref: "message",
  22297. type: "message"
  22298. },
  22299. {
  22300. default: vue.withCtx(() => [
  22301. vue.createVNode(_component_uni_popup_message, {
  22302. type: $setup.messageType,
  22303. message: $setup.messageText,
  22304. duration: 2e3
  22305. }, null, 8, ["type", "message"])
  22306. ]),
  22307. _: 1
  22308. /* STABLE */
  22309. },
  22310. 512
  22311. /* NEED_PATCH */
  22312. ),
  22313. vue.createVNode(
  22314. _component_uni_popup,
  22315. {
  22316. ref: "alertDialog",
  22317. type: "dialog"
  22318. },
  22319. {
  22320. default: vue.withCtx(() => [
  22321. vue.createVNode(_component_uni_popup_dialog, {
  22322. type: "info",
  22323. cancelText: "否",
  22324. confirmText: "是",
  22325. title: "提示",
  22326. content: "是否按默认申报(默认申报为:衣服,10件,单价1)",
  22327. onConfirm: $setup.dialogConfirm,
  22328. onClose: $setup.dialogClose
  22329. })
  22330. ]),
  22331. _: 1
  22332. /* STABLE */
  22333. },
  22334. 512
  22335. /* NEED_PATCH */
  22336. ),
  22337. vue.createVNode(
  22338. _component_uni_popup,
  22339. {
  22340. ref: "printerDialog",
  22341. type: "dialog",
  22342. "is-mask-click": false
  22343. },
  22344. {
  22345. default: vue.withCtx(() => [
  22346. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  22347. vue.createElementVNode("view", {
  22348. class: "",
  22349. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  22350. }, [
  22351. vue.createElementVNode("view", null, [
  22352. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  22353. vue.createElementVNode("text", null, "打印尾程面单")
  22354. ]),
  22355. vue.createElementVNode("view", null, [
  22356. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  22357. vue.createElementVNode("view", null, [
  22358. vue.createVNode(_component_uni_data_checkbox, {
  22359. multiple: "",
  22360. modelValue: $setup.sendToPeinter,
  22361. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.sendToPeinter = $event),
  22362. localdata: [
  22363. {
  22364. text: "发送到标签打印机打印",
  22365. value: 1
  22366. }
  22367. ],
  22368. onChange: $setup.sendToPeinterFun
  22369. }, {
  22370. default: vue.withCtx(() => [
  22371. vue.createTextVNode(" > ")
  22372. ]),
  22373. _: 1
  22374. /* STABLE */
  22375. }, 8, ["modelValue"]),
  22376. vue.createVNode(_component_uni_data_checkbox, {
  22377. disabled: $setup.sendToPeinter.length === 0,
  22378. modelValue: $setup.selectPrinter,
  22379. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.selectPrinter = $event),
  22380. localdata: $setup.printers
  22381. }, null, 8, ["disabled", "modelValue", "localdata"])
  22382. ])
  22383. ])) : vue.createCommentVNode("v-if", true)
  22384. ])
  22385. ]),
  22386. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  22387. vue.createElementVNode("button", {
  22388. onClick: $setup.close,
  22389. style: { "width": "35%" }
  22390. }, "关闭"),
  22391. vue.createElementVNode("button", {
  22392. onClick: $setup.printConfirm,
  22393. "hover-stay-time": 500,
  22394. loading: $setup.subLoading,
  22395. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  22396. class: "my-bt-bg",
  22397. style: { "width": "35%" }
  22398. }, " 打印 ", 8, ["loading", "disabled"])
  22399. ])
  22400. ])
  22401. ])
  22402. ]),
  22403. _: 1
  22404. /* STABLE */
  22405. },
  22406. 512
  22407. /* NEED_PATCH */
  22408. )
  22409. ]);
  22410. }
  22411. const PagesInstockIndex = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-0a882863"], ["__file", "E:/HBuilderProjects/YTAPP/pages/instock/index.vue"]]);
  22412. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  22413. __name: "instockLog",
  22414. setup(__props, { expose: __expose }) {
  22415. __expose();
  22416. const instockHistory = vue.ref([]);
  22417. const getHistory = () => {
  22418. instockHistory.value = uni.getStorageSync("instockHistory");
  22419. };
  22420. onLoad(() => {
  22421. getHistory();
  22422. });
  22423. const __returned__ = { instockHistory, getHistory };
  22424. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  22425. return __returned__;
  22426. }
  22427. });
  22428. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  22429. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  22430. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  22431. (vue.openBlock(true), vue.createElementBlock(
  22432. vue.Fragment,
  22433. null,
  22434. vue.renderList($setup.instockHistory, (item, i2) => {
  22435. return vue.openBlock(), vue.createElementBlock("view", { class: "item" }, [
  22436. vue.createElementVNode(
  22437. "text",
  22438. {
  22439. class: "code",
  22440. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  22441. },
  22442. [
  22443. vue.createTextVNode(
  22444. vue.toDisplayString(item.orderNum) + " ",
  22445. 1
  22446. /* TEXT */
  22447. ),
  22448. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  22449. "text",
  22450. { key: 0 },
  22451. "批次号: " + vue.toDisplayString(item.batch_text),
  22452. 1
  22453. /* TEXT */
  22454. )) : vue.createCommentVNode("v-if", true),
  22455. item.space ? (vue.openBlock(), vue.createElementBlock(
  22456. "text",
  22457. { key: 1 },
  22458. "仓位编码: " + vue.toDisplayString(item.space),
  22459. 1
  22460. /* TEXT */
  22461. )) : vue.createCommentVNode("v-if", true),
  22462. vue.createTextVNode(
  22463. " " + vue.toDisplayString(item.type),
  22464. 1
  22465. /* TEXT */
  22466. )
  22467. ],
  22468. 4
  22469. /* STYLE */
  22470. ),
  22471. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  22472. key: 0,
  22473. type: "checkmarkempty",
  22474. class: "status",
  22475. size: "16",
  22476. color: "green"
  22477. })) : (vue.openBlock(), vue.createElementBlock("text", {
  22478. key: 1,
  22479. class: "status fail"
  22480. }, "F")),
  22481. vue.createElementVNode(
  22482. "text",
  22483. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  22484. vue.toDisplayString("\r\n" + item.createTime),
  22485. 1
  22486. /* TEXT */
  22487. )
  22488. ]);
  22489. }),
  22490. 256
  22491. /* UNKEYED_FRAGMENT */
  22492. )),
  22493. $setup.instockHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  22494. key: 0,
  22495. class: "is-empty"
  22496. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  22497. ]);
  22498. }
  22499. const PagesInstockInstockLog = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-02f20d50"], ["__file", "E:/HBuilderProjects/YTAPP/pages/instock/instockLog.vue"]]);
  22500. const _imports_0$2 = "/static/user.png";
  22501. const _sfc_main$k = {
  22502. data() {
  22503. const token = vue.ref(null);
  22504. const user = vue.ref(null);
  22505. return {
  22506. token,
  22507. user
  22508. };
  22509. },
  22510. onLoad() {
  22511. },
  22512. onShow() {
  22513. this.token = uni.getStorageSync("token");
  22514. this.user = uni.getStorageSync("user");
  22515. },
  22516. methods: {
  22517. avatarClick() {
  22518. if (this.token)
  22519. ;
  22520. else {
  22521. uni.navigateTo({
  22522. url: "/pages/login/index"
  22523. });
  22524. }
  22525. },
  22526. logout() {
  22527. uni.removeStorageSync("token");
  22528. uni.removeStorageSync("user");
  22529. this.token = uni.getStorageSync("token");
  22530. this.user = uni.getStorageSync("user");
  22531. },
  22532. dialogToggle() {
  22533. this.$refs.alertDialog.open();
  22534. }
  22535. }
  22536. };
  22537. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  22538. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_0$2);
  22539. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  22540. return vue.openBlock(), vue.createElementBlock("view", { class: "content" }, [
  22541. vue.createElementVNode("view", {
  22542. class: "user-v",
  22543. onClick: _cache[0] || (_cache[0] = (...args) => $options.avatarClick && $options.avatarClick(...args))
  22544. }, [
  22545. !$data.user.avatar ? (vue.openBlock(), vue.createElementBlock("image", {
  22546. key: 0,
  22547. class: "user-icon",
  22548. src: _imports_0$2
  22549. })) : (vue.openBlock(), vue.createElementBlock("image", {
  22550. key: 1,
  22551. class: "user-icon",
  22552. src: $data.user.avatar
  22553. }, null, 8, ["src"]))
  22554. ]),
  22555. vue.createElementVNode("view", { class: "text-area" }, [
  22556. vue.createElementVNode(
  22557. "text",
  22558. { class: "title" },
  22559. vue.toDisplayString($data.user.username),
  22560. 1
  22561. /* TEXT */
  22562. )
  22563. ]),
  22564. vue.createElementVNode("view", { class: "login-btn" }, [
  22565. !$data.token ? (vue.openBlock(), vue.createElementBlock("button", {
  22566. key: 0,
  22567. type: "primary",
  22568. plain: "true",
  22569. size: "mini",
  22570. onClick: _cache[1] || (_cache[1] = (...args) => $options.avatarClick && $options.avatarClick(...args))
  22571. }, "登录")) : (vue.openBlock(), vue.createElementBlock("button", {
  22572. key: 1,
  22573. type: "default",
  22574. plain: "true",
  22575. size: "mini",
  22576. onClick: _cache[2] || (_cache[2] = (...args) => $options.dialogToggle && $options.dialogToggle(...args))
  22577. }, "注销"))
  22578. ]),
  22579. vue.createVNode(
  22580. _component_uni_popup,
  22581. {
  22582. ref: "alertDialog",
  22583. type: "dialog"
  22584. },
  22585. {
  22586. default: vue.withCtx(() => [
  22587. vue.createVNode(_component_uni_popup_dialog, {
  22588. type: "info",
  22589. cancelText: "取消",
  22590. confirmText: "注销",
  22591. title: "注销",
  22592. content: "确定是要注销吗?",
  22593. onConfirm: $options.logout
  22594. }, null, 8, ["onConfirm"])
  22595. ]),
  22596. _: 1
  22597. /* STABLE */
  22598. },
  22599. 512
  22600. /* NEED_PATCH */
  22601. )
  22602. ]);
  22603. }
  22604. const PagesProfileIndex = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__file", "E:/HBuilderProjects/YTAPP/pages/profile/index.vue"]]);
  22605. const _imports_0$1 = "/static/logo.png";
  22606. const _sfc_main$j = {
  22607. data() {
  22608. return {
  22609. messageText: "",
  22610. captcha_id: "f2dd39ce-0d3e-4c1e-916c-b50090a7590s",
  22611. verifyCodeImg: "",
  22612. //验证码图片
  22613. verifyCodeToken: "",
  22614. //图形验证码的验证token
  22615. isVerifyCodeTure: false,
  22616. //验证码输入是否正确
  22617. valiFormData: {
  22618. account: "",
  22619. password: "",
  22620. captcha: ""
  22621. },
  22622. rules: {
  22623. name: {
  22624. rules: [{
  22625. required: true,
  22626. errorMessage: "姓名不能为空"
  22627. }]
  22628. }
  22629. }
  22630. };
  22631. },
  22632. onLoad() {
  22633. this.getVerifyCodeImg();
  22634. },
  22635. methods: {
  22636. getVerifyCodeImg() {
  22637. uni.request({
  22638. url: `${getcaptchaURL}?server=1&id=${this.captcha_id}&m=` + Math.random(),
  22639. method: "GET",
  22640. responseType: "arraybuffer",
  22641. //设置响应类型
  22642. success: (res) => {
  22643. const arrayBuffer = new Uint8Array(res.data);
  22644. const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(
  22645. arrayBuffer
  22646. );
  22647. this.verifyCodeImg = base64;
  22648. this.verifyCodeToken = res.header["Set-Cookie"];
  22649. }
  22650. });
  22651. },
  22652. formSubmit() {
  22653. uni.request({
  22654. //api地址
  22655. url: loginURL,
  22656. data: {
  22657. "username": this.valiFormData.account,
  22658. "password": this.valiFormData.password,
  22659. "captcha": this.valiFormData.captcha,
  22660. "keep": false,
  22661. "loading": true,
  22662. "captcha_id": this.captcha_id
  22663. },
  22664. //请求类型
  22665. method: "POST",
  22666. success: (res) => {
  22667. formatAppLog("log", "at pages/login/index.vue:100", res);
  22668. if (res.data.code == 1) {
  22669. const userInfo = res.data.data.userInfo;
  22670. uni.setStorage({
  22671. key: "token",
  22672. data: userInfo.token,
  22673. success() {
  22674. uni.setStorage({
  22675. key: "user",
  22676. data: userInfo,
  22677. success() {
  22678. uni.navigateBack();
  22679. }
  22680. });
  22681. }
  22682. });
  22683. } else {
  22684. formatAppLog("log", "at pages/login/index.vue:120", res);
  22685. this.messageText = res.data.msg;
  22686. this.$refs.message.open();
  22687. }
  22688. }
  22689. });
  22690. }
  22691. }
  22692. };
  22693. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  22694. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  22695. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  22696. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  22697. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  22698. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  22699. return vue.openBlock(), vue.createElementBlock("view", { class: "contaier" }, [
  22700. vue.createElementVNode("view", { class: "top-bg" }, [
  22701. vue.createElementVNode("image", {
  22702. class: "logo-icon",
  22703. src: _imports_0$1
  22704. })
  22705. ]),
  22706. vue.createElementVNode("view", { class: "input-box padding-lr" }, [
  22707. vue.createVNode(_component_uni_forms, {
  22708. ref: "valiForm",
  22709. rules: $data.rules,
  22710. modelValue: $data.valiFormData
  22711. }, {
  22712. default: vue.withCtx(() => [
  22713. vue.createElementVNode("view", { class: "cu-form-group margin-top" }, [
  22714. vue.createVNode(_component_uni_icons, {
  22715. class: "uni-icon",
  22716. type: "person",
  22717. size: "30",
  22718. color: "#999"
  22719. }),
  22720. vue.createVNode(_component_uni_easyinput, {
  22721. placeholder: "账号",
  22722. modelValue: $data.valiFormData.account,
  22723. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.valiFormData.account = $event)
  22724. }, null, 8, ["modelValue"])
  22725. ]),
  22726. vue.createElementVNode("view", { class: "cu-form-group" }, [
  22727. vue.createVNode(_component_uni_icons, {
  22728. class: "uni-icon",
  22729. type: "locked",
  22730. size: "30",
  22731. color: "#999"
  22732. }),
  22733. vue.createVNode(_component_uni_easyinput, {
  22734. placeholder: "密码",
  22735. type: "password",
  22736. modelValue: $data.valiFormData.password,
  22737. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.valiFormData.password = $event)
  22738. }, null, 8, ["modelValue"])
  22739. ]),
  22740. vue.createElementVNode("view", { class: "cu-form-group solid-bottom" }, [
  22741. vue.createVNode(_component_uni_icons, {
  22742. class: "uni-icon",
  22743. type: "more-filled",
  22744. size: "30",
  22745. color: "#999"
  22746. }),
  22747. vue.createVNode(_component_uni_easyinput, {
  22748. placeholder: "验证码",
  22749. modelValue: $data.valiFormData.captcha,
  22750. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.valiFormData.captcha = $event)
  22751. }, null, 8, ["modelValue"]),
  22752. vue.createCommentVNode(" <button class='cu-btn bg-login-zl shadow'>验证码</button> "),
  22753. vue.createElementVNode("image", {
  22754. class: "cu-btn captchaImg",
  22755. src: $data.verifyCodeImg,
  22756. onClick: _cache[3] || (_cache[3] = (...args) => $options.getVerifyCodeImg && $options.getVerifyCodeImg(...args))
  22757. }, null, 8, ["src"])
  22758. ])
  22759. ]),
  22760. _: 1
  22761. /* STABLE */
  22762. }, 8, ["rules", "modelValue"])
  22763. ]),
  22764. vue.createElementVNode("view", { class: "padding-lr margin-top-xs" }, [
  22765. vue.createElementVNode("button", {
  22766. class: "cu-btn block round bg-login-zl margin-tb-sm lg",
  22767. onClick: _cache[4] || (_cache[4] = ($event) => $options.formSubmit("valiForm"))
  22768. }, "立即登录")
  22769. ]),
  22770. vue.createVNode(
  22771. _component_uni_popup,
  22772. {
  22773. ref: "message",
  22774. type: "message"
  22775. },
  22776. {
  22777. default: vue.withCtx(() => [
  22778. vue.createVNode(_component_uni_popup_message, {
  22779. type: "error",
  22780. message: $data.messageText,
  22781. duration: 2e3
  22782. }, null, 8, ["message"])
  22783. ]),
  22784. _: 1
  22785. /* STABLE */
  22786. },
  22787. 512
  22788. /* NEED_PATCH */
  22789. )
  22790. ]);
  22791. }
  22792. const PagesLoginIndex = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__scopeId", "data-v-d08ef7d4"], ["__file", "E:/HBuilderProjects/YTAPP/pages/login/index.vue"]]);
  22793. const _sfc_main$i = {
  22794. data() {
  22795. const token = vue.ref(null);
  22796. const user = vue.ref(null);
  22797. return {
  22798. token,
  22799. user
  22800. };
  22801. },
  22802. onLoad() {
  22803. },
  22804. onShow() {
  22805. this.token = uni.getStorageSync("token");
  22806. this.user = uni.getStorageSync("user");
  22807. },
  22808. methods: {
  22809. avatarClick() {
  22810. if (this.token)
  22811. ;
  22812. else {
  22813. uni.navigateTo({
  22814. url: "/pages/login/index"
  22815. });
  22816. }
  22817. },
  22818. logout() {
  22819. uni.removeStorageSync("token");
  22820. uni.removeStorageSync("user");
  22821. this.token = uni.getStorageSync("token");
  22822. this.user = uni.getStorageSync("user");
  22823. },
  22824. dialogToggle() {
  22825. this.$refs.alertDialog.open();
  22826. }
  22827. }
  22828. };
  22829. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  22830. return vue.openBlock(), vue.createElementBlock("view", { class: "content" });
  22831. }
  22832. const PagesOrderIndex = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__file", "E:/HBuilderProjects/YTAPP/pages/order/index.vue"]]);
  22833. const dataPicker = {
  22834. props: {
  22835. localdata: {
  22836. type: [Array, Object],
  22837. default() {
  22838. return [];
  22839. }
  22840. },
  22841. spaceInfo: {
  22842. type: Object,
  22843. default() {
  22844. return {};
  22845. }
  22846. },
  22847. collection: {
  22848. type: String,
  22849. default: ""
  22850. },
  22851. action: {
  22852. type: String,
  22853. default: ""
  22854. },
  22855. field: {
  22856. type: String,
  22857. default: ""
  22858. },
  22859. orderby: {
  22860. type: String,
  22861. default: ""
  22862. },
  22863. where: {
  22864. type: [String, Object],
  22865. default: ""
  22866. },
  22867. pageData: {
  22868. type: String,
  22869. default: "add"
  22870. },
  22871. pageCurrent: {
  22872. type: Number,
  22873. default: 1
  22874. },
  22875. pageSize: {
  22876. type: Number,
  22877. default: 500
  22878. },
  22879. getcount: {
  22880. type: [Boolean, String],
  22881. default: false
  22882. },
  22883. getone: {
  22884. type: [Boolean, String],
  22885. default: false
  22886. },
  22887. gettree: {
  22888. type: [Boolean, String],
  22889. default: false
  22890. },
  22891. manual: {
  22892. type: Boolean,
  22893. default: false
  22894. },
  22895. value: {
  22896. type: [Array, String, Number],
  22897. default() {
  22898. return [];
  22899. }
  22900. },
  22901. modelValue: {
  22902. type: [Array, String, Number],
  22903. default() {
  22904. return [];
  22905. }
  22906. },
  22907. preload: {
  22908. type: Boolean,
  22909. default: false
  22910. },
  22911. stepSearh: {
  22912. type: Boolean,
  22913. default: true
  22914. },
  22915. selfField: {
  22916. type: String,
  22917. default: ""
  22918. },
  22919. parentField: {
  22920. type: String,
  22921. default: ""
  22922. },
  22923. multiple: {
  22924. type: Boolean,
  22925. default: false
  22926. },
  22927. map: {
  22928. type: Object,
  22929. default() {
  22930. return {
  22931. text: "text",
  22932. value: "value"
  22933. };
  22934. }
  22935. }
  22936. },
  22937. data() {
  22938. return {
  22939. loading: false,
  22940. errorMessage: "",
  22941. loadMore: {
  22942. contentdown: "",
  22943. contentrefresh: "",
  22944. contentnomore: ""
  22945. },
  22946. dataList: [],
  22947. selected: [],
  22948. selectedIndex: 0,
  22949. page: {
  22950. current: this.pageCurrent,
  22951. size: this.pageSize,
  22952. count: 0
  22953. }
  22954. };
  22955. },
  22956. computed: {
  22957. isLocalData() {
  22958. return !this.collection.length;
  22959. },
  22960. isCloudData() {
  22961. return this.collection.length > 0;
  22962. },
  22963. isCloudDataList() {
  22964. return this.isCloudData && (!this.parentField && !this.selfField);
  22965. },
  22966. isCloudDataTree() {
  22967. return this.isCloudData && this.parentField && this.selfField;
  22968. },
  22969. dataValue() {
  22970. let isModelValue = Array.isArray(this.modelValue) ? this.modelValue.length > 0 : this.modelValue !== null || this.modelValue !== void 0;
  22971. return isModelValue ? this.modelValue : this.value;
  22972. },
  22973. hasValue() {
  22974. if (typeof this.dataValue === "number") {
  22975. return true;
  22976. }
  22977. return this.dataValue != null && this.dataValue.length > 0;
  22978. }
  22979. },
  22980. created() {
  22981. this.$watch(() => {
  22982. var al = [];
  22983. [
  22984. "pageCurrent",
  22985. "pageSize",
  22986. "spaceInfo",
  22987. "value",
  22988. "modelValue",
  22989. "localdata",
  22990. "collection",
  22991. "action",
  22992. "field",
  22993. "orderby",
  22994. "where",
  22995. "getont",
  22996. "getcount",
  22997. "gettree"
  22998. ].forEach((key) => {
  22999. al.push(this[key]);
  23000. });
  23001. return al;
  23002. }, (newValue, oldValue) => {
  23003. for (let i2 = 2; i2 < newValue.length; i2++) {
  23004. if (newValue[i2] != oldValue[i2]) {
  23005. break;
  23006. }
  23007. }
  23008. if (newValue[0] != oldValue[0]) {
  23009. this.page.current = this.pageCurrent;
  23010. }
  23011. this.page.size = this.pageSize;
  23012. this.onPropsChange();
  23013. });
  23014. this._treeData = [];
  23015. },
  23016. methods: {
  23017. onPropsChange() {
  23018. this._treeData = [];
  23019. },
  23020. // 填充 pickview 数据
  23021. async loadData() {
  23022. if (this.isLocalData) {
  23023. this.loadLocalData();
  23024. } else if (this.isCloudDataList) {
  23025. this.loadCloudDataList();
  23026. } else if (this.isCloudDataTree) {
  23027. this.loadCloudDataTree();
  23028. }
  23029. },
  23030. // 加载本地数据
  23031. async loadLocalData() {
  23032. this._treeData = [];
  23033. this._extractTree(this.localdata, this._treeData);
  23034. let inputValue = this.dataValue;
  23035. if (inputValue === void 0) {
  23036. return;
  23037. }
  23038. if (Array.isArray(inputValue)) {
  23039. inputValue = inputValue[inputValue.length - 1];
  23040. if (typeof inputValue === "object" && inputValue[this.map.value]) {
  23041. inputValue = inputValue[this.map.value];
  23042. }
  23043. }
  23044. this.selected = this._findNodePath(inputValue, this.localdata);
  23045. },
  23046. // 加载 Cloud 数据 (单列)
  23047. async loadCloudDataList() {
  23048. if (this.loading) {
  23049. return;
  23050. }
  23051. this.loading = true;
  23052. try {
  23053. let response = await this.getCommand();
  23054. let responseData = response.result.data;
  23055. this._treeData = responseData;
  23056. this._updateBindData();
  23057. this._updateSelected();
  23058. this.onDataChange();
  23059. } catch (e2) {
  23060. this.errorMessage = e2;
  23061. } finally {
  23062. this.loading = false;
  23063. }
  23064. },
  23065. // 加载 Cloud 数据 (树形)
  23066. async loadCloudDataTree() {
  23067. if (this.loading) {
  23068. return;
  23069. }
  23070. this.loading = true;
  23071. try {
  23072. let commandOptions = {
  23073. field: this._cloudDataPostField(),
  23074. where: this._cloudDataTreeWhere()
  23075. };
  23076. if (this.gettree) {
  23077. commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`;
  23078. }
  23079. let response = await this.getCommand(commandOptions);
  23080. let responseData = response.result.data;
  23081. this._treeData = responseData;
  23082. this._updateBindData();
  23083. this._updateSelected();
  23084. this.onDataChange();
  23085. } catch (e2) {
  23086. this.errorMessage = e2;
  23087. } finally {
  23088. this.loading = false;
  23089. }
  23090. },
  23091. // 加载 Cloud 数据 (节点)
  23092. async loadCloudDataNode(callback) {
  23093. if (this.loading) {
  23094. return;
  23095. }
  23096. this.loading = true;
  23097. try {
  23098. let commandOptions = {
  23099. field: this._cloudDataPostField(),
  23100. where: this._cloudDataNodeWhere()
  23101. };
  23102. let response = await this.getCommand(commandOptions);
  23103. let responseData = response.result.data;
  23104. callback(responseData);
  23105. } catch (e2) {
  23106. this.errorMessage = e2;
  23107. } finally {
  23108. this.loading = false;
  23109. }
  23110. },
  23111. // 回显 Cloud 数据
  23112. getCloudDataValue() {
  23113. if (this.isCloudDataList) {
  23114. return this.getCloudDataListValue();
  23115. }
  23116. if (this.isCloudDataTree) {
  23117. return this.getCloudDataTreeValue();
  23118. }
  23119. },
  23120. // 回显 Cloud 数据 (单列)
  23121. getCloudDataListValue() {
  23122. let where = [];
  23123. let whereField = this._getForeignKeyByField();
  23124. if (whereField) {
  23125. where.push(`${whereField} == '${this.dataValue}'`);
  23126. }
  23127. where = where.join(" || ");
  23128. if (this.where) {
  23129. where = `(${this.where}) && (${where})`;
  23130. }
  23131. return this.getCommand({
  23132. field: this._cloudDataPostField(),
  23133. where
  23134. }).then((res) => {
  23135. this.selected = res.result.data;
  23136. return res.result.data;
  23137. });
  23138. },
  23139. // 回显 Cloud 数据 (树形)
  23140. getCloudDataTreeValue() {
  23141. return this.getCommand({
  23142. field: this._cloudDataPostField(),
  23143. getTreePath: {
  23144. startWith: `${this.selfField}=='${this.dataValue}'`
  23145. }
  23146. }).then((res) => {
  23147. let treePath = [];
  23148. this._extractTreePath(res.result.data, treePath);
  23149. this.selected = treePath;
  23150. return treePath;
  23151. });
  23152. },
  23153. getCommand(options = {}) {
  23154. let db = Ys.database(this.spaceInfo);
  23155. const action = options.action || this.action;
  23156. if (action) {
  23157. db = db.action(action);
  23158. }
  23159. const collection = options.collection || this.collection;
  23160. db = db.collection(collection);
  23161. const where = options.where || this.where;
  23162. if (!(!where || !Object.keys(where).length)) {
  23163. db = db.where(where);
  23164. }
  23165. const field = options.field || this.field;
  23166. if (field) {
  23167. db = db.field(field);
  23168. }
  23169. const orderby = options.orderby || this.orderby;
  23170. if (orderby) {
  23171. db = db.orderBy(orderby);
  23172. }
  23173. const current = options.pageCurrent !== void 0 ? options.pageCurrent : this.page.current;
  23174. const size = options.pageSize !== void 0 ? options.pageSize : this.page.size;
  23175. const getCount = options.getcount !== void 0 ? options.getcount : this.getcount;
  23176. const getTree = options.gettree !== void 0 ? options.gettree : this.gettree;
  23177. const getOptions = {
  23178. getCount,
  23179. getTree
  23180. };
  23181. if (options.getTreePath) {
  23182. getOptions.getTreePath = options.getTreePath;
  23183. }
  23184. db = db.skip(size * (current - 1)).limit(size).get(getOptions);
  23185. return db;
  23186. },
  23187. _cloudDataPostField() {
  23188. let fields = [this.field];
  23189. if (this.parentField) {
  23190. fields.push(`${this.parentField} as parent_value`);
  23191. }
  23192. return fields.join(",");
  23193. },
  23194. _cloudDataTreeWhere() {
  23195. let result = [];
  23196. let selected = this.selected;
  23197. let parentField = this.parentField;
  23198. if (parentField) {
  23199. result.push(`${parentField} == null || ${parentField} == ""`);
  23200. }
  23201. if (selected.length) {
  23202. for (var i2 = 0; i2 < selected.length - 1; i2++) {
  23203. result.push(`${parentField} == '${selected[i2].value}'`);
  23204. }
  23205. }
  23206. let where = [];
  23207. if (this.where) {
  23208. where.push(`(${this.where})`);
  23209. }
  23210. if (result.length) {
  23211. where.push(`(${result.join(" || ")})`);
  23212. }
  23213. return where.join(" && ");
  23214. },
  23215. _cloudDataNodeWhere() {
  23216. let where = [];
  23217. let selected = this.selected;
  23218. if (selected.length) {
  23219. where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
  23220. }
  23221. where = where.join(" || ");
  23222. if (this.where) {
  23223. return `(${this.where}) && (${where})`;
  23224. }
  23225. return where;
  23226. },
  23227. _getWhereByForeignKey() {
  23228. let result = [];
  23229. let whereField = this._getForeignKeyByField();
  23230. if (whereField) {
  23231. result.push(`${whereField} == '${this.dataValue}'`);
  23232. }
  23233. if (this.where) {
  23234. return `(${this.where}) && (${result.join(" || ")})`;
  23235. }
  23236. return result.join(" || ");
  23237. },
  23238. _getForeignKeyByField() {
  23239. let fields = this.field.split(",");
  23240. let whereField = null;
  23241. for (let i2 = 0; i2 < fields.length; i2++) {
  23242. const items = fields[i2].split("as");
  23243. if (items.length < 2) {
  23244. continue;
  23245. }
  23246. if (items[1].trim() === "value") {
  23247. whereField = items[0].trim();
  23248. break;
  23249. }
  23250. }
  23251. return whereField;
  23252. },
  23253. _updateBindData(node) {
  23254. const {
  23255. dataList,
  23256. hasNodes
  23257. } = this._filterData(this._treeData, this.selected);
  23258. let isleaf = this._stepSearh === false && !hasNodes;
  23259. if (node) {
  23260. node.isleaf = isleaf;
  23261. }
  23262. this.dataList = dataList;
  23263. this.selectedIndex = dataList.length - 1;
  23264. if (!isleaf && this.selected.length < dataList.length) {
  23265. this.selected.push({
  23266. value: null,
  23267. text: "请选择"
  23268. });
  23269. }
  23270. return {
  23271. isleaf,
  23272. hasNodes
  23273. };
  23274. },
  23275. _updateSelected() {
  23276. let dl = this.dataList;
  23277. let sl = this.selected;
  23278. let textField = this.map.text;
  23279. let valueField = this.map.value;
  23280. for (let i2 = 0; i2 < sl.length; i2++) {
  23281. let value = sl[i2].value;
  23282. let dl2 = dl[i2];
  23283. for (let j2 = 0; j2 < dl2.length; j2++) {
  23284. let item2 = dl2[j2];
  23285. if (item2[valueField] === value) {
  23286. sl[i2].text = item2[textField];
  23287. break;
  23288. }
  23289. }
  23290. }
  23291. },
  23292. _filterData(data, paths) {
  23293. let dataList = [];
  23294. let hasNodes = true;
  23295. dataList.push(data.filter((item) => {
  23296. return item.parent_value === null || item.parent_value === void 0 || item.parent_value === "";
  23297. }));
  23298. for (let i2 = 0; i2 < paths.length; i2++) {
  23299. let value = paths[i2].value;
  23300. let nodes = data.filter((item) => {
  23301. return item.parent_value === value;
  23302. });
  23303. if (nodes.length) {
  23304. dataList.push(nodes);
  23305. } else {
  23306. hasNodes = false;
  23307. }
  23308. }
  23309. return {
  23310. dataList,
  23311. hasNodes
  23312. };
  23313. },
  23314. _extractTree(nodes, result, parent_value) {
  23315. let valueField = this.map.value;
  23316. for (let i2 = 0; i2 < nodes.length; i2++) {
  23317. let node = nodes[i2];
  23318. let child = {};
  23319. for (let key in node) {
  23320. if (key !== "children") {
  23321. child[key] = node[key];
  23322. }
  23323. }
  23324. if (parent_value !== null && parent_value !== void 0 && parent_value !== "") {
  23325. child.parent_value = parent_value;
  23326. }
  23327. result.push(child);
  23328. let children = node.children;
  23329. if (children) {
  23330. this._extractTree(children, result, node[valueField]);
  23331. }
  23332. }
  23333. },
  23334. _extractTreePath(nodes, result) {
  23335. for (let i2 = 0; i2 < nodes.length; i2++) {
  23336. let node = nodes[i2];
  23337. let child = {};
  23338. for (let key in node) {
  23339. if (key !== "children") {
  23340. child[key] = node[key];
  23341. }
  23342. }
  23343. result.push(child);
  23344. let children = node.children;
  23345. if (children) {
  23346. this._extractTreePath(children, result);
  23347. }
  23348. }
  23349. },
  23350. _findNodePath(key, nodes, path = []) {
  23351. let textField = this.map.text;
  23352. let valueField = this.map.value;
  23353. for (let i2 = 0; i2 < nodes.length; i2++) {
  23354. let node = nodes[i2];
  23355. let children = node.children;
  23356. let text = node[textField];
  23357. let value = node[valueField];
  23358. path.push({
  23359. value,
  23360. text
  23361. });
  23362. if (value === key) {
  23363. return path;
  23364. }
  23365. if (children) {
  23366. const p2 = this._findNodePath(key, children, path);
  23367. if (p2.length) {
  23368. return p2;
  23369. }
  23370. }
  23371. path.pop();
  23372. }
  23373. return [];
  23374. }
  23375. }
  23376. };
  23377. const _sfc_main$h = {
  23378. name: "UniDataPickerView",
  23379. emits: ["nodeclick", "change", "datachange", "update:modelValue"],
  23380. mixins: [dataPicker],
  23381. props: {
  23382. managedMode: {
  23383. type: Boolean,
  23384. default: false
  23385. },
  23386. ellipsis: {
  23387. type: Boolean,
  23388. default: true
  23389. }
  23390. },
  23391. created() {
  23392. if (!this.managedMode) {
  23393. this.$nextTick(() => {
  23394. this.loadData();
  23395. });
  23396. }
  23397. },
  23398. methods: {
  23399. onPropsChange() {
  23400. this._treeData = [];
  23401. this.selectedIndex = 0;
  23402. this.$nextTick(() => {
  23403. this.loadData();
  23404. });
  23405. },
  23406. handleSelect(index) {
  23407. this.selectedIndex = index;
  23408. },
  23409. handleNodeClick(item, i2, j2) {
  23410. if (item.disable) {
  23411. return;
  23412. }
  23413. const node = this.dataList[i2][j2];
  23414. const text = node[this.map.text];
  23415. const value = node[this.map.value];
  23416. if (i2 < this.selected.length - 1) {
  23417. this.selected.splice(i2, this.selected.length - i2);
  23418. this.selected.push({
  23419. text,
  23420. value
  23421. });
  23422. } else if (i2 === this.selected.length - 1) {
  23423. this.selected.splice(i2, 1, {
  23424. text,
  23425. value
  23426. });
  23427. }
  23428. if (node.isleaf) {
  23429. this.onSelectedChange(node, node.isleaf);
  23430. return;
  23431. }
  23432. const {
  23433. isleaf,
  23434. hasNodes
  23435. } = this._updateBindData();
  23436. if (this.isLocalData) {
  23437. this.onSelectedChange(node, !hasNodes || isleaf);
  23438. } else if (this.isCloudDataList) {
  23439. this.onSelectedChange(node, true);
  23440. } else if (this.isCloudDataTree) {
  23441. if (isleaf) {
  23442. this.onSelectedChange(node, node.isleaf);
  23443. } else if (!hasNodes) {
  23444. this.loadCloudDataNode((data) => {
  23445. if (!data.length) {
  23446. node.isleaf = true;
  23447. } else {
  23448. this._treeData.push(...data);
  23449. this._updateBindData(node);
  23450. }
  23451. this.onSelectedChange(node, node.isleaf);
  23452. });
  23453. }
  23454. }
  23455. },
  23456. updateData(data) {
  23457. this._treeData = data.treeData;
  23458. this.selected = data.selected;
  23459. if (!this._treeData.length) {
  23460. this.loadData();
  23461. } else {
  23462. this._updateBindData();
  23463. }
  23464. },
  23465. onDataChange() {
  23466. this.$emit("datachange");
  23467. },
  23468. onSelectedChange(node, isleaf) {
  23469. if (isleaf) {
  23470. this._dispatchEvent();
  23471. }
  23472. if (node) {
  23473. this.$emit("nodeclick", node);
  23474. }
  23475. },
  23476. _dispatchEvent() {
  23477. this.$emit("change", this.selected.slice(0));
  23478. }
  23479. }
  23480. };
  23481. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  23482. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$5);
  23483. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-pickerview" }, [
  23484. !_ctx.isCloudDataList ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  23485. key: 0,
  23486. class: "selected-area",
  23487. "scroll-x": "true"
  23488. }, [
  23489. vue.createElementVNode("view", { class: "selected-list" }, [
  23490. (vue.openBlock(true), vue.createElementBlock(
  23491. vue.Fragment,
  23492. null,
  23493. vue.renderList(_ctx.selected, (item, index) => {
  23494. return vue.openBlock(), vue.createElementBlock("view", {
  23495. class: vue.normalizeClass(["selected-item", {
  23496. "selected-item-active": index == _ctx.selectedIndex
  23497. }]),
  23498. key: index,
  23499. onClick: ($event) => $options.handleSelect(index)
  23500. }, [
  23501. vue.createElementVNode(
  23502. "text",
  23503. null,
  23504. vue.toDisplayString(item.text || ""),
  23505. 1
  23506. /* TEXT */
  23507. )
  23508. ], 10, ["onClick"]);
  23509. }),
  23510. 128
  23511. /* KEYED_FRAGMENT */
  23512. ))
  23513. ])
  23514. ])) : vue.createCommentVNode("v-if", true),
  23515. vue.createElementVNode("view", { class: "tab-c" }, [
  23516. vue.createElementVNode("scroll-view", {
  23517. class: "list",
  23518. "scroll-y": true
  23519. }, [
  23520. (vue.openBlock(true), vue.createElementBlock(
  23521. vue.Fragment,
  23522. null,
  23523. vue.renderList(_ctx.dataList[_ctx.selectedIndex], (item, j2) => {
  23524. return vue.openBlock(), vue.createElementBlock("view", {
  23525. class: vue.normalizeClass(["item", { "is-disabled": !!item.disable }]),
  23526. key: j2,
  23527. onClick: ($event) => $options.handleNodeClick(item, _ctx.selectedIndex, j2)
  23528. }, [
  23529. vue.createElementVNode(
  23530. "text",
  23531. { class: "item-text" },
  23532. vue.toDisplayString(item[_ctx.map.text]),
  23533. 1
  23534. /* TEXT */
  23535. ),
  23536. _ctx.selected.length > _ctx.selectedIndex && item[_ctx.map.value] == _ctx.selected[_ctx.selectedIndex].value ? (vue.openBlock(), vue.createElementBlock("view", {
  23537. key: 0,
  23538. class: "check"
  23539. })) : vue.createCommentVNode("v-if", true)
  23540. ], 10, ["onClick"]);
  23541. }),
  23542. 128
  23543. /* KEYED_FRAGMENT */
  23544. ))
  23545. ]),
  23546. _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  23547. key: 0,
  23548. class: "loading-cover"
  23549. }, [
  23550. vue.createVNode(_component_uni_load_more, {
  23551. class: "load-more",
  23552. contentText: _ctx.loadMore,
  23553. status: "loading"
  23554. }, null, 8, ["contentText"])
  23555. ])) : vue.createCommentVNode("v-if", true),
  23556. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock("view", {
  23557. key: 1,
  23558. class: "error-message"
  23559. }, [
  23560. vue.createElementVNode(
  23561. "text",
  23562. { class: "error-text" },
  23563. vue.toDisplayString(_ctx.errorMessage),
  23564. 1
  23565. /* TEXT */
  23566. )
  23567. ])) : vue.createCommentVNode("v-if", true)
  23568. ])
  23569. ]);
  23570. }
  23571. const DataPickerView = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-91ec6a82"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue"]]);
  23572. const _sfc_main$g = {
  23573. name: "UniDataPicker",
  23574. emits: ["popupopened", "popupclosed", "nodeclick", "input", "change", "update:modelValue", "inputclick"],
  23575. mixins: [dataPicker],
  23576. components: {
  23577. DataPickerView
  23578. },
  23579. props: {
  23580. options: {
  23581. type: [Object, Array],
  23582. default() {
  23583. return {};
  23584. }
  23585. },
  23586. popupTitle: {
  23587. type: String,
  23588. default: "请选择"
  23589. },
  23590. placeholder: {
  23591. type: String,
  23592. default: "请选择"
  23593. },
  23594. heightMobile: {
  23595. type: String,
  23596. default: ""
  23597. },
  23598. readonly: {
  23599. type: Boolean,
  23600. default: false
  23601. },
  23602. clearIcon: {
  23603. type: Boolean,
  23604. default: true
  23605. },
  23606. border: {
  23607. type: Boolean,
  23608. default: true
  23609. },
  23610. split: {
  23611. type: String,
  23612. default: "/"
  23613. },
  23614. ellipsis: {
  23615. type: Boolean,
  23616. default: true
  23617. }
  23618. },
  23619. data() {
  23620. return {
  23621. isOpened: false,
  23622. inputSelected: []
  23623. };
  23624. },
  23625. created() {
  23626. this.$nextTick(() => {
  23627. this.load();
  23628. });
  23629. },
  23630. watch: {
  23631. localdata: {
  23632. handler() {
  23633. this.load();
  23634. },
  23635. deep: true
  23636. }
  23637. },
  23638. methods: {
  23639. clear() {
  23640. this._dispatchEvent([]);
  23641. },
  23642. onPropsChange() {
  23643. this._treeData = [];
  23644. this.selectedIndex = 0;
  23645. this.load();
  23646. },
  23647. load() {
  23648. if (this.readonly) {
  23649. this._processReadonly(this.localdata, this.dataValue);
  23650. return;
  23651. }
  23652. if (this.isLocalData) {
  23653. this.loadData();
  23654. this.inputSelected = this.selected.slice(0);
  23655. } else if (this.isCloudDataList || this.isCloudDataTree) {
  23656. this.loading = true;
  23657. this.getCloudDataValue().then((res) => {
  23658. this.loading = false;
  23659. this.inputSelected = res;
  23660. }).catch((err) => {
  23661. this.loading = false;
  23662. this.errorMessage = err;
  23663. });
  23664. }
  23665. },
  23666. show() {
  23667. this.isOpened = true;
  23668. setTimeout(() => {
  23669. this.$refs.pickerView.updateData({
  23670. treeData: this._treeData,
  23671. selected: this.selected,
  23672. selectedIndex: this.selectedIndex
  23673. });
  23674. }, 200);
  23675. this.$emit("popupopened");
  23676. },
  23677. hide() {
  23678. this.isOpened = false;
  23679. this.$emit("popupclosed");
  23680. },
  23681. handleInput() {
  23682. if (this.readonly) {
  23683. this.$emit("inputclick");
  23684. return;
  23685. }
  23686. this.show();
  23687. },
  23688. handleClose(e2) {
  23689. this.hide();
  23690. },
  23691. onnodeclick(e2) {
  23692. this.$emit("nodeclick", e2);
  23693. },
  23694. ondatachange(e2) {
  23695. this._treeData = this.$refs.pickerView._treeData;
  23696. },
  23697. onchange(e2) {
  23698. this.hide();
  23699. this.$nextTick(() => {
  23700. this.inputSelected = e2;
  23701. });
  23702. this._dispatchEvent(e2);
  23703. },
  23704. _processReadonly(dataList, value) {
  23705. var isTree = dataList.findIndex((item2) => {
  23706. return item2.children;
  23707. });
  23708. if (isTree > -1) {
  23709. let inputValue;
  23710. if (Array.isArray(value)) {
  23711. inputValue = value[value.length - 1];
  23712. if (typeof inputValue === "object" && inputValue.value) {
  23713. inputValue = inputValue.value;
  23714. }
  23715. } else {
  23716. inputValue = value;
  23717. }
  23718. this.inputSelected = this._findNodePath(inputValue, this.localdata);
  23719. return;
  23720. }
  23721. if (!this.hasValue) {
  23722. this.inputSelected = [];
  23723. return;
  23724. }
  23725. let result = [];
  23726. for (let i2 = 0; i2 < value.length; i2++) {
  23727. var val = value[i2];
  23728. var item = dataList.find((v2) => {
  23729. return v2.value == val;
  23730. });
  23731. if (item) {
  23732. result.push(item);
  23733. }
  23734. }
  23735. if (result.length) {
  23736. this.inputSelected = result;
  23737. }
  23738. },
  23739. _filterForArray(data, valueArray) {
  23740. var result = [];
  23741. for (let i2 = 0; i2 < valueArray.length; i2++) {
  23742. var value = valueArray[i2];
  23743. var found = data.find((item) => {
  23744. return item.value == value;
  23745. });
  23746. if (found) {
  23747. result.push(found);
  23748. }
  23749. }
  23750. return result;
  23751. },
  23752. _dispatchEvent(selected) {
  23753. let item = {};
  23754. if (selected.length) {
  23755. var value = new Array(selected.length);
  23756. for (var i2 = 0; i2 < selected.length; i2++) {
  23757. value[i2] = selected[i2].value;
  23758. }
  23759. item = selected[selected.length - 1];
  23760. } else {
  23761. item.value = "";
  23762. }
  23763. if (this.formItem) {
  23764. this.formItem.setValue(item.value);
  23765. }
  23766. this.$emit("input", item.value);
  23767. this.$emit("update:modelValue", item.value);
  23768. this.$emit("change", {
  23769. detail: {
  23770. value: selected
  23771. }
  23772. });
  23773. }
  23774. }
  23775. };
  23776. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  23777. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$5);
  23778. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  23779. const _component_data_picker_view = vue.resolveComponent("data-picker-view");
  23780. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-tree" }, [
  23781. vue.createElementVNode("view", {
  23782. class: "uni-data-tree-input",
  23783. onClick: _cache[1] || (_cache[1] = (...args) => $options.handleInput && $options.handleInput(...args))
  23784. }, [
  23785. vue.renderSlot(_ctx.$slots, "default", {
  23786. options: $props.options,
  23787. data: $data.inputSelected,
  23788. error: _ctx.errorMessage
  23789. }, () => [
  23790. vue.createElementVNode(
  23791. "view",
  23792. {
  23793. class: vue.normalizeClass(["input-value", { "input-value-border": $props.border }])
  23794. },
  23795. [
  23796. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock(
  23797. "text",
  23798. {
  23799. key: 0,
  23800. class: "selected-area error-text"
  23801. },
  23802. vue.toDisplayString(_ctx.errorMessage),
  23803. 1
  23804. /* TEXT */
  23805. )) : _ctx.loading && !$data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  23806. key: 1,
  23807. class: "selected-area"
  23808. }, [
  23809. vue.createVNode(_component_uni_load_more, {
  23810. class: "load-more",
  23811. contentText: _ctx.loadMore,
  23812. status: "loading"
  23813. }, null, 8, ["contentText"])
  23814. ])) : $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  23815. key: 2,
  23816. class: "selected-area",
  23817. "scroll-x": "true"
  23818. }, [
  23819. vue.createElementVNode("view", { class: "selected-list" }, [
  23820. (vue.openBlock(true), vue.createElementBlock(
  23821. vue.Fragment,
  23822. null,
  23823. vue.renderList($data.inputSelected, (item, index) => {
  23824. return vue.openBlock(), vue.createElementBlock("view", {
  23825. class: "selected-item",
  23826. key: index
  23827. }, [
  23828. vue.createElementVNode(
  23829. "text",
  23830. { class: "text-color" },
  23831. vue.toDisplayString(item.text),
  23832. 1
  23833. /* TEXT */
  23834. ),
  23835. index < $data.inputSelected.length - 1 ? (vue.openBlock(), vue.createElementBlock(
  23836. "text",
  23837. {
  23838. key: 0,
  23839. class: "input-split-line"
  23840. },
  23841. vue.toDisplayString($props.split),
  23842. 1
  23843. /* TEXT */
  23844. )) : vue.createCommentVNode("v-if", true)
  23845. ]);
  23846. }),
  23847. 128
  23848. /* KEYED_FRAGMENT */
  23849. ))
  23850. ])
  23851. ])) : (vue.openBlock(), vue.createElementBlock(
  23852. "text",
  23853. {
  23854. key: 3,
  23855. class: "selected-area placeholder"
  23856. },
  23857. vue.toDisplayString($props.placeholder),
  23858. 1
  23859. /* TEXT */
  23860. )),
  23861. $props.clearIcon && !$props.readonly && $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("view", {
  23862. key: 4,
  23863. class: "icon-clear",
  23864. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
  23865. }, [
  23866. vue.createVNode(_component_uni_icons, {
  23867. type: "clear",
  23868. color: "#c0c4cc",
  23869. size: "24"
  23870. })
  23871. ])) : vue.createCommentVNode("v-if", true),
  23872. (!$props.clearIcon || !$data.inputSelected.length) && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  23873. key: 5,
  23874. class: "arrow-area"
  23875. }, [
  23876. vue.createElementVNode("view", { class: "input-arrow" })
  23877. ])) : vue.createCommentVNode("v-if", true)
  23878. ],
  23879. 2
  23880. /* CLASS */
  23881. )
  23882. ], true)
  23883. ]),
  23884. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  23885. key: 0,
  23886. class: "uni-data-tree-cover",
  23887. onClick: _cache[2] || (_cache[2] = (...args) => $options.handleClose && $options.handleClose(...args))
  23888. })) : vue.createCommentVNode("v-if", true),
  23889. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  23890. key: 1,
  23891. class: "uni-data-tree-dialog"
  23892. }, [
  23893. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  23894. vue.createElementVNode("view", { class: "dialog-caption" }, [
  23895. vue.createElementVNode("view", { class: "title-area" }, [
  23896. vue.createElementVNode(
  23897. "text",
  23898. { class: "dialog-title" },
  23899. vue.toDisplayString($props.popupTitle),
  23900. 1
  23901. /* TEXT */
  23902. )
  23903. ]),
  23904. vue.createElementVNode("view", {
  23905. class: "dialog-close",
  23906. onClick: _cache[3] || (_cache[3] = (...args) => $options.handleClose && $options.handleClose(...args))
  23907. }, [
  23908. vue.createElementVNode("view", {
  23909. class: "dialog-close-plus",
  23910. "data-id": "close"
  23911. }),
  23912. vue.createElementVNode("view", {
  23913. class: "dialog-close-plus dialog-close-rotate",
  23914. "data-id": "close"
  23915. })
  23916. ])
  23917. ]),
  23918. vue.createVNode(_component_data_picker_view, {
  23919. class: "picker-view",
  23920. ref: "pickerView",
  23921. modelValue: _ctx.dataValue,
  23922. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.dataValue = $event),
  23923. localdata: _ctx.localdata,
  23924. preload: _ctx.preload,
  23925. collection: _ctx.collection,
  23926. field: _ctx.field,
  23927. orderby: _ctx.orderby,
  23928. where: _ctx.where,
  23929. "step-searh": _ctx.stepSearh,
  23930. "self-field": _ctx.selfField,
  23931. "parent-field": _ctx.parentField,
  23932. "managed-mode": true,
  23933. map: _ctx.map,
  23934. ellipsis: $props.ellipsis,
  23935. onChange: $options.onchange,
  23936. onDatachange: $options.ondatachange,
  23937. onNodeclick: $options.onnodeclick
  23938. }, null, 8, ["modelValue", "localdata", "preload", "collection", "field", "orderby", "where", "step-searh", "self-field", "parent-field", "map", "ellipsis", "onChange", "onDatachange", "onNodeclick"])
  23939. ])) : vue.createCommentVNode("v-if", true)
  23940. ]);
  23941. }
  23942. const __easycom_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-2653531e"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue"]]);
  23943. const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
  23944. __name: "index",
  23945. setup(__props, { expose: __expose }) {
  23946. __expose();
  23947. const token = vue.ref();
  23948. const loading = vue.ref(false);
  23949. const hidePage = vue.ref(false);
  23950. const focusType = vue.ref(true);
  23951. const editBatchNum = vue.ref(false);
  23952. const editPalletNum = vue.ref(false);
  23953. const lotnoLogHistory = vue.ref([]);
  23954. const messageRef = vue.ref();
  23955. const messageType = vue.ref();
  23956. const messageText = vue.ref();
  23957. let st2;
  23958. const valiFormData = vue.ref({
  23959. orderNum: "",
  23960. weight: "",
  23961. batchNum: "",
  23962. palletNum: ""
  23963. });
  23964. const rules = vue.reactive({
  23965. orderNum: {
  23966. rules: [
  23967. {
  23968. required: true,
  23969. errorMessage: "单号不能为空"
  23970. }
  23971. ]
  23972. }
  23973. });
  23974. const options = vue.reactive({
  23975. batch: [],
  23976. pallet: []
  23977. });
  23978. const onnodeclick = () => {
  23979. };
  23980. const onpopupopened = () => {
  23981. };
  23982. const onpopupclosed = () => {
  23983. };
  23984. const onchange = () => {
  23985. };
  23986. const checkPermission = async () => {
  23987. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  23988. if (status === null || status === 1) {
  23989. status = 1;
  23990. } else {
  23991. uni.showModal({
  23992. content: "Camera permission required",
  23993. confirmText: "Setting",
  23994. success: function(res) {
  23995. if (res.confirm) {
  23996. permission.gotoAppSetting();
  23997. }
  23998. }
  23999. });
  24000. }
  24001. return status;
  24002. };
  24003. const scanInput = async () => {
  24004. let status = await checkPermission();
  24005. if (status !== 1) {
  24006. return;
  24007. }
  24008. uni.scanCode({
  24009. success: (res) => {
  24010. valiFormData.value.orderNum = res.result;
  24011. },
  24012. fail: (err) => {
  24013. }
  24014. });
  24015. };
  24016. const reset = () => {
  24017. loading.value = false;
  24018. valiFormData.value.orderNum = "";
  24019. valiFormData.value.weight = "";
  24020. };
  24021. const submitBatchNum = () => {
  24022. if (valiFormData.value.batchNum) {
  24023. editBatchNum.value = true;
  24024. } else {
  24025. messageType.value = "error";
  24026. messageText.value = "请选择批次号";
  24027. messageRef.value.open();
  24028. }
  24029. };
  24030. const batchNum = vue.computed(() => {
  24031. const res = options.batch.find((item) => item.value === valiFormData.value.batchNum);
  24032. return res == null ? void 0 : res.text;
  24033. });
  24034. const submitPalletNum = () => {
  24035. if (valiFormData.value.palletNum) {
  24036. editPalletNum.value = true;
  24037. } else {
  24038. messageType.value = "error";
  24039. messageText.value = "请选择托盘号";
  24040. messageRef.value.open();
  24041. }
  24042. };
  24043. const palletNum = vue.computed(() => {
  24044. function findTextByValue(arr, targetValue) {
  24045. for (let item of arr) {
  24046. if (item.value === targetValue) {
  24047. return item.text;
  24048. }
  24049. if (item.children && item.children.length > 0) {
  24050. const result = findTextByValue(item.children, targetValue);
  24051. if (result) {
  24052. return `${item.text}/${result}`;
  24053. }
  24054. }
  24055. }
  24056. return null;
  24057. }
  24058. const textPath = findTextByValue(options.pallet, valiFormData.value.palletNum);
  24059. return textPath;
  24060. });
  24061. const checkOrder = () => {
  24062. loading.value = true;
  24063. uni.setStorageSync("waybills", []);
  24064. uni.request({
  24065. url: getWaybillsURL,
  24066. method: "POST",
  24067. header: {
  24068. batoken: token.value
  24069. },
  24070. data: {
  24071. order_no: valiFormData.value.orderNum,
  24072. batch_number: valiFormData.value.batchNum,
  24073. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  24074. },
  24075. success: (res) => {
  24076. loading.value = false;
  24077. if (res.data.code == 1) {
  24078. messageType.value = "success";
  24079. messageText.value = res.data.msg;
  24080. messageRef.value.open();
  24081. uni.setStorageSync("waybills", res.data.data.waybills);
  24082. uni.navigateTo({
  24083. url: "/pages/scanLotno/waybillsList"
  24084. });
  24085. } else {
  24086. messageType.value = "error";
  24087. messageText.value = res.data.msg;
  24088. messageRef.value.open();
  24089. }
  24090. }
  24091. });
  24092. };
  24093. const findPalletNumIdByValue = (data, targetValue) => {
  24094. for (let i2 = 0; i2 < data.length; i2++) {
  24095. const item = data[i2];
  24096. if (item.id === targetValue || item.value === targetValue) {
  24097. return [item.id];
  24098. } else if (item.children && item.children.length > 0) {
  24099. const childId = findPalletNumIdByValue(item.children, targetValue);
  24100. if (childId !== null) {
  24101. return childId;
  24102. }
  24103. }
  24104. }
  24105. return null;
  24106. };
  24107. const onsubmit = () => {
  24108. st2 && clearTimeout(st2);
  24109. loading.value = true;
  24110. uni.request({
  24111. url: bindShippingURL,
  24112. method: "POST",
  24113. header: {
  24114. batoken: token.value
  24115. },
  24116. data: {
  24117. order_no: valiFormData.value.orderNum,
  24118. reweighting: valiFormData.value.weight,
  24119. batch_number: valiFormData.value.batchNum,
  24120. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  24121. },
  24122. success: (res) => {
  24123. loading.value = false;
  24124. if (res.data.code == 1) {
  24125. messageType.value = "success";
  24126. messageText.value = res.data.msg;
  24127. messageRef.value.open();
  24128. if (res.data.data.labels && res.data.data.labels.length > 0) {
  24129. formatAppLog("log", "at pages/scanLotno/index.vue:278", "有打印面单");
  24130. }
  24131. const historyItem = {
  24132. orderNum: valiFormData.value.orderNum,
  24133. createTime: /* @__PURE__ */ new Date(),
  24134. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  24135. status: true
  24136. };
  24137. formatAppLog("log", "at pages/scanLotno/index.vue:290", "lotnoLogHistory--", lotnoLogHistory);
  24138. lotnoLogHistory.value.unshift(historyItem);
  24139. uni.setStorageSync("lotnoLogHistory", lotnoLogHistory.value);
  24140. getHistory();
  24141. } else {
  24142. messageType.value = "error";
  24143. messageText.value = res.data.msg;
  24144. messageRef.value.open();
  24145. const historyItem = {
  24146. orderNum: valiFormData.value.orderNum,
  24147. createTime: /* @__PURE__ */ new Date(),
  24148. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  24149. status: false
  24150. };
  24151. lotnoLogHistory.value.unshift(historyItem);
  24152. uni.setStorageSync("lotnoLogHistory", lotnoLogHistory.value);
  24153. getHistory();
  24154. }
  24155. st2 = setTimeout(() => {
  24156. reset();
  24157. setFocus();
  24158. st2 && clearTimeout(st2);
  24159. }, 1e3);
  24160. }
  24161. });
  24162. };
  24163. const getHistory = () => {
  24164. lotnoLogHistory.value = uni.getStorageSync("lotnoLogHistory") || [];
  24165. };
  24166. const keypress = (e2) => {
  24167. formatAppLog("log", "at pages/scanLotno/index.vue:321", e2, "按键码");
  24168. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  24169. ;
  24170. if (e2.keyCode == 66) {
  24171. onsubmit();
  24172. }
  24173. };
  24174. onLoad(() => {
  24175. plus.key.addEventListener("keyup", keypress);
  24176. });
  24177. onUnload(() => {
  24178. plus.key.removeEventListener("keyup", keypress);
  24179. });
  24180. onHide(() => {
  24181. hidePage.value = true;
  24182. plus.key.removeEventListener("keyup", keypress);
  24183. });
  24184. onBackPress(() => {
  24185. plus.key.removeEventListener("keyup", keypress);
  24186. });
  24187. onShow(() => {
  24188. hidePage.value = false;
  24189. token.value = uni.getStorageSync("token");
  24190. getBindParams();
  24191. getHistory();
  24192. });
  24193. const setFocus = () => {
  24194. if (hidePage.value) {
  24195. return;
  24196. }
  24197. focusType.value = false;
  24198. vue.nextTick(() => {
  24199. focusType.value = true;
  24200. });
  24201. };
  24202. const getBindParams = () => {
  24203. uni.request({
  24204. url: getBindParamsURL,
  24205. method: "GET",
  24206. header: {
  24207. batoken: token.value
  24208. },
  24209. success: (res) => {
  24210. if (res.data.code === 1) {
  24211. let transformData = function(data) {
  24212. return data.map((item) => {
  24213. const { id, value, label, ...rest } = item;
  24214. return {
  24215. id: id || value,
  24216. value,
  24217. text: label,
  24218. ...rest,
  24219. children: item.children ? transformData(item.children) : []
  24220. };
  24221. });
  24222. };
  24223. options.batch = res.data.data.batch_number.map((item) => {
  24224. return { text: item.name, value: item.id };
  24225. });
  24226. const shipping = transformData(res.data.data.shipping);
  24227. options.pallet = shipping;
  24228. }
  24229. },
  24230. fail(e2) {
  24231. formatAppLog("log", "at pages/scanLotno/index.vue:411", "fail--", e2);
  24232. }
  24233. });
  24234. };
  24235. onNavigationBarButtonTap((event) => {
  24236. if (event.index === 0) {
  24237. uni.navigateTo({
  24238. url: "/pages/scanLotno/lotnoLog"
  24239. });
  24240. }
  24241. });
  24242. const __returned__ = { token, loading, hidePage, focusType, editBatchNum, editPalletNum, lotnoLogHistory, messageRef, messageType, messageText, get st() {
  24243. return st2;
  24244. }, set st(v2) {
  24245. st2 = v2;
  24246. }, valiFormData, rules, options, onnodeclick, onpopupopened, onpopupclosed, onchange, checkPermission, scanInput, reset, submitBatchNum, batchNum, submitPalletNum, palletNum, checkOrder, findPalletNumIdByValue, onsubmit, getHistory, keypress, setFocus, getBindParams };
  24247. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24248. return __returned__;
  24249. }
  24250. });
  24251. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  24252. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  24253. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  24254. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$6);
  24255. const _component_uni_data_picker = resolveEasycom(vue.resolveDynamicComponent("uni-data-picker"), __easycom_3$1);
  24256. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  24257. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  24258. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  24259. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  24260. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  24261. vue.createVNode(_component_uni_forms, {
  24262. ref: "valiForm",
  24263. "label-align": "right",
  24264. "label-width": 80,
  24265. rules: $setup.rules,
  24266. modelValue: $setup.valiFormData
  24267. }, {
  24268. default: vue.withCtx(() => [
  24269. vue.createVNode(_component_uni_forms_item, {
  24270. label: "运单号码",
  24271. required: "",
  24272. name: "orderNum"
  24273. }, {
  24274. default: vue.withCtx(() => [
  24275. vue.createVNode(_component_uni_easyinput, {
  24276. modelValue: $setup.valiFormData.orderNum,
  24277. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  24278. placeholder: "请输入单号",
  24279. suffixIcon: "scan",
  24280. focus: $setup.focusType,
  24281. onIconClick: $setup.scanInput
  24282. }, null, 8, ["modelValue", "focus"])
  24283. ]),
  24284. _: 1
  24285. /* STABLE */
  24286. }),
  24287. vue.createVNode(_component_uni_forms_item, {
  24288. label: "复称重量",
  24289. name: "weight"
  24290. }, {
  24291. default: vue.withCtx(() => [
  24292. vue.createVNode(_component_uni_easyinput, {
  24293. modelValue: $setup.valiFormData.weight,
  24294. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.weight = $event),
  24295. placeholder: "请输入复称重量",
  24296. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  24297. }, {
  24298. right: vue.withCtx(() => [
  24299. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  24300. ]),
  24301. _: 1
  24302. /* STABLE */
  24303. }, 8, ["modelValue"])
  24304. ]),
  24305. _: 1
  24306. /* STABLE */
  24307. }),
  24308. vue.createCommentVNode(" <text class='weight-tip'>复称重量作用是确保句惠完整,防止工作人员计费称車后进行的其他操作引起的物品丢失问题</text> "),
  24309. vue.createCommentVNode(' <uni-section title="绑定批托盘号" type="line" padding style="height: calc(100vh - 100px)"> '),
  24310. vue.createVNode(_component_uni_forms_item, {
  24311. label: "绑定批次号",
  24312. name: "batchNum",
  24313. class: "select-item"
  24314. }, {
  24315. default: vue.withCtx(() => [
  24316. !$setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  24317. key: 0,
  24318. modelValue: $setup.valiFormData.batchNum,
  24319. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.batchNum = $event),
  24320. placeholder: "请选择批次号",
  24321. localdata: $setup.options.batch,
  24322. clear: false
  24323. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  24324. $setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  24325. key: 1,
  24326. value: $setup.batchNum,
  24327. disabled: $setup.editBatchNum
  24328. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  24329. !$setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  24330. key: 2,
  24331. type: "primary",
  24332. onClick: $setup.submitBatchNum
  24333. }, "确认")) : vue.createCommentVNode("v-if", true),
  24334. $setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  24335. key: 3,
  24336. type: "primary",
  24337. onClick: _cache[3] || (_cache[3] = ($event) => $setup.editBatchNum = false)
  24338. }, "修改")) : vue.createCommentVNode("v-if", true)
  24339. ]),
  24340. _: 1
  24341. /* STABLE */
  24342. }),
  24343. vue.createVNode(_component_uni_forms_item, {
  24344. label: "绑定托盘号",
  24345. name: "palletNum",
  24346. class: "select-item"
  24347. }, {
  24348. default: vue.withCtx(() => [
  24349. !$setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_picker, {
  24350. key: 0,
  24351. placeholder: "请选择托盘号",
  24352. "popup-title": "绑定托盘号",
  24353. localdata: $setup.options.pallet,
  24354. modelValue: $setup.valiFormData.palletNum,
  24355. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.valiFormData.palletNum = $event),
  24356. onChange: $setup.onchange,
  24357. onNodeclick: $setup.onnodeclick,
  24358. onPopupopened: $setup.onpopupopened,
  24359. onPopupclosed: $setup.onpopupclosed
  24360. }, null, 8, ["localdata", "modelValue"])) : vue.createCommentVNode("v-if", true),
  24361. $setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  24362. key: 1,
  24363. value: $setup.palletNum,
  24364. disabled: $setup.editPalletNum
  24365. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  24366. !$setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  24367. key: 2,
  24368. type: "primary",
  24369. onClick: $setup.submitPalletNum
  24370. }, "确认")) : vue.createCommentVNode("v-if", true),
  24371. $setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  24372. key: 3,
  24373. type: "primary",
  24374. onClick: _cache[5] || (_cache[5] = ($event) => $setup.editPalletNum = false)
  24375. }, "修改")) : vue.createCommentVNode("v-if", true)
  24376. ]),
  24377. _: 1
  24378. /* STABLE */
  24379. }),
  24380. vue.createCommentVNode(" </uni-section> ")
  24381. ]),
  24382. _: 1
  24383. /* STABLE */
  24384. }, 8, ["rules", "modelValue"]),
  24385. vue.createElementVNode("view", { class: "button-group" }, [
  24386. vue.createElementVNode("button", {
  24387. type: "info",
  24388. onClick: $setup.reset
  24389. }, "重置"),
  24390. vue.createElementVNode("button", {
  24391. type: "default",
  24392. onClick: $setup.checkOrder,
  24393. loading: $setup.loading
  24394. }, [
  24395. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  24396. key: 0,
  24397. type: "search",
  24398. size: "18"
  24399. })) : vue.createCommentVNode("v-if", true),
  24400. vue.createTextVNode(" 查看运单 ")
  24401. ], 8, ["loading"]),
  24402. vue.createElementVNode("button", {
  24403. type: "primary",
  24404. onClick: $setup.onsubmit,
  24405. loading: $setup.loading
  24406. }, [
  24407. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  24408. key: 0,
  24409. type: "checkmarkempty",
  24410. size: "18",
  24411. color: "white"
  24412. })) : vue.createCommentVNode("v-if", true),
  24413. vue.createTextVNode(" 提交 ")
  24414. ], 8, ["loading"])
  24415. ]),
  24416. $setup.lotnoLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  24417. key: 0,
  24418. class: "history"
  24419. }, [
  24420. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  24421. ])) : vue.createCommentVNode("v-if", true),
  24422. vue.createElementVNode("view", { class: "history" }, [
  24423. (vue.openBlock(true), vue.createElementBlock(
  24424. vue.Fragment,
  24425. null,
  24426. vue.renderList($setup.lotnoLogHistory.slice(0, 5), (item, i2) => {
  24427. return vue.openBlock(), vue.createElementBlock("view", {
  24428. class: "item",
  24429. key: i2
  24430. }, [
  24431. vue.createElementVNode(
  24432. "text",
  24433. { class: "type" },
  24434. vue.toDisplayString(item.type),
  24435. 1
  24436. /* TEXT */
  24437. ),
  24438. vue.createElementVNode(
  24439. "text",
  24440. {
  24441. class: "code",
  24442. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  24443. },
  24444. vue.toDisplayString(item.orderNum),
  24445. 5
  24446. /* TEXT, STYLE */
  24447. ),
  24448. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  24449. key: 0,
  24450. type: "checkmarkempty",
  24451. class: "status",
  24452. size: "16",
  24453. color: "green"
  24454. })) : (vue.openBlock(), vue.createElementBlock("text", {
  24455. key: 1,
  24456. class: "status fail"
  24457. }, "F")),
  24458. vue.createElementVNode(
  24459. "text",
  24460. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  24461. vue.toDisplayString("\r\n" + item.createTime),
  24462. 1
  24463. /* TEXT */
  24464. )
  24465. ]);
  24466. }),
  24467. 128
  24468. /* KEYED_FRAGMENT */
  24469. ))
  24470. ]),
  24471. vue.createVNode(
  24472. _component_uni_popup,
  24473. {
  24474. ref: "messageRef",
  24475. type: "message"
  24476. },
  24477. {
  24478. default: vue.withCtx(() => [
  24479. vue.createVNode(_component_uni_popup_message, {
  24480. type: $setup.messageType,
  24481. message: $setup.messageText,
  24482. duration: 2e3
  24483. }, null, 8, ["type", "message"])
  24484. ]),
  24485. _: 1
  24486. /* STABLE */
  24487. },
  24488. 512
  24489. /* NEED_PATCH */
  24490. )
  24491. ]);
  24492. }
  24493. const PagesScanLotnoIndex = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__file", "E:/HBuilderProjects/YTAPP/pages/scanLotno/index.vue"]]);
  24494. const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
  24495. __name: "lotnoLog",
  24496. setup(__props, { expose: __expose }) {
  24497. __expose();
  24498. const lotnoLogHistory = vue.ref([]);
  24499. const getHistory = () => {
  24500. lotnoLogHistory.value = uni.getStorageSync("lotnoLogHistory");
  24501. };
  24502. onLoad(() => {
  24503. getHistory();
  24504. });
  24505. const __returned__ = { lotnoLogHistory, getHistory };
  24506. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24507. return __returned__;
  24508. }
  24509. });
  24510. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  24511. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  24512. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  24513. (vue.openBlock(true), vue.createElementBlock(
  24514. vue.Fragment,
  24515. null,
  24516. vue.renderList($setup.lotnoLogHistory, (item, i2) => {
  24517. return vue.openBlock(), vue.createElementBlock("view", {
  24518. class: "item",
  24519. key: i2
  24520. }, [
  24521. vue.createElementVNode(
  24522. "text",
  24523. { class: "type" },
  24524. vue.toDisplayString(item.type),
  24525. 1
  24526. /* TEXT */
  24527. ),
  24528. vue.createElementVNode(
  24529. "text",
  24530. {
  24531. class: "code",
  24532. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  24533. },
  24534. vue.toDisplayString(item.orderNum),
  24535. 5
  24536. /* TEXT, STYLE */
  24537. ),
  24538. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  24539. key: 0,
  24540. type: "checkmarkempty",
  24541. class: "status",
  24542. size: "16",
  24543. color: "green"
  24544. })) : (vue.openBlock(), vue.createElementBlock("text", {
  24545. key: 1,
  24546. class: "status fail"
  24547. }, "F")),
  24548. vue.createElementVNode(
  24549. "text",
  24550. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  24551. vue.toDisplayString("\r\n" + item.createTime),
  24552. 1
  24553. /* TEXT */
  24554. )
  24555. ]);
  24556. }),
  24557. 128
  24558. /* KEYED_FRAGMENT */
  24559. )),
  24560. $setup.lotnoLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  24561. key: 0,
  24562. class: "is-empty"
  24563. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  24564. ]);
  24565. }
  24566. const PagesScanLotnoLotnoLog = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-d86d23fe"], ["__file", "E:/HBuilderProjects/YTAPP/pages/scanLotno/lotnoLog.vue"]]);
  24567. const _sfc_main$d = {
  24568. name: "UniSection",
  24569. emits: ["click"],
  24570. props: {
  24571. type: {
  24572. type: String,
  24573. default: ""
  24574. },
  24575. title: {
  24576. type: String,
  24577. required: true,
  24578. default: ""
  24579. },
  24580. titleFontSize: {
  24581. type: String,
  24582. default: "14px"
  24583. },
  24584. titleColor: {
  24585. type: String,
  24586. default: "#333"
  24587. },
  24588. subTitle: {
  24589. type: String,
  24590. default: ""
  24591. },
  24592. subTitleFontSize: {
  24593. type: String,
  24594. default: "12px"
  24595. },
  24596. subTitleColor: {
  24597. type: String,
  24598. default: "#999"
  24599. },
  24600. padding: {
  24601. type: [Boolean, String],
  24602. default: false
  24603. }
  24604. },
  24605. computed: {
  24606. _padding() {
  24607. if (typeof this.padding === "string") {
  24608. return this.padding;
  24609. }
  24610. return this.padding ? "10px" : "";
  24611. }
  24612. },
  24613. watch: {
  24614. title(newVal) {
  24615. if (uni.report && newVal !== "") {
  24616. uni.report("title", newVal);
  24617. }
  24618. }
  24619. },
  24620. methods: {
  24621. onClick() {
  24622. this.$emit("click");
  24623. }
  24624. }
  24625. };
  24626. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  24627. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-section" }, [
  24628. vue.createElementVNode("view", {
  24629. class: "uni-section-header",
  24630. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  24631. }, [
  24632. $props.type ? (vue.openBlock(), vue.createElementBlock(
  24633. "view",
  24634. {
  24635. key: 0,
  24636. class: vue.normalizeClass(["uni-section-header__decoration", $props.type])
  24637. },
  24638. null,
  24639. 2
  24640. /* CLASS */
  24641. )) : vue.renderSlot(_ctx.$slots, "decoration", { key: 1 }, void 0, true),
  24642. vue.createElementVNode("view", { class: "uni-section-header__content" }, [
  24643. vue.createElementVNode(
  24644. "text",
  24645. {
  24646. style: vue.normalizeStyle({ "font-size": $props.titleFontSize, "color": $props.titleColor }),
  24647. class: vue.normalizeClass(["uni-section__content-title", { "distraction": !$props.subTitle }])
  24648. },
  24649. vue.toDisplayString($props.title),
  24650. 7
  24651. /* TEXT, CLASS, STYLE */
  24652. ),
  24653. $props.subTitle ? (vue.openBlock(), vue.createElementBlock(
  24654. "text",
  24655. {
  24656. key: 0,
  24657. style: vue.normalizeStyle({ "font-size": $props.subTitleFontSize, "color": $props.subTitleColor }),
  24658. class: "uni-section-header__content-sub"
  24659. },
  24660. vue.toDisplayString($props.subTitle),
  24661. 5
  24662. /* TEXT, STYLE */
  24663. )) : vue.createCommentVNode("v-if", true)
  24664. ]),
  24665. vue.createElementVNode("view", { class: "uni-section-header__slot-right" }, [
  24666. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  24667. ])
  24668. ]),
  24669. vue.createElementVNode(
  24670. "view",
  24671. {
  24672. class: "uni-section-content",
  24673. style: vue.normalizeStyle({ padding: $options._padding })
  24674. },
  24675. [
  24676. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  24677. ],
  24678. 4
  24679. /* STYLE */
  24680. )
  24681. ]);
  24682. }
  24683. const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-637fd36b"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-section/components/uni-section/uni-section.vue"]]);
  24684. const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
  24685. __name: "waybillsList",
  24686. setup(__props, { expose: __expose }) {
  24687. __expose();
  24688. const waybills = vue.ref([]);
  24689. const getHistory = () => {
  24690. waybills.value = uni.getStorageSync("waybills");
  24691. };
  24692. onLoad(() => {
  24693. getHistory();
  24694. });
  24695. const __returned__ = { waybills, getHistory };
  24696. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24697. return __returned__;
  24698. }
  24699. });
  24700. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  24701. const _component_uni_section = resolveEasycom(vue.resolveDynamicComponent("uni-section"), __easycom_0$1);
  24702. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  24703. vue.createVNode(_component_uni_section, {
  24704. title: "数量: " + $setup.waybills.length
  24705. }, null, 8, ["title"]),
  24706. (vue.openBlock(true), vue.createElementBlock(
  24707. vue.Fragment,
  24708. null,
  24709. vue.renderList($setup.waybills, (item, i2) => {
  24710. return vue.openBlock(), vue.createElementBlock("view", {
  24711. class: "item",
  24712. key: i2
  24713. }, [
  24714. vue.createElementVNode(
  24715. "text",
  24716. {
  24717. class: "code",
  24718. style: { color: "#666" }
  24719. },
  24720. vue.toDisplayString(item.order_box_no),
  24721. 1
  24722. /* TEXT */
  24723. ),
  24724. vue.createElementVNode(
  24725. "text",
  24726. { class: "type" },
  24727. "重量: " + vue.toDisplayString(item.weight) + "KG",
  24728. 1
  24729. /* TEXT */
  24730. ),
  24731. vue.createElementVNode("view", { class: "sub-items" }, [
  24732. vue.createElementVNode("view", { class: "sub-item" }, [
  24733. vue.createElementVNode("text", { class: "type" }, "批次/船航/托盘"),
  24734. vue.createElementVNode(
  24735. "text",
  24736. { class: "type" },
  24737. vue.toDisplayString(item.batch_shipping_pallet),
  24738. 1
  24739. /* TEXT */
  24740. )
  24741. ]),
  24742. vue.createElementVNode("view", { class: "sub-item" }, [
  24743. vue.createElementVNode("text", { class: "type" }, "末公里运单号"),
  24744. vue.createElementVNode(
  24745. "text",
  24746. { class: "type" },
  24747. vue.toDisplayString(item.tracking_number || "无"),
  24748. 1
  24749. /* TEXT */
  24750. )
  24751. ])
  24752. ])
  24753. ]);
  24754. }),
  24755. 128
  24756. /* KEYED_FRAGMENT */
  24757. )),
  24758. $setup.waybills.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  24759. key: 0,
  24760. class: "is-empty"
  24761. }, "暂无运单")) : vue.createCommentVNode("v-if", true)
  24762. ]);
  24763. }
  24764. const PagesScanLotnoWaybillsList = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-ef3fda20"], ["__file", "E:/HBuilderProjects/YTAPP/pages/scanLotno/waybillsList.vue"]]);
  24765. const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
  24766. __name: "index",
  24767. setup(__props, { expose: __expose }) {
  24768. __expose();
  24769. const token = vue.ref();
  24770. const loading = vue.ref(false);
  24771. const hidePage = vue.ref(false);
  24772. const focusType = vue.ref(true);
  24773. const warehouseLogHistory = vue.ref([]);
  24774. const messageRef = vue.ref();
  24775. const messageType = vue.ref();
  24776. const messageText = vue.ref();
  24777. let st2;
  24778. const valiFormData = vue.ref({
  24779. order_code: ""
  24780. });
  24781. const rules = vue.reactive({
  24782. order_code: {
  24783. rules: [
  24784. {
  24785. required: true,
  24786. errorMessage: "单据编号不能为空"
  24787. }
  24788. ]
  24789. }
  24790. });
  24791. const checkPermission = async () => {
  24792. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  24793. if (status === null || status === 1) {
  24794. status = 1;
  24795. } else {
  24796. uni.showModal({
  24797. content: "Camera permission required",
  24798. confirmText: "Setting",
  24799. success: function(res) {
  24800. if (res.confirm) {
  24801. permission.gotoAppSetting();
  24802. }
  24803. }
  24804. });
  24805. }
  24806. return status;
  24807. };
  24808. const scanInput = async () => {
  24809. let status = await checkPermission();
  24810. if (status !== 1) {
  24811. return;
  24812. }
  24813. uni.scanCode({
  24814. success: (res) => {
  24815. valiFormData.value.order_code = res.result;
  24816. onsubmit();
  24817. },
  24818. fail: (err) => {
  24819. }
  24820. });
  24821. };
  24822. const reset = () => {
  24823. loading.value = false;
  24824. valiFormData.value.order_code = "";
  24825. };
  24826. const setfocus = () => {
  24827. if (hidePage.value) {
  24828. return;
  24829. }
  24830. focusType.value = false;
  24831. vue.nextTick(() => {
  24832. focusType.value = true;
  24833. });
  24834. };
  24835. const onsubmit = () => {
  24836. st2 && clearTimeout(st2);
  24837. loading.value = true;
  24838. uni.request({
  24839. url: warehouseScanURL,
  24840. method: "POST",
  24841. header: {
  24842. batoken: token.value
  24843. },
  24844. data: {
  24845. order_code: valiFormData.value.order_code
  24846. },
  24847. success: (res) => {
  24848. loading.value = false;
  24849. if (res.data.code == 1) {
  24850. messageType.value = "success";
  24851. messageText.value = res.data.msg;
  24852. messageRef.value.open();
  24853. const historyItem = {
  24854. order_code: valiFormData.value.order_code,
  24855. createTime: /* @__PURE__ */ new Date(),
  24856. type: "单据扫描",
  24857. status: true
  24858. };
  24859. warehouseLogHistory.value.unshift(historyItem);
  24860. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  24861. getHistory();
  24862. } else {
  24863. messageType.value = "error";
  24864. messageText.value = res.data.msg;
  24865. messageRef.value.open();
  24866. const historyItem = {
  24867. order_code: valiFormData.value.order_code,
  24868. createTime: /* @__PURE__ */ new Date(),
  24869. type: "单据扫描",
  24870. status: false
  24871. };
  24872. warehouseLogHistory.value.unshift(historyItem);
  24873. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  24874. getHistory();
  24875. }
  24876. st2 = setTimeout(() => {
  24877. reset();
  24878. st2 && clearTimeout(st2);
  24879. }, 1e3);
  24880. }
  24881. });
  24882. };
  24883. const getHistory = () => {
  24884. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory") || [];
  24885. };
  24886. const keypress = (e2) => {
  24887. formatAppLog("log", "at pages/warehouseScan/index.vue:179", e2, "按键码");
  24888. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  24889. ;
  24890. if (e2.keyCode == 66) {
  24891. onsubmit();
  24892. }
  24893. };
  24894. onLoad(() => {
  24895. plus.key.addEventListener("keyup", keypress);
  24896. });
  24897. onUnload(() => {
  24898. plus.key.removeEventListener("keyup", keypress);
  24899. });
  24900. onHide(() => {
  24901. hidePage.value = true;
  24902. plus.key.removeEventListener("keyup", keypress);
  24903. });
  24904. onBackPress(() => {
  24905. plus.key.removeEventListener("keyup", keypress);
  24906. });
  24907. onShow(() => {
  24908. token.value = uni.getStorageSync("token");
  24909. hidePage.value = false;
  24910. getHistory();
  24911. });
  24912. onNavigationBarButtonTap((event) => {
  24913. if (event.index === 0) {
  24914. uni.navigateTo({
  24915. url: "/pages/warehouseScan/warehouseLog"
  24916. });
  24917. }
  24918. });
  24919. const __returned__ = { token, loading, hidePage, focusType, warehouseLogHistory, messageRef, messageType, messageText, get st() {
  24920. return st2;
  24921. }, set st(v2) {
  24922. st2 = v2;
  24923. }, valiFormData, rules, checkPermission, scanInput, reset, setfocus, onsubmit, getHistory, keypress };
  24924. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24925. return __returned__;
  24926. }
  24927. });
  24928. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  24929. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  24930. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  24931. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  24932. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  24933. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  24934. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  24935. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  24936. vue.createVNode(_component_uni_forms, {
  24937. ref: "valiForm",
  24938. "label-align": "right",
  24939. "label-width": 80,
  24940. rules: $setup.rules,
  24941. modelValue: $setup.valiFormData
  24942. }, {
  24943. default: vue.withCtx(() => [
  24944. vue.createVNode(_component_uni_forms_item, {
  24945. label: "单据编号",
  24946. required: "",
  24947. name: "order_code"
  24948. }, {
  24949. default: vue.withCtx(() => [
  24950. vue.createVNode(_component_uni_easyinput, {
  24951. modelValue: $setup.valiFormData.order_code,
  24952. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.order_code = $event),
  24953. placeholder: "请输入单据编号",
  24954. suffixIcon: "scan",
  24955. focus: $setup.focusType,
  24956. onIconClick: $setup.scanInput,
  24957. onBlur: $setup.setfocus,
  24958. onConfirm: $setup.onsubmit
  24959. }, null, 8, ["modelValue", "focus"])
  24960. ]),
  24961. _: 1
  24962. /* STABLE */
  24963. })
  24964. ]),
  24965. _: 1
  24966. /* STABLE */
  24967. }, 8, ["rules", "modelValue"]),
  24968. vue.createElementVNode("view", { class: "button-group" }, [
  24969. vue.createElementVNode("button", {
  24970. type: "info",
  24971. onClick: $setup.reset
  24972. }, "重置"),
  24973. vue.createElementVNode("button", {
  24974. type: "primary",
  24975. onClick: $setup.onsubmit,
  24976. loading: $setup.loading
  24977. }, [
  24978. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  24979. key: 0,
  24980. type: "checkmarkempty",
  24981. size: "18",
  24982. color: "white"
  24983. })) : vue.createCommentVNode("v-if", true),
  24984. vue.createTextVNode(" 提交 ")
  24985. ], 8, ["loading"])
  24986. ]),
  24987. $setup.warehouseLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  24988. key: 0,
  24989. class: "history"
  24990. }, [
  24991. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  24992. ])) : vue.createCommentVNode("v-if", true),
  24993. vue.createElementVNode("view", { class: "history" }, [
  24994. (vue.openBlock(true), vue.createElementBlock(
  24995. vue.Fragment,
  24996. null,
  24997. vue.renderList($setup.warehouseLogHistory.slice(0, 5), (item, i2) => {
  24998. return vue.openBlock(), vue.createElementBlock("view", {
  24999. class: "item",
  25000. key: i2
  25001. }, [
  25002. vue.createElementVNode(
  25003. "text",
  25004. {
  25005. class: "code",
  25006. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25007. },
  25008. vue.toDisplayString(item.order_code),
  25009. 5
  25010. /* TEXT, STYLE */
  25011. ),
  25012. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  25013. key: 0,
  25014. type: "checkmarkempty",
  25015. class: "status",
  25016. size: "16",
  25017. color: "green"
  25018. })) : (vue.openBlock(), vue.createElementBlock("text", {
  25019. key: 1,
  25020. class: "status fail"
  25021. }, "F")),
  25022. vue.createElementVNode(
  25023. "text",
  25024. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  25025. vue.toDisplayString("\r\n" + item.createTime),
  25026. 1
  25027. /* TEXT */
  25028. )
  25029. ]);
  25030. }),
  25031. 128
  25032. /* KEYED_FRAGMENT */
  25033. ))
  25034. ]),
  25035. vue.createVNode(
  25036. _component_uni_popup,
  25037. {
  25038. ref: "messageRef",
  25039. type: "message"
  25040. },
  25041. {
  25042. default: vue.withCtx(() => [
  25043. vue.createVNode(_component_uni_popup_message, {
  25044. type: $setup.messageType,
  25045. message: $setup.messageText,
  25046. duration: 2e3
  25047. }, null, 8, ["type", "message"])
  25048. ]),
  25049. _: 1
  25050. /* STABLE */
  25051. },
  25052. 512
  25053. /* NEED_PATCH */
  25054. )
  25055. ]);
  25056. }
  25057. const PagesWarehouseScanIndex = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-c64ca80c"], ["__file", "E:/HBuilderProjects/YTAPP/pages/warehouseScan/index.vue"]]);
  25058. const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
  25059. __name: "warehouseLog",
  25060. setup(__props, { expose: __expose }) {
  25061. __expose();
  25062. const warehouseLogHistory = vue.ref([]);
  25063. const getHistory = () => {
  25064. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory");
  25065. };
  25066. onLoad(() => {
  25067. getHistory();
  25068. });
  25069. const __returned__ = { warehouseLogHistory, getHistory };
  25070. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  25071. return __returned__;
  25072. }
  25073. });
  25074. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  25075. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  25076. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  25077. (vue.openBlock(true), vue.createElementBlock(
  25078. vue.Fragment,
  25079. null,
  25080. vue.renderList($setup.warehouseLogHistory, (item, i2) => {
  25081. return vue.openBlock(), vue.createElementBlock("view", {
  25082. class: "item",
  25083. key: i2
  25084. }, [
  25085. vue.createElementVNode(
  25086. "text",
  25087. { class: "type" },
  25088. vue.toDisplayString(item.type),
  25089. 1
  25090. /* TEXT */
  25091. ),
  25092. vue.createElementVNode(
  25093. "text",
  25094. {
  25095. class: "code",
  25096. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25097. },
  25098. vue.toDisplayString(item.order_code),
  25099. 5
  25100. /* TEXT, STYLE */
  25101. ),
  25102. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  25103. key: 0,
  25104. type: "checkmarkempty",
  25105. class: "status",
  25106. size: "16",
  25107. color: "green"
  25108. })) : (vue.openBlock(), vue.createElementBlock("text", {
  25109. key: 1,
  25110. class: "status fail"
  25111. }, "F")),
  25112. vue.createElementVNode(
  25113. "text",
  25114. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  25115. vue.toDisplayString("\r\n" + item.createTime),
  25116. 1
  25117. /* TEXT */
  25118. )
  25119. ]);
  25120. }),
  25121. 128
  25122. /* KEYED_FRAGMENT */
  25123. )),
  25124. $setup.warehouseLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  25125. key: 0,
  25126. class: "is-empty"
  25127. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  25128. ]);
  25129. }
  25130. const PagesWarehouseScanWarehouseLog = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-dadaa086"], ["__file", "E:/HBuilderProjects/YTAPP/pages/warehouseScan/warehouseLog.vue"]]);
  25131. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  25132. __name: "index",
  25133. setup(__props, { expose: __expose }) {
  25134. __expose();
  25135. const token = vue.ref();
  25136. const editSpaceNo = vue.ref(false);
  25137. const loading = vue.ref(false);
  25138. const hidePage = vue.ref(false);
  25139. const focusType = vue.ref(true);
  25140. const waybillNoHistory = vue.ref([]);
  25141. const messageRef = vue.ref();
  25142. const messageType = vue.ref();
  25143. const messageText = vue.ref();
  25144. let st2;
  25145. const valiFormData = vue.ref({
  25146. code: "",
  25147. space_id: ""
  25148. });
  25149. const rules = vue.reactive({
  25150. code: {
  25151. rules: [
  25152. {
  25153. required: true,
  25154. errorMessage: "单号不能为空"
  25155. }
  25156. ]
  25157. }
  25158. });
  25159. const options = vue.reactive({
  25160. space: []
  25161. });
  25162. const checkPermission = async () => {
  25163. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  25164. if (status === null || status === 1) {
  25165. status = 1;
  25166. } else {
  25167. uni.showModal({
  25168. content: "Camera permission required",
  25169. confirmText: "Setting",
  25170. success: function(res) {
  25171. if (res.confirm) {
  25172. permission.gotoAppSetting();
  25173. }
  25174. }
  25175. });
  25176. }
  25177. return status;
  25178. };
  25179. const scanInput = async () => {
  25180. let status = await checkPermission();
  25181. if (status !== 1) {
  25182. return;
  25183. }
  25184. uni.scanCode({
  25185. success: (res) => {
  25186. valiFormData.value.code = res.result;
  25187. },
  25188. fail: (err) => {
  25189. }
  25190. });
  25191. };
  25192. const reset = () => {
  25193. loading.value = false;
  25194. valiFormData.value.code = "";
  25195. };
  25196. const submitSpace = () => {
  25197. if (valiFormData.value.space_id) {
  25198. editSpaceNo.value = true;
  25199. setFocus();
  25200. } else {
  25201. messageType.value = "error";
  25202. messageText.value = "请选择库位";
  25203. messageRef.value.open();
  25204. }
  25205. };
  25206. const space = vue.computed(() => {
  25207. const res = options.space.find((item) => item.value === valiFormData.value.space_id);
  25208. return res == null ? void 0 : res.text;
  25209. });
  25210. const findPalletNumIdByValue = (data, targetValue) => {
  25211. for (let i2 = 0; i2 < data.length; i2++) {
  25212. const item = data[i2];
  25213. if (item.id === targetValue || item.value === targetValue) {
  25214. return [item.id];
  25215. } else if (item.children && item.children.length > 0) {
  25216. const childId = findPalletNumIdByValue(item.children, targetValue);
  25217. if (childId !== null) {
  25218. return childId;
  25219. }
  25220. }
  25221. }
  25222. return null;
  25223. };
  25224. const onsubmit = () => {
  25225. if (valiFormData.value.space_id && valiFormData.value.code) {
  25226. st2 && clearTimeout(st2);
  25227. loading.value = true;
  25228. uni.request({
  25229. url: addWaybillNoURL,
  25230. method: "POST",
  25231. header: {
  25232. batoken: token.value
  25233. },
  25234. data: {
  25235. code: valiFormData.value.code,
  25236. space_id: valiFormData.value.space_id
  25237. },
  25238. success: (res) => {
  25239. loading.value = false;
  25240. const space2 = options.space.find((item) => item.value === valiFormData.value.space_id);
  25241. if (res.data.code == 1) {
  25242. messageType.value = "success";
  25243. messageText.value = res.data.msg;
  25244. messageRef.value.open();
  25245. const historyItem = {
  25246. code: valiFormData.value.code,
  25247. createTime: /* @__PURE__ */ new Date(),
  25248. type: "运单号",
  25249. space: space2.text,
  25250. status: true
  25251. };
  25252. waybillNoHistory.value.unshift(historyItem);
  25253. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  25254. getHistory();
  25255. } else {
  25256. messageType.value = "error";
  25257. messageText.value = res.data.msg;
  25258. messageRef.value.open();
  25259. const historyItem = {
  25260. code: valiFormData.value.code,
  25261. createTime: /* @__PURE__ */ new Date(),
  25262. type: "运单号",
  25263. space: space2.text,
  25264. status: false
  25265. };
  25266. waybillNoHistory.value.unshift(historyItem);
  25267. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  25268. getHistory();
  25269. }
  25270. st2 = setTimeout(() => {
  25271. reset();
  25272. setFocus();
  25273. st2 && clearTimeout(st2);
  25274. }, 1e3);
  25275. }
  25276. });
  25277. } else {
  25278. if (!valiFormData.value.space_id) {
  25279. messageType.value = "error";
  25280. messageText.value = "请选择库位";
  25281. messageRef.value.open();
  25282. }
  25283. if (!valiFormData.value.code) {
  25284. messageType.value = "error";
  25285. messageText.value = "请填写运单号";
  25286. messageRef.value.open();
  25287. }
  25288. }
  25289. };
  25290. const getHistory = () => {
  25291. waybillNoHistory.value = uni.getStorageSync("waybillNoHistory") || [];
  25292. };
  25293. const keypress = (e2) => {
  25294. formatAppLog("log", "at pages/waybillNo/index.vue:240", e2, "按键码");
  25295. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  25296. ;
  25297. if (e2.keyCode == 66) {
  25298. onsubmit();
  25299. }
  25300. };
  25301. onLoad(() => {
  25302. plus.key.addEventListener("keyup", keypress);
  25303. });
  25304. onUnload(() => {
  25305. plus.key.removeEventListener("keyup", keypress);
  25306. });
  25307. onHide(() => {
  25308. hidePage.value = true;
  25309. plus.key.removeEventListener("keyup", keypress);
  25310. });
  25311. onBackPress(() => {
  25312. plus.key.removeEventListener("keyup", keypress);
  25313. });
  25314. onShow(() => {
  25315. hidePage.value = false;
  25316. token.value = uni.getStorageSync("token");
  25317. getOptions();
  25318. getHistory();
  25319. });
  25320. const getOptions = () => {
  25321. uni.request({
  25322. url: waybillNoOptions,
  25323. method: "GET",
  25324. header: {
  25325. batoken: token.value
  25326. },
  25327. success: (res) => {
  25328. formatAppLog("log", "at pages/waybillNo/index.vue:300", res);
  25329. if (res.data.code === 1) {
  25330. for (let key in res.data.data.space_id) {
  25331. if (res.data.data.space_id.hasOwnProperty(key)) {
  25332. options.space.push({ text: res.data.data.space_id[key], value: key });
  25333. }
  25334. }
  25335. }
  25336. },
  25337. fail(e2) {
  25338. formatAppLog("log", "at pages/waybillNo/index.vue:310", "fail--", e2);
  25339. }
  25340. });
  25341. };
  25342. const setFocus = () => {
  25343. if (hidePage.value) {
  25344. return;
  25345. }
  25346. focusType.value = false;
  25347. vue.nextTick(() => {
  25348. focusType.value = true;
  25349. });
  25350. };
  25351. onNavigationBarButtonTap((event) => {
  25352. if (event.index === 0) {
  25353. uni.navigateTo({
  25354. url: "/pages/waybillNo/waybillNoLog"
  25355. });
  25356. }
  25357. });
  25358. const __returned__ = { token, editSpaceNo, loading, hidePage, focusType, waybillNoHistory, messageRef, messageType, messageText, get st() {
  25359. return st2;
  25360. }, set st(v2) {
  25361. st2 = v2;
  25362. }, valiFormData, rules, options, checkPermission, scanInput, reset, submitSpace, space, findPalletNumIdByValue, onsubmit, getHistory, keypress, getOptions, setFocus };
  25363. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  25364. return __returned__;
  25365. }
  25366. });
  25367. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  25368. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$6);
  25369. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  25370. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  25371. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  25372. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  25373. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  25374. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  25375. vue.createVNode(_component_uni_forms, {
  25376. ref: "valiForm",
  25377. "label-align": "right",
  25378. "label-width": 80,
  25379. rules: $setup.rules,
  25380. modelValue: $setup.valiFormData
  25381. }, {
  25382. default: vue.withCtx(() => [
  25383. vue.createElementVNode("view", { class: "space-select" }, [
  25384. !$setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  25385. key: 0,
  25386. modelValue: $setup.valiFormData.space_id,
  25387. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.space_id = $event),
  25388. placeholder: "请选择库位",
  25389. localdata: $setup.options.space,
  25390. clear: false
  25391. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  25392. $setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  25393. key: 1,
  25394. value: $setup.space,
  25395. disabled: $setup.editSpaceNo
  25396. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  25397. !$setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  25398. key: 2,
  25399. type: "primary",
  25400. onClick: $setup.submitSpace
  25401. }, "确认")) : vue.createCommentVNode("v-if", true),
  25402. $setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  25403. key: 3,
  25404. type: "primary",
  25405. onClick: _cache[1] || (_cache[1] = ($event) => $setup.editSpaceNo = false)
  25406. }, "修改")) : vue.createCommentVNode("v-if", true)
  25407. ]),
  25408. vue.createElementVNode("view", null, [
  25409. vue.createVNode(_component_uni_easyinput, {
  25410. modelValue: $setup.valiFormData.code,
  25411. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.code = $event),
  25412. placeholder: "请输入运单号",
  25413. suffixIcon: "scan",
  25414. focus: $setup.focusType,
  25415. onIconClick: $setup.scanInput
  25416. }, null, 8, ["modelValue", "focus"])
  25417. ])
  25418. ]),
  25419. _: 1
  25420. /* STABLE */
  25421. }, 8, ["rules", "modelValue"]),
  25422. vue.createElementVNode("view", { class: "button-group" }, [
  25423. vue.createElementVNode("button", {
  25424. type: "info",
  25425. onClick: $setup.reset
  25426. }, "重置"),
  25427. vue.createElementVNode("button", {
  25428. type: "primary",
  25429. onClick: $setup.onsubmit,
  25430. loading: $setup.loading
  25431. }, [
  25432. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  25433. key: 0,
  25434. type: "checkmarkempty",
  25435. size: "18",
  25436. color: "white"
  25437. })) : vue.createCommentVNode("v-if", true),
  25438. vue.createTextVNode(" 提交 ")
  25439. ], 8, ["loading"])
  25440. ]),
  25441. $setup.waybillNoHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  25442. key: 0,
  25443. class: "history"
  25444. }, [
  25445. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  25446. ])) : vue.createCommentVNode("v-if", true),
  25447. vue.createElementVNode("view", { class: "history" }, [
  25448. (vue.openBlock(true), vue.createElementBlock(
  25449. vue.Fragment,
  25450. null,
  25451. vue.renderList($setup.waybillNoHistory.slice(0, 5), (item, i2) => {
  25452. return vue.openBlock(), vue.createElementBlock("view", {
  25453. class: "item",
  25454. key: i2
  25455. }, [
  25456. vue.createElementVNode("view", null, [
  25457. vue.createElementVNode("view", null, [
  25458. vue.createElementVNode("text", { class: "type" }, "库位"),
  25459. vue.createElementVNode(
  25460. "text",
  25461. {
  25462. class: "code",
  25463. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25464. },
  25465. vue.toDisplayString(item.space),
  25466. 5
  25467. /* TEXT, STYLE */
  25468. )
  25469. ]),
  25470. vue.createElementVNode("view", null, [
  25471. vue.createElementVNode("text", { class: "type" }, "单号"),
  25472. vue.createElementVNode(
  25473. "text",
  25474. {
  25475. class: "code",
  25476. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25477. },
  25478. vue.toDisplayString(item.code),
  25479. 5
  25480. /* TEXT, STYLE */
  25481. )
  25482. ]),
  25483. vue.createElementVNode("view", { class: "space-time" }, [
  25484. vue.createElementVNode(
  25485. "text",
  25486. null,
  25487. vue.toDisplayString(item.createTime),
  25488. 1
  25489. /* TEXT */
  25490. )
  25491. ])
  25492. ]),
  25493. vue.createElementVNode("view", null, [
  25494. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  25495. key: 0,
  25496. type: "checkmarkempty",
  25497. class: "status",
  25498. size: "16",
  25499. color: "green"
  25500. })) : (vue.openBlock(), vue.createElementBlock("text", {
  25501. key: 1,
  25502. class: "status fail"
  25503. }, "F"))
  25504. ])
  25505. ]);
  25506. }),
  25507. 128
  25508. /* KEYED_FRAGMENT */
  25509. ))
  25510. ]),
  25511. vue.createVNode(
  25512. _component_uni_popup,
  25513. {
  25514. ref: "messageRef",
  25515. type: "message"
  25516. },
  25517. {
  25518. default: vue.withCtx(() => [
  25519. vue.createVNode(_component_uni_popup_message, {
  25520. type: $setup.messageType,
  25521. message: $setup.messageText,
  25522. duration: 2e3
  25523. }, null, 8, ["type", "message"])
  25524. ]),
  25525. _: 1
  25526. /* STABLE */
  25527. },
  25528. 512
  25529. /* NEED_PATCH */
  25530. )
  25531. ]);
  25532. }
  25533. const PagesWaybillNoIndex = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__file", "E:/HBuilderProjects/YTAPP/pages/waybillNo/index.vue"]]);
  25534. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  25535. __name: "waybillNoLog",
  25536. setup(__props, { expose: __expose }) {
  25537. __expose();
  25538. const waybillNoHistory = vue.ref([]);
  25539. const getHistory = async () => {
  25540. waybillNoHistory.value = await uni.getStorageSync("waybillNoHistory");
  25541. };
  25542. onLoad(async () => {
  25543. await getHistory();
  25544. });
  25545. const __returned__ = { waybillNoHistory, getHistory };
  25546. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  25547. return __returned__;
  25548. }
  25549. });
  25550. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  25551. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  25552. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  25553. (vue.openBlock(true), vue.createElementBlock(
  25554. vue.Fragment,
  25555. null,
  25556. vue.renderList($setup.waybillNoHistory, (item, i2) => {
  25557. return vue.openBlock(), vue.createElementBlock("view", {
  25558. class: "item",
  25559. key: i2
  25560. }, [
  25561. vue.createElementVNode("view", null, [
  25562. vue.createElementVNode("view", null, [
  25563. vue.createElementVNode("text", { class: "type" }, "库位"),
  25564. vue.createElementVNode(
  25565. "text",
  25566. {
  25567. class: "code",
  25568. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25569. },
  25570. vue.toDisplayString(item.space),
  25571. 5
  25572. /* TEXT, STYLE */
  25573. )
  25574. ]),
  25575. vue.createElementVNode("view", null, [
  25576. vue.createElementVNode("text", { class: "type" }, "单号"),
  25577. vue.createElementVNode(
  25578. "text",
  25579. {
  25580. class: "code",
  25581. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  25582. },
  25583. vue.toDisplayString(item.code),
  25584. 5
  25585. /* TEXT, STYLE */
  25586. )
  25587. ]),
  25588. vue.createElementVNode("view", { class: "space-time" }, [
  25589. vue.createElementVNode(
  25590. "text",
  25591. null,
  25592. vue.toDisplayString(item.createTime),
  25593. 1
  25594. /* TEXT */
  25595. )
  25596. ])
  25597. ]),
  25598. vue.createElementVNode("view", null, [
  25599. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  25600. key: 0,
  25601. type: "checkmarkempty",
  25602. class: "status",
  25603. size: "16",
  25604. color: "green"
  25605. })) : (vue.openBlock(), vue.createElementBlock("text", {
  25606. key: 1,
  25607. class: "status fail"
  25608. }, "F"))
  25609. ])
  25610. ]);
  25611. }),
  25612. 128
  25613. /* KEYED_FRAGMENT */
  25614. )),
  25615. $setup.waybillNoHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  25616. key: 0,
  25617. class: "is-empty"
  25618. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  25619. ]);
  25620. }
  25621. const PagesWaybillNoWaybillNoLog = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-2f55e896"], ["__file", "E:/HBuilderProjects/YTAPP/pages/waybillNo/waybillNoLog.vue"]]);
  25622. const _sfc_main$7 = {
  25623. name: "UniDrawer",
  25624. components: {},
  25625. emits: ["change"],
  25626. props: {
  25627. /**
  25628. * 显示模式(左、右),只在初始化生效
  25629. */
  25630. mode: {
  25631. type: String,
  25632. default: ""
  25633. },
  25634. /**
  25635. * 蒙层显示状态
  25636. */
  25637. mask: {
  25638. type: Boolean,
  25639. default: true
  25640. },
  25641. /**
  25642. * 遮罩是否可点击关闭
  25643. */
  25644. maskClick: {
  25645. type: Boolean,
  25646. default: true
  25647. },
  25648. /**
  25649. * 抽屉宽度
  25650. */
  25651. width: {
  25652. type: Number,
  25653. default: 220
  25654. }
  25655. },
  25656. data() {
  25657. return {
  25658. visibleSync: false,
  25659. showDrawer: false,
  25660. rightMode: false,
  25661. watchTimer: null,
  25662. drawerWidth: 220
  25663. };
  25664. },
  25665. created() {
  25666. this.drawerWidth = this.width;
  25667. this.rightMode = this.mode === "right";
  25668. },
  25669. methods: {
  25670. clear() {
  25671. },
  25672. close(type) {
  25673. if (type === "mask" && !this.maskClick || !this.visibleSync)
  25674. return;
  25675. this._change("showDrawer", "visibleSync", false);
  25676. },
  25677. open() {
  25678. if (this.visibleSync)
  25679. return;
  25680. this._change("visibleSync", "showDrawer", true);
  25681. },
  25682. _change(param1, param2, status) {
  25683. this[param1] = status;
  25684. if (this.watchTimer) {
  25685. clearTimeout(this.watchTimer);
  25686. }
  25687. this.watchTimer = setTimeout(() => {
  25688. this[param2] = status;
  25689. this.$emit("change", status);
  25690. }, status ? 50 : 300);
  25691. }
  25692. }
  25693. };
  25694. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  25695. return $data.visibleSync ? (vue.openBlock(), vue.createElementBlock(
  25696. "view",
  25697. {
  25698. key: 0,
  25699. class: vue.normalizeClass([{ "uni-drawer--visible": $data.showDrawer }, "uni-drawer"]),
  25700. onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop", "prevent"]))
  25701. },
  25702. [
  25703. vue.createElementVNode(
  25704. "view",
  25705. {
  25706. class: vue.normalizeClass(["uni-drawer__mask", { "uni-drawer__mask--visible": $data.showDrawer && $props.mask }]),
  25707. onClick: _cache[0] || (_cache[0] = ($event) => $options.close("mask"))
  25708. },
  25709. null,
  25710. 2
  25711. /* CLASS */
  25712. ),
  25713. vue.createElementVNode(
  25714. "view",
  25715. {
  25716. class: vue.normalizeClass(["uni-drawer__content", { "uni-drawer--right": $data.rightMode, "uni-drawer--left": !$data.rightMode, "uni-drawer__content--visible": $data.showDrawer }]),
  25717. style: vue.normalizeStyle({ width: $data.drawerWidth + "px" })
  25718. },
  25719. [
  25720. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  25721. ],
  25722. 6
  25723. /* CLASS, STYLE */
  25724. )
  25725. ],
  25726. 34
  25727. /* CLASS, NEED_HYDRATION */
  25728. )) : vue.createCommentVNode("v-if", true);
  25729. }
  25730. const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-f7c32d22"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue"]]);
  25731. const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
  25732. __name: "index",
  25733. setup(__props, { expose: __expose }) {
  25734. __expose();
  25735. const loading = vue.ref(false);
  25736. const loadingBtn = vue.ref(false);
  25737. const token = vue.ref();
  25738. const searchValue = vue.ref();
  25739. const waybillDelivery = vue.ref([]);
  25740. const messageType = vue.ref();
  25741. const messageText = vue.ref();
  25742. const messageRef = vue.ref();
  25743. const showRightRef = vue.ref();
  25744. const resetForm = () => {
  25745. };
  25746. const confirmForm = () => {
  25747. showRightRef.value.close();
  25748. };
  25749. const copyOrderNo = (order_no) => {
  25750. uni.setClipboardData({
  25751. data: order_no,
  25752. success: function() {
  25753. uni.showToast({
  25754. title: "复制成功",
  25755. icon: "success",
  25756. duration: 2e3
  25757. });
  25758. },
  25759. fail: function() {
  25760. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:85", "复制失败");
  25761. }
  25762. });
  25763. };
  25764. const callPhone = (phoneNumber) => {
  25765. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:91", phoneNumber);
  25766. uni.makePhoneCall({
  25767. phoneNumber,
  25768. success: function() {
  25769. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:96", "拨打电话成功!");
  25770. },
  25771. fail: function() {
  25772. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:99", "拨打电话失败!");
  25773. }
  25774. });
  25775. };
  25776. const checkPermission = async () => {
  25777. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  25778. if (status === null || status === 1) {
  25779. status = 1;
  25780. } else {
  25781. uni.showModal({
  25782. content: "Camera permission required",
  25783. confirmText: "Setting",
  25784. success: function(res) {
  25785. if (res.confirm) {
  25786. permission.gotoAppSetting();
  25787. }
  25788. }
  25789. });
  25790. }
  25791. return status;
  25792. };
  25793. const scanInput = async () => {
  25794. let status = await checkPermission();
  25795. if (status !== 1) {
  25796. return;
  25797. }
  25798. uni.scanCode({
  25799. success: (res) => {
  25800. },
  25801. fail: (err) => {
  25802. }
  25803. });
  25804. };
  25805. const itemClick = (item) => {
  25806. uni.setStorageSync("selectItem", item);
  25807. uni.navigateTo({
  25808. url: "/pages/waybillDeliveryOrder/orderInfo?id=" + item.id
  25809. });
  25810. };
  25811. const onButtonClick = async (row, value) => {
  25812. if (value === "send_out") {
  25813. sendOut({ id: row.id });
  25814. } else if (value === "delivered") {
  25815. updateDelivered({ id: row.id });
  25816. } else if (value === "refuse") {
  25817. updateRefuse({ id: row.id });
  25818. } else if (value === "create_track_pod") {
  25819. createTrackPod({ id: row.id });
  25820. } else if (value === "edit")
  25821. ;
  25822. else if (value === "generate_label")
  25823. ;
  25824. else if (value === "fedex_appointment_pick_up")
  25825. ;
  25826. else if (value === "print_get_back_label")
  25827. ;
  25828. else if (value === "fedex_cancel_pick_up") {
  25829. cancelFedExPickUp({ id: row.id });
  25830. }
  25831. };
  25832. const sendOut = (data) => {
  25833. loadingBtn.value = true;
  25834. uni.request({
  25835. url: sendOutURL,
  25836. method: "POST",
  25837. header: {
  25838. batoken: token.value
  25839. },
  25840. data,
  25841. success: ({ data: data2 }) => {
  25842. loadingBtn.value = false;
  25843. messageType.value = "success";
  25844. messageText.value = "发出成功";
  25845. messageRef.value.open();
  25846. },
  25847. fail: (err) => {
  25848. loadingBtn.value = false;
  25849. messageType.value = "error";
  25850. messageText.value = "发出失败,请稍后重试";
  25851. messageRef.value.open();
  25852. }
  25853. });
  25854. };
  25855. const updateDelivered = (data) => {
  25856. loadingBtn.value = true;
  25857. uni.request({
  25858. url: deliveredURL,
  25859. method: "POST",
  25860. header: {
  25861. batoken: token.value
  25862. },
  25863. data,
  25864. success: ({ data: data2 }) => {
  25865. loadingBtn.value = false;
  25866. messageType.value = "success";
  25867. messageText.value = "确认送达成功";
  25868. messageRef.value.open();
  25869. },
  25870. fail: (err) => {
  25871. loadingBtn.value = false;
  25872. messageType.value = "error";
  25873. messageText.value = "确认送达失败,请稍后重试";
  25874. messageRef.value.open();
  25875. }
  25876. });
  25877. };
  25878. const updateRefuse = (data) => {
  25879. loadingBtn.value = true;
  25880. uni.request({
  25881. url: refuseURL,
  25882. method: "POST",
  25883. header: {
  25884. batoken: token.value
  25885. },
  25886. data,
  25887. success: ({ data: data2 }) => {
  25888. loadingBtn.value = false;
  25889. messageType.value = "success";
  25890. messageText.value = "已拒绝签收";
  25891. messageRef.value.open();
  25892. },
  25893. fail: (err) => {
  25894. loadingBtn.value = false;
  25895. messageType.value = "error";
  25896. messageText.value = "修改失败,请稍后重试";
  25897. messageRef.value.open();
  25898. }
  25899. });
  25900. };
  25901. const createTrackPod = (data) => {
  25902. loadingBtn.value = true;
  25903. uni.request({
  25904. url: createTrackPodURL,
  25905. method: "POST",
  25906. header: {
  25907. batoken: token.value
  25908. },
  25909. data,
  25910. success: ({ data: data2 }) => {
  25911. loadingBtn.value = false;
  25912. messageType.value = "success";
  25913. messageText.value = "同步成功";
  25914. messageRef.value.open();
  25915. },
  25916. fail: (err) => {
  25917. loadingBtn.value = false;
  25918. messageType.value = "error";
  25919. messageText.value = "同步失败,请稍后重试";
  25920. messageRef.value.open();
  25921. }
  25922. });
  25923. };
  25924. const cancelFedExPickUp = (data) => {
  25925. loadingBtn.value = true;
  25926. uni.request({
  25927. url: cancelFedExPickUpURL,
  25928. method: "POST",
  25929. header: {
  25930. batoken: token.value
  25931. },
  25932. data,
  25933. success: ({ data: data2 }) => {
  25934. loadingBtn.value = false;
  25935. messageType.value = "success";
  25936. messageText.value = "操作成功";
  25937. messageRef.value.open();
  25938. },
  25939. fail: (err) => {
  25940. loadingBtn.value = false;
  25941. messageType.value = "error";
  25942. messageText.value = "操作失败,请稍后重试";
  25943. messageRef.value.open();
  25944. }
  25945. });
  25946. };
  25947. const getList = () => {
  25948. loading.value = true;
  25949. uni.request({
  25950. url: pickupWaybillDeliveryOrderURL + "/index",
  25951. method: "GET",
  25952. header: {
  25953. batoken: token.value
  25954. },
  25955. success: ({ data }) => {
  25956. loading.value = false;
  25957. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:319", data);
  25958. if (data.code == 1) {
  25959. waybillDelivery.value = data.data.list;
  25960. } else {
  25961. messageType.value = "error";
  25962. messageText.value = data.msg;
  25963. messageRef.value.open();
  25964. }
  25965. },
  25966. fail: (err) => {
  25967. loading.value = false;
  25968. }
  25969. });
  25970. };
  25971. onLoad(() => {
  25972. token.value = uni.getStorageSync("token");
  25973. getList();
  25974. });
  25975. onNavigationBarButtonTap((event) => {
  25976. if (event.index === 0) {
  25977. showRightRef.value.open();
  25978. }
  25979. });
  25980. const __returned__ = { loading, loadingBtn, token, searchValue, waybillDelivery, messageType, messageText, messageRef, showRightRef, resetForm, confirmForm, copyOrderNo, callPhone, checkPermission, scanInput, itemClick, onButtonClick, sendOut, updateDelivered, updateRefuse, createTrackPod, cancelFedExPickUp, getList };
  25981. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  25982. return __returned__;
  25983. }
  25984. });
  25985. const _imports_0 = "/static/copy.png";
  25986. const _imports_1 = "/static/call.png";
  25987. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  25988. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  25989. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  25990. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  25991. const _component_uni_drawer = resolveEasycom(vue.resolveDynamicComponent("uni-drawer"), __easycom_3);
  25992. return vue.openBlock(), vue.createElementBlock("view", { class: "list" }, [
  25993. vue.createCommentVNode(' <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear"></uni-search-bar> '),
  25994. vue.createVNode(_component_uni_easyinput, {
  25995. modelValue: $setup.searchValue,
  25996. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.searchValue = $event),
  25997. placeholder: "请输入单号",
  25998. suffixIcon: "scan",
  25999. onIconClick: $setup.scanInput
  26000. }, null, 8, ["modelValue"]),
  26001. (vue.openBlock(true), vue.createElementBlock(
  26002. vue.Fragment,
  26003. null,
  26004. vue.renderList($setup.waybillDelivery, (item, i2) => {
  26005. return vue.openBlock(), vue.createElementBlock("view", {
  26006. class: "item",
  26007. key: i2,
  26008. onClick: ($event) => $setup.itemClick(item)
  26009. }, [
  26010. vue.createElementVNode("view", { class: "order-no" }, [
  26011. vue.createElementVNode(
  26012. "text",
  26013. null,
  26014. " 派送单号: " + vue.toDisplayString(item.order_no),
  26015. 1
  26016. /* TEXT */
  26017. ),
  26018. vue.createElementVNode("image", {
  26019. onClick: ($event) => $setup.copyOrderNo(item.order_no),
  26020. class: "icon",
  26021. src: _imports_0,
  26022. mode: "aspectFill"
  26023. }, null, 8, ["onClick"])
  26024. ]),
  26025. vue.createElementVNode("view", { class: "address-info" }, [
  26026. vue.createElementVNode("view", { class: "info" }, [
  26027. vue.createElementVNode("view", { class: "user" }, [
  26028. vue.createElementVNode(
  26029. "text",
  26030. null,
  26031. vue.toDisplayString(item.address.first_name + " " + item.address.last_name) + " " + vue.toDisplayString("+" + item.address.mobile_code + " " + item.address.mobile),
  26032. 1
  26033. /* TEXT */
  26034. ),
  26035. vue.createElementVNode("image", {
  26036. onClick: ($event) => $setup.callPhone(item.address.mobile_code + " " + item.address.mobile),
  26037. class: "icon",
  26038. src: _imports_1,
  26039. mode: "aspectFill"
  26040. }, null, 8, ["onClick"])
  26041. ]),
  26042. vue.createElementVNode("view", null, [
  26043. vue.createElementVNode("text", { class: "address" }, [
  26044. vue.createElementVNode(
  26045. "text",
  26046. { class: "city" },
  26047. vue.toDisplayString(item.address.city),
  26048. 1
  26049. /* TEXT */
  26050. ),
  26051. vue.createTextVNode(
  26052. " " + vue.toDisplayString(item.address.zip_code),
  26053. 1
  26054. /* TEXT */
  26055. )
  26056. ]),
  26057. vue.createElementVNode("image", {
  26058. onClick: ($event) => $setup.copyOrderNo(item.address.zip_code),
  26059. class: "icon",
  26060. src: _imports_0,
  26061. mode: "aspectFill"
  26062. }, null, 8, ["onClick"])
  26063. ])
  26064. ]),
  26065. vue.createElementVNode("view", { class: "info" })
  26066. ]),
  26067. vue.createElementVNode("view"),
  26068. vue.createElementVNode("view", { class: "operations" }, [
  26069. (vue.openBlock(true), vue.createElementBlock(
  26070. vue.Fragment,
  26071. null,
  26072. vue.renderList(item.operations, (operation, i22) => {
  26073. return vue.openBlock(), vue.createElementBlock("button", {
  26074. key: i22,
  26075. onClick: ($event) => $setup.onButtonClick(item, operation.value),
  26076. type: "info",
  26077. size: "mini"
  26078. }, vue.toDisplayString(operation.text), 9, ["onClick"]);
  26079. }),
  26080. 128
  26081. /* KEYED_FRAGMENT */
  26082. ))
  26083. ])
  26084. ], 8, ["onClick"]);
  26085. }),
  26086. 128
  26087. /* KEYED_FRAGMENT */
  26088. )),
  26089. $setup.waybillDelivery.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  26090. key: 0,
  26091. class: "is-empty"
  26092. }, "暂无派送单")) : vue.createCommentVNode("v-if", true),
  26093. vue.createVNode(
  26094. _component_uni_popup,
  26095. {
  26096. ref: "messageRef",
  26097. type: "message"
  26098. },
  26099. {
  26100. default: vue.withCtx(() => [
  26101. vue.createVNode(_component_uni_popup_message, {
  26102. type: $setup.messageType,
  26103. message: $setup.messageText,
  26104. duration: 2e3
  26105. }, null, 8, ["type", "message"])
  26106. ]),
  26107. _: 1
  26108. /* STABLE */
  26109. },
  26110. 512
  26111. /* NEED_PATCH */
  26112. ),
  26113. vue.createVNode(
  26114. _component_uni_drawer,
  26115. {
  26116. ref: "showRightRef",
  26117. mode: "right",
  26118. "mask-click": true
  26119. },
  26120. {
  26121. default: vue.withCtx(() => [
  26122. vue.createElementVNode("scroll-view", {
  26123. style: { "height": "100%" },
  26124. "scroll-y": "true"
  26125. }, [
  26126. vue.createElementVNode("view", { class: "button-group" }, [
  26127. vue.createElementVNode("button", {
  26128. onClick: $setup.resetForm,
  26129. type: "info"
  26130. }, "重置"),
  26131. vue.createElementVNode("button", {
  26132. onClick: $setup.confirmForm,
  26133. type: "primary"
  26134. }, "确认")
  26135. ])
  26136. ])
  26137. ]),
  26138. _: 1
  26139. /* STABLE */
  26140. },
  26141. 512
  26142. /* NEED_PATCH */
  26143. )
  26144. ]);
  26145. }
  26146. const PagesWaybillDeliveryOrderIndex = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-e43ee4da"], ["__file", "E:/HBuilderProjects/YTAPP/pages/waybillDeliveryOrder/index.vue"]]);
  26147. const _sfc_main$5 = {
  26148. name: "UniSegmentedControl",
  26149. emits: ["clickItem"],
  26150. props: {
  26151. current: {
  26152. type: Number,
  26153. default: 0
  26154. },
  26155. values: {
  26156. type: Array,
  26157. default() {
  26158. return [];
  26159. }
  26160. },
  26161. activeColor: {
  26162. type: String,
  26163. default: "#2979FF"
  26164. },
  26165. inActiveColor: {
  26166. type: String,
  26167. default: "transparent"
  26168. },
  26169. styleType: {
  26170. type: String,
  26171. default: "button"
  26172. }
  26173. },
  26174. data() {
  26175. return {
  26176. currentIndex: 0
  26177. };
  26178. },
  26179. watch: {
  26180. current(val) {
  26181. if (val !== this.currentIndex) {
  26182. this.currentIndex = val;
  26183. }
  26184. }
  26185. },
  26186. computed: {},
  26187. created() {
  26188. this.currentIndex = this.current;
  26189. },
  26190. methods: {
  26191. _onClick(index) {
  26192. if (this.currentIndex !== index) {
  26193. this.currentIndex = index;
  26194. this.$emit("clickItem", {
  26195. currentIndex: index
  26196. });
  26197. }
  26198. }
  26199. }
  26200. };
  26201. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  26202. return vue.openBlock(), vue.createElementBlock(
  26203. "view",
  26204. {
  26205. class: vue.normalizeClass([[$props.styleType === "text" ? "segmented-control--text" : "segmented-control--button"], "segmented-control"]),
  26206. style: vue.normalizeStyle({ borderColor: $props.styleType === "text" ? "" : $props.activeColor })
  26207. },
  26208. [
  26209. (vue.openBlock(true), vue.createElementBlock(
  26210. vue.Fragment,
  26211. null,
  26212. vue.renderList($props.values, (item, index) => {
  26213. return vue.openBlock(), vue.createElementBlock("view", {
  26214. class: vue.normalizeClass([[
  26215. $props.styleType === "text" ? "" : "segmented-control__item--button",
  26216. index === 0 && $props.styleType === "button" ? "segmented-control__item--button--first" : "",
  26217. index === $props.values.length - 1 && $props.styleType === "button" ? "segmented-control__item--button--last" : ""
  26218. ], "segmented-control__item"]),
  26219. key: index,
  26220. style: vue.normalizeStyle({ backgroundColor: index === $data.currentIndex && $props.styleType === "button" ? $props.activeColor : $props.styleType === "button" ? $props.inActiveColor : "transparent", borderColor: index === $data.currentIndex && $props.styleType === "text" || $props.styleType === "button" ? $props.activeColor : $props.inActiveColor }),
  26221. onClick: ($event) => $options._onClick(index)
  26222. }, [
  26223. vue.createElementVNode("view", null, [
  26224. vue.createElementVNode(
  26225. "text",
  26226. {
  26227. style: vue.normalizeStyle({ color: index === $data.currentIndex ? $props.styleType === "text" ? $props.activeColor : "#fff" : $props.styleType === "text" ? "#000" : $props.activeColor }),
  26228. class: vue.normalizeClass(["segmented-control__text", $props.styleType === "text" && index === $data.currentIndex ? "segmented-control__item--text" : ""])
  26229. },
  26230. vue.toDisplayString(item),
  26231. 7
  26232. /* TEXT, CLASS, STYLE */
  26233. )
  26234. ])
  26235. ], 14, ["onClick"]);
  26236. }),
  26237. 128
  26238. /* KEYED_FRAGMENT */
  26239. ))
  26240. ],
  26241. 6
  26242. /* CLASS, STYLE */
  26243. );
  26244. }
  26245. const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-86aa1171"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue"]]);
  26246. const _sfc_main$4 = {
  26247. name: "UniTag",
  26248. emits: ["click"],
  26249. props: {
  26250. type: {
  26251. // 标签类型default、primary、success、warning、error、royal
  26252. type: String,
  26253. default: "default"
  26254. },
  26255. size: {
  26256. // 标签大小 normal, small
  26257. type: String,
  26258. default: "normal"
  26259. },
  26260. // 标签内容
  26261. text: {
  26262. type: String,
  26263. default: ""
  26264. },
  26265. disabled: {
  26266. // 是否为禁用状态
  26267. type: [Boolean, String],
  26268. default: false
  26269. },
  26270. inverted: {
  26271. // 是否为空心
  26272. type: [Boolean, String],
  26273. default: false
  26274. },
  26275. circle: {
  26276. // 是否为圆角样式
  26277. type: [Boolean, String],
  26278. default: false
  26279. },
  26280. mark: {
  26281. // 是否为标记样式
  26282. type: [Boolean, String],
  26283. default: false
  26284. },
  26285. customStyle: {
  26286. type: String,
  26287. default: ""
  26288. }
  26289. },
  26290. computed: {
  26291. classes() {
  26292. const {
  26293. type,
  26294. disabled,
  26295. inverted,
  26296. circle,
  26297. mark,
  26298. size,
  26299. isTrue
  26300. } = this;
  26301. const classArr = [
  26302. "uni-tag--" + type,
  26303. "uni-tag--" + size,
  26304. isTrue(disabled) ? "uni-tag--disabled" : "",
  26305. isTrue(inverted) ? "uni-tag--" + type + "--inverted" : "",
  26306. isTrue(circle) ? "uni-tag--circle" : "",
  26307. isTrue(mark) ? "uni-tag--mark" : "",
  26308. // type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
  26309. isTrue(inverted) ? "uni-tag--inverted uni-tag-text--" + type : "",
  26310. size === "small" ? "uni-tag-text--small" : ""
  26311. ];
  26312. return classArr.join(" ");
  26313. }
  26314. },
  26315. methods: {
  26316. isTrue(value) {
  26317. return value === true || value === "true";
  26318. },
  26319. onClick() {
  26320. if (this.isTrue(this.disabled))
  26321. return;
  26322. this.$emit("click");
  26323. }
  26324. }
  26325. };
  26326. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  26327. return $props.text ? (vue.openBlock(), vue.createElementBlock(
  26328. "text",
  26329. {
  26330. key: 0,
  26331. class: vue.normalizeClass(["uni-tag", $options.classes]),
  26332. style: vue.normalizeStyle($props.customStyle),
  26333. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  26334. },
  26335. vue.toDisplayString($props.text),
  26336. 7
  26337. /* TEXT, CLASS, STYLE */
  26338. )) : vue.createCommentVNode("v-if", true);
  26339. }
  26340. const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-1f94d070"], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-tag/components/uni-tag/uni-tag.vue"]]);
  26341. function pad(str, length = 2) {
  26342. str += "";
  26343. while (str.length < length) {
  26344. str = "0" + str;
  26345. }
  26346. return str.slice(-length);
  26347. }
  26348. const parser = {
  26349. yyyy: (dateObj) => {
  26350. return pad(dateObj.year, 4);
  26351. },
  26352. yy: (dateObj) => {
  26353. return pad(dateObj.year);
  26354. },
  26355. MM: (dateObj) => {
  26356. return pad(dateObj.month);
  26357. },
  26358. M: (dateObj) => {
  26359. return dateObj.month;
  26360. },
  26361. dd: (dateObj) => {
  26362. return pad(dateObj.day);
  26363. },
  26364. d: (dateObj) => {
  26365. return dateObj.day;
  26366. },
  26367. hh: (dateObj) => {
  26368. return pad(dateObj.hour);
  26369. },
  26370. h: (dateObj) => {
  26371. return dateObj.hour;
  26372. },
  26373. mm: (dateObj) => {
  26374. return pad(dateObj.minute);
  26375. },
  26376. m: (dateObj) => {
  26377. return dateObj.minute;
  26378. },
  26379. ss: (dateObj) => {
  26380. return pad(dateObj.second);
  26381. },
  26382. s: (dateObj) => {
  26383. return dateObj.second;
  26384. },
  26385. SSS: (dateObj) => {
  26386. return pad(dateObj.millisecond, 3);
  26387. },
  26388. S: (dateObj) => {
  26389. return dateObj.millisecond;
  26390. }
  26391. };
  26392. function getDate(time) {
  26393. if (time instanceof Date) {
  26394. return time;
  26395. }
  26396. switch (typeof time) {
  26397. case "string": {
  26398. if (time.indexOf("T") > -1) {
  26399. return new Date(time);
  26400. }
  26401. return new Date(time.replace(/-/g, "/"));
  26402. }
  26403. default:
  26404. return new Date(time);
  26405. }
  26406. }
  26407. function formatDate(date, format = "yyyy/MM/dd hh:mm:ss") {
  26408. if (!date && date !== 0) {
  26409. return "";
  26410. }
  26411. date = getDate(date);
  26412. const dateObj = {
  26413. year: date.getFullYear(),
  26414. month: date.getMonth() + 1,
  26415. day: date.getDate(),
  26416. hour: date.getHours(),
  26417. minute: date.getMinutes(),
  26418. second: date.getSeconds(),
  26419. millisecond: date.getMilliseconds()
  26420. };
  26421. const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;
  26422. let flag = true;
  26423. let result = format;
  26424. while (flag) {
  26425. flag = false;
  26426. result = result.replace(tokenRegExp, function(matched) {
  26427. flag = true;
  26428. return parser[matched](dateObj);
  26429. });
  26430. }
  26431. return result;
  26432. }
  26433. function friendlyDate(time, {
  26434. locale = "zh",
  26435. threshold = [6e4, 36e5],
  26436. format = "yyyy/MM/dd hh:mm:ss"
  26437. }) {
  26438. if (time === "-") {
  26439. return time;
  26440. }
  26441. if (!time && time !== 0) {
  26442. return "";
  26443. }
  26444. const localeText = {
  26445. zh: {
  26446. year: "年",
  26447. month: "月",
  26448. day: "天",
  26449. hour: "小时",
  26450. minute: "分钟",
  26451. second: "秒",
  26452. ago: "前",
  26453. later: "后",
  26454. justNow: "刚刚",
  26455. soon: "马上",
  26456. template: "{num}{unit}{suffix}"
  26457. },
  26458. en: {
  26459. year: "year",
  26460. month: "month",
  26461. day: "day",
  26462. hour: "hour",
  26463. minute: "minute",
  26464. second: "second",
  26465. ago: "ago",
  26466. later: "later",
  26467. justNow: "just now",
  26468. soon: "soon",
  26469. template: "{num} {unit} {suffix}"
  26470. }
  26471. };
  26472. const text = localeText[locale] || localeText.zh;
  26473. let date = getDate(time);
  26474. let ms2 = date.getTime() - Date.now();
  26475. let absMs = Math.abs(ms2);
  26476. if (absMs < threshold[0]) {
  26477. return ms2 < 0 ? text.justNow : text.soon;
  26478. }
  26479. if (absMs >= threshold[1]) {
  26480. return formatDate(date, format);
  26481. }
  26482. let num;
  26483. let unit;
  26484. let suffix = text.later;
  26485. if (ms2 < 0) {
  26486. suffix = text.ago;
  26487. ms2 = -ms2;
  26488. }
  26489. const seconds = Math.floor(ms2 / 1e3);
  26490. const minutes = Math.floor(seconds / 60);
  26491. const hours = Math.floor(minutes / 60);
  26492. const days = Math.floor(hours / 24);
  26493. const months = Math.floor(days / 30);
  26494. const years = Math.floor(months / 12);
  26495. switch (true) {
  26496. case years > 0:
  26497. num = years;
  26498. unit = text.year;
  26499. break;
  26500. case months > 0:
  26501. num = months;
  26502. unit = text.month;
  26503. break;
  26504. case days > 0:
  26505. num = days;
  26506. unit = text.day;
  26507. break;
  26508. case hours > 0:
  26509. num = hours;
  26510. unit = text.hour;
  26511. break;
  26512. case minutes > 0:
  26513. num = minutes;
  26514. unit = text.minute;
  26515. break;
  26516. default:
  26517. num = seconds;
  26518. unit = text.second;
  26519. break;
  26520. }
  26521. if (locale === "en") {
  26522. if (num === 1) {
  26523. num = "a";
  26524. } else {
  26525. unit += "s";
  26526. }
  26527. }
  26528. return text.template.replace(/{\s*num\s*}/g, num + "").replace(/{\s*unit\s*}/g, unit).replace(
  26529. /{\s*suffix\s*}/g,
  26530. suffix
  26531. );
  26532. }
  26533. const _sfc_main$3 = {
  26534. name: "uniDateformat",
  26535. props: {
  26536. date: {
  26537. type: [Object, String, Number],
  26538. default() {
  26539. return "-";
  26540. }
  26541. },
  26542. locale: {
  26543. type: String,
  26544. default: "zh"
  26545. },
  26546. threshold: {
  26547. type: Array,
  26548. default() {
  26549. return [0, 0];
  26550. }
  26551. },
  26552. format: {
  26553. type: String,
  26554. default: "yyyy/MM/dd hh:mm:ss"
  26555. },
  26556. // refreshRate使用不当可能导致性能问题,谨慎使用
  26557. refreshRate: {
  26558. type: [Number, String],
  26559. default: 0
  26560. }
  26561. },
  26562. data() {
  26563. return {
  26564. refreshMark: 0
  26565. };
  26566. },
  26567. computed: {
  26568. dateShow() {
  26569. this.refreshMark;
  26570. return friendlyDate(this.date, {
  26571. locale: this.locale,
  26572. threshold: this.threshold,
  26573. format: this.format
  26574. });
  26575. }
  26576. },
  26577. watch: {
  26578. refreshRate: {
  26579. handler() {
  26580. this.setAutoRefresh();
  26581. },
  26582. immediate: true
  26583. }
  26584. },
  26585. methods: {
  26586. refresh() {
  26587. this.refreshMark++;
  26588. },
  26589. setAutoRefresh() {
  26590. clearInterval(this.refreshInterval);
  26591. if (this.refreshRate) {
  26592. this.refreshInterval = setInterval(() => {
  26593. this.refresh();
  26594. }, parseInt(this.refreshRate));
  26595. }
  26596. }
  26597. }
  26598. };
  26599. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  26600. return vue.openBlock(), vue.createElementBlock(
  26601. "text",
  26602. null,
  26603. vue.toDisplayString($options.dateShow),
  26604. 1
  26605. /* TEXT */
  26606. );
  26607. }
  26608. const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "E:/HBuilderProjects/YTAPP/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue"]]);
  26609. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  26610. __name: "orderInfo",
  26611. setup(__props, { expose: __expose }) {
  26612. __expose();
  26613. const current = vue.ref(0);
  26614. const items = vue.ref(["基本信息", "运单详情"]);
  26615. const loading = vue.ref(false);
  26616. const token = vue.ref();
  26617. const waybillDelivery = vue.ref([]);
  26618. const messageType = vue.ref();
  26619. const messageText = vue.ref();
  26620. const messageRef = vue.ref();
  26621. const item = vue.ref();
  26622. const deliveryOrderOptions = vue.ref({});
  26623. const delivery_type = vue.ref({
  26624. "1": "英途派送",
  26625. "2": "第三方物流"
  26626. });
  26627. onLoad((query) => {
  26628. token.value = uni.getStorageSync("token");
  26629. item.value = uni.getStorageSync("selectItem");
  26630. deliveryOrderOptions.value = uni.getStorageSync("deliveryOrderOptions");
  26631. formatAppLog("log", "at pages/waybillDeliveryOrder/orderInfo.vue:128", item.value);
  26632. });
  26633. const onClickItem = (e2) => {
  26634. if (current.value != e2.currentIndex) {
  26635. current.value = e2.currentIndex;
  26636. }
  26637. };
  26638. const copyString = (str) => {
  26639. uni.setClipboardData({
  26640. data: str,
  26641. success: function() {
  26642. uni.showToast({
  26643. title: "复制成功",
  26644. icon: "success",
  26645. duration: 2e3
  26646. });
  26647. },
  26648. fail: function() {
  26649. formatAppLog("log", "at pages/waybillDeliveryOrder/orderInfo.vue:149", "复制失败");
  26650. }
  26651. });
  26652. };
  26653. const __returned__ = { current, items, loading, token, waybillDelivery, messageType, messageText, messageRef, item, deliveryOrderOptions, delivery_type, onClickItem, copyString };
  26654. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  26655. return __returned__;
  26656. }
  26657. });
  26658. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  26659. const _component_uni_segmented_control = resolveEasycom(vue.resolveDynamicComponent("uni-segmented-control"), __easycom_0);
  26660. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_1);
  26661. const _component_uni_dateformat = resolveEasycom(vue.resolveDynamicComponent("uni-dateformat"), __easycom_2);
  26662. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  26663. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  26664. return vue.openBlock(), vue.createElementBlock("view", { class: "info" }, [
  26665. vue.createVNode(_component_uni_segmented_control, {
  26666. current: $setup.current,
  26667. values: $setup.items,
  26668. onClickItem: $setup.onClickItem,
  26669. styleType: "text",
  26670. activeColor: "#007aff"
  26671. }, null, 8, ["current", "values"]),
  26672. vue.createElementVNode("view", { class: "content" }, [
  26673. vue.withDirectives(vue.createElementVNode(
  26674. "view",
  26675. null,
  26676. [
  26677. vue.createElementVNode("view", { class: "order-no" }, [
  26678. vue.createElementVNode("view", null, [
  26679. vue.createElementVNode(
  26680. "text",
  26681. null,
  26682. "派送单号: " + vue.toDisplayString($setup.item.order_no),
  26683. 1
  26684. /* TEXT */
  26685. ),
  26686. vue.createElementVNode("image", {
  26687. onClick: _cache[0] || (_cache[0] = ($event) => $setup.copyString($setup.item.order_no)),
  26688. class: "icon",
  26689. src: _imports_0,
  26690. mode: "aspectFill"
  26691. })
  26692. ]),
  26693. vue.createVNode(_component_uni_tag, {
  26694. text: $setup.item.status_text,
  26695. type: "primary",
  26696. circle: ""
  26697. }, null, 8, ["text"])
  26698. ]),
  26699. vue.createElementVNode("view", { class: "box-card" }, [
  26700. vue.createElementVNode("view", { class: "label-icon" }, [
  26701. vue.createElementVNode("text", { class: "label-title" }, "地址信息")
  26702. ]),
  26703. vue.createElementVNode("view", { class: "label-content" }, [
  26704. vue.createElementVNode(
  26705. "text",
  26706. null,
  26707. vue.toDisplayString($setup.item.address.first_name + " " + $setup.item.address.last_name),
  26708. 1
  26709. /* TEXT */
  26710. ),
  26711. $setup.item.address.mobile ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, [
  26712. vue.createTextVNode(
  26713. " +" + vue.toDisplayString($setup.item.address.mobile_code + " " + $setup.item.address.mobile) + " ",
  26714. 1
  26715. /* TEXT */
  26716. ),
  26717. vue.createElementVNode("br")
  26718. ])) : vue.createCommentVNode("v-if", true),
  26719. $setup.item.address.email ? (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, [
  26720. vue.createTextVNode(
  26721. vue.toDisplayString($setup.item.address.email) + " ",
  26722. 1
  26723. /* TEXT */
  26724. ),
  26725. vue.createElementVNode("br")
  26726. ])) : vue.createCommentVNode("v-if", true),
  26727. vue.createElementVNode("text", null, [
  26728. vue.createTextVNode(
  26729. vue.toDisplayString($setup.item.address.address_line_1) + " ",
  26730. 1
  26731. /* TEXT */
  26732. ),
  26733. vue.createElementVNode("br")
  26734. ]),
  26735. $setup.item.address.address_line_2 ? (vue.openBlock(), vue.createElementBlock("text", { key: 2 }, [
  26736. vue.createTextVNode(
  26737. vue.toDisplayString($setup.item.address.address_line_2) + " ",
  26738. 1
  26739. /* TEXT */
  26740. ),
  26741. vue.createElementVNode("br")
  26742. ])) : vue.createCommentVNode("v-if", true),
  26743. $setup.item.address.address_line_3 ? (vue.openBlock(), vue.createElementBlock("text", { key: 3 }, [
  26744. vue.createTextVNode(
  26745. vue.toDisplayString($setup.item.address.address_line_3) + " ",
  26746. 1
  26747. /* TEXT */
  26748. ),
  26749. vue.createElementVNode("br")
  26750. ])) : vue.createCommentVNode("v-if", true),
  26751. vue.createElementVNode("text", null, [
  26752. vue.createTextVNode(
  26753. vue.toDisplayString($setup.item.address.city + " " + $setup.item.address.district) + " ",
  26754. 1
  26755. /* TEXT */
  26756. ),
  26757. vue.createElementVNode("br")
  26758. ]),
  26759. vue.createElementVNode("text", null, [
  26760. vue.createTextVNode(
  26761. vue.toDisplayString($setup.item.address.province) + " ",
  26762. 1
  26763. /* TEXT */
  26764. ),
  26765. vue.createElementVNode("br")
  26766. ]),
  26767. vue.createElementVNode("text", null, [
  26768. vue.createTextVNode(
  26769. vue.toDisplayString($setup.item.address.zip_code) + " ",
  26770. 1
  26771. /* TEXT */
  26772. ),
  26773. vue.createElementVNode("br")
  26774. ])
  26775. ])
  26776. ]),
  26777. vue.createElementVNode("view", { class: "box-card" }, [
  26778. vue.createElementVNode("text", null, [
  26779. vue.createTextVNode("客户派送日期: "),
  26780. $setup.item.delivery_date ? (vue.openBlock(), vue.createBlock(_component_uni_dateformat, {
  26781. key: 0,
  26782. date: $setup.item.delivery_date,
  26783. format: "yyyy-MM-dd"
  26784. }, null, 8, ["date"])) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "无")),
  26785. vue.createElementVNode("br")
  26786. ]),
  26787. vue.createElementVNode(
  26788. "text",
  26789. null,
  26790. "备注: " + vue.toDisplayString($setup.item.remark || "无"),
  26791. 1
  26792. /* TEXT */
  26793. )
  26794. ]),
  26795. vue.createElementVNode("view", { class: "box-card" }, [
  26796. vue.createElementVNode("view", { class: "label-icon" }, [
  26797. vue.createElementVNode("text", { class: "label-title" }, "物流信息")
  26798. ]),
  26799. vue.createElementVNode("view", { class: "label-content" }, [
  26800. vue.createElementVNode("text", null, [
  26801. vue.createTextVNode("派送渠道类型: "),
  26802. vue.createVNode(_component_uni_tag, {
  26803. text: $setup.delivery_type[$setup.item.delivery_type],
  26804. type: "primary"
  26805. }, null, 8, ["text"]),
  26806. vue.createElementVNode("br")
  26807. ]),
  26808. Number($setup.item.delivery_type) === 1 ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, [
  26809. vue.createTextVNode(
  26810. "司机: " + vue.toDisplayString($setup.deliveryOrderOptions["driver_id"][$setup.item.driver_id] || "无") + " ",
  26811. 1
  26812. /* TEXT */
  26813. ),
  26814. vue.createElementVNode("br")
  26815. ])) : vue.createCommentVNode("v-if", true),
  26816. Number($setup.item.delivery_type) === 2 ? (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, [
  26817. vue.createTextVNode("快递公司: "),
  26818. vue.createVNode(_component_uni_tag, {
  26819. text: $setup.item.express.name || "无",
  26820. type: "success",
  26821. size: "small",
  26822. circle: ""
  26823. }, null, 8, ["text"]),
  26824. vue.createElementVNode("br")
  26825. ])) : vue.createCommentVNode("v-if", true),
  26826. vue.createElementVNode("text", null, [
  26827. vue.createTextVNode(
  26828. "物流单号: " + vue.toDisplayString($setup.item.express_no || "无") + " ",
  26829. 1
  26830. /* TEXT */
  26831. ),
  26832. vue.createElementVNode("br")
  26833. ]),
  26834. vue.createElementVNode(
  26835. "text",
  26836. null,
  26837. "追踪单号: " + vue.toDisplayString($setup.item.express_tracking_number || "无"),
  26838. 1
  26839. /* TEXT */
  26840. )
  26841. ])
  26842. ])
  26843. ],
  26844. 512
  26845. /* NEED_PATCH */
  26846. ), [
  26847. [vue.vShow, $setup.current === 0]
  26848. ]),
  26849. vue.withDirectives(vue.createElementVNode(
  26850. "view",
  26851. null,
  26852. " 选项卡2的内容 ",
  26853. 512
  26854. /* NEED_PATCH */
  26855. ), [
  26856. [vue.vShow, $setup.current === 1]
  26857. ])
  26858. ]),
  26859. vue.createVNode(
  26860. _component_uni_popup,
  26861. {
  26862. ref: "messageRef",
  26863. type: "message"
  26864. },
  26865. {
  26866. default: vue.withCtx(() => [
  26867. vue.createVNode(_component_uni_popup_message, {
  26868. type: $setup.messageType,
  26869. message: $setup.messageText,
  26870. duration: 2e3
  26871. }, null, 8, ["type", "message"])
  26872. ]),
  26873. _: 1
  26874. /* STABLE */
  26875. },
  26876. 512
  26877. /* NEED_PATCH */
  26878. )
  26879. ]);
  26880. }
  26881. const PagesWaybillDeliveryOrderOrderInfo = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-a28459fe"], ["__file", "E:/HBuilderProjects/YTAPP/pages/waybillDeliveryOrder/orderInfo.vue"]]);
  26882. const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
  26883. __name: "index",
  26884. setup(__props, { expose: __expose }) {
  26885. __expose();
  26886. const token = vue.ref();
  26887. const loading = vue.ref(false);
  26888. const hidePage = vue.ref(false);
  26889. const focusType = vue.ref(true);
  26890. const selectType = vue.ref(1);
  26891. const printType = vue.ref([
  26892. {
  26893. text: "打印尾程面单",
  26894. value: 1
  26895. },
  26896. {
  26897. text: "打印客户联(详细)",
  26898. value: 2
  26899. },
  26900. {
  26901. text: "打印客户联(简单)",
  26902. value: 3
  26903. }
  26904. ]);
  26905. const printerDialog = vue.ref();
  26906. const subLoading = vue.ref(false);
  26907. const printerList = vue.ref([]);
  26908. const printers = vue.ref([]);
  26909. const downloadFile = vue.ref([]);
  26910. const sendToPeinter = vue.ref([1]);
  26911. const selectPrinter = vue.ref(0);
  26912. const printLogHistory = vue.ref([]);
  26913. const messageRef = vue.ref();
  26914. const messageType = vue.ref();
  26915. const messageText = vue.ref();
  26916. let st2;
  26917. const valiFormData = vue.ref({
  26918. order_code: ""
  26919. });
  26920. const rules = vue.reactive({
  26921. order_code: {
  26922. rules: [
  26923. {
  26924. required: true,
  26925. errorMessage: "单据编号不能为空"
  26926. }
  26927. ]
  26928. }
  26929. });
  26930. const checkPermission = async () => {
  26931. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  26932. if (status === null || status === 1) {
  26933. status = 1;
  26934. } else {
  26935. uni.showModal({
  26936. content: "Camera permission required",
  26937. confirmText: "Setting",
  26938. success: function(res) {
  26939. if (res.confirm) {
  26940. permission.gotoAppSetting();
  26941. }
  26942. }
  26943. });
  26944. }
  26945. return status;
  26946. };
  26947. const scanInput = async () => {
  26948. let status = await checkPermission();
  26949. if (status !== 1) {
  26950. return;
  26951. }
  26952. uni.scanCode({
  26953. success: (res) => {
  26954. valiFormData.value.order_code = res.result;
  26955. onsubmit();
  26956. },
  26957. fail: (err) => {
  26958. }
  26959. });
  26960. };
  26961. const reset = () => {
  26962. loading.value = false;
  26963. valiFormData.value.order_code = "";
  26964. };
  26965. const setfocus = () => {
  26966. if (hidePage.value) {
  26967. return;
  26968. }
  26969. focusType.value = false;
  26970. vue.nextTick(() => {
  26971. focusType.value = true;
  26972. });
  26973. };
  26974. const close = () => {
  26975. printerDialog.value.close();
  26976. st2 = setTimeout(() => {
  26977. reset();
  26978. st2 && clearTimeout(st2);
  26979. }, 700);
  26980. };
  26981. const sendToPeinterFun = (res) => {
  26982. if (res.detail.value.length === 0) {
  26983. selectPrinter.value = 0;
  26984. } else {
  26985. selectPrinter.value = printers.value[0].value;
  26986. }
  26987. };
  26988. const printConfirm = () => {
  26989. subLoading.value = true;
  26990. const url = selectType.value === 1 ? printWaybillLabelURL : printCustomerLabelURL;
  26991. let data = {
  26992. order_no: valiFormData.value.order_code,
  26993. printer_code: selectPrinter.value
  26994. };
  26995. let type = "尾程面单打印";
  26996. if (selectType.value === 2) {
  26997. data.style = "detail";
  26998. type = "打印客户联(详细)";
  26999. }
  27000. if (selectType.value === 3) {
  27001. data.style = "simple";
  27002. type = "打印客户联(简单)";
  27003. }
  27004. uni.request({
  27005. url,
  27006. method: "POST",
  27007. header: {
  27008. batoken: token.value
  27009. },
  27010. data,
  27011. success: (res) => {
  27012. subLoading.value = false;
  27013. formatAppLog("log", "at pages/printer/index.vue:233", "打印成功", res);
  27014. messageType.value = res.data.code ? "success" : "error";
  27015. messageText.value = res.data.msg;
  27016. messageRef.value.open();
  27017. const historyItem = {
  27018. order_code: valiFormData.value.order_code,
  27019. createTime: /* @__PURE__ */ new Date(),
  27020. type,
  27021. status: res.data.code
  27022. };
  27023. printLogHistory.value.unshift(historyItem);
  27024. uni.setStorageSync("printLogHistory", printLogHistory.value);
  27025. getHistory();
  27026. close();
  27027. },
  27028. fail: (err) => {
  27029. subLoading.value = false;
  27030. formatAppLog("log", "at pages/printer/index.vue:251", "打印失败", err);
  27031. messageType.value = "error";
  27032. messageText.value = "打印失败";
  27033. messageRef.value.open();
  27034. const historyItem = {
  27035. order_code: valiFormData.value.order_code,
  27036. createTime: /* @__PURE__ */ new Date(),
  27037. type,
  27038. status: false
  27039. };
  27040. printLogHistory.value.unshift(historyItem);
  27041. uni.setStorageSync("printLogHistory", printLogHistory.value);
  27042. getHistory();
  27043. close();
  27044. }
  27045. });
  27046. };
  27047. const getPrinterList = () => {
  27048. uni.request({
  27049. url: getPrinterListURL,
  27050. method: "GET",
  27051. header: {
  27052. batoken: token.value
  27053. },
  27054. success: (res) => {
  27055. if (res.data.code === 1) {
  27056. printerList.value = res.data.data.printers;
  27057. printers.value = Object.values(printerList.value).map((item) => {
  27058. return {
  27059. text: item.name,
  27060. value: item.value
  27061. };
  27062. });
  27063. }
  27064. },
  27065. fail(e2) {
  27066. formatAppLog("log", "at pages/printer/index.vue:288", "fail--", e2);
  27067. }
  27068. });
  27069. };
  27070. const onsubmit = () => {
  27071. if (valiFormData.value.order_code) {
  27072. loading.value = true;
  27073. st2 && clearTimeout(st2);
  27074. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  27075. printerDialog.value.open();
  27076. loading.value = false;
  27077. } else {
  27078. messageType.value = "error";
  27079. messageText.value = "请填写运单号";
  27080. messageRef.value.open();
  27081. }
  27082. };
  27083. const getHistory = () => {
  27084. printLogHistory.value = uni.getStorageSync("printLogHistory") || [];
  27085. };
  27086. const keypress = (e2) => {
  27087. formatAppLog("log", "at pages/printer/index.vue:311", e2, "按键码");
  27088. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  27089. ;
  27090. if (e2.keyCode == 66) {
  27091. onsubmit();
  27092. }
  27093. };
  27094. onLoad(() => {
  27095. plus.key.addEventListener("keyup", keypress);
  27096. });
  27097. onUnload(() => {
  27098. plus.key.removeEventListener("keyup", keypress);
  27099. });
  27100. onHide(() => {
  27101. hidePage.value = true;
  27102. plus.key.removeEventListener("keyup", keypress);
  27103. });
  27104. onBackPress(() => {
  27105. plus.key.removeEventListener("keyup", keypress);
  27106. });
  27107. onShow(() => {
  27108. token.value = uni.getStorageSync("token");
  27109. hidePage.value = false;
  27110. getHistory();
  27111. getPrinterList();
  27112. });
  27113. onNavigationBarButtonTap((event) => {
  27114. if (event.index === 0) {
  27115. uni.navigateTo({
  27116. url: "/pages/warehouseScan/warehouseLog"
  27117. });
  27118. }
  27119. });
  27120. const __returned__ = { token, loading, hidePage, focusType, selectType, printType, printerDialog, subLoading, printerList, printers, downloadFile, sendToPeinter, selectPrinter, printLogHistory, messageRef, messageType, messageText, get st() {
  27121. return st2;
  27122. }, set st(v2) {
  27123. st2 = v2;
  27124. }, valiFormData, rules, checkPermission, scanInput, reset, setfocus, close, sendToPeinterFun, printConfirm, getPrinterList, onsubmit, getHistory, keypress };
  27125. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  27126. return __returned__;
  27127. }
  27128. });
  27129. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  27130. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$4);
  27131. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  27132. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  27133. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  27134. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  27135. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  27136. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  27137. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  27138. vue.createElementVNode("view", { class: "checkbox" }, [
  27139. vue.createVNode(_component_uni_data_checkbox, {
  27140. modelValue: $setup.selectType,
  27141. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.selectType = $event),
  27142. localdata: $setup.printType
  27143. }, null, 8, ["modelValue", "localdata"])
  27144. ]),
  27145. vue.createVNode(_component_uni_forms, {
  27146. ref: "valiForm",
  27147. "label-align": "right",
  27148. "label-width": 80,
  27149. rules: $setup.rules,
  27150. modelValue: $setup.valiFormData
  27151. }, {
  27152. default: vue.withCtx(() => [
  27153. vue.createVNode(_component_uni_forms_item, {
  27154. label: "单据编号",
  27155. required: "",
  27156. name: "order_code"
  27157. }, {
  27158. default: vue.withCtx(() => [
  27159. vue.createVNode(_component_uni_easyinput, {
  27160. modelValue: $setup.valiFormData.order_code,
  27161. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.order_code = $event),
  27162. placeholder: "请输入单据编号",
  27163. suffixIcon: "scan",
  27164. focus: $setup.focusType,
  27165. onIconClick: $setup.scanInput,
  27166. onBlur: $setup.setfocus,
  27167. onConfirm: $setup.onsubmit
  27168. }, null, 8, ["modelValue", "focus"])
  27169. ]),
  27170. _: 1
  27171. /* STABLE */
  27172. })
  27173. ]),
  27174. _: 1
  27175. /* STABLE */
  27176. }, 8, ["rules", "modelValue"]),
  27177. vue.createElementVNode("view", { class: "button-group" }, [
  27178. vue.createElementVNode("button", {
  27179. type: "info",
  27180. onClick: $setup.reset
  27181. }, "重置"),
  27182. vue.createElementVNode("button", {
  27183. type: "primary",
  27184. onClick: $setup.onsubmit,
  27185. loading: $setup.loading
  27186. }, [
  27187. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  27188. key: 0,
  27189. type: "checkmarkempty",
  27190. size: "18",
  27191. color: "white"
  27192. })) : vue.createCommentVNode("v-if", true),
  27193. vue.createTextVNode(" 打印 ")
  27194. ], 8, ["loading"])
  27195. ]),
  27196. $setup.printLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  27197. key: 0,
  27198. class: "history"
  27199. }, [
  27200. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  27201. ])) : vue.createCommentVNode("v-if", true),
  27202. vue.createElementVNode("view", { class: "history" }, [
  27203. (vue.openBlock(true), vue.createElementBlock(
  27204. vue.Fragment,
  27205. null,
  27206. vue.renderList($setup.printLogHistory.slice(0, 5), (item, i2) => {
  27207. return vue.openBlock(), vue.createElementBlock("view", {
  27208. class: "item",
  27209. key: i2
  27210. }, [
  27211. vue.createElementVNode(
  27212. "text",
  27213. {
  27214. class: "code",
  27215. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  27216. },
  27217. vue.toDisplayString(item.type) + " " + vue.toDisplayString(item.order_code),
  27218. 5
  27219. /* TEXT, STYLE */
  27220. ),
  27221. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  27222. key: 0,
  27223. type: "checkmarkempty",
  27224. class: "status",
  27225. size: "16",
  27226. color: "green"
  27227. })) : (vue.openBlock(), vue.createElementBlock("text", {
  27228. key: 1,
  27229. class: "status fail"
  27230. }, "F")),
  27231. vue.createElementVNode(
  27232. "text",
  27233. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  27234. vue.toDisplayString("\r\n" + item.createTime),
  27235. 1
  27236. /* TEXT */
  27237. )
  27238. ]);
  27239. }),
  27240. 128
  27241. /* KEYED_FRAGMENT */
  27242. ))
  27243. ]),
  27244. vue.createVNode(
  27245. _component_uni_popup,
  27246. {
  27247. ref: "messageRef",
  27248. type: "message"
  27249. },
  27250. {
  27251. default: vue.withCtx(() => [
  27252. vue.createVNode(_component_uni_popup_message, {
  27253. type: $setup.messageType,
  27254. message: $setup.messageText,
  27255. duration: 2e3
  27256. }, null, 8, ["type", "message"])
  27257. ]),
  27258. _: 1
  27259. /* STABLE */
  27260. },
  27261. 512
  27262. /* NEED_PATCH */
  27263. ),
  27264. vue.createVNode(
  27265. _component_uni_popup,
  27266. {
  27267. ref: "printerDialog",
  27268. type: "dialog",
  27269. "is-mask-click": false
  27270. },
  27271. {
  27272. default: vue.withCtx(() => [
  27273. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  27274. vue.createElementVNode("view", {
  27275. class: "",
  27276. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  27277. }, [
  27278. vue.createElementVNode("view", null, [
  27279. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  27280. vue.createElementVNode("text", null, "打印尾程面单")
  27281. ]),
  27282. vue.createElementVNode("view", null, [
  27283. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  27284. vue.createElementVNode("view", null, [
  27285. vue.createVNode(_component_uni_data_checkbox, {
  27286. multiple: "",
  27287. modelValue: $setup.sendToPeinter,
  27288. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  27289. localdata: [
  27290. {
  27291. text: "发送到标签打印机打印",
  27292. value: 1
  27293. }
  27294. ],
  27295. onChange: $setup.sendToPeinterFun
  27296. }, {
  27297. default: vue.withCtx(() => [
  27298. vue.createTextVNode(" > ")
  27299. ]),
  27300. _: 1
  27301. /* STABLE */
  27302. }, 8, ["modelValue"]),
  27303. vue.createVNode(_component_uni_data_checkbox, {
  27304. disabled: $setup.sendToPeinter.length === 0,
  27305. modelValue: $setup.selectPrinter,
  27306. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  27307. localdata: $setup.printers
  27308. }, null, 8, ["disabled", "modelValue", "localdata"])
  27309. ])
  27310. ])) : vue.createCommentVNode("v-if", true)
  27311. ])
  27312. ]),
  27313. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  27314. vue.createElementVNode("button", {
  27315. onClick: $setup.close,
  27316. style: { "width": "35%" }
  27317. }, "关闭"),
  27318. vue.createElementVNode("button", {
  27319. onClick: $setup.printConfirm,
  27320. "hover-stay-time": 500,
  27321. loading: $setup.subLoading,
  27322. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  27323. class: "my-bt-bg",
  27324. style: { "width": "35%" }
  27325. }, " 打印 ", 8, ["loading", "disabled"])
  27326. ])
  27327. ])
  27328. ])
  27329. ]),
  27330. _: 1
  27331. /* STABLE */
  27332. },
  27333. 512
  27334. /* NEED_PATCH */
  27335. )
  27336. ]);
  27337. }
  27338. const PagesPrinterIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-b2c0c306"], ["__file", "E:/HBuilderProjects/YTAPP/pages/printer/index.vue"]]);
  27339. __definePage("pages/home/index", PagesHomeIndex);
  27340. __definePage("pages/instock/index", PagesInstockIndex);
  27341. __definePage("pages/instock/instockLog", PagesInstockInstockLog);
  27342. __definePage("pages/profile/index", PagesProfileIndex);
  27343. __definePage("pages/login/index", PagesLoginIndex);
  27344. __definePage("pages/order/index", PagesOrderIndex);
  27345. __definePage("pages/scanLotno/index", PagesScanLotnoIndex);
  27346. __definePage("pages/scanLotno/lotnoLog", PagesScanLotnoLotnoLog);
  27347. __definePage("pages/scanLotno/waybillsList", PagesScanLotnoWaybillsList);
  27348. __definePage("pages/warehouseScan/index", PagesWarehouseScanIndex);
  27349. __definePage("pages/warehouseScan/warehouseLog", PagesWarehouseScanWarehouseLog);
  27350. __definePage("pages/waybillNo/index", PagesWaybillNoIndex);
  27351. __definePage("pages/waybillNo/waybillNoLog", PagesWaybillNoWaybillNoLog);
  27352. __definePage("pages/waybillDeliveryOrder/index", PagesWaybillDeliveryOrderIndex);
  27353. __definePage("pages/waybillDeliveryOrder/orderInfo", PagesWaybillDeliveryOrderOrderInfo);
  27354. __definePage("pages/printer/index", PagesPrinterIndex);
  27355. const _sfc_main = {
  27356. onLaunch: function() {
  27357. formatAppLog("log", "at App.vue:4", "App Launch");
  27358. },
  27359. onShow: function() {
  27360. formatAppLog("log", "at App.vue:7", "App Show");
  27361. },
  27362. onHide: function() {
  27363. formatAppLog("log", "at App.vue:10", "App Hide");
  27364. }
  27365. };
  27366. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/HBuilderProjects/YTAPP/App.vue"]]);
  27367. function createApp() {
  27368. const app = vue.createVueApp(App);
  27369. return {
  27370. app
  27371. };
  27372. }
  27373. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  27374. uni.Vuex = __Vuex__;
  27375. uni.Pinia = __Pinia__;
  27376. __app__.provide("__globalStyles", __uniConfig.styles);
  27377. __app__._component.mpType = "app";
  27378. __app__._component.render = () => {
  27379. };
  27380. __app__.mount("#app");
  27381. })(Vue);