vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js.js 177 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341
  1. "use strict";
  2. (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"],{
  3. /***/ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js":
  4. /*!**************************************************************!*\
  5. !*** ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js ***!
  6. \**************************************************************/
  7. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  8. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9. /* harmony export */ A: function() { return /* binding */ A; },
  10. /* harmony export */ APP: function() { return /* binding */ APP; },
  11. /* harmony export */ BEHAVIORS: function() { return /* binding */ BEHAVIORS; },
  12. /* harmony export */ BODY: function() { return /* binding */ BODY; },
  13. /* harmony export */ CATCHMOVE: function() { return /* binding */ CATCHMOVE; },
  14. /* harmony export */ CATCH_VIEW: function() { return /* binding */ CATCH_VIEW; },
  15. /* harmony export */ CHANGE: function() { return /* binding */ CHANGE; },
  16. /* harmony export */ CLASS: function() { return /* binding */ CLASS; },
  17. /* harmony export */ COMMENT: function() { return /* binding */ COMMENT; },
  18. /* harmony export */ CONFIRM: function() { return /* binding */ CONFIRM; },
  19. /* harmony export */ CONTAINER: function() { return /* binding */ CONTAINER; },
  20. /* harmony export */ CONTEXT_ACTIONS: function() { return /* binding */ CONTEXT_ACTIONS; },
  21. /* harmony export */ CURRENT_TARGET: function() { return /* binding */ CURRENT_TARGET; },
  22. /* harmony export */ CUSTOM_WRAPPER: function() { return /* binding */ CUSTOM_WRAPPER; },
  23. /* harmony export */ Current: function() { return /* binding */ Current; },
  24. /* harmony export */ DATASET: function() { return /* binding */ DATASET; },
  25. /* harmony export */ DATE: function() { return /* binding */ DATE; },
  26. /* harmony export */ DOCUMENT_ELEMENT_NAME: function() { return /* binding */ DOCUMENT_ELEMENT_NAME; },
  27. /* harmony export */ DOCUMENT_FRAGMENT: function() { return /* binding */ DOCUMENT_FRAGMENT; },
  28. /* harmony export */ EVENT_CALLBACK_RESULT: function() { return /* binding */ EVENT_CALLBACK_RESULT; },
  29. /* harmony export */ EXTERNAL_CLASSES: function() { return /* binding */ EXTERNAL_CLASSES; },
  30. /* harmony export */ FOCUS: function() { return /* binding */ FOCUS; },
  31. /* harmony export */ FormElement: function() { return /* binding */ FormElement; },
  32. /* harmony export */ HEAD: function() { return /* binding */ HEAD; },
  33. /* harmony export */ HOOKS_APP_ID: function() { return /* binding */ HOOKS_APP_ID; },
  34. /* harmony export */ HTML: function() { return /* binding */ HTML; },
  35. /* harmony export */ History: function() { return /* binding */ History; },
  36. /* harmony export */ ID: function() { return /* binding */ ID; },
  37. /* harmony export */ INPUT: function() { return /* binding */ INPUT; },
  38. /* harmony export */ KEY_CODE: function() { return /* binding */ KEY_CODE; },
  39. /* harmony export */ Location: function() { return /* binding */ Location; },
  40. /* harmony export */ MutationObserver: function() { return /* binding */ MutationObserver; },
  41. /* harmony export */ OBJECT: function() { return /* binding */ OBJECT; },
  42. /* harmony export */ ON_HIDE: function() { return /* binding */ ON_HIDE; },
  43. /* harmony export */ ON_LOAD: function() { return /* binding */ ON_LOAD; },
  44. /* harmony export */ ON_READY: function() { return /* binding */ ON_READY; },
  45. /* harmony export */ ON_SHOW: function() { return /* binding */ ON_SHOW; },
  46. /* harmony export */ OPTIONS: function() { return /* binding */ OPTIONS; },
  47. /* harmony export */ PAGE_INIT: function() { return /* binding */ PAGE_INIT; },
  48. /* harmony export */ PROPERTY_THRESHOLD: function() { return /* binding */ PROPERTY_THRESHOLD; },
  49. /* harmony export */ PROPS: function() { return /* binding */ PROPS; },
  50. /* harmony export */ PURE_VIEW: function() { return /* binding */ PURE_VIEW; },
  51. /* harmony export */ ROOT_STR: function() { return /* binding */ ROOT_STR; },
  52. /* harmony export */ SET_DATA: function() { return /* binding */ SET_DATA; },
  53. /* harmony export */ SET_TIMEOUT: function() { return /* binding */ SET_TIMEOUT; },
  54. /* harmony export */ STATIC_VIEW: function() { return /* binding */ STATIC_VIEW; },
  55. /* harmony export */ STYLE: function() { return /* binding */ STYLE; },
  56. /* harmony export */ SVGElement: function() { return /* binding */ SVGElement; },
  57. /* harmony export */ Style: function() { return /* binding */ Style; },
  58. /* harmony export */ TARGET: function() { return /* binding */ TARGET; },
  59. /* harmony export */ TARO_RUNTIME: function() { return /* binding */ TARO_RUNTIME; },
  60. /* harmony export */ TIME_STAMP: function() { return /* binding */ TIME_STAMP; },
  61. /* harmony export */ TOUCHMOVE: function() { return /* binding */ TOUCHMOVE; },
  62. /* harmony export */ TYPE: function() { return /* binding */ TYPE; },
  63. /* harmony export */ TaroElement: function() { return /* binding */ TaroElement; },
  64. /* harmony export */ TaroEvent: function() { return /* binding */ TaroEvent; },
  65. /* harmony export */ TaroNode: function() { return /* binding */ TaroNode; },
  66. /* harmony export */ TaroRootElement: function() { return /* binding */ TaroRootElement; },
  67. /* harmony export */ TaroText: function() { return /* binding */ TaroText; },
  68. /* harmony export */ UID: function() { return /* binding */ UID; },
  69. /* harmony export */ URL: function() { return /* binding */ URL; },
  70. /* harmony export */ URLSearchParams: function() { return /* binding */ URLSearchParams; },
  71. /* harmony export */ VALUE: function() { return /* binding */ VALUE; },
  72. /* harmony export */ VIEW: function() { return /* binding */ VIEW; },
  73. /* harmony export */ _caf: function() { return /* binding */ _caf; },
  74. /* harmony export */ _raf: function() { return /* binding */ _raf; },
  75. /* harmony export */ addLeadingSlash: function() { return /* binding */ addLeadingSlash; },
  76. /* harmony export */ createComponentConfig: function() { return /* binding */ createComponentConfig; },
  77. /* harmony export */ createEvent: function() { return /* binding */ createEvent; },
  78. /* harmony export */ createPageConfig: function() { return /* binding */ createPageConfig; },
  79. /* harmony export */ createRecursiveComponentConfig: function() { return /* binding */ createRecursiveComponentConfig; },
  80. /* harmony export */ document$1: function() { return /* binding */ document$1; },
  81. /* harmony export */ env: function() { return /* binding */ env; },
  82. /* harmony export */ eventCenter: function() { return /* binding */ eventCenter; },
  83. /* harmony export */ eventHandler: function() { return /* binding */ eventHandler; },
  84. /* harmony export */ eventSource: function() { return /* binding */ eventSource; },
  85. /* harmony export */ getComputedStyle: function() { return /* binding */ getComputedStyle; },
  86. /* harmony export */ getCurrentInstance: function() { return /* binding */ getCurrentInstance; },
  87. /* harmony export */ getOnHideEventKey: function() { return /* binding */ getOnHideEventKey; },
  88. /* harmony export */ getOnReadyEventKey: function() { return /* binding */ getOnReadyEventKey; },
  89. /* harmony export */ getOnShowEventKey: function() { return /* binding */ getOnShowEventKey; },
  90. /* harmony export */ getPageInstance: function() { return /* binding */ getPageInstance; },
  91. /* harmony export */ getPath: function() { return /* binding */ getPath; },
  92. /* harmony export */ history: function() { return /* binding */ history; },
  93. /* harmony export */ hydrate: function() { return /* binding */ hydrate; },
  94. /* harmony export */ incrementId: function() { return /* binding */ incrementId; },
  95. /* harmony export */ init_runtime_esm: function() { return /* binding */ init_runtime_esm; },
  96. /* harmony export */ injectPageInstance: function() { return /* binding */ injectPageInstance; },
  97. /* harmony export */ location: function() { return /* binding */ location; },
  98. /* harmony export */ nav: function() { return /* binding */ nav; },
  99. /* harmony export */ nextTick: function() { return /* binding */ nextTick; },
  100. /* harmony export */ now: function() { return /* binding */ now; },
  101. /* harmony export */ options: function() { return /* binding */ options; },
  102. /* harmony export */ parseUrl: function() { return /* binding */ parseUrl; },
  103. /* harmony export */ removePageInstance: function() { return /* binding */ removePageInstance; },
  104. /* harmony export */ runtime_esm_exports: function() { return /* binding */ runtime_esm_exports; },
  105. /* harmony export */ safeExecute: function() { return /* binding */ safeExecute; },
  106. /* harmony export */ stringify: function() { return /* binding */ stringify; },
  107. /* harmony export */ window$1: function() { return /* binding */ window$1; }
  108. /* harmony export */ });
  109. /* harmony import */ var _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-77KB62LY.js */ "./node_modules/.taro/weapp/prebundle/chunk-77KB62LY.js");
  110. /* harmony import */ var _chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-P7VEE7PG.js */ "./node_modules/.taro/weapp/prebundle/chunk-P7VEE7PG.js");
  111. /* provided dependency */ var window = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["window$1"];
  112. /* provided dependency */ var document = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["document$1"];
  113. /* provided dependency */ var requestAnimationFrame = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["_raf"];
  114. /* provided dependency */ var cancelAnimationFrame = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["_caf"];
  115. // node_modules/@tarojs/runtime/dist/runtime.esm.js
  116. var runtime_esm_exports = {};
  117. (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__.__export)(runtime_esm_exports, {
  118. A: ()=>A,
  119. APP: ()=>APP,
  120. BEHAVIORS: ()=>BEHAVIORS,
  121. BODY: ()=>BODY,
  122. CATCHMOVE: ()=>CATCHMOVE,
  123. CATCH_VIEW: ()=>CATCH_VIEW,
  124. CHANGE: ()=>CHANGE,
  125. CLASS: ()=>CLASS,
  126. COMMENT: ()=>COMMENT,
  127. CONFIRM: ()=>CONFIRM,
  128. CONTAINER: ()=>CONTAINER,
  129. CONTEXT_ACTIONS: ()=>CONTEXT_ACTIONS,
  130. CURRENT_TARGET: ()=>CURRENT_TARGET,
  131. CUSTOM_WRAPPER: ()=>CUSTOM_WRAPPER,
  132. Current: ()=>Current,
  133. DATASET: ()=>DATASET,
  134. DATE: ()=>DATE,
  135. DOCUMENT_ELEMENT_NAME: ()=>DOCUMENT_ELEMENT_NAME,
  136. DOCUMENT_FRAGMENT: ()=>DOCUMENT_FRAGMENT,
  137. EVENT_CALLBACK_RESULT: ()=>EVENT_CALLBACK_RESULT,
  138. EXTERNAL_CLASSES: ()=>EXTERNAL_CLASSES,
  139. Events: ()=>_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events,
  140. FOCUS: ()=>FOCUS,
  141. FormElement: ()=>FormElement,
  142. HEAD: ()=>HEAD,
  143. HOOKS_APP_ID: ()=>HOOKS_APP_ID,
  144. HTML: ()=>HTML,
  145. History: ()=>History,
  146. ID: ()=>ID,
  147. INPUT: ()=>INPUT,
  148. KEY_CODE: ()=>KEY_CODE,
  149. Location: ()=>Location,
  150. MutationObserver: ()=>MutationObserver,
  151. OBJECT: ()=>OBJECT,
  152. ON_HIDE: ()=>ON_HIDE,
  153. ON_LOAD: ()=>ON_LOAD,
  154. ON_READY: ()=>ON_READY,
  155. ON_SHOW: ()=>ON_SHOW,
  156. OPTIONS: ()=>OPTIONS,
  157. PAGE_INIT: ()=>PAGE_INIT,
  158. PROPERTY_THRESHOLD: ()=>PROPERTY_THRESHOLD,
  159. PROPS: ()=>PROPS,
  160. PURE_VIEW: ()=>PURE_VIEW,
  161. ROOT_STR: ()=>ROOT_STR,
  162. SET_DATA: ()=>SET_DATA,
  163. SET_TIMEOUT: ()=>SET_TIMEOUT,
  164. STATIC_VIEW: ()=>STATIC_VIEW,
  165. STYLE: ()=>STYLE,
  166. SVGElement: ()=>SVGElement,
  167. Style: ()=>Style,
  168. TARGET: ()=>TARGET,
  169. TARO_RUNTIME: ()=>TARO_RUNTIME,
  170. TIME_STAMP: ()=>TIME_STAMP,
  171. TOUCHMOVE: ()=>TOUCHMOVE,
  172. TYPE: ()=>TYPE,
  173. TaroElement: ()=>TaroElement,
  174. TaroEvent: ()=>TaroEvent,
  175. TaroNode: ()=>TaroNode,
  176. TaroRootElement: ()=>TaroRootElement,
  177. TaroText: ()=>TaroText,
  178. UID: ()=>UID,
  179. URL: ()=>URL,
  180. URLSearchParams: ()=>URLSearchParams,
  181. VALUE: ()=>VALUE,
  182. VIEW: ()=>VIEW,
  183. addLeadingSlash: ()=>addLeadingSlash,
  184. cancelAnimationFrame: ()=>_caf,
  185. createComponentConfig: ()=>createComponentConfig,
  186. createEvent: ()=>createEvent,
  187. createPageConfig: ()=>createPageConfig,
  188. createRecursiveComponentConfig: ()=>createRecursiveComponentConfig,
  189. document: ()=>document$1,
  190. env: ()=>env,
  191. eventCenter: ()=>eventCenter,
  192. eventHandler: ()=>eventHandler,
  193. eventSource: ()=>eventSource,
  194. getComputedStyle: ()=>getComputedStyle,
  195. getCurrentInstance: ()=>getCurrentInstance,
  196. getOnHideEventKey: ()=>getOnHideEventKey,
  197. getOnReadyEventKey: ()=>getOnReadyEventKey,
  198. getOnShowEventKey: ()=>getOnShowEventKey,
  199. getPageInstance: ()=>getPageInstance,
  200. getPath: ()=>getPath,
  201. history: ()=>history,
  202. hooks: ()=>_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks,
  203. hydrate: ()=>hydrate,
  204. incrementId: ()=>incrementId,
  205. injectPageInstance: ()=>injectPageInstance,
  206. location: ()=>location,
  207. navigator: ()=>nav,
  208. nextTick: ()=>nextTick,
  209. now: ()=>now,
  210. options: ()=>options,
  211. parseUrl: ()=>parseUrl,
  212. removePageInstance: ()=>removePageInstance,
  213. requestAnimationFrame: ()=>_raf,
  214. safeExecute: ()=>safeExecute,
  215. stringify: ()=>stringify,
  216. window: ()=>window$1
  217. });
  218. function logMutation(observer, record) {
  219. observer.records.push(record);
  220. if (!pendingMuatations) {
  221. pendingMuatations = true;
  222. Promise.resolve().then(()=>{
  223. pendingMuatations = false;
  224. observers.forEach((observer2)=>{
  225. return observer2.callback(observer2.takeRecords());
  226. });
  227. });
  228. }
  229. }
  230. function recordMutation(record) {
  231. observers.forEach((observer)=>{
  232. const { options: options2 } = observer;
  233. for(let t = record.target; t; t = t.parentNode){
  234. if (sidMatches(observer.target, t) && isConcerned(record, options2)) {
  235. logMutation(observer, record);
  236. break;
  237. }
  238. if (!options2.subtree) break;
  239. }
  240. });
  241. }
  242. function isElement(node) {
  243. return node.nodeType === 1;
  244. }
  245. function isText(node) {
  246. return node.nodeType === 3;
  247. }
  248. function isComment(node) {
  249. return node.nodeName === COMMENT;
  250. }
  251. function isHasExtractProp(el) {
  252. const res = Object.keys(el.props).find((prop)=>{
  253. return !(/^(class|style|id)$/.test(prop) || prop.startsWith("data-"));
  254. });
  255. return Boolean(res);
  256. }
  257. function isParentBinded(node, type) {
  258. var _a;
  259. let res = false;
  260. while((node === null || node === void 0 ? void 0 : node.parentElement) && node.parentElement._path !== ROOT_STR){
  261. if ((_a = node.parentElement.__handlers[type]) === null || _a === void 0 ? void 0 : _a.length) {
  262. res = true;
  263. break;
  264. }
  265. node = node.parentElement;
  266. }
  267. return res;
  268. }
  269. function shortcutAttr(key) {
  270. switch(key){
  271. case STYLE:
  272. return "st";
  273. case ID:
  274. return UID;
  275. case CLASS:
  276. return "cl";
  277. default:
  278. return key;
  279. }
  280. }
  281. function extend(ctor, methodName, options2) {
  282. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options2)) {
  283. options2 = {
  284. value: options2
  285. };
  286. }
  287. Object.defineProperty(ctor.prototype, methodName, Object.assign({
  288. configurable: true,
  289. enumerable: true
  290. }, options2));
  291. }
  292. function getComponentsAlias2() {
  293. if (!componentsAlias$1) {
  294. componentsAlias$1 = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.getComponentsAlias)(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents);
  295. }
  296. return componentsAlias$1;
  297. }
  298. function hydrate(node) {
  299. var _a;
  300. if (!componentsAlias) {
  301. componentsAlias = getComponentsAlias2();
  302. }
  303. if (!SPECIAL_NODES) {
  304. SPECIAL_NODES = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
  305. }
  306. const nodeName = node.nodeName;
  307. if (isText(node)) {
  308. return {
  309. ["v"]: node.nodeValue,
  310. ["nn"]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || "8"
  311. };
  312. }
  313. const data = {
  314. ["nn"]: nodeName,
  315. sid: node.sid
  316. };
  317. if (node.uid !== node.sid) {
  318. data.uid = node.uid;
  319. }
  320. if (!node.isAnyEventBinded() && SPECIAL_NODES.indexOf(nodeName) > -1) {
  321. data["nn"] = `static-${nodeName}`;
  322. if (nodeName === VIEW && !isHasExtractProp(node)) {
  323. data["nn"] = PURE_VIEW;
  324. }
  325. }
  326. const { props } = node;
  327. for(const prop in props){
  328. const propInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(prop);
  329. if (!prop.startsWith("data-") && prop !== CLASS && prop !== STYLE && prop !== ID && propInCamelCase !== CATCHMOVE) {
  330. data[propInCamelCase] = props[prop];
  331. }
  332. if (nodeName === VIEW && propInCamelCase === CATCHMOVE && props[prop] !== false) {
  333. data["nn"] = CATCH_VIEW;
  334. }
  335. }
  336. let { childNodes } = node;
  337. childNodes = childNodes.filter((node2)=>!isComment(node2));
  338. if (childNodes.length > 0) {
  339. data["cn"] = childNodes.map(hydrate);
  340. } else {
  341. data["cn"] = [];
  342. }
  343. if (node.className !== "") {
  344. data["cl"] = node.className;
  345. }
  346. const cssText = node.cssText;
  347. if (cssText !== "" && nodeName !== "swiper-item") {
  348. data["st"] = cssText;
  349. }
  350. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyHydrateData", data);
  351. const nn = data["nn"];
  352. const componentAlias = componentsAlias[nn];
  353. if (componentAlias) {
  354. data["nn"] = componentAlias._num;
  355. for(const prop1 in data){
  356. if (prop1 in componentAlias) {
  357. data[componentAlias[prop1]] = data[prop1];
  358. delete data[prop1];
  359. }
  360. }
  361. }
  362. return data;
  363. }
  364. function combine(prefix, list, excludeSelf) {
  365. !excludeSelf && styleProperties.push(prefix);
  366. list.forEach((item)=>{
  367. styleProperties.push(prefix + item);
  368. if (prefix === WEBKIT) {
  369. styleProperties.push("Webkit" + item);
  370. }
  371. });
  372. }
  373. function recordCss(obj) {
  374. MutationObserver.record({
  375. type: "attributes",
  376. target: obj._element,
  377. attributeName: "style",
  378. oldValue: obj.cssText
  379. });
  380. }
  381. function enqueueUpdate(obj) {
  382. const element = obj._element;
  383. if (element._root) {
  384. element.enqueueUpdate({
  385. path: `${element._path}.${"st"}`,
  386. value: obj.cssText
  387. });
  388. }
  389. }
  390. function setStyle(newVal, styleKey) {
  391. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(newVal) && newVal.length > PROPERTY_THRESHOLD, `Style \u5C5E\u6027 ${styleKey} \u7684\u503C\u6570\u636E\u91CF\u8FC7\u5927\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u6E32\u67D3\u6027\u80FD\uFF0C\u8003\u8651\u4F7F\u7528 CSS \u7C7B\u6216\u5176\u5B83\u65B9\u6848\u66FF\u4EE3\u3002`);
  392. const old = this[styleKey];
  393. if (old === newVal) return;
  394. !this._pending && recordCss(this);
  395. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(newVal) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(newVal)) {
  396. this._usedStyleProp.delete(styleKey);
  397. delete this._value[styleKey];
  398. } else {
  399. this._usedStyleProp.add(styleKey);
  400. this._value[styleKey] = newVal;
  401. }
  402. !this._pending && enqueueUpdate(this);
  403. }
  404. function initStyle(ctor, styleProperties2) {
  405. const properties = {};
  406. for(let i = 0; i < styleProperties2.length; i++){
  407. const styleKey = styleProperties2[i];
  408. if (ctor[styleKey]) return;
  409. properties[styleKey] = {
  410. get () {
  411. const val = this._value[styleKey];
  412. return (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(val) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val) ? "" : val;
  413. },
  414. set (newVal) {
  415. setStyle.call(this, newVal, styleKey);
  416. }
  417. };
  418. }
  419. Object.defineProperties(ctor.prototype, properties);
  420. }
  421. function isCssVariable(propertyName) {
  422. return /^--/.test(propertyName);
  423. }
  424. function returnTrue() {
  425. return true;
  426. }
  427. function treeToArray(root, predict) {
  428. const array = [];
  429. const filter = predict !== null && predict !== void 0 ? predict : returnTrue;
  430. let object = root;
  431. while(object){
  432. if (object.nodeType === 1 && filter(object)) {
  433. array.push(object);
  434. }
  435. object = following(object, root);
  436. }
  437. return array;
  438. }
  439. function following(el, root) {
  440. const firstChild = el.firstChild;
  441. const isElmentTypeValid = el.nodeType === 1 || el.nodeType === 9;
  442. if (firstChild && isElmentTypeValid) {
  443. return firstChild;
  444. }
  445. let current = el;
  446. do {
  447. if (current === root) {
  448. return null;
  449. }
  450. const nextSibling = current.nextSibling;
  451. if (nextSibling) {
  452. return nextSibling;
  453. }
  454. current = current.parentElement;
  455. }while (current)
  456. return null;
  457. }
  458. function initPosition() {
  459. return {
  460. index: 0,
  461. column: 0,
  462. line: 0
  463. };
  464. }
  465. function feedPosition(position, str, len) {
  466. const start = position.index;
  467. const end = position.index = start + len;
  468. for(let i = start; i < end; i++){
  469. const char = str.charAt(i);
  470. if (char === "\n") {
  471. position.line++;
  472. position.column = 0;
  473. } else {
  474. position.column++;
  475. }
  476. }
  477. }
  478. function jumpPosition(position, str, end) {
  479. const len = end - position.index;
  480. return feedPosition(position, str, len);
  481. }
  482. function copyPosition(position) {
  483. return {
  484. index: position.index,
  485. line: position.line,
  486. column: position.column
  487. };
  488. }
  489. function isWhitespaceChar(char) {
  490. return whitespace.test(char);
  491. }
  492. function isEqualSignChar(char) {
  493. return equalSign.test(char);
  494. }
  495. function shouldBeIgnore(tagName) {
  496. const name = tagName.toLowerCase();
  497. if (options.html.skipElements.has(name)) {
  498. return true;
  499. }
  500. return false;
  501. }
  502. function findTextEnd(str, index) {
  503. while(true){
  504. const textEnd = str.indexOf("<", index);
  505. if (textEnd === -1) {
  506. return textEnd;
  507. }
  508. const char = str.charAt(textEnd + 1);
  509. if (char === "/" || char === "!" || alphanumeric.test(char)) {
  510. return textEnd;
  511. }
  512. index = textEnd + 1;
  513. }
  514. }
  515. function isWordEnd(cursor, wordBegin, html) {
  516. if (!isWhitespaceChar(html.charAt(cursor))) return false;
  517. const len = html.length;
  518. for(let i = cursor - 1; i > wordBegin; i--){
  519. const char = html.charAt(i);
  520. if (!isWhitespaceChar(char)) {
  521. if (isEqualSignChar(char)) return false;
  522. break;
  523. }
  524. }
  525. for(let i1 = cursor + 1; i1 < len; i1++){
  526. const char1 = html.charAt(i1);
  527. if (!isWhitespaceChar(char1)) {
  528. if (isEqualSignChar(char1)) return false;
  529. return true;
  530. }
  531. }
  532. }
  533. function unquote(str) {
  534. const car = str.charAt(0);
  535. const end = str.length - 1;
  536. const isQuoteStart = car === '"' || car === "'";
  537. if (isQuoteStart && car === str.charAt(end)) {
  538. return str.slice(1, end);
  539. }
  540. return str;
  541. }
  542. function getPreviousElement(el) {
  543. const parent = el.parentElement;
  544. if (!parent) return null;
  545. const prev = el.previousSibling;
  546. if (!prev) return null;
  547. if (prev.nodeType === 1) {
  548. return prev;
  549. } else {
  550. return getPreviousElement(prev);
  551. }
  552. }
  553. function sortStyles(styles) {
  554. return styles.sort((s1, s2)=>{
  555. const hundreds1 = getHundredsWeight(s1.selectorList);
  556. const hundreds2 = getHundredsWeight(s2.selectorList);
  557. if (hundreds1 !== hundreds2) return hundreds1 - hundreds2;
  558. const tens1 = getTensWeight(s1.selectorList);
  559. const tens2 = getTensWeight(s2.selectorList);
  560. if (tens1 !== tens2) return tens1 - tens2;
  561. const ones1 = getOnesWeight(s1.selectorList);
  562. const ones2 = getOnesWeight(s2.selectorList);
  563. return ones1 - ones2;
  564. });
  565. }
  566. function getHundredsWeight(selectors) {
  567. return selectors.reduce((pre, cur)=>pre + (cur.id ? 1 : 0), 0);
  568. }
  569. function getTensWeight(selectors) {
  570. return selectors.reduce((pre, cur)=>pre + cur.class.length + cur.attrs.length, 0);
  571. }
  572. function getOnesWeight(selectors) {
  573. return selectors.reduce((pre, cur)=>pre + (cur.tag ? 1 : 0), 0);
  574. }
  575. function makeMap(str, expectsLowerCase) {
  576. const map = /* @__PURE__ */ Object.create(null);
  577. const list = str.split(",");
  578. for(let i = 0; i < list.length; i++){
  579. map[list[i]] = true;
  580. }
  581. return expectsLowerCase ? (val)=>!!map[val.toLowerCase()] : (val)=>!!map[val];
  582. }
  583. function hasTerminalParent(tagName, stack) {
  584. const tagParents = closingTagAncestorBreakers[tagName];
  585. if (tagParents) {
  586. let currentIndex = stack.length - 1;
  587. while(currentIndex >= 0){
  588. const parentTagName = stack[currentIndex].tagName;
  589. if (parentTagName === tagName) {
  590. break;
  591. }
  592. if (tagParents && tagParents.includes(parentTagName)) {
  593. return true;
  594. }
  595. currentIndex--;
  596. }
  597. }
  598. return false;
  599. }
  600. function getTagName(tag) {
  601. if (options.html.renderHTMLTag) {
  602. return tag;
  603. }
  604. if (specialMiniElements[tag]) {
  605. return specialMiniElements[tag];
  606. } else if (isMiniElements(tag)) {
  607. return tag;
  608. } else if (isBlockElements(tag)) {
  609. return "view";
  610. } else if (isInlineElements(tag)) {
  611. return "text";
  612. }
  613. return "view";
  614. }
  615. function splitEqual(str) {
  616. const sep = "=";
  617. const idx = str.indexOf(sep);
  618. if (idx === -1) return [
  619. str
  620. ];
  621. const key = str.slice(0, idx).trim();
  622. const value = str.slice(idx + sep.length).trim();
  623. return [
  624. key,
  625. value
  626. ];
  627. }
  628. function format(children, document2, styleOptions, parent) {
  629. return children.filter((child)=>{
  630. if (child.type === "comment") {
  631. return false;
  632. } else if (child.type === "text") {
  633. return child.content !== "";
  634. }
  635. return true;
  636. }).map((child)=>{
  637. if (child.type === "text") {
  638. let text = document2.createTextNode(child.content);
  639. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options.html.transformText)) {
  640. text = options.html.transformText(text, child);
  641. }
  642. parent === null || parent === void 0 ? void 0 : parent.appendChild(text);
  643. return text;
  644. }
  645. const el = document2.createElement(getTagName(child.tagName));
  646. el.h5tagName = child.tagName;
  647. parent === null || parent === void 0 ? void 0 : parent.appendChild(el);
  648. if (!options.html.renderHTMLTag) {
  649. el.className = `h5-${child.tagName}`;
  650. }
  651. for(let i = 0; i < child.attributes.length; i++){
  652. const attr = child.attributes[i];
  653. const [key, value] = splitEqual(attr);
  654. if (key === "class") {
  655. el.className += " " + unquote(value);
  656. } else if (key[0] === "o" && key[1] === "n") {
  657. continue;
  658. } else {
  659. el.setAttribute(key, value == null ? true : unquote(value));
  660. }
  661. }
  662. const { styleTagParser , descendantList } = styleOptions;
  663. const list = descendantList.slice();
  664. const style2 = styleTagParser.matchStyle(child.tagName, el, list);
  665. el.setAttribute("style", style2 + el.style.cssText);
  666. format(child.children, document2, {
  667. styleTagParser,
  668. descendantList: list
  669. }, el);
  670. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options.html.transformElement)) {
  671. return options.html.transformElement(el, child);
  672. }
  673. return el;
  674. });
  675. }
  676. function parser(html, document2) {
  677. const styleTagParser = new StyleTagParser();
  678. html = styleTagParser.extractStyle(html);
  679. const tokens = new Scaner(html).scan();
  680. const root = {
  681. tagName: "",
  682. children: [],
  683. type: "element",
  684. attributes: []
  685. };
  686. const state = {
  687. tokens,
  688. options,
  689. cursor: 0,
  690. stack: [
  691. root
  692. ]
  693. };
  694. parse(state);
  695. return format(root.children, document2, {
  696. styleTagParser,
  697. descendantList: Array(styleTagParser.styles.length).fill(0)
  698. });
  699. }
  700. function parse(state) {
  701. const { tokens , stack } = state;
  702. let { cursor } = state;
  703. const len = tokens.length;
  704. let nodes = stack[stack.length - 1].children;
  705. while(cursor < len){
  706. const token = tokens[cursor];
  707. if (token.type !== "tag-start") {
  708. nodes.push(token);
  709. cursor++;
  710. continue;
  711. }
  712. const tagToken = tokens[++cursor];
  713. cursor++;
  714. const tagName = tagToken.content.toLowerCase();
  715. if (token.close) {
  716. let index = stack.length;
  717. let shouldRewind = false;
  718. while(--index > -1){
  719. if (stack[index].tagName === tagName) {
  720. shouldRewind = true;
  721. break;
  722. }
  723. }
  724. while(cursor < len){
  725. const endToken = tokens[cursor];
  726. if (endToken.type !== "tag-end") break;
  727. cursor++;
  728. }
  729. if (shouldRewind) {
  730. stack.splice(index);
  731. break;
  732. } else {
  733. continue;
  734. }
  735. }
  736. const isClosingTag = options.html.closingElements.has(tagName);
  737. let shouldRewindToAutoClose = isClosingTag;
  738. if (shouldRewindToAutoClose) {
  739. shouldRewindToAutoClose = !hasTerminalParent(tagName, stack);
  740. }
  741. if (shouldRewindToAutoClose) {
  742. let currentIndex = stack.length - 1;
  743. while(currentIndex > 0){
  744. if (tagName === stack[currentIndex].tagName) {
  745. stack.splice(currentIndex);
  746. const previousIndex = currentIndex - 1;
  747. nodes = stack[previousIndex].children;
  748. break;
  749. }
  750. currentIndex = currentIndex - 1;
  751. }
  752. }
  753. const attributes = [];
  754. let attrToken;
  755. while(cursor < len){
  756. attrToken = tokens[cursor];
  757. if (attrToken.type === "tag-end") break;
  758. attributes.push(attrToken.content);
  759. cursor++;
  760. }
  761. cursor++;
  762. const children = [];
  763. const element = {
  764. type: "element",
  765. tagName: tagToken.content,
  766. attributes,
  767. children
  768. };
  769. nodes.push(element);
  770. const hasChildren = !(attrToken.close || options.html.voidElements.has(tagName));
  771. if (hasChildren) {
  772. stack.push({
  773. tagName,
  774. children
  775. });
  776. const innerState = {
  777. tokens,
  778. cursor,
  779. stack
  780. };
  781. parse(innerState);
  782. cursor = innerState.cursor;
  783. }
  784. }
  785. state.cursor = cursor;
  786. }
  787. function setInnerHTML(element, html) {
  788. while(element.firstChild){
  789. element.removeChild(element.firstChild);
  790. }
  791. const children = parser(html, element.ownerDocument);
  792. for(let i = 0; i < children.length; i++){
  793. element.appendChild(children[i]);
  794. }
  795. }
  796. function getBoundingClientRectImpl() {
  797. if (!options.miniGlobal) return Promise.resolve(null);
  798. return new Promise((resolve)=>{
  799. const query = options.miniGlobal.createSelectorQuery();
  800. query.select(`#${this.uid}`).boundingClientRect((res)=>{
  801. resolve(res);
  802. }).exec();
  803. });
  804. }
  805. function getTemplateContent(ctx) {
  806. if (ctx.nodeName === "template") {
  807. const document2 = ctx.ownerDocument;
  808. const content = document2.createElement(DOCUMENT_FRAGMENT);
  809. content.childNodes = ctx.childNodes;
  810. ctx.childNodes = [
  811. content
  812. ];
  813. content.parentNode = ctx;
  814. content.childNodes.forEach((nodes)=>{
  815. nodes.parentNode = content;
  816. });
  817. return content;
  818. }
  819. }
  820. function insertAdjacentHTML(position, html) {
  821. var _a, _b;
  822. const parsedNodes = parser(html, this.ownerDocument);
  823. for(let i = 0; i < parsedNodes.length; i++){
  824. const n = parsedNodes[i];
  825. switch(position){
  826. case "beforebegin":
  827. (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(n, this);
  828. break;
  829. case "afterbegin":
  830. if (this.hasChildNodes()) {
  831. this.insertBefore(n, this.childNodes[0]);
  832. } else {
  833. this.appendChild(n);
  834. }
  835. break;
  836. case "beforeend":
  837. this.appendChild(n);
  838. break;
  839. case "afterend":
  840. (_b = this.parentNode) === null || _b === void 0 ? void 0 : _b.appendChild(n);
  841. break;
  842. }
  843. }
  844. }
  845. function cloneNode(isDeep = false) {
  846. const document2 = this.ownerDocument;
  847. let newNode;
  848. if (this.nodeType === 1) {
  849. newNode = document2.createElement(this.nodeName);
  850. } else if (this.nodeType === 3) {
  851. newNode = document2.createTextNode("");
  852. }
  853. for(const key in this){
  854. const value = this[key];
  855. if ([
  856. PROPS,
  857. DATASET
  858. ].includes(key) && typeof value === OBJECT) {
  859. newNode[key] = Object.assign({}, value);
  860. } else if (key === "_value") {
  861. newNode[key] = value;
  862. } else if (key === STYLE) {
  863. newNode.style._value = Object.assign({}, value._value);
  864. newNode.style._usedStyleProp = new Set(Array.from(value._usedStyleProp));
  865. }
  866. }
  867. if (isDeep) {
  868. newNode.childNodes = this.childNodes.map((node)=>node.cloneNode(true));
  869. }
  870. return newNode;
  871. }
  872. function contains(node) {
  873. let isContains = false;
  874. this.childNodes.some((childNode)=>{
  875. const { uid } = childNode;
  876. if (uid === node.uid || uid === node.id || childNode.contains(node)) {
  877. isContains = true;
  878. return true;
  879. }
  880. });
  881. return isContains;
  882. }
  883. function createEvent(event, node) {
  884. if (typeof event === "string") {
  885. return new TaroEvent(event, {
  886. bubbles: true,
  887. cancelable: true
  888. });
  889. }
  890. const domEv = new TaroEvent(event.type, {
  891. bubbles: true,
  892. cancelable: true
  893. }, event);
  894. for(const key in event){
  895. if (key === CURRENT_TARGET || key === TARGET || key === TYPE || key === TIME_STAMP) {
  896. continue;
  897. } else {
  898. domEv[key] = event[key];
  899. }
  900. }
  901. if (domEv.type === CONFIRM && (node === null || node === void 0 ? void 0 : node.nodeName) === INPUT) {
  902. domEv[KEY_CODE] = 13;
  903. }
  904. return domEv;
  905. }
  906. function getEventCBResult(event) {
  907. const result = event[EVENT_CALLBACK_RESULT];
  908. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(result)) {
  909. delete event[EVENT_CALLBACK_RESULT];
  910. }
  911. return result;
  912. }
  913. function eventHandler(event) {
  914. var _a, _b;
  915. event.type === void 0 && Object.defineProperty(event, "type", {
  916. value: event._type
  917. });
  918. event.detail === void 0 && Object.defineProperty(event, "detail", {
  919. value: event._detail || Object.assign({}, event)
  920. });
  921. event.currentTarget = event.currentTarget || event.target || Object.assign({}, event);
  922. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyMpEventImpl", event);
  923. const currentTarget = event.currentTarget;
  924. const id = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.sid) || currentTarget.id || ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.id) || "";
  925. const node = env.document.getElementById(id);
  926. if (node) {
  927. const dispatch = ()=>{
  928. const e = createEvent(event, node);
  929. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyTaroEvent", e, node);
  930. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("dispatchTaroEvent", e, node);
  931. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("dispatchTaroEventFinish", e, node);
  932. };
  933. if (_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.isExist("batchedEventUpdates")) {
  934. const type = event.type;
  935. if (!_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("isBubbleEvents", type) || !isParentBinded(node, type) || type === TOUCHMOVE && !!node.props.catchMove) {
  936. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("batchedEventUpdates", ()=>{
  937. if (eventsBatch[type]) {
  938. eventsBatch[type].forEach((fn)=>fn());
  939. delete eventsBatch[type];
  940. }
  941. dispatch();
  942. });
  943. return getEventCBResult(event);
  944. } else {
  945. (eventsBatch[type] || (eventsBatch[type] = [])).push(dispatch);
  946. }
  947. } else {
  948. dispatch();
  949. return getEventCBResult(event);
  950. }
  951. }
  952. }
  953. function findCustomWrapper(root, dataPathArr) {
  954. const list = dataPathArr.slice(1);
  955. let currentData = root;
  956. let customWrapper;
  957. let splitedPath = "";
  958. list.some((item, i)=>{
  959. const key = item.replace(/^\[(.+)\]$/, "$1").replace(/\bcn\b/g, "childNodes");
  960. currentData = currentData[key];
  961. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(currentData)) {
  962. currentData = currentData.filter((el)=>!isComment(el));
  963. }
  964. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(currentData)) return true;
  965. if (currentData.nodeName === CUSTOM_WRAPPER) {
  966. const res = customWrapperCache.get(currentData.sid);
  967. if (res) {
  968. customWrapper = res;
  969. splitedPath = dataPathArr.slice(i + 2).join(".");
  970. }
  971. }
  972. });
  973. if (customWrapper) {
  974. return {
  975. customWrapper,
  976. splitedPath
  977. };
  978. }
  979. }
  980. function __classPrivateFieldGet(receiver, state, kind, f) {
  981. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  982. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  983. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  984. }
  985. function __classPrivateFieldSet(receiver, state, value, kind, f) {
  986. if (kind === "m") throw new TypeError("Private method is not writable");
  987. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  988. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  989. return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
  990. }
  991. function replacer(match) {
  992. return replaceCharMap[match];
  993. }
  994. function appendTo(dict, name, value) {
  995. const res = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) ? value.join(",") : value;
  996. if (name in dict) dict[name].push(res);
  997. else dict[name] = [
  998. res
  999. ];
  1000. }
  1001. function addEach(value, key) {
  1002. appendTo(this, key, value);
  1003. }
  1004. function decode(str) {
  1005. return decodeURIComponent(str.replace(plusReg, " "));
  1006. }
  1007. function encode(str) {
  1008. return encodeURIComponent(str).replace(findReg, replacer);
  1009. }
  1010. function parseUrl(url = "") {
  1011. const result = {
  1012. href: "",
  1013. origin: "",
  1014. protocol: "",
  1015. hostname: "",
  1016. host: "",
  1017. port: "",
  1018. pathname: "",
  1019. search: "",
  1020. hash: ""
  1021. };
  1022. if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return result;
  1023. url = url.trim();
  1024. const PATTERN = /^(([^:/?#]+):)?\/\/(([^/?#]+):(.+)@)?([^/?#:]*)(:(\d+))?([^?#]*)(\?([^#]*))?(#(.*))?/;
  1025. const matches = url.match(PATTERN);
  1026. if (!matches) return result;
  1027. result.protocol = matches[1] || "https:";
  1028. result.hostname = matches[6] || "taro.com";
  1029. result.port = matches[8] || "";
  1030. result.pathname = matches[9] || "/";
  1031. result.search = matches[10] || "";
  1032. result.hash = matches[12] || "";
  1033. result.href = url;
  1034. result.origin = result.protocol + "//" + result.hostname;
  1035. result.host = result.hostname + (result.port ? `:${result.port}` : "");
  1036. return result;
  1037. }
  1038. function parseUrlBase(url, base) {
  1039. const VALID_URL = /^(https?:)\/\//i;
  1040. let fullUrl = "";
  1041. let parsedBase = null;
  1042. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(base)) {
  1043. base = String(base).trim();
  1044. if (!VALID_URL.test(base)) throw new TypeError(`Failed to construct 'URL': Invalid base URL`);
  1045. parsedBase = parseUrl(base);
  1046. }
  1047. url = String(url).trim();
  1048. if (VALID_URL.test(url)) {
  1049. fullUrl = url;
  1050. } else if (parsedBase) {
  1051. if (url) {
  1052. if (url.startsWith("//")) {
  1053. fullUrl = parsedBase.protocol + url;
  1054. } else {
  1055. fullUrl = parsedBase.origin + (url.startsWith("/") ? url : `/${url}`);
  1056. }
  1057. } else {
  1058. fullUrl = parsedBase.href;
  1059. }
  1060. } else {
  1061. throw new TypeError(`Failed to construct 'URL': Invalid URL`);
  1062. }
  1063. return parseUrl(fullUrl);
  1064. }
  1065. function getComputedStyle(element) {
  1066. return element.style;
  1067. }
  1068. function generateFullUrl(val = "") {
  1069. const origin = INIT_URL;
  1070. if (/^[/?#]/.test(val)) {
  1071. return origin + val;
  1072. }
  1073. return val;
  1074. }
  1075. function injectPageInstance(inst, id) {
  1076. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("mergePageInstance", instances.get(id), inst);
  1077. instances.set(id, inst);
  1078. }
  1079. function getPageInstance(id) {
  1080. return instances.get(id);
  1081. }
  1082. function removePageInstance(id) {
  1083. instances.delete(id);
  1084. }
  1085. function addLeadingSlash(path) {
  1086. if (path == null) {
  1087. return "";
  1088. }
  1089. return path.charAt(0) === "/" ? path : "/" + path;
  1090. }
  1091. function safeExecute(path, lifecycle, ...args) {
  1092. const instance = instances.get(path);
  1093. if (instance == null) {
  1094. return;
  1095. }
  1096. const func = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getLifecycle", instance, lifecycle);
  1097. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(func)) {
  1098. const res = func.map((fn)=>fn.apply(instance, args));
  1099. return res[0];
  1100. }
  1101. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(func)) {
  1102. return;
  1103. }
  1104. return func.apply(instance, args);
  1105. }
  1106. function stringify(obj) {
  1107. if (obj == null) {
  1108. return "";
  1109. }
  1110. const path = Object.keys(obj).map((key)=>{
  1111. return key + "=" + obj[key];
  1112. }).join("&");
  1113. return path === "" ? path : "?" + path;
  1114. }
  1115. function getPath(id, options2) {
  1116. const idx = id.indexOf("?");
  1117. if (isWeb) {
  1118. return `${idx > -1 ? id.substring(0, idx) : id}${stringify((options2 === null || options2 === void 0 ? void 0 : options2.stamp) ? {
  1119. stamp: options2.stamp
  1120. } : {})}`;
  1121. } else {
  1122. return `${idx > -1 ? id.substring(0, idx) : id}${stringify(options2)}`;
  1123. }
  1124. }
  1125. function getOnReadyEventKey(path) {
  1126. return path + "." + ON_READY;
  1127. }
  1128. function getOnShowEventKey(path) {
  1129. return path + "." + ON_SHOW;
  1130. }
  1131. function getOnHideEventKey(path) {
  1132. return path + "." + ON_HIDE;
  1133. }
  1134. function createPageConfig(component, pageName, data, pageConfig) {
  1135. const id = pageName !== null && pageName !== void 0 ? pageName : `taro_page_${pageId()}`;
  1136. const [ONLOAD, ONUNLOAD, ONREADY, ONSHOW, ONHIDE, LIFECYCLES, SIDE_EFFECT_LIFECYCLES] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").page;
  1137. let pageElement = null;
  1138. let unmounting = false;
  1139. let prepareMountList = [];
  1140. function setCurrentRouter(page) {
  1141. const router = isWeb ? page.$taroPath : page.route || page.__route__ || page.$taroPath;
  1142. Current.router = {
  1143. params: page.$taroParams,
  1144. path: addLeadingSlash(router),
  1145. $taroPath: page.$taroPath,
  1146. onReady: getOnReadyEventKey(id),
  1147. onShow: getOnShowEventKey(id),
  1148. onHide: getOnHideEventKey(id)
  1149. };
  1150. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(page.exitState)) {
  1151. Current.router.exitState = page.exitState;
  1152. }
  1153. }
  1154. let loadResolver;
  1155. let hasLoaded;
  1156. const config = {
  1157. [ONLOAD] (options2 = {}, cb) {
  1158. hasLoaded = new Promise((resolve)=>{
  1159. loadResolver = resolve;
  1160. });
  1161. perf.start(PAGE_INIT);
  1162. Current.page = this;
  1163. this.config = pageConfig || {};
  1164. const uniqueOptions = Object.assign({}, options2, {
  1165. $taroTimestamp: Date.now()
  1166. });
  1167. const $taroPath = this.$taroPath = getPath(id, uniqueOptions);
  1168. if (isWeb) {
  1169. config.path = $taroPath;
  1170. }
  1171. if (this.$taroParams == null) {
  1172. this.$taroParams = uniqueOptions;
  1173. }
  1174. setCurrentRouter(this);
  1175. if (!isWeb) {
  1176. window$1.trigger(CONTEXT_ACTIONS.INIT, $taroPath);
  1177. }
  1178. const mount = ()=>{
  1179. Current.app.mount(component, $taroPath, ()=>{
  1180. pageElement = env.document.getElementById($taroPath);
  1181. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(pageElement !== null, "\u6CA1\u6709\u627E\u5230\u9875\u9762\u5B9E\u4F8B\u3002");
  1182. safeExecute($taroPath, ON_LOAD, this.$taroParams);
  1183. loadResolver();
  1184. if (!isWeb) {
  1185. pageElement.ctx = this;
  1186. pageElement.performUpdate(true, cb);
  1187. } else {
  1188. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(cb) && cb();
  1189. }
  1190. });
  1191. };
  1192. if (unmounting) {
  1193. prepareMountList.push(mount);
  1194. } else {
  1195. mount();
  1196. }
  1197. },
  1198. [ONUNLOAD] () {
  1199. const $taroPath = this.$taroPath;
  1200. if (!isWeb) {
  1201. window$1.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath);
  1202. }
  1203. safeExecute($taroPath, ONUNLOAD);
  1204. unmounting = true;
  1205. Current.app.unmount($taroPath, ()=>{
  1206. unmounting = false;
  1207. instances.delete($taroPath);
  1208. if (pageElement) {
  1209. pageElement.ctx = null;
  1210. pageElement = null;
  1211. }
  1212. if (prepareMountList.length) {
  1213. prepareMountList.forEach((fn)=>fn());
  1214. prepareMountList = [];
  1215. }
  1216. });
  1217. },
  1218. [ONREADY] () {
  1219. hasLoaded.then(()=>{
  1220. safeExecute(this.$taroPath, ON_READY);
  1221. _raf(()=>eventCenter.trigger(getOnReadyEventKey(id)));
  1222. this.onReady.called = true;
  1223. });
  1224. },
  1225. [ONSHOW] (options2 = {}) {
  1226. hasLoaded.then(()=>{
  1227. Current.page = this;
  1228. setCurrentRouter(this);
  1229. if (!isWeb) {
  1230. window$1.trigger(CONTEXT_ACTIONS.RECOVER, this.$taroPath);
  1231. }
  1232. safeExecute(this.$taroPath, ON_SHOW, options2);
  1233. _raf(()=>eventCenter.trigger(getOnShowEventKey(id)));
  1234. });
  1235. },
  1236. [ONHIDE] () {
  1237. if (!isWeb) {
  1238. window$1.trigger(CONTEXT_ACTIONS.RESTORE, this.$taroPath);
  1239. }
  1240. if (Current.page === this) {
  1241. Current.page = null;
  1242. Current.router = null;
  1243. }
  1244. safeExecute(this.$taroPath, ON_HIDE);
  1245. eventCenter.trigger(getOnHideEventKey(id));
  1246. }
  1247. };
  1248. LIFECYCLES.forEach((lifecycle)=>{
  1249. let isDefer = false;
  1250. lifecycle = lifecycle.replace(/^defer:/, ()=>{
  1251. isDefer = true;
  1252. return "";
  1253. });
  1254. config[lifecycle] = function() {
  1255. const exec = ()=>safeExecute(this.$taroPath, lifecycle, ...arguments);
  1256. if (isDefer) {
  1257. hasLoaded.then(exec);
  1258. } else {
  1259. return exec();
  1260. }
  1261. };
  1262. });
  1263. SIDE_EFFECT_LIFECYCLES.forEach((lifecycle)=>{
  1264. var _a;
  1265. if (component[lifecycle] || ((_a = component.prototype) === null || _a === void 0 ? void 0 : _a[lifecycle]) || component[lifecycle.replace(/^on/, "enable")] || (pageConfig === null || pageConfig === void 0 ? void 0 : pageConfig[lifecycle.replace(/^on/, "enable")])) {
  1266. config[lifecycle] = function(...args) {
  1267. var _a2;
  1268. const target = (_a2 = args[0]) === null || _a2 === void 0 ? void 0 : _a2.target;
  1269. if (target === null || target === void 0 ? void 0 : target.id) {
  1270. const id2 = target.id;
  1271. const element = env.document.getElementById(id2);
  1272. if (element) {
  1273. target.dataset = element.dataset;
  1274. }
  1275. }
  1276. return safeExecute(this.$taroPath, lifecycle, ...args);
  1277. };
  1278. }
  1279. });
  1280. config.eh = eventHandler;
  1281. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(data)) {
  1282. config.data = data;
  1283. }
  1284. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyPageObject", config);
  1285. return config;
  1286. }
  1287. function createComponentConfig(component, componentName, data) {
  1288. const id = componentName !== null && componentName !== void 0 ? componentName : `taro_component_${pageId()}`;
  1289. let componentElement = null;
  1290. const [ATTACHED, DETACHED] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").component;
  1291. const config = {
  1292. [ATTACHED] () {
  1293. var _a;
  1294. perf.start(PAGE_INIT);
  1295. this.pageIdCache = ((_a = this.getPageId) === null || _a === void 0 ? void 0 : _a.call(this)) || pageId();
  1296. const path = getPath(id, {
  1297. id: this.pageIdCache
  1298. });
  1299. Current.app.mount(component, path, ()=>{
  1300. componentElement = env.document.getElementById(path);
  1301. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(componentElement !== null, "\u6CA1\u6709\u627E\u5230\u7EC4\u4EF6\u5B9E\u4F8B\u3002");
  1302. this.$taroInstances = instances.get(path);
  1303. safeExecute(path, ON_LOAD);
  1304. if (!isWeb) {
  1305. componentElement.ctx = this;
  1306. componentElement.performUpdate(true);
  1307. }
  1308. });
  1309. },
  1310. [DETACHED] () {
  1311. const path = getPath(id, {
  1312. id: this.pageIdCache
  1313. });
  1314. Current.app.unmount(path, ()=>{
  1315. instances.delete(path);
  1316. if (componentElement) {
  1317. componentElement.ctx = null;
  1318. }
  1319. });
  1320. },
  1321. methods: {
  1322. eh: eventHandler
  1323. }
  1324. };
  1325. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(data)) {
  1326. config.data = data;
  1327. }
  1328. [
  1329. OPTIONS,
  1330. EXTERNAL_CLASSES,
  1331. BEHAVIORS
  1332. ].forEach((key)=>{
  1333. var _a;
  1334. config[key] = (_a = component[key]) !== null && _a !== void 0 ? _a : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
  1335. });
  1336. return config;
  1337. }
  1338. function createRecursiveComponentConfig(componentName) {
  1339. const isCustomWrapper = componentName === CUSTOM_WRAPPER;
  1340. const [ATTACHED, DETACHED] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").component;
  1341. const lifeCycles = isCustomWrapper ? {
  1342. [ATTACHED] () {
  1343. var _a, _b;
  1344. const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
  1345. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(componentId)) {
  1346. customWrapperCache.set(componentId, this);
  1347. const el = env.document.getElementById(componentId);
  1348. if (el) {
  1349. el.ctx = this;
  1350. }
  1351. }
  1352. },
  1353. [DETACHED] () {
  1354. var _a, _b;
  1355. const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
  1356. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(componentId)) {
  1357. customWrapperCache.delete(componentId);
  1358. const el = env.document.getElementById(componentId);
  1359. if (el) {
  1360. el.ctx = null;
  1361. }
  1362. }
  1363. }
  1364. } : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
  1365. return Object.assign({
  1366. properties: {
  1367. i: {
  1368. type: Object,
  1369. value: {
  1370. ["nn"]: (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.getComponentsAlias)(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents)[VIEW]._num
  1371. }
  1372. },
  1373. l: {
  1374. type: String,
  1375. value: ""
  1376. }
  1377. },
  1378. options: {
  1379. addGlobalClass: true,
  1380. virtualHost: !isCustomWrapper
  1381. },
  1382. methods: {
  1383. eh: eventHandler
  1384. }
  1385. }, lifeCycles);
  1386. }
  1387. var PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, observers, MutationObserverImpl, sidMatches, isConcerned, pendingMuatations, MutationObserver, incrementId, customWrapperCache, componentsAlias$1, ClassList, EventSource, eventSource, isWeb$1, env, SPECIAL_NODES, componentsAlias, TaroEventTarget, CHILDNODES, nodeId, TaroNode, WEBKIT, styleProperties, color, style, width, image, size, color_style_width, fitlength_fitwidth_image, fitlength_fitwidth_image_radius, color_style_width_fitlength_fitwidth_image, endRadius_startRadius, bottom_left_right_top, end_start, content_items_self, blockSize_height_inlineSize_width, after_before, Style, TaroElement, options, whitespace, equalSign, alphanumeric, Scaner, LEFT_BRACKET, RIGHT_BRACKET, CLASS_SELECTOR, ID_SELECTOR, CHILD_COMBINATOR, GENERAL_SIBLING_COMBINATOR, ADJACENT_SIBLING_COMBINATOR, StyleTagParser, specialMiniElements, internalCompsList, isMiniElements, isInlineElements, isBlockElements, closingTagAncestorBreakers, TaroEvent, eventsBatch, FormElement, Performance, perf, TaroRootElement, TaroText, _URLSearchParams_dict, findReg, plusReg, replaceCharMap, URLSearchParams, _URL_hash, _URL_hostname, _URL_pathname, _URL_port, _URL_protocol, _URL_search, URL, AnchorElement, TaroDocument, document$1, eventCenter, RuntimeCache, _History_instances, _History_location, _History_stack, _History_cur, _History_window, _History_reset, cache$1, History, Current, getCurrentInstance, _Location_instances, _Location_url, _Location_noCheckUrl, _Location_window, _Location_reset, _Location_getPreValue, _Location_rollBack, _Location_recordHistory, _Location_checkUrlChange, INIT_URL, cache, Location, machine, arch, engine, msg, nav, now, lastTime, _raf, _caf, window$1, location, history, SVGElement, instances, pageId, isWeb, TIMEOUT, nextTick;
  1388. var init_runtime_esm = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__.__esm)({
  1389. "node_modules/@tarojs/runtime/dist/runtime.esm.js" () {
  1390. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.init_shared_esm)();
  1391. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.init_shared_esm)();
  1392. PROPERTY_THRESHOLD = 2046;
  1393. TARO_RUNTIME = "Taro runtime";
  1394. HOOKS_APP_ID = "taro-app";
  1395. SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
  1396. PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
  1397. ROOT_STR = "root";
  1398. HTML = "html";
  1399. HEAD = "head";
  1400. BODY = "body";
  1401. APP = "app";
  1402. CONTAINER = "container";
  1403. DOCUMENT_ELEMENT_NAME = "#document";
  1404. DOCUMENT_FRAGMENT = "document-fragment";
  1405. ID = "id";
  1406. UID = "uid";
  1407. CLASS = "class";
  1408. STYLE = "style";
  1409. FOCUS = "focus";
  1410. VIEW = "view";
  1411. STATIC_VIEW = "static-view";
  1412. PURE_VIEW = "pure-view";
  1413. PROPS = "props";
  1414. DATASET = "dataset";
  1415. OBJECT = "object";
  1416. VALUE = "value";
  1417. INPUT = "input";
  1418. CHANGE = "change";
  1419. CUSTOM_WRAPPER = "custom-wrapper";
  1420. TARGET = "target";
  1421. CURRENT_TARGET = "currentTarget";
  1422. TYPE = "type";
  1423. CONFIRM = "confirm";
  1424. TIME_STAMP = "timeStamp";
  1425. KEY_CODE = "keyCode";
  1426. TOUCHMOVE = "touchmove";
  1427. DATE = "Date";
  1428. SET_TIMEOUT = "setTimeout";
  1429. CATCHMOVE = "catchMove";
  1430. CATCH_VIEW = "catch-view";
  1431. COMMENT = "comment";
  1432. ON_LOAD = "onLoad";
  1433. ON_READY = "onReady";
  1434. ON_SHOW = "onShow";
  1435. ON_HIDE = "onHide";
  1436. OPTIONS = "options";
  1437. EXTERNAL_CLASSES = "externalClasses";
  1438. EVENT_CALLBACK_RESULT = "e_result";
  1439. BEHAVIORS = "behaviors";
  1440. A = "a";
  1441. (function(CONTEXT_ACTIONS2) {
  1442. CONTEXT_ACTIONS2["INIT"] = "0";
  1443. CONTEXT_ACTIONS2["RESTORE"] = "1";
  1444. CONTEXT_ACTIONS2["RECOVER"] = "2";
  1445. CONTEXT_ACTIONS2["DESTORY"] = "3";
  1446. })(CONTEXT_ACTIONS || (CONTEXT_ACTIONS = {}));
  1447. observers = [];
  1448. MutationObserverImpl = class {
  1449. observe(target, options2) {
  1450. this.disconnect();
  1451. this.target = target;
  1452. this.options = options2 || {};
  1453. observers.push(this);
  1454. }
  1455. disconnect() {
  1456. this.target = null;
  1457. const index = observers.indexOf(this);
  1458. if (index >= 0) {
  1459. observers.splice(index, 1);
  1460. }
  1461. }
  1462. takeRecords() {
  1463. return this.records.splice(0, this.records.length);
  1464. }
  1465. constructor(callback){
  1466. this.records = [];
  1467. this.callback = callback;
  1468. }
  1469. };
  1470. sidMatches = (observerTarget, target)=>{
  1471. return !!observerTarget && observerTarget.sid === (target === null || target === void 0 ? void 0 : target.sid);
  1472. };
  1473. isConcerned = (record, options2)=>{
  1474. const { characterData , characterDataOldValue , attributes , attributeOldValue , childList } = options2;
  1475. switch(record.type){
  1476. case "characterData":
  1477. if (characterData) {
  1478. if (!characterDataOldValue) record.oldValue = null;
  1479. return true;
  1480. }
  1481. return false;
  1482. case "attributes":
  1483. if (attributes) {
  1484. if (!attributeOldValue) record.oldValue = null;
  1485. return true;
  1486. }
  1487. return false;
  1488. case "childList":
  1489. if (childList) {
  1490. return true;
  1491. }
  1492. return false;
  1493. }
  1494. };
  1495. pendingMuatations = false;
  1496. MutationObserver = class {
  1497. observe(...args) {
  1498. this.core.observe(...args);
  1499. }
  1500. disconnect() {
  1501. this.core.disconnect();
  1502. }
  1503. takeRecords() {
  1504. return this.core.takeRecords();
  1505. }
  1506. static record(record) {
  1507. recordMutation(record);
  1508. }
  1509. constructor(callback){
  1510. if (false) {} else {
  1511. if (true) {
  1512. console.warn("[Taro Warning] \u82E5\u8981\u4F7F\u7528 MutationObserver\uFF0C\u8BF7\u5728 Taro \u7F16\u8BD1\u914D\u7F6E\u4E2D\u8BBE\u7F6E 'mini.enableMutationObserver: true'");
  1513. }
  1514. this.core = {
  1515. observe: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop,
  1516. disconnect: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop,
  1517. takeRecords: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop
  1518. };
  1519. }
  1520. }
  1521. };
  1522. incrementId = ()=>{
  1523. const chatCodes = [];
  1524. for(let i = 65; i <= 90; i++){
  1525. chatCodes.push(i);
  1526. }
  1527. for(let i1 = 97; i1 <= 122; i1++){
  1528. chatCodes.push(i1);
  1529. }
  1530. const chatCodesLen = chatCodes.length - 1;
  1531. const list = [
  1532. 0,
  1533. 0
  1534. ];
  1535. return ()=>{
  1536. const target = list.map((item)=>chatCodes[item]);
  1537. const res = String.fromCharCode(...target);
  1538. let tailIdx = list.length - 1;
  1539. list[tailIdx]++;
  1540. while(list[tailIdx] > chatCodesLen){
  1541. list[tailIdx] = 0;
  1542. tailIdx = tailIdx - 1;
  1543. if (tailIdx < 0) {
  1544. list.push(0);
  1545. break;
  1546. }
  1547. list[tailIdx]++;
  1548. }
  1549. return res;
  1550. };
  1551. };
  1552. customWrapperCache = /* @__PURE__ */ new Map();
  1553. ClassList = class {
  1554. get value() {
  1555. return this.toString();
  1556. }
  1557. get length() {
  1558. return this.tokenList.length;
  1559. }
  1560. add() {
  1561. let index = 0;
  1562. let updated = false;
  1563. const tokens = arguments;
  1564. const length = tokens.length;
  1565. const tokenList = this.tokenList;
  1566. do {
  1567. const token = tokens[index];
  1568. if (this.checkTokenIsValid(token) && !~tokenList.indexOf(token)) {
  1569. tokenList.push(token);
  1570. updated = true;
  1571. }
  1572. }while (++index < length)
  1573. if (updated) {
  1574. this._update();
  1575. }
  1576. }
  1577. remove() {
  1578. let i = 0;
  1579. let updated = false;
  1580. const tokens = arguments;
  1581. const length = tokens.length;
  1582. const tokenList = this.tokenList;
  1583. do {
  1584. const token = tokens[i] + "";
  1585. if (!this.checkTokenIsValid(token)) continue;
  1586. const index = tokenList.indexOf(token);
  1587. if (~tokenList.indexOf(token)) {
  1588. tokenList.splice(index, 1);
  1589. updated = true;
  1590. }
  1591. }while (++i < length)
  1592. if (updated) {
  1593. this._update();
  1594. }
  1595. }
  1596. contains(token) {
  1597. if (!this.checkTokenIsValid(token)) return false;
  1598. return !!~this.tokenList.indexOf(token);
  1599. }
  1600. toggle(token, force) {
  1601. const result = this.contains(token);
  1602. const method = result ? force !== true && "remove" : force !== false && "add";
  1603. if (method) {
  1604. this[method](token);
  1605. }
  1606. if (force === true || force === false) {
  1607. return force;
  1608. } else {
  1609. return !result;
  1610. }
  1611. }
  1612. replace(token, replacement_token) {
  1613. if (!this.checkTokenIsValid(token) || !this.checkTokenIsValid(replacement_token)) return;
  1614. const index = this.tokenList.indexOf(token);
  1615. if (~index) {
  1616. this.tokenList.splice(index, 1, replacement_token);
  1617. this._update();
  1618. }
  1619. }
  1620. toString() {
  1621. return this.tokenList.filter((v)=>v !== "").join(" ");
  1622. }
  1623. checkTokenIsValid(token) {
  1624. if (token === "" || /\s/.test(token)) return false;
  1625. return true;
  1626. }
  1627. _update() {
  1628. this.el.className = this.value;
  1629. }
  1630. constructor(className, el){
  1631. this.tokenList = [];
  1632. this.el = el;
  1633. className.trim().split(/\s+/).forEach((token)=>this.tokenList.push(token));
  1634. }
  1635. };
  1636. EventSource = class extends Map {
  1637. removeNode(child) {
  1638. const { sid , uid } = child;
  1639. this.delete(sid);
  1640. if (uid !== sid && uid) this.delete(uid);
  1641. }
  1642. removeNodeTree(child) {
  1643. this.removeNode(child);
  1644. const { childNodes } = child;
  1645. childNodes.forEach((node)=>this.removeNodeTree(node));
  1646. }
  1647. };
  1648. eventSource = new EventSource();
  1649. isWeb$1 = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)();
  1650. env = {
  1651. window: isWeb$1 ? window : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ,
  1652. document: isWeb$1 ? document : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ
  1653. };
  1654. TaroEventTarget = class {
  1655. addEventListener(type, handler, options2) {
  1656. type = type.toLowerCase();
  1657. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("onAddEvent", type, handler, options2, this);
  1658. if (type === "regionchange") {
  1659. this.addEventListener("begin", handler, options2);
  1660. this.addEventListener("end", handler, options2);
  1661. return;
  1662. }
  1663. let isCapture = Boolean(options2);
  1664. let isOnce = false;
  1665. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(options2)) {
  1666. isCapture = Boolean(options2.capture);
  1667. isOnce = Boolean(options2.once);
  1668. }
  1669. if (isOnce) {
  1670. const wrapper = function() {
  1671. handler.apply(this, arguments);
  1672. this.removeEventListener(type, wrapper);
  1673. };
  1674. this.addEventListener(type, wrapper, Object.assign(Object.assign({}, options2), {
  1675. once: false
  1676. }));
  1677. return;
  1678. }
  1679. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(isCapture, "Taro \u6682\u672A\u5B9E\u73B0 event \u7684 capture \u7279\u6027\u3002");
  1680. const oldHandler = handler;
  1681. handler = function() {
  1682. return oldHandler.apply(this, arguments);
  1683. };
  1684. handler.oldHandler = oldHandler;
  1685. const handlers = this.__handlers[type];
  1686. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(handlers)) {
  1687. handlers.push(handler);
  1688. } else {
  1689. this.__handlers[type] = [
  1690. handler
  1691. ];
  1692. }
  1693. }
  1694. removeEventListener(type, handler) {
  1695. type = type.toLowerCase();
  1696. if (type === "regionchange") {
  1697. this.removeEventListener("begin", handler);
  1698. this.removeEventListener("end", handler);
  1699. return;
  1700. }
  1701. if (!handler) {
  1702. return;
  1703. }
  1704. const handlers = this.__handlers[type];
  1705. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(handlers)) {
  1706. return;
  1707. }
  1708. const index = handlers.findIndex((item)=>{
  1709. if (item === handler || item.oldHandler === handler) return true;
  1710. });
  1711. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(index === -1, `\u4E8B\u4EF6: '${type}' \u6CA1\u6709\u6CE8\u518C\u5728 DOM \u4E2D\uFF0C\u56E0\u6B64\u4E0D\u4F1A\u88AB\u79FB\u9664\u3002`);
  1712. handlers.splice(index, 1);
  1713. }
  1714. isAnyEventBinded() {
  1715. const handlers = this.__handlers;
  1716. const isAnyEventBinded = Object.keys(handlers).find((key)=>handlers[key].length);
  1717. return Boolean(isAnyEventBinded);
  1718. }
  1719. constructor(){
  1720. this.__handlers = {};
  1721. }
  1722. };
  1723. CHILDNODES = "cn";
  1724. nodeId = incrementId();
  1725. TaroNode = class extends TaroEventTarget {
  1726. updateChildNodes(isClean) {
  1727. const cleanChildNodes = ()=>[];
  1728. const rerenderChildNodes = ()=>{
  1729. const childNodes = this.childNodes.filter((node)=>!isComment(node));
  1730. return childNodes.map(hydrate);
  1731. };
  1732. this.enqueueUpdate({
  1733. path: `${this._path}.${CHILDNODES}`,
  1734. value: isClean ? cleanChildNodes : rerenderChildNodes
  1735. });
  1736. }
  1737. updateSingleChild(index) {
  1738. this.childNodes.forEach((child, childIndex)=>{
  1739. if (isComment(child)) return;
  1740. if (index && childIndex < index) return;
  1741. this.enqueueUpdate({
  1742. path: child._path,
  1743. value: this.hydrate(child)
  1744. });
  1745. });
  1746. }
  1747. get _root() {
  1748. var _a;
  1749. return ((_a = this.parentNode) === null || _a === void 0 ? void 0 : _a._root) || null;
  1750. }
  1751. findIndex(refChild) {
  1752. const index = this.childNodes.indexOf(refChild);
  1753. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(index !== -1, "The node to be replaced is not a child of this node.");
  1754. return index;
  1755. }
  1756. get _path() {
  1757. const parentNode = this.parentNode;
  1758. if (parentNode) {
  1759. const list = parentNode.childNodes.filter((node)=>!isComment(node));
  1760. const indexOfNode = list.indexOf(this);
  1761. const index = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getPathIndex", indexOfNode);
  1762. return `${parentNode._path}.${CHILDNODES}.${index}`;
  1763. }
  1764. return "";
  1765. }
  1766. get nextSibling() {
  1767. const parentNode = this.parentNode;
  1768. return (parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes[parentNode.findIndex(this) + 1]) || null;
  1769. }
  1770. get previousSibling() {
  1771. const parentNode = this.parentNode;
  1772. return (parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes[parentNode.findIndex(this) - 1]) || null;
  1773. }
  1774. get parentElement() {
  1775. const parentNode = this.parentNode;
  1776. if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeType) === 1) {
  1777. return parentNode;
  1778. }
  1779. return null;
  1780. }
  1781. get firstChild() {
  1782. return this.childNodes[0] || null;
  1783. }
  1784. get lastChild() {
  1785. const childNodes = this.childNodes;
  1786. return childNodes[childNodes.length - 1] || null;
  1787. }
  1788. set textContent(text) {
  1789. const removedNodes = this.childNodes.slice();
  1790. const addedNodes = [];
  1791. while(this.firstChild){
  1792. this.removeChild(this.firstChild, {
  1793. doUpdate: false
  1794. });
  1795. }
  1796. if (text === "") {
  1797. this.updateChildNodes(true);
  1798. } else {
  1799. const newText = env.document.createTextNode(text);
  1800. addedNodes.push(newText);
  1801. this.appendChild(newText);
  1802. this.updateChildNodes();
  1803. }
  1804. MutationObserver.record({
  1805. type: "childList",
  1806. target: this,
  1807. removedNodes,
  1808. addedNodes
  1809. });
  1810. }
  1811. insertBefore(newChild, refChild, isReplace) {
  1812. if (newChild.nodeName === DOCUMENT_FRAGMENT) {
  1813. newChild.childNodes.reduceRight((previousValue, currentValue)=>{
  1814. this.insertBefore(currentValue, previousValue);
  1815. return currentValue;
  1816. }, refChild);
  1817. return newChild;
  1818. }
  1819. newChild.remove({
  1820. cleanRef: false
  1821. });
  1822. let index = 0;
  1823. newChild.parentNode = this;
  1824. if (refChild) {
  1825. index = this.findIndex(refChild);
  1826. this.childNodes.splice(index, 0, newChild);
  1827. } else {
  1828. this.childNodes.push(newChild);
  1829. }
  1830. const childNodesLength = this.childNodes.length;
  1831. if (this._root) {
  1832. if (!refChild) {
  1833. const isOnlyChild = childNodesLength === 1;
  1834. if (isOnlyChild) {
  1835. this.updateChildNodes();
  1836. } else {
  1837. this.enqueueUpdate({
  1838. path: newChild._path,
  1839. value: this.hydrate(newChild)
  1840. });
  1841. }
  1842. } else if (isReplace) {
  1843. this.enqueueUpdate({
  1844. path: newChild._path,
  1845. value: this.hydrate(newChild)
  1846. });
  1847. } else {
  1848. const mark = childNodesLength * 2 / 3;
  1849. if (mark > index) {
  1850. this.updateChildNodes();
  1851. } else {
  1852. this.updateSingleChild(index);
  1853. }
  1854. }
  1855. }
  1856. MutationObserver.record({
  1857. type: "childList",
  1858. target: this,
  1859. addedNodes: [
  1860. newChild
  1861. ],
  1862. removedNodes: isReplace ? [
  1863. refChild
  1864. ] : [],
  1865. nextSibling: isReplace ? refChild.nextSibling : refChild || null,
  1866. previousSibling: newChild.previousSibling
  1867. });
  1868. return newChild;
  1869. }
  1870. appendChild(newChild) {
  1871. return this.insertBefore(newChild);
  1872. }
  1873. replaceChild(newChild, oldChild) {
  1874. if (oldChild.parentNode !== this) return;
  1875. this.insertBefore(newChild, oldChild, true);
  1876. oldChild.remove({
  1877. doUpdate: false
  1878. });
  1879. return oldChild;
  1880. }
  1881. removeChild(child, options2 = {}) {
  1882. const { cleanRef , doUpdate } = options2;
  1883. if (cleanRef !== false && doUpdate !== false) {
  1884. MutationObserver.record({
  1885. type: "childList",
  1886. target: this,
  1887. removedNodes: [
  1888. child
  1889. ],
  1890. nextSibling: child.nextSibling,
  1891. previousSibling: child.previousSibling
  1892. });
  1893. }
  1894. const index = this.findIndex(child);
  1895. this.childNodes.splice(index, 1);
  1896. child.parentNode = null;
  1897. if (cleanRef !== false) {
  1898. eventSource.removeNodeTree(child);
  1899. }
  1900. if (this._root && doUpdate !== false) {
  1901. this.updateChildNodes();
  1902. }
  1903. return child;
  1904. }
  1905. remove(options2) {
  1906. var _a;
  1907. (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this, options2);
  1908. }
  1909. hasChildNodes() {
  1910. return this.childNodes.length > 0;
  1911. }
  1912. enqueueUpdate(payload) {
  1913. var _a;
  1914. (_a = this._root) === null || _a === void 0 ? void 0 : _a.enqueueUpdate(payload);
  1915. }
  1916. get ownerDocument() {
  1917. return env.document;
  1918. }
  1919. static extend(methodName, options2) {
  1920. extend(TaroNode, methodName, options2);
  1921. }
  1922. constructor(){
  1923. super();
  1924. this.parentNode = null;
  1925. this.childNodes = [];
  1926. this.hydrate = (node)=>()=>hydrate(node);
  1927. this.uid = "_" + nodeId();
  1928. this.sid = this.uid;
  1929. eventSource.set(this.sid, this);
  1930. }
  1931. };
  1932. WEBKIT = "webkit";
  1933. styleProperties = [
  1934. "all",
  1935. "appearance",
  1936. "blockOverflow",
  1937. "blockSize",
  1938. "bottom",
  1939. "clear",
  1940. "contain",
  1941. "content",
  1942. "continue",
  1943. "cursor",
  1944. "direction",
  1945. "display",
  1946. "filter",
  1947. "float",
  1948. "gap",
  1949. "height",
  1950. "inset",
  1951. "isolation",
  1952. "left",
  1953. "letterSpacing",
  1954. "lightingColor",
  1955. "markerSide",
  1956. "mixBlendMode",
  1957. "opacity",
  1958. "order",
  1959. "position",
  1960. "quotes",
  1961. "resize",
  1962. "right",
  1963. "rowGap",
  1964. "tabSize",
  1965. "tableLayout",
  1966. "top",
  1967. "userSelect",
  1968. "verticalAlign",
  1969. "visibility",
  1970. "voiceFamily",
  1971. "volume",
  1972. "whiteSpace",
  1973. "widows",
  1974. "width",
  1975. "zIndex",
  1976. "pointerEvents",
  1977. "aspectRatio"
  1978. ];
  1979. color = "Color";
  1980. style = "Style";
  1981. width = "Width";
  1982. image = "Image";
  1983. size = "Size";
  1984. color_style_width = [
  1985. color,
  1986. style,
  1987. width
  1988. ];
  1989. fitlength_fitwidth_image = [
  1990. "FitLength",
  1991. "FitWidth",
  1992. image
  1993. ];
  1994. fitlength_fitwidth_image_radius = [
  1995. ...fitlength_fitwidth_image,
  1996. "Radius"
  1997. ];
  1998. color_style_width_fitlength_fitwidth_image = [
  1999. ...color_style_width,
  2000. ...fitlength_fitwidth_image
  2001. ];
  2002. endRadius_startRadius = [
  2003. "EndRadius",
  2004. "StartRadius"
  2005. ];
  2006. bottom_left_right_top = [
  2007. "Bottom",
  2008. "Left",
  2009. "Right",
  2010. "Top"
  2011. ];
  2012. end_start = [
  2013. "End",
  2014. "Start"
  2015. ];
  2016. content_items_self = [
  2017. "Content",
  2018. "Items",
  2019. "Self"
  2020. ];
  2021. blockSize_height_inlineSize_width = [
  2022. "BlockSize",
  2023. "Height",
  2024. "InlineSize",
  2025. width
  2026. ];
  2027. after_before = [
  2028. "After",
  2029. "Before"
  2030. ];
  2031. combine("borderBlock", color_style_width);
  2032. combine("borderBlockEnd", color_style_width);
  2033. combine("borderBlockStart", color_style_width);
  2034. combine("outline", [
  2035. ...color_style_width,
  2036. "Offset"
  2037. ]);
  2038. combine("border", [
  2039. ...color_style_width,
  2040. "Boundary",
  2041. "Break",
  2042. "Collapse",
  2043. "Radius",
  2044. "Spacing"
  2045. ]);
  2046. combine("borderFit", [
  2047. "Length",
  2048. width
  2049. ]);
  2050. combine("borderInline", color_style_width);
  2051. combine("borderInlineEnd", color_style_width);
  2052. combine("borderInlineStart", color_style_width);
  2053. combine("borderLeft", color_style_width_fitlength_fitwidth_image);
  2054. combine("borderRight", color_style_width_fitlength_fitwidth_image);
  2055. combine("borderTop", color_style_width_fitlength_fitwidth_image);
  2056. combine("borderBottom", color_style_width_fitlength_fitwidth_image);
  2057. combine("textDecoration", [
  2058. color,
  2059. style,
  2060. "Line"
  2061. ]);
  2062. combine("textEmphasis", [
  2063. color,
  2064. style,
  2065. "Position"
  2066. ]);
  2067. combine("scrollMargin", bottom_left_right_top);
  2068. combine("scrollPadding", bottom_left_right_top);
  2069. combine("padding", bottom_left_right_top);
  2070. combine("margin", [
  2071. ...bottom_left_right_top,
  2072. "Trim"
  2073. ]);
  2074. combine("scrollMarginBlock", end_start);
  2075. combine("scrollMarginInline", end_start);
  2076. combine("scrollPaddingBlock", end_start);
  2077. combine("scrollPaddingInline", end_start);
  2078. combine("gridColumn", end_start);
  2079. combine("gridRow", end_start);
  2080. combine("insetBlock", end_start);
  2081. combine("insetInline", end_start);
  2082. combine("marginBlock", end_start);
  2083. combine("marginInline", end_start);
  2084. combine("paddingBlock", end_start);
  2085. combine("paddingInline", end_start);
  2086. combine("pause", after_before);
  2087. combine("cue", after_before);
  2088. combine("mask", [
  2089. "Clip",
  2090. "Composite",
  2091. image,
  2092. "Mode",
  2093. "Origin",
  2094. "Position",
  2095. "Repeat",
  2096. size,
  2097. "Type"
  2098. ]);
  2099. combine("borderImage", [
  2100. "Outset",
  2101. "Repeat",
  2102. "Slice",
  2103. "Source",
  2104. "Transform",
  2105. width
  2106. ]);
  2107. combine("maskBorder", [
  2108. "Mode",
  2109. "Outset",
  2110. "Repeat",
  2111. "Slice",
  2112. "Source",
  2113. width
  2114. ]);
  2115. combine("font", [
  2116. "Family",
  2117. "FeatureSettings",
  2118. "Kerning",
  2119. "LanguageOverride",
  2120. "MaxSize",
  2121. "MinSize",
  2122. "OpticalSizing",
  2123. "Palette",
  2124. size,
  2125. "SizeAdjust",
  2126. "Stretch",
  2127. style,
  2128. "Weight",
  2129. "VariationSettings"
  2130. ]);
  2131. combine("transform", [
  2132. "Box",
  2133. "Origin",
  2134. style
  2135. ]);
  2136. combine("background", [
  2137. color,
  2138. image,
  2139. "Attachment",
  2140. "BlendMode",
  2141. "Clip",
  2142. "Origin",
  2143. "Position",
  2144. "Repeat",
  2145. size
  2146. ]);
  2147. combine("listStyle", [
  2148. image,
  2149. "Position",
  2150. "Type"
  2151. ]);
  2152. combine("scrollSnap", [
  2153. "Align",
  2154. "Stop",
  2155. "Type"
  2156. ]);
  2157. combine("grid", [
  2158. "Area",
  2159. "AutoColumns",
  2160. "AutoFlow",
  2161. "AutoRows"
  2162. ]);
  2163. combine("gridTemplate", [
  2164. "Areas",
  2165. "Columns",
  2166. "Rows"
  2167. ]);
  2168. combine("overflow", [
  2169. "Block",
  2170. "Inline",
  2171. "Wrap",
  2172. "X",
  2173. "Y"
  2174. ]);
  2175. combine("transition", [
  2176. "Delay",
  2177. "Duration",
  2178. "Property",
  2179. "TimingFunction"
  2180. ]);
  2181. combine("color", [
  2182. "Adjust",
  2183. "InterpolationFilters",
  2184. "Scheme"
  2185. ]);
  2186. combine("textAlign", [
  2187. "All",
  2188. "Last"
  2189. ]);
  2190. combine("page", [
  2191. "BreakAfter",
  2192. "BreakBefore",
  2193. "BreakInside"
  2194. ]);
  2195. combine("animation", [
  2196. "Delay",
  2197. "Direction",
  2198. "Duration",
  2199. "FillMode",
  2200. "IterationCount",
  2201. "Name",
  2202. "PlayState",
  2203. "TimingFunction"
  2204. ]);
  2205. combine("flex", [
  2206. "Basis",
  2207. "Direction",
  2208. "Flow",
  2209. "Grow",
  2210. "Shrink",
  2211. "Wrap"
  2212. ]);
  2213. combine("offset", [
  2214. ...after_before,
  2215. ...end_start,
  2216. "Anchor",
  2217. "Distance",
  2218. "Path",
  2219. "Position",
  2220. "Rotate"
  2221. ]);
  2222. combine("perspective", [
  2223. "Origin"
  2224. ]);
  2225. combine("clip", [
  2226. "Path",
  2227. "Rule"
  2228. ]);
  2229. combine("flow", [
  2230. "From",
  2231. "Into"
  2232. ]);
  2233. combine("align", [
  2234. "Content",
  2235. "Items",
  2236. "Self"
  2237. ], true);
  2238. combine("alignment", [
  2239. "Adjust",
  2240. "Baseline"
  2241. ], true);
  2242. combine("borderStart", endRadius_startRadius, true);
  2243. combine("borderEnd", endRadius_startRadius, true);
  2244. combine("borderCorner", [
  2245. "Fit",
  2246. image,
  2247. "ImageTransform"
  2248. ], true);
  2249. combine("borderTopLeft", fitlength_fitwidth_image_radius, true);
  2250. combine("borderTopRight", fitlength_fitwidth_image_radius, true);
  2251. combine("borderBottomLeft", fitlength_fitwidth_image_radius, true);
  2252. combine("borderBottomRight", fitlength_fitwidth_image_radius, true);
  2253. combine("column", [
  2254. "s",
  2255. "Count",
  2256. "Fill",
  2257. "Gap",
  2258. "Rule",
  2259. "RuleColor",
  2260. "RuleStyle",
  2261. "RuleWidth",
  2262. "Span",
  2263. width
  2264. ], true);
  2265. combine("break", [
  2266. ...after_before,
  2267. "Inside"
  2268. ], true);
  2269. combine("wrap", [
  2270. ...after_before,
  2271. "Flow",
  2272. "Inside",
  2273. "Through"
  2274. ], true);
  2275. combine("justify", content_items_self, true);
  2276. combine("place", content_items_self, true);
  2277. combine("max", [
  2278. ...blockSize_height_inlineSize_width,
  2279. "Lines"
  2280. ], true);
  2281. combine("min", blockSize_height_inlineSize_width, true);
  2282. combine("line", [
  2283. "Break",
  2284. "Clamp",
  2285. "Grid",
  2286. "Height",
  2287. "Padding",
  2288. "Snap"
  2289. ], true);
  2290. combine("inline", [
  2291. "BoxAlign",
  2292. size,
  2293. "Sizing"
  2294. ], true);
  2295. combine("text", [
  2296. "CombineUpright",
  2297. "GroupAlign",
  2298. "Height",
  2299. "Indent",
  2300. "Justify",
  2301. "Orientation",
  2302. "Overflow",
  2303. "Shadow",
  2304. "SpaceCollapse",
  2305. "SpaceTrim",
  2306. "Spacing",
  2307. "Transform",
  2308. "UnderlinePosition",
  2309. "Wrap"
  2310. ], true);
  2311. combine("shape", [
  2312. "ImageThreshold",
  2313. "Inside",
  2314. "Margin",
  2315. "Outside"
  2316. ], true);
  2317. combine("word", [
  2318. "Break",
  2319. "Spacing",
  2320. "Wrap"
  2321. ], true);
  2322. combine("object", [
  2323. "Fit",
  2324. "Position"
  2325. ], true);
  2326. combine("box", [
  2327. "DecorationBreak",
  2328. "Shadow",
  2329. "Sizing",
  2330. "Snap"
  2331. ], true);
  2332. combine(WEBKIT, [
  2333. "LineClamp",
  2334. "BoxOrient",
  2335. "TextFillColor",
  2336. "TextStroke",
  2337. "TextStrokeColor",
  2338. "TextStrokeWidth"
  2339. ], true);
  2340. Style = class {
  2341. setCssVariables(styleKey) {
  2342. this.hasOwnProperty(styleKey) || Object.defineProperty(this, styleKey, {
  2343. enumerable: true,
  2344. configurable: true,
  2345. get: ()=>{
  2346. return this._value[styleKey] || "";
  2347. },
  2348. set: (newVal)=>{
  2349. setStyle.call(this, newVal, styleKey);
  2350. }
  2351. });
  2352. }
  2353. get cssText() {
  2354. if (!this._usedStyleProp.size) return "";
  2355. const texts = [];
  2356. this._usedStyleProp.forEach((key)=>{
  2357. const val = this[key];
  2358. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(val) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val)) return;
  2359. let styleName = isCssVariable(key) ? key : (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toDashed)(key);
  2360. if (styleName.indexOf("webkit") === 0 || styleName.indexOf("Webkit") === 0) {
  2361. styleName = `-${styleName}`;
  2362. }
  2363. texts.push(`${styleName}: ${val};`);
  2364. });
  2365. return texts.join(" ");
  2366. }
  2367. set cssText(str) {
  2368. this._pending = true;
  2369. recordCss(this);
  2370. this._usedStyleProp.forEach((prop)=>{
  2371. this.removeProperty(prop);
  2372. });
  2373. if (str === "" || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(str) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(str)) {
  2374. this._pending = false;
  2375. enqueueUpdate(this);
  2376. return;
  2377. }
  2378. const rules = str.split(";");
  2379. for(let i = 0; i < rules.length; i++){
  2380. const rule = rules[i].trim();
  2381. if (rule === "") {
  2382. continue;
  2383. }
  2384. const [propName, ...valList] = rule.split(":");
  2385. const val = valList.join(":");
  2386. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val)) {
  2387. continue;
  2388. }
  2389. this.setProperty(propName.trim(), val.trim());
  2390. }
  2391. this._pending = false;
  2392. enqueueUpdate(this);
  2393. }
  2394. setProperty(propertyName, value) {
  2395. if (propertyName[0] === "-") {
  2396. this.setCssVariables(propertyName);
  2397. } else {
  2398. propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
  2399. }
  2400. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(value) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(value)) {
  2401. this.removeProperty(propertyName);
  2402. } else {
  2403. this[propertyName] = value;
  2404. }
  2405. }
  2406. removeProperty(propertyName) {
  2407. propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
  2408. if (!this._usedStyleProp.has(propertyName)) {
  2409. return "";
  2410. }
  2411. const value = this[propertyName];
  2412. this[propertyName] = void 0;
  2413. return value;
  2414. }
  2415. getPropertyValue(propertyName) {
  2416. propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
  2417. const value = this[propertyName];
  2418. if (!value) {
  2419. return "";
  2420. }
  2421. return value;
  2422. }
  2423. constructor(element){
  2424. this._element = element;
  2425. this._usedStyleProp = /* @__PURE__ */ new Set();
  2426. this._value = {};
  2427. }
  2428. };
  2429. initStyle(Style, styleProperties);
  2430. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.tap("injectNewStyleProperties", (newStyleProperties)=>{
  2431. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(newStyleProperties)) {
  2432. initStyle(Style, newStyleProperties);
  2433. } else {
  2434. if (typeof newStyleProperties !== "string") return;
  2435. initStyle(Style, [
  2436. newStyleProperties
  2437. ]);
  2438. }
  2439. });
  2440. TaroElement = class extends TaroNode {
  2441. _stopPropagation(event) {
  2442. let target = this;
  2443. while(target = target.parentNode){
  2444. const listeners = target.__handlers[event.type];
  2445. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(listeners)) {
  2446. continue;
  2447. }
  2448. for(let i = listeners.length; i--;){
  2449. const l = listeners[i];
  2450. l._stop = true;
  2451. }
  2452. }
  2453. }
  2454. get id() {
  2455. return this.getAttribute(ID);
  2456. }
  2457. set id(val) {
  2458. this.setAttribute(ID, val);
  2459. }
  2460. get className() {
  2461. return this.getAttribute(CLASS) || "";
  2462. }
  2463. set className(val) {
  2464. this.setAttribute(CLASS, val);
  2465. }
  2466. get cssText() {
  2467. return this.getAttribute(STYLE) || "";
  2468. }
  2469. get classList() {
  2470. return new ClassList(this.className, this);
  2471. }
  2472. get children() {
  2473. return this.childNodes.filter(isElement);
  2474. }
  2475. get attributes() {
  2476. const props = this.props;
  2477. const propKeys = Object.keys(props);
  2478. const style2 = this.style.cssText;
  2479. const attrs = propKeys.map((key)=>({
  2480. name: key,
  2481. value: props[key]
  2482. }));
  2483. return attrs.concat(style2 ? {
  2484. name: STYLE,
  2485. value: style2
  2486. } : []);
  2487. }
  2488. get textContent() {
  2489. let text = "";
  2490. const childNodes = this.childNodes;
  2491. for(let i = 0; i < childNodes.length; i++){
  2492. text += childNodes[i].textContent;
  2493. }
  2494. return text;
  2495. }
  2496. set textContent(text) {
  2497. super.textContent = text;
  2498. }
  2499. hasAttribute(qualifiedName) {
  2500. return !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(this.props[qualifiedName]);
  2501. }
  2502. hasAttributes() {
  2503. return this.attributes.length > 0;
  2504. }
  2505. get focus() {
  2506. return function() {
  2507. this.setAttribute(FOCUS, true);
  2508. };
  2509. }
  2510. set focus(value) {
  2511. this.setAttribute(FOCUS, value);
  2512. }
  2513. blur() {
  2514. this.setAttribute(FOCUS, false);
  2515. }
  2516. setAttribute(qualifiedName, value) {
  2517. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && value.length > PROPERTY_THRESHOLD, `\u5143\u7D20 ${this.nodeName} \u7684 ${qualifiedName} \u5C5E\u6027\u503C\u6570\u636E\u91CF\u8FC7\u5927\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u6E32\u67D3\u6027\u80FD\u3002\u8003\u8651\u964D\u4F4E\u56FE\u7247\u8F6C\u4E3A base64 \u7684\u9608\u503C\u6216\u5728 CSS \u4E2D\u4F7F\u7528 base64\u3002`);
  2518. const isPureView = this.nodeName === VIEW && !isHasExtractProp(this) && !this.isAnyEventBinded();
  2519. if (qualifiedName !== STYLE) {
  2520. MutationObserver.record({
  2521. target: this,
  2522. type: "attributes",
  2523. attributeName: qualifiedName,
  2524. oldValue: this.getAttribute(qualifiedName)
  2525. });
  2526. }
  2527. switch(qualifiedName){
  2528. case STYLE:
  2529. this.style.cssText = value;
  2530. break;
  2531. case ID:
  2532. if (this.uid !== this.sid) {
  2533. eventSource.delete(this.uid);
  2534. }
  2535. value = String(value);
  2536. this.props[qualifiedName] = this.uid = value;
  2537. eventSource.set(value, this);
  2538. break;
  2539. default:
  2540. this.props[qualifiedName] = value;
  2541. if (qualifiedName.startsWith("data-")) {
  2542. if (this.dataset === _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ) {
  2543. this.dataset = /* @__PURE__ */ Object.create(null);
  2544. }
  2545. this.dataset[(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName.replace(/^data-/, ""))] = value;
  2546. }
  2547. break;
  2548. }
  2549. if (!this._root) return;
  2550. const componentsAlias2 = getComponentsAlias2();
  2551. const _alias = componentsAlias2[this.nodeName];
  2552. const viewAlias = componentsAlias2[VIEW]._num;
  2553. const staticViewAlias = componentsAlias2[STATIC_VIEW]._num;
  2554. const catchViewAlias = componentsAlias2[CATCH_VIEW]._num;
  2555. const _path = this._path;
  2556. qualifiedName = shortcutAttr(qualifiedName);
  2557. const qualifiedNameInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName);
  2558. const payload = {
  2559. path: `${_path}.${qualifiedNameInCamelCase}`,
  2560. value: (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value) ? ()=>value : value
  2561. };
  2562. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifySetAttrPayload", this, qualifiedName, payload, componentsAlias2);
  2563. if (_alias) {
  2564. const qualifiedNameAlias = _alias[qualifiedNameInCamelCase] || qualifiedName;
  2565. payload.path = `${_path}.${(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedNameAlias)}`;
  2566. }
  2567. this.enqueueUpdate(payload);
  2568. if (this.nodeName === VIEW) {
  2569. if (qualifiedNameInCamelCase === CATCHMOVE) {
  2570. this.enqueueUpdate({
  2571. path: `${_path}.${"nn"}`,
  2572. value: value ? catchViewAlias : this.isAnyEventBinded() ? viewAlias : staticViewAlias
  2573. });
  2574. } else if (isPureView && isHasExtractProp(this)) {
  2575. this.enqueueUpdate({
  2576. path: `${_path}.${"nn"}`,
  2577. value: staticViewAlias
  2578. });
  2579. }
  2580. }
  2581. }
  2582. removeAttribute(qualifiedName) {
  2583. const isStaticView = this.nodeName === VIEW && isHasExtractProp(this) && !this.isAnyEventBinded();
  2584. MutationObserver.record({
  2585. target: this,
  2586. type: "attributes",
  2587. attributeName: qualifiedName,
  2588. oldValue: this.getAttribute(qualifiedName)
  2589. });
  2590. if (qualifiedName === STYLE) {
  2591. this.style.cssText = "";
  2592. } else {
  2593. const isInterrupt = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("onRemoveAttribute", this, qualifiedName);
  2594. if (isInterrupt) {
  2595. return;
  2596. }
  2597. if (!this.props.hasOwnProperty(qualifiedName)) {
  2598. return;
  2599. }
  2600. delete this.props[qualifiedName];
  2601. }
  2602. if (!this._root) return;
  2603. const componentsAlias2 = getComponentsAlias2();
  2604. const _alias = componentsAlias2[this.nodeName];
  2605. const viewAlias = componentsAlias2[VIEW]._num;
  2606. const staticViewAlias = componentsAlias2[STATIC_VIEW]._num;
  2607. const pureViewAlias = componentsAlias2[PURE_VIEW]._num;
  2608. const _path = this._path;
  2609. qualifiedName = shortcutAttr(qualifiedName);
  2610. const qualifiedNameInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName);
  2611. const payload = {
  2612. path: `${_path}.${qualifiedNameInCamelCase}`,
  2613. value: ""
  2614. };
  2615. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyRmAttrPayload", this, qualifiedName, payload, componentsAlias2);
  2616. if (_alias) {
  2617. const qualifiedNameAlias = _alias[qualifiedNameInCamelCase] || qualifiedName;
  2618. payload.path = `${_path}.${(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedNameAlias)}`;
  2619. }
  2620. this.enqueueUpdate(payload);
  2621. if (this.nodeName === VIEW) {
  2622. if (qualifiedNameInCamelCase === CATCHMOVE) {
  2623. this.enqueueUpdate({
  2624. path: `${_path}.${"nn"}`,
  2625. value: this.isAnyEventBinded() ? viewAlias : isHasExtractProp(this) ? staticViewAlias : pureViewAlias
  2626. });
  2627. } else if (isStaticView && !isHasExtractProp(this)) {
  2628. this.enqueueUpdate({
  2629. path: `${_path}.${"nn"}`,
  2630. value: pureViewAlias
  2631. });
  2632. }
  2633. }
  2634. }
  2635. getAttribute(qualifiedName) {
  2636. const attr = qualifiedName === STYLE ? this.style.cssText : this.props[qualifiedName];
  2637. return attr !== null && attr !== void 0 ? attr : "";
  2638. }
  2639. getElementsByTagName(tagName) {
  2640. return treeToArray(this, (el)=>{
  2641. return el.nodeName === tagName || tagName === "*" && this !== el;
  2642. });
  2643. }
  2644. getElementsByClassName(className) {
  2645. const classNames = className.trim().split(/\s+/);
  2646. return treeToArray(this, (el)=>{
  2647. const classList = el.classList;
  2648. return classNames.every((c)=>classList.contains(c));
  2649. });
  2650. }
  2651. dispatchEvent(event) {
  2652. const cancelable = event.cancelable;
  2653. const listeners = this.__handlers[event.type];
  2654. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(listeners)) {
  2655. return false;
  2656. }
  2657. for(let i = listeners.length; i--;){
  2658. const listener = listeners[i];
  2659. let result;
  2660. if (listener._stop) {
  2661. listener._stop = false;
  2662. } else {
  2663. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyDispatchEvent", event, this);
  2664. result = listener.call(this, event);
  2665. }
  2666. if ((result === false || event._end) && cancelable) {
  2667. event.defaultPrevented = true;
  2668. }
  2669. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(result) && event.mpEvent) {
  2670. event.mpEvent[EVENT_CALLBACK_RESULT] = result;
  2671. }
  2672. if (event._end && event._stop) {
  2673. break;
  2674. }
  2675. }
  2676. if (event._stop) {
  2677. this._stopPropagation(event);
  2678. } else {
  2679. event._stop = true;
  2680. }
  2681. return listeners != null;
  2682. }
  2683. addEventListener(type, handler, options2) {
  2684. const name = this.nodeName;
  2685. const SPECIAL_NODES2 = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
  2686. let sideEffect = true;
  2687. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(options2) && options2.sideEffect === false) {
  2688. sideEffect = false;
  2689. delete options2.sideEffect;
  2690. }
  2691. if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES2.indexOf(name) > -1) {
  2692. const componentsAlias2 = getComponentsAlias2();
  2693. const alias = componentsAlias2[name]._num;
  2694. this.enqueueUpdate({
  2695. path: `${this._path}.${"nn"}`,
  2696. value: alias
  2697. });
  2698. }
  2699. super.addEventListener(type, handler, options2);
  2700. }
  2701. removeEventListener(type, handler, sideEffect = true) {
  2702. super.removeEventListener(type, handler);
  2703. const name = this.nodeName;
  2704. const SPECIAL_NODES2 = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
  2705. if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES2.indexOf(name) > -1) {
  2706. const componentsAlias2 = getComponentsAlias2();
  2707. const value = isHasExtractProp(this) ? `static-${name}` : `pure-${name}`;
  2708. const valueAlias = componentsAlias2[value]._num;
  2709. this.enqueueUpdate({
  2710. path: `${this._path}.${"nn"}`,
  2711. value: valueAlias
  2712. });
  2713. }
  2714. }
  2715. static extend(methodName, options2) {
  2716. extend(TaroElement, methodName, options2);
  2717. }
  2718. constructor(){
  2719. super();
  2720. this.props = {};
  2721. this.dataset = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
  2722. this.nodeType = 1;
  2723. this.style = new Style(this);
  2724. _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("patchElement", this);
  2725. }
  2726. };
  2727. options = {
  2728. prerender: true,
  2729. debug: false
  2730. };
  2731. whitespace = /\s/;
  2732. equalSign = /=/;
  2733. alphanumeric = /[A-Za-z0-9]/;
  2734. Scaner = class {
  2735. scan() {
  2736. const { html , position } = this;
  2737. const len = html.length;
  2738. while(position.index < len){
  2739. const start = position.index;
  2740. this.scanText();
  2741. if (position.index === start) {
  2742. const isComment2 = html.startsWith("!--", start + 1);
  2743. if (isComment2) {
  2744. this.scanComment();
  2745. } else {
  2746. const tagName = this.scanTag();
  2747. if (shouldBeIgnore(tagName)) {
  2748. this.scanSkipTag(tagName);
  2749. }
  2750. }
  2751. }
  2752. }
  2753. return this.tokens;
  2754. }
  2755. scanText() {
  2756. const type = "text";
  2757. const { html , position } = this;
  2758. let textEnd = findTextEnd(html, position.index);
  2759. if (textEnd === position.index) {
  2760. return;
  2761. }
  2762. if (textEnd === -1) {
  2763. textEnd = html.length;
  2764. }
  2765. const start = copyPosition(position);
  2766. const content = html.slice(position.index, textEnd);
  2767. jumpPosition(position, html, textEnd);
  2768. const end = copyPosition(position);
  2769. this.tokens.push({
  2770. type,
  2771. content,
  2772. position: {
  2773. start,
  2774. end
  2775. }
  2776. });
  2777. }
  2778. scanComment() {
  2779. const type = "comment";
  2780. const { html , position } = this;
  2781. const start = copyPosition(position);
  2782. feedPosition(position, html, 4);
  2783. let contentEnd = html.indexOf("-->", position.index);
  2784. let commentEnd = contentEnd + 3;
  2785. if (contentEnd === -1) {
  2786. contentEnd = commentEnd = html.length;
  2787. }
  2788. const content = html.slice(position.index, contentEnd);
  2789. jumpPosition(position, html, commentEnd);
  2790. this.tokens.push({
  2791. type,
  2792. content,
  2793. position: {
  2794. start,
  2795. end: copyPosition(position)
  2796. }
  2797. });
  2798. }
  2799. scanTag() {
  2800. this.scanTagStart();
  2801. const tagName = this.scanTagName();
  2802. this.scanAttrs();
  2803. this.scanTagEnd();
  2804. return tagName;
  2805. }
  2806. scanTagStart() {
  2807. const type = "tag-start";
  2808. const { html , position } = this;
  2809. const secondChar = html.charAt(position.index + 1);
  2810. const close = secondChar === "/";
  2811. const start = copyPosition(position);
  2812. feedPosition(position, html, close ? 2 : 1);
  2813. this.tokens.push({
  2814. type,
  2815. close,
  2816. position: {
  2817. start
  2818. }
  2819. });
  2820. }
  2821. scanTagEnd() {
  2822. const type = "tag-end";
  2823. const { html , position } = this;
  2824. const firstChar = html.charAt(position.index);
  2825. const close = firstChar === "/";
  2826. feedPosition(position, html, close ? 2 : 1);
  2827. const end = copyPosition(position);
  2828. this.tokens.push({
  2829. type,
  2830. close,
  2831. position: {
  2832. end
  2833. }
  2834. });
  2835. }
  2836. scanTagName() {
  2837. const type = "tag";
  2838. const { html , position } = this;
  2839. const len = html.length;
  2840. let start = position.index;
  2841. while(start < len){
  2842. const char = html.charAt(start);
  2843. const isTagChar = !(isWhitespaceChar(char) || char === "/" || char === ">");
  2844. if (isTagChar) break;
  2845. start++;
  2846. }
  2847. let end = start + 1;
  2848. while(end < len){
  2849. const char1 = html.charAt(end);
  2850. const isTagChar1 = !(isWhitespaceChar(char1) || char1 === "/" || char1 === ">");
  2851. if (!isTagChar1) break;
  2852. end++;
  2853. }
  2854. jumpPosition(position, html, end);
  2855. const tagName = html.slice(start, end);
  2856. this.tokens.push({
  2857. type,
  2858. content: tagName
  2859. });
  2860. return tagName;
  2861. }
  2862. scanAttrs() {
  2863. const { html , position , tokens } = this;
  2864. let cursor = position.index;
  2865. let quote = null;
  2866. let wordBegin = cursor;
  2867. const words = [];
  2868. const len = html.length;
  2869. while(cursor < len){
  2870. const char = html.charAt(cursor);
  2871. if (quote) {
  2872. const isQuoteEnd = char === quote;
  2873. if (isQuoteEnd) {
  2874. quote = null;
  2875. }
  2876. cursor++;
  2877. continue;
  2878. }
  2879. const isTagEnd = char === "/" || char === ">";
  2880. if (isTagEnd) {
  2881. if (cursor !== wordBegin) {
  2882. words.push(html.slice(wordBegin, cursor));
  2883. }
  2884. break;
  2885. }
  2886. if (isWordEnd(cursor, wordBegin, html)) {
  2887. if (cursor !== wordBegin) {
  2888. words.push(html.slice(wordBegin, cursor));
  2889. }
  2890. wordBegin = cursor + 1;
  2891. cursor++;
  2892. continue;
  2893. }
  2894. const isQuoteStart = char === "'" || char === '"';
  2895. if (isQuoteStart) {
  2896. quote = char;
  2897. cursor++;
  2898. continue;
  2899. }
  2900. cursor++;
  2901. }
  2902. jumpPosition(position, html, cursor);
  2903. const wLen = words.length;
  2904. const type = "attribute";
  2905. for(let i = 0; i < wLen; i++){
  2906. const word = words[i];
  2907. const isNotPair = word.includes("=");
  2908. if (isNotPair) {
  2909. const secondWord = words[i + 1];
  2910. if (secondWord && secondWord.startsWith("=")) {
  2911. if (secondWord.length > 1) {
  2912. const newWord = word + secondWord;
  2913. tokens.push({
  2914. type,
  2915. content: newWord
  2916. });
  2917. i += 1;
  2918. continue;
  2919. }
  2920. const thirdWord = words[i + 2];
  2921. i += 1;
  2922. if (thirdWord) {
  2923. const newWord1 = word + "=" + thirdWord;
  2924. tokens.push({
  2925. type,
  2926. content: newWord1
  2927. });
  2928. i += 1;
  2929. continue;
  2930. }
  2931. }
  2932. }
  2933. if (word.endsWith("=")) {
  2934. const secondWord1 = words[i + 1];
  2935. if (secondWord1 && !secondWord1.includes("=")) {
  2936. const newWord2 = word + secondWord1;
  2937. tokens.push({
  2938. type,
  2939. content: newWord2
  2940. });
  2941. i += 1;
  2942. continue;
  2943. }
  2944. const newWord3 = word.slice(0, -1);
  2945. tokens.push({
  2946. type,
  2947. content: newWord3
  2948. });
  2949. continue;
  2950. }
  2951. tokens.push({
  2952. type,
  2953. content: word
  2954. });
  2955. }
  2956. }
  2957. scanSkipTag(tagName) {
  2958. const { html , position } = this;
  2959. const safeTagName = tagName.toLowerCase();
  2960. const len = html.length;
  2961. while(position.index < len){
  2962. const nextTag = html.indexOf("</", position.index);
  2963. if (nextTag === -1) {
  2964. this.scanText();
  2965. break;
  2966. }
  2967. jumpPosition(position, html, nextTag);
  2968. const name = this.scanTag();
  2969. if (safeTagName === name.toLowerCase()) {
  2970. break;
  2971. }
  2972. }
  2973. }
  2974. constructor(html){
  2975. this.tokens = [];
  2976. this.position = initPosition();
  2977. this.html = html;
  2978. }
  2979. };
  2980. LEFT_BRACKET = "{";
  2981. RIGHT_BRACKET = "}";
  2982. CLASS_SELECTOR = ".";
  2983. ID_SELECTOR = "#";
  2984. CHILD_COMBINATOR = ">";
  2985. GENERAL_SIBLING_COMBINATOR = "~";
  2986. ADJACENT_SIBLING_COMBINATOR = "+";
  2987. StyleTagParser = class {
  2988. extractStyle(src) {
  2989. const REG_STYLE = /<style\s?[^>]*>((.|\n|\s)+?)<\/style>/g;
  2990. let html = src;
  2991. html = html.replace(REG_STYLE, (_, $1)=>{
  2992. const style2 = $1.trim();
  2993. this.stringToSelector(style2);
  2994. return "";
  2995. });
  2996. return html.trim();
  2997. }
  2998. stringToSelector(style2) {
  2999. let lb = style2.indexOf(LEFT_BRACKET);
  3000. while(lb > -1){
  3001. const rb = style2.indexOf(RIGHT_BRACKET);
  3002. const selectors = style2.slice(0, lb).trim();
  3003. let content = style2.slice(lb + 1, rb);
  3004. content = content.replace(/:(.*);/g, function(_, $1) {
  3005. const t = $1.trim().replace(/ +/g, "+++");
  3006. return `:${t};`;
  3007. });
  3008. content = content.replace(/ /g, "");
  3009. content = content.replace(/\+\+\+/g, " ");
  3010. if (!/;$/.test(content)) {
  3011. content += ";";
  3012. }
  3013. selectors.split(",").forEach((src)=>{
  3014. const selectorList = this.parseSelector(src);
  3015. this.styles.push({
  3016. content,
  3017. selectorList
  3018. });
  3019. });
  3020. style2 = style2.slice(rb + 1);
  3021. lb = style2.indexOf(LEFT_BRACKET);
  3022. }
  3023. }
  3024. parseSelector(src) {
  3025. const list = src.trim().replace(/ *([>~+]) */g, " $1").replace(/ +/g, " ").replace(/\[\s*([^[\]=\s]+)\s*=\s*([^[\]=\s]+)\s*\]/g, "[$1=$2]").split(" ");
  3026. const selectors = list.map((item)=>{
  3027. const firstChar = item.charAt(0);
  3028. const selector = {
  3029. isChild: firstChar === CHILD_COMBINATOR,
  3030. isGeneralSibling: firstChar === GENERAL_SIBLING_COMBINATOR,
  3031. isAdjacentSibling: firstChar === ADJACENT_SIBLING_COMBINATOR,
  3032. tag: null,
  3033. id: null,
  3034. class: [],
  3035. attrs: []
  3036. };
  3037. item = item.replace(/^[>~+]/, "");
  3038. item = item.replace(/\[(.+?)\]/g, function(_, $1) {
  3039. const [key, value] = $1.split("=");
  3040. const all = $1.indexOf("=") === -1;
  3041. const attr = {
  3042. all,
  3043. key,
  3044. value: all ? null : value
  3045. };
  3046. selector.attrs.push(attr);
  3047. return "";
  3048. });
  3049. item = item.replace(/([.#][A-Za-z0-9-_]+)/g, function(_, $1) {
  3050. if ($1[0] === ID_SELECTOR) {
  3051. selector.id = $1.substr(1);
  3052. } else if ($1[0] === CLASS_SELECTOR) {
  3053. selector.class.push($1.substr(1));
  3054. }
  3055. return "";
  3056. });
  3057. if (item !== "") {
  3058. selector.tag = item;
  3059. }
  3060. return selector;
  3061. });
  3062. return selectors;
  3063. }
  3064. matchStyle(tagName, el, list) {
  3065. const res = sortStyles(this.styles).reduce((str, { content , selectorList }, i)=>{
  3066. let idx = list[i];
  3067. let selector = selectorList[idx];
  3068. const nextSelector = selectorList[idx + 1];
  3069. if ((nextSelector === null || nextSelector === void 0 ? void 0 : nextSelector.isGeneralSibling) || (nextSelector === null || nextSelector === void 0 ? void 0 : nextSelector.isAdjacentSibling)) {
  3070. selector = nextSelector;
  3071. idx += 1;
  3072. list[i] += 1;
  3073. }
  3074. let isMatch = this.matchCurrent(tagName, el, selector);
  3075. if (isMatch && selector.isGeneralSibling) {
  3076. let prev = getPreviousElement(el);
  3077. while(prev){
  3078. if (prev.h5tagName && this.matchCurrent(prev.h5tagName, prev, selectorList[idx - 1])) {
  3079. isMatch = true;
  3080. break;
  3081. }
  3082. prev = getPreviousElement(prev);
  3083. isMatch = false;
  3084. }
  3085. }
  3086. if (isMatch && selector.isAdjacentSibling) {
  3087. const prev1 = getPreviousElement(el);
  3088. if (!prev1 || !prev1.h5tagName) {
  3089. isMatch = false;
  3090. } else {
  3091. const isSiblingMatch = this.matchCurrent(prev1.h5tagName, prev1, selectorList[idx - 1]);
  3092. if (!isSiblingMatch) {
  3093. isMatch = false;
  3094. }
  3095. }
  3096. }
  3097. if (isMatch) {
  3098. if (idx === selectorList.length - 1) {
  3099. return str + content;
  3100. } else if (idx < selectorList.length - 1) {
  3101. list[i] += 1;
  3102. }
  3103. } else {
  3104. if (selector.isChild && idx > 0) {
  3105. list[i] -= 1;
  3106. if (this.matchCurrent(tagName, el, selectorList[list[i]])) {
  3107. list[i] += 1;
  3108. }
  3109. }
  3110. }
  3111. return str;
  3112. }, "");
  3113. return res;
  3114. }
  3115. matchCurrent(tagName, el, selector) {
  3116. if (selector.tag && selector.tag !== tagName) return false;
  3117. if (selector.id && selector.id !== el.id) return false;
  3118. if (selector.class.length) {
  3119. const classList = el.className.split(" ");
  3120. for(let i = 0; i < selector.class.length; i++){
  3121. const cls = selector.class[i];
  3122. if (classList.indexOf(cls) === -1) {
  3123. return false;
  3124. }
  3125. }
  3126. }
  3127. if (selector.attrs.length) {
  3128. for(let i1 = 0; i1 < selector.attrs.length; i1++){
  3129. const { all , key , value } = selector.attrs[i1];
  3130. if (all && !el.hasAttribute(key)) {
  3131. return false;
  3132. } else {
  3133. const attr = el.getAttribute(key);
  3134. if (attr !== unquote(value || "")) {
  3135. return false;
  3136. }
  3137. }
  3138. }
  3139. }
  3140. return true;
  3141. }
  3142. constructor(){
  3143. this.styles = [];
  3144. }
  3145. };
  3146. specialMiniElements = {
  3147. img: "image",
  3148. iframe: "web-view"
  3149. };
  3150. internalCompsList = Object.keys(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents).map((i)=>i.toLowerCase()).join(",");
  3151. isMiniElements = makeMap(internalCompsList, true);
  3152. isInlineElements = makeMap("a,i,abbr,iframe,select,acronym,slot,small,span,bdi,kbd,strong,big,map,sub,sup,br,mark,mark,meter,template,canvas,textarea,cite,object,time,code,output,u,data,picture,tt,datalist,var,dfn,del,q,em,s,embed,samp,b", true);
  3153. isBlockElements = makeMap("address,fieldset,li,article,figcaption,main,aside,figure,nav,blockquote,footer,ol,details,form,p,dialog,h1,h2,h3,h4,h5,h6,pre,dd,header,section,div,hgroup,table,dl,hr,ul,dt", true);
  3154. closingTagAncestorBreakers = {
  3155. li: [
  3156. "ul",
  3157. "ol",
  3158. "menu"
  3159. ],
  3160. dt: [
  3161. "dl"
  3162. ],
  3163. dd: [
  3164. "dl"
  3165. ],
  3166. tbody: [
  3167. "table"
  3168. ],
  3169. thead: [
  3170. "table"
  3171. ],
  3172. tfoot: [
  3173. "table"
  3174. ],
  3175. tr: [
  3176. "table"
  3177. ],
  3178. td: [
  3179. "table"
  3180. ]
  3181. };
  3182. options.html = {
  3183. skipElements: /* @__PURE__ */ new Set([
  3184. "style",
  3185. "script"
  3186. ]),
  3187. voidElements: /* @__PURE__ */ new Set([
  3188. "!doctype",
  3189. "area",
  3190. "base",
  3191. "br",
  3192. "col",
  3193. "command",
  3194. "embed",
  3195. "hr",
  3196. "img",
  3197. "input",
  3198. "keygen",
  3199. "link",
  3200. "meta",
  3201. "param",
  3202. "source",
  3203. "track",
  3204. "wbr"
  3205. ]),
  3206. closingElements: /* @__PURE__ */ new Set([
  3207. "html",
  3208. "head",
  3209. "body",
  3210. "p",
  3211. "dt",
  3212. "dd",
  3213. "li",
  3214. "option",
  3215. "thead",
  3216. "th",
  3217. "tbody",
  3218. "tr",
  3219. "td",
  3220. "tfoot",
  3221. "colgroup"
  3222. ]),
  3223. renderHTMLTag: false
  3224. };
  3225. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
  3226. if (true) {
  3227. TaroNode.extend("innerHTML", {
  3228. set (html) {
  3229. setInnerHTML.call(this, this, html);
  3230. },
  3231. get () {
  3232. return "";
  3233. }
  3234. });
  3235. if (false) {}
  3236. }
  3237. if (false) {}
  3238. if (false) {}
  3239. if (false) {}
  3240. if (false) {}
  3241. }
  3242. TaroEvent = class {
  3243. stopPropagation() {
  3244. this._stop = true;
  3245. }
  3246. stopImmediatePropagation() {
  3247. this._end = this._stop = true;
  3248. }
  3249. preventDefault() {
  3250. this.defaultPrevented = true;
  3251. }
  3252. get target() {
  3253. var _a, _b, _c;
  3254. const cacheTarget = this.cacheTarget;
  3255. if (!cacheTarget) {
  3256. const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
  3257. const element = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
  3258. target.dataset = element !== null ? element.dataset : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
  3259. for(const key in (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.detail){
  3260. target[key] = this.mpEvent.detail[key];
  3261. }
  3262. this.cacheTarget = target;
  3263. return target;
  3264. } else {
  3265. return cacheTarget;
  3266. }
  3267. }
  3268. get currentTarget() {
  3269. var _a, _b, _c, _d, _e, _f, _g, _h;
  3270. const cacheCurrentTarget = this.cacheCurrentTarget;
  3271. if (!cacheCurrentTarget) {
  3272. const doc = env.document;
  3273. const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
  3274. const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b.sid) || currentTarget.id || null);
  3275. const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e.sid) || ((_g = (_f = this.mpEvent) === null || _f === void 0 ? void 0 : _f.target) === null || _g === void 0 ? void 0 : _g.id) || null);
  3276. if (element === null || element && element === targetElement) {
  3277. this.cacheCurrentTarget = this.target;
  3278. return this.target;
  3279. }
  3280. currentTarget.dataset = element.dataset;
  3281. for(const key in (_h = this.mpEvent) === null || _h === void 0 ? void 0 : _h.detail){
  3282. currentTarget[key] = this.mpEvent.detail[key];
  3283. }
  3284. this.cacheCurrentTarget = currentTarget;
  3285. return currentTarget;
  3286. } else {
  3287. return cacheCurrentTarget;
  3288. }
  3289. }
  3290. constructor(type, opts, event){
  3291. this._stop = false;
  3292. this._end = false;
  3293. this.defaultPrevented = false;
  3294. this.button = 0;
  3295. this.timeStamp = Date.now();
  3296. this.type = type.toLowerCase();
  3297. this.mpEvent = event;
  3298. this.bubbles = Boolean(opts && opts.bubbles);
  3299. this.cancelable = Boolean(opts && opts.cancelable);
  3300. }
  3301. };
  3302. eventsBatch = {};
  3303. FormElement = class extends TaroElement {
  3304. get type() {
  3305. var _a;
  3306. return (_a = this.props[TYPE]) !== null && _a !== void 0 ? _a : "";
  3307. }
  3308. set type(val) {
  3309. this.setAttribute(TYPE, val);
  3310. }
  3311. get value() {
  3312. const val = this.props[VALUE];
  3313. return val == null ? "" : val;
  3314. }
  3315. set value(val) {
  3316. this.setAttribute(VALUE, val);
  3317. }
  3318. dispatchEvent(event) {
  3319. if (event.mpEvent) {
  3320. const val = event.mpEvent.detail.value;
  3321. if (event.type === CHANGE) {
  3322. this.props.value = val;
  3323. } else if (event.type === INPUT) {
  3324. this.value = val;
  3325. }
  3326. }
  3327. return super.dispatchEvent(event);
  3328. }
  3329. };
  3330. Performance = class {
  3331. start(id) {
  3332. if (!options.debug) {
  3333. return;
  3334. }
  3335. this.recorder.set(id, Date.now());
  3336. }
  3337. stop(id) {
  3338. if (!options.debug) {
  3339. return;
  3340. }
  3341. const now2 = Date.now();
  3342. const prev = this.recorder.get(id);
  3343. this.recorder.delete(id);
  3344. const time = now2 - prev;
  3345. console.log(`${id} \u65F6\u957F\uFF1A ${time}ms`);
  3346. }
  3347. constructor(){
  3348. this.recorder = /* @__PURE__ */ new Map();
  3349. }
  3350. };
  3351. perf = new Performance();
  3352. TaroRootElement = class extends TaroElement {
  3353. get _path() {
  3354. return ROOT_STR;
  3355. }
  3356. get _root() {
  3357. return this;
  3358. }
  3359. enqueueUpdate(payload) {
  3360. this.updatePayloads.push(payload);
  3361. if (!this.pendingUpdate && this.ctx) {
  3362. this.performUpdate();
  3363. }
  3364. }
  3365. performUpdate(initRender = false, prerender) {
  3366. this.pendingUpdate = true;
  3367. const ctx = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("proxyToRaw", this.ctx);
  3368. setTimeout(()=>{
  3369. const setDataMark = `${SET_DATA} \u5F00\u59CB\u65F6\u95F4\u6233 ${Date.now()}`;
  3370. perf.start(setDataMark);
  3371. const data = /* @__PURE__ */ Object.create(null);
  3372. const resetPaths = new Set(initRender ? [
  3373. "root.cn.[0]",
  3374. "root.cn[0]"
  3375. ] : []);
  3376. while(this.updatePayloads.length > 0){
  3377. const { path , value } = this.updatePayloads.shift();
  3378. if (path.endsWith("cn")) {
  3379. resetPaths.add(path);
  3380. }
  3381. data[path] = value;
  3382. }
  3383. for(const path1 in data){
  3384. resetPaths.forEach((p)=>{
  3385. if (path1.includes(p) && path1 !== p) {
  3386. delete data[path1];
  3387. }
  3388. });
  3389. const value1 = data[path1];
  3390. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value1)) {
  3391. data[path1] = value1();
  3392. }
  3393. }
  3394. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(prerender)) return prerender(data);
  3395. this.pendingUpdate = false;
  3396. let normalUpdate = {};
  3397. const customWrapperMap = /* @__PURE__ */ new Map();
  3398. if (initRender) {
  3399. normalUpdate = data;
  3400. } else {
  3401. for(const p in data){
  3402. const dataPathArr = p.split(".");
  3403. const found = findCustomWrapper(this, dataPathArr);
  3404. if (found) {
  3405. const { customWrapper , splitedPath } = found;
  3406. customWrapperMap.set(customWrapper, Object.assign(Object.assign({}, customWrapperMap.get(customWrapper) || {}), {
  3407. [`i.${splitedPath}`]: data[p]
  3408. }));
  3409. } else {
  3410. normalUpdate[p] = data[p];
  3411. }
  3412. }
  3413. }
  3414. const customWrapperCount = customWrapperMap.size;
  3415. const isNeedNormalUpdate = Object.keys(normalUpdate).length > 0;
  3416. const updateArrLen = customWrapperCount + (isNeedNormalUpdate ? 1 : 0);
  3417. let executeTime = 0;
  3418. const cb = ()=>{
  3419. if (++executeTime === updateArrLen) {
  3420. perf.stop(setDataMark);
  3421. this.flushUpdateCallback();
  3422. initRender && perf.stop(PAGE_INIT);
  3423. }
  3424. };
  3425. if (customWrapperCount) {
  3426. customWrapperMap.forEach((data2, ctx2)=>{
  3427. if (options.debug) {
  3428. console.log("custom wrapper setData: ", data2);
  3429. }
  3430. ctx2.setData(data2, cb);
  3431. });
  3432. }
  3433. if (isNeedNormalUpdate) {
  3434. if (options.debug) {
  3435. console.log("page setData:", normalUpdate);
  3436. }
  3437. ctx.setData(normalUpdate, cb);
  3438. }
  3439. }, 0);
  3440. }
  3441. enqueueUpdateCallback(cb, ctx) {
  3442. this.updateCallbacks.push(()=>{
  3443. ctx ? cb.call(ctx) : cb();
  3444. });
  3445. }
  3446. flushUpdateCallback() {
  3447. const updateCallbacks = this.updateCallbacks;
  3448. if (!updateCallbacks.length) return;
  3449. const copies = updateCallbacks.slice(0);
  3450. this.updateCallbacks.length = 0;
  3451. for(let i = 0; i < copies.length; i++){
  3452. copies[i]();
  3453. }
  3454. }
  3455. constructor(){
  3456. super();
  3457. this.updatePayloads = [];
  3458. this.updateCallbacks = [];
  3459. this.pendingUpdate = false;
  3460. this.ctx = null;
  3461. this.nodeName = ROOT_STR;
  3462. this.tagName = ROOT_STR.toUpperCase();
  3463. }
  3464. };
  3465. TaroText = class extends TaroNode {
  3466. set textContent(text) {
  3467. MutationObserver.record({
  3468. target: this,
  3469. type: "characterData",
  3470. oldValue: this._value
  3471. });
  3472. this._value = text;
  3473. this.enqueueUpdate({
  3474. path: `${this._path}.${"v"}`,
  3475. value: text
  3476. });
  3477. }
  3478. get textContent() {
  3479. return this._value;
  3480. }
  3481. set nodeValue(text) {
  3482. this.textContent = text;
  3483. }
  3484. get nodeValue() {
  3485. return this._value;
  3486. }
  3487. set data(text) {
  3488. this.textContent = text;
  3489. }
  3490. get data() {
  3491. return this._value;
  3492. }
  3493. constructor(value){
  3494. super();
  3495. this.nodeType = 3;
  3496. this.nodeName = "#text";
  3497. this._value = value;
  3498. }
  3499. };
  3500. findReg = /[!'()~]|%20|%00/g;
  3501. plusReg = /\+/g;
  3502. replaceCharMap = {
  3503. "!": "%21",
  3504. "'": "%27",
  3505. "(": "%28",
  3506. ")": "%29",
  3507. "~": "%7E",
  3508. "%20": "+",
  3509. "%00": "\0"
  3510. };
  3511. URLSearchParams = class {
  3512. append(name, value) {
  3513. appendTo(__classPrivateFieldGet(this, _URLSearchParams_dict, "f"), name, value);
  3514. }
  3515. delete(name) {
  3516. delete __classPrivateFieldGet(this, _URLSearchParams_dict, "f")[name];
  3517. }
  3518. get(name) {
  3519. const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3520. return name in dict ? dict[name][0] : null;
  3521. }
  3522. getAll(name) {
  3523. const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3524. return name in dict ? dict[name].slice(0) : [];
  3525. }
  3526. has(name) {
  3527. return name in __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3528. }
  3529. keys() {
  3530. return Object.keys(__classPrivateFieldGet(this, _URLSearchParams_dict, "f"));
  3531. }
  3532. set(name, value) {
  3533. __classPrivateFieldGet(this, _URLSearchParams_dict, "f")[name] = [
  3534. "" + value
  3535. ];
  3536. }
  3537. forEach(callback, thisArg) {
  3538. const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3539. Object.getOwnPropertyNames(dict).forEach(function(name) {
  3540. dict[name].forEach(function(value) {
  3541. callback.call(thisArg, value, name, this);
  3542. }, this);
  3543. }, this);
  3544. }
  3545. toJSON() {
  3546. return {};
  3547. }
  3548. toString() {
  3549. const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3550. const query = [];
  3551. for(const key in dict){
  3552. const name = encode(key);
  3553. for(let i = 0, value = dict[key]; i < value.length; i++){
  3554. query.push(name + "=" + encode(value[i]));
  3555. }
  3556. }
  3557. return query.join("&");
  3558. }
  3559. constructor(query){
  3560. _URLSearchParams_dict.set(this, /* @__PURE__ */ Object.create(null));
  3561. query !== null && query !== void 0 ? query : query = "";
  3562. const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
  3563. if (typeof query === "string") {
  3564. if (query.charAt(0) === "?") {
  3565. query = query.slice(1);
  3566. }
  3567. for(let pairs = query.split("&"), i = 0, length = pairs.length; i < length; i++){
  3568. const value = pairs[i];
  3569. const index = value.indexOf("=");
  3570. if (index > -1) {
  3571. appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
  3572. } else if (value.length) {
  3573. appendTo(dict, decode(value), "");
  3574. }
  3575. }
  3576. } else {
  3577. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(query)) {
  3578. for(let i1 = 0, length1 = query.length; i1 < length1; i1++){
  3579. const value1 = query[i1];
  3580. appendTo(dict, value1[0], value1[1]);
  3581. }
  3582. } else if (query.forEach) {
  3583. query.forEach(addEach, dict);
  3584. } else {
  3585. for(const key in query){
  3586. appendTo(dict, key, query[key]);
  3587. }
  3588. }
  3589. }
  3590. }
  3591. };
  3592. _URLSearchParams_dict = /* @__PURE__ */ new WeakMap();
  3593. URL = class {
  3594. static createObjectURL() {
  3595. throw new Error("Oops, not support URL.createObjectURL() in miniprogram.");
  3596. }
  3597. static revokeObjectURL() {
  3598. throw new Error("Oops, not support URL.revokeObjectURL() in miniprogram.");
  3599. }
  3600. get protocol() {
  3601. return __classPrivateFieldGet(this, _URL_protocol, "f");
  3602. }
  3603. set protocol(val) {
  3604. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_protocol, val.trim(), "f");
  3605. }
  3606. get host() {
  3607. return this.hostname + (this.port ? ":" + this.port : "");
  3608. }
  3609. set host(val) {
  3610. if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3611. val = val.trim();
  3612. const { hostname , port } = parseUrl(`//${val}`);
  3613. this.hostname = hostname;
  3614. this.port = port;
  3615. }
  3616. }
  3617. get hostname() {
  3618. return __classPrivateFieldGet(this, _URL_hostname, "f");
  3619. }
  3620. set hostname(val) {
  3621. val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_hostname, val.trim(), "f");
  3622. }
  3623. get port() {
  3624. return __classPrivateFieldGet(this, _URL_port, "f");
  3625. }
  3626. set port(val) {
  3627. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_port, val.trim(), "f");
  3628. }
  3629. get pathname() {
  3630. return __classPrivateFieldGet(this, _URL_pathname, "f");
  3631. }
  3632. set pathname(val) {
  3633. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3634. val = val.trim();
  3635. const HEAD_REG = /^(\/|\.\/|\.\.\/)/;
  3636. let temp = val;
  3637. while(HEAD_REG.test(temp)){
  3638. temp = temp.replace(HEAD_REG, "");
  3639. }
  3640. if (temp) __classPrivateFieldSet(this, _URL_pathname, "/" + temp, "f");
  3641. else __classPrivateFieldSet(this, _URL_pathname, "/", "f");
  3642. }
  3643. }
  3644. get search() {
  3645. const val = __classPrivateFieldGet(this, _URL_search, "f").toString();
  3646. return val.length === 0 || val.startsWith("?") ? val : `?${val}`;
  3647. }
  3648. set search(val) {
  3649. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3650. val = val.trim();
  3651. __classPrivateFieldSet(this, _URL_search, new URLSearchParams(val), "f");
  3652. }
  3653. }
  3654. get hash() {
  3655. return __classPrivateFieldGet(this, _URL_hash, "f");
  3656. }
  3657. set hash(val) {
  3658. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3659. val = val.trim();
  3660. if (val) __classPrivateFieldSet(this, _URL_hash, val.startsWith("#") ? val : `#${val}`, "f");
  3661. else __classPrivateFieldSet(this, _URL_hash, "", "f");
  3662. }
  3663. }
  3664. get href() {
  3665. return `${this.protocol}//${this.host}${this.pathname}${this.search}${this.hash}`;
  3666. }
  3667. set href(val) {
  3668. if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3669. val = val.trim();
  3670. const { protocol , hostname , port , hash , search , pathname } = parseUrl(val);
  3671. this.protocol = protocol;
  3672. this.hostname = hostname;
  3673. this.pathname = pathname;
  3674. this.port = port;
  3675. this.hash = hash;
  3676. this.search = search;
  3677. }
  3678. }
  3679. get origin() {
  3680. return `${this.protocol}//${this.host}`;
  3681. }
  3682. set origin(val) {
  3683. if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
  3684. val = val.trim();
  3685. const { protocol , hostname , port } = parseUrl(val);
  3686. this.protocol = protocol;
  3687. this.hostname = hostname;
  3688. this.port = port;
  3689. }
  3690. }
  3691. get searchParams() {
  3692. return __classPrivateFieldGet(this, _URL_search, "f");
  3693. }
  3694. toString() {
  3695. return this.href;
  3696. }
  3697. toJSON() {
  3698. return this.toString();
  3699. }
  3700. _toRaw() {
  3701. return {
  3702. protocol: this.protocol,
  3703. port: this.port,
  3704. host: this.host,
  3705. hostname: this.hostname,
  3706. pathname: this.pathname,
  3707. hash: this.hash,
  3708. search: this.search,
  3709. origin: this.origin,
  3710. href: this.href
  3711. };
  3712. }
  3713. constructor(url, base){
  3714. _URL_hash.set(this, "");
  3715. _URL_hostname.set(this, "");
  3716. _URL_pathname.set(this, "");
  3717. _URL_port.set(this, "");
  3718. _URL_protocol.set(this, "");
  3719. _URL_search.set(this, void 0);
  3720. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) url = String(url);
  3721. const parseResult = parseUrlBase(url, base);
  3722. const { hash , hostname , pathname , port , protocol , search } = parseResult;
  3723. __classPrivateFieldSet(this, _URL_hash, hash, "f");
  3724. __classPrivateFieldSet(this, _URL_hostname, hostname, "f");
  3725. __classPrivateFieldSet(this, _URL_pathname, pathname || "/", "f");
  3726. __classPrivateFieldSet(this, _URL_port, port, "f");
  3727. __classPrivateFieldSet(this, _URL_protocol, protocol, "f");
  3728. __classPrivateFieldSet(this, _URL_search, new URLSearchParams(search), "f");
  3729. }
  3730. };
  3731. _URL_hash = /* @__PURE__ */ new WeakMap(), _URL_hostname = /* @__PURE__ */ new WeakMap(), _URL_pathname = /* @__PURE__ */ new WeakMap(), _URL_port = /* @__PURE__ */ new WeakMap(), _URL_protocol = /* @__PURE__ */ new WeakMap(), _URL_search = /* @__PURE__ */ new WeakMap();
  3732. AnchorElement = class extends TaroElement {
  3733. get href() {
  3734. var _a;
  3735. return (_a = this.props["href"]) !== null && _a !== void 0 ? _a : "";
  3736. }
  3737. set href(val) {
  3738. this.setAttribute("href", val);
  3739. }
  3740. get protocol() {
  3741. var _a;
  3742. return (_a = this.props["protocol"]) !== null && _a !== void 0 ? _a : "";
  3743. }
  3744. get host() {
  3745. var _a;
  3746. return (_a = this.props["host"]) !== null && _a !== void 0 ? _a : "";
  3747. }
  3748. get search() {
  3749. var _a;
  3750. return (_a = this.props["search"]) !== null && _a !== void 0 ? _a : "";
  3751. }
  3752. get hash() {
  3753. var _a;
  3754. return (_a = this.props["hash"]) !== null && _a !== void 0 ? _a : "";
  3755. }
  3756. get hostname() {
  3757. var _a;
  3758. return (_a = this.props["hostname"]) !== null && _a !== void 0 ? _a : "";
  3759. }
  3760. get port() {
  3761. var _a;
  3762. return (_a = this.props["port"]) !== null && _a !== void 0 ? _a : "";
  3763. }
  3764. get pathname() {
  3765. var _a;
  3766. return (_a = this.props["pathname"]) !== null && _a !== void 0 ? _a : "";
  3767. }
  3768. setAttribute(qualifiedName, value) {
  3769. if (qualifiedName === "href") {
  3770. const willSetAttr = parseUrl(value);
  3771. for(const k in willSetAttr){
  3772. super.setAttribute(k, willSetAttr[k]);
  3773. }
  3774. } else {
  3775. super.setAttribute(qualifiedName, value);
  3776. }
  3777. }
  3778. };
  3779. TaroDocument = class extends TaroElement {
  3780. createElement(type) {
  3781. const nodeName = type.toLowerCase();
  3782. let element;
  3783. switch(true){
  3784. case nodeName === ROOT_STR:
  3785. element = new TaroRootElement();
  3786. return element;
  3787. case _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.controlledComponent.has(nodeName):
  3788. element = new FormElement();
  3789. break;
  3790. case nodeName === A:
  3791. element = new AnchorElement();
  3792. break;
  3793. default:
  3794. element = new TaroElement();
  3795. break;
  3796. }
  3797. element.nodeName = nodeName;
  3798. element.tagName = type.toUpperCase();
  3799. return element;
  3800. }
  3801. createElementNS(_svgNS, type) {
  3802. return this.createElement(type);
  3803. }
  3804. createTextNode(text) {
  3805. return new TaroText(text);
  3806. }
  3807. getElementById(id) {
  3808. const el = eventSource.get(id);
  3809. return (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(el) ? null : el;
  3810. }
  3811. querySelector(query) {
  3812. if (/^#/.test(query)) {
  3813. return this.getElementById(query.slice(1));
  3814. }
  3815. return null;
  3816. }
  3817. querySelectorAll() {
  3818. return [];
  3819. }
  3820. createComment() {
  3821. const textnode = new TaroText("");
  3822. textnode.nodeName = COMMENT;
  3823. return textnode;
  3824. }
  3825. get defaultView() {
  3826. return env.window;
  3827. }
  3828. constructor(){
  3829. super();
  3830. this.createEvent = createEvent;
  3831. this.nodeType = 9;
  3832. this.nodeName = DOCUMENT_ELEMENT_NAME;
  3833. }
  3834. };
  3835. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
  3836. let createDocument = function() {
  3837. const doc = new TaroDocument();
  3838. const documentCreateElement = doc.createElement.bind(doc);
  3839. const html = documentCreateElement(HTML);
  3840. const head = documentCreateElement(HEAD);
  3841. const body = documentCreateElement(BODY);
  3842. const app = documentCreateElement(APP);
  3843. app.id = APP;
  3844. const container = documentCreateElement(CONTAINER);
  3845. doc.appendChild(html);
  3846. html.appendChild(head);
  3847. html.appendChild(body);
  3848. body.appendChild(container);
  3849. container.appendChild(app);
  3850. doc.documentElement = html;
  3851. doc.head = head;
  3852. doc.body = body;
  3853. return doc;
  3854. };
  3855. document$1 = env.document = createDocument();
  3856. } else {
  3857. document$1 = env.document;
  3858. }
  3859. eventCenter = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getEventCenter", _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events);
  3860. RuntimeCache = class {
  3861. has(identifier) {
  3862. return this.cache.has(identifier);
  3863. }
  3864. set(identifier, ctx) {
  3865. if (identifier && ctx) {
  3866. this.cache.set(identifier, ctx);
  3867. }
  3868. }
  3869. get(identifier) {
  3870. if (this.has(identifier)) return this.cache.get(identifier);
  3871. }
  3872. delete(identifier) {
  3873. this.cache.delete(identifier);
  3874. }
  3875. constructor(name){
  3876. this.cache = /* @__PURE__ */ new Map();
  3877. this.name = name;
  3878. }
  3879. };
  3880. cache$1 = new RuntimeCache("history");
  3881. History = class extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
  3882. get length() {
  3883. return __classPrivateFieldGet(this, _History_stack, "f").length;
  3884. }
  3885. get state() {
  3886. return __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")].state;
  3887. }
  3888. go(delta) {
  3889. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(delta) || isNaN(delta)) return;
  3890. let targetIdx = __classPrivateFieldGet(this, _History_cur, "f") + delta;
  3891. targetIdx = Math.min(Math.max(targetIdx, 0), this.length - 1);
  3892. __classPrivateFieldSet(this, _History_cur, targetIdx, "f");
  3893. __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")].url);
  3894. __classPrivateFieldGet(this, _History_window, "f").trigger("popstate", __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")]);
  3895. }
  3896. back() {
  3897. this.go(-1);
  3898. }
  3899. forward() {
  3900. this.go(1);
  3901. }
  3902. pushState(state, title, url) {
  3903. if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return;
  3904. __classPrivateFieldSet(this, _History_stack, __classPrivateFieldGet(this, _History_stack, "f").slice(0, __classPrivateFieldGet(this, _History_cur, "f") + 1), "f");
  3905. __classPrivateFieldGet(this, _History_stack, "f").push({
  3906. state,
  3907. title,
  3908. url
  3909. });
  3910. __classPrivateFieldSet(this, _History_cur, this.length - 1, "f");
  3911. __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", url);
  3912. }
  3913. replaceState(state, title, url) {
  3914. if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return;
  3915. __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")] = {
  3916. state,
  3917. title,
  3918. url
  3919. };
  3920. __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", url);
  3921. }
  3922. get cache() {
  3923. return cache$1;
  3924. }
  3925. constructor(location2, options2){
  3926. super();
  3927. _History_instances.add(this);
  3928. _History_location.set(this, void 0);
  3929. _History_stack.set(this, []);
  3930. _History_cur.set(this, 0);
  3931. _History_window.set(this, void 0);
  3932. __classPrivateFieldSet(this, _History_window, options2.window, "f");
  3933. __classPrivateFieldSet(this, _History_location, location2, "f");
  3934. __classPrivateFieldGet(this, _History_location, "f").on("__record_history__", (href)=>{
  3935. var _a;
  3936. __classPrivateFieldSet(this, _History_cur, (_a = __classPrivateFieldGet(this, _History_cur, "f"), _a++, _a), "f");
  3937. __classPrivateFieldSet(this, _History_stack, __classPrivateFieldGet(this, _History_stack, "f").slice(0, __classPrivateFieldGet(this, _History_cur, "f")), "f");
  3938. __classPrivateFieldGet(this, _History_stack, "f").push({
  3939. state: null,
  3940. title: "",
  3941. url: href
  3942. });
  3943. }, null);
  3944. __classPrivateFieldGet(this, _History_location, "f").on("__reset_history__", (href)=>{
  3945. __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this, href);
  3946. }, null);
  3947. this.on(CONTEXT_ACTIONS.INIT, ()=>{
  3948. __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
  3949. }, null);
  3950. this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
  3951. cache$1.set(pageId2, {
  3952. location: __classPrivateFieldGet(this, _History_location, "f"),
  3953. stack: __classPrivateFieldGet(this, _History_stack, "f").slice(),
  3954. cur: __classPrivateFieldGet(this, _History_cur, "f")
  3955. });
  3956. }, null);
  3957. this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
  3958. if (cache$1.has(pageId2)) {
  3959. const ctx = cache$1.get(pageId2);
  3960. __classPrivateFieldSet(this, _History_location, ctx.location, "f");
  3961. __classPrivateFieldSet(this, _History_stack, ctx.stack, "f");
  3962. __classPrivateFieldSet(this, _History_cur, ctx.cur, "f");
  3963. }
  3964. }, null);
  3965. this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
  3966. cache$1.delete(pageId2);
  3967. }, null);
  3968. __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
  3969. }
  3970. };
  3971. _History_location = /* @__PURE__ */ new WeakMap(), _History_stack = /* @__PURE__ */ new WeakMap(), _History_cur = /* @__PURE__ */ new WeakMap(), _History_window = /* @__PURE__ */ new WeakMap(), _History_instances = /* @__PURE__ */ new WeakSet(), _History_reset = function _History_reset2(href = "") {
  3972. __classPrivateFieldSet(this, _History_stack, [
  3973. {
  3974. state: null,
  3975. title: "",
  3976. url: href || __classPrivateFieldGet(this, _History_location, "f").href
  3977. }
  3978. ], "f");
  3979. __classPrivateFieldSet(this, _History_cur, 0, "f");
  3980. };
  3981. Current = {
  3982. app: null,
  3983. router: null,
  3984. page: null
  3985. };
  3986. getCurrentInstance = ()=>Current;
  3987. INIT_URL = "https://taro.com";
  3988. cache = new RuntimeCache("location");
  3989. Location = class extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
  3990. get protocol() {
  3991. return __classPrivateFieldGet(this, _Location_url, "f").protocol;
  3992. }
  3993. set protocol(val) {
  3994. const REG = /^(http|https):$/i;
  3995. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val.trim())) return;
  3996. val = val.trim();
  3997. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  3998. __classPrivateFieldGet(this, _Location_url, "f").protocol = val;
  3999. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4000. }
  4001. get host() {
  4002. return __classPrivateFieldGet(this, _Location_url, "f").host;
  4003. }
  4004. set host(val) {
  4005. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
  4006. val = val.trim();
  4007. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4008. __classPrivateFieldGet(this, _Location_url, "f").host = val;
  4009. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4010. }
  4011. get hostname() {
  4012. return __classPrivateFieldGet(this, _Location_url, "f").hostname;
  4013. }
  4014. set hostname(val) {
  4015. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
  4016. val = val.trim();
  4017. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4018. __classPrivateFieldGet(this, _Location_url, "f").hostname = val;
  4019. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4020. }
  4021. get port() {
  4022. return __classPrivateFieldGet(this, _Location_url, "f").port;
  4023. }
  4024. set port(val) {
  4025. const xVal = Number(val = val.trim());
  4026. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(xVal) || xVal <= 0) return;
  4027. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4028. __classPrivateFieldGet(this, _Location_url, "f").port = val;
  4029. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4030. }
  4031. get pathname() {
  4032. return __classPrivateFieldGet(this, _Location_url, "f").pathname;
  4033. }
  4034. set pathname(val) {
  4035. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
  4036. val = val.trim();
  4037. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4038. __classPrivateFieldGet(this, _Location_url, "f").pathname = val;
  4039. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4040. }
  4041. get search() {
  4042. return __classPrivateFieldGet(this, _Location_url, "f").search;
  4043. }
  4044. set search(val) {
  4045. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
  4046. val = val.trim();
  4047. val = val.startsWith("?") ? val : `?${val}`;
  4048. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4049. __classPrivateFieldGet(this, _Location_url, "f").search = val;
  4050. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4051. }
  4052. get hash() {
  4053. return __classPrivateFieldGet(this, _Location_url, "f").hash;
  4054. }
  4055. set hash(val) {
  4056. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
  4057. val = val.trim();
  4058. val = val.startsWith("#") ? val : `#${val}`;
  4059. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4060. __classPrivateFieldGet(this, _Location_url, "f").hash = val;
  4061. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4062. }
  4063. get href() {
  4064. return __classPrivateFieldGet(this, _Location_url, "f").href;
  4065. }
  4066. set href(val) {
  4067. const REG = /^(http:|https:)?\/\/.+/;
  4068. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val = val.trim())) return;
  4069. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4070. __classPrivateFieldGet(this, _Location_url, "f").href = val;
  4071. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4072. }
  4073. get origin() {
  4074. return __classPrivateFieldGet(this, _Location_url, "f").origin;
  4075. }
  4076. set origin(val) {
  4077. const REG = /^(http:|https:)?\/\/.+/;
  4078. if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val = val.trim())) return;
  4079. const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
  4080. __classPrivateFieldGet(this, _Location_url, "f").origin = val;
  4081. if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
  4082. }
  4083. assign() {
  4084. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(true, "\u5C0F\u7A0B\u5E8F\u73AF\u5883\u4E2D\u8C03\u7528location.assign()\u65E0\u6548.");
  4085. }
  4086. reload() {
  4087. (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(true, "\u5C0F\u7A0B\u5E8F\u73AF\u5883\u4E2D\u8C03\u7528location.reload()\u65E0\u6548.");
  4088. }
  4089. replace(url) {
  4090. this.trigger("__set_href_without_history__", url);
  4091. }
  4092. toString() {
  4093. return this.href;
  4094. }
  4095. get cache() {
  4096. return cache;
  4097. }
  4098. constructor(options2){
  4099. super();
  4100. _Location_instances.add(this);
  4101. _Location_url.set(this, new URL(INIT_URL));
  4102. _Location_noCheckUrl.set(this, false);
  4103. _Location_window.set(this, void 0);
  4104. __classPrivateFieldSet(this, _Location_window, options2.window, "f");
  4105. __classPrivateFieldGet(this, _Location_instances, "m", _Location_reset).call(this);
  4106. this.on("__set_href_without_history__", (href)=>{
  4107. __classPrivateFieldSet(this, _Location_noCheckUrl, true, "f");
  4108. const lastHash = __classPrivateFieldGet(this, _Location_url, "f").hash;
  4109. __classPrivateFieldGet(this, _Location_url, "f").href = generateFullUrl(href);
  4110. if (lastHash !== __classPrivateFieldGet(this, _Location_url, "f").hash) {
  4111. __classPrivateFieldGet(this, _Location_window, "f").trigger("hashchange");
  4112. }
  4113. __classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
  4114. }, null);
  4115. this.on(CONTEXT_ACTIONS.INIT, ()=>{
  4116. __classPrivateFieldGet(this, _Location_instances, "m", _Location_reset).call(this);
  4117. }, null);
  4118. this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
  4119. cache.set(pageId2, {
  4120. lastHref: this.href
  4121. });
  4122. }, null);
  4123. this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
  4124. if (cache.has(pageId2)) {
  4125. const ctx = cache.get(pageId2);
  4126. __classPrivateFieldSet(this, _Location_noCheckUrl, true, "f");
  4127. __classPrivateFieldGet(this, _Location_url, "f").href = ctx.lastHref;
  4128. __classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
  4129. }
  4130. }, null);
  4131. this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
  4132. cache.delete(pageId2);
  4133. }, null);
  4134. }
  4135. };
  4136. _Location_url = /* @__PURE__ */ new WeakMap(), _Location_noCheckUrl = /* @__PURE__ */ new WeakMap(), _Location_window = /* @__PURE__ */ new WeakMap(), _Location_instances = /* @__PURE__ */ new WeakSet(), _Location_reset = function _Location_reset2() {
  4137. const Current2 = getCurrentInstance();
  4138. const router = Current2.router;
  4139. if (router) {
  4140. const { path , params } = router;
  4141. const searchArr = Object.keys(params).map((key)=>{
  4142. return `${key}=${params[key]}`;
  4143. });
  4144. const searchStr = searchArr.length > 0 ? "?" + searchArr.join("&") : "";
  4145. const url = `${INIT_URL}${path.startsWith("/") ? path : "/" + path}${searchStr}`;
  4146. __classPrivateFieldSet(this, _Location_url, new URL(url), "f");
  4147. this.trigger("__reset_history__", this.href);
  4148. }
  4149. }, _Location_getPreValue = function _Location_getPreValue2() {
  4150. return __classPrivateFieldGet(this, _Location_url, "f")._toRaw();
  4151. }, _Location_rollBack = function _Location_rollBack2(href) {
  4152. __classPrivateFieldGet(this, _Location_url, "f").href = href;
  4153. }, _Location_recordHistory = function _Location_recordHistory2() {
  4154. this.trigger("__record_history__", this.href);
  4155. }, _Location_checkUrlChange = function _Location_checkUrlChange2(preValue) {
  4156. if (__classPrivateFieldGet(this, _Location_noCheckUrl, "f")) {
  4157. return false;
  4158. }
  4159. const { protocol , hostname , port , pathname , search , hash } = __classPrivateFieldGet(this, _Location_url, "f")._toRaw();
  4160. if (protocol !== preValue.protocol || hostname !== preValue.hostname || port !== preValue.port) {
  4161. __classPrivateFieldGet(this, _Location_instances, "m", _Location_rollBack).call(this, preValue.href);
  4162. return false;
  4163. }
  4164. if (pathname !== preValue.pathname) {
  4165. return true;
  4166. }
  4167. if (search !== preValue.search) {
  4168. return true;
  4169. }
  4170. if (hash !== preValue.hash) {
  4171. __classPrivateFieldGet(this, _Location_window, "f").trigger("hashchange");
  4172. return true;
  4173. }
  4174. __classPrivateFieldGet(this, _Location_instances, "m", _Location_rollBack).call(this, preValue.href);
  4175. return false;
  4176. };
  4177. machine = "Macintosh";
  4178. arch = "Intel Mac OS X 10_14_5";
  4179. engine = "AppleWebKit/534.36 (KHTML, like Gecko) NodeJS/v4.1.0 Chrome/76.0.3809.132 Safari/534.36";
  4180. msg = "(" + machine + "; " + arch + ") " + engine;
  4181. nav = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)() ? env.window.navigator : {
  4182. appCodeName: "Mozilla",
  4183. appName: "Netscape",
  4184. appVersion: "5.0 " + msg,
  4185. cookieEnabled: true,
  4186. mimeTypes: [],
  4187. onLine: true,
  4188. platform: "MacIntel",
  4189. plugins: [],
  4190. product: "Taro",
  4191. productSub: "20030107",
  4192. userAgent: "Mozilla/5.0 " + msg,
  4193. vendor: "Joyent",
  4194. vendorSub: ""
  4195. };
  4196. (function() {
  4197. let loadTime;
  4198. if (typeof performance !== "undefined" && performance !== null && performance.now) {
  4199. now = ()=>performance.now();
  4200. } else if (Date.now) {
  4201. loadTime = Date.now();
  4202. now = ()=>Date.now() - loadTime;
  4203. } else {
  4204. loadTime = new Date().getTime();
  4205. now = ()=>new Date().getTime() - loadTime;
  4206. }
  4207. })();
  4208. lastTime = 0;
  4209. _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame !== null ? requestAnimationFrame : function(callback) {
  4210. const _now = now();
  4211. const nextTime = Math.max(lastTime + 16, _now);
  4212. return setTimeout(function() {
  4213. callback(lastTime = nextTime);
  4214. }, nextTime - _now);
  4215. };
  4216. _caf = typeof cancelAnimationFrame !== "undefined" && cancelAnimationFrame !== null ? cancelAnimationFrame : function(seed) {
  4217. clearTimeout(seed);
  4218. };
  4219. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
  4220. class Window extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
  4221. initEvent() {
  4222. const _location = this.location;
  4223. const _history = this.history;
  4224. this.on(CONTEXT_ACTIONS.INIT, (pageId2)=>{
  4225. _location.trigger(CONTEXT_ACTIONS.INIT, pageId2);
  4226. }, null);
  4227. this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
  4228. _location.trigger(CONTEXT_ACTIONS.RECOVER, pageId2);
  4229. _history.trigger(CONTEXT_ACTIONS.RECOVER, pageId2);
  4230. }, null);
  4231. this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
  4232. _location.trigger(CONTEXT_ACTIONS.RESTORE, pageId2);
  4233. _history.trigger(CONTEXT_ACTIONS.RESTORE, pageId2);
  4234. }, null);
  4235. this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
  4236. _location.trigger(CONTEXT_ACTIONS.DESTORY, pageId2);
  4237. _history.trigger(CONTEXT_ACTIONS.DESTORY, pageId2);
  4238. }, null);
  4239. }
  4240. get document() {
  4241. return env.document;
  4242. }
  4243. addEventListener(event, callback) {
  4244. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(event)) return;
  4245. this.on(event, callback, null);
  4246. }
  4247. removeEventListener(event, callback) {
  4248. if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(event)) return;
  4249. this.off(event, callback, null);
  4250. }
  4251. setTimeout(...args) {
  4252. return setTimeout(...args);
  4253. }
  4254. clearTimeout(...args) {
  4255. return clearTimeout(...args);
  4256. }
  4257. constructor(){
  4258. super();
  4259. this.navigator = nav;
  4260. this.requestAnimationFrame = _raf;
  4261. this.cancelAnimationFrame = _caf;
  4262. this.getComputedStyle = getComputedStyle;
  4263. const globalProperties = [
  4264. ...Object.getOwnPropertyNames(__webpack_require__.g || {}),
  4265. ...Object.getOwnPropertySymbols(__webpack_require__.g || {})
  4266. ];
  4267. globalProperties.forEach((property)=>{
  4268. if (property === "atob" || property === "document") return;
  4269. if (!Object.prototype.hasOwnProperty.call(this, property)) {
  4270. try {
  4271. this[property] = __webpack_require__.g[property];
  4272. } catch (e) {
  4273. if (true) {
  4274. console.warn(`[Taro warn] window.${String(property)} \u5728\u8D4B\u503C\u5230 window \u65F6\u62A5\u9519`);
  4275. }
  4276. }
  4277. }
  4278. });
  4279. this.Date || (this.Date = Date);
  4280. this.location = new Location({
  4281. window: this
  4282. });
  4283. this.history = new History(this.location, {
  4284. window: this
  4285. });
  4286. this.initEvent();
  4287. }
  4288. }
  4289. window$1 = env.window = new Window();
  4290. } else {
  4291. window$1 = env.window;
  4292. }
  4293. location = window$1.location;
  4294. history = window$1.history;
  4295. SVGElement = class extends TaroElement {
  4296. };
  4297. instances = /* @__PURE__ */ new Map();
  4298. pageId = incrementId();
  4299. isWeb = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)();
  4300. TIMEOUT = 100;
  4301. nextTick = (cb, ctx)=>{
  4302. const beginTime = Date.now();
  4303. const router = Current.router;
  4304. const timerFunc = ()=>{
  4305. setTimeout(function() {
  4306. ctx ? cb.call(ctx) : cb();
  4307. }, 1);
  4308. };
  4309. if (router === null) return timerFunc();
  4310. const path = router.$taroPath;
  4311. function next() {
  4312. var _a, _b, _c;
  4313. const pageElement = env.document.getElementById(path);
  4314. if (pageElement === null || pageElement === void 0 ? void 0 : pageElement.pendingUpdate) {
  4315. if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
  4316. (_c = (_b = (_a = pageElement.firstChild) === null || _a === void 0 ? void 0 : _a["componentOnReady"]) === null || _b === void 0 ? void 0 : _b.call(_a).then(()=>{
  4317. timerFunc();
  4318. })) !== null && _c !== void 0 ? _c : timerFunc();
  4319. } else {
  4320. pageElement.enqueueUpdateCallback(cb, ctx);
  4321. }
  4322. } else if (Date.now() - beginTime > TIMEOUT) {
  4323. timerFunc();
  4324. } else {
  4325. setTimeout(()=>next(), 20);
  4326. }
  4327. }
  4328. next();
  4329. };
  4330. }
  4331. });
  4332. /***/ })
  4333. }]);