vendor.js 339 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156
  1. "use strict";
  2. /**
  3. * @vue/shared v3.4.21
  4. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  5. * @license MIT
  6. **/
  7. function makeMap(str, expectsLowerCase) {
  8. const set2 = new Set(str.split(","));
  9. return expectsLowerCase ? (val) => set2.has(val.toLowerCase()) : (val) => set2.has(val);
  10. }
  11. const EMPTY_OBJ = Object.freeze({});
  12. const EMPTY_ARR = Object.freeze([]);
  13. const NOOP = () => {
  14. };
  15. const NO = () => false;
  16. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  17. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  18. const isModelListener = (key) => key.startsWith("onUpdate:");
  19. const extend = Object.assign;
  20. const remove = (arr, el) => {
  21. const i = arr.indexOf(el);
  22. if (i > -1) {
  23. arr.splice(i, 1);
  24. }
  25. };
  26. const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  27. const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key);
  28. const isArray = Array.isArray;
  29. const isMap = (val) => toTypeString(val) === "[object Map]";
  30. const isSet = (val) => toTypeString(val) === "[object Set]";
  31. const isFunction = (val) => typeof val === "function";
  32. const isString = (val) => typeof val === "string";
  33. const isSymbol = (val) => typeof val === "symbol";
  34. const isObject$2 = (val) => val !== null && typeof val === "object";
  35. const isPromise$1 = (val) => {
  36. return (isObject$2(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  37. };
  38. const objectToString = Object.prototype.toString;
  39. const toTypeString = (value) => objectToString.call(value);
  40. const toRawType = (value) => {
  41. return toTypeString(value).slice(8, -1);
  42. };
  43. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  44. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  45. const isReservedProp = /* @__PURE__ */ makeMap(
  46. // the leading comma is intentional so empty string "" is also included
  47. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  48. );
  49. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  50. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  51. );
  52. const cacheStringFunction = (fn) => {
  53. const cache = /* @__PURE__ */ Object.create(null);
  54. return (str) => {
  55. const hit = cache[str];
  56. return hit || (cache[str] = fn(str));
  57. };
  58. };
  59. const camelizeRE = /-(\w)/g;
  60. const camelize = cacheStringFunction((str) => {
  61. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  62. });
  63. const hyphenateRE = /\B([A-Z])/g;
  64. const hyphenate = cacheStringFunction(
  65. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  66. );
  67. const capitalize = cacheStringFunction((str) => {
  68. return str.charAt(0).toUpperCase() + str.slice(1);
  69. });
  70. const toHandlerKey = cacheStringFunction((str) => {
  71. const s2 = str ? `on${capitalize(str)}` : ``;
  72. return s2;
  73. });
  74. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  75. const invokeArrayFns$1 = (fns, arg) => {
  76. for (let i = 0; i < fns.length; i++) {
  77. fns[i](arg);
  78. }
  79. };
  80. const def = (obj, key, value) => {
  81. Object.defineProperty(obj, key, {
  82. configurable: true,
  83. enumerable: false,
  84. value
  85. });
  86. };
  87. const looseToNumber = (val) => {
  88. const n2 = parseFloat(val);
  89. return isNaN(n2) ? val : n2;
  90. };
  91. function normalizeStyle(value) {
  92. if (isArray(value)) {
  93. const res2 = {};
  94. for (let i = 0; i < value.length; i++) {
  95. const item = value[i];
  96. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  97. if (normalized) {
  98. for (const key in normalized) {
  99. res2[key] = normalized[key];
  100. }
  101. }
  102. }
  103. return res2;
  104. } else if (isString(value) || isObject$2(value)) {
  105. return value;
  106. }
  107. }
  108. const listDelimiterRE = /;(?![^(]*\))/g;
  109. const propertyDelimiterRE = /:([^]+)/;
  110. const styleCommentRE = /\/\*[^]*?\*\//g;
  111. function parseStringStyle(cssText) {
  112. const ret = {};
  113. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  114. if (item) {
  115. const tmp = item.split(propertyDelimiterRE);
  116. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  117. }
  118. });
  119. return ret;
  120. }
  121. function normalizeClass(value) {
  122. let res2 = "";
  123. if (isString(value)) {
  124. res2 = value;
  125. } else if (isArray(value)) {
  126. for (let i = 0; i < value.length; i++) {
  127. const normalized = normalizeClass(value[i]);
  128. if (normalized) {
  129. res2 += normalized + " ";
  130. }
  131. }
  132. } else if (isObject$2(value)) {
  133. for (const name in value) {
  134. if (value[name]) {
  135. res2 += name + " ";
  136. }
  137. }
  138. }
  139. return res2.trim();
  140. }
  141. const toDisplayString = (val) => {
  142. return isString(val) ? val : val == null ? "" : isArray(val) || isObject$2(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  143. };
  144. const replacer = (_key, val) => {
  145. if (val && val.__v_isRef) {
  146. return replacer(_key, val.value);
  147. } else if (isMap(val)) {
  148. return {
  149. [`Map(${val.size})`]: [...val.entries()].reduce(
  150. (entries, [key, val2], i) => {
  151. entries[stringifySymbol(key, i) + " =>"] = val2;
  152. return entries;
  153. },
  154. {}
  155. )
  156. };
  157. } else if (isSet(val)) {
  158. return {
  159. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  160. };
  161. } else if (isSymbol(val)) {
  162. return stringifySymbol(val);
  163. } else if (isObject$2(val) && !isArray(val) && !isPlainObject(val)) {
  164. return String(val);
  165. }
  166. return val;
  167. };
  168. const stringifySymbol = (v, i = "") => {
  169. var _a;
  170. return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
  171. };
  172. const isObject$1 = (val) => val !== null && typeof val === "object";
  173. const defaultDelimiters = ["{", "}"];
  174. class BaseFormatter {
  175. constructor() {
  176. this._caches = /* @__PURE__ */ Object.create(null);
  177. }
  178. interpolate(message, values, delimiters = defaultDelimiters) {
  179. if (!values) {
  180. return [message];
  181. }
  182. let tokens = this._caches[message];
  183. if (!tokens) {
  184. tokens = parse(message, delimiters);
  185. this._caches[message] = tokens;
  186. }
  187. return compile$1(tokens, values);
  188. }
  189. }
  190. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  191. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  192. function parse(format, [startDelimiter, endDelimiter]) {
  193. const tokens = [];
  194. let position = 0;
  195. let text = "";
  196. while (position < format.length) {
  197. let char = format[position++];
  198. if (char === startDelimiter) {
  199. if (text) {
  200. tokens.push({ type: "text", value: text });
  201. }
  202. text = "";
  203. let sub = "";
  204. char = format[position++];
  205. while (char !== void 0 && char !== endDelimiter) {
  206. sub += char;
  207. char = format[position++];
  208. }
  209. const isClosed = char === endDelimiter;
  210. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  211. tokens.push({ value: sub, type });
  212. } else {
  213. text += char;
  214. }
  215. }
  216. text && tokens.push({ type: "text", value: text });
  217. return tokens;
  218. }
  219. function compile$1(tokens, values) {
  220. const compiled = [];
  221. let index2 = 0;
  222. const mode = Array.isArray(values) ? "list" : isObject$1(values) ? "named" : "unknown";
  223. if (mode === "unknown") {
  224. return compiled;
  225. }
  226. while (index2 < tokens.length) {
  227. const token = tokens[index2];
  228. switch (token.type) {
  229. case "text":
  230. compiled.push(token.value);
  231. break;
  232. case "list":
  233. compiled.push(values[parseInt(token.value, 10)]);
  234. break;
  235. case "named":
  236. if (mode === "named") {
  237. compiled.push(values[token.value]);
  238. } else {
  239. {
  240. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  241. }
  242. }
  243. break;
  244. case "unknown":
  245. {
  246. console.warn(`Detect 'unknown' type of token!`);
  247. }
  248. break;
  249. }
  250. index2++;
  251. }
  252. return compiled;
  253. }
  254. const LOCALE_ZH_HANS = "zh-Hans";
  255. const LOCALE_ZH_HANT = "zh-Hant";
  256. const LOCALE_EN = "en";
  257. const LOCALE_FR = "fr";
  258. const LOCALE_ES = "es";
  259. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  260. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  261. const defaultFormatter = new BaseFormatter();
  262. function include(str, parts) {
  263. return !!parts.find((part) => str.indexOf(part) !== -1);
  264. }
  265. function startsWith(str, parts) {
  266. return parts.find((part) => str.indexOf(part) === 0);
  267. }
  268. function normalizeLocale(locale, messages) {
  269. if (!locale) {
  270. return;
  271. }
  272. locale = locale.trim().replace(/_/g, "-");
  273. if (messages && messages[locale]) {
  274. return locale;
  275. }
  276. locale = locale.toLowerCase();
  277. if (locale === "chinese") {
  278. return LOCALE_ZH_HANS;
  279. }
  280. if (locale.indexOf("zh") === 0) {
  281. if (locale.indexOf("-hans") > -1) {
  282. return LOCALE_ZH_HANS;
  283. }
  284. if (locale.indexOf("-hant") > -1) {
  285. return LOCALE_ZH_HANT;
  286. }
  287. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  288. return LOCALE_ZH_HANT;
  289. }
  290. return LOCALE_ZH_HANS;
  291. }
  292. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  293. if (messages && Object.keys(messages).length > 0) {
  294. locales = Object.keys(messages);
  295. }
  296. const lang = startsWith(locale, locales);
  297. if (lang) {
  298. return lang;
  299. }
  300. }
  301. class I18n {
  302. constructor({ locale, fallbackLocale, messages, watcher, formater: formater2 }) {
  303. this.locale = LOCALE_EN;
  304. this.fallbackLocale = LOCALE_EN;
  305. this.message = {};
  306. this.messages = {};
  307. this.watchers = [];
  308. if (fallbackLocale) {
  309. this.fallbackLocale = fallbackLocale;
  310. }
  311. this.formater = formater2 || defaultFormatter;
  312. this.messages = messages || {};
  313. this.setLocale(locale || LOCALE_EN);
  314. if (watcher) {
  315. this.watchLocale(watcher);
  316. }
  317. }
  318. setLocale(locale) {
  319. const oldLocale = this.locale;
  320. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  321. if (!this.messages[this.locale]) {
  322. this.messages[this.locale] = {};
  323. }
  324. this.message = this.messages[this.locale];
  325. if (oldLocale !== this.locale) {
  326. this.watchers.forEach((watcher) => {
  327. watcher(this.locale, oldLocale);
  328. });
  329. }
  330. }
  331. getLocale() {
  332. return this.locale;
  333. }
  334. watchLocale(fn) {
  335. const index2 = this.watchers.push(fn) - 1;
  336. return () => {
  337. this.watchers.splice(index2, 1);
  338. };
  339. }
  340. add(locale, message, override = true) {
  341. const curMessages = this.messages[locale];
  342. if (curMessages) {
  343. if (override) {
  344. Object.assign(curMessages, message);
  345. } else {
  346. Object.keys(message).forEach((key) => {
  347. if (!hasOwn(curMessages, key)) {
  348. curMessages[key] = message[key];
  349. }
  350. });
  351. }
  352. } else {
  353. this.messages[locale] = message;
  354. }
  355. }
  356. f(message, values, delimiters) {
  357. return this.formater.interpolate(message, values, delimiters).join("");
  358. }
  359. t(key, locale, values) {
  360. let message = this.message;
  361. if (typeof locale === "string") {
  362. locale = normalizeLocale(locale, this.messages);
  363. locale && (message = this.messages[locale]);
  364. } else {
  365. values = locale;
  366. }
  367. if (!hasOwn(message, key)) {
  368. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  369. return key;
  370. }
  371. return this.formater.interpolate(message[key], values).join("");
  372. }
  373. }
  374. function watchAppLocale(appVm, i18n) {
  375. if (appVm.$watchLocale) {
  376. appVm.$watchLocale((newLocale) => {
  377. i18n.setLocale(newLocale);
  378. });
  379. } else {
  380. appVm.$watch(() => appVm.$locale, (newLocale) => {
  381. i18n.setLocale(newLocale);
  382. });
  383. }
  384. }
  385. function getDefaultLocale() {
  386. if (typeof index !== "undefined" && index.getLocale) {
  387. return index.getLocale();
  388. }
  389. if (typeof global !== "undefined" && global.getLocale) {
  390. return global.getLocale();
  391. }
  392. return LOCALE_EN;
  393. }
  394. function initVueI18n(locale, messages = {}, fallbackLocale, watcher) {
  395. if (typeof locale !== "string") {
  396. const options = [
  397. messages,
  398. locale
  399. ];
  400. locale = options[0];
  401. messages = options[1];
  402. }
  403. if (typeof locale !== "string") {
  404. locale = getDefaultLocale();
  405. }
  406. if (typeof fallbackLocale !== "string") {
  407. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  408. }
  409. const i18n = new I18n({
  410. locale,
  411. fallbackLocale,
  412. messages,
  413. watcher
  414. });
  415. let t2 = (key, values) => {
  416. if (typeof getApp !== "function") {
  417. t2 = function(key2, values2) {
  418. return i18n.t(key2, values2);
  419. };
  420. } else {
  421. let isWatchedAppLocale = false;
  422. t2 = function(key2, values2) {
  423. const appVm = getApp().$vm;
  424. if (appVm) {
  425. appVm.$locale;
  426. if (!isWatchedAppLocale) {
  427. isWatchedAppLocale = true;
  428. watchAppLocale(appVm, i18n);
  429. }
  430. }
  431. return i18n.t(key2, values2);
  432. };
  433. }
  434. return t2(key, values);
  435. };
  436. return {
  437. i18n,
  438. f(message, values, delimiters) {
  439. return i18n.f(message, values, delimiters);
  440. },
  441. t(key, values) {
  442. return t2(key, values);
  443. },
  444. add(locale2, message, override = true) {
  445. return i18n.add(locale2, message, override);
  446. },
  447. watch(fn) {
  448. return i18n.watchLocale(fn);
  449. },
  450. getLocale() {
  451. return i18n.getLocale();
  452. },
  453. setLocale(newLocale) {
  454. return i18n.setLocale(newLocale);
  455. }
  456. };
  457. }
  458. const SLOT_DEFAULT_NAME = "d";
  459. const ON_SHOW = "onShow";
  460. const ON_HIDE = "onHide";
  461. const ON_LAUNCH = "onLaunch";
  462. const ON_ERROR = "onError";
  463. const ON_THEME_CHANGE = "onThemeChange";
  464. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  465. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  466. const ON_EXIT = "onExit";
  467. const ON_LOAD = "onLoad";
  468. const ON_READY = "onReady";
  469. const ON_UNLOAD = "onUnload";
  470. const ON_INIT = "onInit";
  471. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  472. const ON_RESIZE = "onResize";
  473. const ON_BACK_PRESS = "onBackPress";
  474. const ON_PAGE_SCROLL = "onPageScroll";
  475. const ON_TAB_ITEM_TAP = "onTabItemTap";
  476. const ON_REACH_BOTTOM = "onReachBottom";
  477. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  478. const ON_SHARE_TIMELINE = "onShareTimeline";
  479. const ON_SHARE_CHAT = "onShareChat";
  480. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  481. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  482. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  483. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  484. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  485. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  486. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  487. const VIRTUAL_HOST_STYLE = "virtualHostStyle";
  488. const VIRTUAL_HOST_CLASS = "virtualHostClass";
  489. const VIRTUAL_HOST_HIDDEN = "virtualHostHidden";
  490. const VIRTUAL_HOST_ID = "virtualHostId";
  491. function hasLeadingSlash(str) {
  492. return str.indexOf("/") === 0;
  493. }
  494. function addLeadingSlash(str) {
  495. return hasLeadingSlash(str) ? str : "/" + str;
  496. }
  497. const invokeArrayFns = (fns, arg) => {
  498. let ret;
  499. for (let i = 0; i < fns.length; i++) {
  500. ret = fns[i](arg);
  501. }
  502. return ret;
  503. };
  504. function once(fn, ctx = null) {
  505. let res2;
  506. return (...args) => {
  507. if (fn) {
  508. res2 = fn.apply(ctx, args);
  509. fn = null;
  510. }
  511. return res2;
  512. };
  513. }
  514. function getValueByDataPath(obj, path) {
  515. if (!isString(path)) {
  516. return;
  517. }
  518. path = path.replace(/\[(\d+)\]/g, ".$1");
  519. const parts = path.split(".");
  520. let key = parts[0];
  521. if (!obj) {
  522. obj = {};
  523. }
  524. if (parts.length === 1) {
  525. return obj[key];
  526. }
  527. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  528. }
  529. function sortObject(obj) {
  530. let sortObj = {};
  531. if (isPlainObject(obj)) {
  532. Object.keys(obj).sort().forEach((key) => {
  533. const _key = key;
  534. sortObj[_key] = obj[_key];
  535. });
  536. }
  537. return !Object.keys(sortObj) ? obj : sortObj;
  538. }
  539. const customizeRE = /:/g;
  540. function customizeEvent(str) {
  541. return camelize(str.replace(customizeRE, "-"));
  542. }
  543. const encode = encodeURIComponent;
  544. function stringifyQuery(obj, encodeStr = encode) {
  545. const res2 = obj ? Object.keys(obj).map((key) => {
  546. let val = obj[key];
  547. if (typeof val === void 0 || val === null) {
  548. val = "";
  549. } else if (isPlainObject(val)) {
  550. val = JSON.stringify(val);
  551. }
  552. return encodeStr(key) + "=" + encodeStr(val);
  553. }).filter((x) => x.length > 0).join("&") : null;
  554. return res2 ? `?${res2}` : "";
  555. }
  556. const PAGE_HOOKS = [
  557. ON_INIT,
  558. ON_LOAD,
  559. ON_SHOW,
  560. ON_HIDE,
  561. ON_UNLOAD,
  562. ON_BACK_PRESS,
  563. ON_PAGE_SCROLL,
  564. ON_TAB_ITEM_TAP,
  565. ON_REACH_BOTTOM,
  566. ON_PULL_DOWN_REFRESH,
  567. ON_SHARE_TIMELINE,
  568. ON_SHARE_APP_MESSAGE,
  569. ON_SHARE_CHAT,
  570. ON_ADD_TO_FAVORITES,
  571. ON_SAVE_EXIT_STATE,
  572. ON_NAVIGATION_BAR_BUTTON_TAP,
  573. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  574. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  575. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  576. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  577. ];
  578. function isRootHook(name) {
  579. return PAGE_HOOKS.indexOf(name) > -1;
  580. }
  581. const UniLifecycleHooks = [
  582. ON_SHOW,
  583. ON_HIDE,
  584. ON_LAUNCH,
  585. ON_ERROR,
  586. ON_THEME_CHANGE,
  587. ON_PAGE_NOT_FOUND,
  588. ON_UNHANDLE_REJECTION,
  589. ON_EXIT,
  590. ON_INIT,
  591. ON_LOAD,
  592. ON_READY,
  593. ON_UNLOAD,
  594. ON_RESIZE,
  595. ON_BACK_PRESS,
  596. ON_PAGE_SCROLL,
  597. ON_TAB_ITEM_TAP,
  598. ON_REACH_BOTTOM,
  599. ON_PULL_DOWN_REFRESH,
  600. ON_SHARE_TIMELINE,
  601. ON_ADD_TO_FAVORITES,
  602. ON_SHARE_APP_MESSAGE,
  603. ON_SHARE_CHAT,
  604. ON_SAVE_EXIT_STATE,
  605. ON_NAVIGATION_BAR_BUTTON_TAP,
  606. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  607. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  608. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  609. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  610. ];
  611. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  612. return {
  613. onPageScroll: 1,
  614. onShareAppMessage: 1 << 1,
  615. onShareTimeline: 1 << 2
  616. };
  617. })();
  618. function isUniLifecycleHook(name, value, checkType = true) {
  619. if (checkType && !isFunction(value)) {
  620. return false;
  621. }
  622. if (UniLifecycleHooks.indexOf(name) > -1) {
  623. return true;
  624. } else if (name.indexOf("on") === 0) {
  625. return true;
  626. }
  627. return false;
  628. }
  629. let vueApp;
  630. const createVueAppHooks = [];
  631. function onCreateVueApp(hook) {
  632. if (vueApp) {
  633. return hook(vueApp);
  634. }
  635. createVueAppHooks.push(hook);
  636. }
  637. function invokeCreateVueAppHook(app) {
  638. vueApp = app;
  639. createVueAppHooks.forEach((hook) => hook(app));
  640. }
  641. const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  642. return createErrorHandler2(app);
  643. });
  644. const E = function() {
  645. };
  646. E.prototype = {
  647. _id: 1,
  648. on: function(name, callback, ctx) {
  649. var e2 = this.e || (this.e = {});
  650. (e2[name] || (e2[name] = [])).push({
  651. fn: callback,
  652. ctx,
  653. _id: this._id
  654. });
  655. return this._id++;
  656. },
  657. once: function(name, callback, ctx) {
  658. var self2 = this;
  659. function listener() {
  660. self2.off(name, listener);
  661. callback.apply(ctx, arguments);
  662. }
  663. listener._ = callback;
  664. return this.on(name, listener, ctx);
  665. },
  666. emit: function(name) {
  667. var data = [].slice.call(arguments, 1);
  668. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  669. var i = 0;
  670. var len = evtArr.length;
  671. for (i; i < len; i++) {
  672. evtArr[i].fn.apply(evtArr[i].ctx, data);
  673. }
  674. return this;
  675. },
  676. off: function(name, event) {
  677. var e2 = this.e || (this.e = {});
  678. var evts = e2[name];
  679. var liveEvents = [];
  680. if (evts && event) {
  681. for (var i = evts.length - 1; i >= 0; i--) {
  682. if (evts[i].fn === event || evts[i].fn._ === event || evts[i]._id === event) {
  683. evts.splice(i, 1);
  684. break;
  685. }
  686. }
  687. liveEvents = evts;
  688. }
  689. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  690. return this;
  691. }
  692. };
  693. var E$1 = E;
  694. /**
  695. * @dcloudio/uni-mp-vue v3.4.21
  696. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  697. * @license MIT
  698. **/
  699. function warn$2(msg, ...args) {
  700. console.warn(`[Vue warn] ${msg}`, ...args);
  701. }
  702. let activeEffectScope;
  703. class EffectScope {
  704. constructor(detached = false) {
  705. this.detached = detached;
  706. this._active = true;
  707. this.effects = [];
  708. this.cleanups = [];
  709. this.parent = activeEffectScope;
  710. if (!detached && activeEffectScope) {
  711. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  712. this
  713. ) - 1;
  714. }
  715. }
  716. get active() {
  717. return this._active;
  718. }
  719. run(fn) {
  720. if (this._active) {
  721. const currentEffectScope = activeEffectScope;
  722. try {
  723. activeEffectScope = this;
  724. return fn();
  725. } finally {
  726. activeEffectScope = currentEffectScope;
  727. }
  728. } else {
  729. warn$2(`cannot run an inactive effect scope.`);
  730. }
  731. }
  732. /**
  733. * This should only be called on non-detached scopes
  734. * @internal
  735. */
  736. on() {
  737. activeEffectScope = this;
  738. }
  739. /**
  740. * This should only be called on non-detached scopes
  741. * @internal
  742. */
  743. off() {
  744. activeEffectScope = this.parent;
  745. }
  746. stop(fromParent) {
  747. if (this._active) {
  748. let i, l;
  749. for (i = 0, l = this.effects.length; i < l; i++) {
  750. this.effects[i].stop();
  751. }
  752. for (i = 0, l = this.cleanups.length; i < l; i++) {
  753. this.cleanups[i]();
  754. }
  755. if (this.scopes) {
  756. for (i = 0, l = this.scopes.length; i < l; i++) {
  757. this.scopes[i].stop(true);
  758. }
  759. }
  760. if (!this.detached && this.parent && !fromParent) {
  761. const last = this.parent.scopes.pop();
  762. if (last && last !== this) {
  763. this.parent.scopes[this.index] = last;
  764. last.index = this.index;
  765. }
  766. }
  767. this.parent = void 0;
  768. this._active = false;
  769. }
  770. }
  771. }
  772. function effectScope(detached) {
  773. return new EffectScope(detached);
  774. }
  775. function recordEffectScope(effect2, scope = activeEffectScope) {
  776. if (scope && scope.active) {
  777. scope.effects.push(effect2);
  778. }
  779. }
  780. function getCurrentScope() {
  781. return activeEffectScope;
  782. }
  783. let activeEffect;
  784. class ReactiveEffect {
  785. constructor(fn, trigger2, scheduler, scope) {
  786. this.fn = fn;
  787. this.trigger = trigger2;
  788. this.scheduler = scheduler;
  789. this.active = true;
  790. this.deps = [];
  791. this._dirtyLevel = 4;
  792. this._trackId = 0;
  793. this._runnings = 0;
  794. this._shouldSchedule = false;
  795. this._depsLength = 0;
  796. recordEffectScope(this, scope);
  797. }
  798. get dirty() {
  799. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  800. this._dirtyLevel = 1;
  801. pauseTracking();
  802. for (let i = 0; i < this._depsLength; i++) {
  803. const dep = this.deps[i];
  804. if (dep.computed) {
  805. triggerComputed(dep.computed);
  806. if (this._dirtyLevel >= 4) {
  807. break;
  808. }
  809. }
  810. }
  811. if (this._dirtyLevel === 1) {
  812. this._dirtyLevel = 0;
  813. }
  814. resetTracking();
  815. }
  816. return this._dirtyLevel >= 4;
  817. }
  818. set dirty(v) {
  819. this._dirtyLevel = v ? 4 : 0;
  820. }
  821. run() {
  822. this._dirtyLevel = 0;
  823. if (!this.active) {
  824. return this.fn();
  825. }
  826. let lastShouldTrack = shouldTrack;
  827. let lastEffect = activeEffect;
  828. try {
  829. shouldTrack = true;
  830. activeEffect = this;
  831. this._runnings++;
  832. preCleanupEffect(this);
  833. return this.fn();
  834. } finally {
  835. postCleanupEffect(this);
  836. this._runnings--;
  837. activeEffect = lastEffect;
  838. shouldTrack = lastShouldTrack;
  839. }
  840. }
  841. stop() {
  842. var _a;
  843. if (this.active) {
  844. preCleanupEffect(this);
  845. postCleanupEffect(this);
  846. (_a = this.onStop) == null ? void 0 : _a.call(this);
  847. this.active = false;
  848. }
  849. }
  850. }
  851. function triggerComputed(computed2) {
  852. return computed2.value;
  853. }
  854. function preCleanupEffect(effect2) {
  855. effect2._trackId++;
  856. effect2._depsLength = 0;
  857. }
  858. function postCleanupEffect(effect2) {
  859. if (effect2.deps.length > effect2._depsLength) {
  860. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  861. cleanupDepEffect(effect2.deps[i], effect2);
  862. }
  863. effect2.deps.length = effect2._depsLength;
  864. }
  865. }
  866. function cleanupDepEffect(dep, effect2) {
  867. const trackId = dep.get(effect2);
  868. if (trackId !== void 0 && effect2._trackId !== trackId) {
  869. dep.delete(effect2);
  870. if (dep.size === 0) {
  871. dep.cleanup();
  872. }
  873. }
  874. }
  875. let shouldTrack = true;
  876. let pauseScheduleStack = 0;
  877. const trackStack = [];
  878. function pauseTracking() {
  879. trackStack.push(shouldTrack);
  880. shouldTrack = false;
  881. }
  882. function resetTracking() {
  883. const last = trackStack.pop();
  884. shouldTrack = last === void 0 ? true : last;
  885. }
  886. function pauseScheduling() {
  887. pauseScheduleStack++;
  888. }
  889. function resetScheduling() {
  890. pauseScheduleStack--;
  891. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  892. queueEffectSchedulers.shift()();
  893. }
  894. }
  895. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  896. var _a;
  897. if (dep.get(effect2) !== effect2._trackId) {
  898. dep.set(effect2, effect2._trackId);
  899. const oldDep = effect2.deps[effect2._depsLength];
  900. if (oldDep !== dep) {
  901. if (oldDep) {
  902. cleanupDepEffect(oldDep, effect2);
  903. }
  904. effect2.deps[effect2._depsLength++] = dep;
  905. } else {
  906. effect2._depsLength++;
  907. }
  908. {
  909. (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  910. }
  911. }
  912. }
  913. const queueEffectSchedulers = [];
  914. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  915. var _a;
  916. pauseScheduling();
  917. for (const effect2 of dep.keys()) {
  918. let tracking;
  919. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  920. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  921. effect2._dirtyLevel = dirtyLevel;
  922. }
  923. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  924. {
  925. (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  926. }
  927. effect2.trigger();
  928. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  929. effect2._shouldSchedule = false;
  930. if (effect2.scheduler) {
  931. queueEffectSchedulers.push(effect2.scheduler);
  932. }
  933. }
  934. }
  935. }
  936. resetScheduling();
  937. }
  938. const createDep = (cleanup, computed2) => {
  939. const dep = /* @__PURE__ */ new Map();
  940. dep.cleanup = cleanup;
  941. dep.computed = computed2;
  942. return dep;
  943. };
  944. const targetMap = /* @__PURE__ */ new WeakMap();
  945. const ITERATE_KEY = Symbol("iterate");
  946. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  947. function track(target, type, key) {
  948. if (shouldTrack && activeEffect) {
  949. let depsMap = targetMap.get(target);
  950. if (!depsMap) {
  951. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  952. }
  953. let dep = depsMap.get(key);
  954. if (!dep) {
  955. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  956. }
  957. trackEffect(
  958. activeEffect,
  959. dep,
  960. {
  961. target,
  962. type,
  963. key
  964. }
  965. );
  966. }
  967. }
  968. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  969. const depsMap = targetMap.get(target);
  970. if (!depsMap) {
  971. return;
  972. }
  973. let deps = [];
  974. if (type === "clear") {
  975. deps = [...depsMap.values()];
  976. } else if (key === "length" && isArray(target)) {
  977. const newLength = Number(newValue);
  978. depsMap.forEach((dep, key2) => {
  979. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  980. deps.push(dep);
  981. }
  982. });
  983. } else {
  984. if (key !== void 0) {
  985. deps.push(depsMap.get(key));
  986. }
  987. switch (type) {
  988. case "add":
  989. if (!isArray(target)) {
  990. deps.push(depsMap.get(ITERATE_KEY));
  991. if (isMap(target)) {
  992. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  993. }
  994. } else if (isIntegerKey(key)) {
  995. deps.push(depsMap.get("length"));
  996. }
  997. break;
  998. case "delete":
  999. if (!isArray(target)) {
  1000. deps.push(depsMap.get(ITERATE_KEY));
  1001. if (isMap(target)) {
  1002. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1003. }
  1004. }
  1005. break;
  1006. case "set":
  1007. if (isMap(target)) {
  1008. deps.push(depsMap.get(ITERATE_KEY));
  1009. }
  1010. break;
  1011. }
  1012. }
  1013. pauseScheduling();
  1014. for (const dep of deps) {
  1015. if (dep) {
  1016. triggerEffects(
  1017. dep,
  1018. 4,
  1019. {
  1020. target,
  1021. type,
  1022. key,
  1023. newValue,
  1024. oldValue,
  1025. oldTarget
  1026. }
  1027. );
  1028. }
  1029. }
  1030. resetScheduling();
  1031. }
  1032. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1033. const builtInSymbols = new Set(
  1034. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1035. );
  1036. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  1037. function createArrayInstrumentations() {
  1038. const instrumentations = {};
  1039. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  1040. instrumentations[key] = function(...args) {
  1041. const arr = toRaw(this);
  1042. for (let i = 0, l = this.length; i < l; i++) {
  1043. track(arr, "get", i + "");
  1044. }
  1045. const res2 = arr[key](...args);
  1046. if (res2 === -1 || res2 === false) {
  1047. return arr[key](...args.map(toRaw));
  1048. } else {
  1049. return res2;
  1050. }
  1051. };
  1052. });
  1053. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  1054. instrumentations[key] = function(...args) {
  1055. pauseTracking();
  1056. pauseScheduling();
  1057. const res2 = toRaw(this)[key].apply(this, args);
  1058. resetScheduling();
  1059. resetTracking();
  1060. return res2;
  1061. };
  1062. });
  1063. return instrumentations;
  1064. }
  1065. function hasOwnProperty(key) {
  1066. const obj = toRaw(this);
  1067. track(obj, "has", key);
  1068. return obj.hasOwnProperty(key);
  1069. }
  1070. class BaseReactiveHandler {
  1071. constructor(_isReadonly = false, _isShallow = false) {
  1072. this._isReadonly = _isReadonly;
  1073. this._isShallow = _isShallow;
  1074. }
  1075. get(target, key, receiver) {
  1076. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1077. if (key === "__v_isReactive") {
  1078. return !isReadonly2;
  1079. } else if (key === "__v_isReadonly") {
  1080. return isReadonly2;
  1081. } else if (key === "__v_isShallow") {
  1082. return isShallow2;
  1083. } else if (key === "__v_raw") {
  1084. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1085. // this means the reciever is a user proxy of the reactive proxy
  1086. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1087. return target;
  1088. }
  1089. return;
  1090. }
  1091. const targetIsArray = isArray(target);
  1092. if (!isReadonly2) {
  1093. if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
  1094. return Reflect.get(arrayInstrumentations, key, receiver);
  1095. }
  1096. if (key === "hasOwnProperty") {
  1097. return hasOwnProperty;
  1098. }
  1099. }
  1100. const res2 = Reflect.get(target, key, receiver);
  1101. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1102. return res2;
  1103. }
  1104. if (!isReadonly2) {
  1105. track(target, "get", key);
  1106. }
  1107. if (isShallow2) {
  1108. return res2;
  1109. }
  1110. if (isRef(res2)) {
  1111. return targetIsArray && isIntegerKey(key) ? res2 : res2.value;
  1112. }
  1113. if (isObject$2(res2)) {
  1114. return isReadonly2 ? readonly(res2) : reactive(res2);
  1115. }
  1116. return res2;
  1117. }
  1118. }
  1119. class MutableReactiveHandler extends BaseReactiveHandler {
  1120. constructor(isShallow2 = false) {
  1121. super(false, isShallow2);
  1122. }
  1123. set(target, key, value, receiver) {
  1124. let oldValue = target[key];
  1125. if (!this._isShallow) {
  1126. const isOldValueReadonly = isReadonly(oldValue);
  1127. if (!isShallow(value) && !isReadonly(value)) {
  1128. oldValue = toRaw(oldValue);
  1129. value = toRaw(value);
  1130. }
  1131. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1132. if (isOldValueReadonly) {
  1133. return false;
  1134. } else {
  1135. oldValue.value = value;
  1136. return true;
  1137. }
  1138. }
  1139. }
  1140. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
  1141. const result = Reflect.set(target, key, value, receiver);
  1142. if (target === toRaw(receiver)) {
  1143. if (!hadKey) {
  1144. trigger(target, "add", key, value);
  1145. } else if (hasChanged(value, oldValue)) {
  1146. trigger(target, "set", key, value, oldValue);
  1147. }
  1148. }
  1149. return result;
  1150. }
  1151. deleteProperty(target, key) {
  1152. const hadKey = hasOwn$1(target, key);
  1153. const oldValue = target[key];
  1154. const result = Reflect.deleteProperty(target, key);
  1155. if (result && hadKey) {
  1156. trigger(target, "delete", key, void 0, oldValue);
  1157. }
  1158. return result;
  1159. }
  1160. has(target, key) {
  1161. const result = Reflect.has(target, key);
  1162. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1163. track(target, "has", key);
  1164. }
  1165. return result;
  1166. }
  1167. ownKeys(target) {
  1168. track(
  1169. target,
  1170. "iterate",
  1171. isArray(target) ? "length" : ITERATE_KEY
  1172. );
  1173. return Reflect.ownKeys(target);
  1174. }
  1175. }
  1176. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1177. constructor(isShallow2 = false) {
  1178. super(true, isShallow2);
  1179. }
  1180. set(target, key) {
  1181. {
  1182. warn$2(
  1183. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1184. target
  1185. );
  1186. }
  1187. return true;
  1188. }
  1189. deleteProperty(target, key) {
  1190. {
  1191. warn$2(
  1192. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1193. target
  1194. );
  1195. }
  1196. return true;
  1197. }
  1198. }
  1199. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1200. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1201. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  1202. true
  1203. );
  1204. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1205. const toShallow = (value) => value;
  1206. const getProto = (v) => Reflect.getPrototypeOf(v);
  1207. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  1208. target = target["__v_raw"];
  1209. const rawTarget = toRaw(target);
  1210. const rawKey = toRaw(key);
  1211. if (!isReadonly2) {
  1212. if (hasChanged(key, rawKey)) {
  1213. track(rawTarget, "get", key);
  1214. }
  1215. track(rawTarget, "get", rawKey);
  1216. }
  1217. const { has: has2 } = getProto(rawTarget);
  1218. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1219. if (has2.call(rawTarget, key)) {
  1220. return wrap(target.get(key));
  1221. } else if (has2.call(rawTarget, rawKey)) {
  1222. return wrap(target.get(rawKey));
  1223. } else if (target !== rawTarget) {
  1224. target.get(key);
  1225. }
  1226. }
  1227. function has$1(key, isReadonly2 = false) {
  1228. const target = this["__v_raw"];
  1229. const rawTarget = toRaw(target);
  1230. const rawKey = toRaw(key);
  1231. if (!isReadonly2) {
  1232. if (hasChanged(key, rawKey)) {
  1233. track(rawTarget, "has", key);
  1234. }
  1235. track(rawTarget, "has", rawKey);
  1236. }
  1237. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1238. }
  1239. function size(target, isReadonly2 = false) {
  1240. target = target["__v_raw"];
  1241. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  1242. return Reflect.get(target, "size", target);
  1243. }
  1244. function add(value) {
  1245. value = toRaw(value);
  1246. const target = toRaw(this);
  1247. const proto = getProto(target);
  1248. const hadKey = proto.has.call(target, value);
  1249. if (!hadKey) {
  1250. target.add(value);
  1251. trigger(target, "add", value, value);
  1252. }
  1253. return this;
  1254. }
  1255. function set$1(key, value) {
  1256. value = toRaw(value);
  1257. const target = toRaw(this);
  1258. const { has: has2, get: get22 } = getProto(target);
  1259. let hadKey = has2.call(target, key);
  1260. if (!hadKey) {
  1261. key = toRaw(key);
  1262. hadKey = has2.call(target, key);
  1263. } else {
  1264. checkIdentityKeys(target, has2, key);
  1265. }
  1266. const oldValue = get22.call(target, key);
  1267. target.set(key, value);
  1268. if (!hadKey) {
  1269. trigger(target, "add", key, value);
  1270. } else if (hasChanged(value, oldValue)) {
  1271. trigger(target, "set", key, value, oldValue);
  1272. }
  1273. return this;
  1274. }
  1275. function deleteEntry(key) {
  1276. const target = toRaw(this);
  1277. const { has: has2, get: get22 } = getProto(target);
  1278. let hadKey = has2.call(target, key);
  1279. if (!hadKey) {
  1280. key = toRaw(key);
  1281. hadKey = has2.call(target, key);
  1282. } else {
  1283. checkIdentityKeys(target, has2, key);
  1284. }
  1285. const oldValue = get22 ? get22.call(target, key) : void 0;
  1286. const result = target.delete(key);
  1287. if (hadKey) {
  1288. trigger(target, "delete", key, void 0, oldValue);
  1289. }
  1290. return result;
  1291. }
  1292. function clear() {
  1293. const target = toRaw(this);
  1294. const hadItems = target.size !== 0;
  1295. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  1296. const result = target.clear();
  1297. if (hadItems) {
  1298. trigger(target, "clear", void 0, void 0, oldTarget);
  1299. }
  1300. return result;
  1301. }
  1302. function createForEach(isReadonly2, isShallow2) {
  1303. return function forEach(callback, thisArg) {
  1304. const observed = this;
  1305. const target = observed["__v_raw"];
  1306. const rawTarget = toRaw(target);
  1307. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1308. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  1309. return target.forEach((value, key) => {
  1310. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1311. });
  1312. };
  1313. }
  1314. function createIterableMethod(method, isReadonly2, isShallow2) {
  1315. return function(...args) {
  1316. const target = this["__v_raw"];
  1317. const rawTarget = toRaw(target);
  1318. const targetIsMap = isMap(rawTarget);
  1319. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1320. const isKeyOnly = method === "keys" && targetIsMap;
  1321. const innerIterator = target[method](...args);
  1322. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1323. !isReadonly2 && track(
  1324. rawTarget,
  1325. "iterate",
  1326. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1327. );
  1328. return {
  1329. // iterator protocol
  1330. next() {
  1331. const { value, done } = innerIterator.next();
  1332. return done ? { value, done } : {
  1333. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1334. done
  1335. };
  1336. },
  1337. // iterable protocol
  1338. [Symbol.iterator]() {
  1339. return this;
  1340. }
  1341. };
  1342. };
  1343. }
  1344. function createReadonlyMethod(type) {
  1345. return function(...args) {
  1346. {
  1347. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1348. warn$2(
  1349. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1350. toRaw(this)
  1351. );
  1352. }
  1353. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1354. };
  1355. }
  1356. function createInstrumentations() {
  1357. const mutableInstrumentations2 = {
  1358. get(key) {
  1359. return get(this, key);
  1360. },
  1361. get size() {
  1362. return size(this);
  1363. },
  1364. has: has$1,
  1365. add,
  1366. set: set$1,
  1367. delete: deleteEntry,
  1368. clear,
  1369. forEach: createForEach(false, false)
  1370. };
  1371. const shallowInstrumentations2 = {
  1372. get(key) {
  1373. return get(this, key, false, true);
  1374. },
  1375. get size() {
  1376. return size(this);
  1377. },
  1378. has: has$1,
  1379. add,
  1380. set: set$1,
  1381. delete: deleteEntry,
  1382. clear,
  1383. forEach: createForEach(false, true)
  1384. };
  1385. const readonlyInstrumentations2 = {
  1386. get(key) {
  1387. return get(this, key, true);
  1388. },
  1389. get size() {
  1390. return size(this, true);
  1391. },
  1392. has(key) {
  1393. return has$1.call(this, key, true);
  1394. },
  1395. add: createReadonlyMethod("add"),
  1396. set: createReadonlyMethod("set"),
  1397. delete: createReadonlyMethod("delete"),
  1398. clear: createReadonlyMethod("clear"),
  1399. forEach: createForEach(true, false)
  1400. };
  1401. const shallowReadonlyInstrumentations2 = {
  1402. get(key) {
  1403. return get(this, key, true, true);
  1404. },
  1405. get size() {
  1406. return size(this, true);
  1407. },
  1408. has(key) {
  1409. return has$1.call(this, key, true);
  1410. },
  1411. add: createReadonlyMethod("add"),
  1412. set: createReadonlyMethod("set"),
  1413. delete: createReadonlyMethod("delete"),
  1414. clear: createReadonlyMethod("clear"),
  1415. forEach: createForEach(true, true)
  1416. };
  1417. const iteratorMethods = [
  1418. "keys",
  1419. "values",
  1420. "entries",
  1421. Symbol.iterator
  1422. ];
  1423. iteratorMethods.forEach((method) => {
  1424. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  1425. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  1426. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  1427. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1428. method,
  1429. true,
  1430. true
  1431. );
  1432. });
  1433. return [
  1434. mutableInstrumentations2,
  1435. readonlyInstrumentations2,
  1436. shallowInstrumentations2,
  1437. shallowReadonlyInstrumentations2
  1438. ];
  1439. }
  1440. const [
  1441. mutableInstrumentations,
  1442. readonlyInstrumentations,
  1443. shallowInstrumentations,
  1444. shallowReadonlyInstrumentations
  1445. ] = /* @__PURE__ */ createInstrumentations();
  1446. function createInstrumentationGetter(isReadonly2, shallow) {
  1447. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  1448. return (target, key, receiver) => {
  1449. if (key === "__v_isReactive") {
  1450. return !isReadonly2;
  1451. } else if (key === "__v_isReadonly") {
  1452. return isReadonly2;
  1453. } else if (key === "__v_raw") {
  1454. return target;
  1455. }
  1456. return Reflect.get(
  1457. hasOwn$1(instrumentations, key) && key in target ? instrumentations : target,
  1458. key,
  1459. receiver
  1460. );
  1461. };
  1462. }
  1463. const mutableCollectionHandlers = {
  1464. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1465. };
  1466. const shallowCollectionHandlers = {
  1467. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1468. };
  1469. const readonlyCollectionHandlers = {
  1470. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1471. };
  1472. const shallowReadonlyCollectionHandlers = {
  1473. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1474. };
  1475. function checkIdentityKeys(target, has2, key) {
  1476. const rawKey = toRaw(key);
  1477. if (rawKey !== key && has2.call(target, rawKey)) {
  1478. const type = toRawType(target);
  1479. warn$2(
  1480. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1481. );
  1482. }
  1483. }
  1484. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1485. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1486. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1487. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1488. function targetTypeMap(rawType) {
  1489. switch (rawType) {
  1490. case "Object":
  1491. case "Array":
  1492. return 1;
  1493. case "Map":
  1494. case "Set":
  1495. case "WeakMap":
  1496. case "WeakSet":
  1497. return 2;
  1498. default:
  1499. return 0;
  1500. }
  1501. }
  1502. function getTargetType(value) {
  1503. return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  1504. }
  1505. function reactive(target) {
  1506. if (isReadonly(target)) {
  1507. return target;
  1508. }
  1509. return createReactiveObject(
  1510. target,
  1511. false,
  1512. mutableHandlers,
  1513. mutableCollectionHandlers,
  1514. reactiveMap
  1515. );
  1516. }
  1517. function shallowReactive(target) {
  1518. return createReactiveObject(
  1519. target,
  1520. false,
  1521. shallowReactiveHandlers,
  1522. shallowCollectionHandlers,
  1523. shallowReactiveMap
  1524. );
  1525. }
  1526. function readonly(target) {
  1527. return createReactiveObject(
  1528. target,
  1529. true,
  1530. readonlyHandlers,
  1531. readonlyCollectionHandlers,
  1532. readonlyMap
  1533. );
  1534. }
  1535. function shallowReadonly(target) {
  1536. return createReactiveObject(
  1537. target,
  1538. true,
  1539. shallowReadonlyHandlers,
  1540. shallowReadonlyCollectionHandlers,
  1541. shallowReadonlyMap
  1542. );
  1543. }
  1544. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1545. if (!isObject$2(target)) {
  1546. {
  1547. warn$2(`value cannot be made reactive: ${String(target)}`);
  1548. }
  1549. return target;
  1550. }
  1551. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1552. return target;
  1553. }
  1554. const existingProxy = proxyMap.get(target);
  1555. if (existingProxy) {
  1556. return existingProxy;
  1557. }
  1558. const targetType = getTargetType(target);
  1559. if (targetType === 0) {
  1560. return target;
  1561. }
  1562. const proxy = new Proxy(
  1563. target,
  1564. targetType === 2 ? collectionHandlers : baseHandlers
  1565. );
  1566. proxyMap.set(target, proxy);
  1567. return proxy;
  1568. }
  1569. function isReactive(value) {
  1570. if (isReadonly(value)) {
  1571. return isReactive(value["__v_raw"]);
  1572. }
  1573. return !!(value && value["__v_isReactive"]);
  1574. }
  1575. function isReadonly(value) {
  1576. return !!(value && value["__v_isReadonly"]);
  1577. }
  1578. function isShallow(value) {
  1579. return !!(value && value["__v_isShallow"]);
  1580. }
  1581. function isProxy(value) {
  1582. return isReactive(value) || isReadonly(value);
  1583. }
  1584. function toRaw(observed) {
  1585. const raw = observed && observed["__v_raw"];
  1586. return raw ? toRaw(raw) : observed;
  1587. }
  1588. function markRaw(value) {
  1589. if (Object.isExtensible(value)) {
  1590. def(value, "__v_skip", true);
  1591. }
  1592. return value;
  1593. }
  1594. const toReactive = (value) => isObject$2(value) ? reactive(value) : value;
  1595. const toReadonly = (value) => isObject$2(value) ? readonly(value) : value;
  1596. const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
  1597. class ComputedRefImpl {
  1598. constructor(getter, _setter, isReadonly2, isSSR) {
  1599. this.getter = getter;
  1600. this._setter = _setter;
  1601. this.dep = void 0;
  1602. this.__v_isRef = true;
  1603. this["__v_isReadonly"] = false;
  1604. this.effect = new ReactiveEffect(
  1605. () => getter(this._value),
  1606. () => triggerRefValue(
  1607. this,
  1608. this.effect._dirtyLevel === 2 ? 2 : 3
  1609. )
  1610. );
  1611. this.effect.computed = this;
  1612. this.effect.active = this._cacheable = !isSSR;
  1613. this["__v_isReadonly"] = isReadonly2;
  1614. }
  1615. get value() {
  1616. const self = toRaw(this);
  1617. if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
  1618. triggerRefValue(self, 4);
  1619. }
  1620. trackRefValue(self);
  1621. if (self.effect._dirtyLevel >= 2) {
  1622. if (this._warnRecursive) {
  1623. warn$2(COMPUTED_SIDE_EFFECT_WARN, `
  1624. getter: `, this.getter);
  1625. }
  1626. triggerRefValue(self, 2);
  1627. }
  1628. return self._value;
  1629. }
  1630. set value(newValue) {
  1631. this._setter(newValue);
  1632. }
  1633. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1634. get _dirty() {
  1635. return this.effect.dirty;
  1636. }
  1637. set _dirty(v) {
  1638. this.effect.dirty = v;
  1639. }
  1640. // #endregion
  1641. }
  1642. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1643. let getter;
  1644. let setter;
  1645. const onlyGetter = isFunction(getterOrOptions);
  1646. if (onlyGetter) {
  1647. getter = getterOrOptions;
  1648. setter = () => {
  1649. warn$2("Write operation failed: computed value is readonly");
  1650. };
  1651. } else {
  1652. getter = getterOrOptions.get;
  1653. setter = getterOrOptions.set;
  1654. }
  1655. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1656. if (debugOptions && !isSSR) {
  1657. cRef.effect.onTrack = debugOptions.onTrack;
  1658. cRef.effect.onTrigger = debugOptions.onTrigger;
  1659. }
  1660. return cRef;
  1661. }
  1662. function trackRefValue(ref2) {
  1663. var _a;
  1664. if (shouldTrack && activeEffect) {
  1665. ref2 = toRaw(ref2);
  1666. trackEffect(
  1667. activeEffect,
  1668. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1669. () => ref2.dep = void 0,
  1670. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1671. ),
  1672. {
  1673. target: ref2,
  1674. type: "get",
  1675. key: "value"
  1676. }
  1677. );
  1678. }
  1679. }
  1680. function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
  1681. ref2 = toRaw(ref2);
  1682. const dep = ref2.dep;
  1683. if (dep) {
  1684. triggerEffects(
  1685. dep,
  1686. dirtyLevel,
  1687. {
  1688. target: ref2,
  1689. type: "set",
  1690. key: "value",
  1691. newValue: newVal
  1692. }
  1693. );
  1694. }
  1695. }
  1696. function isRef(r2) {
  1697. return !!(r2 && r2.__v_isRef === true);
  1698. }
  1699. function ref(value) {
  1700. return createRef(value, false);
  1701. }
  1702. function createRef(rawValue, shallow) {
  1703. if (isRef(rawValue)) {
  1704. return rawValue;
  1705. }
  1706. return new RefImpl(rawValue, shallow);
  1707. }
  1708. class RefImpl {
  1709. constructor(value, __v_isShallow) {
  1710. this.__v_isShallow = __v_isShallow;
  1711. this.dep = void 0;
  1712. this.__v_isRef = true;
  1713. this._rawValue = __v_isShallow ? value : toRaw(value);
  1714. this._value = __v_isShallow ? value : toReactive(value);
  1715. }
  1716. get value() {
  1717. trackRefValue(this);
  1718. return this._value;
  1719. }
  1720. set value(newVal) {
  1721. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1722. newVal = useDirectValue ? newVal : toRaw(newVal);
  1723. if (hasChanged(newVal, this._rawValue)) {
  1724. this._rawValue = newVal;
  1725. this._value = useDirectValue ? newVal : toReactive(newVal);
  1726. triggerRefValue(this, 4, newVal);
  1727. }
  1728. }
  1729. }
  1730. function unref(ref2) {
  1731. return isRef(ref2) ? ref2.value : ref2;
  1732. }
  1733. const shallowUnwrapHandlers = {
  1734. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1735. set: (target, key, value, receiver) => {
  1736. const oldValue = target[key];
  1737. if (isRef(oldValue) && !isRef(value)) {
  1738. oldValue.value = value;
  1739. return true;
  1740. } else {
  1741. return Reflect.set(target, key, value, receiver);
  1742. }
  1743. }
  1744. };
  1745. function proxyRefs(objectWithRefs) {
  1746. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1747. }
  1748. const stack = [];
  1749. function pushWarningContext(vnode) {
  1750. stack.push(vnode);
  1751. }
  1752. function popWarningContext() {
  1753. stack.pop();
  1754. }
  1755. function warn$1(msg, ...args) {
  1756. pauseTracking();
  1757. const instance = stack.length ? stack[stack.length - 1].component : null;
  1758. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1759. const trace = getComponentTrace();
  1760. if (appWarnHandler) {
  1761. callWithErrorHandling(
  1762. appWarnHandler,
  1763. instance,
  1764. 11,
  1765. [
  1766. msg + args.map((a) => {
  1767. var _a, _b;
  1768. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1769. }).join(""),
  1770. instance && instance.proxy,
  1771. trace.map(
  1772. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1773. ).join("\n"),
  1774. trace
  1775. ]
  1776. );
  1777. } else {
  1778. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1779. if (trace.length && // avoid spamming console during tests
  1780. true) {
  1781. warnArgs.push(`
  1782. `, ...formatTrace(trace));
  1783. }
  1784. console.warn(...warnArgs);
  1785. }
  1786. resetTracking();
  1787. }
  1788. function getComponentTrace() {
  1789. let currentVNode = stack[stack.length - 1];
  1790. if (!currentVNode) {
  1791. return [];
  1792. }
  1793. const normalizedStack = [];
  1794. while (currentVNode) {
  1795. const last = normalizedStack[0];
  1796. if (last && last.vnode === currentVNode) {
  1797. last.recurseCount++;
  1798. } else {
  1799. normalizedStack.push({
  1800. vnode: currentVNode,
  1801. recurseCount: 0
  1802. });
  1803. }
  1804. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1805. currentVNode = parentInstance && parentInstance.vnode;
  1806. }
  1807. return normalizedStack;
  1808. }
  1809. function formatTrace(trace) {
  1810. const logs = [];
  1811. trace.forEach((entry, i) => {
  1812. logs.push(...i === 0 ? [] : [`
  1813. `], ...formatTraceEntry(entry));
  1814. });
  1815. return logs;
  1816. }
  1817. function formatTraceEntry({ vnode, recurseCount }) {
  1818. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1819. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1820. const open = ` at <${formatComponentName(
  1821. vnode.component,
  1822. vnode.type,
  1823. isRoot
  1824. )}`;
  1825. const close = `>` + postfix;
  1826. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1827. }
  1828. function formatProps(props) {
  1829. const res2 = [];
  1830. const keys = Object.keys(props);
  1831. keys.slice(0, 3).forEach((key) => {
  1832. res2.push(...formatProp(key, props[key]));
  1833. });
  1834. if (keys.length > 3) {
  1835. res2.push(` ...`);
  1836. }
  1837. return res2;
  1838. }
  1839. function formatProp(key, value, raw) {
  1840. if (isString(value)) {
  1841. value = JSON.stringify(value);
  1842. return raw ? value : [`${key}=${value}`];
  1843. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1844. return raw ? value : [`${key}=${value}`];
  1845. } else if (isRef(value)) {
  1846. value = formatProp(key, toRaw(value.value), true);
  1847. return raw ? value : [`${key}=Ref<`, value, `>`];
  1848. } else if (isFunction(value)) {
  1849. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1850. } else {
  1851. value = toRaw(value);
  1852. return raw ? value : [`${key}=`, value];
  1853. }
  1854. }
  1855. const ErrorTypeStrings = {
  1856. ["sp"]: "serverPrefetch hook",
  1857. ["bc"]: "beforeCreate hook",
  1858. ["c"]: "created hook",
  1859. ["bm"]: "beforeMount hook",
  1860. ["m"]: "mounted hook",
  1861. ["bu"]: "beforeUpdate hook",
  1862. ["u"]: "updated",
  1863. ["bum"]: "beforeUnmount hook",
  1864. ["um"]: "unmounted hook",
  1865. ["a"]: "activated hook",
  1866. ["da"]: "deactivated hook",
  1867. ["ec"]: "errorCaptured hook",
  1868. ["rtc"]: "renderTracked hook",
  1869. ["rtg"]: "renderTriggered hook",
  1870. [0]: "setup function",
  1871. [1]: "render function",
  1872. [2]: "watcher getter",
  1873. [3]: "watcher callback",
  1874. [4]: "watcher cleanup function",
  1875. [5]: "native event handler",
  1876. [6]: "component event handler",
  1877. [7]: "vnode hook",
  1878. [8]: "directive hook",
  1879. [9]: "transition hook",
  1880. [10]: "app errorHandler",
  1881. [11]: "app warnHandler",
  1882. [12]: "ref function",
  1883. [13]: "async component loader",
  1884. [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
  1885. };
  1886. function callWithErrorHandling(fn, instance, type, args) {
  1887. try {
  1888. return args ? fn(...args) : fn();
  1889. } catch (err) {
  1890. handleError(err, instance, type);
  1891. }
  1892. }
  1893. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1894. if (isFunction(fn)) {
  1895. const res2 = callWithErrorHandling(fn, instance, type, args);
  1896. if (res2 && isPromise$1(res2)) {
  1897. res2.catch((err) => {
  1898. handleError(err, instance, type);
  1899. });
  1900. }
  1901. return res2;
  1902. }
  1903. const values = [];
  1904. for (let i = 0; i < fn.length; i++) {
  1905. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1906. }
  1907. return values;
  1908. }
  1909. function handleError(err, instance, type, throwInDev = true) {
  1910. const contextVNode = instance ? instance.vnode : null;
  1911. if (instance) {
  1912. let cur = instance.parent;
  1913. const exposedInstance = instance.proxy;
  1914. const errorInfo = ErrorTypeStrings[type] || type;
  1915. while (cur) {
  1916. const errorCapturedHooks = cur.ec;
  1917. if (errorCapturedHooks) {
  1918. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1919. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1920. return;
  1921. }
  1922. }
  1923. }
  1924. cur = cur.parent;
  1925. }
  1926. const appErrorHandler = instance.appContext.config.errorHandler;
  1927. if (appErrorHandler) {
  1928. callWithErrorHandling(
  1929. appErrorHandler,
  1930. null,
  1931. 10,
  1932. [err, exposedInstance, errorInfo]
  1933. );
  1934. return;
  1935. }
  1936. }
  1937. logError(err, type, contextVNode, throwInDev);
  1938. }
  1939. function logError(err, type, contextVNode, throwInDev = true) {
  1940. {
  1941. const info = ErrorTypeStrings[type] || type;
  1942. if (contextVNode) {
  1943. pushWarningContext(contextVNode);
  1944. }
  1945. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  1946. if (contextVNode) {
  1947. popWarningContext();
  1948. }
  1949. if (throwInDev) {
  1950. console.error(err);
  1951. } else {
  1952. console.error(err);
  1953. }
  1954. }
  1955. }
  1956. let isFlushing = false;
  1957. let isFlushPending = false;
  1958. const queue$1 = [];
  1959. let flushIndex = 0;
  1960. const pendingPostFlushCbs = [];
  1961. let activePostFlushCbs = null;
  1962. let postFlushIndex = 0;
  1963. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1964. let currentFlushPromise = null;
  1965. const RECURSION_LIMIT = 100;
  1966. function nextTick$1(fn) {
  1967. const p2 = currentFlushPromise || resolvedPromise;
  1968. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  1969. }
  1970. function findInsertionIndex(id) {
  1971. let start = flushIndex + 1;
  1972. let end = queue$1.length;
  1973. while (start < end) {
  1974. const middle = start + end >>> 1;
  1975. const middleJob = queue$1[middle];
  1976. const middleJobId = getId(middleJob);
  1977. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1978. start = middle + 1;
  1979. } else {
  1980. end = middle;
  1981. }
  1982. }
  1983. return start;
  1984. }
  1985. function queueJob(job) {
  1986. if (!queue$1.length || !queue$1.includes(
  1987. job,
  1988. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1989. )) {
  1990. if (job.id == null) {
  1991. queue$1.push(job);
  1992. } else {
  1993. queue$1.splice(findInsertionIndex(job.id), 0, job);
  1994. }
  1995. queueFlush();
  1996. }
  1997. }
  1998. function queueFlush() {
  1999. if (!isFlushing && !isFlushPending) {
  2000. isFlushPending = true;
  2001. currentFlushPromise = resolvedPromise.then(flushJobs);
  2002. }
  2003. }
  2004. function hasQueueJob(job) {
  2005. return queue$1.indexOf(job) > -1;
  2006. }
  2007. function invalidateJob(job) {
  2008. const i = queue$1.indexOf(job);
  2009. if (i > flushIndex) {
  2010. queue$1.splice(i, 1);
  2011. }
  2012. }
  2013. function queuePostFlushCb(cb) {
  2014. if (!isArray(cb)) {
  2015. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  2016. cb,
  2017. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  2018. )) {
  2019. pendingPostFlushCbs.push(cb);
  2020. }
  2021. } else {
  2022. pendingPostFlushCbs.push(...cb);
  2023. }
  2024. queueFlush();
  2025. }
  2026. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  2027. {
  2028. seen = seen || /* @__PURE__ */ new Map();
  2029. }
  2030. for (; i < queue$1.length; i++) {
  2031. const cb = queue$1[i];
  2032. if (cb && cb.pre) {
  2033. if (checkRecursiveUpdates(seen, cb)) {
  2034. continue;
  2035. }
  2036. queue$1.splice(i, 1);
  2037. i--;
  2038. cb();
  2039. }
  2040. }
  2041. }
  2042. function flushPostFlushCbs(seen) {
  2043. if (pendingPostFlushCbs.length) {
  2044. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2045. (a, b) => getId(a) - getId(b)
  2046. );
  2047. pendingPostFlushCbs.length = 0;
  2048. if (activePostFlushCbs) {
  2049. activePostFlushCbs.push(...deduped);
  2050. return;
  2051. }
  2052. activePostFlushCbs = deduped;
  2053. {
  2054. seen = seen || /* @__PURE__ */ new Map();
  2055. }
  2056. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2057. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  2058. continue;
  2059. }
  2060. activePostFlushCbs[postFlushIndex]();
  2061. }
  2062. activePostFlushCbs = null;
  2063. postFlushIndex = 0;
  2064. }
  2065. }
  2066. const getId = (job) => job.id == null ? Infinity : job.id;
  2067. const comparator = (a, b) => {
  2068. const diff2 = getId(a) - getId(b);
  2069. if (diff2 === 0) {
  2070. if (a.pre && !b.pre)
  2071. return -1;
  2072. if (b.pre && !a.pre)
  2073. return 1;
  2074. }
  2075. return diff2;
  2076. };
  2077. function flushJobs(seen) {
  2078. isFlushPending = false;
  2079. isFlushing = true;
  2080. {
  2081. seen = seen || /* @__PURE__ */ new Map();
  2082. }
  2083. queue$1.sort(comparator);
  2084. const check = (job) => checkRecursiveUpdates(seen, job);
  2085. try {
  2086. for (flushIndex = 0; flushIndex < queue$1.length; flushIndex++) {
  2087. const job = queue$1[flushIndex];
  2088. if (job && job.active !== false) {
  2089. if (check(job)) {
  2090. continue;
  2091. }
  2092. callWithErrorHandling(job, null, 14);
  2093. }
  2094. }
  2095. } finally {
  2096. flushIndex = 0;
  2097. queue$1.length = 0;
  2098. flushPostFlushCbs(seen);
  2099. isFlushing = false;
  2100. currentFlushPromise = null;
  2101. if (queue$1.length || pendingPostFlushCbs.length) {
  2102. flushJobs(seen);
  2103. }
  2104. }
  2105. }
  2106. function checkRecursiveUpdates(seen, fn) {
  2107. if (!seen.has(fn)) {
  2108. seen.set(fn, 1);
  2109. } else {
  2110. const count2 = seen.get(fn);
  2111. if (count2 > RECURSION_LIMIT) {
  2112. const instance = fn.ownerInstance;
  2113. const componentName = instance && getComponentName(instance.type);
  2114. handleError(
  2115. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  2116. null,
  2117. 10
  2118. );
  2119. return true;
  2120. } else {
  2121. seen.set(fn, count2 + 1);
  2122. }
  2123. }
  2124. }
  2125. let devtools;
  2126. let buffer = [];
  2127. let devtoolsNotInstalled = false;
  2128. function emit$1(event, ...args) {
  2129. if (devtools) {
  2130. devtools.emit(event, ...args);
  2131. } else if (!devtoolsNotInstalled) {
  2132. buffer.push({ event, args });
  2133. }
  2134. }
  2135. function setDevtoolsHook(hook, target) {
  2136. var _a, _b;
  2137. devtools = hook;
  2138. if (devtools) {
  2139. devtools.enabled = true;
  2140. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  2141. buffer = [];
  2142. } else if (
  2143. // handle late devtools injection - only do this if we are in an actual
  2144. // browser environment to avoid the timer handle stalling test runner exit
  2145. // (#4815)
  2146. typeof window !== "undefined" && // some envs mock window but not fully
  2147. window.HTMLElement && // also exclude jsdom
  2148. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2149. ) {
  2150. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2151. replay.push((newHook) => {
  2152. setDevtoolsHook(newHook, target);
  2153. });
  2154. setTimeout(() => {
  2155. if (!devtools) {
  2156. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2157. devtoolsNotInstalled = true;
  2158. buffer = [];
  2159. }
  2160. }, 3e3);
  2161. } else {
  2162. devtoolsNotInstalled = true;
  2163. buffer = [];
  2164. }
  2165. }
  2166. function devtoolsInitApp(app, version2) {
  2167. emit$1("app:init", app, version2, {
  2168. Fragment,
  2169. Text,
  2170. Comment,
  2171. Static
  2172. });
  2173. }
  2174. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  2175. "component:added"
  2176. /* COMPONENT_ADDED */
  2177. );
  2178. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  2179. "component:updated"
  2180. /* COMPONENT_UPDATED */
  2181. );
  2182. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2183. "component:removed"
  2184. /* COMPONENT_REMOVED */
  2185. );
  2186. const devtoolsComponentRemoved = (component) => {
  2187. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2188. !devtools.cleanupBuffer(component)) {
  2189. _devtoolsComponentRemoved(component);
  2190. }
  2191. };
  2192. /*! #__NO_SIDE_EFFECTS__ */
  2193. // @__NO_SIDE_EFFECTS__
  2194. function createDevtoolsComponentHook(hook) {
  2195. return (component) => {
  2196. emit$1(
  2197. hook,
  2198. component.appContext.app,
  2199. component.uid,
  2200. // fixed by xxxxxx
  2201. // 为 0 是 App,无 parent 是 Page 指向 App
  2202. component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
  2203. component
  2204. );
  2205. };
  2206. }
  2207. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2208. "perf:start"
  2209. /* PERFORMANCE_START */
  2210. );
  2211. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2212. "perf:end"
  2213. /* PERFORMANCE_END */
  2214. );
  2215. function createDevtoolsPerformanceHook(hook) {
  2216. return (component, type, time) => {
  2217. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2218. };
  2219. }
  2220. function devtoolsComponentEmit(component, event, params) {
  2221. emit$1(
  2222. "component:emit",
  2223. component.appContext.app,
  2224. component,
  2225. event,
  2226. params
  2227. );
  2228. }
  2229. function emit(instance, event, ...rawArgs) {
  2230. if (instance.isUnmounted)
  2231. return;
  2232. const props = instance.vnode.props || EMPTY_OBJ;
  2233. {
  2234. const {
  2235. emitsOptions,
  2236. propsOptions: [propsOptions]
  2237. } = instance;
  2238. if (emitsOptions) {
  2239. if (!(event in emitsOptions) && true) {
  2240. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  2241. warn$1(
  2242. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
  2243. );
  2244. }
  2245. } else {
  2246. const validator = emitsOptions[event];
  2247. if (isFunction(validator)) {
  2248. const isValid = validator(...rawArgs);
  2249. if (!isValid) {
  2250. warn$1(
  2251. `Invalid event arguments: event validation failed for event "${event}".`
  2252. );
  2253. }
  2254. }
  2255. }
  2256. }
  2257. }
  2258. let args = rawArgs;
  2259. const isModelListener2 = event.startsWith("update:");
  2260. const modelArg = isModelListener2 && event.slice(7);
  2261. if (modelArg && modelArg in props) {
  2262. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  2263. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  2264. if (trim) {
  2265. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  2266. }
  2267. if (number) {
  2268. args = rawArgs.map(looseToNumber);
  2269. }
  2270. }
  2271. {
  2272. devtoolsComponentEmit(instance, event, args);
  2273. }
  2274. {
  2275. const lowerCaseEvent = event.toLowerCase();
  2276. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  2277. warn$1(
  2278. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  2279. instance,
  2280. instance.type
  2281. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
  2282. event
  2283. )}" instead of "${event}".`
  2284. );
  2285. }
  2286. }
  2287. let handlerName;
  2288. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  2289. props[handlerName = toHandlerKey(camelize(event))];
  2290. if (!handler && isModelListener2) {
  2291. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  2292. }
  2293. if (handler) {
  2294. callWithAsyncErrorHandling(
  2295. handler,
  2296. instance,
  2297. 6,
  2298. args
  2299. );
  2300. }
  2301. const onceHandler = props[handlerName + `Once`];
  2302. if (onceHandler) {
  2303. if (!instance.emitted) {
  2304. instance.emitted = {};
  2305. } else if (instance.emitted[handlerName]) {
  2306. return;
  2307. }
  2308. instance.emitted[handlerName] = true;
  2309. callWithAsyncErrorHandling(
  2310. onceHandler,
  2311. instance,
  2312. 6,
  2313. args
  2314. );
  2315. }
  2316. }
  2317. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  2318. const cache = appContext.emitsCache;
  2319. const cached = cache.get(comp);
  2320. if (cached !== void 0) {
  2321. return cached;
  2322. }
  2323. const raw = comp.emits;
  2324. let normalized = {};
  2325. let hasExtends = false;
  2326. if (!isFunction(comp)) {
  2327. const extendEmits = (raw2) => {
  2328. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  2329. if (normalizedFromExtend) {
  2330. hasExtends = true;
  2331. extend(normalized, normalizedFromExtend);
  2332. }
  2333. };
  2334. if (!asMixin && appContext.mixins.length) {
  2335. appContext.mixins.forEach(extendEmits);
  2336. }
  2337. if (comp.extends) {
  2338. extendEmits(comp.extends);
  2339. }
  2340. if (comp.mixins) {
  2341. comp.mixins.forEach(extendEmits);
  2342. }
  2343. }
  2344. if (!raw && !hasExtends) {
  2345. if (isObject$2(comp)) {
  2346. cache.set(comp, null);
  2347. }
  2348. return null;
  2349. }
  2350. if (isArray(raw)) {
  2351. raw.forEach((key) => normalized[key] = null);
  2352. } else {
  2353. extend(normalized, raw);
  2354. }
  2355. if (isObject$2(comp)) {
  2356. cache.set(comp, normalized);
  2357. }
  2358. return normalized;
  2359. }
  2360. function isEmitListener(options, key) {
  2361. if (!options || !isOn(key)) {
  2362. return false;
  2363. }
  2364. key = key.slice(2).replace(/Once$/, "");
  2365. return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
  2366. }
  2367. let currentRenderingInstance = null;
  2368. function setCurrentRenderingInstance(instance) {
  2369. const prev = currentRenderingInstance;
  2370. currentRenderingInstance = instance;
  2371. instance && instance.type.__scopeId || null;
  2372. return prev;
  2373. }
  2374. const COMPONENTS = "components";
  2375. function resolveComponent(name, maybeSelfReference) {
  2376. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2377. }
  2378. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2379. const instance = currentRenderingInstance || currentInstance;
  2380. if (instance) {
  2381. const Component2 = instance.type;
  2382. if (type === COMPONENTS) {
  2383. const selfName = getComponentName(
  2384. Component2,
  2385. false
  2386. );
  2387. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  2388. return Component2;
  2389. }
  2390. }
  2391. const res2 = (
  2392. // local registration
  2393. // check instance[type] first which is resolved for options API
  2394. resolve(instance[type] || Component2[type], name) || // global registration
  2395. resolve(instance.appContext[type], name)
  2396. );
  2397. if (!res2 && maybeSelfReference) {
  2398. return Component2;
  2399. }
  2400. if (warnMissing && !res2) {
  2401. const extra = type === COMPONENTS ? `
  2402. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  2403. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  2404. }
  2405. return res2;
  2406. } else {
  2407. warn$1(
  2408. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  2409. );
  2410. }
  2411. }
  2412. function resolve(registry, name) {
  2413. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  2414. }
  2415. const INITIAL_WATCHER_VALUE = {};
  2416. function watch(source, cb, options) {
  2417. if (!isFunction(cb)) {
  2418. warn$1(
  2419. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  2420. );
  2421. }
  2422. return doWatch(source, cb, options);
  2423. }
  2424. function doWatch(source, cb, {
  2425. immediate,
  2426. deep,
  2427. flush,
  2428. once: once2,
  2429. onTrack,
  2430. onTrigger
  2431. } = EMPTY_OBJ) {
  2432. if (cb && once2) {
  2433. const _cb = cb;
  2434. cb = (...args) => {
  2435. _cb(...args);
  2436. unwatch();
  2437. };
  2438. }
  2439. if (deep !== void 0 && typeof deep === "number") {
  2440. warn$1(
  2441. `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
  2442. );
  2443. }
  2444. if (!cb) {
  2445. if (immediate !== void 0) {
  2446. warn$1(
  2447. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  2448. );
  2449. }
  2450. if (deep !== void 0) {
  2451. warn$1(
  2452. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  2453. );
  2454. }
  2455. if (once2 !== void 0) {
  2456. warn$1(
  2457. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  2458. );
  2459. }
  2460. }
  2461. const warnInvalidSource = (s2) => {
  2462. warn$1(
  2463. `Invalid watch source: `,
  2464. s2,
  2465. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  2466. );
  2467. };
  2468. const instance = currentInstance;
  2469. const reactiveGetter = (source2) => deep === true ? source2 : (
  2470. // for deep: false, only traverse root-level properties
  2471. traverse(source2, deep === false ? 1 : void 0)
  2472. );
  2473. let getter;
  2474. let forceTrigger = false;
  2475. let isMultiSource = false;
  2476. if (isRef(source)) {
  2477. getter = () => source.value;
  2478. forceTrigger = isShallow(source);
  2479. } else if (isReactive(source)) {
  2480. getter = () => reactiveGetter(source);
  2481. forceTrigger = true;
  2482. } else if (isArray(source)) {
  2483. isMultiSource = true;
  2484. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  2485. getter = () => source.map((s2) => {
  2486. if (isRef(s2)) {
  2487. return s2.value;
  2488. } else if (isReactive(s2)) {
  2489. return reactiveGetter(s2);
  2490. } else if (isFunction(s2)) {
  2491. return callWithErrorHandling(s2, instance, 2);
  2492. } else {
  2493. warnInvalidSource(s2);
  2494. }
  2495. });
  2496. } else if (isFunction(source)) {
  2497. if (cb) {
  2498. getter = () => callWithErrorHandling(source, instance, 2);
  2499. } else {
  2500. getter = () => {
  2501. if (cleanup) {
  2502. cleanup();
  2503. }
  2504. return callWithAsyncErrorHandling(
  2505. source,
  2506. instance,
  2507. 3,
  2508. [onCleanup]
  2509. );
  2510. };
  2511. }
  2512. } else {
  2513. getter = NOOP;
  2514. warnInvalidSource(source);
  2515. }
  2516. if (cb && deep) {
  2517. const baseGetter = getter;
  2518. getter = () => traverse(baseGetter());
  2519. }
  2520. let cleanup;
  2521. let onCleanup = (fn) => {
  2522. cleanup = effect2.onStop = () => {
  2523. callWithErrorHandling(fn, instance, 4);
  2524. cleanup = effect2.onStop = void 0;
  2525. };
  2526. };
  2527. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2528. const job = () => {
  2529. if (!effect2.active || !effect2.dirty) {
  2530. return;
  2531. }
  2532. if (cb) {
  2533. const newValue = effect2.run();
  2534. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  2535. if (cleanup) {
  2536. cleanup();
  2537. }
  2538. callWithAsyncErrorHandling(cb, instance, 3, [
  2539. newValue,
  2540. // pass undefined as the old value when it's changed for the first time
  2541. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2542. onCleanup
  2543. ]);
  2544. oldValue = newValue;
  2545. }
  2546. } else {
  2547. effect2.run();
  2548. }
  2549. };
  2550. job.allowRecurse = !!cb;
  2551. let scheduler;
  2552. if (flush === "sync") {
  2553. scheduler = job;
  2554. } else if (flush === "post") {
  2555. scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  2556. } else {
  2557. job.pre = true;
  2558. if (instance)
  2559. job.id = instance.uid;
  2560. scheduler = () => queueJob(job);
  2561. }
  2562. const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  2563. const scope = getCurrentScope();
  2564. const unwatch = () => {
  2565. effect2.stop();
  2566. if (scope) {
  2567. remove(scope.effects, effect2);
  2568. }
  2569. };
  2570. {
  2571. effect2.onTrack = onTrack;
  2572. effect2.onTrigger = onTrigger;
  2573. }
  2574. if (cb) {
  2575. if (immediate) {
  2576. job();
  2577. } else {
  2578. oldValue = effect2.run();
  2579. }
  2580. } else if (flush === "post") {
  2581. queuePostRenderEffect$1(
  2582. effect2.run.bind(effect2),
  2583. instance && instance.suspense
  2584. );
  2585. } else {
  2586. effect2.run();
  2587. }
  2588. return unwatch;
  2589. }
  2590. function instanceWatch(source, value, options) {
  2591. const publicThis = this.proxy;
  2592. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  2593. let cb;
  2594. if (isFunction(value)) {
  2595. cb = value;
  2596. } else {
  2597. cb = value.handler;
  2598. options = value;
  2599. }
  2600. const reset = setCurrentInstance(this);
  2601. const res2 = doWatch(getter, cb.bind(publicThis), options);
  2602. reset();
  2603. return res2;
  2604. }
  2605. function createPathGetter(ctx, path) {
  2606. const segments = path.split(".");
  2607. return () => {
  2608. let cur = ctx;
  2609. for (let i = 0; i < segments.length && cur; i++) {
  2610. cur = cur[segments[i]];
  2611. }
  2612. return cur;
  2613. };
  2614. }
  2615. function traverse(value, depth, currentDepth = 0, seen) {
  2616. if (!isObject$2(value) || value["__v_skip"]) {
  2617. return value;
  2618. }
  2619. if (depth && depth > 0) {
  2620. if (currentDepth >= depth) {
  2621. return value;
  2622. }
  2623. currentDepth++;
  2624. }
  2625. seen = seen || /* @__PURE__ */ new Set();
  2626. if (seen.has(value)) {
  2627. return value;
  2628. }
  2629. seen.add(value);
  2630. if (isRef(value)) {
  2631. traverse(value.value, depth, currentDepth, seen);
  2632. } else if (isArray(value)) {
  2633. for (let i = 0; i < value.length; i++) {
  2634. traverse(value[i], depth, currentDepth, seen);
  2635. }
  2636. } else if (isSet(value) || isMap(value)) {
  2637. value.forEach((v) => {
  2638. traverse(v, depth, currentDepth, seen);
  2639. });
  2640. } else if (isPlainObject(value)) {
  2641. for (const key in value) {
  2642. traverse(value[key], depth, currentDepth, seen);
  2643. }
  2644. }
  2645. return value;
  2646. }
  2647. function validateDirectiveName(name) {
  2648. if (isBuiltInDirective(name)) {
  2649. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2650. }
  2651. }
  2652. function createAppContext() {
  2653. return {
  2654. app: null,
  2655. config: {
  2656. isNativeTag: NO,
  2657. performance: false,
  2658. globalProperties: {},
  2659. optionMergeStrategies: {},
  2660. errorHandler: void 0,
  2661. warnHandler: void 0,
  2662. compilerOptions: {}
  2663. },
  2664. mixins: [],
  2665. components: {},
  2666. directives: {},
  2667. provides: /* @__PURE__ */ Object.create(null),
  2668. optionsCache: /* @__PURE__ */ new WeakMap(),
  2669. propsCache: /* @__PURE__ */ new WeakMap(),
  2670. emitsCache: /* @__PURE__ */ new WeakMap()
  2671. };
  2672. }
  2673. let uid$1 = 0;
  2674. function createAppAPI(render, hydrate) {
  2675. return function createApp2(rootComponent, rootProps = null) {
  2676. if (!isFunction(rootComponent)) {
  2677. rootComponent = extend({}, rootComponent);
  2678. }
  2679. if (rootProps != null && !isObject$2(rootProps)) {
  2680. warn$1(`root props passed to app.mount() must be an object.`);
  2681. rootProps = null;
  2682. }
  2683. const context = createAppContext();
  2684. const installedPlugins = /* @__PURE__ */ new WeakSet();
  2685. const app = context.app = {
  2686. _uid: uid$1++,
  2687. _component: rootComponent,
  2688. _props: rootProps,
  2689. _container: null,
  2690. _context: context,
  2691. _instance: null,
  2692. version,
  2693. get config() {
  2694. return context.config;
  2695. },
  2696. set config(v) {
  2697. {
  2698. warn$1(
  2699. `app.config cannot be replaced. Modify individual options instead.`
  2700. );
  2701. }
  2702. },
  2703. use(plugin2, ...options) {
  2704. if (installedPlugins.has(plugin2)) {
  2705. warn$1(`Plugin has already been applied to target app.`);
  2706. } else if (plugin2 && isFunction(plugin2.install)) {
  2707. installedPlugins.add(plugin2);
  2708. plugin2.install(app, ...options);
  2709. } else if (isFunction(plugin2)) {
  2710. installedPlugins.add(plugin2);
  2711. plugin2(app, ...options);
  2712. } else {
  2713. warn$1(
  2714. `A plugin must either be a function or an object with an "install" function.`
  2715. );
  2716. }
  2717. return app;
  2718. },
  2719. mixin(mixin) {
  2720. {
  2721. if (!context.mixins.includes(mixin)) {
  2722. context.mixins.push(mixin);
  2723. } else {
  2724. warn$1(
  2725. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  2726. );
  2727. }
  2728. }
  2729. return app;
  2730. },
  2731. component(name, component) {
  2732. {
  2733. validateComponentName(name, context.config);
  2734. }
  2735. if (!component) {
  2736. return context.components[name];
  2737. }
  2738. if (context.components[name]) {
  2739. warn$1(`Component "${name}" has already been registered in target app.`);
  2740. }
  2741. context.components[name] = component;
  2742. return app;
  2743. },
  2744. directive(name, directive) {
  2745. {
  2746. validateDirectiveName(name);
  2747. }
  2748. if (!directive) {
  2749. return context.directives[name];
  2750. }
  2751. if (context.directives[name]) {
  2752. warn$1(`Directive "${name}" has already been registered in target app.`);
  2753. }
  2754. context.directives[name] = directive;
  2755. return app;
  2756. },
  2757. // fixed by xxxxxx
  2758. mount() {
  2759. },
  2760. // fixed by xxxxxx
  2761. unmount() {
  2762. },
  2763. provide(key, value) {
  2764. if (key in context.provides) {
  2765. warn$1(
  2766. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  2767. );
  2768. }
  2769. context.provides[key] = value;
  2770. return app;
  2771. },
  2772. runWithContext(fn) {
  2773. const lastApp = currentApp;
  2774. currentApp = app;
  2775. try {
  2776. return fn();
  2777. } finally {
  2778. currentApp = lastApp;
  2779. }
  2780. }
  2781. };
  2782. return app;
  2783. };
  2784. }
  2785. let currentApp = null;
  2786. function provide(key, value) {
  2787. if (!currentInstance) {
  2788. {
  2789. warn$1(`provide() can only be used inside setup().`);
  2790. }
  2791. } else {
  2792. let provides = currentInstance.provides;
  2793. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2794. if (parentProvides === provides) {
  2795. provides = currentInstance.provides = Object.create(parentProvides);
  2796. }
  2797. provides[key] = value;
  2798. if (currentInstance.type.mpType === "app") {
  2799. currentInstance.appContext.app.provide(key, value);
  2800. }
  2801. }
  2802. }
  2803. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2804. const instance = currentInstance || currentRenderingInstance;
  2805. if (instance || currentApp) {
  2806. const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
  2807. if (provides && key in provides) {
  2808. return provides[key];
  2809. } else if (arguments.length > 1) {
  2810. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  2811. } else {
  2812. warn$1(`injection "${String(key)}" not found.`);
  2813. }
  2814. } else {
  2815. warn$1(`inject() can only be used inside setup() or functional components.`);
  2816. }
  2817. }
  2818. /*! #__NO_SIDE_EFFECTS__ */
  2819. // @__NO_SIDE_EFFECTS__
  2820. function defineComponent(options, extraOptions) {
  2821. return isFunction(options) ? (
  2822. // #8326: extend call and options.name access are considered side-effects
  2823. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  2824. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  2825. ) : options;
  2826. }
  2827. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2828. function onActivated(hook, target) {
  2829. registerKeepAliveHook(hook, "a", target);
  2830. }
  2831. function onDeactivated(hook, target) {
  2832. registerKeepAliveHook(hook, "da", target);
  2833. }
  2834. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2835. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2836. let current = target;
  2837. while (current) {
  2838. if (current.isDeactivated) {
  2839. return;
  2840. }
  2841. current = current.parent;
  2842. }
  2843. return hook();
  2844. });
  2845. injectHook(type, wrappedHook, target);
  2846. if (target) {
  2847. let current = target.parent;
  2848. while (current && current.parent) {
  2849. if (isKeepAlive(current.parent.vnode)) {
  2850. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2851. }
  2852. current = current.parent;
  2853. }
  2854. }
  2855. }
  2856. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2857. const injected = injectHook(
  2858. type,
  2859. hook,
  2860. keepAliveRoot,
  2861. true
  2862. /* prepend */
  2863. );
  2864. onUnmounted(() => {
  2865. remove(keepAliveRoot[type], injected);
  2866. }, target);
  2867. }
  2868. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2869. if (target) {
  2870. if (isRootHook(type)) {
  2871. target = target.root;
  2872. }
  2873. const hooks = target[type] || (target[type] = []);
  2874. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2875. if (target.isUnmounted) {
  2876. return;
  2877. }
  2878. pauseTracking();
  2879. const reset = setCurrentInstance(target);
  2880. const res2 = callWithAsyncErrorHandling(hook, target, type, args);
  2881. reset();
  2882. resetTracking();
  2883. return res2;
  2884. });
  2885. if (prepend) {
  2886. hooks.unshift(wrappedHook);
  2887. } else {
  2888. hooks.push(wrappedHook);
  2889. }
  2890. return wrappedHook;
  2891. } else {
  2892. const apiName = toHandlerKey(
  2893. (ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, "")
  2894. );
  2895. warn$1(
  2896. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`
  2897. );
  2898. }
  2899. }
  2900. const createHook = (lifecycle) => (hook, target = currentInstance) => (
  2901. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  2902. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  2903. );
  2904. const onBeforeMount = createHook("bm");
  2905. const onMounted = createHook("m");
  2906. const onBeforeUpdate = createHook("bu");
  2907. const onUpdated = createHook("u");
  2908. const onBeforeUnmount = createHook("bum");
  2909. const onUnmounted = createHook("um");
  2910. const onServerPrefetch = createHook("sp");
  2911. const onRenderTriggered = createHook(
  2912. "rtg"
  2913. );
  2914. const onRenderTracked = createHook(
  2915. "rtc"
  2916. );
  2917. function onErrorCaptured(hook, target = currentInstance) {
  2918. injectHook("ec", hook, target);
  2919. }
  2920. const getPublicInstance = (i) => {
  2921. if (!i)
  2922. return null;
  2923. if (isStatefulComponent(i))
  2924. return getExposeProxy(i) || i.proxy;
  2925. return getPublicInstance(i.parent);
  2926. };
  2927. function getComponentInternalInstance(i) {
  2928. return i;
  2929. }
  2930. const publicPropertiesMap = (
  2931. // Move PURE marker to new line to workaround compiler discarding it
  2932. // due to type annotation
  2933. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  2934. // fixed by xxxxxx
  2935. $: getComponentInternalInstance,
  2936. // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
  2937. // $el: i => i.vnode.el,
  2938. $el: (i) => i.__$el || (i.__$el = {}),
  2939. $data: (i) => i.data,
  2940. $props: (i) => shallowReadonly(i.props),
  2941. $attrs: (i) => shallowReadonly(i.attrs),
  2942. $slots: (i) => shallowReadonly(i.slots),
  2943. $refs: (i) => shallowReadonly(i.refs),
  2944. $parent: (i) => getPublicInstance(i.parent),
  2945. $root: (i) => getPublicInstance(i.root),
  2946. $emit: (i) => i.emit,
  2947. $options: (i) => resolveMergedOptions(i),
  2948. $forceUpdate: (i) => i.f || (i.f = () => {
  2949. i.effect.dirty = true;
  2950. queueJob(i.update);
  2951. }),
  2952. // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
  2953. $watch: (i) => instanceWatch.bind(i)
  2954. })
  2955. );
  2956. const isReservedPrefix = (key) => key === "_" || key === "$";
  2957. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
  2958. const PublicInstanceProxyHandlers = {
  2959. get({ _: instance }, key) {
  2960. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2961. if (key === "__isVue") {
  2962. return true;
  2963. }
  2964. let normalizedProps;
  2965. if (key[0] !== "$") {
  2966. const n2 = accessCache[key];
  2967. if (n2 !== void 0) {
  2968. switch (n2) {
  2969. case 1:
  2970. return setupState[key];
  2971. case 2:
  2972. return data[key];
  2973. case 4:
  2974. return ctx[key];
  2975. case 3:
  2976. return props[key];
  2977. }
  2978. } else if (hasSetupBinding(setupState, key)) {
  2979. accessCache[key] = 1;
  2980. return setupState[key];
  2981. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  2982. accessCache[key] = 2;
  2983. return data[key];
  2984. } else if (
  2985. // only cache other properties when instance has declared (thus stable)
  2986. // props
  2987. (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
  2988. ) {
  2989. accessCache[key] = 3;
  2990. return props[key];
  2991. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  2992. accessCache[key] = 4;
  2993. return ctx[key];
  2994. } else if (shouldCacheAccess) {
  2995. accessCache[key] = 0;
  2996. }
  2997. }
  2998. const publicGetter = publicPropertiesMap[key];
  2999. let cssModule, globalProperties;
  3000. if (publicGetter) {
  3001. if (key === "$attrs") {
  3002. track(instance, "get", key);
  3003. } else if (key === "$slots") {
  3004. track(instance, "get", key);
  3005. }
  3006. return publicGetter(instance);
  3007. } else if (
  3008. // css module (injected by vue-loader)
  3009. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3010. ) {
  3011. return cssModule;
  3012. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  3013. accessCache[key] = 4;
  3014. return ctx[key];
  3015. } else if (
  3016. // global properties
  3017. globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
  3018. ) {
  3019. {
  3020. return globalProperties[key];
  3021. }
  3022. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3023. // to infinite warning loop
  3024. key.indexOf("__v") !== 0)) {
  3025. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
  3026. warn$1(
  3027. `Property ${JSON.stringify(
  3028. key
  3029. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3030. );
  3031. } else if (instance === currentRenderingInstance) {
  3032. warn$1(
  3033. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3034. );
  3035. }
  3036. }
  3037. },
  3038. set({ _: instance }, key, value) {
  3039. const { data, setupState, ctx } = instance;
  3040. if (hasSetupBinding(setupState, key)) {
  3041. setupState[key] = value;
  3042. return true;
  3043. } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
  3044. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3045. return false;
  3046. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  3047. data[key] = value;
  3048. return true;
  3049. } else if (hasOwn$1(instance.props, key)) {
  3050. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3051. return false;
  3052. }
  3053. if (key[0] === "$" && key.slice(1) in instance) {
  3054. warn$1(
  3055. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3056. );
  3057. return false;
  3058. } else {
  3059. if (key in instance.appContext.config.globalProperties) {
  3060. Object.defineProperty(ctx, key, {
  3061. enumerable: true,
  3062. configurable: true,
  3063. value
  3064. });
  3065. } else {
  3066. ctx[key] = value;
  3067. }
  3068. }
  3069. return true;
  3070. },
  3071. has({
  3072. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  3073. }, key) {
  3074. let normalizedProps;
  3075. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
  3076. },
  3077. defineProperty(target, key, descriptor) {
  3078. if (descriptor.get != null) {
  3079. target._.accessCache[key] = 0;
  3080. } else if (hasOwn$1(descriptor, "value")) {
  3081. this.set(target, key, descriptor.value, null);
  3082. }
  3083. return Reflect.defineProperty(target, key, descriptor);
  3084. }
  3085. };
  3086. {
  3087. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3088. warn$1(
  3089. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3090. );
  3091. return Reflect.ownKeys(target);
  3092. };
  3093. }
  3094. function createDevRenderContext(instance) {
  3095. const target = {};
  3096. Object.defineProperty(target, `_`, {
  3097. configurable: true,
  3098. enumerable: false,
  3099. get: () => instance
  3100. });
  3101. Object.keys(publicPropertiesMap).forEach((key) => {
  3102. Object.defineProperty(target, key, {
  3103. configurable: true,
  3104. enumerable: false,
  3105. get: () => publicPropertiesMap[key](instance),
  3106. // intercepted by the proxy so no need for implementation,
  3107. // but needed to prevent set errors
  3108. set: NOOP
  3109. });
  3110. });
  3111. return target;
  3112. }
  3113. function exposePropsOnRenderContext(instance) {
  3114. const {
  3115. ctx,
  3116. propsOptions: [propsOptions]
  3117. } = instance;
  3118. if (propsOptions) {
  3119. Object.keys(propsOptions).forEach((key) => {
  3120. Object.defineProperty(ctx, key, {
  3121. enumerable: true,
  3122. configurable: true,
  3123. get: () => instance.props[key],
  3124. set: NOOP
  3125. });
  3126. });
  3127. }
  3128. }
  3129. function exposeSetupStateOnRenderContext(instance) {
  3130. const { ctx, setupState } = instance;
  3131. Object.keys(toRaw(setupState)).forEach((key) => {
  3132. if (!setupState.__isScriptSetup) {
  3133. if (isReservedPrefix(key[0])) {
  3134. warn$1(
  3135. `setup() return property ${JSON.stringify(
  3136. key
  3137. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3138. );
  3139. return;
  3140. }
  3141. Object.defineProperty(ctx, key, {
  3142. enumerable: true,
  3143. configurable: true,
  3144. get: () => setupState[key],
  3145. set: NOOP
  3146. });
  3147. }
  3148. });
  3149. }
  3150. function normalizePropsOrEmits(props) {
  3151. return isArray(props) ? props.reduce(
  3152. (normalized, p2) => (normalized[p2] = null, normalized),
  3153. {}
  3154. ) : props;
  3155. }
  3156. function createDuplicateChecker() {
  3157. const cache = /* @__PURE__ */ Object.create(null);
  3158. return (type, key) => {
  3159. if (cache[key]) {
  3160. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3161. } else {
  3162. cache[key] = type;
  3163. }
  3164. };
  3165. }
  3166. let shouldCacheAccess = true;
  3167. function applyOptions$1(instance) {
  3168. const options = resolveMergedOptions(instance);
  3169. const publicThis = instance.proxy;
  3170. const ctx = instance.ctx;
  3171. shouldCacheAccess = false;
  3172. if (options.beforeCreate) {
  3173. callHook$1(options.beforeCreate, instance, "bc");
  3174. }
  3175. const {
  3176. // state
  3177. data: dataOptions,
  3178. computed: computedOptions,
  3179. methods,
  3180. watch: watchOptions,
  3181. provide: provideOptions,
  3182. inject: injectOptions,
  3183. // lifecycle
  3184. created,
  3185. beforeMount,
  3186. mounted,
  3187. beforeUpdate,
  3188. updated,
  3189. activated,
  3190. deactivated,
  3191. beforeDestroy,
  3192. beforeUnmount,
  3193. destroyed,
  3194. unmounted,
  3195. render,
  3196. renderTracked,
  3197. renderTriggered,
  3198. errorCaptured,
  3199. serverPrefetch,
  3200. // public API
  3201. expose,
  3202. inheritAttrs,
  3203. // assets
  3204. components,
  3205. directives,
  3206. filters
  3207. } = options;
  3208. const checkDuplicateProperties = createDuplicateChecker();
  3209. {
  3210. const [propsOptions] = instance.propsOptions;
  3211. if (propsOptions) {
  3212. for (const key in propsOptions) {
  3213. checkDuplicateProperties("Props", key);
  3214. }
  3215. }
  3216. }
  3217. function initInjections() {
  3218. if (injectOptions) {
  3219. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3220. }
  3221. }
  3222. {
  3223. initInjections();
  3224. }
  3225. if (methods) {
  3226. for (const key in methods) {
  3227. const methodHandler = methods[key];
  3228. if (isFunction(methodHandler)) {
  3229. {
  3230. Object.defineProperty(ctx, key, {
  3231. value: methodHandler.bind(publicThis),
  3232. configurable: true,
  3233. enumerable: true,
  3234. writable: true
  3235. });
  3236. }
  3237. {
  3238. checkDuplicateProperties("Methods", key);
  3239. }
  3240. } else {
  3241. warn$1(
  3242. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3243. );
  3244. }
  3245. }
  3246. }
  3247. if (dataOptions) {
  3248. if (!isFunction(dataOptions)) {
  3249. warn$1(
  3250. `The data option must be a function. Plain object usage is no longer supported.`
  3251. );
  3252. }
  3253. const data = dataOptions.call(publicThis, publicThis);
  3254. if (isPromise$1(data)) {
  3255. warn$1(
  3256. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3257. );
  3258. }
  3259. if (!isObject$2(data)) {
  3260. warn$1(`data() should return an object.`);
  3261. } else {
  3262. instance.data = reactive(data);
  3263. {
  3264. for (const key in data) {
  3265. checkDuplicateProperties("Data", key);
  3266. if (!isReservedPrefix(key[0])) {
  3267. Object.defineProperty(ctx, key, {
  3268. configurable: true,
  3269. enumerable: true,
  3270. get: () => data[key],
  3271. set: NOOP
  3272. });
  3273. }
  3274. }
  3275. }
  3276. }
  3277. }
  3278. shouldCacheAccess = true;
  3279. if (computedOptions) {
  3280. for (const key in computedOptions) {
  3281. const opt = computedOptions[key];
  3282. const get22 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3283. if (get22 === NOOP) {
  3284. warn$1(`Computed property "${key}" has no getter.`);
  3285. }
  3286. const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3287. warn$1(
  3288. `Write operation failed: computed property "${key}" is readonly.`
  3289. );
  3290. };
  3291. const c2 = computed({
  3292. get: get22,
  3293. set: set2
  3294. });
  3295. Object.defineProperty(ctx, key, {
  3296. enumerable: true,
  3297. configurable: true,
  3298. get: () => c2.value,
  3299. set: (v) => c2.value = v
  3300. });
  3301. {
  3302. checkDuplicateProperties("Computed", key);
  3303. }
  3304. }
  3305. }
  3306. if (watchOptions) {
  3307. for (const key in watchOptions) {
  3308. createWatcher(watchOptions[key], ctx, publicThis, key);
  3309. }
  3310. }
  3311. function initProvides() {
  3312. if (provideOptions) {
  3313. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3314. Reflect.ownKeys(provides).forEach((key) => {
  3315. provide(key, provides[key]);
  3316. });
  3317. }
  3318. }
  3319. {
  3320. initProvides();
  3321. }
  3322. {
  3323. if (created) {
  3324. callHook$1(created, instance, "c");
  3325. }
  3326. }
  3327. function registerLifecycleHook(register2, hook) {
  3328. if (isArray(hook)) {
  3329. hook.forEach((_hook) => register2(_hook.bind(publicThis)));
  3330. } else if (hook) {
  3331. register2(hook.bind(publicThis));
  3332. }
  3333. }
  3334. registerLifecycleHook(onBeforeMount, beforeMount);
  3335. registerLifecycleHook(onMounted, mounted);
  3336. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3337. registerLifecycleHook(onUpdated, updated);
  3338. registerLifecycleHook(onActivated, activated);
  3339. registerLifecycleHook(onDeactivated, deactivated);
  3340. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3341. registerLifecycleHook(onRenderTracked, renderTracked);
  3342. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3343. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3344. registerLifecycleHook(onUnmounted, unmounted);
  3345. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3346. if (isArray(expose)) {
  3347. if (expose.length) {
  3348. const exposed = instance.exposed || (instance.exposed = {});
  3349. expose.forEach((key) => {
  3350. Object.defineProperty(exposed, key, {
  3351. get: () => publicThis[key],
  3352. set: (val) => publicThis[key] = val
  3353. });
  3354. });
  3355. } else if (!instance.exposed) {
  3356. instance.exposed = {};
  3357. }
  3358. }
  3359. if (render && instance.render === NOOP) {
  3360. instance.render = render;
  3361. }
  3362. if (inheritAttrs != null) {
  3363. instance.inheritAttrs = inheritAttrs;
  3364. }
  3365. if (components)
  3366. instance.components = components;
  3367. if (directives)
  3368. instance.directives = directives;
  3369. if (instance.ctx.$onApplyOptions) {
  3370. instance.ctx.$onApplyOptions(options, instance, publicThis);
  3371. }
  3372. }
  3373. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3374. if (isArray(injectOptions)) {
  3375. injectOptions = normalizeInject(injectOptions);
  3376. }
  3377. for (const key in injectOptions) {
  3378. const opt = injectOptions[key];
  3379. let injected;
  3380. if (isObject$2(opt)) {
  3381. if ("default" in opt) {
  3382. injected = inject(
  3383. opt.from || key,
  3384. opt.default,
  3385. true
  3386. );
  3387. } else {
  3388. injected = inject(opt.from || key);
  3389. }
  3390. } else {
  3391. injected = inject(opt);
  3392. }
  3393. if (isRef(injected)) {
  3394. Object.defineProperty(ctx, key, {
  3395. enumerable: true,
  3396. configurable: true,
  3397. get: () => injected.value,
  3398. set: (v) => injected.value = v
  3399. });
  3400. } else {
  3401. ctx[key] = injected;
  3402. }
  3403. {
  3404. checkDuplicateProperties("Inject", key);
  3405. }
  3406. }
  3407. }
  3408. function callHook$1(hook, instance, type) {
  3409. callWithAsyncErrorHandling(
  3410. isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
  3411. instance,
  3412. type
  3413. );
  3414. }
  3415. function createWatcher(raw, ctx, publicThis, key) {
  3416. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3417. if (isString(raw)) {
  3418. const handler = ctx[raw];
  3419. if (isFunction(handler)) {
  3420. watch(getter, handler);
  3421. } else {
  3422. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3423. }
  3424. } else if (isFunction(raw)) {
  3425. watch(getter, raw.bind(publicThis));
  3426. } else if (isObject$2(raw)) {
  3427. if (isArray(raw)) {
  3428. raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
  3429. } else {
  3430. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3431. if (isFunction(handler)) {
  3432. watch(getter, handler, raw);
  3433. } else {
  3434. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3435. }
  3436. }
  3437. } else {
  3438. warn$1(`Invalid watch option: "${key}"`, raw);
  3439. }
  3440. }
  3441. function resolveMergedOptions(instance) {
  3442. const base = instance.type;
  3443. const { mixins, extends: extendsOptions } = base;
  3444. const {
  3445. mixins: globalMixins,
  3446. optionsCache: cache,
  3447. config: { optionMergeStrategies }
  3448. } = instance.appContext;
  3449. const cached = cache.get(base);
  3450. let resolved;
  3451. if (cached) {
  3452. resolved = cached;
  3453. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3454. {
  3455. resolved = base;
  3456. }
  3457. } else {
  3458. resolved = {};
  3459. if (globalMixins.length) {
  3460. globalMixins.forEach(
  3461. (m2) => mergeOptions(resolved, m2, optionMergeStrategies, true)
  3462. );
  3463. }
  3464. mergeOptions(resolved, base, optionMergeStrategies);
  3465. }
  3466. if (isObject$2(base)) {
  3467. cache.set(base, resolved);
  3468. }
  3469. return resolved;
  3470. }
  3471. function mergeOptions(to, from, strats, asMixin = false) {
  3472. const { mixins, extends: extendsOptions } = from;
  3473. if (extendsOptions) {
  3474. mergeOptions(to, extendsOptions, strats, true);
  3475. }
  3476. if (mixins) {
  3477. mixins.forEach(
  3478. (m2) => mergeOptions(to, m2, strats, true)
  3479. );
  3480. }
  3481. for (const key in from) {
  3482. if (asMixin && key === "expose") {
  3483. warn$1(
  3484. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3485. );
  3486. } else {
  3487. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3488. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3489. }
  3490. }
  3491. return to;
  3492. }
  3493. const internalOptionMergeStrats = {
  3494. data: mergeDataFn,
  3495. props: mergeEmitsOrPropsOptions,
  3496. emits: mergeEmitsOrPropsOptions,
  3497. // objects
  3498. methods: mergeObjectOptions,
  3499. computed: mergeObjectOptions,
  3500. // lifecycle
  3501. beforeCreate: mergeAsArray$1,
  3502. created: mergeAsArray$1,
  3503. beforeMount: mergeAsArray$1,
  3504. mounted: mergeAsArray$1,
  3505. beforeUpdate: mergeAsArray$1,
  3506. updated: mergeAsArray$1,
  3507. beforeDestroy: mergeAsArray$1,
  3508. beforeUnmount: mergeAsArray$1,
  3509. destroyed: mergeAsArray$1,
  3510. unmounted: mergeAsArray$1,
  3511. activated: mergeAsArray$1,
  3512. deactivated: mergeAsArray$1,
  3513. errorCaptured: mergeAsArray$1,
  3514. serverPrefetch: mergeAsArray$1,
  3515. // assets
  3516. components: mergeObjectOptions,
  3517. directives: mergeObjectOptions,
  3518. // watch
  3519. watch: mergeWatchOptions,
  3520. // provide / inject
  3521. provide: mergeDataFn,
  3522. inject: mergeInject
  3523. };
  3524. function mergeDataFn(to, from) {
  3525. if (!from) {
  3526. return to;
  3527. }
  3528. if (!to) {
  3529. return from;
  3530. }
  3531. return function mergedDataFn() {
  3532. return extend(
  3533. isFunction(to) ? to.call(this, this) : to,
  3534. isFunction(from) ? from.call(this, this) : from
  3535. );
  3536. };
  3537. }
  3538. function mergeInject(to, from) {
  3539. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3540. }
  3541. function normalizeInject(raw) {
  3542. if (isArray(raw)) {
  3543. const res2 = {};
  3544. for (let i = 0; i < raw.length; i++) {
  3545. res2[raw[i]] = raw[i];
  3546. }
  3547. return res2;
  3548. }
  3549. return raw;
  3550. }
  3551. function mergeAsArray$1(to, from) {
  3552. return to ? [...new Set([].concat(to, from))] : from;
  3553. }
  3554. function mergeObjectOptions(to, from) {
  3555. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3556. }
  3557. function mergeEmitsOrPropsOptions(to, from) {
  3558. if (to) {
  3559. if (isArray(to) && isArray(from)) {
  3560. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3561. }
  3562. return extend(
  3563. /* @__PURE__ */ Object.create(null),
  3564. normalizePropsOrEmits(to),
  3565. normalizePropsOrEmits(from != null ? from : {})
  3566. );
  3567. } else {
  3568. return from;
  3569. }
  3570. }
  3571. function mergeWatchOptions(to, from) {
  3572. if (!to)
  3573. return from;
  3574. if (!from)
  3575. return to;
  3576. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3577. for (const key in from) {
  3578. merged[key] = mergeAsArray$1(to[key], from[key]);
  3579. }
  3580. return merged;
  3581. }
  3582. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  3583. const props = {};
  3584. const attrs = {};
  3585. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3586. setFullProps(instance, rawProps, props, attrs);
  3587. for (const key in instance.propsOptions[0]) {
  3588. if (!(key in props)) {
  3589. props[key] = void 0;
  3590. }
  3591. }
  3592. {
  3593. validateProps(rawProps || {}, props, instance);
  3594. }
  3595. if (isStateful) {
  3596. instance.props = isSSR ? props : shallowReactive(props);
  3597. } else {
  3598. if (!instance.type.props) {
  3599. instance.props = attrs;
  3600. } else {
  3601. instance.props = props;
  3602. }
  3603. }
  3604. instance.attrs = attrs;
  3605. }
  3606. function isInHmrContext(instance) {
  3607. }
  3608. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3609. const {
  3610. props,
  3611. attrs,
  3612. vnode: { patchFlag }
  3613. } = instance;
  3614. const rawCurrentProps = toRaw(props);
  3615. const [options] = instance.propsOptions;
  3616. let hasAttrsChanged = false;
  3617. if (
  3618. // always force full diff in dev
  3619. // - #1942 if hmr is enabled with sfc component
  3620. // - vite#872 non-sfc component used by sfc component
  3621. !isInHmrContext() && (optimized || patchFlag > 0) && !(patchFlag & 16)
  3622. ) {
  3623. if (patchFlag & 8) {
  3624. const propsToUpdate = instance.vnode.dynamicProps;
  3625. for (let i = 0; i < propsToUpdate.length; i++) {
  3626. let key = propsToUpdate[i];
  3627. if (isEmitListener(instance.emitsOptions, key)) {
  3628. continue;
  3629. }
  3630. const value = rawProps[key];
  3631. if (options) {
  3632. if (hasOwn$1(attrs, key)) {
  3633. if (value !== attrs[key]) {
  3634. attrs[key] = value;
  3635. hasAttrsChanged = true;
  3636. }
  3637. } else {
  3638. const camelizedKey = camelize(key);
  3639. props[camelizedKey] = resolvePropValue$1(
  3640. options,
  3641. rawCurrentProps,
  3642. camelizedKey,
  3643. value,
  3644. instance,
  3645. false
  3646. );
  3647. }
  3648. } else {
  3649. if (value !== attrs[key]) {
  3650. attrs[key] = value;
  3651. hasAttrsChanged = true;
  3652. }
  3653. }
  3654. }
  3655. }
  3656. } else {
  3657. if (setFullProps(instance, rawProps, props, attrs)) {
  3658. hasAttrsChanged = true;
  3659. }
  3660. let kebabKey;
  3661. for (const key in rawCurrentProps) {
  3662. if (!rawProps || // for camelCase
  3663. !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3664. // and converted to camelCase (#955)
  3665. ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
  3666. if (options) {
  3667. if (rawPrevProps && // for camelCase
  3668. (rawPrevProps[key] !== void 0 || // for kebab-case
  3669. rawPrevProps[kebabKey] !== void 0)) {
  3670. props[key] = resolvePropValue$1(
  3671. options,
  3672. rawCurrentProps,
  3673. key,
  3674. void 0,
  3675. instance,
  3676. true
  3677. );
  3678. }
  3679. } else {
  3680. delete props[key];
  3681. }
  3682. }
  3683. }
  3684. if (attrs !== rawCurrentProps) {
  3685. for (const key in attrs) {
  3686. if (!rawProps || !hasOwn$1(rawProps, key) && true) {
  3687. delete attrs[key];
  3688. hasAttrsChanged = true;
  3689. }
  3690. }
  3691. }
  3692. }
  3693. if (hasAttrsChanged) {
  3694. trigger(instance, "set", "$attrs");
  3695. }
  3696. {
  3697. validateProps(rawProps || {}, props, instance);
  3698. }
  3699. }
  3700. function setFullProps(instance, rawProps, props, attrs) {
  3701. const [options, needCastKeys] = instance.propsOptions;
  3702. let hasAttrsChanged = false;
  3703. let rawCastValues;
  3704. if (rawProps) {
  3705. for (let key in rawProps) {
  3706. if (isReservedProp(key)) {
  3707. continue;
  3708. }
  3709. const value = rawProps[key];
  3710. let camelKey;
  3711. if (options && hasOwn$1(options, camelKey = camelize(key))) {
  3712. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3713. props[camelKey] = value;
  3714. } else {
  3715. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3716. }
  3717. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3718. if (!(key in attrs) || value !== attrs[key]) {
  3719. attrs[key] = value;
  3720. hasAttrsChanged = true;
  3721. }
  3722. }
  3723. }
  3724. }
  3725. if (needCastKeys) {
  3726. const rawCurrentProps = toRaw(props);
  3727. const castValues = rawCastValues || EMPTY_OBJ;
  3728. for (let i = 0; i < needCastKeys.length; i++) {
  3729. const key = needCastKeys[i];
  3730. props[key] = resolvePropValue$1(
  3731. options,
  3732. rawCurrentProps,
  3733. key,
  3734. castValues[key],
  3735. instance,
  3736. !hasOwn$1(castValues, key)
  3737. );
  3738. }
  3739. }
  3740. return hasAttrsChanged;
  3741. }
  3742. function resolvePropValue$1(options, props, key, value, instance, isAbsent) {
  3743. const opt = options[key];
  3744. if (opt != null) {
  3745. const hasDefault = hasOwn$1(opt, "default");
  3746. if (hasDefault && value === void 0) {
  3747. const defaultValue = opt.default;
  3748. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  3749. const { propsDefaults } = instance;
  3750. if (key in propsDefaults) {
  3751. value = propsDefaults[key];
  3752. } else {
  3753. const reset = setCurrentInstance(instance);
  3754. value = propsDefaults[key] = defaultValue.call(
  3755. null,
  3756. props
  3757. );
  3758. reset();
  3759. }
  3760. } else {
  3761. value = defaultValue;
  3762. }
  3763. }
  3764. if (opt[
  3765. 0
  3766. /* shouldCast */
  3767. ]) {
  3768. if (isAbsent && !hasDefault) {
  3769. value = false;
  3770. } else if (opt[
  3771. 1
  3772. /* shouldCastTrue */
  3773. ] && (value === "" || value === hyphenate(key))) {
  3774. value = true;
  3775. }
  3776. }
  3777. }
  3778. return value;
  3779. }
  3780. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3781. const cache = appContext.propsCache;
  3782. const cached = cache.get(comp);
  3783. if (cached) {
  3784. return cached;
  3785. }
  3786. const raw = comp.props;
  3787. const normalized = {};
  3788. const needCastKeys = [];
  3789. let hasExtends = false;
  3790. if (!isFunction(comp)) {
  3791. const extendProps = (raw2) => {
  3792. hasExtends = true;
  3793. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3794. extend(normalized, props);
  3795. if (keys)
  3796. needCastKeys.push(...keys);
  3797. };
  3798. if (!asMixin && appContext.mixins.length) {
  3799. appContext.mixins.forEach(extendProps);
  3800. }
  3801. if (comp.extends) {
  3802. extendProps(comp.extends);
  3803. }
  3804. if (comp.mixins) {
  3805. comp.mixins.forEach(extendProps);
  3806. }
  3807. }
  3808. if (!raw && !hasExtends) {
  3809. if (isObject$2(comp)) {
  3810. cache.set(comp, EMPTY_ARR);
  3811. }
  3812. return EMPTY_ARR;
  3813. }
  3814. if (isArray(raw)) {
  3815. for (let i = 0; i < raw.length; i++) {
  3816. if (!isString(raw[i])) {
  3817. warn$1(`props must be strings when using array syntax.`, raw[i]);
  3818. }
  3819. const normalizedKey = camelize(raw[i]);
  3820. if (validatePropName(normalizedKey)) {
  3821. normalized[normalizedKey] = EMPTY_OBJ;
  3822. }
  3823. }
  3824. } else if (raw) {
  3825. if (!isObject$2(raw)) {
  3826. warn$1(`invalid props options`, raw);
  3827. }
  3828. for (const key in raw) {
  3829. const normalizedKey = camelize(key);
  3830. if (validatePropName(normalizedKey)) {
  3831. const opt = raw[key];
  3832. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  3833. if (prop) {
  3834. const booleanIndex = getTypeIndex(Boolean, prop.type);
  3835. const stringIndex = getTypeIndex(String, prop.type);
  3836. prop[
  3837. 0
  3838. /* shouldCast */
  3839. ] = booleanIndex > -1;
  3840. prop[
  3841. 1
  3842. /* shouldCastTrue */
  3843. ] = stringIndex < 0 || booleanIndex < stringIndex;
  3844. if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
  3845. needCastKeys.push(normalizedKey);
  3846. }
  3847. }
  3848. }
  3849. }
  3850. }
  3851. const res2 = [normalized, needCastKeys];
  3852. if (isObject$2(comp)) {
  3853. cache.set(comp, res2);
  3854. }
  3855. return res2;
  3856. }
  3857. function validatePropName(key) {
  3858. if (key[0] !== "$" && !isReservedProp(key)) {
  3859. return true;
  3860. } else {
  3861. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  3862. }
  3863. return false;
  3864. }
  3865. function getType$1(ctor) {
  3866. if (ctor === null) {
  3867. return "null";
  3868. }
  3869. if (typeof ctor === "function") {
  3870. return ctor.name || "";
  3871. } else if (typeof ctor === "object") {
  3872. const name = ctor.constructor && ctor.constructor.name;
  3873. return name || "";
  3874. }
  3875. return "";
  3876. }
  3877. function isSameType(a, b) {
  3878. return getType$1(a) === getType$1(b);
  3879. }
  3880. function getTypeIndex(type, expectedTypes) {
  3881. if (isArray(expectedTypes)) {
  3882. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  3883. } else if (isFunction(expectedTypes)) {
  3884. return isSameType(expectedTypes, type) ? 0 : -1;
  3885. }
  3886. return -1;
  3887. }
  3888. function validateProps(rawProps, props, instance) {
  3889. const resolvedValues = toRaw(props);
  3890. const options = instance.propsOptions[0];
  3891. for (const key in options) {
  3892. let opt = options[key];
  3893. if (opt == null)
  3894. continue;
  3895. validateProp$1(
  3896. key,
  3897. resolvedValues[key],
  3898. opt,
  3899. shallowReadonly(resolvedValues),
  3900. !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key))
  3901. );
  3902. }
  3903. }
  3904. function validateProp$1(name, value, prop, props, isAbsent) {
  3905. const { type, required, validator, skipCheck } = prop;
  3906. if (required && isAbsent) {
  3907. warn$1('Missing required prop: "' + name + '"');
  3908. return;
  3909. }
  3910. if (value == null && !required) {
  3911. return;
  3912. }
  3913. if (type != null && type !== true && !skipCheck) {
  3914. let isValid = false;
  3915. const types = isArray(type) ? type : [type];
  3916. const expectedTypes = [];
  3917. for (let i = 0; i < types.length && !isValid; i++) {
  3918. const { valid, expectedType } = assertType$1(value, types[i]);
  3919. expectedTypes.push(expectedType || "");
  3920. isValid = valid;
  3921. }
  3922. if (!isValid) {
  3923. warn$1(getInvalidTypeMessage$1(name, value, expectedTypes));
  3924. return;
  3925. }
  3926. }
  3927. if (validator && !validator(value, props)) {
  3928. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  3929. }
  3930. }
  3931. const isSimpleType$1 = /* @__PURE__ */ makeMap(
  3932. "String,Number,Boolean,Function,Symbol,BigInt"
  3933. );
  3934. function assertType$1(value, type) {
  3935. let valid;
  3936. const expectedType = getType$1(type);
  3937. if (isSimpleType$1(expectedType)) {
  3938. const t2 = typeof value;
  3939. valid = t2 === expectedType.toLowerCase();
  3940. if (!valid && t2 === "object") {
  3941. valid = value instanceof type;
  3942. }
  3943. } else if (expectedType === "Object") {
  3944. valid = isObject$2(value);
  3945. } else if (expectedType === "Array") {
  3946. valid = isArray(value);
  3947. } else if (expectedType === "null") {
  3948. valid = value === null;
  3949. } else {
  3950. valid = value instanceof type;
  3951. }
  3952. return {
  3953. valid,
  3954. expectedType
  3955. };
  3956. }
  3957. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  3958. if (expectedTypes.length === 0) {
  3959. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  3960. }
  3961. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  3962. const expectedType = expectedTypes[0];
  3963. const receivedType = toRawType(value);
  3964. const expectedValue = styleValue$1(value, expectedType);
  3965. const receivedValue = styleValue$1(value, receivedType);
  3966. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  3967. message += ` with value ${expectedValue}`;
  3968. }
  3969. message += `, got ${receivedType} `;
  3970. if (isExplicable$1(receivedType)) {
  3971. message += `with value ${receivedValue}.`;
  3972. }
  3973. return message;
  3974. }
  3975. function styleValue$1(value, type) {
  3976. if (type === "String") {
  3977. return `"${value}"`;
  3978. } else if (type === "Number") {
  3979. return `${Number(value)}`;
  3980. } else {
  3981. return `${value}`;
  3982. }
  3983. }
  3984. function isExplicable$1(type) {
  3985. const explicitTypes = ["string", "number", "boolean"];
  3986. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  3987. }
  3988. function isBoolean$1(...args) {
  3989. return args.some((elem) => elem.toLowerCase() === "boolean");
  3990. }
  3991. let supported;
  3992. let perf;
  3993. function startMeasure(instance, type) {
  3994. if (instance.appContext.config.performance && isSupported()) {
  3995. perf.mark(`vue-${type}-${instance.uid}`);
  3996. }
  3997. {
  3998. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  3999. }
  4000. }
  4001. function endMeasure(instance, type) {
  4002. if (instance.appContext.config.performance && isSupported()) {
  4003. const startTag = `vue-${type}-${instance.uid}`;
  4004. const endTag = startTag + `:end`;
  4005. perf.mark(endTag);
  4006. perf.measure(
  4007. `<${formatComponentName(instance, instance.type)}> ${type}`,
  4008. startTag,
  4009. endTag
  4010. );
  4011. perf.clearMarks(startTag);
  4012. perf.clearMarks(endTag);
  4013. }
  4014. {
  4015. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  4016. }
  4017. }
  4018. function isSupported() {
  4019. if (supported !== void 0) {
  4020. return supported;
  4021. }
  4022. if (typeof window !== "undefined" && window.performance) {
  4023. supported = true;
  4024. perf = window.performance;
  4025. } else {
  4026. supported = false;
  4027. }
  4028. return supported;
  4029. }
  4030. const queuePostRenderEffect$1 = queuePostFlushCb;
  4031. const Fragment = Symbol.for("v-fgt");
  4032. const Text = Symbol.for("v-txt");
  4033. const Comment = Symbol.for("v-cmt");
  4034. const Static = Symbol.for("v-stc");
  4035. function isVNode(value) {
  4036. return value ? value.__v_isVNode === true : false;
  4037. }
  4038. const InternalObjectKey = `__vInternal`;
  4039. function guardReactiveProps(props) {
  4040. if (!props)
  4041. return null;
  4042. return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
  4043. }
  4044. const emptyAppContext = createAppContext();
  4045. let uid = 0;
  4046. function createComponentInstance(vnode, parent, suspense) {
  4047. const type = vnode.type;
  4048. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  4049. const instance = {
  4050. uid: uid++,
  4051. vnode,
  4052. type,
  4053. parent,
  4054. appContext,
  4055. root: null,
  4056. // to be immediately set
  4057. next: null,
  4058. subTree: null,
  4059. // will be set synchronously right after creation
  4060. effect: null,
  4061. update: null,
  4062. // will be set synchronously right after creation
  4063. scope: new EffectScope(
  4064. true
  4065. /* detached */
  4066. ),
  4067. render: null,
  4068. proxy: null,
  4069. exposed: null,
  4070. exposeProxy: null,
  4071. withProxy: null,
  4072. provides: parent ? parent.provides : Object.create(appContext.provides),
  4073. accessCache: null,
  4074. renderCache: [],
  4075. // local resolved assets
  4076. components: null,
  4077. directives: null,
  4078. // resolved props and emits options
  4079. propsOptions: normalizePropsOptions(type, appContext),
  4080. emitsOptions: normalizeEmitsOptions(type, appContext),
  4081. // emit
  4082. emit: null,
  4083. // to be set immediately
  4084. emitted: null,
  4085. // props default value
  4086. propsDefaults: EMPTY_OBJ,
  4087. // inheritAttrs
  4088. inheritAttrs: type.inheritAttrs,
  4089. // state
  4090. ctx: EMPTY_OBJ,
  4091. data: EMPTY_OBJ,
  4092. props: EMPTY_OBJ,
  4093. attrs: EMPTY_OBJ,
  4094. slots: EMPTY_OBJ,
  4095. refs: EMPTY_OBJ,
  4096. setupState: EMPTY_OBJ,
  4097. setupContext: null,
  4098. attrsProxy: null,
  4099. slotsProxy: null,
  4100. // suspense related
  4101. suspense,
  4102. suspenseId: suspense ? suspense.pendingId : 0,
  4103. asyncDep: null,
  4104. asyncResolved: false,
  4105. // lifecycle hooks
  4106. // not using enums here because it results in computed properties
  4107. isMounted: false,
  4108. isUnmounted: false,
  4109. isDeactivated: false,
  4110. bc: null,
  4111. c: null,
  4112. bm: null,
  4113. m: null,
  4114. bu: null,
  4115. u: null,
  4116. um: null,
  4117. bum: null,
  4118. da: null,
  4119. a: null,
  4120. rtg: null,
  4121. rtc: null,
  4122. ec: null,
  4123. sp: null,
  4124. // fixed by xxxxxx 用于存储uni-app的元素缓存
  4125. $uniElements: /* @__PURE__ */ new Map(),
  4126. $templateUniElementRefs: [],
  4127. $templateUniElementStyles: {},
  4128. $eS: {},
  4129. $eA: {}
  4130. };
  4131. {
  4132. instance.ctx = createDevRenderContext(instance);
  4133. }
  4134. instance.root = parent ? parent.root : instance;
  4135. instance.emit = emit.bind(null, instance);
  4136. if (vnode.ce) {
  4137. vnode.ce(instance);
  4138. }
  4139. return instance;
  4140. }
  4141. let currentInstance = null;
  4142. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  4143. let internalSetCurrentInstance;
  4144. let setInSSRSetupState;
  4145. {
  4146. internalSetCurrentInstance = (i) => {
  4147. currentInstance = i;
  4148. };
  4149. setInSSRSetupState = (v) => {
  4150. isInSSRComponentSetup = v;
  4151. };
  4152. }
  4153. const setCurrentInstance = (instance) => {
  4154. const prev = currentInstance;
  4155. internalSetCurrentInstance(instance);
  4156. instance.scope.on();
  4157. return () => {
  4158. instance.scope.off();
  4159. internalSetCurrentInstance(prev);
  4160. };
  4161. };
  4162. const unsetCurrentInstance = () => {
  4163. currentInstance && currentInstance.scope.off();
  4164. internalSetCurrentInstance(null);
  4165. };
  4166. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  4167. function validateComponentName(name, { isNativeTag }) {
  4168. if (isBuiltInTag(name) || isNativeTag(name)) {
  4169. warn$1(
  4170. "Do not use built-in or reserved HTML elements as component id: " + name
  4171. );
  4172. }
  4173. }
  4174. function isStatefulComponent(instance) {
  4175. return instance.vnode.shapeFlag & 4;
  4176. }
  4177. let isInSSRComponentSetup = false;
  4178. function setupComponent(instance, isSSR = false) {
  4179. isSSR && setInSSRSetupState(isSSR);
  4180. const {
  4181. props
  4182. /*, children*/
  4183. } = instance.vnode;
  4184. const isStateful = isStatefulComponent(instance);
  4185. initProps$1(instance, props, isStateful, isSSR);
  4186. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  4187. isSSR && setInSSRSetupState(false);
  4188. return setupResult;
  4189. }
  4190. function setupStatefulComponent(instance, isSSR) {
  4191. const Component2 = instance.type;
  4192. {
  4193. if (Component2.name) {
  4194. validateComponentName(Component2.name, instance.appContext.config);
  4195. }
  4196. if (Component2.components) {
  4197. const names = Object.keys(Component2.components);
  4198. for (let i = 0; i < names.length; i++) {
  4199. validateComponentName(names[i], instance.appContext.config);
  4200. }
  4201. }
  4202. if (Component2.directives) {
  4203. const names = Object.keys(Component2.directives);
  4204. for (let i = 0; i < names.length; i++) {
  4205. validateDirectiveName(names[i]);
  4206. }
  4207. }
  4208. if (Component2.compilerOptions && isRuntimeOnly()) {
  4209. warn$1(
  4210. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  4211. );
  4212. }
  4213. }
  4214. instance.accessCache = /* @__PURE__ */ Object.create(null);
  4215. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  4216. {
  4217. exposePropsOnRenderContext(instance);
  4218. }
  4219. const { setup } = Component2;
  4220. if (setup) {
  4221. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  4222. const reset = setCurrentInstance(instance);
  4223. pauseTracking();
  4224. const setupResult = callWithErrorHandling(
  4225. setup,
  4226. instance,
  4227. 0,
  4228. [
  4229. shallowReadonly(instance.props),
  4230. setupContext
  4231. ]
  4232. );
  4233. resetTracking();
  4234. reset();
  4235. if (isPromise$1(setupResult)) {
  4236. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  4237. {
  4238. warn$1(
  4239. `setup() returned a Promise, but the version of Vue you are using does not support it yet.`
  4240. );
  4241. }
  4242. } else {
  4243. handleSetupResult(instance, setupResult, isSSR);
  4244. }
  4245. } else {
  4246. finishComponentSetup(instance, isSSR);
  4247. }
  4248. }
  4249. function handleSetupResult(instance, setupResult, isSSR) {
  4250. if (isFunction(setupResult)) {
  4251. {
  4252. instance.render = setupResult;
  4253. }
  4254. } else if (isObject$2(setupResult)) {
  4255. if (isVNode(setupResult)) {
  4256. warn$1(
  4257. `setup() should not return VNodes directly - return a render function instead.`
  4258. );
  4259. }
  4260. {
  4261. instance.devtoolsRawSetupState = setupResult;
  4262. }
  4263. instance.setupState = proxyRefs(setupResult);
  4264. {
  4265. exposeSetupStateOnRenderContext(instance);
  4266. }
  4267. } else if (setupResult !== void 0) {
  4268. warn$1(
  4269. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  4270. );
  4271. }
  4272. finishComponentSetup(instance, isSSR);
  4273. }
  4274. let compile;
  4275. const isRuntimeOnly = () => !compile;
  4276. function finishComponentSetup(instance, isSSR, skipOptions) {
  4277. const Component2 = instance.type;
  4278. if (!instance.render) {
  4279. instance.render = Component2.render || NOOP;
  4280. }
  4281. {
  4282. const reset = setCurrentInstance(instance);
  4283. pauseTracking();
  4284. try {
  4285. applyOptions$1(instance);
  4286. } finally {
  4287. resetTracking();
  4288. reset();
  4289. }
  4290. }
  4291. if (!Component2.render && instance.render === NOOP && !isSSR) {
  4292. if (Component2.template) {
  4293. warn$1(
  4294. `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  4295. );
  4296. } else {
  4297. warn$1(`Component is missing template or render function.`);
  4298. }
  4299. }
  4300. }
  4301. function getAttrsProxy(instance) {
  4302. return instance.attrsProxy || (instance.attrsProxy = new Proxy(
  4303. instance.attrs,
  4304. {
  4305. get(target, key) {
  4306. track(instance, "get", "$attrs");
  4307. return target[key];
  4308. },
  4309. set() {
  4310. warn$1(`setupContext.attrs is readonly.`);
  4311. return false;
  4312. },
  4313. deleteProperty() {
  4314. warn$1(`setupContext.attrs is readonly.`);
  4315. return false;
  4316. }
  4317. }
  4318. ));
  4319. }
  4320. function getSlotsProxy(instance) {
  4321. return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
  4322. get(target, key) {
  4323. track(instance, "get", "$slots");
  4324. return target[key];
  4325. }
  4326. }));
  4327. }
  4328. function createSetupContext(instance) {
  4329. const expose = (exposed) => {
  4330. {
  4331. if (instance.exposed) {
  4332. warn$1(`expose() should be called only once per setup().`);
  4333. }
  4334. if (exposed != null) {
  4335. let exposedType = typeof exposed;
  4336. if (exposedType === "object") {
  4337. if (isArray(exposed)) {
  4338. exposedType = "array";
  4339. } else if (isRef(exposed)) {
  4340. exposedType = "ref";
  4341. }
  4342. }
  4343. if (exposedType !== "object") {
  4344. warn$1(
  4345. `expose() should be passed a plain object, received ${exposedType}.`
  4346. );
  4347. }
  4348. }
  4349. }
  4350. instance.exposed = exposed || {};
  4351. };
  4352. {
  4353. return Object.freeze({
  4354. get attrs() {
  4355. return getAttrsProxy(instance);
  4356. },
  4357. get slots() {
  4358. return getSlotsProxy(instance);
  4359. },
  4360. get emit() {
  4361. return (event, ...args) => instance.emit(event, ...args);
  4362. },
  4363. expose
  4364. });
  4365. }
  4366. }
  4367. function getExposeProxy(instance) {
  4368. if (instance.exposed) {
  4369. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  4370. get(target, key) {
  4371. if (key in target) {
  4372. return target[key];
  4373. }
  4374. return instance.proxy[key];
  4375. },
  4376. has(target, key) {
  4377. return key in target || key in publicPropertiesMap;
  4378. }
  4379. }));
  4380. }
  4381. }
  4382. const classifyRE = /(?:^|[-_])(\w)/g;
  4383. const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
  4384. function getComponentName(Component2, includeInferred = true) {
  4385. return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  4386. }
  4387. function formatComponentName(instance, Component2, isRoot = false) {
  4388. let name = getComponentName(Component2);
  4389. if (!name && Component2.__file) {
  4390. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  4391. if (match) {
  4392. name = match[1];
  4393. }
  4394. }
  4395. if (!name && instance && instance.parent) {
  4396. const inferFromRegistry = (registry) => {
  4397. for (const key in registry) {
  4398. if (registry[key] === Component2) {
  4399. return key;
  4400. }
  4401. }
  4402. };
  4403. name = inferFromRegistry(
  4404. instance.components || instance.parent.type.components
  4405. ) || inferFromRegistry(instance.appContext.components);
  4406. }
  4407. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  4408. }
  4409. const computed = (getterOrOptions, debugOptions) => {
  4410. const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  4411. {
  4412. const i = getCurrentInstance();
  4413. if (i && i.appContext.config.warnRecursiveComputed) {
  4414. c2._warnRecursive = true;
  4415. }
  4416. }
  4417. return c2;
  4418. };
  4419. const version = "3.4.21";
  4420. const warn = warn$1;
  4421. function unwrapper(target) {
  4422. return unref(target);
  4423. }
  4424. const ARRAYTYPE = "[object Array]";
  4425. const OBJECTTYPE = "[object Object]";
  4426. function diff(current, pre) {
  4427. const result = {};
  4428. syncKeys(current, pre);
  4429. _diff(current, pre, "", result);
  4430. return result;
  4431. }
  4432. function syncKeys(current, pre) {
  4433. current = unwrapper(current);
  4434. if (current === pre)
  4435. return;
  4436. const rootCurrentType = toTypeString(current);
  4437. const rootPreType = toTypeString(pre);
  4438. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  4439. for (let key in pre) {
  4440. const currentValue = current[key];
  4441. if (currentValue === void 0) {
  4442. current[key] = null;
  4443. } else {
  4444. syncKeys(currentValue, pre[key]);
  4445. }
  4446. }
  4447. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  4448. if (current.length >= pre.length) {
  4449. pre.forEach((item, index2) => {
  4450. syncKeys(current[index2], item);
  4451. });
  4452. }
  4453. }
  4454. }
  4455. function _diff(current, pre, path, result) {
  4456. current = unwrapper(current);
  4457. if (current === pre)
  4458. return;
  4459. const rootCurrentType = toTypeString(current);
  4460. const rootPreType = toTypeString(pre);
  4461. if (rootCurrentType == OBJECTTYPE) {
  4462. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  4463. setResult(result, path, current);
  4464. } else {
  4465. for (let key in current) {
  4466. const currentValue = unwrapper(current[key]);
  4467. const preValue = pre[key];
  4468. const currentType = toTypeString(currentValue);
  4469. const preType = toTypeString(preValue);
  4470. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  4471. if (currentValue != preValue) {
  4472. setResult(
  4473. result,
  4474. (path == "" ? "" : path + ".") + key,
  4475. currentValue
  4476. );
  4477. }
  4478. } else if (currentType == ARRAYTYPE) {
  4479. if (preType != ARRAYTYPE) {
  4480. setResult(
  4481. result,
  4482. (path == "" ? "" : path + ".") + key,
  4483. currentValue
  4484. );
  4485. } else {
  4486. if (currentValue.length < preValue.length) {
  4487. setResult(
  4488. result,
  4489. (path == "" ? "" : path + ".") + key,
  4490. currentValue
  4491. );
  4492. } else {
  4493. currentValue.forEach((item, index2) => {
  4494. _diff(
  4495. item,
  4496. preValue[index2],
  4497. (path == "" ? "" : path + ".") + key + "[" + index2 + "]",
  4498. result
  4499. );
  4500. });
  4501. }
  4502. }
  4503. } else if (currentType == OBJECTTYPE) {
  4504. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  4505. setResult(
  4506. result,
  4507. (path == "" ? "" : path + ".") + key,
  4508. currentValue
  4509. );
  4510. } else {
  4511. for (let subKey in currentValue) {
  4512. _diff(
  4513. currentValue[subKey],
  4514. preValue[subKey],
  4515. (path == "" ? "" : path + ".") + key + "." + subKey,
  4516. result
  4517. );
  4518. }
  4519. }
  4520. }
  4521. }
  4522. }
  4523. } else if (rootCurrentType == ARRAYTYPE) {
  4524. if (rootPreType != ARRAYTYPE) {
  4525. setResult(result, path, current);
  4526. } else {
  4527. if (current.length < pre.length) {
  4528. setResult(result, path, current);
  4529. } else {
  4530. current.forEach((item, index2) => {
  4531. _diff(item, pre[index2], path + "[" + index2 + "]", result);
  4532. });
  4533. }
  4534. }
  4535. } else {
  4536. setResult(result, path, current);
  4537. }
  4538. }
  4539. function setResult(result, k, v) {
  4540. result[k] = v;
  4541. }
  4542. function hasComponentEffect(instance) {
  4543. return queue$1.includes(instance.update);
  4544. }
  4545. function flushCallbacks(instance) {
  4546. const ctx = instance.ctx;
  4547. const callbacks = ctx.__next_tick_callbacks;
  4548. if (callbacks && callbacks.length) {
  4549. const copies = callbacks.slice(0);
  4550. callbacks.length = 0;
  4551. for (let i = 0; i < copies.length; i++) {
  4552. copies[i]();
  4553. }
  4554. }
  4555. }
  4556. function nextTick(instance, fn) {
  4557. const ctx = instance.ctx;
  4558. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  4559. return nextTick$1(fn && fn.bind(instance.proxy));
  4560. }
  4561. let _resolve;
  4562. if (!ctx.__next_tick_callbacks) {
  4563. ctx.__next_tick_callbacks = [];
  4564. }
  4565. ctx.__next_tick_callbacks.push(() => {
  4566. if (fn) {
  4567. callWithErrorHandling(
  4568. fn.bind(instance.proxy),
  4569. instance,
  4570. 14
  4571. );
  4572. } else if (_resolve) {
  4573. _resolve(instance.proxy);
  4574. }
  4575. });
  4576. return new Promise((resolve2) => {
  4577. _resolve = resolve2;
  4578. });
  4579. }
  4580. function clone(src, seen) {
  4581. src = unwrapper(src);
  4582. const type = typeof src;
  4583. if (type === "object" && src !== null) {
  4584. let copy = seen.get(src);
  4585. if (typeof copy !== "undefined") {
  4586. return copy;
  4587. }
  4588. if (isArray(src)) {
  4589. const len = src.length;
  4590. copy = new Array(len);
  4591. seen.set(src, copy);
  4592. for (let i = 0; i < len; i++) {
  4593. copy[i] = clone(src[i], seen);
  4594. }
  4595. } else {
  4596. copy = {};
  4597. seen.set(src, copy);
  4598. for (const name in src) {
  4599. if (hasOwn$1(src, name)) {
  4600. copy[name] = clone(src[name], seen);
  4601. }
  4602. }
  4603. }
  4604. return copy;
  4605. }
  4606. if (type !== "symbol") {
  4607. return src;
  4608. }
  4609. }
  4610. function deepCopy(src) {
  4611. return clone(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  4612. }
  4613. function getMPInstanceData(instance, keys) {
  4614. const data = instance.data;
  4615. const ret = /* @__PURE__ */ Object.create(null);
  4616. keys.forEach((key) => {
  4617. ret[key] = data[key];
  4618. });
  4619. return ret;
  4620. }
  4621. function patch(instance, data, oldData) {
  4622. if (!data) {
  4623. return;
  4624. }
  4625. data = deepCopy(data);
  4626. data.$eS = instance.$eS || {};
  4627. data.$eA = instance.$eA || {};
  4628. const ctx = instance.ctx;
  4629. const mpType = ctx.mpType;
  4630. if (mpType === "page" || mpType === "component") {
  4631. data.r0 = 1;
  4632. const mpInstance = ctx.$scope;
  4633. const keys = Object.keys(data);
  4634. const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
  4635. if (Object.keys(diffData).length) {
  4636. ctx.__next_tick_pending = true;
  4637. mpInstance.setData(diffData, () => {
  4638. ctx.__next_tick_pending = false;
  4639. flushCallbacks(instance);
  4640. });
  4641. flushPreFlushCbs();
  4642. } else {
  4643. flushCallbacks(instance);
  4644. }
  4645. }
  4646. }
  4647. function initAppConfig(appConfig) {
  4648. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  4649. return nextTick(this.$, fn);
  4650. };
  4651. }
  4652. function onApplyOptions(options, instance, publicThis) {
  4653. instance.appContext.config.globalProperties.$applyOptions(
  4654. options,
  4655. instance,
  4656. publicThis
  4657. );
  4658. const computedOptions = options.computed;
  4659. if (computedOptions) {
  4660. const keys = Object.keys(computedOptions);
  4661. if (keys.length) {
  4662. const ctx = instance.ctx;
  4663. if (!ctx.$computedKeys) {
  4664. ctx.$computedKeys = [];
  4665. }
  4666. ctx.$computedKeys.push(...keys);
  4667. }
  4668. }
  4669. delete instance.ctx.$onApplyOptions;
  4670. }
  4671. function setRef$1(instance, isUnmount = false) {
  4672. const {
  4673. setupState,
  4674. $templateRefs,
  4675. $templateUniElementRefs,
  4676. ctx: { $scope, $mpPlatform }
  4677. } = instance;
  4678. if ($mpPlatform === "mp-alipay") {
  4679. return;
  4680. }
  4681. if (!$scope || !$templateRefs && !$templateUniElementRefs) {
  4682. return;
  4683. }
  4684. if (isUnmount) {
  4685. $templateRefs && $templateRefs.forEach(
  4686. (templateRef) => setTemplateRef(templateRef, null, setupState)
  4687. );
  4688. $templateUniElementRefs && $templateUniElementRefs.forEach(
  4689. (templateRef) => setTemplateRef(templateRef, null, setupState)
  4690. );
  4691. return;
  4692. }
  4693. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  4694. const doSetByRefs = (refs) => {
  4695. if (refs.length === 0) {
  4696. return [];
  4697. }
  4698. const mpComponents = (
  4699. // 字节小程序 selectAllComponents 可能返回 null
  4700. // https://github.com/dcloudio/uni-app/issues/3954
  4701. ($scope.selectAllComponents(".r") || []).concat(
  4702. $scope.selectAllComponents(".r-i-f") || []
  4703. )
  4704. );
  4705. return refs.filter((templateRef) => {
  4706. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  4707. if (check && refValue === null) {
  4708. return true;
  4709. }
  4710. setTemplateRef(templateRef, refValue, setupState);
  4711. return false;
  4712. });
  4713. };
  4714. const doSet = () => {
  4715. if ($templateRefs) {
  4716. const refs = doSetByRefs($templateRefs);
  4717. if (refs.length && instance.proxy && instance.proxy.$scope) {
  4718. instance.proxy.$scope.setData({ r1: 1 }, () => {
  4719. doSetByRefs(refs);
  4720. });
  4721. }
  4722. }
  4723. };
  4724. if ($templateUniElementRefs && $templateUniElementRefs.length) {
  4725. nextTick(instance, () => {
  4726. $templateUniElementRefs.forEach((templateRef) => {
  4727. if (isArray(templateRef.v)) {
  4728. templateRef.v.forEach((v) => {
  4729. setTemplateRef(templateRef, v, setupState);
  4730. });
  4731. } else {
  4732. setTemplateRef(templateRef, templateRef.v, setupState);
  4733. }
  4734. });
  4735. });
  4736. }
  4737. if ($scope._$setRef) {
  4738. $scope._$setRef(doSet);
  4739. } else {
  4740. nextTick(instance, doSet);
  4741. }
  4742. }
  4743. function toSkip(value) {
  4744. if (isObject$2(value)) {
  4745. markRaw(value);
  4746. }
  4747. return value;
  4748. }
  4749. function findComponentPublicInstance(mpComponents, id) {
  4750. const mpInstance = mpComponents.find(
  4751. (com) => com && (com.properties || com.props).uI === id
  4752. );
  4753. if (mpInstance) {
  4754. const vm = mpInstance.$vm;
  4755. if (vm) {
  4756. return getExposeProxy(vm.$) || vm;
  4757. }
  4758. return toSkip(mpInstance);
  4759. }
  4760. return null;
  4761. }
  4762. function setTemplateRef({ r: r2, f: f2 }, refValue, setupState) {
  4763. if (isFunction(r2)) {
  4764. r2(refValue, {});
  4765. } else {
  4766. const _isString = isString(r2);
  4767. const _isRef = isRef(r2);
  4768. if (_isString || _isRef) {
  4769. if (f2) {
  4770. if (!_isRef) {
  4771. return;
  4772. }
  4773. if (!isArray(r2.value)) {
  4774. r2.value = [];
  4775. }
  4776. const existing = r2.value;
  4777. if (existing.indexOf(refValue) === -1) {
  4778. existing.push(refValue);
  4779. if (!refValue) {
  4780. return;
  4781. }
  4782. if (refValue.$) {
  4783. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  4784. }
  4785. }
  4786. } else if (_isString) {
  4787. if (hasOwn$1(setupState, r2)) {
  4788. setupState[r2] = refValue;
  4789. }
  4790. } else if (isRef(r2)) {
  4791. r2.value = refValue;
  4792. } else {
  4793. warnRef(r2);
  4794. }
  4795. } else {
  4796. warnRef(r2);
  4797. }
  4798. }
  4799. }
  4800. function warnRef(ref2) {
  4801. warn("Invalid template ref type:", ref2, `(${typeof ref2})`);
  4802. }
  4803. const queuePostRenderEffect = queuePostFlushCb;
  4804. function mountComponent(initialVNode, options) {
  4805. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  4806. instance.renderer = options.mpType ? options.mpType : "component";
  4807. {
  4808. instance.ctx.$onApplyOptions = onApplyOptions;
  4809. instance.ctx.$children = [];
  4810. }
  4811. if (options.mpType === "app") {
  4812. instance.render = NOOP;
  4813. }
  4814. if (options.onBeforeSetup) {
  4815. options.onBeforeSetup(instance, options);
  4816. }
  4817. {
  4818. pushWarningContext(initialVNode);
  4819. startMeasure(instance, `mount`);
  4820. }
  4821. {
  4822. startMeasure(instance, `init`);
  4823. }
  4824. setupComponent(instance);
  4825. {
  4826. endMeasure(instance, `init`);
  4827. }
  4828. {
  4829. if (options.parentComponent && instance.proxy) {
  4830. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  4831. }
  4832. }
  4833. setupRenderEffect(instance);
  4834. {
  4835. popWarningContext();
  4836. endMeasure(instance, `mount`);
  4837. }
  4838. return instance.proxy;
  4839. }
  4840. const getFunctionalFallthrough = (attrs) => {
  4841. let res2;
  4842. for (const key in attrs) {
  4843. if (key === "class" || key === "style" || isOn(key)) {
  4844. (res2 || (res2 = {}))[key] = attrs[key];
  4845. }
  4846. }
  4847. return res2;
  4848. };
  4849. function renderComponentRoot(instance) {
  4850. const {
  4851. type: Component2,
  4852. vnode,
  4853. proxy,
  4854. withProxy,
  4855. props,
  4856. propsOptions: [propsOptions],
  4857. slots,
  4858. attrs,
  4859. emit: emit2,
  4860. render,
  4861. renderCache,
  4862. data,
  4863. setupState,
  4864. ctx,
  4865. uid: uid2,
  4866. appContext: {
  4867. app: {
  4868. config: {
  4869. globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 }
  4870. }
  4871. }
  4872. },
  4873. inheritAttrs
  4874. } = instance;
  4875. instance.$uniElementIds = /* @__PURE__ */ new Map();
  4876. instance.$templateRefs = [];
  4877. instance.$templateUniElementRefs = [];
  4878. instance.$templateUniElementStyles = {};
  4879. instance.$ei = 0;
  4880. pruneComponentPropsCache2(uid2);
  4881. instance.__counter = instance.__counter === 0 ? 1 : 0;
  4882. let result;
  4883. const prev = setCurrentRenderingInstance(instance);
  4884. try {
  4885. if (vnode.shapeFlag & 4) {
  4886. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  4887. const proxyToUse = withProxy || proxy;
  4888. result = render.call(
  4889. proxyToUse,
  4890. proxyToUse,
  4891. renderCache,
  4892. props,
  4893. setupState,
  4894. data,
  4895. ctx
  4896. );
  4897. } else {
  4898. fallthroughAttrs(
  4899. inheritAttrs,
  4900. props,
  4901. propsOptions,
  4902. Component2.props ? attrs : getFunctionalFallthrough(attrs)
  4903. );
  4904. const render2 = Component2;
  4905. result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
  4906. props,
  4907. null
  4908. /* we know it doesn't need it */
  4909. );
  4910. }
  4911. } catch (err) {
  4912. handleError(err, instance, 1);
  4913. result = false;
  4914. }
  4915. setRef$1(instance);
  4916. setCurrentRenderingInstance(prev);
  4917. return result;
  4918. }
  4919. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  4920. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  4921. const keys = Object.keys(fallthroughAttrs2).filter(
  4922. (key) => key !== "class" && key !== "style"
  4923. );
  4924. if (!keys.length) {
  4925. return;
  4926. }
  4927. if (propsOptions && keys.some(isModelListener)) {
  4928. keys.forEach((key) => {
  4929. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  4930. props[key] = fallthroughAttrs2[key];
  4931. }
  4932. });
  4933. } else {
  4934. keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
  4935. }
  4936. }
  4937. }
  4938. const updateComponentPreRender = (instance) => {
  4939. pauseTracking();
  4940. flushPreFlushCbs();
  4941. resetTracking();
  4942. };
  4943. function componentUpdateScopedSlotsFn() {
  4944. const scopedSlotsData = this.$scopedSlotsData;
  4945. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  4946. return;
  4947. }
  4948. const mpInstance = this.ctx.$scope;
  4949. const oldData = mpInstance.data;
  4950. const diffData = /* @__PURE__ */ Object.create(null);
  4951. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  4952. const oldScopedSlotData = getValueByDataPath(oldData, path);
  4953. const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  4954. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  4955. diffData[diffPath] = data;
  4956. } else {
  4957. const diffScopedSlotData = diff(
  4958. data,
  4959. oldScopedSlotData[index2]
  4960. );
  4961. Object.keys(diffScopedSlotData).forEach((name) => {
  4962. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  4963. });
  4964. }
  4965. });
  4966. scopedSlotsData.length = 0;
  4967. if (Object.keys(diffData).length) {
  4968. mpInstance.setData(diffData);
  4969. }
  4970. }
  4971. function toggleRecurse({ effect: effect2, update: update3 }, allowed) {
  4972. effect2.allowRecurse = update3.allowRecurse = allowed;
  4973. }
  4974. function setupRenderEffect(instance) {
  4975. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(
  4976. instance
  4977. );
  4978. instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  4979. const componentUpdateFn = () => {
  4980. if (!instance.isMounted) {
  4981. onBeforeUnmount(() => {
  4982. setRef$1(instance, true);
  4983. }, instance);
  4984. {
  4985. startMeasure(instance, `patch`);
  4986. }
  4987. patch(instance, renderComponentRoot(instance));
  4988. {
  4989. endMeasure(instance, `patch`);
  4990. }
  4991. {
  4992. devtoolsComponentAdded(instance);
  4993. }
  4994. } else {
  4995. const { next, bu, u } = instance;
  4996. {
  4997. pushWarningContext(next || instance.vnode);
  4998. }
  4999. toggleRecurse(instance, false);
  5000. updateComponentPreRender();
  5001. if (bu) {
  5002. invokeArrayFns$1(bu);
  5003. }
  5004. toggleRecurse(instance, true);
  5005. {
  5006. startMeasure(instance, `patch`);
  5007. }
  5008. patch(instance, renderComponentRoot(instance));
  5009. {
  5010. endMeasure(instance, `patch`);
  5011. }
  5012. if (u) {
  5013. queuePostRenderEffect(u);
  5014. }
  5015. {
  5016. devtoolsComponentUpdated(instance);
  5017. }
  5018. {
  5019. popWarningContext();
  5020. }
  5021. }
  5022. };
  5023. const effect2 = instance.effect = new ReactiveEffect(
  5024. componentUpdateFn,
  5025. NOOP,
  5026. () => queueJob(update3),
  5027. instance.scope
  5028. // track it in component's effect scope
  5029. );
  5030. const update3 = instance.update = () => {
  5031. if (effect2.dirty) {
  5032. effect2.run();
  5033. }
  5034. };
  5035. update3.id = instance.uid;
  5036. toggleRecurse(instance, true);
  5037. {
  5038. effect2.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  5039. effect2.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  5040. update3.ownerInstance = instance;
  5041. }
  5042. {
  5043. update3();
  5044. }
  5045. }
  5046. function unmountComponent(instance) {
  5047. const { bum, scope, update: update3, um } = instance;
  5048. if (bum) {
  5049. invokeArrayFns$1(bum);
  5050. }
  5051. {
  5052. const parentInstance = instance.parent;
  5053. if (parentInstance) {
  5054. const $children = parentInstance.ctx.$children;
  5055. const target = getExposeProxy(instance) || instance.proxy;
  5056. const index2 = $children.indexOf(target);
  5057. if (index2 > -1) {
  5058. $children.splice(index2, 1);
  5059. }
  5060. }
  5061. }
  5062. scope.stop();
  5063. if (update3) {
  5064. update3.active = false;
  5065. }
  5066. if (um) {
  5067. queuePostRenderEffect(um);
  5068. }
  5069. queuePostRenderEffect(() => {
  5070. instance.isUnmounted = true;
  5071. });
  5072. {
  5073. devtoolsComponentRemoved(instance);
  5074. }
  5075. }
  5076. const oldCreateApp = createAppAPI();
  5077. function getTarget() {
  5078. if (typeof window !== "undefined") {
  5079. return window;
  5080. }
  5081. if (typeof globalThis !== "undefined") {
  5082. return globalThis;
  5083. }
  5084. if (typeof global !== "undefined") {
  5085. return global;
  5086. }
  5087. if (typeof my !== "undefined") {
  5088. return my;
  5089. }
  5090. }
  5091. function createVueApp(rootComponent, rootProps = null) {
  5092. const target = getTarget();
  5093. target.__VUE__ = true;
  5094. {
  5095. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5096. }
  5097. const app = oldCreateApp(rootComponent, rootProps);
  5098. const appContext = app._context;
  5099. initAppConfig(appContext.config);
  5100. const createVNode2 = (initialVNode) => {
  5101. initialVNode.appContext = appContext;
  5102. initialVNode.shapeFlag = 6;
  5103. return initialVNode;
  5104. };
  5105. const createComponent2 = function createComponent22(initialVNode, options) {
  5106. return mountComponent(createVNode2(initialVNode), options);
  5107. };
  5108. const destroyComponent = function destroyComponent2(component) {
  5109. return component && unmountComponent(component.$);
  5110. };
  5111. app.mount = function mount() {
  5112. rootComponent.render = NOOP;
  5113. const instance = mountComponent(
  5114. createVNode2({ type: rootComponent }),
  5115. {
  5116. mpType: "app",
  5117. mpInstance: null,
  5118. parentComponent: null,
  5119. slots: [],
  5120. props: null
  5121. }
  5122. );
  5123. app._instance = instance.$;
  5124. {
  5125. devtoolsInitApp(app, version);
  5126. }
  5127. instance.$app = app;
  5128. instance.$createComponent = createComponent2;
  5129. instance.$destroyComponent = destroyComponent;
  5130. appContext.$appInstance = instance;
  5131. return instance;
  5132. };
  5133. app.unmount = function unmount() {
  5134. warn(`Cannot unmount an app.`);
  5135. };
  5136. return app;
  5137. }
  5138. function injectLifecycleHook(name, hook, publicThis, instance) {
  5139. if (isFunction(hook)) {
  5140. injectHook(name, hook.bind(publicThis), instance);
  5141. }
  5142. }
  5143. function initHooks$1(options, instance, publicThis) {
  5144. const mpType = options.mpType || publicThis.$mpType;
  5145. if (!mpType || mpType === "component" || // instance.renderer 标识页面是否作为组件渲染
  5146. mpType === "page" && instance.renderer === "component") {
  5147. return;
  5148. }
  5149. Object.keys(options).forEach((name) => {
  5150. if (isUniLifecycleHook(name, options[name], false)) {
  5151. const hooks = options[name];
  5152. if (isArray(hooks)) {
  5153. hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  5154. } else {
  5155. injectLifecycleHook(name, hooks, publicThis, instance);
  5156. }
  5157. }
  5158. });
  5159. }
  5160. function applyOptions$2(options, instance, publicThis) {
  5161. initHooks$1(options, instance, publicThis);
  5162. }
  5163. function set(target, key, val) {
  5164. return target[key] = val;
  5165. }
  5166. function $callMethod(method, ...args) {
  5167. const fn = this[method];
  5168. if (fn) {
  5169. return fn(...args);
  5170. }
  5171. console.error(`method ${method} not found`);
  5172. return null;
  5173. }
  5174. function createErrorHandler(app) {
  5175. const userErrorHandler = app.config.errorHandler;
  5176. return function errorHandler(err, instance, info) {
  5177. if (userErrorHandler) {
  5178. userErrorHandler(err, instance, info);
  5179. }
  5180. const appInstance = app._instance;
  5181. if (!appInstance || !appInstance.proxy) {
  5182. throw err;
  5183. }
  5184. if (appInstance[ON_ERROR]) {
  5185. {
  5186. appInstance.proxy.$callHook(ON_ERROR, err);
  5187. }
  5188. } else {
  5189. logError(err, info, instance ? instance.$.vnode : null, false);
  5190. }
  5191. };
  5192. }
  5193. function mergeAsArray(to, from) {
  5194. return to ? [...new Set([].concat(to, from))] : from;
  5195. }
  5196. function initOptionMergeStrategies(optionMergeStrategies) {
  5197. UniLifecycleHooks.forEach((name) => {
  5198. optionMergeStrategies[name] = mergeAsArray;
  5199. });
  5200. }
  5201. let realAtob;
  5202. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  5203. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  5204. if (typeof atob !== "function") {
  5205. realAtob = function(str) {
  5206. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  5207. if (!b64re.test(str)) {
  5208. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  5209. }
  5210. str += "==".slice(2 - (str.length & 3));
  5211. var bitmap;
  5212. var result = "";
  5213. var r1;
  5214. var r2;
  5215. var i = 0;
  5216. for (; i < str.length; ) {
  5217. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  5218. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  5219. }
  5220. return result;
  5221. };
  5222. } else {
  5223. realAtob = atob;
  5224. }
  5225. function b64DecodeUnicode(str) {
  5226. return decodeURIComponent(realAtob(str).split("").map(function(c2) {
  5227. return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
  5228. }).join(""));
  5229. }
  5230. function getCurrentUserInfo() {
  5231. const token = index.getStorageSync("uni_id_token") || "";
  5232. const tokenArr = token.split(".");
  5233. if (!token || tokenArr.length !== 3) {
  5234. return {
  5235. uid: null,
  5236. role: [],
  5237. permission: [],
  5238. tokenExpired: 0
  5239. };
  5240. }
  5241. let userInfo;
  5242. try {
  5243. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  5244. } catch (error) {
  5245. throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
  5246. }
  5247. userInfo.tokenExpired = userInfo.exp * 1e3;
  5248. delete userInfo.exp;
  5249. delete userInfo.iat;
  5250. return userInfo;
  5251. }
  5252. function uniIdMixin(globalProperties) {
  5253. globalProperties.uniIDHasRole = function(roleId) {
  5254. const { role } = getCurrentUserInfo();
  5255. return role.indexOf(roleId) > -1;
  5256. };
  5257. globalProperties.uniIDHasPermission = function(permissionId) {
  5258. const { permission } = getCurrentUserInfo();
  5259. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  5260. };
  5261. globalProperties.uniIDTokenValid = function() {
  5262. const { tokenExpired } = getCurrentUserInfo();
  5263. return tokenExpired > Date.now();
  5264. };
  5265. }
  5266. function initApp(app) {
  5267. const appConfig = app.config;
  5268. appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  5269. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  5270. const globalProperties = appConfig.globalProperties;
  5271. {
  5272. uniIdMixin(globalProperties);
  5273. }
  5274. {
  5275. globalProperties.$set = set;
  5276. globalProperties.$applyOptions = applyOptions$2;
  5277. globalProperties.$callMethod = $callMethod;
  5278. }
  5279. {
  5280. index.invokeCreateVueAppHook(app);
  5281. }
  5282. }
  5283. const propsCaches = /* @__PURE__ */ Object.create(null);
  5284. function renderProps(props) {
  5285. const { uid: uid2, __counter } = getCurrentInstance();
  5286. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  5287. return uid2 + "," + propsId + "," + __counter;
  5288. }
  5289. function pruneComponentPropsCache(uid2) {
  5290. delete propsCaches[uid2];
  5291. }
  5292. function findComponentPropsData(up) {
  5293. if (!up) {
  5294. return;
  5295. }
  5296. const [uid2, propsId] = up.split(",");
  5297. if (!propsCaches[uid2]) {
  5298. return;
  5299. }
  5300. return propsCaches[uid2][parseInt(propsId)];
  5301. }
  5302. var plugin = {
  5303. install(app) {
  5304. initApp(app);
  5305. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  5306. const oldMount = app.mount;
  5307. app.mount = function mount(rootContainer) {
  5308. const instance = oldMount.call(app, rootContainer);
  5309. const createApp2 = getCreateApp();
  5310. if (createApp2) {
  5311. createApp2(instance);
  5312. } else {
  5313. if (typeof createMiniProgramApp !== "undefined") {
  5314. createMiniProgramApp(instance);
  5315. }
  5316. }
  5317. return instance;
  5318. };
  5319. }
  5320. };
  5321. function getCreateApp() {
  5322. const method = "createApp";
  5323. if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
  5324. return global[method];
  5325. } else if (typeof my !== "undefined") {
  5326. return my[method];
  5327. }
  5328. }
  5329. function stringifyStyle(value) {
  5330. if (isString(value)) {
  5331. return value;
  5332. }
  5333. return stringify(normalizeStyle(value));
  5334. }
  5335. function stringify(styles) {
  5336. let ret = "";
  5337. if (!styles || isString(styles)) {
  5338. return ret;
  5339. }
  5340. for (const key in styles) {
  5341. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  5342. }
  5343. return ret;
  5344. }
  5345. function vOn(value, key) {
  5346. const instance = getCurrentInstance();
  5347. const ctx = instance.ctx;
  5348. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq" || ctx.$mpPlatform === "mp-xhs") && (isString(key) || typeof key === "number") ? "_" + key : "";
  5349. const name = "e" + instance.$ei++ + extraKey;
  5350. const mpInstance = ctx.$scope;
  5351. if (!value) {
  5352. delete mpInstance[name];
  5353. return name;
  5354. }
  5355. const existingInvoker = mpInstance[name];
  5356. if (existingInvoker) {
  5357. existingInvoker.value = value;
  5358. } else {
  5359. mpInstance[name] = createInvoker(value, instance);
  5360. }
  5361. return name;
  5362. }
  5363. function createInvoker(initialValue, instance) {
  5364. const invoker = (e2) => {
  5365. patchMPEvent(e2);
  5366. let args = [e2];
  5367. if (instance && instance.ctx.$getTriggerEventDetail) {
  5368. if (typeof e2.detail === "number") {
  5369. e2.detail = instance.ctx.$getTriggerEventDetail(e2.detail);
  5370. }
  5371. }
  5372. if (e2.detail && e2.detail.__args__) {
  5373. args = e2.detail.__args__;
  5374. }
  5375. const eventValue = invoker.value;
  5376. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  5377. const eventTarget = e2.target;
  5378. const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
  5379. if (bubbles.includes(e2.type) && !eventSync) {
  5380. setTimeout(invoke);
  5381. } else {
  5382. const res2 = invoke();
  5383. if (e2.type === "input" && (isArray(res2) || isPromise$1(res2))) {
  5384. return;
  5385. }
  5386. return res2;
  5387. }
  5388. };
  5389. invoker.value = initialValue;
  5390. return invoker;
  5391. }
  5392. const bubbles = [
  5393. // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
  5394. // 'touchstart',
  5395. // 'touchmove',
  5396. // 'touchcancel',
  5397. // 'touchend',
  5398. "tap",
  5399. "longpress",
  5400. "longtap",
  5401. "transitionend",
  5402. "animationstart",
  5403. "animationiteration",
  5404. "animationend",
  5405. "touchforcechange"
  5406. ];
  5407. function patchMPEvent(event, instance) {
  5408. if (event.type && event.target) {
  5409. event.preventDefault = NOOP;
  5410. event.stopPropagation = NOOP;
  5411. event.stopImmediatePropagation = NOOP;
  5412. if (!hasOwn$1(event, "detail")) {
  5413. event.detail = {};
  5414. }
  5415. if (hasOwn$1(event, "markerId")) {
  5416. event.detail = typeof event.detail === "object" ? event.detail : {};
  5417. event.detail.markerId = event.markerId;
  5418. }
  5419. if (isPlainObject(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
  5420. event.detail.value = event.detail.checked;
  5421. }
  5422. if (isPlainObject(event.detail)) {
  5423. event.target = extend({}, event.target, event.detail);
  5424. }
  5425. }
  5426. }
  5427. function patchStopImmediatePropagation(e2, value) {
  5428. if (isArray(value)) {
  5429. const originalStop = e2.stopImmediatePropagation;
  5430. e2.stopImmediatePropagation = () => {
  5431. originalStop && originalStop.call(e2);
  5432. e2._stopped = true;
  5433. };
  5434. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  5435. } else {
  5436. return value;
  5437. }
  5438. }
  5439. function vFor(source, renderItem) {
  5440. let ret;
  5441. if (isArray(source) || isString(source)) {
  5442. ret = new Array(source.length);
  5443. for (let i = 0, l = source.length; i < l; i++) {
  5444. ret[i] = renderItem(source[i], i, i);
  5445. }
  5446. } else if (typeof source === "number") {
  5447. if (!Number.isInteger(source)) {
  5448. warn(`The v-for range expect an integer value but got ${source}.`);
  5449. return [];
  5450. }
  5451. ret = new Array(source);
  5452. for (let i = 0; i < source; i++) {
  5453. ret[i] = renderItem(i + 1, i, i);
  5454. }
  5455. } else if (isObject$2(source)) {
  5456. if (source[Symbol.iterator]) {
  5457. ret = Array.from(source, (item, i) => renderItem(item, i, i));
  5458. } else {
  5459. const keys = Object.keys(source);
  5460. ret = new Array(keys.length);
  5461. for (let i = 0, l = keys.length; i < l; i++) {
  5462. const key = keys[i];
  5463. ret[i] = renderItem(source[key], key, i);
  5464. }
  5465. }
  5466. } else {
  5467. ret = [];
  5468. }
  5469. return ret;
  5470. }
  5471. const o = (value, key) => vOn(value, key);
  5472. const f = (source, renderItem) => vFor(source, renderItem);
  5473. const s = (value) => stringifyStyle(value);
  5474. const e = (target, ...sources) => extend(target, ...sources);
  5475. const n = (value) => normalizeClass(value);
  5476. const t = (val) => toDisplayString(val);
  5477. const p = (props) => renderProps(props);
  5478. function createApp$1(rootComponent, rootProps = null) {
  5479. rootComponent && (rootComponent.mpType = "app");
  5480. return createVueApp(rootComponent, rootProps).use(plugin);
  5481. }
  5482. const createSSRApp = createApp$1;
  5483. function getLocaleLanguage$1() {
  5484. var _a;
  5485. let localeLanguage = "";
  5486. {
  5487. const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
  5488. const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
  5489. localeLanguage = normalizeLocale(language) || LOCALE_EN;
  5490. }
  5491. return localeLanguage;
  5492. }
  5493. function validateProtocolFail(name, msg) {
  5494. console.warn(`${name}: ${msg}`);
  5495. }
  5496. function validateProtocol(name, data, protocol, onFail) {
  5497. if (!onFail) {
  5498. onFail = validateProtocolFail;
  5499. }
  5500. for (const key in protocol) {
  5501. const errMsg = validateProp(key, data[key], protocol[key], !hasOwn$1(data, key));
  5502. if (isString(errMsg)) {
  5503. onFail(name, errMsg);
  5504. }
  5505. }
  5506. }
  5507. function validateProtocols(name, args, protocol, onFail) {
  5508. if (!protocol) {
  5509. return;
  5510. }
  5511. if (!isArray(protocol)) {
  5512. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  5513. }
  5514. const len = protocol.length;
  5515. const argsLen = args.length;
  5516. for (let i = 0; i < len; i++) {
  5517. const opts = protocol[i];
  5518. const data = /* @__PURE__ */ Object.create(null);
  5519. if (argsLen > i) {
  5520. data[opts.name] = args[i];
  5521. }
  5522. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  5523. }
  5524. }
  5525. function validateProp(name, value, prop, isAbsent) {
  5526. if (!isPlainObject(prop)) {
  5527. prop = { type: prop };
  5528. }
  5529. const { type, required, validator } = prop;
  5530. if (required && isAbsent) {
  5531. return 'Missing required args: "' + name + '"';
  5532. }
  5533. if (value == null && !required) {
  5534. return;
  5535. }
  5536. if (type != null) {
  5537. let isValid = false;
  5538. const types = isArray(type) ? type : [type];
  5539. const expectedTypes = [];
  5540. for (let i = 0; i < types.length && !isValid; i++) {
  5541. const { valid, expectedType } = assertType(value, types[i]);
  5542. expectedTypes.push(expectedType || "");
  5543. isValid = valid;
  5544. }
  5545. if (!isValid) {
  5546. return getInvalidTypeMessage(name, value, expectedTypes);
  5547. }
  5548. }
  5549. if (validator) {
  5550. return validator(value);
  5551. }
  5552. }
  5553. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  5554. function assertType(value, type) {
  5555. let valid;
  5556. const expectedType = getType(type);
  5557. if (isSimpleType(expectedType)) {
  5558. const t2 = typeof value;
  5559. valid = t2 === expectedType.toLowerCase();
  5560. if (!valid && t2 === "object") {
  5561. valid = value instanceof type;
  5562. }
  5563. } else if (expectedType === "Object") {
  5564. valid = isObject$2(value);
  5565. } else if (expectedType === "Array") {
  5566. valid = isArray(value);
  5567. } else {
  5568. {
  5569. valid = value instanceof type;
  5570. }
  5571. }
  5572. return {
  5573. valid,
  5574. expectedType
  5575. };
  5576. }
  5577. function getInvalidTypeMessage(name, value, expectedTypes) {
  5578. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  5579. const expectedType = expectedTypes[0];
  5580. const receivedType = toRawType(value);
  5581. const expectedValue = styleValue(value, expectedType);
  5582. const receivedValue = styleValue(value, receivedType);
  5583. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  5584. message += ` with value ${expectedValue}`;
  5585. }
  5586. message += `, got ${receivedType} `;
  5587. if (isExplicable(receivedType)) {
  5588. message += `with value ${receivedValue}.`;
  5589. }
  5590. return message;
  5591. }
  5592. function getType(ctor) {
  5593. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  5594. return match ? match[1] : "";
  5595. }
  5596. function styleValue(value, type) {
  5597. if (type === "String") {
  5598. return `"${value}"`;
  5599. } else if (type === "Number") {
  5600. return `${Number(value)}`;
  5601. } else {
  5602. return `${value}`;
  5603. }
  5604. }
  5605. function isExplicable(type) {
  5606. const explicitTypes = ["string", "number", "boolean"];
  5607. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  5608. }
  5609. function isBoolean(...args) {
  5610. return args.some((elem) => elem.toLowerCase() === "boolean");
  5611. }
  5612. function tryCatch(fn) {
  5613. return function() {
  5614. try {
  5615. return fn.apply(fn, arguments);
  5616. } catch (e2) {
  5617. console.error(e2);
  5618. }
  5619. };
  5620. }
  5621. let invokeCallbackId = 1;
  5622. const invokeCallbacks = {};
  5623. function addInvokeCallback(id, name, callback, keepAlive = false) {
  5624. invokeCallbacks[id] = {
  5625. name,
  5626. keepAlive,
  5627. callback
  5628. };
  5629. return id;
  5630. }
  5631. function invokeCallback(id, res2, extras) {
  5632. if (typeof id === "number") {
  5633. const opts = invokeCallbacks[id];
  5634. if (opts) {
  5635. if (!opts.keepAlive) {
  5636. delete invokeCallbacks[id];
  5637. }
  5638. return opts.callback(res2, extras);
  5639. }
  5640. }
  5641. return res2;
  5642. }
  5643. const API_SUCCESS = "success";
  5644. const API_FAIL = "fail";
  5645. const API_COMPLETE = "complete";
  5646. function getApiCallbacks(args) {
  5647. const apiCallbacks = {};
  5648. for (const name in args) {
  5649. const fn = args[name];
  5650. if (isFunction(fn)) {
  5651. apiCallbacks[name] = tryCatch(fn);
  5652. delete args[name];
  5653. }
  5654. }
  5655. return apiCallbacks;
  5656. }
  5657. function normalizeErrMsg(errMsg, name) {
  5658. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  5659. return name + ":ok";
  5660. }
  5661. return name + errMsg.substring(errMsg.indexOf(":fail"));
  5662. }
  5663. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  5664. if (!isPlainObject(args)) {
  5665. args = {};
  5666. }
  5667. const { success, fail, complete } = getApiCallbacks(args);
  5668. const hasSuccess = isFunction(success);
  5669. const hasFail = isFunction(fail);
  5670. const hasComplete = isFunction(complete);
  5671. const callbackId = invokeCallbackId++;
  5672. addInvokeCallback(callbackId, name, (res2) => {
  5673. res2 = res2 || {};
  5674. res2.errMsg = normalizeErrMsg(res2.errMsg, name);
  5675. isFunction(beforeAll) && beforeAll(res2);
  5676. if (res2.errMsg === name + ":ok") {
  5677. isFunction(beforeSuccess) && beforeSuccess(res2, args);
  5678. hasSuccess && success(res2);
  5679. } else {
  5680. hasFail && fail(res2);
  5681. }
  5682. hasComplete && complete(res2);
  5683. });
  5684. return callbackId;
  5685. }
  5686. const HOOK_SUCCESS = "success";
  5687. const HOOK_FAIL = "fail";
  5688. const HOOK_COMPLETE = "complete";
  5689. const globalInterceptors = {};
  5690. const scopedInterceptors = {};
  5691. function wrapperHook(hook, params) {
  5692. return function(data) {
  5693. return hook(data, params) || data;
  5694. };
  5695. }
  5696. function queue(hooks, data, params) {
  5697. let promise = false;
  5698. for (let i = 0; i < hooks.length; i++) {
  5699. const hook = hooks[i];
  5700. if (promise) {
  5701. promise = Promise.resolve(wrapperHook(hook, params));
  5702. } else {
  5703. const res2 = hook(data, params);
  5704. if (isPromise$1(res2)) {
  5705. promise = Promise.resolve(res2);
  5706. }
  5707. if (res2 === false) {
  5708. return {
  5709. then() {
  5710. },
  5711. catch() {
  5712. }
  5713. };
  5714. }
  5715. }
  5716. }
  5717. return promise || {
  5718. then(callback) {
  5719. return callback(data);
  5720. },
  5721. catch() {
  5722. }
  5723. };
  5724. }
  5725. function wrapperOptions(interceptors2, options = {}) {
  5726. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  5727. const hooks = interceptors2[name];
  5728. if (!isArray(hooks)) {
  5729. return;
  5730. }
  5731. const oldCallback = options[name];
  5732. options[name] = function callbackInterceptor(res2) {
  5733. queue(hooks, res2, options).then((res22) => {
  5734. return isFunction(oldCallback) && oldCallback(res22) || res22;
  5735. });
  5736. };
  5737. });
  5738. return options;
  5739. }
  5740. function wrapperReturnValue(method, returnValue) {
  5741. const returnValueHooks = [];
  5742. if (isArray(globalInterceptors.returnValue)) {
  5743. returnValueHooks.push(...globalInterceptors.returnValue);
  5744. }
  5745. const interceptor = scopedInterceptors[method];
  5746. if (interceptor && isArray(interceptor.returnValue)) {
  5747. returnValueHooks.push(...interceptor.returnValue);
  5748. }
  5749. returnValueHooks.forEach((hook) => {
  5750. returnValue = hook(returnValue) || returnValue;
  5751. });
  5752. return returnValue;
  5753. }
  5754. function getApiInterceptorHooks(method) {
  5755. const interceptor = /* @__PURE__ */ Object.create(null);
  5756. Object.keys(globalInterceptors).forEach((hook) => {
  5757. if (hook !== "returnValue") {
  5758. interceptor[hook] = globalInterceptors[hook].slice();
  5759. }
  5760. });
  5761. const scopedInterceptor = scopedInterceptors[method];
  5762. if (scopedInterceptor) {
  5763. Object.keys(scopedInterceptor).forEach((hook) => {
  5764. if (hook !== "returnValue") {
  5765. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  5766. }
  5767. });
  5768. }
  5769. return interceptor;
  5770. }
  5771. function invokeApi(method, api, options, params) {
  5772. const interceptor = getApiInterceptorHooks(method);
  5773. if (interceptor && Object.keys(interceptor).length) {
  5774. if (isArray(interceptor.invoke)) {
  5775. const res2 = queue(interceptor.invoke, options);
  5776. return res2.then((options2) => {
  5777. return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
  5778. });
  5779. } else {
  5780. return api(wrapperOptions(interceptor, options), ...params);
  5781. }
  5782. }
  5783. return api(options, ...params);
  5784. }
  5785. function hasCallback(args) {
  5786. if (isPlainObject(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
  5787. return true;
  5788. }
  5789. return false;
  5790. }
  5791. function handlePromise(promise) {
  5792. return promise;
  5793. }
  5794. function promisify$1(name, fn) {
  5795. return (args = {}, ...rest) => {
  5796. if (hasCallback(args)) {
  5797. return wrapperReturnValue(name, invokeApi(name, fn, extend({}, args), rest));
  5798. }
  5799. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  5800. invokeApi(name, fn, extend({}, args, { success: resolve2, fail: reject }), rest);
  5801. })));
  5802. };
  5803. }
  5804. function formatApiArgs(args, options) {
  5805. args[0];
  5806. {
  5807. return;
  5808. }
  5809. }
  5810. function invokeSuccess(id, name, res2) {
  5811. const result = {
  5812. errMsg: name + ":ok"
  5813. };
  5814. return invokeCallback(id, extend(res2 || {}, result));
  5815. }
  5816. function invokeFail(id, name, errMsg, errRes = {}) {
  5817. const errMsgPrefix = name + ":fail";
  5818. let apiErrMsg = "";
  5819. if (!errMsg) {
  5820. apiErrMsg = errMsgPrefix;
  5821. } else if (errMsg.indexOf(errMsgPrefix) === 0) {
  5822. apiErrMsg = errMsg;
  5823. } else {
  5824. apiErrMsg = errMsgPrefix + " " + errMsg;
  5825. }
  5826. {
  5827. delete errRes.errCode;
  5828. }
  5829. let res2 = extend({ errMsg: apiErrMsg }, errRes);
  5830. return invokeCallback(id, res2);
  5831. }
  5832. function beforeInvokeApi(name, args, protocol, options) {
  5833. {
  5834. validateProtocols(name, args, protocol);
  5835. }
  5836. const errMsg = formatApiArgs(args);
  5837. if (errMsg) {
  5838. return errMsg;
  5839. }
  5840. }
  5841. function parseErrMsg(errMsg) {
  5842. if (!errMsg || isString(errMsg)) {
  5843. return errMsg;
  5844. }
  5845. if (errMsg.stack) {
  5846. if (typeof globalThis === "undefined" || !globalThis.harmonyChannel) {
  5847. console.error(errMsg.message + "\n" + errMsg.stack);
  5848. }
  5849. return errMsg.message;
  5850. }
  5851. return errMsg;
  5852. }
  5853. function wrapperTaskApi(name, fn, protocol, options) {
  5854. return (args) => {
  5855. const id = createAsyncApiCallback(name, args, options);
  5856. const errMsg = beforeInvokeApi(name, [args], protocol);
  5857. if (errMsg) {
  5858. return invokeFail(id, name, errMsg);
  5859. }
  5860. return fn(args, {
  5861. resolve: (res2) => invokeSuccess(id, name, res2),
  5862. reject: (errMsg2, errRes) => invokeFail(id, name, parseErrMsg(errMsg2), errRes)
  5863. });
  5864. };
  5865. }
  5866. function wrapperSyncApi(name, fn, protocol, options) {
  5867. return (...args) => {
  5868. const errMsg = beforeInvokeApi(name, args, protocol);
  5869. if (errMsg) {
  5870. throw new Error(errMsg);
  5871. }
  5872. return fn.apply(null, args);
  5873. };
  5874. }
  5875. function wrapperAsyncApi(name, fn, protocol, options) {
  5876. return wrapperTaskApi(name, fn, protocol, options);
  5877. }
  5878. function defineSyncApi(name, fn, protocol, options) {
  5879. return wrapperSyncApi(name, fn, protocol);
  5880. }
  5881. function defineAsyncApi(name, fn, protocol, options) {
  5882. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  5883. }
  5884. const API_UPX2PX = "upx2px";
  5885. const Upx2pxProtocol = [
  5886. {
  5887. name: "upx",
  5888. type: [Number, String],
  5889. required: true
  5890. }
  5891. ];
  5892. const EPS = 1e-4;
  5893. const BASE_DEVICE_WIDTH = 750;
  5894. let isIOS = false;
  5895. let deviceWidth = 0;
  5896. let deviceDPR = 0;
  5897. function checkDeviceWidth() {
  5898. var _a, _b;
  5899. let windowWidth, pixelRatio, platform;
  5900. {
  5901. const windowInfo = ((_a = wx.getWindowInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
  5902. const deviceInfo = ((_b = wx.getDeviceInfo) === null || _b === void 0 ? void 0 : _b.call(wx)) || wx.getSystemInfoSync();
  5903. windowWidth = windowInfo.windowWidth;
  5904. pixelRatio = windowInfo.pixelRatio;
  5905. platform = deviceInfo.platform;
  5906. }
  5907. deviceWidth = windowWidth;
  5908. deviceDPR = pixelRatio;
  5909. isIOS = platform === "ios";
  5910. }
  5911. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  5912. if (deviceWidth === 0) {
  5913. checkDeviceWidth();
  5914. }
  5915. number = Number(number);
  5916. if (number === 0) {
  5917. return 0;
  5918. }
  5919. let width = newDeviceWidth || deviceWidth;
  5920. let result = number / BASE_DEVICE_WIDTH * width;
  5921. if (result < 0) {
  5922. result = -result;
  5923. }
  5924. result = Math.floor(result + EPS);
  5925. if (result === 0) {
  5926. if (deviceDPR === 1 || !isIOS) {
  5927. result = 1;
  5928. } else {
  5929. result = 0.5;
  5930. }
  5931. }
  5932. return number < 0 ? -result : result;
  5933. }, Upx2pxProtocol);
  5934. function __f__(type, filename, ...args) {
  5935. if (filename) {
  5936. args.push(filename);
  5937. }
  5938. console[type].apply(console, args);
  5939. }
  5940. const API_ADD_INTERCEPTOR = "addInterceptor";
  5941. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  5942. const AddInterceptorProtocol = [
  5943. {
  5944. name: "method",
  5945. type: [String, Object],
  5946. required: true
  5947. }
  5948. ];
  5949. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  5950. function mergeInterceptorHook(interceptors2, interceptor) {
  5951. Object.keys(interceptor).forEach((hook) => {
  5952. if (isFunction(interceptor[hook])) {
  5953. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  5954. }
  5955. });
  5956. }
  5957. function removeInterceptorHook(interceptors2, interceptor) {
  5958. if (!interceptors2 || !interceptor) {
  5959. return;
  5960. }
  5961. Object.keys(interceptor).forEach((name) => {
  5962. const hooks = interceptors2[name];
  5963. const hook = interceptor[name];
  5964. if (isArray(hooks) && isFunction(hook)) {
  5965. remove(hooks, hook);
  5966. }
  5967. });
  5968. }
  5969. function mergeHook(parentVal, childVal) {
  5970. const res2 = childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
  5971. return res2 ? dedupeHooks(res2) : res2;
  5972. }
  5973. function dedupeHooks(hooks) {
  5974. const res2 = [];
  5975. for (let i = 0; i < hooks.length; i++) {
  5976. if (res2.indexOf(hooks[i]) === -1) {
  5977. res2.push(hooks[i]);
  5978. }
  5979. }
  5980. return res2;
  5981. }
  5982. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  5983. if (isString(method) && isPlainObject(interceptor)) {
  5984. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  5985. } else if (isPlainObject(method)) {
  5986. mergeInterceptorHook(globalInterceptors, method);
  5987. }
  5988. }, AddInterceptorProtocol);
  5989. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  5990. if (isString(method)) {
  5991. if (isPlainObject(interceptor)) {
  5992. removeInterceptorHook(scopedInterceptors[method], interceptor);
  5993. } else {
  5994. delete scopedInterceptors[method];
  5995. }
  5996. } else if (isPlainObject(method)) {
  5997. removeInterceptorHook(globalInterceptors, method);
  5998. }
  5999. }, RemoveInterceptorProtocol);
  6000. const interceptors = {};
  6001. const API_ON = "$on";
  6002. const OnProtocol = [
  6003. {
  6004. name: "event",
  6005. type: String,
  6006. required: true
  6007. },
  6008. {
  6009. name: "callback",
  6010. type: Function,
  6011. required: true
  6012. }
  6013. ];
  6014. const API_ONCE = "$once";
  6015. const OnceProtocol = OnProtocol;
  6016. const API_OFF = "$off";
  6017. const OffProtocol = [
  6018. {
  6019. name: "event",
  6020. type: [String, Array]
  6021. },
  6022. {
  6023. name: "callback",
  6024. type: [Function, Number]
  6025. }
  6026. ];
  6027. const API_EMIT = "$emit";
  6028. const EmitProtocol = [
  6029. {
  6030. name: "event",
  6031. type: String,
  6032. required: true
  6033. }
  6034. ];
  6035. class EventBus {
  6036. constructor() {
  6037. this.$emitter = new E$1();
  6038. }
  6039. on(name, callback) {
  6040. return this.$emitter.on(name, callback);
  6041. }
  6042. once(name, callback) {
  6043. return this.$emitter.once(name, callback);
  6044. }
  6045. off(name, callback) {
  6046. if (!name) {
  6047. this.$emitter.e = {};
  6048. return;
  6049. }
  6050. this.$emitter.off(name, callback);
  6051. }
  6052. emit(name, ...args) {
  6053. this.$emitter.emit(name, ...args);
  6054. }
  6055. }
  6056. const eventBus = new EventBus();
  6057. const $on = defineSyncApi(API_ON, (name, callback) => {
  6058. eventBus.on(name, callback);
  6059. return () => eventBus.off(name, callback);
  6060. }, OnProtocol);
  6061. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  6062. eventBus.once(name, callback);
  6063. return () => eventBus.off(name, callback);
  6064. }, OnceProtocol);
  6065. const $off = defineSyncApi(API_OFF, (name, callback) => {
  6066. if (!isArray(name))
  6067. name = name ? [name] : [];
  6068. name.forEach((n2) => {
  6069. eventBus.off(n2, callback);
  6070. });
  6071. }, OffProtocol);
  6072. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  6073. eventBus.emit(name, ...args);
  6074. }, EmitProtocol);
  6075. let cid;
  6076. let cidErrMsg;
  6077. let enabled;
  6078. function normalizePushMessage(message) {
  6079. try {
  6080. return JSON.parse(message);
  6081. } catch (e2) {
  6082. }
  6083. return message;
  6084. }
  6085. function invokePushCallback(args) {
  6086. if (args.type === "enabled") {
  6087. enabled = true;
  6088. } else if (args.type === "clientId") {
  6089. cid = args.cid;
  6090. cidErrMsg = args.errMsg;
  6091. invokeGetPushCidCallbacks(cid, args.errMsg);
  6092. } else if (args.type === "pushMsg") {
  6093. const message = {
  6094. type: "receive",
  6095. data: normalizePushMessage(args.message)
  6096. };
  6097. for (let i = 0; i < onPushMessageCallbacks.length; i++) {
  6098. const callback = onPushMessageCallbacks[i];
  6099. callback(message);
  6100. if (message.stopped) {
  6101. break;
  6102. }
  6103. }
  6104. } else if (args.type === "click") {
  6105. onPushMessageCallbacks.forEach((callback) => {
  6106. callback({
  6107. type: "click",
  6108. data: normalizePushMessage(args.message)
  6109. });
  6110. });
  6111. }
  6112. }
  6113. const getPushCidCallbacks = [];
  6114. function invokeGetPushCidCallbacks(cid2, errMsg) {
  6115. getPushCidCallbacks.forEach((callback) => {
  6116. callback(cid2, errMsg);
  6117. });
  6118. getPushCidCallbacks.length = 0;
  6119. }
  6120. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  6121. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
  6122. Promise.resolve().then(() => {
  6123. if (typeof enabled === "undefined") {
  6124. enabled = false;
  6125. cid = "";
  6126. cidErrMsg = "uniPush is not enabled";
  6127. }
  6128. getPushCidCallbacks.push((cid2, errMsg) => {
  6129. if (cid2) {
  6130. resolve2({ cid: cid2 });
  6131. } else {
  6132. reject(errMsg);
  6133. }
  6134. });
  6135. if (typeof cid !== "undefined") {
  6136. invokeGetPushCidCallbacks(cid, cidErrMsg);
  6137. }
  6138. });
  6139. });
  6140. const onPushMessageCallbacks = [];
  6141. const onPushMessage = (fn) => {
  6142. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  6143. onPushMessageCallbacks.push(fn);
  6144. }
  6145. };
  6146. const offPushMessage = (fn) => {
  6147. if (!fn) {
  6148. onPushMessageCallbacks.length = 0;
  6149. } else {
  6150. const index2 = onPushMessageCallbacks.indexOf(fn);
  6151. if (index2 > -1) {
  6152. onPushMessageCallbacks.splice(index2, 1);
  6153. }
  6154. }
  6155. };
  6156. const SYNC_API_RE = /^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
  6157. const CONTEXT_API_RE = /^create|Manager$/;
  6158. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  6159. const TASK_APIS = ["request", "downloadFile", "uploadFile", "connectSocket"];
  6160. const ASYNC_API = ["createBLEConnection"];
  6161. const CALLBACK_API_RE = /^on|^off/;
  6162. function isContextApi(name) {
  6163. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  6164. }
  6165. function isSyncApi(name) {
  6166. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  6167. }
  6168. function isCallbackApi(name) {
  6169. return CALLBACK_API_RE.test(name) && name !== "onPush";
  6170. }
  6171. function isTaskApi(name) {
  6172. return TASK_APIS.indexOf(name) !== -1;
  6173. }
  6174. function shouldPromise(name) {
  6175. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  6176. return false;
  6177. }
  6178. return true;
  6179. }
  6180. if (!Promise.prototype.finally) {
  6181. Promise.prototype.finally = function(onfinally) {
  6182. const promise = this.constructor;
  6183. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  6184. throw reason;
  6185. }));
  6186. };
  6187. }
  6188. function promisify(name, api) {
  6189. if (!shouldPromise(name)) {
  6190. return api;
  6191. }
  6192. if (!isFunction(api)) {
  6193. return api;
  6194. }
  6195. return function promiseApi(options = {}, ...rest) {
  6196. if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
  6197. return wrapperReturnValue(name, invokeApi(name, api, extend({}, options), rest));
  6198. }
  6199. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  6200. invokeApi(name, api, extend({}, options, {
  6201. success: resolve2,
  6202. fail: reject
  6203. }), rest);
  6204. })));
  6205. };
  6206. }
  6207. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  6208. function initWrapper(protocols2) {
  6209. function processCallback(methodName, method, returnValue) {
  6210. return function(res2) {
  6211. return method(processReturnValue(methodName, res2, returnValue));
  6212. };
  6213. }
  6214. function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
  6215. if (isPlainObject(fromArgs)) {
  6216. const toArgs = keepFromArgs === true ? fromArgs : {};
  6217. if (isFunction(argsOption)) {
  6218. argsOption = argsOption(fromArgs, toArgs) || {};
  6219. }
  6220. for (const key in fromArgs) {
  6221. if (hasOwn$1(argsOption, key)) {
  6222. let keyOption = argsOption[key];
  6223. if (isFunction(keyOption)) {
  6224. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  6225. }
  6226. if (!keyOption) {
  6227. console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
  6228. } else if (isString(keyOption)) {
  6229. toArgs[keyOption] = fromArgs[key];
  6230. } else if (isPlainObject(keyOption)) {
  6231. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  6232. }
  6233. } else if (CALLBACKS.indexOf(key) !== -1) {
  6234. const callback = fromArgs[key];
  6235. if (isFunction(callback)) {
  6236. toArgs[key] = processCallback(methodName, callback, returnValue);
  6237. }
  6238. } else {
  6239. if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
  6240. toArgs[key] = fromArgs[key];
  6241. }
  6242. }
  6243. }
  6244. return toArgs;
  6245. } else if (isFunction(fromArgs)) {
  6246. if (isFunction(argsOption)) {
  6247. argsOption(fromArgs, {});
  6248. }
  6249. fromArgs = processCallback(methodName, fromArgs, returnValue);
  6250. }
  6251. return fromArgs;
  6252. }
  6253. function processReturnValue(methodName, res2, returnValue, keepReturnValue = false) {
  6254. if (isFunction(protocols2.returnValue)) {
  6255. res2 = protocols2.returnValue(methodName, res2);
  6256. }
  6257. const realKeepReturnValue = keepReturnValue || false;
  6258. return processArgs(methodName, res2, returnValue, {}, realKeepReturnValue);
  6259. }
  6260. return function wrapper(methodName, method) {
  6261. const hasProtocol = hasOwn$1(protocols2, methodName);
  6262. if (!hasProtocol && typeof wx[methodName] !== "function") {
  6263. return method;
  6264. }
  6265. const needWrapper = hasProtocol || isFunction(protocols2.returnValue) || isContextApi(methodName) || isTaskApi(methodName);
  6266. const hasMethod = hasProtocol || isFunction(method);
  6267. if (!hasProtocol && !method) {
  6268. return function() {
  6269. console.error(`微信小程序 暂不支持${methodName}`);
  6270. };
  6271. }
  6272. if (!needWrapper || !hasMethod) {
  6273. return method;
  6274. }
  6275. const protocol = protocols2[methodName];
  6276. return function(arg1, arg2) {
  6277. let options = protocol || {};
  6278. if (isFunction(protocol)) {
  6279. options = protocol(arg1);
  6280. }
  6281. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  6282. const args = [arg1];
  6283. if (typeof arg2 !== "undefined") {
  6284. args.push(arg2);
  6285. }
  6286. const returnValue = wx[options.name || methodName].apply(wx, args);
  6287. if (isContextApi(methodName) || isTaskApi(methodName)) {
  6288. if (returnValue && !returnValue.__v_skip) {
  6289. returnValue.__v_skip = true;
  6290. }
  6291. }
  6292. if (isSyncApi(methodName)) {
  6293. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  6294. }
  6295. return returnValue;
  6296. };
  6297. };
  6298. }
  6299. const getLocale = () => {
  6300. const app = isFunction(getApp) && getApp({ allowDefault: true });
  6301. if (app && app.$vm) {
  6302. return app.$vm.$locale;
  6303. }
  6304. return getLocaleLanguage$1();
  6305. };
  6306. const setLocale = (locale) => {
  6307. const app = isFunction(getApp) && getApp();
  6308. if (!app) {
  6309. return false;
  6310. }
  6311. const oldLocale = app.$vm.$locale;
  6312. if (oldLocale !== locale) {
  6313. app.$vm.$locale = locale;
  6314. onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
  6315. return true;
  6316. }
  6317. return false;
  6318. };
  6319. const onLocaleChangeCallbacks = [];
  6320. const onLocaleChange = (fn) => {
  6321. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  6322. onLocaleChangeCallbacks.push(fn);
  6323. }
  6324. };
  6325. if (typeof global !== "undefined") {
  6326. global.getLocale = getLocale;
  6327. }
  6328. const UUID_KEY = "__DC_STAT_UUID";
  6329. let deviceId;
  6330. function useDeviceId(global2 = wx) {
  6331. return function addDeviceId(_, toRes) {
  6332. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  6333. if (!deviceId) {
  6334. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  6335. wx.setStorage({
  6336. key: UUID_KEY,
  6337. data: deviceId
  6338. });
  6339. }
  6340. toRes.deviceId = deviceId;
  6341. };
  6342. }
  6343. function addSafeAreaInsets(fromRes, toRes) {
  6344. if (fromRes.safeArea) {
  6345. const safeArea = fromRes.safeArea;
  6346. toRes.safeAreaInsets = {
  6347. top: safeArea.top,
  6348. left: safeArea.left,
  6349. right: fromRes.windowWidth - safeArea.right,
  6350. bottom: fromRes.screenHeight - safeArea.bottom
  6351. };
  6352. }
  6353. }
  6354. function getOSInfo(system, platform) {
  6355. let osName = "";
  6356. let osVersion = "";
  6357. if (platform && false) {
  6358. osName = platform;
  6359. osVersion = system;
  6360. } else {
  6361. osName = system.split(" ")[0] || platform;
  6362. osVersion = system.split(" ")[1] || "";
  6363. }
  6364. osName = osName.toLowerCase();
  6365. switch (osName) {
  6366. case "harmony":
  6367. case "ohos":
  6368. case "openharmony":
  6369. osName = "harmonyos";
  6370. break;
  6371. case "iphone os":
  6372. osName = "ios";
  6373. break;
  6374. case "mac":
  6375. case "darwin":
  6376. osName = "macos";
  6377. break;
  6378. case "windows_nt":
  6379. osName = "windows";
  6380. break;
  6381. }
  6382. return {
  6383. osName,
  6384. osVersion
  6385. };
  6386. }
  6387. function populateParameters(fromRes, toRes) {
  6388. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  6389. const { osName, osVersion } = getOSInfo(system, platform);
  6390. let hostVersion = version2;
  6391. let deviceType = getGetDeviceType(fromRes, model);
  6392. let deviceBrand = getDeviceBrand(brand);
  6393. let _hostName = getHostName(fromRes);
  6394. let _deviceOrientation = deviceOrientation;
  6395. let _devicePixelRatio = pixelRatio;
  6396. let _SDKVersion = SDKVersion;
  6397. const hostLanguage = (language || "").replace(/_/g, "-");
  6398. const parameters = {
  6399. appId: "__UNI__2391417",
  6400. appName: "uni-app-demo",
  6401. appVersion: "1.0.0",
  6402. appVersionCode: "100",
  6403. appLanguage: getAppLanguage(hostLanguage),
  6404. uniCompileVersion: "4.76",
  6405. uniCompilerVersion: "4.76",
  6406. uniRuntimeVersion: "4.76",
  6407. uniPlatform: "mp-weixin",
  6408. deviceBrand,
  6409. deviceModel: model,
  6410. deviceType,
  6411. devicePixelRatio: _devicePixelRatio,
  6412. deviceOrientation: _deviceOrientation,
  6413. osName,
  6414. osVersion,
  6415. hostTheme: theme,
  6416. hostVersion,
  6417. hostLanguage,
  6418. hostName: _hostName,
  6419. hostSDKVersion: _SDKVersion,
  6420. hostFontSizeSetting: fontSizeSetting,
  6421. windowTop: 0,
  6422. windowBottom: 0,
  6423. // TODO
  6424. osLanguage: void 0,
  6425. osTheme: void 0,
  6426. ua: void 0,
  6427. hostPackageName: void 0,
  6428. browserName: void 0,
  6429. browserVersion: void 0,
  6430. isUniAppX: false
  6431. };
  6432. extend(toRes, parameters);
  6433. }
  6434. function getGetDeviceType(fromRes, model) {
  6435. let deviceType = fromRes.deviceType || "phone";
  6436. {
  6437. const deviceTypeMaps = {
  6438. ipad: "pad",
  6439. windows: "pc",
  6440. mac: "pc"
  6441. };
  6442. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  6443. const _model = model.toLowerCase();
  6444. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  6445. const _m = deviceTypeMapsKeys[index2];
  6446. if (_model.indexOf(_m) !== -1) {
  6447. deviceType = deviceTypeMaps[_m];
  6448. break;
  6449. }
  6450. }
  6451. }
  6452. return deviceType;
  6453. }
  6454. function getDeviceBrand(brand) {
  6455. let deviceBrand = brand;
  6456. if (deviceBrand) {
  6457. deviceBrand = deviceBrand.toLowerCase();
  6458. }
  6459. return deviceBrand;
  6460. }
  6461. function getAppLanguage(defaultLanguage) {
  6462. return getLocale ? getLocale() : defaultLanguage;
  6463. }
  6464. function getHostName(fromRes) {
  6465. const _platform = "WeChat";
  6466. let _hostName = fromRes.hostName || _platform;
  6467. {
  6468. if (fromRes.environment) {
  6469. _hostName = fromRes.environment;
  6470. } else if (fromRes.host && fromRes.host.env) {
  6471. _hostName = fromRes.host.env;
  6472. }
  6473. }
  6474. return _hostName;
  6475. }
  6476. const getSystemInfo = {
  6477. returnValue: (fromRes, toRes) => {
  6478. addSafeAreaInsets(fromRes, toRes);
  6479. useDeviceId()(fromRes, toRes);
  6480. populateParameters(fromRes, toRes);
  6481. }
  6482. };
  6483. const getSystemInfoSync = getSystemInfo;
  6484. const redirectTo = {};
  6485. const previewImage = {
  6486. args(fromArgs, toArgs) {
  6487. let currentIndex = parseInt(fromArgs.current);
  6488. if (isNaN(currentIndex)) {
  6489. return;
  6490. }
  6491. const urls = fromArgs.urls;
  6492. if (!isArray(urls)) {
  6493. return;
  6494. }
  6495. const len = urls.length;
  6496. if (!len) {
  6497. return;
  6498. }
  6499. if (currentIndex < 0) {
  6500. currentIndex = 0;
  6501. } else if (currentIndex >= len) {
  6502. currentIndex = len - 1;
  6503. }
  6504. if (currentIndex > 0) {
  6505. toArgs.current = urls[currentIndex];
  6506. toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
  6507. } else {
  6508. toArgs.current = urls[0];
  6509. }
  6510. return {
  6511. indicator: false,
  6512. loop: false
  6513. };
  6514. }
  6515. };
  6516. const showActionSheet = {
  6517. args(fromArgs, toArgs) {
  6518. toArgs.alertText = fromArgs.title;
  6519. }
  6520. };
  6521. const getDeviceInfo = {
  6522. returnValue: (fromRes, toRes) => {
  6523. const { brand, model, system = "", platform = "" } = fromRes;
  6524. let deviceType = getGetDeviceType(fromRes, model);
  6525. let deviceBrand = getDeviceBrand(brand);
  6526. useDeviceId()(fromRes, toRes);
  6527. const { osName, osVersion } = getOSInfo(system, platform);
  6528. toRes = sortObject(extend(toRes, {
  6529. deviceType,
  6530. deviceBrand,
  6531. deviceModel: model,
  6532. osName,
  6533. osVersion
  6534. }));
  6535. }
  6536. };
  6537. const getAppBaseInfo = {
  6538. returnValue: (fromRes, toRes) => {
  6539. const { version: version2, language, SDKVersion, theme } = fromRes;
  6540. let _hostName = getHostName(fromRes);
  6541. let hostLanguage = (language || "").replace(/_/g, "-");
  6542. const parameters = {
  6543. hostVersion: version2,
  6544. hostLanguage,
  6545. hostName: _hostName,
  6546. hostSDKVersion: SDKVersion,
  6547. hostTheme: theme,
  6548. appId: "__UNI__2391417",
  6549. appName: "uni-app-demo",
  6550. appVersion: "1.0.0",
  6551. appVersionCode: "100",
  6552. appLanguage: getAppLanguage(hostLanguage),
  6553. isUniAppX: false,
  6554. uniPlatform: "mp-weixin",
  6555. uniCompileVersion: "4.76",
  6556. uniCompilerVersion: "4.76",
  6557. uniRuntimeVersion: "4.76"
  6558. };
  6559. extend(toRes, parameters);
  6560. }
  6561. };
  6562. const getWindowInfo = {
  6563. returnValue: (fromRes, toRes) => {
  6564. addSafeAreaInsets(fromRes, toRes);
  6565. toRes = sortObject(extend(toRes, {
  6566. windowTop: 0,
  6567. windowBottom: 0
  6568. }));
  6569. }
  6570. };
  6571. const getAppAuthorizeSetting = {
  6572. returnValue: function(fromRes, toRes) {
  6573. const { locationReducedAccuracy } = fromRes;
  6574. toRes.locationAccuracy = "unsupported";
  6575. if (locationReducedAccuracy === true) {
  6576. toRes.locationAccuracy = "reduced";
  6577. } else if (locationReducedAccuracy === false) {
  6578. toRes.locationAccuracy = "full";
  6579. }
  6580. }
  6581. };
  6582. const onError = {
  6583. args(fromArgs) {
  6584. const app = getApp({ allowDefault: true }) || {};
  6585. if (!app.$vm) {
  6586. if (!wx.$onErrorHandlers) {
  6587. wx.$onErrorHandlers = [];
  6588. }
  6589. wx.$onErrorHandlers.push(fromArgs);
  6590. } else {
  6591. injectHook(ON_ERROR, fromArgs, app.$vm.$);
  6592. }
  6593. }
  6594. };
  6595. const offError = {
  6596. args(fromArgs) {
  6597. const app = getApp({ allowDefault: true }) || {};
  6598. if (!app.$vm) {
  6599. if (!wx.$onErrorHandlers) {
  6600. return;
  6601. }
  6602. const index2 = wx.$onErrorHandlers.findIndex((fn) => fn === fromArgs);
  6603. if (index2 !== -1) {
  6604. wx.$onErrorHandlers.splice(index2, 1);
  6605. }
  6606. } else if (fromArgs.__weh) {
  6607. const onErrors = app.$vm.$[ON_ERROR];
  6608. if (onErrors) {
  6609. const index2 = onErrors.indexOf(fromArgs.__weh);
  6610. if (index2 > -1) {
  6611. onErrors.splice(index2, 1);
  6612. }
  6613. }
  6614. }
  6615. }
  6616. };
  6617. const onSocketOpen = {
  6618. args() {
  6619. if (wx.__uni_console__) {
  6620. if (wx.__uni_console_warned__) {
  6621. return;
  6622. }
  6623. wx.__uni_console_warned__ = true;
  6624. console.warn(`开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)`);
  6625. }
  6626. }
  6627. };
  6628. const onSocketMessage = onSocketOpen;
  6629. const baseApis = {
  6630. $on,
  6631. $off,
  6632. $once,
  6633. $emit,
  6634. upx2px,
  6635. rpx2px: upx2px,
  6636. interceptors,
  6637. addInterceptor,
  6638. removeInterceptor,
  6639. onCreateVueApp,
  6640. invokeCreateVueAppHook,
  6641. getLocale,
  6642. setLocale,
  6643. onLocaleChange,
  6644. getPushClientId,
  6645. onPushMessage,
  6646. offPushMessage,
  6647. invokePushCallback,
  6648. __f__
  6649. };
  6650. function initUni(api, protocols2, platform = wx) {
  6651. const wrapper = initWrapper(protocols2);
  6652. const UniProxyHandlers = {
  6653. get(target, key) {
  6654. if (hasOwn$1(target, key)) {
  6655. return target[key];
  6656. }
  6657. if (hasOwn$1(api, key)) {
  6658. return promisify(key, api[key]);
  6659. }
  6660. if (hasOwn$1(baseApis, key)) {
  6661. return promisify(key, baseApis[key]);
  6662. }
  6663. return promisify(key, wrapper(key, platform[key]));
  6664. }
  6665. };
  6666. return new Proxy({}, UniProxyHandlers);
  6667. }
  6668. function initGetProvider(providers) {
  6669. return function getProvider2({ service, success, fail, complete }) {
  6670. let res2;
  6671. if (providers[service]) {
  6672. res2 = {
  6673. errMsg: "getProvider:ok",
  6674. service,
  6675. provider: providers[service]
  6676. };
  6677. isFunction(success) && success(res2);
  6678. } else {
  6679. res2 = {
  6680. errMsg: "getProvider:fail:服务[" + service + "]不存在"
  6681. };
  6682. isFunction(fail) && fail(res2);
  6683. }
  6684. isFunction(complete) && complete(res2);
  6685. };
  6686. }
  6687. const objectKeys = [
  6688. "qy",
  6689. "env",
  6690. "error",
  6691. "version",
  6692. "lanDebug",
  6693. "cloud",
  6694. "serviceMarket",
  6695. "router",
  6696. "worklet",
  6697. "__webpack_require_UNI_MP_PLUGIN__"
  6698. ];
  6699. const singlePageDisableKey = ["lanDebug", "router", "worklet"];
  6700. const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
  6701. function isWxKey(key) {
  6702. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  6703. return false;
  6704. }
  6705. return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
  6706. }
  6707. function initWx() {
  6708. const newWx = {};
  6709. for (const key in wx) {
  6710. if (isWxKey(key)) {
  6711. newWx[key] = wx[key];
  6712. }
  6713. }
  6714. if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
  6715. globalThis.wx = newWx;
  6716. }
  6717. return newWx;
  6718. }
  6719. const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  6720. const getProvider = initGetProvider({
  6721. oauth: ["weixin"],
  6722. share: ["weixin"],
  6723. payment: ["wxpay"],
  6724. push: ["weixin"]
  6725. });
  6726. function initComponentMocks(component) {
  6727. const res2 = /* @__PURE__ */ Object.create(null);
  6728. mocks$1.forEach((name) => {
  6729. res2[name] = component[name];
  6730. });
  6731. return res2;
  6732. }
  6733. function createSelectorQuery() {
  6734. const query = wx$2.createSelectorQuery();
  6735. const oldIn = query.in;
  6736. query.in = function newIn(component) {
  6737. if (component.$scope) {
  6738. return oldIn.call(this, component.$scope);
  6739. }
  6740. return oldIn.call(this, initComponentMocks(component));
  6741. };
  6742. return query;
  6743. }
  6744. const wx$2 = initWx();
  6745. if (!wx$2.canIUse("getAppBaseInfo")) {
  6746. wx$2.getAppBaseInfo = wx$2.getSystemInfoSync;
  6747. }
  6748. if (!wx$2.canIUse("getWindowInfo")) {
  6749. wx$2.getWindowInfo = wx$2.getSystemInfoSync;
  6750. }
  6751. if (!wx$2.canIUse("getDeviceInfo")) {
  6752. wx$2.getDeviceInfo = wx$2.getSystemInfoSync;
  6753. }
  6754. let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
  6755. if (!baseInfo) {
  6756. baseInfo = wx$2.getSystemInfoSync();
  6757. }
  6758. const host = baseInfo ? baseInfo.host : null;
  6759. const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
  6760. var shims = /* @__PURE__ */ Object.freeze({
  6761. __proto__: null,
  6762. createSelectorQuery,
  6763. getProvider,
  6764. shareVideoMessage
  6765. });
  6766. const compressImage = {
  6767. args(fromArgs, toArgs) {
  6768. if (fromArgs.compressedHeight && !toArgs.compressHeight) {
  6769. toArgs.compressHeight = fromArgs.compressedHeight;
  6770. }
  6771. if (fromArgs.compressedWidth && !toArgs.compressWidth) {
  6772. toArgs.compressWidth = fromArgs.compressedWidth;
  6773. }
  6774. }
  6775. };
  6776. var protocols = /* @__PURE__ */ Object.freeze({
  6777. __proto__: null,
  6778. compressImage,
  6779. getAppAuthorizeSetting,
  6780. getAppBaseInfo,
  6781. getDeviceInfo,
  6782. getSystemInfo,
  6783. getSystemInfoSync,
  6784. getWindowInfo,
  6785. offError,
  6786. onError,
  6787. onSocketMessage,
  6788. onSocketOpen,
  6789. previewImage,
  6790. redirectTo,
  6791. showActionSheet
  6792. });
  6793. const wx$1 = initWx();
  6794. var index = initUni(shims, protocols, wx$1);
  6795. function initRuntimeSocket(hosts, port, id) {
  6796. if (hosts == "" || port == "" || id == "")
  6797. return Promise.resolve(null);
  6798. return hosts.split(",").reduce((promise, host2) => {
  6799. return promise.then((socket) => {
  6800. if (socket != null)
  6801. return Promise.resolve(socket);
  6802. return tryConnectSocket(host2, port, id);
  6803. });
  6804. }, Promise.resolve(null));
  6805. }
  6806. const SOCKET_TIMEOUT = 500;
  6807. function tryConnectSocket(host2, port, id) {
  6808. return new Promise((resolve2, reject) => {
  6809. const socket = index.connectSocket({
  6810. url: `ws://${host2}:${port}/${id}`,
  6811. multiple: true,
  6812. // 支付宝小程序 是否开启多实例
  6813. fail() {
  6814. resolve2(null);
  6815. }
  6816. });
  6817. const timer = setTimeout(() => {
  6818. socket.close({
  6819. code: 1006,
  6820. reason: "connect timeout"
  6821. });
  6822. resolve2(null);
  6823. }, SOCKET_TIMEOUT);
  6824. socket.onOpen((e2) => {
  6825. clearTimeout(timer);
  6826. resolve2(socket);
  6827. });
  6828. socket.onClose((e2) => {
  6829. clearTimeout(timer);
  6830. resolve2(null);
  6831. });
  6832. socket.onError((e2) => {
  6833. clearTimeout(timer);
  6834. resolve2(null);
  6835. });
  6836. });
  6837. }
  6838. const CONSOLE_TYPES = ["log", "warn", "error", "info", "debug"];
  6839. const originalConsole = /* @__PURE__ */ CONSOLE_TYPES.reduce((methods, type) => {
  6840. methods[type] = console[type].bind(console);
  6841. return methods;
  6842. }, {});
  6843. let sendError = null;
  6844. const errorQueue = /* @__PURE__ */ new Set();
  6845. const errorExtra = {};
  6846. function sendErrorMessages(errors) {
  6847. if (sendError == null) {
  6848. errors.forEach((error) => {
  6849. errorQueue.add(error);
  6850. });
  6851. return;
  6852. }
  6853. const data = errors.map((err) => {
  6854. if (typeof err === "string") {
  6855. return err;
  6856. }
  6857. const isPromiseRejection = err && "promise" in err && "reason" in err;
  6858. const prefix = isPromiseRejection ? "UnhandledPromiseRejection: " : "";
  6859. if (isPromiseRejection) {
  6860. err = err.reason;
  6861. }
  6862. if (err instanceof Error && err.stack) {
  6863. if (err.message && !err.stack.includes(err.message)) {
  6864. return `${prefix}${err.message}
  6865. ${err.stack}`;
  6866. }
  6867. return `${prefix}${err.stack}`;
  6868. }
  6869. if (typeof err === "object" && err !== null) {
  6870. try {
  6871. return prefix + JSON.stringify(err);
  6872. } catch (err2) {
  6873. return prefix + String(err2);
  6874. }
  6875. }
  6876. return prefix + String(err);
  6877. }).filter(Boolean);
  6878. if (data.length > 0) {
  6879. sendError(JSON.stringify(Object.assign({
  6880. type: "error",
  6881. data
  6882. }, errorExtra)));
  6883. }
  6884. }
  6885. function setSendError(value, extra = {}) {
  6886. sendError = value;
  6887. Object.assign(errorExtra, extra);
  6888. if (value != null && errorQueue.size > 0) {
  6889. const errors = Array.from(errorQueue);
  6890. errorQueue.clear();
  6891. sendErrorMessages(errors);
  6892. }
  6893. }
  6894. function initOnError() {
  6895. function onError2(error) {
  6896. try {
  6897. if (typeof PromiseRejectionEvent !== "undefined" && error instanceof PromiseRejectionEvent && error.reason instanceof Error && error.reason.message && error.reason.message.includes(`Cannot create property 'errMsg' on string 'taskId`)) {
  6898. return;
  6899. }
  6900. if (true) {
  6901. originalConsole.error(error);
  6902. }
  6903. sendErrorMessages([error]);
  6904. } catch (err) {
  6905. originalConsole.error(err);
  6906. }
  6907. }
  6908. if (typeof index.onError === "function") {
  6909. index.onError(onError2);
  6910. }
  6911. if (typeof index.onUnhandledRejection === "function") {
  6912. index.onUnhandledRejection(onError2);
  6913. }
  6914. return function offError2() {
  6915. if (typeof index.offError === "function") {
  6916. index.offError(onError2);
  6917. }
  6918. if (typeof index.offUnhandledRejection === "function") {
  6919. index.offUnhandledRejection(onError2);
  6920. }
  6921. };
  6922. }
  6923. function formatMessage(type, args) {
  6924. try {
  6925. return {
  6926. type,
  6927. args: formatArgs(args)
  6928. };
  6929. } catch (e2) {
  6930. }
  6931. return {
  6932. type,
  6933. args: []
  6934. };
  6935. }
  6936. function formatArgs(args) {
  6937. return args.map((arg) => formatArg(arg));
  6938. }
  6939. function formatArg(arg, depth = 0) {
  6940. if (depth >= 7) {
  6941. return {
  6942. type: "object",
  6943. value: "[Maximum depth reached]"
  6944. };
  6945. }
  6946. const type = typeof arg;
  6947. switch (type) {
  6948. case "string":
  6949. return formatString(arg);
  6950. case "number":
  6951. return formatNumber$1(arg);
  6952. case "boolean":
  6953. return formatBoolean(arg);
  6954. case "object":
  6955. try {
  6956. return formatObject(arg, depth);
  6957. } catch (e2) {
  6958. return {
  6959. type: "object",
  6960. value: {
  6961. properties: []
  6962. }
  6963. };
  6964. }
  6965. case "undefined":
  6966. return formatUndefined();
  6967. case "function":
  6968. return formatFunction(arg);
  6969. case "symbol": {
  6970. return formatSymbol(arg);
  6971. }
  6972. case "bigint":
  6973. return formatBigInt(arg);
  6974. }
  6975. }
  6976. function formatFunction(value) {
  6977. return {
  6978. type: "function",
  6979. value: `function ${value.name}() {}`
  6980. };
  6981. }
  6982. function formatUndefined() {
  6983. return {
  6984. type: "undefined"
  6985. };
  6986. }
  6987. function formatBoolean(value) {
  6988. return {
  6989. type: "boolean",
  6990. value: String(value)
  6991. };
  6992. }
  6993. function formatNumber$1(value) {
  6994. return {
  6995. type: "number",
  6996. value: String(value)
  6997. };
  6998. }
  6999. function formatBigInt(value) {
  7000. return {
  7001. type: "bigint",
  7002. value: String(value)
  7003. };
  7004. }
  7005. function formatString(value) {
  7006. return {
  7007. type: "string",
  7008. value
  7009. };
  7010. }
  7011. function formatSymbol(value) {
  7012. return {
  7013. type: "symbol",
  7014. value: value.description
  7015. };
  7016. }
  7017. function formatObject(value, depth) {
  7018. if (value === null) {
  7019. return {
  7020. type: "null"
  7021. };
  7022. }
  7023. {
  7024. if (isComponentPublicInstance(value)) {
  7025. return formatComponentPublicInstance(value, depth);
  7026. }
  7027. if (isComponentInternalInstance(value)) {
  7028. return formatComponentInternalInstance(value, depth);
  7029. }
  7030. if (isUniElement(value)) {
  7031. return formatUniElement(value, depth);
  7032. }
  7033. if (isCSSStyleDeclaration(value)) {
  7034. return formatCSSStyleDeclaration(value, depth);
  7035. }
  7036. }
  7037. if (Array.isArray(value)) {
  7038. return {
  7039. type: "object",
  7040. subType: "array",
  7041. value: {
  7042. properties: value.map((v, i) => formatArrayElement(v, i, depth + 1))
  7043. }
  7044. };
  7045. }
  7046. if (value instanceof Set) {
  7047. return {
  7048. type: "object",
  7049. subType: "set",
  7050. className: "Set",
  7051. description: `Set(${value.size})`,
  7052. value: {
  7053. entries: Array.from(value).map((v) => formatSetEntry(v, depth + 1))
  7054. }
  7055. };
  7056. }
  7057. if (value instanceof Map) {
  7058. return {
  7059. type: "object",
  7060. subType: "map",
  7061. className: "Map",
  7062. description: `Map(${value.size})`,
  7063. value: {
  7064. entries: Array.from(value.entries()).map((v) => formatMapEntry(v, depth + 1))
  7065. }
  7066. };
  7067. }
  7068. if (value instanceof Promise) {
  7069. return {
  7070. type: "object",
  7071. subType: "promise",
  7072. value: {
  7073. properties: []
  7074. }
  7075. };
  7076. }
  7077. if (value instanceof RegExp) {
  7078. return {
  7079. type: "object",
  7080. subType: "regexp",
  7081. value: String(value),
  7082. className: "Regexp"
  7083. };
  7084. }
  7085. if (value instanceof Date) {
  7086. return {
  7087. type: "object",
  7088. subType: "date",
  7089. value: String(value),
  7090. className: "Date"
  7091. };
  7092. }
  7093. if (value instanceof Error) {
  7094. return {
  7095. type: "object",
  7096. subType: "error",
  7097. value: value.message || String(value),
  7098. className: value.name || "Error"
  7099. };
  7100. }
  7101. let className = void 0;
  7102. {
  7103. const constructor = value.constructor;
  7104. if (constructor) {
  7105. if (constructor.get$UTSMetadata$) {
  7106. className = constructor.get$UTSMetadata$().name;
  7107. }
  7108. }
  7109. }
  7110. let entries = Object.entries(value);
  7111. if (isHarmonyBuilderParams(value)) {
  7112. entries = entries.filter(([key]) => key !== "modifier" && key !== "nodeContent");
  7113. }
  7114. return {
  7115. type: "object",
  7116. className,
  7117. value: {
  7118. properties: entries.map((entry) => formatObjectProperty(entry[0], entry[1], depth + 1))
  7119. }
  7120. };
  7121. }
  7122. function isHarmonyBuilderParams(value) {
  7123. return value.modifier && value.modifier._attribute && value.nodeContent;
  7124. }
  7125. function isComponentPublicInstance(value) {
  7126. return value.$ && isComponentInternalInstance(value.$);
  7127. }
  7128. function isComponentInternalInstance(value) {
  7129. return value.type && value.uid != null && value.appContext;
  7130. }
  7131. function formatComponentPublicInstance(value, depth) {
  7132. return {
  7133. type: "object",
  7134. className: "ComponentPublicInstance",
  7135. value: {
  7136. properties: Object.entries(value.$.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7137. }
  7138. };
  7139. }
  7140. function formatComponentInternalInstance(value, depth) {
  7141. return {
  7142. type: "object",
  7143. className: "ComponentInternalInstance",
  7144. value: {
  7145. properties: Object.entries(value.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7146. }
  7147. };
  7148. }
  7149. function isUniElement(value) {
  7150. return value.style && value.tagName != null && value.nodeName != null;
  7151. }
  7152. function formatUniElement(value, depth) {
  7153. return {
  7154. type: "object",
  7155. // 非 x 没有 UniElement 的概念
  7156. // className: 'UniElement',
  7157. value: {
  7158. properties: Object.entries(value).filter(([name]) => [
  7159. "id",
  7160. "tagName",
  7161. "nodeName",
  7162. "dataset",
  7163. "offsetTop",
  7164. "offsetLeft",
  7165. "style"
  7166. ].includes(name)).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7167. }
  7168. };
  7169. }
  7170. function isCSSStyleDeclaration(value) {
  7171. return typeof value.getPropertyValue === "function" && typeof value.setProperty === "function" && value.$styles;
  7172. }
  7173. function formatCSSStyleDeclaration(style, depth) {
  7174. return {
  7175. type: "object",
  7176. value: {
  7177. properties: Object.entries(style.$styles).map(([name, value]) => formatObjectProperty(name, value, depth + 1))
  7178. }
  7179. };
  7180. }
  7181. function formatObjectProperty(name, value, depth) {
  7182. const result = formatArg(value, depth);
  7183. result.name = name;
  7184. return result;
  7185. }
  7186. function formatArrayElement(value, index2, depth) {
  7187. const result = formatArg(value, depth);
  7188. result.name = `${index2}`;
  7189. return result;
  7190. }
  7191. function formatSetEntry(value, depth) {
  7192. return {
  7193. value: formatArg(value, depth)
  7194. };
  7195. }
  7196. function formatMapEntry(value, depth) {
  7197. return {
  7198. key: formatArg(value[0], depth),
  7199. value: formatArg(value[1], depth)
  7200. };
  7201. }
  7202. let sendConsole = null;
  7203. const messageQueue = [];
  7204. const messageExtra = {};
  7205. const EXCEPTION_BEGIN_MARK = "---BEGIN:EXCEPTION---";
  7206. const EXCEPTION_END_MARK = "---END:EXCEPTION---";
  7207. function sendConsoleMessages(messages) {
  7208. if (sendConsole == null) {
  7209. messageQueue.push(...messages);
  7210. return;
  7211. }
  7212. sendConsole(JSON.stringify(Object.assign({
  7213. type: "console",
  7214. data: messages
  7215. }, messageExtra)));
  7216. }
  7217. function setSendConsole(value, extra = {}) {
  7218. sendConsole = value;
  7219. Object.assign(messageExtra, extra);
  7220. if (value != null && messageQueue.length > 0) {
  7221. const messages = messageQueue.slice();
  7222. messageQueue.length = 0;
  7223. sendConsoleMessages(messages);
  7224. }
  7225. }
  7226. const atFileRegex = /^\s*at\s+[\w/./-]+:\d+$/;
  7227. function rewriteConsole() {
  7228. function wrapConsole(type) {
  7229. return function(...args) {
  7230. {
  7231. const originalArgs = [...args];
  7232. if (originalArgs.length) {
  7233. const maybeAtFile = originalArgs[originalArgs.length - 1];
  7234. if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
  7235. originalArgs.pop();
  7236. }
  7237. }
  7238. originalConsole[type](...originalArgs);
  7239. }
  7240. if (type === "error" && args.length === 1) {
  7241. const arg = args[0];
  7242. if (typeof arg === "string" && arg.startsWith(EXCEPTION_BEGIN_MARK)) {
  7243. const startIndex = EXCEPTION_BEGIN_MARK.length;
  7244. const endIndex = arg.length - EXCEPTION_END_MARK.length;
  7245. sendErrorMessages([arg.slice(startIndex, endIndex)]);
  7246. return;
  7247. } else if (arg instanceof Error) {
  7248. sendErrorMessages([arg]);
  7249. return;
  7250. }
  7251. }
  7252. sendConsoleMessages([formatMessage(type, args)]);
  7253. };
  7254. }
  7255. if (isConsoleWritable()) {
  7256. CONSOLE_TYPES.forEach((type) => {
  7257. console[type] = wrapConsole(type);
  7258. });
  7259. return function restoreConsole() {
  7260. CONSOLE_TYPES.forEach((type) => {
  7261. console[type] = originalConsole[type];
  7262. });
  7263. };
  7264. } else {
  7265. {
  7266. if (typeof index !== "undefined" && index.__f__) {
  7267. const oldLog = index.__f__;
  7268. if (oldLog) {
  7269. index.__f__ = function(...args) {
  7270. const [type, filename, ...rest] = args;
  7271. oldLog(type, "", ...rest);
  7272. sendConsoleMessages([formatMessage(type, [...rest, filename])]);
  7273. };
  7274. return function restoreConsole() {
  7275. index.__f__ = oldLog;
  7276. };
  7277. }
  7278. }
  7279. }
  7280. }
  7281. return function restoreConsole() {
  7282. };
  7283. }
  7284. function isConsoleWritable() {
  7285. const value = console.log;
  7286. const sym = Symbol();
  7287. try {
  7288. console.log = sym;
  7289. } catch (ex) {
  7290. return false;
  7291. }
  7292. const isWritable = console.log === sym;
  7293. console.log = value;
  7294. return isWritable;
  7295. }
  7296. function initRuntimeSocketService() {
  7297. const hosts = "192.168.137.1,192.168.202.254,127.0.0.1";
  7298. const port = "8090";
  7299. const id = "mp-weixin_BZxuW4";
  7300. const lazy = typeof swan !== "undefined";
  7301. let restoreError = lazy ? () => {
  7302. } : initOnError();
  7303. let restoreConsole = lazy ? () => {
  7304. } : rewriteConsole();
  7305. return Promise.resolve().then(() => {
  7306. if (lazy) {
  7307. restoreError = initOnError();
  7308. restoreConsole = rewriteConsole();
  7309. }
  7310. return initRuntimeSocket(hosts, port, id).then((socket) => {
  7311. if (!socket) {
  7312. restoreError();
  7313. restoreConsole();
  7314. originalConsole.error(wrapError("开发模式下日志通道建立 socket 连接失败。"));
  7315. {
  7316. originalConsole.error(wrapError("小程序平台,请勾选不校验合法域名配置。"));
  7317. }
  7318. originalConsole.error(wrapError("如果是运行到真机,请确认手机与电脑处于同一网络。"));
  7319. return false;
  7320. }
  7321. {
  7322. initMiniProgramGlobalFlag();
  7323. }
  7324. socket.onClose(() => {
  7325. {
  7326. originalConsole.error(wrapError("开发模式下日志通道 socket 连接关闭,请在 HBuilderX 中重新运行。"));
  7327. }
  7328. restoreError();
  7329. restoreConsole();
  7330. });
  7331. setSendConsole((data) => {
  7332. socket.send({
  7333. data
  7334. });
  7335. });
  7336. setSendError((data) => {
  7337. socket.send({
  7338. data
  7339. });
  7340. });
  7341. return true;
  7342. });
  7343. });
  7344. }
  7345. const ERROR_CHAR = "‌";
  7346. function wrapError(error) {
  7347. return `${ERROR_CHAR}${error}${ERROR_CHAR}`;
  7348. }
  7349. function initMiniProgramGlobalFlag() {
  7350. if (typeof wx$1 !== "undefined") {
  7351. wx$1.__uni_console__ = true;
  7352. } else if (typeof my !== "undefined") {
  7353. my.__uni_console__ = true;
  7354. } else if (typeof tt !== "undefined") {
  7355. tt.__uni_console__ = true;
  7356. } else if (typeof swan !== "undefined") {
  7357. swan.__uni_console__ = true;
  7358. } else if (typeof qq !== "undefined") {
  7359. qq.__uni_console__ = true;
  7360. } else if (typeof ks !== "undefined") {
  7361. ks.__uni_console__ = true;
  7362. } else if (typeof jd !== "undefined") {
  7363. jd.__uni_console__ = true;
  7364. } else if (typeof xhs !== "undefined") {
  7365. xhs.__uni_console__ = true;
  7366. } else if (typeof has !== "undefined") {
  7367. has.__uni_console__ = true;
  7368. } else if (typeof qa !== "undefined") {
  7369. qa.__uni_console__ = true;
  7370. }
  7371. }
  7372. initRuntimeSocketService();
  7373. const _export_sfc = (sfc, props) => {
  7374. const target = sfc.__vccOpts || sfc;
  7375. for (const [key, val] of props) {
  7376. target[key] = val;
  7377. }
  7378. return target;
  7379. };
  7380. function initVueIds(vueIds, mpInstance) {
  7381. if (!vueIds) {
  7382. return;
  7383. }
  7384. const ids = vueIds.split(",");
  7385. const len = ids.length;
  7386. if (len === 1) {
  7387. mpInstance._$vueId = ids[0];
  7388. } else if (len === 2) {
  7389. mpInstance._$vueId = ids[0];
  7390. mpInstance._$vuePid = ids[1];
  7391. }
  7392. }
  7393. const EXTRAS = ["externalClasses"];
  7394. function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  7395. EXTRAS.forEach((name) => {
  7396. if (hasOwn$1(vueOptions, name)) {
  7397. miniProgramComponentOptions[name] = vueOptions[name];
  7398. }
  7399. });
  7400. }
  7401. const WORKLET_RE = /_(.*)_worklet_factory_/;
  7402. function initWorkletMethods(mpMethods, vueMethods) {
  7403. if (vueMethods) {
  7404. Object.keys(vueMethods).forEach((name) => {
  7405. const matches = name.match(WORKLET_RE);
  7406. if (matches) {
  7407. const workletName = matches[1];
  7408. mpMethods[name] = vueMethods[name];
  7409. mpMethods[workletName] = vueMethods[workletName];
  7410. }
  7411. });
  7412. }
  7413. }
  7414. function initWxsCallMethods(methods, wxsCallMethods) {
  7415. if (!isArray(wxsCallMethods)) {
  7416. return;
  7417. }
  7418. wxsCallMethods.forEach((callMethod) => {
  7419. methods[callMethod] = function(args) {
  7420. return this.$vm[callMethod](args);
  7421. };
  7422. });
  7423. }
  7424. function selectAllComponents(mpInstance, selector, $refs) {
  7425. const components = mpInstance.selectAllComponents(selector);
  7426. components.forEach((component) => {
  7427. const ref2 = component.properties.uR;
  7428. $refs[ref2] = component.$vm || component;
  7429. });
  7430. }
  7431. function initRefs(instance, mpInstance) {
  7432. Object.defineProperty(instance, "refs", {
  7433. get() {
  7434. const $refs = {};
  7435. selectAllComponents(mpInstance, ".r", $refs);
  7436. const forComponents = mpInstance.selectAllComponents(".r-i-f");
  7437. forComponents.forEach((component) => {
  7438. const ref2 = component.properties.uR;
  7439. if (!ref2) {
  7440. return;
  7441. }
  7442. if (!$refs[ref2]) {
  7443. $refs[ref2] = [];
  7444. }
  7445. $refs[ref2].push(component.$vm || component);
  7446. });
  7447. return $refs;
  7448. }
  7449. });
  7450. }
  7451. function findVmByVueId(instance, vuePid) {
  7452. const $children = instance.$children;
  7453. for (let i = $children.length - 1; i >= 0; i--) {
  7454. const childVm = $children[i];
  7455. if (childVm.$scope._$vueId === vuePid) {
  7456. return childVm;
  7457. }
  7458. }
  7459. let parentVm;
  7460. for (let i = $children.length - 1; i >= 0; i--) {
  7461. parentVm = findVmByVueId($children[i], vuePid);
  7462. if (parentVm) {
  7463. return parentVm;
  7464. }
  7465. }
  7466. }
  7467. function getLocaleLanguage() {
  7468. var _a;
  7469. let localeLanguage = "";
  7470. {
  7471. const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
  7472. const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
  7473. localeLanguage = normalizeLocale(language) || LOCALE_EN;
  7474. }
  7475. return localeLanguage;
  7476. }
  7477. const MP_METHODS = [
  7478. "createSelectorQuery",
  7479. "createIntersectionObserver",
  7480. "selectAllComponents",
  7481. "selectComponent"
  7482. ];
  7483. function createEmitFn(oldEmit, ctx) {
  7484. return function emit2(event, ...args) {
  7485. const scope = ctx.$scope;
  7486. if (scope && event) {
  7487. const detail = { __args__: args };
  7488. {
  7489. scope.triggerEvent(event, detail);
  7490. }
  7491. }
  7492. return oldEmit.apply(this, [event, ...args]);
  7493. };
  7494. }
  7495. function initBaseInstance(instance, options) {
  7496. const ctx = instance.ctx;
  7497. ctx.mpType = options.mpType;
  7498. ctx.$mpType = options.mpType;
  7499. ctx.$mpPlatform = "mp-weixin";
  7500. ctx.$scope = options.mpInstance;
  7501. {
  7502. Object.defineProperties(ctx, {
  7503. // only id
  7504. [VIRTUAL_HOST_ID]: {
  7505. get() {
  7506. const id = this.$scope.data[VIRTUAL_HOST_ID];
  7507. return id === void 0 ? "" : id;
  7508. }
  7509. }
  7510. });
  7511. }
  7512. ctx.$mp = {};
  7513. {
  7514. ctx._self = {};
  7515. }
  7516. instance.slots = {};
  7517. if (isArray(options.slots) && options.slots.length) {
  7518. options.slots.forEach((name) => {
  7519. instance.slots[name] = true;
  7520. });
  7521. if (instance.slots[SLOT_DEFAULT_NAME]) {
  7522. instance.slots.default = true;
  7523. }
  7524. }
  7525. ctx.getOpenerEventChannel = function() {
  7526. {
  7527. return options.mpInstance.getOpenerEventChannel();
  7528. }
  7529. };
  7530. ctx.$hasHook = hasHook;
  7531. ctx.$callHook = callHook;
  7532. instance.emit = createEmitFn(instance.emit, ctx);
  7533. }
  7534. function initComponentInstance(instance, options) {
  7535. initBaseInstance(instance, options);
  7536. const ctx = instance.ctx;
  7537. MP_METHODS.forEach((method) => {
  7538. ctx[method] = function(...args) {
  7539. const mpInstance = ctx.$scope;
  7540. if (mpInstance && mpInstance[method]) {
  7541. return mpInstance[method].apply(mpInstance, args);
  7542. }
  7543. };
  7544. });
  7545. }
  7546. function initMocks(instance, mpInstance, mocks2) {
  7547. const ctx = instance.ctx;
  7548. mocks2.forEach((mock) => {
  7549. if (hasOwn$1(mpInstance, mock)) {
  7550. instance[mock] = ctx[mock] = mpInstance[mock];
  7551. }
  7552. });
  7553. }
  7554. function hasHook(name) {
  7555. const hooks = this.$[name];
  7556. if (hooks && hooks.length) {
  7557. return true;
  7558. }
  7559. return false;
  7560. }
  7561. function callHook(name, args) {
  7562. if (name === "mounted") {
  7563. callHook.call(this, "bm");
  7564. this.$.isMounted = true;
  7565. name = "m";
  7566. }
  7567. const hooks = this.$[name];
  7568. return hooks && invokeArrayFns(hooks, args);
  7569. }
  7570. const PAGE_INIT_HOOKS = [
  7571. ON_LOAD,
  7572. ON_SHOW,
  7573. ON_HIDE,
  7574. ON_UNLOAD,
  7575. ON_RESIZE,
  7576. ON_TAB_ITEM_TAP,
  7577. ON_REACH_BOTTOM,
  7578. ON_PULL_DOWN_REFRESH,
  7579. ON_ADD_TO_FAVORITES
  7580. // 'onReady', // lifetimes.ready
  7581. // 'onPageScroll', // 影响性能,开发者手动注册
  7582. // 'onShareTimeline', // 右上角菜单,开发者手动注册
  7583. // 'onShareAppMessage' // 右上角菜单,开发者手动注册
  7584. ];
  7585. function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  7586. if (vueOptions) {
  7587. Object.keys(vueOptions).forEach((name) => {
  7588. if (isUniLifecycleHook(name, vueOptions[name])) {
  7589. hooks.add(name);
  7590. }
  7591. });
  7592. {
  7593. const { extends: extendsOptions, mixins } = vueOptions;
  7594. if (mixins) {
  7595. mixins.forEach((mixin) => findHooks(mixin, hooks));
  7596. }
  7597. if (extendsOptions) {
  7598. findHooks(extendsOptions, hooks);
  7599. }
  7600. }
  7601. }
  7602. return hooks;
  7603. }
  7604. function initHook(mpOptions, hook, excludes) {
  7605. if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
  7606. mpOptions[hook] = function(args) {
  7607. return this.$vm && this.$vm.$callHook(hook, args);
  7608. };
  7609. }
  7610. }
  7611. const EXCLUDE_HOOKS = [ON_READY];
  7612. function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  7613. hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
  7614. }
  7615. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  7616. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  7617. }
  7618. function initRuntimeHooks(mpOptions, runtimeHooks) {
  7619. if (!runtimeHooks) {
  7620. return;
  7621. }
  7622. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  7623. hooks.forEach((hook) => {
  7624. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  7625. initHook(mpOptions, hook, []);
  7626. }
  7627. });
  7628. }
  7629. const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  7630. const runtimeHooks = [];
  7631. const app = isFunction(getApp) && getApp({ allowDefault: true });
  7632. if (app && app.$vm && app.$vm.$) {
  7633. const mixins = app.$vm.$.appContext.mixins;
  7634. if (isArray(mixins)) {
  7635. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  7636. mixins.forEach((mixin) => {
  7637. hooks.forEach((hook) => {
  7638. if (hasOwn$1(mixin, hook) && !runtimeHooks.includes(hook)) {
  7639. runtimeHooks.push(hook);
  7640. }
  7641. });
  7642. });
  7643. }
  7644. }
  7645. return runtimeHooks;
  7646. });
  7647. function initMixinRuntimeHooks(mpOptions) {
  7648. initHooks(mpOptions, findMixinRuntimeHooks());
  7649. }
  7650. const HOOKS = [
  7651. ON_SHOW,
  7652. ON_HIDE,
  7653. ON_ERROR,
  7654. ON_THEME_CHANGE,
  7655. ON_PAGE_NOT_FOUND,
  7656. ON_UNHANDLE_REJECTION
  7657. ];
  7658. function parseApp(instance, parseAppOptions) {
  7659. const internalInstance = instance.$;
  7660. const appOptions = {
  7661. globalData: instance.$options && instance.$options.globalData || {},
  7662. $vm: instance,
  7663. // mp-alipay 组件 data 初始化比 onLaunch 早,提前挂载
  7664. onLaunch(options) {
  7665. this.$vm = instance;
  7666. const ctx = internalInstance.ctx;
  7667. if (this.$vm && ctx.$scope && ctx.$callHook) {
  7668. return;
  7669. }
  7670. initBaseInstance(internalInstance, {
  7671. mpType: "app",
  7672. mpInstance: this,
  7673. slots: []
  7674. });
  7675. ctx.globalData = this.globalData;
  7676. instance.$callHook(ON_LAUNCH, options);
  7677. }
  7678. };
  7679. const onErrorHandlers = wx.$onErrorHandlers;
  7680. if (onErrorHandlers) {
  7681. onErrorHandlers.forEach((fn) => {
  7682. injectHook(ON_ERROR, fn, internalInstance);
  7683. });
  7684. onErrorHandlers.length = 0;
  7685. }
  7686. initLocale(instance);
  7687. const vueOptions = instance.$.type;
  7688. initHooks(appOptions, HOOKS);
  7689. initUnknownHooks(appOptions, vueOptions);
  7690. {
  7691. const methods = vueOptions.methods;
  7692. methods && extend(appOptions, methods);
  7693. }
  7694. return appOptions;
  7695. }
  7696. function initCreateApp(parseAppOptions) {
  7697. return function createApp2(vm) {
  7698. return App(parseApp(vm));
  7699. };
  7700. }
  7701. function initCreateSubpackageApp(parseAppOptions) {
  7702. return function createApp2(vm) {
  7703. const appOptions = parseApp(vm);
  7704. const app = isFunction(getApp) && getApp({
  7705. allowDefault: true
  7706. });
  7707. if (!app)
  7708. return;
  7709. vm.$.ctx.$scope = app;
  7710. const globalData = app.globalData;
  7711. if (globalData) {
  7712. Object.keys(appOptions.globalData).forEach((name) => {
  7713. if (!hasOwn$1(globalData, name)) {
  7714. globalData[name] = appOptions.globalData[name];
  7715. }
  7716. });
  7717. }
  7718. Object.keys(appOptions).forEach((name) => {
  7719. if (!hasOwn$1(app, name)) {
  7720. app[name] = appOptions[name];
  7721. }
  7722. });
  7723. initAppLifecycle(appOptions, vm);
  7724. };
  7725. }
  7726. function initAppLifecycle(appOptions, vm) {
  7727. if (isFunction(appOptions.onLaunch)) {
  7728. const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  7729. appOptions.onLaunch(args);
  7730. }
  7731. if (isFunction(appOptions.onShow) && wx.onAppShow) {
  7732. wx.onAppShow((args) => {
  7733. vm.$callHook("onShow", args);
  7734. });
  7735. }
  7736. if (isFunction(appOptions.onHide) && wx.onAppHide) {
  7737. wx.onAppHide((args) => {
  7738. vm.$callHook("onHide", args);
  7739. });
  7740. }
  7741. }
  7742. function initLocale(appVm) {
  7743. const locale = ref(getLocaleLanguage());
  7744. Object.defineProperty(appVm, "$locale", {
  7745. get() {
  7746. return locale.value;
  7747. },
  7748. set(v) {
  7749. locale.value = v;
  7750. }
  7751. });
  7752. }
  7753. const builtInProps = [
  7754. // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
  7755. // event-opts
  7756. "eO",
  7757. // 组件 ref
  7758. "uR",
  7759. // 组件 ref-in-for
  7760. "uRIF",
  7761. // 组件 id
  7762. "uI",
  7763. // 组件类型 m: 小程序组件
  7764. "uT",
  7765. // 组件 props
  7766. "uP",
  7767. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  7768. "uS"
  7769. ];
  7770. function initDefaultProps(options, isBehavior = false) {
  7771. const properties = {};
  7772. if (!isBehavior) {
  7773. let observerSlots = function(newVal) {
  7774. const $slots = /* @__PURE__ */ Object.create(null);
  7775. newVal && newVal.forEach((slotName) => {
  7776. $slots[slotName] = true;
  7777. });
  7778. this.setData({
  7779. $slots
  7780. });
  7781. };
  7782. builtInProps.forEach((name) => {
  7783. properties[name] = {
  7784. type: null,
  7785. value: ""
  7786. };
  7787. });
  7788. properties.uS = {
  7789. type: null,
  7790. value: []
  7791. };
  7792. {
  7793. properties.uS.observer = observerSlots;
  7794. }
  7795. }
  7796. if (options.behaviors) {
  7797. if (options.behaviors.includes("wx://form-field")) {
  7798. if (!options.properties || !options.properties.name) {
  7799. properties.name = {
  7800. type: null,
  7801. value: ""
  7802. };
  7803. }
  7804. if (!options.properties || !options.properties.value) {
  7805. properties.value = {
  7806. type: null,
  7807. value: ""
  7808. };
  7809. }
  7810. }
  7811. }
  7812. return properties;
  7813. }
  7814. function initVirtualHostProps(options) {
  7815. const properties = {};
  7816. {
  7817. if (options && options.virtualHost) {
  7818. properties[VIRTUAL_HOST_STYLE] = {
  7819. type: null,
  7820. value: ""
  7821. };
  7822. properties[VIRTUAL_HOST_CLASS] = {
  7823. type: null,
  7824. value: ""
  7825. };
  7826. properties[VIRTUAL_HOST_HIDDEN] = {
  7827. type: null,
  7828. value: ""
  7829. };
  7830. properties[VIRTUAL_HOST_ID] = {
  7831. type: null,
  7832. value: ""
  7833. };
  7834. }
  7835. }
  7836. return properties;
  7837. }
  7838. function initProps(mpComponentOptions) {
  7839. if (!mpComponentOptions.properties) {
  7840. mpComponentOptions.properties = {};
  7841. }
  7842. extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
  7843. }
  7844. const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  7845. function parsePropType(type, defaultValue) {
  7846. if (isArray(type) && type.length === 1) {
  7847. return type[0];
  7848. }
  7849. return type;
  7850. }
  7851. function normalizePropType(type, defaultValue) {
  7852. const res2 = parsePropType(type);
  7853. return PROP_TYPES.indexOf(res2) !== -1 ? res2 : null;
  7854. }
  7855. function initPageProps({ properties }, rawProps) {
  7856. if (isArray(rawProps)) {
  7857. rawProps.forEach((key) => {
  7858. properties[key] = {
  7859. type: String,
  7860. value: ""
  7861. };
  7862. });
  7863. } else if (isPlainObject(rawProps)) {
  7864. Object.keys(rawProps).forEach((key) => {
  7865. const opts = rawProps[key];
  7866. if (isPlainObject(opts)) {
  7867. let value = opts.default;
  7868. if (isFunction(value)) {
  7869. value = value();
  7870. }
  7871. const type = opts.type;
  7872. opts.type = normalizePropType(type);
  7873. properties[key] = {
  7874. type: opts.type,
  7875. value
  7876. };
  7877. } else {
  7878. properties[key] = {
  7879. type: normalizePropType(opts)
  7880. };
  7881. }
  7882. });
  7883. }
  7884. }
  7885. function findPropsData(properties, isPage2) {
  7886. return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(resolvePropValue(properties.uP))) || {};
  7887. }
  7888. function findPagePropsData(properties) {
  7889. const propsData = {};
  7890. if (isPlainObject(properties)) {
  7891. Object.keys(properties).forEach((name) => {
  7892. if (builtInProps.indexOf(name) === -1) {
  7893. propsData[name] = resolvePropValue(properties[name]);
  7894. }
  7895. });
  7896. }
  7897. return propsData;
  7898. }
  7899. function initFormField(vm) {
  7900. const vueOptions = vm.$options;
  7901. if (isArray(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
  7902. vm.$watch("modelValue", () => {
  7903. vm.$scope && vm.$scope.setData({
  7904. name: vm.name,
  7905. value: vm.modelValue
  7906. });
  7907. }, {
  7908. immediate: true
  7909. });
  7910. }
  7911. }
  7912. function resolvePropValue(prop) {
  7913. return prop;
  7914. }
  7915. function initData(_) {
  7916. return {};
  7917. }
  7918. function initPropsObserver(componentOptions) {
  7919. const observe = function observe2() {
  7920. const up = this.properties.uP;
  7921. if (!up) {
  7922. return;
  7923. }
  7924. if (this.$vm) {
  7925. updateComponentProps(resolvePropValue(up), this.$vm.$);
  7926. } else if (resolvePropValue(this.properties.uT) === "m") {
  7927. updateMiniProgramComponentProperties(resolvePropValue(up), this);
  7928. }
  7929. };
  7930. {
  7931. if (!componentOptions.observers) {
  7932. componentOptions.observers = {};
  7933. }
  7934. componentOptions.observers.uP = observe;
  7935. }
  7936. }
  7937. function updateMiniProgramComponentProperties(up, mpInstance) {
  7938. const prevProps = mpInstance.properties;
  7939. const nextProps = findComponentPropsData(up) || {};
  7940. if (hasPropsChanged(prevProps, nextProps, false)) {
  7941. mpInstance.setData(nextProps);
  7942. }
  7943. }
  7944. function updateComponentProps(up, instance) {
  7945. const prevProps = toRaw(instance.props);
  7946. const nextProps = findComponentPropsData(up) || {};
  7947. if (hasPropsChanged(prevProps, nextProps)) {
  7948. updateProps(instance, nextProps, prevProps, false);
  7949. if (hasQueueJob(instance.update)) {
  7950. invalidateJob(instance.update);
  7951. }
  7952. {
  7953. instance.update();
  7954. }
  7955. }
  7956. }
  7957. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  7958. const nextKeys = Object.keys(nextProps);
  7959. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  7960. return true;
  7961. }
  7962. for (let i = 0; i < nextKeys.length; i++) {
  7963. const key = nextKeys[i];
  7964. if (nextProps[key] !== prevProps[key]) {
  7965. return true;
  7966. }
  7967. }
  7968. return false;
  7969. }
  7970. function initBehaviors(vueOptions) {
  7971. const vueBehaviors = vueOptions.behaviors;
  7972. let vueProps = vueOptions.props;
  7973. if (!vueProps) {
  7974. vueOptions.props = vueProps = [];
  7975. }
  7976. const behaviors = [];
  7977. if (isArray(vueBehaviors)) {
  7978. vueBehaviors.forEach((behavior) => {
  7979. behaviors.push(behavior.replace("uni://", "wx://"));
  7980. if (behavior === "uni://form-field") {
  7981. if (isArray(vueProps)) {
  7982. vueProps.push("name");
  7983. vueProps.push("modelValue");
  7984. } else {
  7985. vueProps.name = {
  7986. type: String,
  7987. default: ""
  7988. };
  7989. vueProps.modelValue = {
  7990. type: [String, Number, Boolean, Array, Object, Date],
  7991. default: ""
  7992. };
  7993. }
  7994. }
  7995. });
  7996. }
  7997. return behaviors;
  7998. }
  7999. function applyOptions(componentOptions, vueOptions) {
  8000. componentOptions.data = initData();
  8001. componentOptions.behaviors = initBehaviors(vueOptions);
  8002. }
  8003. function parseComponent(vueOptions, { parse: parse2, mocks: mocks2, isPage: isPage2, isPageInProject, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  8004. vueOptions = vueOptions.default || vueOptions;
  8005. const options = {
  8006. multipleSlots: true,
  8007. // styleIsolation: 'apply-shared',
  8008. addGlobalClass: true,
  8009. pureDataPattern: /^uP$/
  8010. };
  8011. if (isArray(vueOptions.mixins)) {
  8012. vueOptions.mixins.forEach((item) => {
  8013. if (isObject$2(item.options)) {
  8014. extend(options, item.options);
  8015. }
  8016. });
  8017. }
  8018. if (vueOptions.options) {
  8019. extend(options, vueOptions.options);
  8020. }
  8021. const mpComponentOptions = {
  8022. options,
  8023. lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
  8024. pageLifetimes: {
  8025. show() {
  8026. this.$vm && this.$vm.$callHook("onPageShow");
  8027. },
  8028. hide() {
  8029. this.$vm && this.$vm.$callHook("onPageHide");
  8030. },
  8031. resize(size2) {
  8032. this.$vm && this.$vm.$callHook("onPageResize", size2);
  8033. }
  8034. },
  8035. methods: {
  8036. __l: handleLink2
  8037. }
  8038. };
  8039. {
  8040. applyOptions(mpComponentOptions, vueOptions);
  8041. }
  8042. initProps(mpComponentOptions);
  8043. initPropsObserver(mpComponentOptions);
  8044. initExtraOptions(mpComponentOptions, vueOptions);
  8045. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  8046. {
  8047. initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  8048. }
  8049. if (parse2) {
  8050. parse2(mpComponentOptions, { handleLink: handleLink2 });
  8051. }
  8052. return mpComponentOptions;
  8053. }
  8054. function initCreateComponent(parseOptions2) {
  8055. return function createComponent2(vueComponentOptions) {
  8056. return Component(parseComponent(vueComponentOptions, parseOptions2));
  8057. };
  8058. }
  8059. let $createComponentFn;
  8060. let $destroyComponentFn;
  8061. function getAppVm() {
  8062. return getApp().$vm;
  8063. }
  8064. function $createComponent(initialVNode, options) {
  8065. if (!$createComponentFn) {
  8066. $createComponentFn = getAppVm().$createComponent;
  8067. }
  8068. const proxy = $createComponentFn(initialVNode, options);
  8069. return getExposeProxy(proxy.$) || proxy;
  8070. }
  8071. function $destroyComponent(instance) {
  8072. if (!$destroyComponentFn) {
  8073. $destroyComponentFn = getAppVm().$destroyComponent;
  8074. }
  8075. return $destroyComponentFn(instance);
  8076. }
  8077. function parsePage(vueOptions, parseOptions2) {
  8078. const { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  8079. const miniProgramPageOptions = parseComponent(vueOptions, {
  8080. mocks: mocks2,
  8081. isPage: isPage2,
  8082. isPageInProject: true,
  8083. initRelation: initRelation2,
  8084. handleLink: handleLink2,
  8085. initLifetimes: initLifetimes2
  8086. });
  8087. initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  8088. const methods = miniProgramPageOptions.methods;
  8089. methods.onLoad = function(query) {
  8090. {
  8091. this.options = query;
  8092. }
  8093. this.$page = {
  8094. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  8095. };
  8096. return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  8097. };
  8098. initHooks(methods, PAGE_INIT_HOOKS);
  8099. {
  8100. initUnknownHooks(methods, vueOptions);
  8101. }
  8102. initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  8103. initMixinRuntimeHooks(methods);
  8104. parse2 && parse2(miniProgramPageOptions, { handleLink: handleLink2 });
  8105. return miniProgramPageOptions;
  8106. }
  8107. function initCreatePage(parseOptions2) {
  8108. return function createPage2(vuePageOptions) {
  8109. return Component(parsePage(vuePageOptions, parseOptions2));
  8110. };
  8111. }
  8112. function initCreatePluginApp(parseAppOptions) {
  8113. return function createApp2(vm) {
  8114. initAppLifecycle(parseApp(vm), vm);
  8115. };
  8116. }
  8117. const MPPage = Page;
  8118. const MPComponent = Component;
  8119. function initTriggerEvent(mpInstance) {
  8120. const oldTriggerEvent = mpInstance.triggerEvent;
  8121. const newTriggerEvent = function(event, ...args) {
  8122. return oldTriggerEvent.apply(mpInstance, [
  8123. customizeEvent(event),
  8124. ...args
  8125. ]);
  8126. };
  8127. try {
  8128. mpInstance.triggerEvent = newTriggerEvent;
  8129. } catch (error) {
  8130. mpInstance._triggerEvent = newTriggerEvent;
  8131. }
  8132. }
  8133. function initMiniProgramHook(name, options, isComponent) {
  8134. const oldHook = options[name];
  8135. if (!oldHook) {
  8136. options[name] = function() {
  8137. initTriggerEvent(this);
  8138. };
  8139. } else {
  8140. options[name] = function(...args) {
  8141. initTriggerEvent(this);
  8142. return oldHook.apply(this, args);
  8143. };
  8144. }
  8145. }
  8146. Page = function(options) {
  8147. initMiniProgramHook(ON_LOAD, options);
  8148. return MPPage(options);
  8149. };
  8150. Component = function(options) {
  8151. initMiniProgramHook("created", options);
  8152. const isVueComponent = options.properties && options.properties.uP;
  8153. if (!isVueComponent) {
  8154. initProps(options);
  8155. initPropsObserver(options);
  8156. }
  8157. return MPComponent(options);
  8158. };
  8159. function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  8160. return {
  8161. attached() {
  8162. let properties = this.properties;
  8163. initVueIds(properties.uI, this);
  8164. const relationOptions = {
  8165. vuePid: this._$vuePid
  8166. };
  8167. initRelation2(this, relationOptions);
  8168. const mpInstance = this;
  8169. const isMiniProgramPage = isPage2(mpInstance);
  8170. let propsData = properties;
  8171. this.$vm = $createComponent({
  8172. type: vueOptions,
  8173. props: findPropsData(propsData, isMiniProgramPage)
  8174. }, {
  8175. mpType: isMiniProgramPage ? "page" : "component",
  8176. mpInstance,
  8177. slots: properties.uS || {},
  8178. // vueSlots
  8179. parentComponent: relationOptions.parent && relationOptions.parent.$,
  8180. onBeforeSetup(instance, options) {
  8181. initRefs(instance, mpInstance);
  8182. initMocks(instance, mpInstance, mocks2);
  8183. initComponentInstance(instance, options);
  8184. }
  8185. });
  8186. if (!isMiniProgramPage) {
  8187. initFormField(this.$vm);
  8188. }
  8189. },
  8190. ready() {
  8191. if (this.$vm) {
  8192. {
  8193. this.$vm.$callHook("mounted");
  8194. this.$vm.$callHook(ON_READY);
  8195. }
  8196. }
  8197. },
  8198. detached() {
  8199. if (this.$vm) {
  8200. pruneComponentPropsCache(this.$vm.$.uid);
  8201. $destroyComponent(this.$vm);
  8202. }
  8203. }
  8204. };
  8205. }
  8206. const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  8207. function isPage(mpInstance) {
  8208. return !!mpInstance.route;
  8209. }
  8210. function initRelation(mpInstance, detail) {
  8211. mpInstance.triggerEvent("__l", detail);
  8212. }
  8213. function handleLink(event) {
  8214. const detail = event.detail || event.value;
  8215. const vuePid = detail.vuePid;
  8216. let parentVm;
  8217. if (vuePid) {
  8218. parentVm = findVmByVueId(this.$vm, vuePid);
  8219. }
  8220. if (!parentVm) {
  8221. parentVm = this.$vm;
  8222. }
  8223. detail.parent = parentVm;
  8224. }
  8225. var parseOptions = /* @__PURE__ */ Object.freeze({
  8226. __proto__: null,
  8227. handleLink,
  8228. initLifetimes,
  8229. initRelation,
  8230. isPage,
  8231. mocks
  8232. });
  8233. const createApp = initCreateApp();
  8234. const createPage = initCreatePage(parseOptions);
  8235. const createComponent = initCreateComponent(parseOptions);
  8236. const createPluginApp = initCreatePluginApp();
  8237. const createSubpackageApp = initCreateSubpackageApp();
  8238. {
  8239. wx.createApp = global.createApp = createApp;
  8240. wx.createPage = createPage;
  8241. wx.createComponent = createComponent;
  8242. wx.createPluginApp = global.createPluginApp = createPluginApp;
  8243. wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
  8244. }
  8245. const BASE_URL = "api/";
  8246. const frontEndConfig = {
  8247. // 固定的GlobalData配置信息,只存在本地代码',
  8248. fixedAppjsGlobalData: {
  8249. // 防止页面并发调用登录接口,默认判断5次',
  8250. retryNum: 5,
  8251. // 院区Id 如果院区ID有值 queryBHospitalList和挂号流程 会使用此ID, 默认取DIY配置 院区列表中第一个院区ID',
  8252. districtId: "",
  8253. // 医院Id demo 1024727 43',
  8254. hosId: "1024727",
  8255. // 小程序登录configKey',
  8256. configKey: "WXTEST001",
  8257. // *配置appId,后端分配',
  8258. // appId: 'wxede0b125eed31b0d',
  8259. // 公众号授权地址configKey',
  8260. wechatConfigKey: "kasite_demo",
  8261. // 请求接口需要加密请求的秘钥,要与配置的相同',
  8262. apiSecretKey: "sdf67UI23f123",
  8263. // 不需要加密的请求接口',
  8264. noNeedSecretKeyApiArr: []
  8265. },
  8266. // 可配置修改的GlobalData配置信息,与下方的webDiy配置一起配置后台配置系统内',
  8267. appjsGlobalData: {
  8268. // 存储医院信息经纬度,在开发是先找项目经理要,用于来院导航、与在线签到',
  8269. hospitalInfo: {
  8270. Wd: "26.06063",
  8271. Jd: "119.26848",
  8272. HospitalAddress: "福建省福州市仓山区",
  8273. HospitalAlias: "福州智医科技(演示医院)"
  8274. },
  8275. // 判断当前服务器是否更新,主要用于上线项目,后端全量更新时使用',
  8276. updateOrNot: false,
  8277. // 是否区分院区',
  8278. hasDistrict: false,
  8279. // 是否开启公众号授权',
  8280. officialAuthOn: true,
  8281. // 是否允许无卡预约',
  8282. withoutCard: true,
  8283. // 是否需要互联网Websocket',
  8284. hasWebsocket: true,
  8285. // 是否需要适老版',
  8286. hasSlb: true,
  8287. // 上门护理配置信息',
  8288. nurseConfig: {},
  8289. // 上门护理默认HosId',
  8290. nurseHosId: "1024727",
  8291. // 是否开启AI智能客服',
  8292. showAICustomerService: true
  8293. },
  8294. webUiDiy: {
  8295. pageConfiguration: {
  8296. currency_config: {
  8297. remark: "通用配置",
  8298. remarkMsg: "authBusinessPage:要授权的业务页面;",
  8299. authBusinessPage: {
  8300. remarkMsg: "pageName:授权业务页面名称;levelNum:授权页面需求用户等级1:短信验证;2人脸认证;[reportIndex:报告查询]",
  8301. pageName: "levelNum",
  8302. reportIndex: "1"
  8303. }
  8304. },
  8305. login_config: {
  8306. messageSys: true
  8307. },
  8308. homePage_config: {
  8309. remark: "就诊人列表 页面个性化",
  8310. remarkMsg: "medicalBtn:展示医保电子",
  8311. medicalBtn: false
  8312. },
  8313. memberList_config: {
  8314. remark: "就诊人列表 页面个性化",
  8315. remarkMsg: "idCodeShow:是否展示电子就诊码;",
  8316. isCodeShow: true
  8317. },
  8318. hospitalDistrict_config: {
  8319. remark: "院区选择 页面个性化配置",
  8320. remarkMsg: "districtList:院区列表;districImg:院区图片;districtName: 院区名称;districtId:院区ID",
  8321. districtList: [
  8322. {
  8323. districImg: "https://demo.kasitesoft.com/uploadFile/ui/image/menu/homePage_menuYygk.png",
  8324. districtName: "智医科技体验医院",
  8325. districtId: "1024727"
  8326. },
  8327. {
  8328. districImg: "https://demo.kasitesoft.com/uploadFile/ui/image/menu/homePage_menuLcfb.png",
  8329. districtName: "智医科技体验医院分院",
  8330. districtId: "10247271"
  8331. }
  8332. ]
  8333. },
  8334. yyghDeptList_config: {
  8335. remark: "科室列表 页面个性化配置",
  8336. remarkMsg: "aiMode:ai到诊配置模块;showDeptSec:是否展示二级科室;deptShowMode:查看具体科室排班时弹窗提示;modalData:弹窗内容具体配置信息查看[pages.st1.components.richTextModal.richTextModal]",
  8337. aiMode: {
  8338. showAi: true,
  8339. appId: "wxba22f1a66a3af7aa",
  8340. path: "pages/index?appid=wx3f6fa5f164160c4b"
  8341. },
  8342. showDeptSec: false,
  8343. deptShowMode: {
  8344. 科室code: "特殊科室提示内容"
  8345. },
  8346. modalData: {
  8347. showModal: false,
  8348. title: "预约须知",
  8349. content: "",
  8350. contentAlign: "",
  8351. styleType: "bottom",
  8352. articleId: "70a53d226c5e41149b6e9d7f9863cbd4",
  8353. showCancel: false,
  8354. cancelText: "取消",
  8355. cancelColor: "red",
  8356. confirmText: "确定",
  8357. showCancelBtn: true
  8358. }
  8359. },
  8360. yyghDoctorList_config: {
  8361. remark: "医生列表 页面个性化配置",
  8362. remarkMsg: "hasAllSchedules:排班时间是否有全部选项;",
  8363. hasAllSchedules: true
  8364. },
  8365. yyghClinicMsg_config: {
  8366. remark: "确认挂号 页面个性化配置",
  8367. remarkMsg: "numberType:号源展示 1方块格式 2列表格式;",
  8368. numberType: "1"
  8369. },
  8370. payState_config: {
  8371. remark: "订单成功页面个性化配置",
  8372. remarkMsg: "isAiBtn:预约挂号AI预问诊是否展示;tip:预约挂号注意事项;tips:用于有用预约配置信息时,把内容复制到tip上,signInQueue:签单成功是否展示候诊",
  8373. isAiBtn: true,
  8374. tips: [
  8375. [
  8376. "1、签到取号:",
  8377. "于就诊当日到院签到,支持微信签到、自助机、服务台签到取号,可提前90分钟或延迟30分钟(超过30分钟则预约无效,需要重新排号);"
  8378. ],
  8379. ["2、退号:", "如您无法按时就诊,请至少提前1天取消,以免因为爽约影响下次预约;"],
  8380. ["3、首次就诊患者:", "需要带身份证原件办理开卡;"],
  8381. [
  8382. "未实名制的复诊患者:",
  8383. "在就诊前需要持本人有效身份证证件进行实名认证,否则无法就诊;有效证件类型包括:身份证、社保卡、户口簿(仅限未成年)、护照、驾驶证、港澳台通行证、老人证、军官证、出生证(仅限新生儿)。"
  8384. ]
  8385. ],
  8386. signInQueue: true
  8387. },
  8388. authorizeMode_config: {
  8389. remark: "授权组件 页面个性化配置",
  8390. remarkMsg: "face:是否有人脸识别授权;code:是否有短信验证码授权;",
  8391. face: true,
  8392. code: true
  8393. },
  8394. signInList_config: {
  8395. remark: "在线签到 页面个性化配置",
  8396. remarkMsg: "allowedSignAfter:允许超时多久还可签到;allowedSignBefore:就诊前多久可签到;signDistance:签到距离;signReason:签到接口入参1旧接口2星网锐捷",
  8397. allowedSignAfter: 30,
  8398. allowedSignBefore: 30,
  8399. signDistance: 1,
  8400. signReason: 2
  8401. },
  8402. orderPayment_config: {
  8403. remark: "门诊结算 页面个性化配置",
  8404. remarkMsg: "orderPaymentMode:订单缴费模式 1预交金 2线上支付;consolidationPayment:是否合并支付;",
  8405. orderPaymentMode: "2",
  8406. consolidationPayment: false
  8407. },
  8408. payMent_config: {
  8409. remark: "支付倒计时 页面个性化配置",
  8410. remarkMsg: "payWay:支付方式:1为单个支付方式;2为多个支付方式选择;",
  8411. payWay: "1"
  8412. },
  8413. inspectTestReportDetails_config: {
  8414. remark: "检查报告单详情 页面个性化配置",
  8415. remarkMsg: "showCloudFilm:是否展示云胶片按钮;",
  8416. showCloudFilm: false
  8417. },
  8418. topUpRecord_screening: {
  8419. remark: "充值记录筛选",
  8420. remarkMsg: "title(标题名称),key(参数 字段名),single(选择类型,true:单选,false:多选,默认多选),options(标题名称对应的筛选条件)",
  8421. value: [
  8422. {
  8423. title: "订单状态",
  8424. key: "payState",
  8425. single: true,
  8426. options: [
  8427. {
  8428. name: "全部",
  8429. check: true,
  8430. value: {
  8431. OverState: "",
  8432. PayState: "",
  8433. BizState: ""
  8434. }
  8435. },
  8436. {
  8437. name: "未支付",
  8438. check: false,
  8439. value: {
  8440. OverState: "0",
  8441. PayState: "0",
  8442. BizState: "0"
  8443. }
  8444. },
  8445. {
  8446. name: "已支付",
  8447. check: false,
  8448. value: {
  8449. OverState: "0",
  8450. PayState: "2",
  8451. BizState: "1"
  8452. }
  8453. },
  8454. {
  8455. name: "支付中",
  8456. check: false,
  8457. value: {
  8458. OverState: "0",
  8459. PayState: "1",
  8460. BizState: "0"
  8461. }
  8462. },
  8463. {
  8464. name: "已取消",
  8465. check: false,
  8466. value: {
  8467. OverState: "5",
  8468. PayState: "0",
  8469. BizState: "0"
  8470. }
  8471. }
  8472. ]
  8473. },
  8474. {
  8475. title: "订单类型",
  8476. key: "serviceId",
  8477. options: [
  8478. {
  8479. name: "全部",
  8480. check: true,
  8481. value: "006,007"
  8482. },
  8483. {
  8484. name: "门诊充值",
  8485. check: false,
  8486. value: "006"
  8487. },
  8488. {
  8489. name: "住院充值",
  8490. check: false,
  8491. value: "007"
  8492. }
  8493. ]
  8494. }
  8495. ]
  8496. },
  8497. appointmentRecord_screening: {
  8498. remark: "预约记录筛选",
  8499. remarkMsg: "type(选择类型,0:单选,1:多选,2:输入);title(标题名称);value(标题名称对应的筛选条件),parameter(参数 字段名)",
  8500. value: [
  8501. {
  8502. type: 0,
  8503. title: "预约记录",
  8504. selected: [
  8505. {
  8506. key: 0,
  8507. name: "全部",
  8508. options: {
  8509. OverState: "",
  8510. PayState: "",
  8511. BizState: ""
  8512. }
  8513. }
  8514. ],
  8515. value: [
  8516. {
  8517. key: 0,
  8518. name: "全部",
  8519. options: {
  8520. OverState: "",
  8521. PayState: "",
  8522. BizState: ""
  8523. }
  8524. },
  8525. {
  8526. key: 1,
  8527. name: "已挂号",
  8528. options: {
  8529. OverState: "0",
  8530. PayState: "0",
  8531. BizState: "1"
  8532. }
  8533. },
  8534. {
  8535. key: 2,
  8536. name: "已退号",
  8537. options: {
  8538. OverState: "0",
  8539. PayState: "0",
  8540. BizState: "2"
  8541. }
  8542. }
  8543. ]
  8544. }
  8545. ]
  8546. }
  8547. },
  8548. net_pageConfiguration_patient: {
  8549. currency_config: {
  8550. remark: "通用配置",
  8551. remarkMsg: "useMenuOnLine:是否从后台获取menu菜单; officialAuthOn:是否开启公众号授权;isVisitMode:是否为就诊人模式;withoutCard:就诊人模式是否允许无卡预约;queryMemberList:是否使用queryMemberList查询就诊人;hospitalAddress:来源自取地址;",
  8552. iniHighAppraiseCount: 0,
  8553. consultIsOnlinePay: "1",
  8554. hospitalAddress: "福建省福州市仓山区"
  8555. },
  8556. reportIndex_config: {
  8557. remark: "查报告单 页面个性化配置",
  8558. remarkMsg: "auth:是否需要授权;typeShow:报告查询两种模式: 1 tab切换模式; 2 列表选择",
  8559. auth: true,
  8560. typeShow: "2"
  8561. },
  8562. authorizeMode_config: {
  8563. remark: "授权组件 页面个性化配置",
  8564. remarkMsg: "face:是否有人脸识别授权;code:是否有短信验证码授权;",
  8565. face: false,
  8566. code: true
  8567. },
  8568. inspectTestReportDetails_config: {
  8569. remark: "检查报告单详情 页面个性化配置",
  8570. remarkMsg: "showCloudFilm:是否展示云胶片按钮;",
  8571. showCloudFilm: true
  8572. },
  8573. doctorList_screening: {
  8574. remark: "推荐医生筛选",
  8575. remarkMsg: "type(选择类型,0:单选,1:多选,2:输入,3:日期选择);title(标题名称);value(标题名称对应的筛选条件)",
  8576. value: [
  8577. {
  8578. type: "0",
  8579. title: "开处方状态",
  8580. selectedInd: [0],
  8581. list: [
  8582. {
  8583. key: 0,
  8584. name: "全部状态",
  8585. options: {
  8586. DoctorService1004: ""
  8587. }
  8588. },
  8589. {
  8590. key: 0,
  8591. name: "可开处方",
  8592. options: {
  8593. DoctorService1004: "1"
  8594. }
  8595. },
  8596. {
  8597. key: 0,
  8598. name: "不可开处方",
  8599. options: {
  8600. DoctorService1004: "0"
  8601. }
  8602. }
  8603. ]
  8604. },
  8605. {
  8606. type: "0",
  8607. title: "服务模式",
  8608. selectedInd: [0],
  8609. list: [
  8610. {
  8611. key: 0,
  8612. name: "全部方式",
  8613. options: {
  8614. ConsultType: ""
  8615. }
  8616. },
  8617. {
  8618. key: 0,
  8619. name: "图文咨询",
  8620. options: {
  8621. ConsultType: "1"
  8622. }
  8623. },
  8624. {
  8625. key: 0,
  8626. name: "视频咨询",
  8627. options: {
  8628. ConsultType: "2"
  8629. }
  8630. }
  8631. ]
  8632. }
  8633. ]
  8634. },
  8635. enquireList_screening: {
  8636. remark: "咨询中筛选",
  8637. remarkMsg: "type(选择类型,0:单选,1:多选,2:输入,3:日期选择);title(标题名称);value(标题名称对应的筛选条件)",
  8638. value: [
  8639. {
  8640. type: "1",
  8641. title: "咨询状态",
  8642. selectedInd: [0],
  8643. list: [
  8644. {
  8645. key: 0,
  8646. name: "全部状态",
  8647. options: {
  8648. ConsultStatus: ""
  8649. }
  8650. },
  8651. {
  8652. key: 0,
  8653. name: "待支付",
  8654. options: {
  8655. ConsultStatus: "0"
  8656. }
  8657. },
  8658. {
  8659. key: 0,
  8660. name: "待接单",
  8661. options: {
  8662. ConsultStatus: "1"
  8663. }
  8664. },
  8665. {
  8666. key: 0,
  8667. name: "进行中",
  8668. options: {
  8669. ConsultStatus: "2"
  8670. }
  8671. },
  8672. {
  8673. key: 0,
  8674. name: "已结束",
  8675. options: {
  8676. ConsultStatus: "3"
  8677. }
  8678. },
  8679. {
  8680. key: 0,
  8681. name: "已评价",
  8682. options: {
  8683. ConsultStatus: "5"
  8684. }
  8685. }
  8686. ]
  8687. }
  8688. ]
  8689. },
  8690. logisticsRecord_screening: {
  8691. remark: "物流记录筛选",
  8692. remarkMsg: "type(选择类型,0:单选,1:多选,2:输入,3:日期选择);title(标题名称);value(标题名称对应的筛选条件)",
  8693. value: [
  8694. {
  8695. type: "1",
  8696. title: "物流状态",
  8697. selectedInd: [0],
  8698. list: [
  8699. {
  8700. key: 0,
  8701. name: "全部状态",
  8702. options: {
  8703. ConsultStatus: ""
  8704. }
  8705. },
  8706. {
  8707. key: 0,
  8708. name: "待自取",
  8709. options: {
  8710. ConsultStatus: "1"
  8711. }
  8712. },
  8713. {
  8714. key: 0,
  8715. name: "已取药(已签收)",
  8716. options: {
  8717. ConsultStatus: "2"
  8718. }
  8719. },
  8720. {
  8721. key: 0,
  8722. name: "配送中",
  8723. options: {
  8724. ConsultStatus: "0"
  8725. }
  8726. }
  8727. ]
  8728. }
  8729. ]
  8730. },
  8731. rechargeRecord_screening: {
  8732. remark: "充值记录筛选",
  8733. remarkMsg: "type(选择类型,0:单选,1:多选,2:输入);title(标题名称);value(标题名称对应的筛选条件),options(参数 字段名)",
  8734. value: []
  8735. },
  8736. report_screening: {
  8737. remark: "报告单查询筛选",
  8738. state: "type(选择类型,0:单选,1:多选,2:输入);title(标题名称);value(标题名称对应的筛选条件),options(参数 字段名)",
  8739. value: [
  8740. {
  8741. type: 0,
  8742. title: "报告单类型",
  8743. selected: [
  8744. {
  8745. key: 0,
  8746. name: "全部",
  8747. options: {
  8748. ReportType: ""
  8749. }
  8750. }
  8751. ],
  8752. value: [
  8753. {
  8754. key: 0,
  8755. name: "全部",
  8756. options: {
  8757. ReportType: ""
  8758. }
  8759. },
  8760. {
  8761. key: 0,
  8762. name: "检验报告单",
  8763. options: {
  8764. ReportType: "1"
  8765. }
  8766. },
  8767. {
  8768. key: 1,
  8769. name: "检查报告单",
  8770. options: {
  8771. ReportType: "2"
  8772. }
  8773. }
  8774. ]
  8775. }
  8776. ]
  8777. }
  8778. }
  8779. }
  8780. };
  8781. var CryptoJS = CryptoJS || function(u, l) {
  8782. var d = {}, n2 = d.lib = {}, p2 = function() {
  8783. }, s2 = n2.Base = {
  8784. extend: function(a) {
  8785. p2.prototype = this;
  8786. var c = new p2();
  8787. a && c.mixIn(a);
  8788. c.hasOwnProperty("init") || (c.init = function() {
  8789. c.$super.init.apply(this, arguments);
  8790. });
  8791. c.init.prototype = c;
  8792. c.$super = this;
  8793. return c;
  8794. },
  8795. create: function() {
  8796. var a = this.extend();
  8797. a.init.apply(a, arguments);
  8798. return a;
  8799. },
  8800. init: function() {
  8801. },
  8802. mixIn: function(a) {
  8803. for (var c in a)
  8804. a.hasOwnProperty(c) && (this[c] = a[c]);
  8805. a.hasOwnProperty("toString") && (this.toString = a.toString);
  8806. },
  8807. clone: function() {
  8808. return this.init.prototype.extend(this);
  8809. }
  8810. }, q = n2.WordArray = s2.extend({
  8811. init: function(a, c) {
  8812. a = this.words = a || [];
  8813. this.sigBytes = c != l ? c : 4 * a.length;
  8814. },
  8815. toString: function(a) {
  8816. return (a || v).stringify(this);
  8817. },
  8818. concat: function(a) {
  8819. var c = this.words, m = a.words, f2 = this.sigBytes;
  8820. a = a.sigBytes;
  8821. this.clamp();
  8822. if (f2 % 4)
  8823. for (var t2 = 0; t2 < a; t2++)
  8824. c[f2 + t2 >>> 2] |= (m[t2 >>> 2] >>> 24 - 8 * (t2 % 4) & 255) << 24 - 8 * ((f2 + t2) % 4);
  8825. else if (65535 < m.length)
  8826. for (t2 = 0; t2 < a; t2 += 4)
  8827. c[f2 + t2 >>> 2] = m[t2 >>> 2];
  8828. else
  8829. c.push.apply(c, m);
  8830. this.sigBytes += a;
  8831. return this;
  8832. },
  8833. clamp: function() {
  8834. var a = this.words, c = this.sigBytes;
  8835. a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4);
  8836. a.length = u.ceil(c / 4);
  8837. },
  8838. clone: function() {
  8839. var a = s2.clone.call(this);
  8840. a.words = this.words.slice(0);
  8841. return a;
  8842. },
  8843. random: function(a) {
  8844. for (var c = [], m = 0; m < a; m += 4)
  8845. c.push(4294967296 * u.random() | 0);
  8846. return new q.init(c, a);
  8847. }
  8848. }), w = d.enc = {}, v = w.Hex = {
  8849. stringify: function(a) {
  8850. var c = a.words;
  8851. a = a.sigBytes;
  8852. for (var m = [], f2 = 0; f2 < a; f2++) {
  8853. var t2 = c[f2 >>> 2] >>> 24 - 8 * (f2 % 4) & 255;
  8854. m.push((t2 >>> 4).toString(16));
  8855. m.push((t2 & 15).toString(16));
  8856. }
  8857. return m.join("");
  8858. },
  8859. parse: function(a) {
  8860. for (var c = a.length, m = [], f2 = 0; f2 < c; f2 += 2)
  8861. m[f2 >>> 3] |= parseInt(a.substr(
  8862. f2,
  8863. 2
  8864. ), 16) << 24 - 4 * (f2 % 8);
  8865. return new q.init(m, c / 2);
  8866. }
  8867. }, b = w.Latin1 = {
  8868. stringify: function(a) {
  8869. var c = a.words;
  8870. a = a.sigBytes;
  8871. for (var m = [], f2 = 0; f2 < a; f2++)
  8872. m.push(String.fromCharCode(c[f2 >>> 2] >>> 24 - 8 * (f2 % 4) & 255));
  8873. return m.join("");
  8874. },
  8875. parse: function(a) {
  8876. for (var c = a.length, m = [], f2 = 0; f2 < c; f2++)
  8877. m[f2 >>> 2] |= (a.charCodeAt(f2) & 255) << 24 - 8 * (f2 % 4);
  8878. return new q.init(m, c);
  8879. }
  8880. }, x = w.Utf8 = {
  8881. stringify: function(a) {
  8882. try {
  8883. return decodeURIComponent(escape(b.stringify(a)));
  8884. } catch (c) {
  8885. throw Error("Malformed UTF-8 data");
  8886. }
  8887. },
  8888. parse: function(a) {
  8889. return b.parse(unescape(encodeURIComponent(a)));
  8890. }
  8891. }, r = n2.BufferedBlockAlgorithm = s2.extend({
  8892. reset: function() {
  8893. this._data = new q.init();
  8894. this._nDataBytes = 0;
  8895. },
  8896. _append: function(a) {
  8897. "string" == typeof a && (a = x.parse(a));
  8898. this._data.concat(a);
  8899. this._nDataBytes += a.sigBytes;
  8900. },
  8901. _process: function(a) {
  8902. var c = this._data, m = c.words, f2 = c.sigBytes, t2 = this.blockSize, b2 = f2 / (4 * t2), b2 = a ? u.ceil(b2) : u.max((b2 | 0) - this._minBufferSize, 0);
  8903. a = b2 * t2;
  8904. f2 = u.min(4 * a, f2);
  8905. if (a) {
  8906. for (var e3 = 0; e3 < a; e3 += t2)
  8907. this._doProcessBlock(m, e3);
  8908. e3 = m.splice(0, a);
  8909. c.sigBytes -= f2;
  8910. }
  8911. return new q.init(e3, f2);
  8912. },
  8913. clone: function() {
  8914. var a = s2.clone.call(this);
  8915. a._data = this._data.clone();
  8916. return a;
  8917. },
  8918. _minBufferSize: 0
  8919. });
  8920. n2.Hasher = r.extend({
  8921. cfg: s2.extend(),
  8922. init: function(a) {
  8923. this.cfg = this.cfg.extend(a);
  8924. this.reset();
  8925. },
  8926. reset: function() {
  8927. r.reset.call(this);
  8928. this._doReset();
  8929. },
  8930. update: function(a) {
  8931. this._append(a);
  8932. this._process();
  8933. return this;
  8934. },
  8935. finalize: function(a) {
  8936. a && this._append(a);
  8937. return this._doFinalize();
  8938. },
  8939. blockSize: 16,
  8940. _createHelper: function(a) {
  8941. return function(c, m) {
  8942. return new a.init(m).finalize(c);
  8943. };
  8944. },
  8945. _createHmacHelper: function(a) {
  8946. return function(c, m) {
  8947. return new e2.HMAC.init(
  8948. a,
  8949. m
  8950. ).finalize(c);
  8951. };
  8952. }
  8953. });
  8954. var e2 = d.algo = {};
  8955. return d;
  8956. }(Math);
  8957. (function() {
  8958. var u = CryptoJS, l = u.lib.WordArray;
  8959. u.enc.Base64 = {
  8960. stringify: function(d) {
  8961. var n2 = d.words, l2 = d.sigBytes, s2 = this._map;
  8962. d.clamp();
  8963. d = [];
  8964. for (var q = 0; q < l2; q += 3)
  8965. for (var w = (n2[q >>> 2] >>> 24 - 8 * (q % 4) & 255) << 16 | (n2[q + 1 >>> 2] >>> 24 - 8 * ((q + 1) % 4) & 255) << 8 | n2[q + 2 >>> 2] >>> 24 - 8 * ((q + 2) % 4) & 255, v = 0; 4 > v && q + 0.75 * v < l2; v++)
  8966. d.push(s2.charAt(w >>> 6 * (3 - v) & 63));
  8967. if (n2 = s2.charAt(64))
  8968. for (; d.length % 4; )
  8969. d.push(n2);
  8970. return d.join("");
  8971. },
  8972. parse: function(d) {
  8973. var n2 = d.length, p2 = this._map, s2 = p2.charAt(64);
  8974. s2 && (s2 = d.indexOf(s2), -1 != s2 && (n2 = s2));
  8975. for (var s2 = [], q = 0, w = 0; w < n2; w++)
  8976. if (w % 4) {
  8977. var v = p2.indexOf(d.charAt(w - 1)) << 2 * (w % 4), b = p2.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4);
  8978. s2[q >>> 2] |= (v | b) << 24 - 8 * (q % 4);
  8979. q++;
  8980. }
  8981. return l.create(s2, q);
  8982. },
  8983. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  8984. };
  8985. })();
  8986. (function(u) {
  8987. function l(b2, e2, a, c, m, f2, t2) {
  8988. b2 = b2 + (e2 & a | ~e2 & c) + m + t2;
  8989. return (b2 << f2 | b2 >>> 32 - f2) + e2;
  8990. }
  8991. function d(b2, e2, a, c, m, f2, t2) {
  8992. b2 = b2 + (e2 & c | a & ~c) + m + t2;
  8993. return (b2 << f2 | b2 >>> 32 - f2) + e2;
  8994. }
  8995. function n2(b2, e2, a, c, m, f2, t2) {
  8996. b2 = b2 + (e2 ^ a ^ c) + m + t2;
  8997. return (b2 << f2 | b2 >>> 32 - f2) + e2;
  8998. }
  8999. function p2(b2, e2, a, c, m, f2, t2) {
  9000. b2 = b2 + (a ^ (e2 | ~c)) + m + t2;
  9001. return (b2 << f2 | b2 >>> 32 - f2) + e2;
  9002. }
  9003. for (var s2 = CryptoJS, q = s2.lib, w = q.WordArray, v = q.Hasher, q = s2.algo, b = [], x = 0; 64 > x; x++)
  9004. b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0;
  9005. q = q.MD5 = v.extend({
  9006. _doReset: function() {
  9007. this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878]);
  9008. },
  9009. _doProcessBlock: function(r, e2) {
  9010. for (var a = 0; 16 > a; a++) {
  9011. var c = e2 + a, m = r[c];
  9012. r[c] = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360;
  9013. }
  9014. var a = this._hash.words, c = r[e2 + 0], m = r[e2 + 1], f2 = r[e2 + 2], t2 = r[e2 + 3], y = r[e2 + 4], q2 = r[e2 + 5], s3 = r[e2 + 6], w2 = r[e2 + 7], v2 = r[e2 + 8], u2 = r[e2 + 9], x2 = r[e2 + 10], z = r[e2 + 11], A = r[e2 + 12], B = r[e2 + 13], C = r[e2 + 14], D = r[e2 + 15], g = a[0], h = a[1], j = a[2], k = a[3], g = l(g, h, j, k, c, 7, b[0]), k = l(k, g, h, j, m, 12, b[1]), j = l(j, k, g, h, f2, 17, b[2]), h = l(h, j, k, g, t2, 22, b[3]), g = l(g, h, j, k, y, 7, b[4]), k = l(k, g, h, j, q2, 12, b[5]), j = l(j, k, g, h, s3, 17, b[6]), h = l(h, j, k, g, w2, 22, b[7]), g = l(g, h, j, k, v2, 7, b[8]), k = l(k, g, h, j, u2, 12, b[9]), j = l(j, k, g, h, x2, 17, b[10]), h = l(h, j, k, g, z, 22, b[11]), g = l(g, h, j, k, A, 7, b[12]), k = l(k, g, h, j, B, 12, b[13]), j = l(j, k, g, h, C, 17, b[14]), h = l(h, j, k, g, D, 22, b[15]), g = d(g, h, j, k, m, 5, b[16]), k = d(k, g, h, j, s3, 9, b[17]), j = d(j, k, g, h, z, 14, b[18]), h = d(h, j, k, g, c, 20, b[19]), g = d(g, h, j, k, q2, 5, b[20]), k = d(k, g, h, j, x2, 9, b[21]), j = d(j, k, g, h, D, 14, b[22]), h = d(h, j, k, g, y, 20, b[23]), g = d(g, h, j, k, u2, 5, b[24]), k = d(k, g, h, j, C, 9, b[25]), j = d(j, k, g, h, t2, 14, b[26]), h = d(h, j, k, g, v2, 20, b[27]), g = d(g, h, j, k, B, 5, b[28]), k = d(
  9015. k,
  9016. g,
  9017. h,
  9018. j,
  9019. f2,
  9020. 9,
  9021. b[29]
  9022. ), j = d(j, k, g, h, w2, 14, b[30]), h = d(h, j, k, g, A, 20, b[31]), g = n2(g, h, j, k, q2, 4, b[32]), k = n2(k, g, h, j, v2, 11, b[33]), j = n2(j, k, g, h, z, 16, b[34]), h = n2(h, j, k, g, C, 23, b[35]), g = n2(g, h, j, k, m, 4, b[36]), k = n2(k, g, h, j, y, 11, b[37]), j = n2(j, k, g, h, w2, 16, b[38]), h = n2(h, j, k, g, x2, 23, b[39]), g = n2(g, h, j, k, B, 4, b[40]), k = n2(k, g, h, j, c, 11, b[41]), j = n2(j, k, g, h, t2, 16, b[42]), h = n2(h, j, k, g, s3, 23, b[43]), g = n2(g, h, j, k, u2, 4, b[44]), k = n2(k, g, h, j, A, 11, b[45]), j = n2(j, k, g, h, D, 16, b[46]), h = n2(h, j, k, g, f2, 23, b[47]), g = p2(g, h, j, k, c, 6, b[48]), k = p2(k, g, h, j, w2, 10, b[49]), j = p2(
  9023. j,
  9024. k,
  9025. g,
  9026. h,
  9027. C,
  9028. 15,
  9029. b[50]
  9030. ), h = p2(h, j, k, g, q2, 21, b[51]), g = p2(g, h, j, k, A, 6, b[52]), k = p2(k, g, h, j, t2, 10, b[53]), j = p2(j, k, g, h, x2, 15, b[54]), h = p2(h, j, k, g, m, 21, b[55]), g = p2(g, h, j, k, v2, 6, b[56]), k = p2(k, g, h, j, D, 10, b[57]), j = p2(j, k, g, h, s3, 15, b[58]), h = p2(h, j, k, g, B, 21, b[59]), g = p2(g, h, j, k, y, 6, b[60]), k = p2(k, g, h, j, z, 10, b[61]), j = p2(j, k, g, h, f2, 15, b[62]), h = p2(h, j, k, g, u2, 21, b[63]);
  9031. a[0] = a[0] + g | 0;
  9032. a[1] = a[1] + h | 0;
  9033. a[2] = a[2] + j | 0;
  9034. a[3] = a[3] + k | 0;
  9035. },
  9036. _doFinalize: function() {
  9037. var b2 = this._data, e2 = b2.words, a = 8 * this._nDataBytes, c = 8 * b2.sigBytes;
  9038. e2[c >>> 5] |= 128 << 24 - c % 32;
  9039. var m = u.floor(a / 4294967296);
  9040. e2[(c + 64 >>> 9 << 4) + 15] = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360;
  9041. e2[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360;
  9042. b2.sigBytes = 4 * (e2.length + 1);
  9043. this._process();
  9044. b2 = this._hash;
  9045. e2 = b2.words;
  9046. for (a = 0; 4 > a; a++)
  9047. c = e2[a], e2[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360;
  9048. return b2;
  9049. },
  9050. clone: function() {
  9051. var b2 = v.clone.call(this);
  9052. b2._hash = this._hash.clone();
  9053. return b2;
  9054. }
  9055. });
  9056. s2.MD5 = v._createHelper(q);
  9057. s2.HmacMD5 = v._createHmacHelper(q);
  9058. })(Math);
  9059. (function() {
  9060. var u = CryptoJS, l = u.lib, d = l.Base, n2 = l.WordArray, l = u.algo, p2 = l.EvpKDF = d.extend({
  9061. cfg: d.extend({
  9062. keySize: 4,
  9063. hasher: l.MD5,
  9064. iterations: 1
  9065. }),
  9066. init: function(d2) {
  9067. this.cfg = this.cfg.extend(d2);
  9068. },
  9069. compute: function(d2, l2) {
  9070. for (var p3 = this.cfg, v = p3.hasher.create(), b = n2.create(), u2 = b.words, r = p3.keySize, p3 = p3.iterations; u2.length < r; ) {
  9071. e2 && v.update(e2);
  9072. var e2 = v.update(d2).finalize(l2);
  9073. v.reset();
  9074. for (var a = 1; a < p3; a++)
  9075. e2 = v.finalize(e2), v.reset();
  9076. b.concat(e2);
  9077. }
  9078. b.sigBytes = 4 * r;
  9079. return b;
  9080. }
  9081. });
  9082. u.EvpKDF = function(d2, l2, n3) {
  9083. return p2.create(n3).compute(
  9084. d2,
  9085. l2
  9086. );
  9087. };
  9088. })();
  9089. CryptoJS.lib.Cipher || function(u) {
  9090. var l = CryptoJS, d = l.lib, n2 = d.Base, p2 = d.WordArray, s2 = d.BufferedBlockAlgorithm, q = l.enc.Base64, w = l.algo.EvpKDF, v = d.Cipher = s2.extend({
  9091. cfg: n2.extend(),
  9092. createEncryptor: function(m, a2) {
  9093. return this.create(this._ENC_XFORM_MODE, m, a2);
  9094. },
  9095. createDecryptor: function(m, a2) {
  9096. return this.create(this._DEC_XFORM_MODE, m, a2);
  9097. },
  9098. init: function(m, a2, b2) {
  9099. this.cfg = this.cfg.extend(b2);
  9100. this._xformMode = m;
  9101. this._key = a2;
  9102. this.reset();
  9103. },
  9104. reset: function() {
  9105. s2.reset.call(this);
  9106. this._doReset();
  9107. },
  9108. process: function(a2) {
  9109. this._append(a2);
  9110. return this._process();
  9111. },
  9112. finalize: function(a2) {
  9113. a2 && this._append(a2);
  9114. return this._doFinalize();
  9115. },
  9116. keySize: 4,
  9117. ivSize: 4,
  9118. _ENC_XFORM_MODE: 1,
  9119. _DEC_XFORM_MODE: 2,
  9120. _createHelper: function(m) {
  9121. return {
  9122. encrypt: function(f2, b2, e3) {
  9123. return ("string" == typeof b2 ? c : a).encrypt(m, f2, b2, e3);
  9124. },
  9125. decrypt: function(f2, b2, e3) {
  9126. return ("string" == typeof b2 ? c : a).decrypt(m, f2, b2, e3);
  9127. }
  9128. };
  9129. }
  9130. });
  9131. d.StreamCipher = v.extend({
  9132. _doFinalize: function() {
  9133. return this._process(true);
  9134. },
  9135. blockSize: 1
  9136. });
  9137. var b = l.mode = {}, x = function(a2, f2, b2) {
  9138. var c2 = this._iv;
  9139. c2 ? this._iv = u : c2 = this._prevBlock;
  9140. for (var e3 = 0; e3 < b2; e3++)
  9141. a2[f2 + e3] ^= c2[e3];
  9142. }, r = (d.BlockCipherMode = n2.extend({
  9143. createEncryptor: function(a2, f2) {
  9144. return this.Encryptor.create(a2, f2);
  9145. },
  9146. createDecryptor: function(a2, f2) {
  9147. return this.Decryptor.create(a2, f2);
  9148. },
  9149. init: function(a2, f2) {
  9150. this._cipher = a2;
  9151. this._iv = f2;
  9152. }
  9153. })).extend();
  9154. r.Encryptor = r.extend({
  9155. processBlock: function(a2, f2) {
  9156. var b2 = this._cipher, c2 = b2.blockSize;
  9157. x.call(this, a2, f2, c2);
  9158. b2.encryptBlock(a2, f2);
  9159. this._prevBlock = a2.slice(f2, f2 + c2);
  9160. }
  9161. });
  9162. r.Decryptor = r.extend({
  9163. processBlock: function(a2, b2) {
  9164. var c2 = this._cipher, e3 = c2.blockSize, d2 = a2.slice(b2, b2 + e3);
  9165. c2.decryptBlock(a2, b2);
  9166. x.call(
  9167. this,
  9168. a2,
  9169. b2,
  9170. e3
  9171. );
  9172. this._prevBlock = d2;
  9173. }
  9174. });
  9175. b = b.CBC = r;
  9176. r = (l.pad = {}).Pkcs7 = {
  9177. pad: function(a2, b2) {
  9178. for (var c2 = 4 * b2, c2 = c2 - a2.sigBytes % c2, e3 = c2 << 24 | c2 << 16 | c2 << 8 | c2, d2 = [], l2 = 0; l2 < c2; l2 += 4)
  9179. d2.push(e3);
  9180. c2 = p2.create(d2, c2);
  9181. a2.concat(c2);
  9182. },
  9183. unpad: function(a2) {
  9184. a2.sigBytes -= a2.words[a2.sigBytes - 1 >>> 2] & 255;
  9185. }
  9186. };
  9187. d.BlockCipher = v.extend({
  9188. cfg: v.cfg.extend({
  9189. mode: b,
  9190. padding: r
  9191. }),
  9192. reset: function() {
  9193. v.reset.call(this);
  9194. var a2 = this.cfg, c2 = a2.iv, a2 = a2.mode;
  9195. if (this._xformMode == this._ENC_XFORM_MODE)
  9196. var b2 = a2.createEncryptor;
  9197. else
  9198. b2 = a2.createDecryptor, this._minBufferSize = 1;
  9199. this._mode = b2.call(
  9200. a2,
  9201. this,
  9202. c2 && c2.words
  9203. );
  9204. },
  9205. _doProcessBlock: function(a2, c2) {
  9206. this._mode.processBlock(a2, c2);
  9207. },
  9208. _doFinalize: function() {
  9209. var a2 = this.cfg.padding;
  9210. if (this._xformMode == this._ENC_XFORM_MODE) {
  9211. a2.pad(this._data, this.blockSize);
  9212. var c2 = this._process(true);
  9213. } else
  9214. c2 = this._process(true), a2.unpad(c2);
  9215. return c2;
  9216. },
  9217. blockSize: 4
  9218. });
  9219. var e2 = d.CipherParams = n2.extend({
  9220. init: function(a2) {
  9221. this.mixIn(a2);
  9222. },
  9223. toString: function(a2) {
  9224. return (a2 || this.formatter).stringify(this);
  9225. }
  9226. }), b = (l.format = {}).OpenSSL = {
  9227. stringify: function(a2) {
  9228. var c2 = a2.ciphertext;
  9229. a2 = a2.salt;
  9230. return (a2 ? p2.create([
  9231. 1398893684,
  9232. 1701076831
  9233. ]).concat(a2).concat(c2) : c2).toString(q);
  9234. },
  9235. parse: function(a2) {
  9236. a2 = q.parse(a2);
  9237. var c2 = a2.words;
  9238. if (1398893684 == c2[0] && 1701076831 == c2[1]) {
  9239. var b2 = p2.create(c2.slice(2, 4));
  9240. c2.splice(0, 4);
  9241. a2.sigBytes -= 16;
  9242. }
  9243. return e2.create({
  9244. ciphertext: a2,
  9245. salt: b2
  9246. });
  9247. }
  9248. }, a = d.SerializableCipher = n2.extend({
  9249. cfg: n2.extend({
  9250. format: b
  9251. }),
  9252. encrypt: function(a2, c2, b2, d2) {
  9253. d2 = this.cfg.extend(d2);
  9254. var l2 = a2.createEncryptor(b2, d2);
  9255. c2 = l2.finalize(c2);
  9256. l2 = l2.cfg;
  9257. return e2.create({
  9258. ciphertext: c2,
  9259. key: b2,
  9260. iv: l2.iv,
  9261. algorithm: a2,
  9262. mode: l2.mode,
  9263. padding: l2.padding,
  9264. blockSize: a2.blockSize,
  9265. formatter: d2.format
  9266. });
  9267. },
  9268. decrypt: function(a2, c2, b2, e3) {
  9269. e3 = this.cfg.extend(e3);
  9270. c2 = this._parse(c2, e3.format);
  9271. return a2.createDecryptor(b2, e3).finalize(c2.ciphertext);
  9272. },
  9273. _parse: function(a2, c2) {
  9274. return "string" == typeof a2 ? c2.parse(a2, this) : a2;
  9275. }
  9276. }), l = (l.kdf = {}).OpenSSL = {
  9277. execute: function(a2, c2, b2, d2) {
  9278. d2 || (d2 = p2.random(8));
  9279. a2 = w.create({
  9280. keySize: c2 + b2
  9281. }).compute(a2, d2);
  9282. b2 = p2.create(a2.words.slice(c2), 4 * b2);
  9283. a2.sigBytes = 4 * c2;
  9284. return e2.create({
  9285. key: a2,
  9286. iv: b2,
  9287. salt: d2
  9288. });
  9289. }
  9290. }, c = d.PasswordBasedCipher = a.extend({
  9291. cfg: a.cfg.extend({
  9292. kdf: l
  9293. }),
  9294. encrypt: function(c2, b2, e3, d2) {
  9295. d2 = this.cfg.extend(d2);
  9296. e3 = d2.kdf.execute(
  9297. e3,
  9298. c2.keySize,
  9299. c2.ivSize
  9300. );
  9301. d2.iv = e3.iv;
  9302. c2 = a.encrypt.call(this, c2, b2, e3.key, d2);
  9303. c2.mixIn(e3);
  9304. return c2;
  9305. },
  9306. decrypt: function(c2, b2, e3, d2) {
  9307. d2 = this.cfg.extend(d2);
  9308. b2 = this._parse(b2, d2.format);
  9309. e3 = d2.kdf.execute(e3, c2.keySize, c2.ivSize, b2.salt);
  9310. d2.iv = e3.iv;
  9311. return a.decrypt.call(this, c2, b2, e3.key, d2);
  9312. }
  9313. });
  9314. }();
  9315. (function() {
  9316. function u(b2, a) {
  9317. var c = (this._lBlock >>> b2 ^ this._rBlock) & a;
  9318. this._rBlock ^= c;
  9319. this._lBlock ^= c << b2;
  9320. }
  9321. function l(b2, a) {
  9322. var c = (this._rBlock >>> b2 ^ this._lBlock) & a;
  9323. this._lBlock ^= c;
  9324. this._rBlock ^= c << b2;
  9325. }
  9326. var d = CryptoJS, n2 = d.lib, p2 = n2.WordArray, n2 = n2.BlockCipher, s2 = d.algo, q = [
  9327. 57,
  9328. 49,
  9329. 41,
  9330. 33,
  9331. 25,
  9332. 17,
  9333. 9,
  9334. 1,
  9335. 58,
  9336. 50,
  9337. 42,
  9338. 34,
  9339. 26,
  9340. 18,
  9341. 10,
  9342. 2,
  9343. 59,
  9344. 51,
  9345. 43,
  9346. 35,
  9347. 27,
  9348. 19,
  9349. 11,
  9350. 3,
  9351. 60,
  9352. 52,
  9353. 44,
  9354. 36,
  9355. 63,
  9356. 55,
  9357. 47,
  9358. 39,
  9359. 31,
  9360. 23,
  9361. 15,
  9362. 7,
  9363. 62,
  9364. 54,
  9365. 46,
  9366. 38,
  9367. 30,
  9368. 22,
  9369. 14,
  9370. 6,
  9371. 61,
  9372. 53,
  9373. 45,
  9374. 37,
  9375. 29,
  9376. 21,
  9377. 13,
  9378. 5,
  9379. 28,
  9380. 20,
  9381. 12,
  9382. 4
  9383. ], w = [
  9384. 14,
  9385. 17,
  9386. 11,
  9387. 24,
  9388. 1,
  9389. 5,
  9390. 3,
  9391. 28,
  9392. 15,
  9393. 6,
  9394. 21,
  9395. 10,
  9396. 23,
  9397. 19,
  9398. 12,
  9399. 4,
  9400. 26,
  9401. 8,
  9402. 16,
  9403. 7,
  9404. 27,
  9405. 20,
  9406. 13,
  9407. 2,
  9408. 41,
  9409. 52,
  9410. 31,
  9411. 37,
  9412. 47,
  9413. 55,
  9414. 30,
  9415. 40,
  9416. 51,
  9417. 45,
  9418. 33,
  9419. 48,
  9420. 44,
  9421. 49,
  9422. 39,
  9423. 56,
  9424. 34,
  9425. 53,
  9426. 46,
  9427. 42,
  9428. 50,
  9429. 36,
  9430. 29,
  9431. 32
  9432. ], v = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], b = [{
  9433. "0": 8421888,
  9434. 268435456: 32768,
  9435. 536870912: 8421378,
  9436. 805306368: 2,
  9437. 1073741824: 512,
  9438. 1342177280: 8421890,
  9439. 1610612736: 8389122,
  9440. 1879048192: 8388608,
  9441. 2147483648: 514,
  9442. 2415919104: 8389120,
  9443. 2684354560: 33280,
  9444. 2952790016: 8421376,
  9445. 3221225472: 32770,
  9446. 3489660928: 8388610,
  9447. 3758096384: 0,
  9448. 4026531840: 33282,
  9449. 134217728: 0,
  9450. 402653184: 8421890,
  9451. 671088640: 33282,
  9452. 939524096: 32768,
  9453. 1207959552: 8421888,
  9454. 1476395008: 512,
  9455. 1744830464: 8421378,
  9456. 2013265920: 2,
  9457. 2281701376: 8389120,
  9458. 2550136832: 33280,
  9459. 2818572288: 8421376,
  9460. 3087007744: 8389122,
  9461. 3355443200: 8388610,
  9462. 3623878656: 32770,
  9463. 3892314112: 514,
  9464. 4160749568: 8388608,
  9465. 1: 32768,
  9466. 268435457: 2,
  9467. 536870913: 8421888,
  9468. 805306369: 8388608,
  9469. 1073741825: 8421378,
  9470. 1342177281: 33280,
  9471. 1610612737: 512,
  9472. 1879048193: 8389122,
  9473. 2147483649: 8421890,
  9474. 2415919105: 8421376,
  9475. 2684354561: 8388610,
  9476. 2952790017: 33282,
  9477. 3221225473: 514,
  9478. 3489660929: 8389120,
  9479. 3758096385: 32770,
  9480. 4026531841: 0,
  9481. 134217729: 8421890,
  9482. 402653185: 8421376,
  9483. 671088641: 8388608,
  9484. 939524097: 512,
  9485. 1207959553: 32768,
  9486. 1476395009: 8388610,
  9487. 1744830465: 2,
  9488. 2013265921: 33282,
  9489. 2281701377: 32770,
  9490. 2550136833: 8389122,
  9491. 2818572289: 514,
  9492. 3087007745: 8421888,
  9493. 3355443201: 8389120,
  9494. 3623878657: 0,
  9495. 3892314113: 33280,
  9496. 4160749569: 8421378
  9497. }, {
  9498. "0": 1074282512,
  9499. 16777216: 16384,
  9500. 33554432: 524288,
  9501. 50331648: 1074266128,
  9502. 67108864: 1073741840,
  9503. 83886080: 1074282496,
  9504. 100663296: 1073758208,
  9505. 117440512: 16,
  9506. 134217728: 540672,
  9507. 150994944: 1073758224,
  9508. 167772160: 1073741824,
  9509. 184549376: 540688,
  9510. 201326592: 524304,
  9511. 218103808: 0,
  9512. 234881024: 16400,
  9513. 251658240: 1074266112,
  9514. 8388608: 1073758208,
  9515. 25165824: 540688,
  9516. 41943040: 16,
  9517. 58720256: 1073758224,
  9518. 75497472: 1074282512,
  9519. 92274688: 1073741824,
  9520. 109051904: 524288,
  9521. 125829120: 1074266128,
  9522. 142606336: 524304,
  9523. 159383552: 0,
  9524. 176160768: 16384,
  9525. 192937984: 1074266112,
  9526. 209715200: 1073741840,
  9527. 226492416: 540672,
  9528. 243269632: 1074282496,
  9529. 260046848: 16400,
  9530. 268435456: 0,
  9531. 285212672: 1074266128,
  9532. 301989888: 1073758224,
  9533. 318767104: 1074282496,
  9534. 335544320: 1074266112,
  9535. 352321536: 16,
  9536. 369098752: 540688,
  9537. 385875968: 16384,
  9538. 402653184: 16400,
  9539. 419430400: 524288,
  9540. 436207616: 524304,
  9541. 452984832: 1073741840,
  9542. 469762048: 540672,
  9543. 486539264: 1073758208,
  9544. 503316480: 1073741824,
  9545. 520093696: 1074282512,
  9546. 276824064: 540688,
  9547. 293601280: 524288,
  9548. 310378496: 1074266112,
  9549. 327155712: 16384,
  9550. 343932928: 1073758208,
  9551. 360710144: 1074282512,
  9552. 377487360: 16,
  9553. 394264576: 1073741824,
  9554. 411041792: 1074282496,
  9555. 427819008: 1073741840,
  9556. 444596224: 1073758224,
  9557. 461373440: 524304,
  9558. 478150656: 0,
  9559. 494927872: 16400,
  9560. 511705088: 1074266128,
  9561. 528482304: 540672
  9562. }, {
  9563. "0": 260,
  9564. 1048576: 0,
  9565. 2097152: 67109120,
  9566. 3145728: 65796,
  9567. 4194304: 65540,
  9568. 5242880: 67108868,
  9569. 6291456: 67174660,
  9570. 7340032: 67174400,
  9571. 8388608: 67108864,
  9572. 9437184: 67174656,
  9573. 10485760: 65792,
  9574. 11534336: 67174404,
  9575. 12582912: 67109124,
  9576. 13631488: 65536,
  9577. 14680064: 4,
  9578. 15728640: 256,
  9579. 524288: 67174656,
  9580. 1572864: 67174404,
  9581. 2621440: 0,
  9582. 3670016: 67109120,
  9583. 4718592: 67108868,
  9584. 5767168: 65536,
  9585. 6815744: 65540,
  9586. 7864320: 260,
  9587. 8912896: 4,
  9588. 9961472: 256,
  9589. 11010048: 67174400,
  9590. 12058624: 65796,
  9591. 13107200: 65792,
  9592. 14155776: 67109124,
  9593. 15204352: 67174660,
  9594. 16252928: 67108864,
  9595. 16777216: 67174656,
  9596. 17825792: 65540,
  9597. 18874368: 65536,
  9598. 19922944: 67109120,
  9599. 20971520: 256,
  9600. 22020096: 67174660,
  9601. 23068672: 67108868,
  9602. 24117248: 0,
  9603. 25165824: 67109124,
  9604. 26214400: 67108864,
  9605. 27262976: 4,
  9606. 28311552: 65792,
  9607. 29360128: 67174400,
  9608. 30408704: 260,
  9609. 31457280: 65796,
  9610. 32505856: 67174404,
  9611. 17301504: 67108864,
  9612. 18350080: 260,
  9613. 19398656: 67174656,
  9614. 20447232: 0,
  9615. 21495808: 65540,
  9616. 22544384: 67109120,
  9617. 23592960: 256,
  9618. 24641536: 67174404,
  9619. 25690112: 65536,
  9620. 26738688: 67174660,
  9621. 27787264: 65796,
  9622. 28835840: 67108868,
  9623. 29884416: 67109124,
  9624. 30932992: 67174400,
  9625. 31981568: 4,
  9626. 33030144: 65792
  9627. }, {
  9628. "0": 2151682048,
  9629. 65536: 2147487808,
  9630. 131072: 4198464,
  9631. 196608: 2151677952,
  9632. 262144: 0,
  9633. 327680: 4198400,
  9634. 393216: 2147483712,
  9635. 458752: 4194368,
  9636. 524288: 2147483648,
  9637. 589824: 4194304,
  9638. 655360: 64,
  9639. 720896: 2147487744,
  9640. 786432: 2151678016,
  9641. 851968: 4160,
  9642. 917504: 4096,
  9643. 983040: 2151682112,
  9644. 32768: 2147487808,
  9645. 98304: 64,
  9646. 163840: 2151678016,
  9647. 229376: 2147487744,
  9648. 294912: 4198400,
  9649. 360448: 2151682112,
  9650. 425984: 0,
  9651. 491520: 2151677952,
  9652. 557056: 4096,
  9653. 622592: 2151682048,
  9654. 688128: 4194304,
  9655. 753664: 4160,
  9656. 819200: 2147483648,
  9657. 884736: 4194368,
  9658. 950272: 4198464,
  9659. 1015808: 2147483712,
  9660. 1048576: 4194368,
  9661. 1114112: 4198400,
  9662. 1179648: 2147483712,
  9663. 1245184: 0,
  9664. 1310720: 4160,
  9665. 1376256: 2151678016,
  9666. 1441792: 2151682048,
  9667. 1507328: 2147487808,
  9668. 1572864: 2151682112,
  9669. 1638400: 2147483648,
  9670. 1703936: 2151677952,
  9671. 1769472: 4198464,
  9672. 1835008: 2147487744,
  9673. 1900544: 4194304,
  9674. 1966080: 64,
  9675. 2031616: 4096,
  9676. 1081344: 2151677952,
  9677. 1146880: 2151682112,
  9678. 1212416: 0,
  9679. 1277952: 4198400,
  9680. 1343488: 4194368,
  9681. 1409024: 2147483648,
  9682. 1474560: 2147487808,
  9683. 1540096: 64,
  9684. 1605632: 2147483712,
  9685. 1671168: 4096,
  9686. 1736704: 2147487744,
  9687. 1802240: 2151678016,
  9688. 1867776: 4160,
  9689. 1933312: 2151682048,
  9690. 1998848: 4194304,
  9691. 2064384: 4198464
  9692. }, {
  9693. "0": 128,
  9694. 4096: 17039360,
  9695. 8192: 262144,
  9696. 12288: 536870912,
  9697. 16384: 537133184,
  9698. 20480: 16777344,
  9699. 24576: 553648256,
  9700. 28672: 262272,
  9701. 32768: 16777216,
  9702. 36864: 537133056,
  9703. 40960: 536871040,
  9704. 45056: 553910400,
  9705. 49152: 553910272,
  9706. 53248: 0,
  9707. 57344: 17039488,
  9708. 61440: 553648128,
  9709. 2048: 17039488,
  9710. 6144: 553648256,
  9711. 10240: 128,
  9712. 14336: 17039360,
  9713. 18432: 262144,
  9714. 22528: 537133184,
  9715. 26624: 553910272,
  9716. 30720: 536870912,
  9717. 34816: 537133056,
  9718. 38912: 0,
  9719. 43008: 553910400,
  9720. 47104: 16777344,
  9721. 51200: 536871040,
  9722. 55296: 553648128,
  9723. 59392: 16777216,
  9724. 63488: 262272,
  9725. 65536: 262144,
  9726. 69632: 128,
  9727. 73728: 536870912,
  9728. 77824: 553648256,
  9729. 81920: 16777344,
  9730. 86016: 553910272,
  9731. 90112: 537133184,
  9732. 94208: 16777216,
  9733. 98304: 553910400,
  9734. 102400: 553648128,
  9735. 106496: 17039360,
  9736. 110592: 537133056,
  9737. 114688: 262272,
  9738. 118784: 536871040,
  9739. 122880: 0,
  9740. 126976: 17039488,
  9741. 67584: 553648256,
  9742. 71680: 16777216,
  9743. 75776: 17039360,
  9744. 79872: 537133184,
  9745. 83968: 536870912,
  9746. 88064: 17039488,
  9747. 92160: 128,
  9748. 96256: 553910272,
  9749. 100352: 262272,
  9750. 104448: 553910400,
  9751. 108544: 0,
  9752. 112640: 553648128,
  9753. 116736: 16777344,
  9754. 120832: 262144,
  9755. 124928: 537133056,
  9756. 129024: 536871040
  9757. }, {
  9758. "0": 268435464,
  9759. 256: 8192,
  9760. 512: 270532608,
  9761. 768: 270540808,
  9762. 1024: 268443648,
  9763. 1280: 2097152,
  9764. 1536: 2097160,
  9765. 1792: 268435456,
  9766. 2048: 0,
  9767. 2304: 268443656,
  9768. 2560: 2105344,
  9769. 2816: 8,
  9770. 3072: 270532616,
  9771. 3328: 2105352,
  9772. 3584: 8200,
  9773. 3840: 270540800,
  9774. 128: 270532608,
  9775. 384: 270540808,
  9776. 640: 8,
  9777. 896: 2097152,
  9778. 1152: 2105352,
  9779. 1408: 268435464,
  9780. 1664: 268443648,
  9781. 1920: 8200,
  9782. 2176: 2097160,
  9783. 2432: 8192,
  9784. 2688: 268443656,
  9785. 2944: 270532616,
  9786. 3200: 0,
  9787. 3456: 270540800,
  9788. 3712: 2105344,
  9789. 3968: 268435456,
  9790. 4096: 268443648,
  9791. 4352: 270532616,
  9792. 4608: 270540808,
  9793. 4864: 8200,
  9794. 5120: 2097152,
  9795. 5376: 268435456,
  9796. 5632: 268435464,
  9797. 5888: 2105344,
  9798. 6144: 2105352,
  9799. 6400: 0,
  9800. 6656: 8,
  9801. 6912: 270532608,
  9802. 7168: 8192,
  9803. 7424: 268443656,
  9804. 7680: 270540800,
  9805. 7936: 2097160,
  9806. 4224: 8,
  9807. 4480: 2105344,
  9808. 4736: 2097152,
  9809. 4992: 268435464,
  9810. 5248: 268443648,
  9811. 5504: 8200,
  9812. 5760: 270540808,
  9813. 6016: 270532608,
  9814. 6272: 270540800,
  9815. 6528: 270532616,
  9816. 6784: 8192,
  9817. 7040: 2105352,
  9818. 7296: 2097160,
  9819. 7552: 0,
  9820. 7808: 268435456,
  9821. 8064: 268443656
  9822. }, {
  9823. "0": 1048576,
  9824. 16: 33555457,
  9825. 32: 1024,
  9826. 48: 1049601,
  9827. 64: 34604033,
  9828. 80: 0,
  9829. 96: 1,
  9830. 112: 34603009,
  9831. 128: 33555456,
  9832. 144: 1048577,
  9833. 160: 33554433,
  9834. 176: 34604032,
  9835. 192: 34603008,
  9836. 208: 1025,
  9837. 224: 1049600,
  9838. 240: 33554432,
  9839. 8: 34603009,
  9840. 24: 0,
  9841. 40: 33555457,
  9842. 56: 34604032,
  9843. 72: 1048576,
  9844. 88: 33554433,
  9845. 104: 33554432,
  9846. 120: 1025,
  9847. 136: 1049601,
  9848. 152: 33555456,
  9849. 168: 34603008,
  9850. 184: 1048577,
  9851. 200: 1024,
  9852. 216: 34604033,
  9853. 232: 1,
  9854. 248: 1049600,
  9855. 256: 33554432,
  9856. 272: 1048576,
  9857. 288: 33555457,
  9858. 304: 34603009,
  9859. 320: 1048577,
  9860. 336: 33555456,
  9861. 352: 34604032,
  9862. 368: 1049601,
  9863. 384: 1025,
  9864. 400: 34604033,
  9865. 416: 1049600,
  9866. 432: 1,
  9867. 448: 0,
  9868. 464: 34603008,
  9869. 480: 33554433,
  9870. 496: 1024,
  9871. 264: 1049600,
  9872. 280: 33555457,
  9873. 296: 34603009,
  9874. 312: 1,
  9875. 328: 33554432,
  9876. 344: 1048576,
  9877. 360: 1025,
  9878. 376: 34604032,
  9879. 392: 33554433,
  9880. 408: 34603008,
  9881. 424: 0,
  9882. 440: 34604033,
  9883. 456: 1049601,
  9884. 472: 1024,
  9885. 488: 33555456,
  9886. 504: 1048577
  9887. }, {
  9888. "0": 134219808,
  9889. 1: 131072,
  9890. 2: 134217728,
  9891. 3: 32,
  9892. 4: 131104,
  9893. 5: 134350880,
  9894. 6: 134350848,
  9895. 7: 2048,
  9896. 8: 134348800,
  9897. 9: 134219776,
  9898. 10: 133120,
  9899. 11: 134348832,
  9900. 12: 2080,
  9901. 13: 0,
  9902. 14: 134217760,
  9903. 15: 133152,
  9904. 2147483648: 2048,
  9905. 2147483649: 134350880,
  9906. 2147483650: 134219808,
  9907. 2147483651: 134217728,
  9908. 2147483652: 134348800,
  9909. 2147483653: 133120,
  9910. 2147483654: 133152,
  9911. 2147483655: 32,
  9912. 2147483656: 134217760,
  9913. 2147483657: 2080,
  9914. 2147483658: 131104,
  9915. 2147483659: 134350848,
  9916. 2147483660: 0,
  9917. 2147483661: 134348832,
  9918. 2147483662: 134219776,
  9919. 2147483663: 131072,
  9920. 16: 133152,
  9921. 17: 134350848,
  9922. 18: 32,
  9923. 19: 2048,
  9924. 20: 134219776,
  9925. 21: 134217760,
  9926. 22: 134348832,
  9927. 23: 131072,
  9928. 24: 0,
  9929. 25: 131104,
  9930. 26: 134348800,
  9931. 27: 134219808,
  9932. 28: 134350880,
  9933. 29: 133120,
  9934. 30: 2080,
  9935. 31: 134217728,
  9936. 2147483664: 131072,
  9937. 2147483665: 2048,
  9938. 2147483666: 134348832,
  9939. 2147483667: 133152,
  9940. 2147483668: 32,
  9941. 2147483669: 134348800,
  9942. 2147483670: 134217728,
  9943. 2147483671: 134219808,
  9944. 2147483672: 134350880,
  9945. 2147483673: 134217760,
  9946. 2147483674: 134219776,
  9947. 2147483675: 0,
  9948. 2147483676: 133120,
  9949. 2147483677: 2080,
  9950. 2147483678: 131104,
  9951. 2147483679: 134350848
  9952. }], x = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679], r = s2.DES = n2.extend({
  9953. _doReset: function() {
  9954. for (var b2 = this._key.words, a = [], c = 0; 56 > c; c++) {
  9955. var d2 = q[c] - 1;
  9956. a[c] = b2[d2 >>> 5] >>> 31 - d2 % 32 & 1;
  9957. }
  9958. b2 = this._subKeys = [];
  9959. for (d2 = 0; 16 > d2; d2++) {
  9960. for (var f2 = b2[d2] = [], l2 = v[d2], c = 0; 24 > c; c++)
  9961. f2[c / 6 | 0] |= a[(w[c] - 1 + l2) % 28] << 31 - c % 6, f2[4 + (c / 6 | 0)] |= a[28 + (w[c + 24] - 1 + l2) % 28] << 31 - c % 6;
  9962. f2[0] = f2[0] << 1 | f2[0] >>> 31;
  9963. for (c = 1; 7 > c; c++)
  9964. f2[c] >>>= 4 * (c - 1) + 3;
  9965. f2[7] = f2[7] << 5 | f2[7] >>> 27;
  9966. }
  9967. a = this._invSubKeys = [];
  9968. for (c = 0; 16 > c; c++)
  9969. a[c] = b2[15 - c];
  9970. },
  9971. encryptBlock: function(b2, a) {
  9972. this._doCryptBlock(b2, a, this._subKeys);
  9973. },
  9974. decryptBlock: function(b2, a) {
  9975. this._doCryptBlock(b2, a, this._invSubKeys);
  9976. },
  9977. _doCryptBlock: function(e2, a, c) {
  9978. this._lBlock = e2[a];
  9979. this._rBlock = e2[a + 1];
  9980. u.call(this, 4, 252645135);
  9981. u.call(this, 16, 65535);
  9982. l.call(this, 2, 858993459);
  9983. l.call(this, 8, 16711935);
  9984. u.call(this, 1, 1431655765);
  9985. for (var d2 = 0; 16 > d2; d2++) {
  9986. for (var f2 = c[d2], n3 = this._lBlock, p3 = this._rBlock, q2 = 0, r2 = 0; 8 > r2; r2++)
  9987. q2 |= b[r2][((p3 ^ f2[r2]) & x[r2]) >>> 0];
  9988. this._lBlock = p3;
  9989. this._rBlock = n3 ^ q2;
  9990. }
  9991. c = this._lBlock;
  9992. this._lBlock = this._rBlock;
  9993. this._rBlock = c;
  9994. u.call(this, 1, 1431655765);
  9995. l.call(this, 8, 16711935);
  9996. l.call(this, 2, 858993459);
  9997. u.call(this, 16, 65535);
  9998. u.call(this, 4, 252645135);
  9999. e2[a] = this._lBlock;
  10000. e2[a + 1] = this._rBlock;
  10001. },
  10002. keySize: 2,
  10003. ivSize: 2,
  10004. blockSize: 2
  10005. });
  10006. d.DES = n2._createHelper(r);
  10007. s2 = s2.TripleDES = n2.extend({
  10008. _doReset: function() {
  10009. var b2 = this._key.words;
  10010. this._des1 = r.createEncryptor(p2.create(b2.slice(0, 2)));
  10011. this._des2 = r.createEncryptor(p2.create(b2.slice(2, 4)));
  10012. this._des3 = r.createEncryptor(p2.create(b2.slice(4, 6)));
  10013. },
  10014. encryptBlock: function(b2, a) {
  10015. this._des1.encryptBlock(b2, a);
  10016. this._des2.decryptBlock(b2, a);
  10017. this._des3.encryptBlock(b2, a);
  10018. },
  10019. decryptBlock: function(b2, a) {
  10020. this._des3.decryptBlock(b2, a);
  10021. this._des2.encryptBlock(b2, a);
  10022. this._des1.decryptBlock(b2, a);
  10023. },
  10024. keySize: 6,
  10025. ivSize: 2,
  10026. blockSize: 2
  10027. });
  10028. d.TripleDES = n2._createHelper(s2);
  10029. })();
  10030. CryptoJS.mode.ECB = function() {
  10031. var ECB = CryptoJS.lib.BlockCipherMode.extend();
  10032. ECB.Encryptor = ECB.extend({
  10033. processBlock: function(words, offset) {
  10034. this._cipher.encryptBlock(words, offset);
  10035. }
  10036. });
  10037. ECB.Decryptor = ECB.extend({
  10038. processBlock: function(words, offset) {
  10039. this._cipher.decryptBlock(words, offset);
  10040. }
  10041. });
  10042. return ECB;
  10043. }();
  10044. let loading = false;
  10045. let count = 0;
  10046. const showLoading = function(title = "") {
  10047. if (!loading) {
  10048. index.showLoading({
  10049. title: title || "",
  10050. mask: true
  10051. });
  10052. loading = true;
  10053. }
  10054. count += 1;
  10055. };
  10056. const hideLoading = function() {
  10057. let timer = setTimeout(() => {
  10058. if (count === 1 && loading) {
  10059. index.hideLoading();
  10060. loading = false;
  10061. }
  10062. count -= 1;
  10063. clearTimeout(timer);
  10064. timer = null;
  10065. }, 0);
  10066. };
  10067. const showToast = function(msg, fn = () => {
  10068. }, duration = 1500) {
  10069. index.showToast({
  10070. title: msg,
  10071. mask: true,
  10072. icon: "none",
  10073. duration
  10074. });
  10075. if (fn) {
  10076. setTimeout(() => {
  10077. fn();
  10078. }, duration);
  10079. }
  10080. };
  10081. const showModal = function(content, callBack = () => {
  10082. }, data = {}) {
  10083. index.showModal({
  10084. content,
  10085. title: data.title || "",
  10086. confirmText: data.confirmText || "确定",
  10087. confirmColor: data.confirmColor || "",
  10088. cancelColor: data.cancelColor || "",
  10089. cancelText: data.cancelText || "",
  10090. showCancel: data.cancelText ? true : false,
  10091. success: (res2) => {
  10092. if (res2.confirm && callBack instanceof Function) {
  10093. callBack();
  10094. }
  10095. if (!res2.confirm && data.callBack instanceof Function) {
  10096. data.callBack();
  10097. }
  10098. }
  10099. });
  10100. };
  10101. const isEmpty = function(obj) {
  10102. if (obj == void 0 || obj == null || obj == "") {
  10103. return true;
  10104. } else if (obj instanceof Array) {
  10105. return obj.length <= 0;
  10106. } else if (obj instanceof Object) {
  10107. return Object.keys(obj).length <= 0;
  10108. }
  10109. return false;
  10110. };
  10111. const isNotEmpty = function(obj) {
  10112. return !isEmpty(obj);
  10113. };
  10114. const isJSON = function(str) {
  10115. if (typeof str == "string") {
  10116. try {
  10117. var obj = JSON.parse(str);
  10118. if (typeof obj == "object" && obj) {
  10119. return true;
  10120. } else {
  10121. return false;
  10122. }
  10123. } catch (e2) {
  10124. return false;
  10125. }
  10126. }
  10127. };
  10128. const desEncrypt = function(message, key) {
  10129. let keyHex = CryptoJS.enc.Utf8.parse(key);
  10130. let encrypted = CryptoJS.DES.encrypt(message, keyHex, {
  10131. mode: CryptoJS.mode.ECB,
  10132. padding: CryptoJS.pad.Pkcs7
  10133. });
  10134. return encrypted.toString();
  10135. };
  10136. const desDecrypt = function(str, key, exportType) {
  10137. let keyHex = CryptoJS.enc.Utf8.parse(key);
  10138. let decrypted = CryptoJS.DES.decrypt(
  10139. exportType == "hex" ? {
  10140. ciphertext: CryptoJS.enc.Hex.parse(str)
  10141. } : str,
  10142. keyHex,
  10143. {
  10144. mode: CryptoJS.mode.ECB,
  10145. padding: CryptoJS.pad.Pkcs7
  10146. }
  10147. );
  10148. return decrypted.toString(CryptoJS.enc.Utf8);
  10149. };
  10150. const turnToMap = (list) => {
  10151. let map = {};
  10152. list.map((item) => {
  10153. map[item.routePath] = JSON.parse(item.infoJson || "{}");
  10154. });
  10155. return map;
  10156. };
  10157. const goToUrl = function(toUrl, data = { skipWay: "navigateTo", data: "" }) {
  10158. var menu = [];
  10159. let num = toUrl.indexOf("?") || 0;
  10160. let key = toUrl.substr(num == -1 ? toUrl.length : num, toUrl.length);
  10161. let url = toUrl.substr(0, num == -1 ? toUrl.length : num);
  10162. if (index.getStorageSync("menuList")) {
  10163. menu = index.getStorageSync("menuList");
  10164. }
  10165. menu = menu.filter((item) => item.MenuName == "DiyMenu");
  10166. if (isNotEmpty(menu) && isNotEmpty(menu[0])) {
  10167. var diyMenu = menu[0];
  10168. diyMenu.Children.forEach(function(val, index2) {
  10169. var FromUrl = val.FromUrl;
  10170. var ToDiyUrl = val.ToUrl;
  10171. if (url == FromUrl) {
  10172. url = ToDiyUrl;
  10173. }
  10174. });
  10175. }
  10176. if (isNotEmpty(data.data)) {
  10177. if (data.data.indexOf("?") == -1) {
  10178. url = url + "?" + data.data;
  10179. } else {
  10180. url = url + data.data;
  10181. }
  10182. }
  10183. if (isNotEmpty(key)) {
  10184. if (key.indexOf("url=") >= 0) {
  10185. let url_ = key.substr(key.indexOf("url=") + 4);
  10186. if (url_ == decodeURIComponent(url_)) {
  10187. url_ = encodeURIComponent(url_);
  10188. }
  10189. key = key.substr(0, key.indexOf("url=") + 4) + url_;
  10190. }
  10191. url = url + key;
  10192. }
  10193. let way = data.skipWay || "navigateTo";
  10194. index[way]({
  10195. url,
  10196. success: () => {
  10197. }
  10198. });
  10199. };
  10200. const navigateBack = function(delta, key = "", value = "") {
  10201. let pages = getCurrentPages();
  10202. pages[pages.length - (delta + 1)];
  10203. if (isNotEmpty(key))
  10204. ;
  10205. index.navigateBack({
  10206. delta
  10207. });
  10208. };
  10209. const dateFormat = function(date) {
  10210. const weekArr = ["日", "一", "二", "三", "四", "五", "六"];
  10211. let year = date.getFullYear();
  10212. let month = formatNumber(date.getMonth() + 1);
  10213. let day = formatNumber(date.getDate());
  10214. let week = weekArr[date.getDay()];
  10215. let hour = formatNumber(date.getHours());
  10216. let min = formatNumber(date.getMinutes());
  10217. let sec = formatNumber(date.getSeconds());
  10218. return {
  10219. regDate: `${year}年${month}月${day}日 星期${week}`,
  10220. date: `${year}${month}${day}`,
  10221. formatYear: `${year}-${month}-${day}`,
  10222. formatMon: `${month}-${day}`,
  10223. formatMon_C: `${month}月${day}日`,
  10224. formatTime: `${year}-${month}-${day} ${hour}:${min}:${sec}`,
  10225. week: `星期${week}`,
  10226. day,
  10227. year,
  10228. time: `${hour}${min}`
  10229. };
  10230. };
  10231. const formatNumber = function(n2) {
  10232. n2 = n2.toString();
  10233. return n2[1] ? n2 : "0" + n2;
  10234. };
  10235. const mergeObject = function(A, B) {
  10236. let res2 = {};
  10237. Object.keys({ ...A, ...B }).map((key) => {
  10238. res2[key] = B[key] || A[key];
  10239. });
  10240. return res2;
  10241. };
  10242. const getDistance = function(la1, lo1, la2, lo2) {
  10243. var La1 = la1 * Math.PI / 180;
  10244. var La2 = la2 * Math.PI / 180;
  10245. var La3 = La1 - La2;
  10246. var Lb3 = lo1 * Math.PI / 180 - lo2 * Math.PI / 180;
  10247. var s2 = 2 * Math.asin(
  10248. Math.sqrt(
  10249. Math.pow(Math.sin(La3 / 2), 2) + Math.cos(La1) * Math.cos(La2) * Math.pow(Math.sin(Lb3 / 2), 2)
  10250. )
  10251. );
  10252. s2 = s2 * 6378.137;
  10253. s2 = Math.round(s2 * 1e4) / 1e4;
  10254. s2 = s2.toFixed(2);
  10255. return s2;
  10256. };
  10257. const sleep$1 = (val = 100) => {
  10258. try {
  10259. val = Number(val);
  10260. return new Promise((resolve2) => {
  10261. let timer = setTimeout(() => {
  10262. resolve2(true);
  10263. clearTimeout(timer);
  10264. timer = null;
  10265. }, val);
  10266. });
  10267. } catch (error) {
  10268. }
  10269. };
  10270. const useFrontEndConfigVersion = async () => {
  10271. return new Promise((resolve2) => {
  10272. index.request({
  10273. url: `${BASE_URL}api/smallproFrontEndConfigVersion/localConfig.do`,
  10274. method: "GET",
  10275. data: {},
  10276. success(resp) {
  10277. if (index.getStorageSync("frontEndConfigVersion") == resp.data.frontEndConfigVersion) {
  10278. index.setStorageSync("frontEndConfigRequest", false);
  10279. } else {
  10280. index.setStorageSync("frontEndConfigRequest", true);
  10281. index.setStorageSync("frontEndConfigVersion", resp.data.frontEndConfigVersion);
  10282. }
  10283. resolve2(false);
  10284. },
  10285. fail(error) {
  10286. index.setStorageSync("frontEndConfigRequest", true);
  10287. resolve2(false);
  10288. }
  10289. });
  10290. });
  10291. };
  10292. const frontEndConfigFn = () => {
  10293. return new Promise(async (resolve2) => {
  10294. let accountInfo = getApp().globalData.accountInfo;
  10295. if (accountInfo.miniProgram.envVersion == "release") {
  10296. index.request({
  10297. url: `${BASE_URL}api/wechaSmallproFrontEndConfig/localConfig.do`,
  10298. method: "GET",
  10299. data: {},
  10300. header: {
  10301. "content-type": "application/x-www-form-urlencoded"
  10302. },
  10303. success(resp) {
  10304. resp.data.fixedAppjsGlobalData = frontEndConfig.fixedAppjsGlobalData;
  10305. index.setStorageSync("frontEndConfig", resp.data);
  10306. resolve2(resp.data);
  10307. },
  10308. fail(error) {
  10309. resolve2(false);
  10310. }
  10311. });
  10312. } else {
  10313. index.setStorageSync("frontEndConfig", frontEndConfig);
  10314. resolve2(frontEndConfig);
  10315. }
  10316. });
  10317. };
  10318. const useSetFrontEndConfig = async () => {
  10319. let has2 = false;
  10320. let frontEndConfigs;
  10321. if (index.getStorageSync("frontEndConfigRequest") || isEmpty(index.getStorageSync("frontEndConfig"))) {
  10322. frontEndConfigs = await frontEndConfigFn();
  10323. } else {
  10324. frontEndConfigs = index.getStorageSync("frontEndConfig");
  10325. }
  10326. return new Promise(async (resolve2) => {
  10327. if (!frontEndConfigs.appjsGlobalData) {
  10328. showModal("小程序登录初始化数据信息未配置");
  10329. has2 = true;
  10330. } else {
  10331. getApp().globalData = Object.assign(getApp().globalData, {
  10332. smallPro_version: getApp().globalData.accountInfo.miniProgram.version || "0.0.0",
  10333. // 登录请求时版本信息, 本地和体验版本都是0.0.0,正式线用获取的
  10334. ...frontEndConfigs.fixedAppjsGlobalData,
  10335. ...frontEndConfigs.appjsGlobalData
  10336. });
  10337. }
  10338. if (!frontEndConfigs.webUiDiy) {
  10339. showModal(
  10340. frontEndConfigs === false ? "网络请求异常,请切换网络重新进入!" : "webUiDiy配置信息未配置"
  10341. );
  10342. index.hideLoading();
  10343. has2 = true;
  10344. } else {
  10345. let config = frontEndConfigs.webUiDiy;
  10346. getApp().globalData.config = frontEndConfigs.webUiDiy;
  10347. let distric = config && config.pageConfiguration && config.pageConfiguration.hospitalDistrict_config;
  10348. if (getApp().globalData.hasDistrict && distric && distric.districtList instanceof Array && distric.districtList[0].districtId) {
  10349. getApp().globalData.districtId = distric.districtList[0].districtId;
  10350. }
  10351. }
  10352. if (frontEndConfigs.appjsGlobalData.updateOrNot) {
  10353. index.redirectTo({
  10354. url: `pages/st1/business/otherService/building/building`
  10355. });
  10356. has2 = true;
  10357. }
  10358. resolve2(has2);
  10359. });
  10360. };
  10361. /*!
  10362. * vuex v4.1.0
  10363. * (c) 2022 Evan You
  10364. * @license MIT
  10365. */
  10366. var storeKey = "store";
  10367. function useStore(key) {
  10368. if (key === void 0)
  10369. key = null;
  10370. return inject(key !== null ? key : storeKey);
  10371. }
  10372. function forEachValue(obj, fn) {
  10373. Object.keys(obj).forEach(function(key) {
  10374. return fn(obj[key], key);
  10375. });
  10376. }
  10377. function isObject(obj) {
  10378. return obj !== null && typeof obj === "object";
  10379. }
  10380. function isPromise(val) {
  10381. return val && typeof val.then === "function";
  10382. }
  10383. function assert(condition, msg) {
  10384. if (!condition) {
  10385. throw new Error("[vuex] " + msg);
  10386. }
  10387. }
  10388. function partial(fn, arg) {
  10389. return function() {
  10390. return fn(arg);
  10391. };
  10392. }
  10393. function genericSubscribe(fn, subs, options) {
  10394. if (subs.indexOf(fn) < 0) {
  10395. options && options.prepend ? subs.unshift(fn) : subs.push(fn);
  10396. }
  10397. return function() {
  10398. var i = subs.indexOf(fn);
  10399. if (i > -1) {
  10400. subs.splice(i, 1);
  10401. }
  10402. };
  10403. }
  10404. function resetStore(store2, hot) {
  10405. store2._actions = /* @__PURE__ */ Object.create(null);
  10406. store2._mutations = /* @__PURE__ */ Object.create(null);
  10407. store2._wrappedGetters = /* @__PURE__ */ Object.create(null);
  10408. store2._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
  10409. var state = store2.state;
  10410. installModule(store2, state, [], store2._modules.root, true);
  10411. resetStoreState(store2, state, hot);
  10412. }
  10413. function resetStoreState(store2, state, hot) {
  10414. var oldState = store2._state;
  10415. var oldScope = store2._scope;
  10416. store2.getters = {};
  10417. store2._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
  10418. var wrappedGetters = store2._wrappedGetters;
  10419. var computedObj = {};
  10420. var computedCache = {};
  10421. var scope = effectScope(true);
  10422. scope.run(function() {
  10423. forEachValue(wrappedGetters, function(fn, key) {
  10424. computedObj[key] = partial(fn, store2);
  10425. computedCache[key] = computed(function() {
  10426. return computedObj[key]();
  10427. });
  10428. Object.defineProperty(store2.getters, key, {
  10429. get: function() {
  10430. return computedCache[key].value;
  10431. },
  10432. enumerable: true
  10433. // for local getters
  10434. });
  10435. });
  10436. });
  10437. store2._state = reactive({
  10438. data: state
  10439. });
  10440. store2._scope = scope;
  10441. if (store2.strict) {
  10442. enableStrictMode(store2);
  10443. }
  10444. if (oldState) {
  10445. if (hot) {
  10446. store2._withCommit(function() {
  10447. oldState.data = null;
  10448. });
  10449. }
  10450. }
  10451. if (oldScope) {
  10452. oldScope.stop();
  10453. }
  10454. }
  10455. function installModule(store2, rootState, path, module2, hot) {
  10456. var isRoot = !path.length;
  10457. var namespace = store2._modules.getNamespace(path);
  10458. if (module2.namespaced) {
  10459. if (store2._modulesNamespaceMap[namespace] && true) {
  10460. console.error("[vuex] duplicate namespace " + namespace + " for the namespaced module " + path.join("/"));
  10461. }
  10462. store2._modulesNamespaceMap[namespace] = module2;
  10463. }
  10464. if (!isRoot && !hot) {
  10465. var parentState = getNestedState(rootState, path.slice(0, -1));
  10466. var moduleName = path[path.length - 1];
  10467. store2._withCommit(function() {
  10468. {
  10469. if (moduleName in parentState) {
  10470. console.warn(
  10471. '[vuex] state field "' + moduleName + '" was overridden by a module with the same name at "' + path.join(".") + '"'
  10472. );
  10473. }
  10474. }
  10475. parentState[moduleName] = module2.state;
  10476. });
  10477. }
  10478. var local = module2.context = makeLocalContext(store2, namespace, path);
  10479. module2.forEachMutation(function(mutation, key) {
  10480. var namespacedType = namespace + key;
  10481. registerMutation(store2, namespacedType, mutation, local);
  10482. });
  10483. module2.forEachAction(function(action, key) {
  10484. var type = action.root ? key : namespace + key;
  10485. var handler = action.handler || action;
  10486. registerAction(store2, type, handler, local);
  10487. });
  10488. module2.forEachGetter(function(getter, key) {
  10489. var namespacedType = namespace + key;
  10490. registerGetter(store2, namespacedType, getter, local);
  10491. });
  10492. module2.forEachChild(function(child, key) {
  10493. installModule(store2, rootState, path.concat(key), child, hot);
  10494. });
  10495. }
  10496. function makeLocalContext(store2, namespace, path) {
  10497. var noNamespace = namespace === "";
  10498. var local = {
  10499. dispatch: noNamespace ? store2.dispatch : function(_type, _payload, _options) {
  10500. var args = unifyObjectStyle(_type, _payload, _options);
  10501. var payload = args.payload;
  10502. var options = args.options;
  10503. var type = args.type;
  10504. if (!options || !options.root) {
  10505. type = namespace + type;
  10506. if (!store2._actions[type]) {
  10507. console.error("[vuex] unknown local action type: " + args.type + ", global type: " + type);
  10508. return;
  10509. }
  10510. }
  10511. return store2.dispatch(type, payload);
  10512. },
  10513. commit: noNamespace ? store2.commit : function(_type, _payload, _options) {
  10514. var args = unifyObjectStyle(_type, _payload, _options);
  10515. var payload = args.payload;
  10516. var options = args.options;
  10517. var type = args.type;
  10518. if (!options || !options.root) {
  10519. type = namespace + type;
  10520. if (!store2._mutations[type]) {
  10521. console.error("[vuex] unknown local mutation type: " + args.type + ", global type: " + type);
  10522. return;
  10523. }
  10524. }
  10525. store2.commit(type, payload, options);
  10526. }
  10527. };
  10528. Object.defineProperties(local, {
  10529. getters: {
  10530. get: noNamespace ? function() {
  10531. return store2.getters;
  10532. } : function() {
  10533. return makeLocalGetters(store2, namespace);
  10534. }
  10535. },
  10536. state: {
  10537. get: function() {
  10538. return getNestedState(store2.state, path);
  10539. }
  10540. }
  10541. });
  10542. return local;
  10543. }
  10544. function makeLocalGetters(store2, namespace) {
  10545. if (!store2._makeLocalGettersCache[namespace]) {
  10546. var gettersProxy = {};
  10547. var splitPos = namespace.length;
  10548. Object.keys(store2.getters).forEach(function(type) {
  10549. if (type.slice(0, splitPos) !== namespace) {
  10550. return;
  10551. }
  10552. var localType = type.slice(splitPos);
  10553. Object.defineProperty(gettersProxy, localType, {
  10554. get: function() {
  10555. return store2.getters[type];
  10556. },
  10557. enumerable: true
  10558. });
  10559. });
  10560. store2._makeLocalGettersCache[namespace] = gettersProxy;
  10561. }
  10562. return store2._makeLocalGettersCache[namespace];
  10563. }
  10564. function registerMutation(store2, type, handler, local) {
  10565. var entry = store2._mutations[type] || (store2._mutations[type] = []);
  10566. entry.push(function wrappedMutationHandler(payload) {
  10567. handler.call(store2, local.state, payload);
  10568. });
  10569. }
  10570. function registerAction(store2, type, handler, local) {
  10571. var entry = store2._actions[type] || (store2._actions[type] = []);
  10572. entry.push(function wrappedActionHandler(payload) {
  10573. var res2 = handler.call(store2, {
  10574. dispatch: local.dispatch,
  10575. commit: local.commit,
  10576. getters: local.getters,
  10577. state: local.state,
  10578. rootGetters: store2.getters,
  10579. rootState: store2.state
  10580. }, payload);
  10581. if (!isPromise(res2)) {
  10582. res2 = Promise.resolve(res2);
  10583. }
  10584. if (store2._devtoolHook) {
  10585. return res2.catch(function(err) {
  10586. store2._devtoolHook.emit("vuex:error", err);
  10587. throw err;
  10588. });
  10589. } else {
  10590. return res2;
  10591. }
  10592. });
  10593. }
  10594. function registerGetter(store2, type, rawGetter, local) {
  10595. if (store2._wrappedGetters[type]) {
  10596. {
  10597. console.error("[vuex] duplicate getter key: " + type);
  10598. }
  10599. return;
  10600. }
  10601. store2._wrappedGetters[type] = function wrappedGetter(store22) {
  10602. return rawGetter(
  10603. local.state,
  10604. // local state
  10605. local.getters,
  10606. // local getters
  10607. store22.state,
  10608. // root state
  10609. store22.getters
  10610. // root getters
  10611. );
  10612. };
  10613. }
  10614. function enableStrictMode(store2) {
  10615. watch(function() {
  10616. return store2._state.data;
  10617. }, function() {
  10618. {
  10619. assert(store2._committing, "do not mutate vuex store state outside mutation handlers.");
  10620. }
  10621. }, { deep: true, flush: "sync" });
  10622. }
  10623. function getNestedState(state, path) {
  10624. return path.reduce(function(state2, key) {
  10625. return state2[key];
  10626. }, state);
  10627. }
  10628. function unifyObjectStyle(type, payload, options) {
  10629. if (isObject(type) && type.type) {
  10630. options = payload;
  10631. payload = type;
  10632. type = type.type;
  10633. }
  10634. {
  10635. assert(typeof type === "string", "expects string as the type, but found " + typeof type + ".");
  10636. }
  10637. return { type, payload, options };
  10638. }
  10639. var Module = function Module2(rawModule, runtime) {
  10640. this.runtime = runtime;
  10641. this._children = /* @__PURE__ */ Object.create(null);
  10642. this._rawModule = rawModule;
  10643. var rawState = rawModule.state;
  10644. this.state = (typeof rawState === "function" ? rawState() : rawState) || {};
  10645. };
  10646. var prototypeAccessors$1 = { namespaced: { configurable: true } };
  10647. prototypeAccessors$1.namespaced.get = function() {
  10648. return !!this._rawModule.namespaced;
  10649. };
  10650. Module.prototype.addChild = function addChild(key, module2) {
  10651. this._children[key] = module2;
  10652. };
  10653. Module.prototype.removeChild = function removeChild(key) {
  10654. delete this._children[key];
  10655. };
  10656. Module.prototype.getChild = function getChild(key) {
  10657. return this._children[key];
  10658. };
  10659. Module.prototype.hasChild = function hasChild(key) {
  10660. return key in this._children;
  10661. };
  10662. Module.prototype.update = function update(rawModule) {
  10663. this._rawModule.namespaced = rawModule.namespaced;
  10664. if (rawModule.actions) {
  10665. this._rawModule.actions = rawModule.actions;
  10666. }
  10667. if (rawModule.mutations) {
  10668. this._rawModule.mutations = rawModule.mutations;
  10669. }
  10670. if (rawModule.getters) {
  10671. this._rawModule.getters = rawModule.getters;
  10672. }
  10673. };
  10674. Module.prototype.forEachChild = function forEachChild(fn) {
  10675. forEachValue(this._children, fn);
  10676. };
  10677. Module.prototype.forEachGetter = function forEachGetter(fn) {
  10678. if (this._rawModule.getters) {
  10679. forEachValue(this._rawModule.getters, fn);
  10680. }
  10681. };
  10682. Module.prototype.forEachAction = function forEachAction(fn) {
  10683. if (this._rawModule.actions) {
  10684. forEachValue(this._rawModule.actions, fn);
  10685. }
  10686. };
  10687. Module.prototype.forEachMutation = function forEachMutation(fn) {
  10688. if (this._rawModule.mutations) {
  10689. forEachValue(this._rawModule.mutations, fn);
  10690. }
  10691. };
  10692. Object.defineProperties(Module.prototype, prototypeAccessors$1);
  10693. var ModuleCollection = function ModuleCollection2(rawRootModule) {
  10694. this.register([], rawRootModule, false);
  10695. };
  10696. ModuleCollection.prototype.get = function get2(path) {
  10697. return path.reduce(function(module2, key) {
  10698. return module2.getChild(key);
  10699. }, this.root);
  10700. };
  10701. ModuleCollection.prototype.getNamespace = function getNamespace(path) {
  10702. var module2 = this.root;
  10703. return path.reduce(function(namespace, key) {
  10704. module2 = module2.getChild(key);
  10705. return namespace + (module2.namespaced ? key + "/" : "");
  10706. }, "");
  10707. };
  10708. ModuleCollection.prototype.update = function update$1(rawRootModule) {
  10709. update2([], this.root, rawRootModule);
  10710. };
  10711. ModuleCollection.prototype.register = function register(path, rawModule, runtime) {
  10712. var this$1$1 = this;
  10713. if (runtime === void 0)
  10714. runtime = true;
  10715. {
  10716. assertRawModule(path, rawModule);
  10717. }
  10718. var newModule = new Module(rawModule, runtime);
  10719. if (path.length === 0) {
  10720. this.root = newModule;
  10721. } else {
  10722. var parent = this.get(path.slice(0, -1));
  10723. parent.addChild(path[path.length - 1], newModule);
  10724. }
  10725. if (rawModule.modules) {
  10726. forEachValue(rawModule.modules, function(rawChildModule, key) {
  10727. this$1$1.register(path.concat(key), rawChildModule, runtime);
  10728. });
  10729. }
  10730. };
  10731. ModuleCollection.prototype.unregister = function unregister(path) {
  10732. var parent = this.get(path.slice(0, -1));
  10733. var key = path[path.length - 1];
  10734. var child = parent.getChild(key);
  10735. if (!child) {
  10736. {
  10737. console.warn(
  10738. "[vuex] trying to unregister module '" + key + "', which is not registered"
  10739. );
  10740. }
  10741. return;
  10742. }
  10743. if (!child.runtime) {
  10744. return;
  10745. }
  10746. parent.removeChild(key);
  10747. };
  10748. ModuleCollection.prototype.isRegistered = function isRegistered(path) {
  10749. var parent = this.get(path.slice(0, -1));
  10750. var key = path[path.length - 1];
  10751. if (parent) {
  10752. return parent.hasChild(key);
  10753. }
  10754. return false;
  10755. };
  10756. function update2(path, targetModule, newModule) {
  10757. {
  10758. assertRawModule(path, newModule);
  10759. }
  10760. targetModule.update(newModule);
  10761. if (newModule.modules) {
  10762. for (var key in newModule.modules) {
  10763. if (!targetModule.getChild(key)) {
  10764. {
  10765. console.warn(
  10766. "[vuex] trying to add a new module '" + key + "' on hot reloading, manual reload is needed"
  10767. );
  10768. }
  10769. return;
  10770. }
  10771. update2(
  10772. path.concat(key),
  10773. targetModule.getChild(key),
  10774. newModule.modules[key]
  10775. );
  10776. }
  10777. }
  10778. }
  10779. var functionAssert = {
  10780. assert: function(value) {
  10781. return typeof value === "function";
  10782. },
  10783. expected: "function"
  10784. };
  10785. var objectAssert = {
  10786. assert: function(value) {
  10787. return typeof value === "function" || typeof value === "object" && typeof value.handler === "function";
  10788. },
  10789. expected: 'function or object with "handler" function'
  10790. };
  10791. var assertTypes = {
  10792. getters: functionAssert,
  10793. mutations: functionAssert,
  10794. actions: objectAssert
  10795. };
  10796. function assertRawModule(path, rawModule) {
  10797. Object.keys(assertTypes).forEach(function(key) {
  10798. if (!rawModule[key]) {
  10799. return;
  10800. }
  10801. var assertOptions = assertTypes[key];
  10802. forEachValue(rawModule[key], function(value, type) {
  10803. assert(
  10804. assertOptions.assert(value),
  10805. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10806. );
  10807. });
  10808. });
  10809. }
  10810. function makeAssertionMessage(path, key, type, value, expected) {
  10811. var buf = key + " should be " + expected + ' but "' + key + "." + type + '"';
  10812. if (path.length > 0) {
  10813. buf += ' in module "' + path.join(".") + '"';
  10814. }
  10815. buf += " is " + JSON.stringify(value) + ".";
  10816. return buf;
  10817. }
  10818. function createStore(options) {
  10819. return new Store(options);
  10820. }
  10821. var Store = function Store2(options) {
  10822. var this$1$1 = this;
  10823. if (options === void 0)
  10824. options = {};
  10825. {
  10826. assert(typeof Promise !== "undefined", "vuex requires a Promise polyfill in this browser.");
  10827. assert(this instanceof Store2, "store must be called with the new operator.");
  10828. }
  10829. var plugins = options.plugins;
  10830. if (plugins === void 0)
  10831. plugins = [];
  10832. var strict = options.strict;
  10833. if (strict === void 0)
  10834. strict = false;
  10835. var devtools2 = options.devtools;
  10836. this._committing = false;
  10837. this._actions = /* @__PURE__ */ Object.create(null);
  10838. this._actionSubscribers = [];
  10839. this._mutations = /* @__PURE__ */ Object.create(null);
  10840. this._wrappedGetters = /* @__PURE__ */ Object.create(null);
  10841. this._modules = new ModuleCollection(options);
  10842. this._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
  10843. this._subscribers = [];
  10844. this._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
  10845. this._scope = null;
  10846. this._devtools = devtools2;
  10847. var store2 = this;
  10848. var ref2 = this;
  10849. var dispatch2 = ref2.dispatch;
  10850. var commit2 = ref2.commit;
  10851. this.dispatch = function boundDispatch(type, payload) {
  10852. return dispatch2.call(store2, type, payload);
  10853. };
  10854. this.commit = function boundCommit(type, payload, options2) {
  10855. return commit2.call(store2, type, payload, options2);
  10856. };
  10857. this.strict = strict;
  10858. var state = this._modules.root.state;
  10859. installModule(this, state, [], this._modules.root);
  10860. resetStoreState(this, state);
  10861. plugins.forEach(function(plugin2) {
  10862. return plugin2(this$1$1);
  10863. });
  10864. };
  10865. var prototypeAccessors = { state: { configurable: true } };
  10866. Store.prototype.install = function install(app, injectKey) {
  10867. app.provide(injectKey || storeKey, this);
  10868. app.config.globalProperties.$store = this;
  10869. this._devtools !== void 0 ? this._devtools : true;
  10870. };
  10871. prototypeAccessors.state.get = function() {
  10872. return this._state.data;
  10873. };
  10874. prototypeAccessors.state.set = function(v) {
  10875. {
  10876. assert(false, "use store.replaceState() to explicit replace store state.");
  10877. }
  10878. };
  10879. Store.prototype.commit = function commit(_type, _payload, _options) {
  10880. var this$1$1 = this;
  10881. var ref2 = unifyObjectStyle(_type, _payload, _options);
  10882. var type = ref2.type;
  10883. var payload = ref2.payload;
  10884. var options = ref2.options;
  10885. var mutation = { type, payload };
  10886. var entry = this._mutations[type];
  10887. if (!entry) {
  10888. {
  10889. console.error("[vuex] unknown mutation type: " + type);
  10890. }
  10891. return;
  10892. }
  10893. this._withCommit(function() {
  10894. entry.forEach(function commitIterator(handler) {
  10895. handler(payload);
  10896. });
  10897. });
  10898. this._subscribers.slice().forEach(function(sub) {
  10899. return sub(mutation, this$1$1.state);
  10900. });
  10901. if (options && options.silent) {
  10902. console.warn(
  10903. "[vuex] mutation type: " + type + ". Silent option has been removed. Use the filter functionality in the vue-devtools"
  10904. );
  10905. }
  10906. };
  10907. Store.prototype.dispatch = function dispatch(_type, _payload) {
  10908. var this$1$1 = this;
  10909. var ref2 = unifyObjectStyle(_type, _payload);
  10910. var type = ref2.type;
  10911. var payload = ref2.payload;
  10912. var action = { type, payload };
  10913. var entry = this._actions[type];
  10914. if (!entry) {
  10915. {
  10916. console.error("[vuex] unknown action type: " + type);
  10917. }
  10918. return;
  10919. }
  10920. try {
  10921. this._actionSubscribers.slice().filter(function(sub) {
  10922. return sub.before;
  10923. }).forEach(function(sub) {
  10924. return sub.before(action, this$1$1.state);
  10925. });
  10926. } catch (e2) {
  10927. {
  10928. console.warn("[vuex] error in before action subscribers: ");
  10929. console.error(e2);
  10930. }
  10931. }
  10932. var result = entry.length > 1 ? Promise.all(entry.map(function(handler) {
  10933. return handler(payload);
  10934. })) : entry[0](payload);
  10935. return new Promise(function(resolve2, reject) {
  10936. result.then(function(res2) {
  10937. try {
  10938. this$1$1._actionSubscribers.filter(function(sub) {
  10939. return sub.after;
  10940. }).forEach(function(sub) {
  10941. return sub.after(action, this$1$1.state);
  10942. });
  10943. } catch (e2) {
  10944. {
  10945. console.warn("[vuex] error in after action subscribers: ");
  10946. console.error(e2);
  10947. }
  10948. }
  10949. resolve2(res2);
  10950. }, function(error) {
  10951. try {
  10952. this$1$1._actionSubscribers.filter(function(sub) {
  10953. return sub.error;
  10954. }).forEach(function(sub) {
  10955. return sub.error(action, this$1$1.state, error);
  10956. });
  10957. } catch (e2) {
  10958. {
  10959. console.warn("[vuex] error in error action subscribers: ");
  10960. console.error(e2);
  10961. }
  10962. }
  10963. reject(error);
  10964. });
  10965. });
  10966. };
  10967. Store.prototype.subscribe = function subscribe(fn, options) {
  10968. return genericSubscribe(fn, this._subscribers, options);
  10969. };
  10970. Store.prototype.subscribeAction = function subscribeAction(fn, options) {
  10971. var subs = typeof fn === "function" ? { before: fn } : fn;
  10972. return genericSubscribe(subs, this._actionSubscribers, options);
  10973. };
  10974. Store.prototype.watch = function watch$1(getter, cb, options) {
  10975. var this$1$1 = this;
  10976. {
  10977. assert(typeof getter === "function", "store.watch only accepts a function.");
  10978. }
  10979. return watch(function() {
  10980. return getter(this$1$1.state, this$1$1.getters);
  10981. }, cb, Object.assign({}, options));
  10982. };
  10983. Store.prototype.replaceState = function replaceState(state) {
  10984. var this$1$1 = this;
  10985. this._withCommit(function() {
  10986. this$1$1._state.data = state;
  10987. });
  10988. };
  10989. Store.prototype.registerModule = function registerModule(path, rawModule, options) {
  10990. if (options === void 0)
  10991. options = {};
  10992. if (typeof path === "string") {
  10993. path = [path];
  10994. }
  10995. {
  10996. assert(Array.isArray(path), "module path must be a string or an Array.");
  10997. assert(path.length > 0, "cannot register the root module by using registerModule.");
  10998. }
  10999. this._modules.register(path, rawModule);
  11000. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  11001. resetStoreState(this, this.state);
  11002. };
  11003. Store.prototype.unregisterModule = function unregisterModule(path) {
  11004. var this$1$1 = this;
  11005. if (typeof path === "string") {
  11006. path = [path];
  11007. }
  11008. {
  11009. assert(Array.isArray(path), "module path must be a string or an Array.");
  11010. }
  11011. this._modules.unregister(path);
  11012. this._withCommit(function() {
  11013. var parentState = getNestedState(this$1$1.state, path.slice(0, -1));
  11014. delete parentState[path[path.length - 1]];
  11015. });
  11016. resetStore(this);
  11017. };
  11018. Store.prototype.hasModule = function hasModule(path) {
  11019. if (typeof path === "string") {
  11020. path = [path];
  11021. }
  11022. {
  11023. assert(Array.isArray(path), "module path must be a string or an Array.");
  11024. }
  11025. return this._modules.isRegistered(path);
  11026. };
  11027. Store.prototype.hotUpdate = function hotUpdate(newOptions) {
  11028. this._modules.update(newOptions);
  11029. resetStore(this, true);
  11030. };
  11031. Store.prototype._withCommit = function _withCommit(fn) {
  11032. var committing = this._committing;
  11033. this._committing = true;
  11034. fn();
  11035. this._committing = committing;
  11036. };
  11037. Object.defineProperties(Store.prototype, prototypeAccessors);
  11038. var mapState$1 = normalizeNamespace(function(namespace, states) {
  11039. var res2 = {};
  11040. if (!isValidMap(states)) {
  11041. console.error("[vuex] mapState: mapper parameter must be either an Array or an Object");
  11042. }
  11043. normalizeMap(states).forEach(function(ref2) {
  11044. var key = ref2.key;
  11045. var val = ref2.val;
  11046. res2[key] = function mappedState() {
  11047. var state = this.$store.state;
  11048. var getters = this.$store.getters;
  11049. if (namespace) {
  11050. var module2 = getModuleByNamespace(this.$store, "mapState", namespace);
  11051. if (!module2) {
  11052. return;
  11053. }
  11054. state = module2.context.state;
  11055. getters = module2.context.getters;
  11056. }
  11057. return typeof val === "function" ? val.call(this, state, getters) : state[val];
  11058. };
  11059. res2[key].vuex = true;
  11060. });
  11061. return res2;
  11062. });
  11063. var mapMutations$1 = normalizeNamespace(function(namespace, mutations) {
  11064. var res2 = {};
  11065. if (!isValidMap(mutations)) {
  11066. console.error("[vuex] mapMutations: mapper parameter must be either an Array or an Object");
  11067. }
  11068. normalizeMap(mutations).forEach(function(ref2) {
  11069. var key = ref2.key;
  11070. var val = ref2.val;
  11071. res2[key] = function mappedMutation() {
  11072. var args = [], len = arguments.length;
  11073. while (len--)
  11074. args[len] = arguments[len];
  11075. var commit2 = this.$store.commit;
  11076. if (namespace) {
  11077. var module2 = getModuleByNamespace(this.$store, "mapMutations", namespace);
  11078. if (!module2) {
  11079. return;
  11080. }
  11081. commit2 = module2.context.commit;
  11082. }
  11083. return typeof val === "function" ? val.apply(this, [commit2].concat(args)) : commit2.apply(this.$store, [val].concat(args));
  11084. };
  11085. });
  11086. return res2;
  11087. });
  11088. var mapGetters$1 = normalizeNamespace(function(namespace, getters) {
  11089. var res2 = {};
  11090. if (!isValidMap(getters)) {
  11091. console.error("[vuex] mapGetters: mapper parameter must be either an Array or an Object");
  11092. }
  11093. normalizeMap(getters).forEach(function(ref2) {
  11094. var key = ref2.key;
  11095. var val = ref2.val;
  11096. val = namespace + val;
  11097. res2[key] = function mappedGetter() {
  11098. if (namespace && !getModuleByNamespace(this.$store, "mapGetters", namespace)) {
  11099. return;
  11100. }
  11101. if (!(val in this.$store.getters)) {
  11102. console.error("[vuex] unknown getter: " + val);
  11103. return;
  11104. }
  11105. return this.$store.getters[val];
  11106. };
  11107. res2[key].vuex = true;
  11108. });
  11109. return res2;
  11110. });
  11111. function normalizeMap(map) {
  11112. if (!isValidMap(map)) {
  11113. return [];
  11114. }
  11115. return Array.isArray(map) ? map.map(function(key) {
  11116. return { key, val: key };
  11117. }) : Object.keys(map).map(function(key) {
  11118. return { key, val: map[key] };
  11119. });
  11120. }
  11121. function isValidMap(map) {
  11122. return Array.isArray(map) || isObject(map);
  11123. }
  11124. function normalizeNamespace(fn) {
  11125. return function(namespace, map) {
  11126. if (typeof namespace !== "string") {
  11127. map = namespace;
  11128. namespace = "";
  11129. } else if (namespace.charAt(namespace.length - 1) !== "/") {
  11130. namespace += "/";
  11131. }
  11132. return fn(namespace, map);
  11133. };
  11134. }
  11135. function getModuleByNamespace(store2, helper, namespace) {
  11136. var module2 = store2._modulesNamespaceMap[namespace];
  11137. if (!module2) {
  11138. console.error("[vuex] module namespace not found in " + helper + "(): " + namespace);
  11139. }
  11140. return module2;
  11141. }
  11142. const global$1 = {
  11143. state: {
  11144. token: "",
  11145. openId: "",
  11146. unionId: "",
  11147. smallProOpenId: "",
  11148. wechatOpenId: "",
  11149. memberList: [],
  11150. currentUser: null
  11151. },
  11152. getters: {
  11153. /** 获取token */
  11154. getToken: (state) => {
  11155. return state.token;
  11156. },
  11157. /** 获取openId */
  11158. getOpenId: (state) => {
  11159. return state.openId;
  11160. },
  11161. /** 获取unionId */
  11162. getUnionId: (state) => {
  11163. return state.unionId;
  11164. },
  11165. /** 获取smallProOpenId */
  11166. getSmallProOpenId: (state) => {
  11167. return state.smallProOpenId;
  11168. },
  11169. /** 获取wechatOpenId */
  11170. getWechatOpenId: (state) => {
  11171. return state.wechatOpenId;
  11172. },
  11173. /** 获取就诊人列表 */
  11174. getMemberList: (state) => {
  11175. return state.memberList;
  11176. },
  11177. /** 获取当前就诊人 */
  11178. getCurrentUser: (state) => {
  11179. return state.currentUser;
  11180. }
  11181. },
  11182. mutations: {
  11183. /** 设置token */
  11184. setToken: (state, token) => {
  11185. index.setStorageSync("token", token);
  11186. state.token = token;
  11187. },
  11188. /** 设置openId */
  11189. setOpenId: (state, openId) => {
  11190. state.openId = openId;
  11191. },
  11192. /** 设置unionId */
  11193. setUnionId: (state, unionId) => {
  11194. state.unionId = unionId;
  11195. },
  11196. /** 设置smallProOpenId */
  11197. setSmallProOpenId: (state, smallProOpenId) => {
  11198. state.smallProOpenId = smallProOpenId;
  11199. },
  11200. /** 设置wechatOpenId */
  11201. setWechatOpenId: (state, wechatOpenId) => {
  11202. state.wechatOpenId = wechatOpenId;
  11203. },
  11204. /** 设置就诊人列表 */
  11205. setMemberList: (state, list) => {
  11206. state.memberList = list;
  11207. },
  11208. /** 设置当前就诊人 */
  11209. setCurrentUser: (state, member) => {
  11210. state.currentUser = member;
  11211. }
  11212. },
  11213. actions: {},
  11214. modules: {}
  11215. };
  11216. const useStateMapper = (mapper, mapFn) => {
  11217. const store2 = useStore();
  11218. const storeStateFns = mapFn(mapper);
  11219. const storeState = {};
  11220. Object.keys(storeStateFns).forEach((fnKey) => {
  11221. const fn = storeStateFns[fnKey].bind({ $store: store2 });
  11222. storeState[fnKey] = computed(fn);
  11223. });
  11224. return storeState;
  11225. };
  11226. const useStateGetters = (mapper, mapFn) => {
  11227. const store2 = useStore();
  11228. const storeStateFns = mapFn(mapper);
  11229. const storeState = {};
  11230. Object.keys(storeStateFns).forEach((fnKey) => {
  11231. const fn = storeStateFns[fnKey].bind({ $store: store2 });
  11232. storeState[fnKey] = fn;
  11233. });
  11234. return storeState;
  11235. };
  11236. const mapState = (map) => {
  11237. let mapperFn = mapState$1;
  11238. return useStateMapper(map, mapperFn);
  11239. };
  11240. const mapGetters = (map) => {
  11241. let mapperFn = mapGetters$1;
  11242. return useStateGetters(map, mapperFn);
  11243. };
  11244. const mapMutations = (map) => {
  11245. let mapperFn = mapMutations$1;
  11246. return useStateGetters(map, mapperFn);
  11247. };
  11248. const store = createStore({
  11249. ...global$1,
  11250. modules: {}
  11251. });
  11252. let _app;
  11253. const httpPost = (url, data, options = {}, complete = void 0) => {
  11254. let has2 = getApp().globalData.accountInfo.miniProgram.envVersion != "develop";
  11255. let querData = {};
  11256. if (isNotEmpty(getApp().globalData.noNeedSecretKeyApiArr)) {
  11257. for (let i of getApp().globalData.noNeedSecretKeyApiArr) {
  11258. if (url.indexOf(i) != "-1") {
  11259. has2 = false;
  11260. break;
  11261. }
  11262. }
  11263. }
  11264. if (url.indexOf("callApiJSON") == -1 && url.indexOf("callApi.do") == -1) {
  11265. has2 = false;
  11266. }
  11267. let showLoading$1 = true;
  11268. if (options != void 0 && options.showLoading != void 0) {
  11269. showLoading$1 = options.showLoading;
  11270. }
  11271. if (showLoading$1) {
  11272. showLoading();
  11273. }
  11274. let header = {
  11275. "content-type": "application/json",
  11276. token: store.state.token,
  11277. "call-appId": index.getStorageSync("frontEndConfig").fixedAppjsGlobalData.appId
  11278. };
  11279. if (has2 && isNotEmpty(getApp().globalData.apiSecretKey)) {
  11280. header.appId = "KASIET_alismaillpro", querData.data = desEncrypt(JSON.stringify(data), getApp().globalData.apiSecretKey);
  11281. }
  11282. if (options) {
  11283. const extOptions = [
  11284. "showLoading",
  11285. // 显示加载中
  11286. "onChunkReceived",
  11287. // 分块传输监听
  11288. "timeout",
  11289. // 超时时间, 默认取/app.json里的networkTimeout配置
  11290. "responseType"
  11291. // 响应结果
  11292. ];
  11293. Object.keys(options).forEach((key) => {
  11294. if (!extOptions.includes(key)) {
  11295. header[key] = options[key];
  11296. }
  11297. });
  11298. }
  11299. return new Promise((resolve2, reject) => {
  11300. const enableChunked = options && typeof options.onChunkReceived == "function";
  11301. const requestOptions = {
  11302. url,
  11303. data: isEmpty(querData) ? data : querData,
  11304. method: "POST",
  11305. header,
  11306. enableChunked,
  11307. // 新增分块数据
  11308. success(res2) {
  11309. if (showLoading$1) {
  11310. hideLoading();
  11311. }
  11312. if (!complete) {
  11313. if (options && options.construction) {
  11314. resolve2({ data: { Data: res2.data, RespCode: 1e4 } });
  11315. } else {
  11316. resolve2(res2);
  11317. }
  11318. }
  11319. },
  11320. fail(error) {
  11321. if (showLoading$1) {
  11322. hideLoading();
  11323. }
  11324. if (!complete) {
  11325. reject(error);
  11326. }
  11327. index.__f__("error", "at node_modules/@kasite/uni-app-base/service/request.ts:84", error);
  11328. showToast(`连接超时,请重试`);
  11329. },
  11330. complete(res2) {
  11331. if (complete) {
  11332. resolve2(res2);
  11333. }
  11334. }
  11335. };
  11336. if (options && options.timeout != void 0 && options.timeout != null) {
  11337. requestOptions.timeout = options.timeout;
  11338. }
  11339. if (options && options.responseType != void 0 && options.responseType != null) {
  11340. requestOptions.responseType = options.responseType;
  11341. }
  11342. const wxRequest = index.request(requestOptions);
  11343. if (enableChunked) {
  11344. wxRequest.onChunkReceived(options.onChunkReceived);
  11345. }
  11346. });
  11347. };
  11348. const doPost = async (url, data, options = {}, complete = void 0) => {
  11349. const response = httpPost(url, data, options, complete);
  11350. let loginAgain = false;
  11351. await response.then((resp) => {
  11352. if (resp.data.RespCode == 401) {
  11353. loginAgain = true;
  11354. }
  11355. });
  11356. if (!loginAgain) {
  11357. return response;
  11358. }
  11359. if (index.getStorageSync("isCall") != 1) {
  11360. index.setStorageSync("isCall", 1);
  11361. index.setStorageSync("data_expiration", 0);
  11362. index.__f__("log", "at node_modules/@kasite/uni-app-base/service/request.ts:129", "login timeout");
  11363. let retry2 = getApp().globalData.retryNum;
  11364. while (retry2 > 0) {
  11365. await useSmallProgramLogin(_app).then((resp) => {
  11366. if (resp.data.RespCode != "10000") {
  11367. retry2--;
  11368. } else {
  11369. retry2 = 0;
  11370. }
  11371. });
  11372. if (retry2 != 0) {
  11373. await sleep(300);
  11374. }
  11375. }
  11376. }
  11377. let retry = getApp().globalData.retryNum;
  11378. while (retry > 0) {
  11379. if (index.getStorageSync("isCall") != 1) {
  11380. return httpPost(url, data, options);
  11381. } else {
  11382. await sleep(500);
  11383. retry--;
  11384. }
  11385. }
  11386. return httpPost(url, data, options);
  11387. };
  11388. const doGet = async (url, data, options = {}) => {
  11389. const response = httpGet(url, data, options);
  11390. let loginAgain = false;
  11391. await response.then((resp) => {
  11392. if (resp.data.RespCode == 401) {
  11393. loginAgain = true;
  11394. }
  11395. });
  11396. if (!loginAgain) {
  11397. return response;
  11398. }
  11399. if (index.getStorageSync("isCall") != 1) {
  11400. index.setStorageSync("isCall", 1);
  11401. index.setStorageSync("data_expiration", 0);
  11402. let retry2 = getApp().globalData.retryNum;
  11403. while (retry2 > 0) {
  11404. await useSmallProgramLogin(_app).then((resp) => {
  11405. if (resp.data.RespCode != "10000") {
  11406. retry2--;
  11407. } else {
  11408. retry2 = 0;
  11409. }
  11410. });
  11411. if (retry2 != 0) {
  11412. await sleep(300);
  11413. }
  11414. }
  11415. }
  11416. let retry = getApp().globalData.retryNum;
  11417. while (retry > 0) {
  11418. if (index.getStorageSync("isCall") != 1) {
  11419. return httpGet(url, data, options);
  11420. } else {
  11421. await sleep(500);
  11422. retry--;
  11423. }
  11424. }
  11425. return httpGet(url, data, options);
  11426. };
  11427. const httpGet = (url, data, options = {}) => {
  11428. let showLoading$1 = true;
  11429. if (options != void 0 && options.showLoading != void 0) {
  11430. showLoading$1 = options.showLoading;
  11431. }
  11432. if (showLoading$1) {
  11433. showLoading();
  11434. }
  11435. let header = {
  11436. "content-type": "application/json",
  11437. token: getApp().globalData.token || index.getStorageSync("token"),
  11438. "call-appId": index.getStorageSync("frontEndConfig").fixedAppjsGlobalData.appId
  11439. };
  11440. if (options) {
  11441. Object.keys(options).forEach((key) => {
  11442. if (key != "showLoading") {
  11443. header[key] = options[key];
  11444. }
  11445. });
  11446. }
  11447. return new Promise((resolve2, reject) => {
  11448. index.request({
  11449. url,
  11450. data,
  11451. method: "GET",
  11452. header,
  11453. success(res2) {
  11454. if (showLoading$1) {
  11455. hideLoading();
  11456. }
  11457. if (options && options.construction) {
  11458. resolve2({ data: { Data: res2.data, RespCode: 1e4 } });
  11459. } else {
  11460. resolve2(res2);
  11461. }
  11462. },
  11463. fail(error) {
  11464. if (showLoading$1) {
  11465. hideLoading();
  11466. }
  11467. reject(error);
  11468. showToast(`连接超时,请重试`);
  11469. }
  11470. });
  11471. });
  11472. };
  11473. const sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
  11474. const request = {
  11475. doPost,
  11476. doGet
  11477. };
  11478. function createSSEParser(callback) {
  11479. let buffer2 = "";
  11480. let currentEvent = "message";
  11481. function parse2(chunk) {
  11482. buffer2 += chunk;
  11483. const messages = buffer2.split("\n\n");
  11484. buffer2 = messages.pop();
  11485. messages.forEach((message) => {
  11486. if (message.trim()) {
  11487. currentEvent = "message";
  11488. parseMessage(message);
  11489. }
  11490. });
  11491. }
  11492. function parseMessage(message) {
  11493. const lines = message.split("\n");
  11494. let event = "message";
  11495. const dataLines = [];
  11496. lines.forEach((line) => {
  11497. if (line.startsWith("event:")) {
  11498. event = line.slice(6).trim();
  11499. currentEvent = event;
  11500. } else if (line.startsWith("data:")) {
  11501. dataLines.push(line.slice(5).trim());
  11502. }
  11503. });
  11504. if (dataLines.length > 0) {
  11505. dataLines.forEach((data) => {
  11506. callback(currentEvent, data);
  11507. });
  11508. } else if (currentEvent !== "message") {
  11509. callback(currentEvent, null);
  11510. }
  11511. }
  11512. return {
  11513. parse: parse2
  11514. };
  11515. }
  11516. getApp();
  11517. const promistHandle = (res2) => {
  11518. if (typeof res2.data.data == "string" && res2.data.data.constructor == String) {
  11519. res2.data = JSON.parse(desDecrypt(res2.data.data, getApp().globalData.apiSecretKey));
  11520. }
  11521. let resp = "";
  11522. if (res2.data.RespCode == "10000" || res2.data.resultCode == "0") {
  11523. resp = [];
  11524. if (res2.data.Data instanceof Array || res2.data.Data instanceof Object) {
  11525. resp = res2.data.Data;
  11526. } else if (res2.data.WxPayConfigKey || res2.data.resultCode == "0" || res2.data.configKey || res2.data.result || res2.data.clientId) {
  11527. resp = res2.data;
  11528. }
  11529. } else {
  11530. if (res2.data.RespCode == 503) {
  11531. jumpErrorPage();
  11532. }
  11533. if (res2.data.RespCode != "401") {
  11534. resp = res2.data.RespMessage || res2.data.errMsg;
  11535. }
  11536. }
  11537. return resp;
  11538. };
  11539. const catchPromise = (resp, callBack, showModal$1 = true) => {
  11540. if (resp === "") {
  11541. return false;
  11542. }
  11543. if (typeof resp != "object") {
  11544. if (!showModal$1) {
  11545. return false;
  11546. }
  11547. showModal(resp);
  11548. return false;
  11549. } else {
  11550. if (callBack) {
  11551. return callBack();
  11552. }
  11553. }
  11554. };
  11555. const promistHandleNew = (res2) => {
  11556. if (typeof res2.data.data == "string" && res2.data.data.constructor == String) {
  11557. res2.data = JSON.parse(desDecrypt(res2.data.data, getApp().globalData.apiSecretKey));
  11558. }
  11559. let resp = "";
  11560. if (res2.data.RespCode == "10000" || res2.data.resultCode == "0") {
  11561. resp = [];
  11562. if (res2.data.Data instanceof Array || res2.data.Data instanceof Object) {
  11563. resp = res2.data.Data;
  11564. } else if (res2.data.WxPayConfigKey || res2.data.resultCode == "0" || res2.data.configKey || res2.data.result || res2.data.clientId) {
  11565. resp = res2.data;
  11566. }
  11567. } else {
  11568. if (res2.data.RespCode == 503) {
  11569. jumpErrorPage();
  11570. }
  11571. if (res2.data.RespCode != "401") {
  11572. resp = res2.data.RespMessage || res2.data.errMsg;
  11573. }
  11574. }
  11575. return {
  11576. resp,
  11577. resData: res2.data
  11578. };
  11579. };
  11580. const catchPromiseNew = (data, callBack, option = {
  11581. showModal: true,
  11582. showModalCallBack: () => {
  11583. }
  11584. }) => {
  11585. if (data.resp === "") {
  11586. return {
  11587. resp: false,
  11588. resData: data.resData
  11589. };
  11590. }
  11591. if (typeof data.resp != "object") {
  11592. if (!option.showModal || data.resData.RespCode == 503) {
  11593. return {
  11594. resp: false,
  11595. resData: data.resData
  11596. };
  11597. }
  11598. showModal(data.resp, option.showModalCallBack);
  11599. return {
  11600. resp: false,
  11601. resData: data.resData
  11602. };
  11603. } else {
  11604. if (callBack) {
  11605. return callBack();
  11606. }
  11607. }
  11608. };
  11609. const jumpErrorPage = () => {
  11610. const [currentPage] = getCurrentPages();
  11611. const maintainPage = "pages/st1/business/errorPage/maintain/maintain";
  11612. const offlinePage = "pages/st1/business/errorPage/offline/offline";
  11613. const isMaintainPage = currentPage.route.indexOf(maintainPage) > 0;
  11614. const isOfflinePage = currentPage.route.indexOf(offlinePage) > 0;
  11615. let jumpPage = "";
  11616. if (res.data.RespCode == "maintain" && !isMaintainPage) {
  11617. jumpPage = maintainPage;
  11618. }
  11619. if (res.data.RespCode == "offline" && !isOfflinePage) {
  11620. jumpPage = offlinePage;
  11621. }
  11622. jumpPage && index.reLaunch({
  11623. url: `/${jumpPage}`
  11624. });
  11625. };
  11626. function arrayBufferToString(arrayBuffer) {
  11627. let binary = "";
  11628. const bytes = new Uint8Array(arrayBuffer);
  11629. const len = bytes.byteLength;
  11630. for (let i = 0; i < len; i++) {
  11631. binary += String.fromCharCode(bytes[i]);
  11632. }
  11633. return decodeURIComponent(escape(binary));
  11634. }
  11635. const sseChunkDataHandle = (onChunkReceived) => {
  11636. let ssePaser = createSSEParser(onChunkReceived);
  11637. return (res2) => {
  11638. try {
  11639. let data = arrayBufferToString(res2.data);
  11640. index.__f__("log", "at node_modules/@kasite/uni-app-base/service/handle.js:173", "==>", data);
  11641. ssePaser.parse(data);
  11642. } catch (e2) {
  11643. index.__f__("error", "at node_modules/@kasite/uni-app-base/service/handle.js:176", e2);
  11644. }
  11645. };
  11646. };
  11647. const handle = {
  11648. promistHandle,
  11649. catchPromise,
  11650. promistHandleNew,
  11651. catchPromiseNew,
  11652. sseChunkDataHandle
  11653. };
  11654. const GetAppStatus = async (queryData) => {
  11655. const resp = handle.promistHandle(
  11656. await request.doPost(
  11657. `${BASE_URL}kstserver/status?appId=${queryData.appId}`,
  11658. {},
  11659. {
  11660. construction: true
  11661. }
  11662. )
  11663. );
  11664. return handle.catchPromise(resp, () => resp);
  11665. };
  11666. const SysAppPageList = async (queryData) => {
  11667. const resp = handle.promistHandle(
  11668. await request.doPost(
  11669. `${BASE_URL}wsgw/sysAppPage/api/List/callApiJSON.do`,
  11670. queryData,
  11671. {
  11672. showLoading: false
  11673. }
  11674. )
  11675. );
  11676. return handle.catchPromise(resp, () => resp);
  11677. };
  11678. const QueryMemberCardList_V3 = async (queryData) => {
  11679. const resp = handle.promistHandleNew(
  11680. await request.doPost(
  11681. `${BASE_URL}wsgw/accountMember/api/QueryMemberCardList_V3/callApiJSON.do`,
  11682. queryData
  11683. )
  11684. );
  11685. return handle.catchPromiseNew(resp, () => resp);
  11686. };
  11687. const QueryBaseMemberList_V3 = async (queryData) => {
  11688. const resp = handle.promistHandleNew(
  11689. await request.doPost(
  11690. `${BASE_URL}wsgw/accountMember/api/QueryBaseMemberList_V3/callApiJSON.do`,
  11691. queryData
  11692. )
  11693. );
  11694. return handle.catchPromiseNew(resp, () => resp);
  11695. };
  11696. const BaseFormQuery = async (queryData) => {
  11697. let resp = handle.promistHandle(
  11698. await request.doPost(
  11699. `${BASE_URL}wsgw/base/form/Query/callApiJSON.do`,
  11700. queryData,
  11701. {
  11702. showLoading: false
  11703. }
  11704. )
  11705. );
  11706. return handle.catchPromise(resp, () => resp);
  11707. };
  11708. const SysclientappmenuList = async (queryData) => {
  11709. let resp = handle.promistHandle(
  11710. await request.doPost(
  11711. `${BASE_URL}wsgw/sysclientappmenu/api/List/callApiJSON.do`,
  11712. queryData,
  11713. {
  11714. showLoading: false
  11715. }
  11716. )
  11717. );
  11718. return handle.catchPromise(resp, () => resp);
  11719. };
  11720. const CacheGetValue = async (queryData) => {
  11721. const resp = handle.promistHandle(
  11722. await request.doPost(
  11723. `${BASE_URL}wsgw/sysweb/cache/GetValue/callApiJSON.do`,
  11724. queryData,
  11725. {
  11726. showLoading: false
  11727. }
  11728. )
  11729. );
  11730. return handle.catchPromise(resp, () => resp);
  11731. };
  11732. const useGetSysAppPageList = async () => {
  11733. const app = getApp();
  11734. const resp = await SysAppPageList({
  11735. sysAppCode: app.globalData.appId
  11736. });
  11737. if (resp) {
  11738. const map = turnToMap(resp);
  11739. app.globalData.pageMessageList = map;
  11740. }
  11741. };
  11742. const useSetFrontEndForm = () => {
  11743. return new Promise(async (resolve2) => {
  11744. let queryData = {
  11745. api: "base.form.Query",
  11746. formScene: "",
  11747. orgCode: getApp().globalData.hosId
  11748. };
  11749. let formConfigList = await BaseFormQuery(queryData);
  11750. formConfigList = isEmpty(formConfigList) ? [] : formConfigList;
  11751. if (isEmpty(formConfigList)) {
  11752. showModal(`form表单未配置`);
  11753. }
  11754. index.setStorageSync("formConfigList", formConfigList);
  11755. resolve2(true);
  11756. });
  11757. };
  11758. const useAppStatus = async () => {
  11759. const app = getApp();
  11760. const { status, content } = await GetAppStatus({
  11761. appId: app.globalData.appId
  11762. });
  11763. switch (status) {
  11764. case "maintain":
  11765. index.reLaunch({
  11766. url: `/pages/st1/business/errorPage/maintain/maintain?content=${content}`
  11767. });
  11768. break;
  11769. case "offline":
  11770. index.reLaunch({
  11771. url: "/pages/st1/business/errorPage/offline/offline"
  11772. });
  11773. break;
  11774. }
  11775. };
  11776. const useDomain = (useLocal = false) => {
  11777. let origin = "", pathname = "";
  11778. if (!useLocal) {
  11779. const [domain] = BASE_URL.match(
  11780. /^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/
  11781. );
  11782. origin = domain;
  11783. pathname = BASE_URL;
  11784. } else {
  11785. origin = location.origin;
  11786. pathname = location.pathname;
  11787. }
  11788. const hasSuffix = pathname.match(/\/KasiteWeb\//);
  11789. return `${origin}${hasSuffix ? "/KasiteWeb" : ""}`;
  11790. };
  11791. const useGetUpdateManager = () => {
  11792. return new Promise((resolve2, reject) => {
  11793. index.getUpdateManager().onCheckForUpdate(function(res2) {
  11794. if (res2.hasUpdate) {
  11795. index.getUpdateManager().onUpdateReady(function() {
  11796. index.showModal({
  11797. title: "更新提示",
  11798. content: "新版本已经准备好,单击确定重启应用",
  11799. showCancel: false,
  11800. success: function(res22) {
  11801. if (res22.confirm) {
  11802. index.getUpdateManager().applyUpdate();
  11803. }
  11804. }
  11805. });
  11806. });
  11807. index.getUpdateManager().onUpdateFailed(function() {
  11808. index.showModal({
  11809. title: "提示",
  11810. content: "检查到有新版本,但下载失败,请检查网络设置",
  11811. showCancel: false
  11812. });
  11813. });
  11814. }
  11815. resolve2(res2.hasUpdate);
  11816. });
  11817. });
  11818. };
  11819. const useIsExpiration = async () => {
  11820. var timestamp = Date.parse(/* @__PURE__ */ new Date());
  11821. var data_expiration = index.getStorageSync("data_expiration");
  11822. if (data_expiration) {
  11823. if (timestamp > data_expiration) {
  11824. index.setStorageSync("data_expiration", 0);
  11825. return false;
  11826. } else {
  11827. return true;
  11828. }
  11829. }
  11830. return false;
  11831. };
  11832. const useSmallProgramLogin = async (app) => {
  11833. let res2;
  11834. res2 = await smallProgramLoginByMPWEIXIN(app);
  11835. return res2;
  11836. };
  11837. const smallProgramLoginByMPWEIXIN = async (app) => {
  11838. return new Promise(async (resolve2, reject) => {
  11839. if (await useIsExpiration() && index.getStorageSync("token")) {
  11840. resolve2(true);
  11841. return;
  11842. }
  11843. index.login({
  11844. success(res2) {
  11845. index.request({
  11846. url: BASE_URL + "wsgw/" + app.globalData.channelId + "/" + app.globalData.configKey + "/" + app.globalData.hosId + "/smallProgramLogin_v2.do?cfgKey=" + app.globalData.wechatConfigKey,
  11847. method: "POST",
  11848. data: {
  11849. appId: app.globalData.appId,
  11850. smallPro_authCode: res2.code,
  11851. smallPro_systemInfo: app.globalData.smallPro_systemInfo,
  11852. smallPro_version: app.globalData.smallPro_version
  11853. },
  11854. header: {
  11855. "content-type": "application/x-www-form-urlencoded"
  11856. },
  11857. success(resp) {
  11858. if (resp.data.RespCode == "10000") {
  11859. store.commit("setToken", resp.data.token);
  11860. store.commit("setOpenId", resp.data.openId);
  11861. store.commit("setUnionId", resp.data.unionId);
  11862. store.commit("setSmallProOpenId", resp.data.smallProOpenId);
  11863. store.commit("setWechatOpenId", resp.data.wechatOpenid);
  11864. index.setStorageSync("isCall", 0);
  11865. var timestamp = Date.parse(/* @__PURE__ */ new Date());
  11866. var expiration = timestamp + resp.data.expireTime;
  11867. index.setStorageSync("data_expiration", expiration);
  11868. resolve2(resp);
  11869. } else {
  11870. if (resp.data.RespCode == "-14019" && resp.data.RespMessage && resp.data.RespMessage.indexOf("非白名单用户") >= 0) {
  11871. index.showLoading({
  11872. title: "系统升级中...",
  11873. mask: true
  11874. });
  11875. } else {
  11876. index.showLoading({
  11877. title: resp.data.RespMessage || "网络异常!",
  11878. mask: true
  11879. });
  11880. }
  11881. resolve2(false);
  11882. }
  11883. },
  11884. fail(error) {
  11885. index.showLoading({
  11886. title: "网络异常!",
  11887. mask: true
  11888. });
  11889. reject(error);
  11890. }
  11891. });
  11892. },
  11893. fail(error) {
  11894. index.showLoading({
  11895. title: "网络异常!",
  11896. mask: true
  11897. });
  11898. reject(error);
  11899. }
  11900. });
  11901. });
  11902. };
  11903. const usePreserMember = async () => {
  11904. let queryData = {
  11905. isCache: false,
  11906. isEncrypt: true,
  11907. hosId: getApp().globalData.districtId || getApp().globalData.hosId,
  11908. openid: store.state.openId
  11909. };
  11910. let { resp, resData } = await QueryBaseMemberList_V3(queryData);
  11911. store.commit("setCurrentUser", null);
  11912. if (resData.RespCode == 1e4 && isNotEmpty(resp)) {
  11913. store.commit("setMemberList", resp);
  11914. } else {
  11915. store.commit("setMemberList", null);
  11916. }
  11917. return resp;
  11918. };
  11919. const getMember = async (type = "memberList", cardType = 1) => {
  11920. return new Promise(async (resolve2, reject) => {
  11921. let resp = store.state.memberList || [];
  11922. let memberList = [];
  11923. let currentUser = {};
  11924. if (!resp.length && getApp().globalData.userAccount) {
  11925. await usePreserMember();
  11926. resp = store.state.memberList;
  11927. }
  11928. if (isNotEmpty(resp)) {
  11929. memberList = resp;
  11930. if (type == "defaultInfo") {
  11931. let memberLists = memberList.filter((item2) => item2.userMemberList[0].isDefaultMember == 1);
  11932. if (isNotEmpty(memberLists)) {
  11933. currentUser = memberLists[0];
  11934. } else {
  11935. currentUser = memberList[0];
  11936. }
  11937. if (isNotEmpty(cardType)) {
  11938. let resp2 = await queryMemberCardList_V3(currentUser.memberId);
  11939. if (isNotEmpty(resp2)) {
  11940. currentUser.data_1 = resp2;
  11941. }
  11942. }
  11943. resolve2(currentUser);
  11944. }
  11945. if (type == "defaultList") {
  11946. let memberListIndex = 0;
  11947. let userInfo = memberList[memberListIndex];
  11948. memberList.forEach((item2, index2) => {
  11949. if (item2.userMemberList[0].isDefaultMember == 1) {
  11950. userInfo = item2;
  11951. memberListIndex = index2;
  11952. }
  11953. });
  11954. let resp2 = await queryMemberCardList_V3(userInfo.memberId);
  11955. if (isNotEmpty(resp2)) {
  11956. memberList[memberListIndex].data_1 = resp2;
  11957. }
  11958. resolve2(memberList);
  11959. }
  11960. if (type == "cardList") {
  11961. for (var item of memberList) {
  11962. let resp2 = await queryMemberCardList_V3(item.memberId);
  11963. if (isNotEmpty(resp2)) {
  11964. item.Data_1 = resp2;
  11965. } else {
  11966. item.Data_1 = [];
  11967. }
  11968. }
  11969. }
  11970. resolve2(memberList);
  11971. } else {
  11972. resolve2([]);
  11973. }
  11974. });
  11975. };
  11976. const queryMemberCardList_V3 = async (memberId) => {
  11977. return new Promise(async (resolve2, reject) => {
  11978. let querData = {
  11979. hosId: getApp().globalData.hosId,
  11980. memberId,
  11981. cardNoFormatDesensitization: "false"
  11982. };
  11983. let { resp, resData } = await QueryMemberCardList_V3(querData);
  11984. if (resData.RespCode == 1e4 && isNotEmpty(resp)) {
  11985. resolve2(resp);
  11986. } else {
  11987. resolve2([]);
  11988. }
  11989. });
  11990. };
  11991. const currentUsersFilter = async (currentUsers, cardType) => {
  11992. return new Promise(async (resolve2, reject) => {
  11993. let currentUser = {};
  11994. let cardUser = {};
  11995. if (currentUsers.data_1) {
  11996. let cardDataList = [];
  11997. for (var item of currentUsers.data_1) {
  11998. if (item.cardType == cardType) {
  11999. cardDataList.push(item);
  12000. }
  12001. if (item.isDefault == 1 && item.cardType == cardType) {
  12002. cardUser = item;
  12003. }
  12004. }
  12005. if (isEmpty(cardUser)) {
  12006. cardUser = cardDataList[0];
  12007. }
  12008. if (isNotEmpty(cardUser)) {
  12009. currentUser = mergeObject(currentUsers, cardUser);
  12010. } else {
  12011. if (isEmpty(cardType)) {
  12012. currentUser = currentUsers;
  12013. }
  12014. }
  12015. } else if (isNotEmpty(currentUsers)) {
  12016. currentUser = currentUsers;
  12017. }
  12018. resolve2(currentUser);
  12019. });
  12020. };
  12021. const useGetDefaultMember = async (data = {}) => {
  12022. getApp().globalData.cardType = null;
  12023. let member = {};
  12024. let defaultInfo = await getMember("defaultInfo", data.cardType);
  12025. if (!isEmpty(defaultInfo)) {
  12026. member = await currentUsersFilter(defaultInfo, data.cardType);
  12027. if (isEmpty(member) || isNotEmpty(data.cardType) && isEmpty(member.cardNo)) {
  12028. if (isNotEmpty(data.url)) {
  12029. getApp().globalData.toUrl = data.url;
  12030. }
  12031. let type = data.cardType == 1 ? "card" : data.cardType == 14 ? "hospital" : "member";
  12032. let skipWay = data.isKeepPage ? "navigateTo" : "redirectTo";
  12033. goToUrl(
  12034. `/pagesPersonal${index.getStorageSync("wx_Slb") ? "Slb" : ""}/st1/business/patientManagement/selecteCardOrHos/selecteCardOrHos?type=${type}`,
  12035. {
  12036. skipWay
  12037. }
  12038. );
  12039. return null;
  12040. }
  12041. }
  12042. store.commit("setCurrentUse", member);
  12043. return member;
  12044. };
  12045. const useSetMenuList = async (menu) => {
  12046. return new Promise(async (resolve2) => {
  12047. let menuList = menu;
  12048. const app = getApp();
  12049. if (app.globalData.accountInfo.miniProgram.envVersion == "release") {
  12050. let getSysConfigData = {
  12051. orgCode: app.globalData.hosId,
  12052. appId: app.globalData.appId
  12053. };
  12054. let menuresp = await SysclientappmenuList(getSysConfigData);
  12055. if (!isEmpty(menuresp)) {
  12056. menuList = JSON.parse(menuresp[0].menuJson);
  12057. }
  12058. }
  12059. index.setStorageSync("menuList", menuList);
  12060. resolve2(menuList);
  12061. });
  12062. };
  12063. const useLoadViewMenu = async () => {
  12064. const resp = await CacheGetValue({
  12065. key: "smallproViewMenu"
  12066. });
  12067. if (resp && resp.length) {
  12068. const menu = JSON.parse(resp[0].Value || "[]");
  12069. menu.length && wx$1.setStorageSync("menuList", menu);
  12070. }
  12071. };
  12072. const useIsToAuthPage = () => {
  12073. if (index.getStorageSync("wechatOpenid") === null && getApp().globalData.officialAuthOn) {
  12074. goToUrl(`/pages/st1/business/h5/h5?type=0`, {
  12075. skipWay: "redirectTo"
  12076. });
  12077. return true;
  12078. }
  12079. return false;
  12080. };
  12081. const createLifeCycleHook = (lifecycle, flag = 0) => (hook, target = getCurrentInstance()) => {
  12082. !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
  12083. };
  12084. const onLoad = /* @__PURE__ */ createLifeCycleHook(
  12085. ON_LOAD,
  12086. 2
  12087. /* HookFlags.PAGE */
  12088. );
  12089. const onShareTimeline = /* @__PURE__ */ createLifeCycleHook(
  12090. ON_SHARE_TIMELINE,
  12091. 2
  12092. /* HookFlags.PAGE */
  12093. );
  12094. const onShareAppMessage = /* @__PURE__ */ createLifeCycleHook(
  12095. ON_SHARE_APP_MESSAGE,
  12096. 2
  12097. /* HookFlags.PAGE */
  12098. );
  12099. exports.BASE_URL = BASE_URL;
  12100. exports._export_sfc = _export_sfc;
  12101. exports.createSSRApp = createSSRApp;
  12102. exports.createStore = createStore;
  12103. exports.dateFormat = dateFormat;
  12104. exports.defineComponent = defineComponent;
  12105. exports.e = e;
  12106. exports.f = f;
  12107. exports.getDistance = getDistance;
  12108. exports.global = global$1;
  12109. exports.goToUrl = goToUrl;
  12110. exports.handle = handle;
  12111. exports.hideLoading = hideLoading;
  12112. exports.index = index;
  12113. exports.initVueI18n = initVueI18n;
  12114. exports.isEmpty = isEmpty;
  12115. exports.isJSON = isJSON;
  12116. exports.isNotEmpty = isNotEmpty;
  12117. exports.mapGetters = mapGetters;
  12118. exports.mapMutations = mapMutations;
  12119. exports.mapState = mapState;
  12120. exports.n = n;
  12121. exports.navigateBack = navigateBack;
  12122. exports.nextTick$1 = nextTick$1;
  12123. exports.o = o;
  12124. exports.onLoad = onLoad;
  12125. exports.onShareAppMessage = onShareAppMessage;
  12126. exports.onShareTimeline = onShareTimeline;
  12127. exports.p = p;
  12128. exports.reactive = reactive;
  12129. exports.ref = ref;
  12130. exports.request = request;
  12131. exports.resolveComponent = resolveComponent;
  12132. exports.s = s;
  12133. exports.showLoading = showLoading;
  12134. exports.showModal = showModal;
  12135. exports.showToast = showToast;
  12136. exports.sleep = sleep$1;
  12137. exports.t = t;
  12138. exports.unref = unref;
  12139. exports.useAppStatus = useAppStatus;
  12140. exports.useDomain = useDomain;
  12141. exports.useFrontEndConfigVersion = useFrontEndConfigVersion;
  12142. exports.useGetDefaultMember = useGetDefaultMember;
  12143. exports.useGetSysAppPageList = useGetSysAppPageList;
  12144. exports.useGetUpdateManager = useGetUpdateManager;
  12145. exports.useIsToAuthPage = useIsToAuthPage;
  12146. exports.useLoadViewMenu = useLoadViewMenu;
  12147. exports.usePreserMember = usePreserMember;
  12148. exports.useSetFrontEndConfig = useSetFrontEndConfig;
  12149. exports.useSetFrontEndForm = useSetFrontEndForm;
  12150. exports.useSetMenuList = useSetMenuList;
  12151. exports.useSmallProgramLogin = useSmallProgramLogin;
  12152. exports.useStore = useStore;
  12153. exports.watch = watch;
  12154. exports.wx$1 = wx$1;
  12155. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map