vendor.js 1005 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151
  1. "use strict";
  2. var __accessCheck = (obj, member, msg) => {
  3. if (!member.has(obj))
  4. throw TypeError("Cannot " + msg);
  5. };
  6. var __privateGet = (obj, member, getter) => {
  7. __accessCheck(obj, member, "read from private field");
  8. return getter ? getter.call(obj) : member.get(obj);
  9. };
  10. var __privateAdd = (obj, member, value) => {
  11. if (member.has(obj))
  12. throw TypeError("Cannot add the same private member more than once");
  13. member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
  14. };
  15. var __privateSet = (obj, member, value, setter) => {
  16. __accessCheck(obj, member, "write to private field");
  17. setter ? setter.call(obj, value) : member.set(obj, value);
  18. return value;
  19. };
  20. function makeMap(str, expectsLowerCase) {
  21. const map = /* @__PURE__ */ Object.create(null);
  22. const list = str.split(",");
  23. for (let i2 = 0; i2 < list.length; i2++) {
  24. map[list[i2]] = true;
  25. }
  26. return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
  27. }
  28. const EMPTY_OBJ = Object.freeze({});
  29. const EMPTY_ARR = Object.freeze([]);
  30. const NOOP = () => {
  31. };
  32. const NO = () => false;
  33. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  34. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  35. const isModelListener = (key) => key.startsWith("onUpdate:");
  36. const extend = Object.assign;
  37. const remove = (arr, el) => {
  38. const i2 = arr.indexOf(el);
  39. if (i2 > -1) {
  40. arr.splice(i2, 1);
  41. }
  42. };
  43. const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  44. const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key);
  45. const isArray$1 = Array.isArray;
  46. const isMap = (val) => toTypeString(val) === "[object Map]";
  47. const isSet = (val) => toTypeString(val) === "[object Set]";
  48. const isFunction = (val) => typeof val === "function";
  49. const isString = (val) => typeof val === "string";
  50. const isSymbol = (val) => typeof val === "symbol";
  51. const isObject$3 = (val) => val !== null && typeof val === "object";
  52. const isPromise = (val) => {
  53. return (isObject$3(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  54. };
  55. const objectToString = Object.prototype.toString;
  56. const toTypeString = (value) => objectToString.call(value);
  57. const toRawType = (value) => {
  58. return toTypeString(value).slice(8, -1);
  59. };
  60. const isPlainObject$2 = (val) => toTypeString(val) === "[object Object]";
  61. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  62. const isReservedProp = /* @__PURE__ */ makeMap(
  63. // the leading comma is intentional so empty string "" is also included
  64. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  65. );
  66. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  67. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  68. );
  69. const cacheStringFunction = (fn) => {
  70. const cache = /* @__PURE__ */ Object.create(null);
  71. return (str) => {
  72. const hit = cache[str];
  73. return hit || (cache[str] = fn(str));
  74. };
  75. };
  76. const camelizeRE = /-(\w)/g;
  77. const camelize = cacheStringFunction((str) => {
  78. return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
  79. });
  80. const hyphenateRE = /\B([A-Z])/g;
  81. const hyphenate = cacheStringFunction(
  82. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  83. );
  84. const capitalize = cacheStringFunction((str) => {
  85. return str.charAt(0).toUpperCase() + str.slice(1);
  86. });
  87. const toHandlerKey = cacheStringFunction((str) => {
  88. const s2 = str ? `on${capitalize(str)}` : ``;
  89. return s2;
  90. });
  91. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  92. const invokeArrayFns$1 = (fns, arg) => {
  93. for (let i2 = 0; i2 < fns.length; i2++) {
  94. fns[i2](arg);
  95. }
  96. };
  97. const def = (obj, key, value) => {
  98. Object.defineProperty(obj, key, {
  99. configurable: true,
  100. enumerable: false,
  101. value
  102. });
  103. };
  104. const looseToNumber = (val) => {
  105. const n2 = parseFloat(val);
  106. return isNaN(n2) ? val : n2;
  107. };
  108. const toNumber = (val) => {
  109. const n2 = isString(val) ? Number(val) : NaN;
  110. return isNaN(n2) ? val : n2;
  111. };
  112. function normalizeStyle(value) {
  113. if (isArray$1(value)) {
  114. const res = {};
  115. for (let i2 = 0; i2 < value.length; i2++) {
  116. const item = value[i2];
  117. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  118. if (normalized) {
  119. for (const key in normalized) {
  120. res[key] = normalized[key];
  121. }
  122. }
  123. }
  124. return res;
  125. } else if (isString(value) || isObject$3(value)) {
  126. return value;
  127. }
  128. }
  129. const listDelimiterRE = /;(?![^(]*\))/g;
  130. const propertyDelimiterRE = /:([^]+)/;
  131. const styleCommentRE = /\/\*[^]*?\*\//g;
  132. function parseStringStyle(cssText) {
  133. const ret = {};
  134. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  135. if (item) {
  136. const tmp = item.split(propertyDelimiterRE);
  137. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  138. }
  139. });
  140. return ret;
  141. }
  142. function normalizeClass(value) {
  143. let res = "";
  144. if (isString(value)) {
  145. res = value;
  146. } else if (isArray$1(value)) {
  147. for (let i2 = 0; i2 < value.length; i2++) {
  148. const normalized = normalizeClass(value[i2]);
  149. if (normalized) {
  150. res += normalized + " ";
  151. }
  152. }
  153. } else if (isObject$3(value)) {
  154. for (const name in value) {
  155. if (value[name]) {
  156. res += name + " ";
  157. }
  158. }
  159. }
  160. return res.trim();
  161. }
  162. const toDisplayString = (val) => {
  163. return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$3(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  164. };
  165. const replacer = (_key, val) => {
  166. if (val && val.__v_isRef) {
  167. return replacer(_key, val.value);
  168. } else if (isMap(val)) {
  169. return {
  170. [`Map(${val.size})`]: [...val.entries()].reduce(
  171. (entries, [key, val2], i2) => {
  172. entries[stringifySymbol(key, i2) + " =>"] = val2;
  173. return entries;
  174. },
  175. {}
  176. )
  177. };
  178. } else if (isSet(val)) {
  179. return {
  180. [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2))
  181. };
  182. } else if (isSymbol(val)) {
  183. return stringifySymbol(val);
  184. } else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$2(val)) {
  185. return String(val);
  186. }
  187. return val;
  188. };
  189. const stringifySymbol = (v2, i2 = "") => {
  190. var _a2;
  191. return isSymbol(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2;
  192. };
  193. const isObject$2 = (val) => val !== null && typeof val === "object";
  194. const defaultDelimiters = ["{", "}"];
  195. class BaseFormatter {
  196. constructor() {
  197. this._caches = /* @__PURE__ */ Object.create(null);
  198. }
  199. interpolate(message, values, delimiters = defaultDelimiters) {
  200. if (!values) {
  201. return [message];
  202. }
  203. let tokens = this._caches[message];
  204. if (!tokens) {
  205. tokens = parse$1(message, delimiters);
  206. this._caches[message] = tokens;
  207. }
  208. return compile$1(tokens, values);
  209. }
  210. }
  211. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  212. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  213. function parse$1(format, [startDelimiter, endDelimiter]) {
  214. const tokens = [];
  215. let position = 0;
  216. let text = "";
  217. while (position < format.length) {
  218. let char = format[position++];
  219. if (char === startDelimiter) {
  220. if (text) {
  221. tokens.push({ type: "text", value: text });
  222. }
  223. text = "";
  224. let sub = "";
  225. char = format[position++];
  226. while (char !== void 0 && char !== endDelimiter) {
  227. sub += char;
  228. char = format[position++];
  229. }
  230. const isClosed = char === endDelimiter;
  231. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  232. tokens.push({ value: sub, type });
  233. } else {
  234. text += char;
  235. }
  236. }
  237. text && tokens.push({ type: "text", value: text });
  238. return tokens;
  239. }
  240. function compile$1(tokens, values) {
  241. const compiled = [];
  242. let index2 = 0;
  243. const mode = Array.isArray(values) ? "list" : isObject$2(values) ? "named" : "unknown";
  244. if (mode === "unknown") {
  245. return compiled;
  246. }
  247. while (index2 < tokens.length) {
  248. const token = tokens[index2];
  249. switch (token.type) {
  250. case "text":
  251. compiled.push(token.value);
  252. break;
  253. case "list":
  254. compiled.push(values[parseInt(token.value, 10)]);
  255. break;
  256. case "named":
  257. if (mode === "named") {
  258. compiled.push(values[token.value]);
  259. } else {
  260. {
  261. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  262. }
  263. }
  264. break;
  265. case "unknown":
  266. {
  267. console.warn(`Detect 'unknown' type of token!`);
  268. }
  269. break;
  270. }
  271. index2++;
  272. }
  273. return compiled;
  274. }
  275. const LOCALE_ZH_HANS = "zh-Hans";
  276. const LOCALE_ZH_HANT = "zh-Hant";
  277. const LOCALE_EN = "en";
  278. const LOCALE_FR = "fr";
  279. const LOCALE_ES = "es";
  280. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  281. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  282. const defaultFormatter = new BaseFormatter();
  283. function include(str, parts) {
  284. return !!parts.find((part) => str.indexOf(part) !== -1);
  285. }
  286. function startsWith(str, parts) {
  287. return parts.find((part) => str.indexOf(part) === 0);
  288. }
  289. function normalizeLocale(locale, messages) {
  290. if (!locale) {
  291. return;
  292. }
  293. locale = locale.trim().replace(/_/g, "-");
  294. if (messages && messages[locale]) {
  295. return locale;
  296. }
  297. locale = locale.toLowerCase();
  298. if (locale === "chinese") {
  299. return LOCALE_ZH_HANS;
  300. }
  301. if (locale.indexOf("zh") === 0) {
  302. if (locale.indexOf("-hans") > -1) {
  303. return LOCALE_ZH_HANS;
  304. }
  305. if (locale.indexOf("-hant") > -1) {
  306. return LOCALE_ZH_HANT;
  307. }
  308. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  309. return LOCALE_ZH_HANT;
  310. }
  311. return LOCALE_ZH_HANS;
  312. }
  313. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  314. if (messages && Object.keys(messages).length > 0) {
  315. locales = Object.keys(messages);
  316. }
  317. const lang = startsWith(locale, locales);
  318. if (lang) {
  319. return lang;
  320. }
  321. }
  322. class I18n {
  323. constructor({ locale, fallbackLocale, messages, watcher, formater }) {
  324. this.locale = LOCALE_EN;
  325. this.fallbackLocale = LOCALE_EN;
  326. this.message = {};
  327. this.messages = {};
  328. this.watchers = [];
  329. if (fallbackLocale) {
  330. this.fallbackLocale = fallbackLocale;
  331. }
  332. this.formater = formater || defaultFormatter;
  333. this.messages = messages || {};
  334. this.setLocale(locale || LOCALE_EN);
  335. if (watcher) {
  336. this.watchLocale(watcher);
  337. }
  338. }
  339. setLocale(locale) {
  340. const oldLocale = this.locale;
  341. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  342. if (!this.messages[this.locale]) {
  343. this.messages[this.locale] = {};
  344. }
  345. this.message = this.messages[this.locale];
  346. if (oldLocale !== this.locale) {
  347. this.watchers.forEach((watcher) => {
  348. watcher(this.locale, oldLocale);
  349. });
  350. }
  351. }
  352. getLocale() {
  353. return this.locale;
  354. }
  355. watchLocale(fn) {
  356. const index2 = this.watchers.push(fn) - 1;
  357. return () => {
  358. this.watchers.splice(index2, 1);
  359. };
  360. }
  361. add(locale, message, override = true) {
  362. const curMessages = this.messages[locale];
  363. if (curMessages) {
  364. if (override) {
  365. Object.assign(curMessages, message);
  366. } else {
  367. Object.keys(message).forEach((key) => {
  368. if (!hasOwn(curMessages, key)) {
  369. curMessages[key] = message[key];
  370. }
  371. });
  372. }
  373. } else {
  374. this.messages[locale] = message;
  375. }
  376. }
  377. f(message, values, delimiters) {
  378. return this.formater.interpolate(message, values, delimiters).join("");
  379. }
  380. t(key, locale, values) {
  381. let message = this.message;
  382. if (typeof locale === "string") {
  383. locale = normalizeLocale(locale, this.messages);
  384. locale && (message = this.messages[locale]);
  385. } else {
  386. values = locale;
  387. }
  388. if (!hasOwn(message, key)) {
  389. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  390. return key;
  391. }
  392. return this.formater.interpolate(message[key], values).join("");
  393. }
  394. }
  395. function watchAppLocale(appVm, i18n) {
  396. if (appVm.$watchLocale) {
  397. appVm.$watchLocale((newLocale) => {
  398. i18n.setLocale(newLocale);
  399. });
  400. } else {
  401. appVm.$watch(() => appVm.$locale, (newLocale) => {
  402. i18n.setLocale(newLocale);
  403. });
  404. }
  405. }
  406. function getDefaultLocale() {
  407. if (typeof index$1 !== "undefined" && index$1.getLocale) {
  408. return index$1.getLocale();
  409. }
  410. if (typeof global !== "undefined" && global.getLocale) {
  411. return global.getLocale();
  412. }
  413. return LOCALE_EN;
  414. }
  415. function initVueI18n(locale, messages = {}, fallbackLocale, watcher) {
  416. if (typeof locale !== "string") {
  417. [locale, messages] = [
  418. messages,
  419. locale
  420. ];
  421. }
  422. if (typeof locale !== "string") {
  423. locale = getDefaultLocale();
  424. }
  425. if (typeof fallbackLocale !== "string") {
  426. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  427. }
  428. const i18n = new I18n({
  429. locale,
  430. fallbackLocale,
  431. messages,
  432. watcher
  433. });
  434. let t2 = (key, values) => {
  435. if (typeof getApp !== "function") {
  436. t2 = function(key2, values2) {
  437. return i18n.t(key2, values2);
  438. };
  439. } else {
  440. let isWatchedAppLocale = false;
  441. t2 = function(key2, values2) {
  442. const appVm = getApp().$vm;
  443. if (appVm) {
  444. appVm.$locale;
  445. if (!isWatchedAppLocale) {
  446. isWatchedAppLocale = true;
  447. watchAppLocale(appVm, i18n);
  448. }
  449. }
  450. return i18n.t(key2, values2);
  451. };
  452. }
  453. return t2(key, values);
  454. };
  455. return {
  456. i18n,
  457. f(message, values, delimiters) {
  458. return i18n.f(message, values, delimiters);
  459. },
  460. t(key, values) {
  461. return t2(key, values);
  462. },
  463. add(locale2, message, override = true) {
  464. return i18n.add(locale2, message, override);
  465. },
  466. watch(fn) {
  467. return i18n.watchLocale(fn);
  468. },
  469. getLocale() {
  470. return i18n.getLocale();
  471. },
  472. setLocale(newLocale) {
  473. return i18n.setLocale(newLocale);
  474. }
  475. };
  476. }
  477. const LINEFEED = "\n";
  478. const SLOT_DEFAULT_NAME = "d";
  479. const ON_SHOW = "onShow";
  480. const ON_HIDE = "onHide";
  481. const ON_LAUNCH = "onLaunch";
  482. const ON_ERROR = "onError";
  483. const ON_THEME_CHANGE = "onThemeChange";
  484. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  485. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  486. const ON_EXIT = "onExit";
  487. const ON_LOAD = "onLoad";
  488. const ON_READY = "onReady";
  489. const ON_UNLOAD = "onUnload";
  490. const ON_INIT = "onInit";
  491. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  492. const ON_RESIZE = "onResize";
  493. const ON_BACK_PRESS = "onBackPress";
  494. const ON_PAGE_SCROLL = "onPageScroll";
  495. const ON_TAB_ITEM_TAP = "onTabItemTap";
  496. const ON_REACH_BOTTOM = "onReachBottom";
  497. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  498. const ON_SHARE_TIMELINE = "onShareTimeline";
  499. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  500. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  501. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  502. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  503. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  504. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  505. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  506. const customizeRE = /:/g;
  507. function customizeEvent(str) {
  508. return camelize(str.replace(customizeRE, "-"));
  509. }
  510. function hasLeadingSlash(str) {
  511. return str.indexOf("/") === 0;
  512. }
  513. function addLeadingSlash(str) {
  514. return hasLeadingSlash(str) ? str : "/" + str;
  515. }
  516. const invokeArrayFns = (fns, arg) => {
  517. let ret;
  518. for (let i2 = 0; i2 < fns.length; i2++) {
  519. ret = fns[i2](arg);
  520. }
  521. return ret;
  522. };
  523. function once(fn, ctx = null) {
  524. let res;
  525. return (...args) => {
  526. if (fn) {
  527. res = fn.apply(ctx, args);
  528. fn = null;
  529. }
  530. return res;
  531. };
  532. }
  533. function getValueByDataPath(obj, path) {
  534. if (!isString(path)) {
  535. return;
  536. }
  537. path = path.replace(/\[(\d+)\]/g, ".$1");
  538. const parts = path.split(".");
  539. let key = parts[0];
  540. if (!obj) {
  541. obj = {};
  542. }
  543. if (parts.length === 1) {
  544. return obj[key];
  545. }
  546. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  547. }
  548. function sortObject(obj) {
  549. let sortObj = {};
  550. if (isPlainObject$2(obj)) {
  551. Object.keys(obj).sort().forEach((key) => {
  552. const _key = key;
  553. sortObj[_key] = obj[_key];
  554. });
  555. }
  556. return !Object.keys(sortObj) ? obj : sortObj;
  557. }
  558. const encode$1 = encodeURIComponent;
  559. function stringifyQuery(obj, encodeStr = encode$1) {
  560. const res = obj ? Object.keys(obj).map((key) => {
  561. let val = obj[key];
  562. if (typeof val === void 0 || val === null) {
  563. val = "";
  564. } else if (isPlainObject$2(val)) {
  565. val = JSON.stringify(val);
  566. }
  567. return encodeStr(key) + "=" + encodeStr(val);
  568. }).filter((x) => x.length > 0).join("&") : null;
  569. return res ? `?${res}` : "";
  570. }
  571. const PAGE_HOOKS = [
  572. ON_INIT,
  573. ON_LOAD,
  574. ON_SHOW,
  575. ON_HIDE,
  576. ON_UNLOAD,
  577. ON_BACK_PRESS,
  578. ON_PAGE_SCROLL,
  579. ON_TAB_ITEM_TAP,
  580. ON_REACH_BOTTOM,
  581. ON_PULL_DOWN_REFRESH,
  582. ON_SHARE_TIMELINE,
  583. ON_SHARE_APP_MESSAGE,
  584. ON_ADD_TO_FAVORITES,
  585. ON_SAVE_EXIT_STATE,
  586. ON_NAVIGATION_BAR_BUTTON_TAP,
  587. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  588. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  589. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  590. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  591. ];
  592. function isRootHook(name) {
  593. return PAGE_HOOKS.indexOf(name) > -1;
  594. }
  595. const UniLifecycleHooks = [
  596. ON_SHOW,
  597. ON_HIDE,
  598. ON_LAUNCH,
  599. ON_ERROR,
  600. ON_THEME_CHANGE,
  601. ON_PAGE_NOT_FOUND,
  602. ON_UNHANDLE_REJECTION,
  603. ON_EXIT,
  604. ON_INIT,
  605. ON_LOAD,
  606. ON_READY,
  607. ON_UNLOAD,
  608. ON_RESIZE,
  609. ON_BACK_PRESS,
  610. ON_PAGE_SCROLL,
  611. ON_TAB_ITEM_TAP,
  612. ON_REACH_BOTTOM,
  613. ON_PULL_DOWN_REFRESH,
  614. ON_SHARE_TIMELINE,
  615. ON_ADD_TO_FAVORITES,
  616. ON_SHARE_APP_MESSAGE,
  617. ON_SAVE_EXIT_STATE,
  618. ON_NAVIGATION_BAR_BUTTON_TAP,
  619. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  620. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  621. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  622. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  623. ];
  624. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  625. return {
  626. onPageScroll: 1,
  627. onShareAppMessage: 1 << 1,
  628. onShareTimeline: 1 << 2
  629. };
  630. })();
  631. function isUniLifecycleHook(name, value, checkType = true) {
  632. if (checkType && !isFunction(value)) {
  633. return false;
  634. }
  635. if (UniLifecycleHooks.indexOf(name) > -1) {
  636. return true;
  637. } else if (name.indexOf("on") === 0) {
  638. return true;
  639. }
  640. return false;
  641. }
  642. let vueApp;
  643. const createVueAppHooks = [];
  644. function onCreateVueApp(hook) {
  645. if (vueApp) {
  646. return hook(vueApp);
  647. }
  648. createVueAppHooks.push(hook);
  649. }
  650. function invokeCreateVueAppHook(app) {
  651. vueApp = app;
  652. createVueAppHooks.forEach((hook) => hook(app));
  653. }
  654. const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  655. if (isFunction(app._component.onError)) {
  656. return createErrorHandler2(app);
  657. }
  658. });
  659. const E$1 = function() {
  660. };
  661. E$1.prototype = {
  662. on: function(name, callback, ctx) {
  663. var e2 = this.e || (this.e = {});
  664. (e2[name] || (e2[name] = [])).push({
  665. fn: callback,
  666. ctx
  667. });
  668. return this;
  669. },
  670. once: function(name, callback, ctx) {
  671. var self2 = this;
  672. function listener() {
  673. self2.off(name, listener);
  674. callback.apply(ctx, arguments);
  675. }
  676. listener._ = callback;
  677. return this.on(name, listener, ctx);
  678. },
  679. emit: function(name) {
  680. var data = [].slice.call(arguments, 1);
  681. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  682. var i2 = 0;
  683. var len = evtArr.length;
  684. for (i2; i2 < len; i2++) {
  685. evtArr[i2].fn.apply(evtArr[i2].ctx, data);
  686. }
  687. return this;
  688. },
  689. off: function(name, callback) {
  690. var e2 = this.e || (this.e = {});
  691. var evts = e2[name];
  692. var liveEvents = [];
  693. if (evts && callback) {
  694. for (var i2 = evts.length - 1; i2 >= 0; i2--) {
  695. if (evts[i2].fn === callback || evts[i2].fn._ === callback) {
  696. evts.splice(i2, 1);
  697. break;
  698. }
  699. }
  700. liveEvents = evts;
  701. }
  702. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  703. return this;
  704. }
  705. };
  706. var E$1$1 = E$1;
  707. function getBaseSystemInfo() {
  708. return wx.getSystemInfoSync();
  709. }
  710. function validateProtocolFail(name, msg) {
  711. console.warn(`${name}: ${msg}`);
  712. }
  713. function validateProtocol(name, data, protocol, onFail) {
  714. if (!onFail) {
  715. onFail = validateProtocolFail;
  716. }
  717. for (const key in protocol) {
  718. const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn$1(data, key));
  719. if (isString(errMsg)) {
  720. onFail(name, errMsg);
  721. }
  722. }
  723. }
  724. function validateProtocols(name, args, protocol, onFail) {
  725. if (!protocol) {
  726. return;
  727. }
  728. if (!isArray$1(protocol)) {
  729. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  730. }
  731. const len = protocol.length;
  732. const argsLen = args.length;
  733. for (let i2 = 0; i2 < len; i2++) {
  734. const opts = protocol[i2];
  735. const data = /* @__PURE__ */ Object.create(null);
  736. if (argsLen > i2) {
  737. data[opts.name] = args[i2];
  738. }
  739. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  740. }
  741. }
  742. function validateProp$1(name, value, prop, isAbsent) {
  743. if (!isPlainObject$2(prop)) {
  744. prop = { type: prop };
  745. }
  746. const { type, required, validator } = prop;
  747. if (required && isAbsent) {
  748. return 'Missing required args: "' + name + '"';
  749. }
  750. if (value == null && !required) {
  751. return;
  752. }
  753. if (type != null) {
  754. let isValid = false;
  755. const types = isArray$1(type) ? type : [type];
  756. const expectedTypes = [];
  757. for (let i2 = 0; i2 < types.length && !isValid; i2++) {
  758. const { valid, expectedType } = assertType$1(value, types[i2]);
  759. expectedTypes.push(expectedType || "");
  760. isValid = valid;
  761. }
  762. if (!isValid) {
  763. return getInvalidTypeMessage$1(name, value, expectedTypes);
  764. }
  765. }
  766. if (validator) {
  767. return validator(value);
  768. }
  769. }
  770. const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  771. function assertType$1(value, type) {
  772. let valid;
  773. const expectedType = getType$2(type);
  774. if (isSimpleType$1(expectedType)) {
  775. const t2 = typeof value;
  776. valid = t2 === expectedType.toLowerCase();
  777. if (!valid && t2 === "object") {
  778. valid = value instanceof type;
  779. }
  780. } else if (expectedType === "Object") {
  781. valid = isObject$3(value);
  782. } else if (expectedType === "Array") {
  783. valid = isArray$1(value);
  784. } else {
  785. {
  786. valid = value instanceof type;
  787. }
  788. }
  789. return {
  790. valid,
  791. expectedType
  792. };
  793. }
  794. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  795. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  796. const expectedType = expectedTypes[0];
  797. const receivedType = toRawType(value);
  798. const expectedValue = styleValue$1(value, expectedType);
  799. const receivedValue = styleValue$1(value, receivedType);
  800. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  801. message += ` with value ${expectedValue}`;
  802. }
  803. message += `, got ${receivedType} `;
  804. if (isExplicable$1(receivedType)) {
  805. message += `with value ${receivedValue}.`;
  806. }
  807. return message;
  808. }
  809. function getType$2(ctor) {
  810. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  811. return match ? match[1] : "";
  812. }
  813. function styleValue$1(value, type) {
  814. if (type === "String") {
  815. return `"${value}"`;
  816. } else if (type === "Number") {
  817. return `${Number(value)}`;
  818. } else {
  819. return `${value}`;
  820. }
  821. }
  822. function isExplicable$1(type) {
  823. const explicitTypes = ["string", "number", "boolean"];
  824. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  825. }
  826. function isBoolean$1(...args) {
  827. return args.some((elem) => elem.toLowerCase() === "boolean");
  828. }
  829. function tryCatch(fn) {
  830. return function() {
  831. try {
  832. return fn.apply(fn, arguments);
  833. } catch (e2) {
  834. console.error(e2);
  835. }
  836. };
  837. }
  838. let invokeCallbackId = 1;
  839. const invokeCallbacks = {};
  840. function addInvokeCallback(id, name, callback, keepAlive = false) {
  841. invokeCallbacks[id] = {
  842. name,
  843. keepAlive,
  844. callback
  845. };
  846. return id;
  847. }
  848. function invokeCallback(id, res, extras) {
  849. if (typeof id === "number") {
  850. const opts = invokeCallbacks[id];
  851. if (opts) {
  852. if (!opts.keepAlive) {
  853. delete invokeCallbacks[id];
  854. }
  855. return opts.callback(res, extras);
  856. }
  857. }
  858. return res;
  859. }
  860. const API_SUCCESS = "success";
  861. const API_FAIL = "fail";
  862. const API_COMPLETE = "complete";
  863. function getApiCallbacks(args) {
  864. const apiCallbacks = {};
  865. for (const name in args) {
  866. const fn = args[name];
  867. if (isFunction(fn)) {
  868. apiCallbacks[name] = tryCatch(fn);
  869. delete args[name];
  870. }
  871. }
  872. return apiCallbacks;
  873. }
  874. function normalizeErrMsg$1(errMsg, name) {
  875. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  876. return name + ":ok";
  877. }
  878. return name + errMsg.substring(errMsg.indexOf(":fail"));
  879. }
  880. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  881. if (!isPlainObject$2(args)) {
  882. args = {};
  883. }
  884. const { success, fail, complete } = getApiCallbacks(args);
  885. const hasSuccess = isFunction(success);
  886. const hasFail = isFunction(fail);
  887. const hasComplete = isFunction(complete);
  888. const callbackId = invokeCallbackId++;
  889. addInvokeCallback(callbackId, name, (res) => {
  890. res = res || {};
  891. res.errMsg = normalizeErrMsg$1(res.errMsg, name);
  892. isFunction(beforeAll) && beforeAll(res);
  893. if (res.errMsg === name + ":ok") {
  894. isFunction(beforeSuccess) && beforeSuccess(res, args);
  895. hasSuccess && success(res);
  896. } else {
  897. hasFail && fail(res);
  898. }
  899. hasComplete && complete(res);
  900. });
  901. return callbackId;
  902. }
  903. const HOOK_SUCCESS = "success";
  904. const HOOK_FAIL = "fail";
  905. const HOOK_COMPLETE = "complete";
  906. const globalInterceptors = {};
  907. const scopedInterceptors = {};
  908. function wrapperHook(hook, params) {
  909. return function(data) {
  910. return hook(data, params) || data;
  911. };
  912. }
  913. function queue$1(hooks, data, params) {
  914. let promise = false;
  915. for (let i2 = 0; i2 < hooks.length; i2++) {
  916. const hook = hooks[i2];
  917. if (promise) {
  918. promise = Promise.resolve(wrapperHook(hook, params));
  919. } else {
  920. const res = hook(data, params);
  921. if (isPromise(res)) {
  922. promise = Promise.resolve(res);
  923. }
  924. if (res === false) {
  925. return {
  926. then() {
  927. },
  928. catch() {
  929. }
  930. };
  931. }
  932. }
  933. }
  934. return promise || {
  935. then(callback) {
  936. return callback(data);
  937. },
  938. catch() {
  939. }
  940. };
  941. }
  942. function wrapperOptions(interceptors2, options = {}) {
  943. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  944. const hooks = interceptors2[name];
  945. if (!isArray$1(hooks)) {
  946. return;
  947. }
  948. const oldCallback = options[name];
  949. options[name] = function callbackInterceptor(res) {
  950. queue$1(hooks, res, options).then((res2) => {
  951. return isFunction(oldCallback) && oldCallback(res2) || res2;
  952. });
  953. };
  954. });
  955. return options;
  956. }
  957. function wrapperReturnValue(method, returnValue) {
  958. const returnValueHooks = [];
  959. if (isArray$1(globalInterceptors.returnValue)) {
  960. returnValueHooks.push(...globalInterceptors.returnValue);
  961. }
  962. const interceptor = scopedInterceptors[method];
  963. if (interceptor && isArray$1(interceptor.returnValue)) {
  964. returnValueHooks.push(...interceptor.returnValue);
  965. }
  966. returnValueHooks.forEach((hook) => {
  967. returnValue = hook(returnValue) || returnValue;
  968. });
  969. return returnValue;
  970. }
  971. function getApiInterceptorHooks(method) {
  972. const interceptor = /* @__PURE__ */ Object.create(null);
  973. Object.keys(globalInterceptors).forEach((hook) => {
  974. if (hook !== "returnValue") {
  975. interceptor[hook] = globalInterceptors[hook].slice();
  976. }
  977. });
  978. const scopedInterceptor = scopedInterceptors[method];
  979. if (scopedInterceptor) {
  980. Object.keys(scopedInterceptor).forEach((hook) => {
  981. if (hook !== "returnValue") {
  982. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  983. }
  984. });
  985. }
  986. return interceptor;
  987. }
  988. function invokeApi(method, api, options, params) {
  989. const interceptor = getApiInterceptorHooks(method);
  990. if (interceptor && Object.keys(interceptor).length) {
  991. if (isArray$1(interceptor.invoke)) {
  992. const res = queue$1(interceptor.invoke, options);
  993. return res.then((options2) => {
  994. return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
  995. });
  996. } else {
  997. return api(wrapperOptions(interceptor, options), ...params);
  998. }
  999. }
  1000. return api(options, ...params);
  1001. }
  1002. function hasCallback(args) {
  1003. if (isPlainObject$2(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
  1004. return true;
  1005. }
  1006. return false;
  1007. }
  1008. function handlePromise(promise) {
  1009. return promise;
  1010. }
  1011. function promisify$1(name, fn) {
  1012. return (args = {}, ...rest) => {
  1013. if (hasCallback(args)) {
  1014. return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
  1015. }
  1016. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  1017. invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
  1018. })));
  1019. };
  1020. }
  1021. function formatApiArgs(args, options) {
  1022. const params = args[0];
  1023. if (!options || !isPlainObject$2(options.formatArgs) && isPlainObject$2(params)) {
  1024. return;
  1025. }
  1026. const formatArgs = options.formatArgs;
  1027. const keys = Object.keys(formatArgs);
  1028. for (let i2 = 0; i2 < keys.length; i2++) {
  1029. const name = keys[i2];
  1030. const formatterOrDefaultValue = formatArgs[name];
  1031. if (isFunction(formatterOrDefaultValue)) {
  1032. const errMsg = formatterOrDefaultValue(args[0][name], params);
  1033. if (isString(errMsg)) {
  1034. return errMsg;
  1035. }
  1036. } else {
  1037. if (!hasOwn$1(params, name)) {
  1038. params[name] = formatterOrDefaultValue;
  1039. }
  1040. }
  1041. }
  1042. }
  1043. function invokeSuccess(id, name, res) {
  1044. const result2 = {
  1045. errMsg: name + ":ok"
  1046. };
  1047. return invokeCallback(id, extend(res || {}, result2));
  1048. }
  1049. function invokeFail(id, name, errMsg, errRes = {}) {
  1050. const apiErrMsg = name + ":fail" + (errMsg ? " " + errMsg : "");
  1051. delete errRes.errCode;
  1052. return invokeCallback(id, typeof UniError !== "undefined" ? typeof errRes.errCode !== "undefined" ? new UniError(name, errRes.errCode, apiErrMsg) : new UniError(apiErrMsg, errRes) : extend({ errMsg: apiErrMsg }, errRes));
  1053. }
  1054. function beforeInvokeApi(name, args, protocol, options) {
  1055. {
  1056. validateProtocols(name, args, protocol);
  1057. }
  1058. if (options && options.beforeInvoke) {
  1059. const errMsg2 = options.beforeInvoke(args);
  1060. if (isString(errMsg2)) {
  1061. return errMsg2;
  1062. }
  1063. }
  1064. const errMsg = formatApiArgs(args, options);
  1065. if (errMsg) {
  1066. return errMsg;
  1067. }
  1068. }
  1069. function normalizeErrMsg(errMsg) {
  1070. if (!errMsg || isString(errMsg)) {
  1071. return errMsg;
  1072. }
  1073. if (errMsg.stack) {
  1074. console.error(errMsg.message + LINEFEED + errMsg.stack);
  1075. return errMsg.message;
  1076. }
  1077. return errMsg;
  1078. }
  1079. function wrapperTaskApi(name, fn, protocol, options) {
  1080. return (args) => {
  1081. const id = createAsyncApiCallback(name, args, options);
  1082. const errMsg = beforeInvokeApi(name, [args], protocol, options);
  1083. if (errMsg) {
  1084. return invokeFail(id, name, errMsg);
  1085. }
  1086. return fn(args, {
  1087. resolve: (res) => invokeSuccess(id, name, res),
  1088. reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
  1089. });
  1090. };
  1091. }
  1092. function wrapperSyncApi(name, fn, protocol, options) {
  1093. return (...args) => {
  1094. const errMsg = beforeInvokeApi(name, args, protocol, options);
  1095. if (errMsg) {
  1096. throw new Error(errMsg);
  1097. }
  1098. return fn.apply(null, args);
  1099. };
  1100. }
  1101. function wrapperAsyncApi(name, fn, protocol, options) {
  1102. return wrapperTaskApi(name, fn, protocol, options);
  1103. }
  1104. function defineSyncApi(name, fn, protocol, options) {
  1105. return wrapperSyncApi(name, fn, protocol, options);
  1106. }
  1107. function defineAsyncApi(name, fn, protocol, options) {
  1108. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  1109. }
  1110. const API_UPX2PX = "upx2px";
  1111. const Upx2pxProtocol = [
  1112. {
  1113. name: "upx",
  1114. type: [Number, String],
  1115. required: true
  1116. }
  1117. ];
  1118. const EPS = 1e-4;
  1119. const BASE_DEVICE_WIDTH = 750;
  1120. let isIOS = false;
  1121. let deviceWidth = 0;
  1122. let deviceDPR = 0;
  1123. function checkDeviceWidth() {
  1124. const { platform, pixelRatio, windowWidth } = getBaseSystemInfo();
  1125. deviceWidth = windowWidth;
  1126. deviceDPR = pixelRatio;
  1127. isIOS = platform === "ios";
  1128. }
  1129. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  1130. if (deviceWidth === 0) {
  1131. checkDeviceWidth();
  1132. }
  1133. number = Number(number);
  1134. if (number === 0) {
  1135. return 0;
  1136. }
  1137. let width = newDeviceWidth || deviceWidth;
  1138. let result2 = number / BASE_DEVICE_WIDTH * width;
  1139. if (result2 < 0) {
  1140. result2 = -result2;
  1141. }
  1142. result2 = Math.floor(result2 + EPS);
  1143. if (result2 === 0) {
  1144. if (deviceDPR === 1 || !isIOS) {
  1145. result2 = 1;
  1146. } else {
  1147. result2 = 0.5;
  1148. }
  1149. }
  1150. return number < 0 ? -result2 : result2;
  1151. }, Upx2pxProtocol);
  1152. const API_ADD_INTERCEPTOR = "addInterceptor";
  1153. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  1154. const AddInterceptorProtocol = [
  1155. {
  1156. name: "method",
  1157. type: [String, Object],
  1158. required: true
  1159. }
  1160. ];
  1161. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  1162. function mergeInterceptorHook(interceptors2, interceptor) {
  1163. Object.keys(interceptor).forEach((hook) => {
  1164. if (isFunction(interceptor[hook])) {
  1165. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  1166. }
  1167. });
  1168. }
  1169. function removeInterceptorHook(interceptors2, interceptor) {
  1170. if (!interceptors2 || !interceptor) {
  1171. return;
  1172. }
  1173. Object.keys(interceptor).forEach((name) => {
  1174. const hooks = interceptors2[name];
  1175. const hook = interceptor[name];
  1176. if (isArray$1(hooks) && isFunction(hook)) {
  1177. remove(hooks, hook);
  1178. }
  1179. });
  1180. }
  1181. function mergeHook(parentVal, childVal) {
  1182. const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray$1(childVal) ? childVal : [childVal] : parentVal;
  1183. return res ? dedupeHooks(res) : res;
  1184. }
  1185. function dedupeHooks(hooks) {
  1186. const res = [];
  1187. for (let i2 = 0; i2 < hooks.length; i2++) {
  1188. if (res.indexOf(hooks[i2]) === -1) {
  1189. res.push(hooks[i2]);
  1190. }
  1191. }
  1192. return res;
  1193. }
  1194. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  1195. if (isString(method) && isPlainObject$2(interceptor)) {
  1196. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  1197. } else if (isPlainObject$2(method)) {
  1198. mergeInterceptorHook(globalInterceptors, method);
  1199. }
  1200. }, AddInterceptorProtocol);
  1201. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  1202. if (isString(method)) {
  1203. if (isPlainObject$2(interceptor)) {
  1204. removeInterceptorHook(scopedInterceptors[method], interceptor);
  1205. } else {
  1206. delete scopedInterceptors[method];
  1207. }
  1208. } else if (isPlainObject$2(method)) {
  1209. removeInterceptorHook(globalInterceptors, method);
  1210. }
  1211. }, RemoveInterceptorProtocol);
  1212. const interceptors = {};
  1213. const API_ON = "$on";
  1214. const OnProtocol = [
  1215. {
  1216. name: "event",
  1217. type: String,
  1218. required: true
  1219. },
  1220. {
  1221. name: "callback",
  1222. type: Function,
  1223. required: true
  1224. }
  1225. ];
  1226. const API_ONCE = "$once";
  1227. const OnceProtocol = OnProtocol;
  1228. const API_OFF = "$off";
  1229. const OffProtocol = [
  1230. {
  1231. name: "event",
  1232. type: [String, Array]
  1233. },
  1234. {
  1235. name: "callback",
  1236. type: Function
  1237. }
  1238. ];
  1239. const API_EMIT = "$emit";
  1240. const EmitProtocol = [
  1241. {
  1242. name: "event",
  1243. type: String,
  1244. required: true
  1245. }
  1246. ];
  1247. const emitter = new E$1$1();
  1248. const $on = defineSyncApi(API_ON, (name, callback) => {
  1249. emitter.on(name, callback);
  1250. return () => emitter.off(name, callback);
  1251. }, OnProtocol);
  1252. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  1253. emitter.once(name, callback);
  1254. return () => emitter.off(name, callback);
  1255. }, OnceProtocol);
  1256. const $off = defineSyncApi(API_OFF, (name, callback) => {
  1257. if (!name) {
  1258. emitter.e = {};
  1259. return;
  1260. }
  1261. if (!isArray$1(name))
  1262. name = [name];
  1263. name.forEach((n2) => emitter.off(n2, callback));
  1264. }, OffProtocol);
  1265. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  1266. emitter.emit(name, ...args);
  1267. }, EmitProtocol);
  1268. let cid;
  1269. let cidErrMsg;
  1270. let enabled;
  1271. function normalizePushMessage(message) {
  1272. try {
  1273. return JSON.parse(message);
  1274. } catch (e2) {
  1275. }
  1276. return message;
  1277. }
  1278. function invokePushCallback(args) {
  1279. if (args.type === "enabled") {
  1280. enabled = true;
  1281. } else if (args.type === "clientId") {
  1282. cid = args.cid;
  1283. cidErrMsg = args.errMsg;
  1284. invokeGetPushCidCallbacks(cid, args.errMsg);
  1285. } else if (args.type === "pushMsg") {
  1286. const message = {
  1287. type: "receive",
  1288. data: normalizePushMessage(args.message)
  1289. };
  1290. for (let i2 = 0; i2 < onPushMessageCallbacks.length; i2++) {
  1291. const callback = onPushMessageCallbacks[i2];
  1292. callback(message);
  1293. if (message.stopped) {
  1294. break;
  1295. }
  1296. }
  1297. } else if (args.type === "click") {
  1298. onPushMessageCallbacks.forEach((callback) => {
  1299. callback({
  1300. type: "click",
  1301. data: normalizePushMessage(args.message)
  1302. });
  1303. });
  1304. }
  1305. }
  1306. const getPushCidCallbacks = [];
  1307. function invokeGetPushCidCallbacks(cid2, errMsg) {
  1308. getPushCidCallbacks.forEach((callback) => {
  1309. callback(cid2, errMsg);
  1310. });
  1311. getPushCidCallbacks.length = 0;
  1312. }
  1313. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  1314. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_2, { resolve: resolve2, reject }) => {
  1315. Promise.resolve().then(() => {
  1316. if (typeof enabled === "undefined") {
  1317. enabled = false;
  1318. cid = "";
  1319. cidErrMsg = "uniPush is not enabled";
  1320. }
  1321. getPushCidCallbacks.push((cid2, errMsg) => {
  1322. if (cid2) {
  1323. resolve2({ cid: cid2 });
  1324. } else {
  1325. reject(errMsg);
  1326. }
  1327. });
  1328. if (typeof cid !== "undefined") {
  1329. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1330. }
  1331. });
  1332. });
  1333. const onPushMessageCallbacks = [];
  1334. const onPushMessage = (fn) => {
  1335. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1336. onPushMessageCallbacks.push(fn);
  1337. }
  1338. };
  1339. const offPushMessage = (fn) => {
  1340. if (!fn) {
  1341. onPushMessageCallbacks.length = 0;
  1342. } else {
  1343. const index2 = onPushMessageCallbacks.indexOf(fn);
  1344. if (index2 > -1) {
  1345. onPushMessageCallbacks.splice(index2, 1);
  1346. }
  1347. }
  1348. };
  1349. const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
  1350. const CONTEXT_API_RE = /^create|Manager$/;
  1351. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  1352. const ASYNC_API = ["createBLEConnection"];
  1353. const CALLBACK_API_RE = /^on|^off/;
  1354. function isContextApi(name) {
  1355. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1356. }
  1357. function isSyncApi(name) {
  1358. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1359. }
  1360. function isCallbackApi(name) {
  1361. return CALLBACK_API_RE.test(name) && name !== "onPush";
  1362. }
  1363. function shouldPromise(name) {
  1364. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1365. return false;
  1366. }
  1367. return true;
  1368. }
  1369. if (!Promise.prototype.finally) {
  1370. Promise.prototype.finally = function(onfinally) {
  1371. const promise = this.constructor;
  1372. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  1373. throw reason;
  1374. }));
  1375. };
  1376. }
  1377. function promisify(name, api) {
  1378. if (!shouldPromise(name)) {
  1379. return api;
  1380. }
  1381. if (!isFunction(api)) {
  1382. return api;
  1383. }
  1384. return function promiseApi(options = {}, ...rest) {
  1385. if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
  1386. return wrapperReturnValue(name, invokeApi(name, api, options, rest));
  1387. }
  1388. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  1389. invokeApi(name, api, extend({}, options, {
  1390. success: resolve2,
  1391. fail: reject
  1392. }), rest);
  1393. })));
  1394. };
  1395. }
  1396. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  1397. function initWrapper(protocols2) {
  1398. function processCallback(methodName, method, returnValue) {
  1399. return function(res) {
  1400. return method(processReturnValue(methodName, res, returnValue));
  1401. };
  1402. }
  1403. function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
  1404. if (isPlainObject$2(fromArgs)) {
  1405. const toArgs = keepFromArgs === true ? fromArgs : {};
  1406. if (isFunction(argsOption)) {
  1407. argsOption = argsOption(fromArgs, toArgs) || {};
  1408. }
  1409. for (const key in fromArgs) {
  1410. if (hasOwn$1(argsOption, key)) {
  1411. let keyOption = argsOption[key];
  1412. if (isFunction(keyOption)) {
  1413. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1414. }
  1415. if (!keyOption) {
  1416. console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
  1417. } else if (isString(keyOption)) {
  1418. toArgs[keyOption] = fromArgs[key];
  1419. } else if (isPlainObject$2(keyOption)) {
  1420. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1421. }
  1422. } else if (CALLBACKS.indexOf(key) !== -1) {
  1423. const callback = fromArgs[key];
  1424. if (isFunction(callback)) {
  1425. toArgs[key] = processCallback(methodName, callback, returnValue);
  1426. }
  1427. } else {
  1428. if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
  1429. toArgs[key] = fromArgs[key];
  1430. }
  1431. }
  1432. }
  1433. return toArgs;
  1434. } else if (isFunction(fromArgs)) {
  1435. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1436. }
  1437. return fromArgs;
  1438. }
  1439. function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
  1440. if (isFunction(protocols2.returnValue)) {
  1441. res = protocols2.returnValue(methodName, res);
  1442. }
  1443. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1444. }
  1445. return function wrapper(methodName, method) {
  1446. if (!hasOwn$1(protocols2, methodName)) {
  1447. return method;
  1448. }
  1449. const protocol = protocols2[methodName];
  1450. if (!protocol) {
  1451. return function() {
  1452. console.error(`微信小程序 暂不支持${methodName}`);
  1453. };
  1454. }
  1455. return function(arg1, arg2) {
  1456. let options = protocol;
  1457. if (isFunction(protocol)) {
  1458. options = protocol(arg1);
  1459. }
  1460. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1461. const args = [arg1];
  1462. if (typeof arg2 !== "undefined") {
  1463. args.push(arg2);
  1464. }
  1465. const returnValue = wx[options.name || methodName].apply(wx, args);
  1466. if (isSyncApi(methodName)) {
  1467. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1468. }
  1469. return returnValue;
  1470. };
  1471. };
  1472. }
  1473. const getLocale = () => {
  1474. const app = isFunction(getApp) && getApp({ allowDefault: true });
  1475. if (app && app.$vm) {
  1476. return app.$vm.$locale;
  1477. }
  1478. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1479. };
  1480. const setLocale = (locale) => {
  1481. const app = isFunction(getApp) && getApp();
  1482. if (!app) {
  1483. return false;
  1484. }
  1485. const oldLocale = app.$vm.$locale;
  1486. if (oldLocale !== locale) {
  1487. app.$vm.$locale = locale;
  1488. onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
  1489. return true;
  1490. }
  1491. return false;
  1492. };
  1493. const onLocaleChangeCallbacks = [];
  1494. const onLocaleChange = (fn) => {
  1495. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1496. onLocaleChangeCallbacks.push(fn);
  1497. }
  1498. };
  1499. if (typeof global !== "undefined") {
  1500. global.getLocale = getLocale;
  1501. }
  1502. const UUID_KEY = "__DC_STAT_UUID";
  1503. let deviceId;
  1504. function useDeviceId(global2 = wx) {
  1505. return function addDeviceId(_2, toRes) {
  1506. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  1507. if (!deviceId) {
  1508. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  1509. wx.setStorage({
  1510. key: UUID_KEY,
  1511. data: deviceId
  1512. });
  1513. }
  1514. toRes.deviceId = deviceId;
  1515. };
  1516. }
  1517. function addSafeAreaInsets(fromRes, toRes) {
  1518. if (fromRes.safeArea) {
  1519. const safeArea = fromRes.safeArea;
  1520. toRes.safeAreaInsets = {
  1521. top: safeArea.top,
  1522. left: safeArea.left,
  1523. right: fromRes.windowWidth - safeArea.right,
  1524. bottom: fromRes.screenHeight - safeArea.bottom
  1525. };
  1526. }
  1527. }
  1528. function populateParameters(fromRes, toRes) {
  1529. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  1530. let osName = "";
  1531. let osVersion = "";
  1532. {
  1533. osName = system.split(" ")[0] || "";
  1534. osVersion = system.split(" ")[1] || "";
  1535. }
  1536. let hostVersion = version2;
  1537. let deviceType = getGetDeviceType(fromRes, model);
  1538. let deviceBrand = getDeviceBrand(brand);
  1539. let _hostName = getHostName(fromRes);
  1540. let _deviceOrientation = deviceOrientation;
  1541. let _devicePixelRatio = pixelRatio;
  1542. let _SDKVersion = SDKVersion;
  1543. const hostLanguage = language.replace(/_/g, "-");
  1544. const parameters = {
  1545. appId: "__UNI__7806143",
  1546. appName: "常来此购",
  1547. appVersion: "1.8.3",
  1548. appVersionCode: 183,
  1549. appLanguage: getAppLanguage(hostLanguage),
  1550. uniCompileVersion: "4.08",
  1551. uniRuntimeVersion: "4.08",
  1552. uniPlatform: "mp-weixin",
  1553. deviceBrand,
  1554. deviceModel: model,
  1555. deviceType,
  1556. devicePixelRatio: _devicePixelRatio,
  1557. deviceOrientation: _deviceOrientation,
  1558. osName: osName.toLocaleLowerCase(),
  1559. osVersion,
  1560. hostTheme: theme,
  1561. hostVersion,
  1562. hostLanguage,
  1563. hostName: _hostName,
  1564. hostSDKVersion: _SDKVersion,
  1565. hostFontSizeSetting: fontSizeSetting,
  1566. windowTop: 0,
  1567. windowBottom: 0,
  1568. // TODO
  1569. osLanguage: void 0,
  1570. osTheme: void 0,
  1571. ua: void 0,
  1572. hostPackageName: void 0,
  1573. browserName: void 0,
  1574. browserVersion: void 0
  1575. };
  1576. extend(toRes, parameters);
  1577. }
  1578. function getGetDeviceType(fromRes, model) {
  1579. let deviceType = fromRes.deviceType || "phone";
  1580. {
  1581. const deviceTypeMaps = {
  1582. ipad: "pad",
  1583. windows: "pc",
  1584. mac: "pc"
  1585. };
  1586. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1587. const _model = model.toLocaleLowerCase();
  1588. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  1589. const _m = deviceTypeMapsKeys[index2];
  1590. if (_model.indexOf(_m) !== -1) {
  1591. deviceType = deviceTypeMaps[_m];
  1592. break;
  1593. }
  1594. }
  1595. }
  1596. return deviceType;
  1597. }
  1598. function getDeviceBrand(brand) {
  1599. let deviceBrand = brand;
  1600. if (deviceBrand) {
  1601. deviceBrand = deviceBrand.toLocaleLowerCase();
  1602. }
  1603. return deviceBrand;
  1604. }
  1605. function getAppLanguage(defaultLanguage) {
  1606. return getLocale ? getLocale() : defaultLanguage;
  1607. }
  1608. function getHostName(fromRes) {
  1609. const _platform = "WeChat";
  1610. let _hostName = fromRes.hostName || _platform;
  1611. {
  1612. if (fromRes.environment) {
  1613. _hostName = fromRes.environment;
  1614. } else if (fromRes.host && fromRes.host.env) {
  1615. _hostName = fromRes.host.env;
  1616. }
  1617. }
  1618. return _hostName;
  1619. }
  1620. const getSystemInfo = {
  1621. returnValue: (fromRes, toRes) => {
  1622. addSafeAreaInsets(fromRes, toRes);
  1623. useDeviceId()(fromRes, toRes);
  1624. populateParameters(fromRes, toRes);
  1625. }
  1626. };
  1627. const getSystemInfoSync = getSystemInfo;
  1628. const redirectTo = {};
  1629. const previewImage = {
  1630. args(fromArgs, toArgs) {
  1631. let currentIndex = parseInt(fromArgs.current);
  1632. if (isNaN(currentIndex)) {
  1633. return;
  1634. }
  1635. const urls = fromArgs.urls;
  1636. if (!isArray$1(urls)) {
  1637. return;
  1638. }
  1639. const len = urls.length;
  1640. if (!len) {
  1641. return;
  1642. }
  1643. if (currentIndex < 0) {
  1644. currentIndex = 0;
  1645. } else if (currentIndex >= len) {
  1646. currentIndex = len - 1;
  1647. }
  1648. if (currentIndex > 0) {
  1649. toArgs.current = urls[currentIndex];
  1650. toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
  1651. } else {
  1652. toArgs.current = urls[0];
  1653. }
  1654. return {
  1655. indicator: false,
  1656. loop: false
  1657. };
  1658. }
  1659. };
  1660. const showActionSheet = {
  1661. args(fromArgs, toArgs) {
  1662. toArgs.alertText = fromArgs.title;
  1663. }
  1664. };
  1665. const getDeviceInfo = {
  1666. returnValue: (fromRes, toRes) => {
  1667. const { brand, model } = fromRes;
  1668. let deviceType = getGetDeviceType(fromRes, model);
  1669. let deviceBrand = getDeviceBrand(brand);
  1670. useDeviceId()(fromRes, toRes);
  1671. toRes = sortObject(extend(toRes, {
  1672. deviceType,
  1673. deviceBrand,
  1674. deviceModel: model
  1675. }));
  1676. }
  1677. };
  1678. const getAppBaseInfo = {
  1679. returnValue: (fromRes, toRes) => {
  1680. const { version: version2, language, SDKVersion, theme } = fromRes;
  1681. let _hostName = getHostName(fromRes);
  1682. let hostLanguage = language.replace(/_/g, "-");
  1683. toRes = sortObject(extend(toRes, {
  1684. hostVersion: version2,
  1685. hostLanguage,
  1686. hostName: _hostName,
  1687. hostSDKVersion: SDKVersion,
  1688. hostTheme: theme,
  1689. appId: "__UNI__7806143",
  1690. appName: "常来此购",
  1691. appVersion: "1.8.3",
  1692. appVersionCode: 183,
  1693. appLanguage: getAppLanguage(hostLanguage)
  1694. }));
  1695. }
  1696. };
  1697. const getWindowInfo = {
  1698. returnValue: (fromRes, toRes) => {
  1699. addSafeAreaInsets(fromRes, toRes);
  1700. toRes = sortObject(extend(toRes, {
  1701. windowTop: 0,
  1702. windowBottom: 0
  1703. }));
  1704. }
  1705. };
  1706. const getAppAuthorizeSetting = {
  1707. returnValue: function(fromRes, toRes) {
  1708. const { locationReducedAccuracy } = fromRes;
  1709. toRes.locationAccuracy = "unsupported";
  1710. if (locationReducedAccuracy === true) {
  1711. toRes.locationAccuracy = "reduced";
  1712. } else if (locationReducedAccuracy === false) {
  1713. toRes.locationAccuracy = "full";
  1714. }
  1715. }
  1716. };
  1717. const baseApis = {
  1718. $on,
  1719. $off,
  1720. $once,
  1721. $emit,
  1722. upx2px,
  1723. interceptors,
  1724. addInterceptor,
  1725. removeInterceptor,
  1726. onCreateVueApp,
  1727. invokeCreateVueAppHook,
  1728. getLocale,
  1729. setLocale,
  1730. onLocaleChange,
  1731. getPushClientId,
  1732. onPushMessage,
  1733. offPushMessage,
  1734. invokePushCallback
  1735. };
  1736. function initUni(api, protocols2, platform = wx) {
  1737. const wrapper = initWrapper(protocols2);
  1738. const UniProxyHandlers = {
  1739. get(target, key) {
  1740. if (hasOwn$1(target, key)) {
  1741. return target[key];
  1742. }
  1743. if (hasOwn$1(api, key)) {
  1744. return promisify(key, api[key]);
  1745. }
  1746. if (hasOwn$1(baseApis, key)) {
  1747. return promisify(key, baseApis[key]);
  1748. }
  1749. return promisify(key, wrapper(key, platform[key]));
  1750. }
  1751. };
  1752. return new Proxy({}, UniProxyHandlers);
  1753. }
  1754. function initGetProvider(providers) {
  1755. return function getProvider2({ service, success, fail, complete }) {
  1756. let res;
  1757. if (providers[service]) {
  1758. res = {
  1759. errMsg: "getProvider:ok",
  1760. service,
  1761. provider: providers[service]
  1762. };
  1763. isFunction(success) && success(res);
  1764. } else {
  1765. res = {
  1766. errMsg: "getProvider:fail:服务[" + service + "]不存在"
  1767. };
  1768. isFunction(fail) && fail(res);
  1769. }
  1770. isFunction(complete) && complete(res);
  1771. };
  1772. }
  1773. const objectKeys = [
  1774. "qy",
  1775. "env",
  1776. "error",
  1777. "version",
  1778. "lanDebug",
  1779. "cloud",
  1780. "serviceMarket",
  1781. "router",
  1782. "worklet",
  1783. "__webpack_require_UNI_MP_PLUGIN__"
  1784. ];
  1785. const singlePageDisableKey = ["lanDebug", "router", "worklet"];
  1786. const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
  1787. function isWxKey(key) {
  1788. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  1789. return false;
  1790. }
  1791. return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
  1792. }
  1793. function initWx() {
  1794. const newWx = {};
  1795. for (const key in wx) {
  1796. if (isWxKey(key)) {
  1797. newWx[key] = wx[key];
  1798. }
  1799. }
  1800. if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
  1801. globalThis.wx = newWx;
  1802. }
  1803. return newWx;
  1804. }
  1805. const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  1806. const getProvider = initGetProvider({
  1807. oauth: ["weixin"],
  1808. share: ["weixin"],
  1809. payment: ["wxpay"],
  1810. push: ["weixin"]
  1811. });
  1812. function initComponentMocks(component) {
  1813. const res = /* @__PURE__ */ Object.create(null);
  1814. mocks$1.forEach((name) => {
  1815. res[name] = component[name];
  1816. });
  1817. return res;
  1818. }
  1819. function createSelectorQuery() {
  1820. const query = wx$2.createSelectorQuery();
  1821. const oldIn = query.in;
  1822. query.in = function newIn(component) {
  1823. return oldIn.call(this, initComponentMocks(component));
  1824. };
  1825. return query;
  1826. }
  1827. const wx$2 = initWx();
  1828. let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
  1829. if (!baseInfo) {
  1830. baseInfo = wx$2.getSystemInfoSync();
  1831. }
  1832. const host = baseInfo ? baseInfo.host : null;
  1833. const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
  1834. var shims = /* @__PURE__ */ Object.freeze({
  1835. __proto__: null,
  1836. createSelectorQuery,
  1837. getProvider,
  1838. shareVideoMessage
  1839. });
  1840. const compressImage = {
  1841. args(fromArgs, toArgs) {
  1842. if (fromArgs.compressedHeight && !toArgs.compressHeight) {
  1843. toArgs.compressHeight = fromArgs.compressedHeight;
  1844. }
  1845. if (fromArgs.compressedWidth && !toArgs.compressWidth) {
  1846. toArgs.compressWidth = fromArgs.compressedWidth;
  1847. }
  1848. }
  1849. };
  1850. var protocols = /* @__PURE__ */ Object.freeze({
  1851. __proto__: null,
  1852. compressImage,
  1853. getAppAuthorizeSetting,
  1854. getAppBaseInfo,
  1855. getDeviceInfo,
  1856. getSystemInfo,
  1857. getSystemInfoSync,
  1858. getWindowInfo,
  1859. previewImage,
  1860. redirectTo,
  1861. showActionSheet
  1862. });
  1863. const wx$1 = initWx();
  1864. var index$1 = initUni(shims, protocols, wx$1);
  1865. const _export_sfc = (sfc, props) => {
  1866. const target = sfc.__vccOpts || sfc;
  1867. for (const [key, val] of props) {
  1868. target[key] = val;
  1869. }
  1870. return target;
  1871. };
  1872. function warn$1(msg, ...args) {
  1873. console.warn(`[Vue warn] ${msg}`, ...args);
  1874. }
  1875. let activeEffectScope;
  1876. class EffectScope {
  1877. constructor(detached = false) {
  1878. this.detached = detached;
  1879. this._active = true;
  1880. this.effects = [];
  1881. this.cleanups = [];
  1882. this.parent = activeEffectScope;
  1883. if (!detached && activeEffectScope) {
  1884. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1885. }
  1886. }
  1887. get active() {
  1888. return this._active;
  1889. }
  1890. run(fn) {
  1891. if (this._active) {
  1892. const currentEffectScope = activeEffectScope;
  1893. try {
  1894. activeEffectScope = this;
  1895. return fn();
  1896. } finally {
  1897. activeEffectScope = currentEffectScope;
  1898. }
  1899. } else {
  1900. warn$1(`cannot run an inactive effect scope.`);
  1901. }
  1902. }
  1903. /**
  1904. * This should only be called on non-detached scopes
  1905. * @internal
  1906. */
  1907. on() {
  1908. activeEffectScope = this;
  1909. }
  1910. /**
  1911. * This should only be called on non-detached scopes
  1912. * @internal
  1913. */
  1914. off() {
  1915. activeEffectScope = this.parent;
  1916. }
  1917. stop(fromParent) {
  1918. if (this._active) {
  1919. let i2, l2;
  1920. for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
  1921. this.effects[i2].stop();
  1922. }
  1923. for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
  1924. this.cleanups[i2]();
  1925. }
  1926. if (this.scopes) {
  1927. for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
  1928. this.scopes[i2].stop(true);
  1929. }
  1930. }
  1931. if (!this.detached && this.parent && !fromParent) {
  1932. const last = this.parent.scopes.pop();
  1933. if (last && last !== this) {
  1934. this.parent.scopes[this.index] = last;
  1935. last.index = this.index;
  1936. }
  1937. }
  1938. this.parent = void 0;
  1939. this._active = false;
  1940. }
  1941. }
  1942. }
  1943. function effectScope(detached) {
  1944. return new EffectScope(detached);
  1945. }
  1946. function recordEffectScope(effect, scope = activeEffectScope) {
  1947. if (scope && scope.active) {
  1948. scope.effects.push(effect);
  1949. }
  1950. }
  1951. function getCurrentScope() {
  1952. return activeEffectScope;
  1953. }
  1954. function onScopeDispose(fn) {
  1955. if (activeEffectScope) {
  1956. activeEffectScope.cleanups.push(fn);
  1957. } else {
  1958. warn$1(`onScopeDispose() is called when there is no active effect scope to be associated with.`);
  1959. }
  1960. }
  1961. const createDep = (effects) => {
  1962. const dep = new Set(effects);
  1963. dep.w = 0;
  1964. dep.n = 0;
  1965. return dep;
  1966. };
  1967. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  1968. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  1969. const initDepMarkers = ({ deps }) => {
  1970. if (deps.length) {
  1971. for (let i2 = 0; i2 < deps.length; i2++) {
  1972. deps[i2].w |= trackOpBit;
  1973. }
  1974. }
  1975. };
  1976. const finalizeDepMarkers = (effect) => {
  1977. const { deps } = effect;
  1978. if (deps.length) {
  1979. let ptr = 0;
  1980. for (let i2 = 0; i2 < deps.length; i2++) {
  1981. const dep = deps[i2];
  1982. if (wasTracked(dep) && !newTracked(dep)) {
  1983. dep.delete(effect);
  1984. } else {
  1985. deps[ptr++] = dep;
  1986. }
  1987. dep.w &= ~trackOpBit;
  1988. dep.n &= ~trackOpBit;
  1989. }
  1990. deps.length = ptr;
  1991. }
  1992. };
  1993. const targetMap = /* @__PURE__ */ new WeakMap();
  1994. let effectTrackDepth = 0;
  1995. let trackOpBit = 1;
  1996. const maxMarkerBits = 30;
  1997. let activeEffect;
  1998. const ITERATE_KEY = Symbol("iterate");
  1999. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  2000. class ReactiveEffect {
  2001. constructor(fn, scheduler = null, scope) {
  2002. this.fn = fn;
  2003. this.scheduler = scheduler;
  2004. this.active = true;
  2005. this.deps = [];
  2006. this.parent = void 0;
  2007. recordEffectScope(this, scope);
  2008. }
  2009. run() {
  2010. if (!this.active) {
  2011. return this.fn();
  2012. }
  2013. let parent = activeEffect;
  2014. let lastShouldTrack = shouldTrack;
  2015. while (parent) {
  2016. if (parent === this) {
  2017. return;
  2018. }
  2019. parent = parent.parent;
  2020. }
  2021. try {
  2022. this.parent = activeEffect;
  2023. activeEffect = this;
  2024. shouldTrack = true;
  2025. trackOpBit = 1 << ++effectTrackDepth;
  2026. if (effectTrackDepth <= maxMarkerBits) {
  2027. initDepMarkers(this);
  2028. } else {
  2029. cleanupEffect(this);
  2030. }
  2031. return this.fn();
  2032. } finally {
  2033. if (effectTrackDepth <= maxMarkerBits) {
  2034. finalizeDepMarkers(this);
  2035. }
  2036. trackOpBit = 1 << --effectTrackDepth;
  2037. activeEffect = this.parent;
  2038. shouldTrack = lastShouldTrack;
  2039. this.parent = void 0;
  2040. if (this.deferStop) {
  2041. this.stop();
  2042. }
  2043. }
  2044. }
  2045. stop() {
  2046. if (activeEffect === this) {
  2047. this.deferStop = true;
  2048. } else if (this.active) {
  2049. cleanupEffect(this);
  2050. if (this.onStop) {
  2051. this.onStop();
  2052. }
  2053. this.active = false;
  2054. }
  2055. }
  2056. }
  2057. function cleanupEffect(effect) {
  2058. const { deps } = effect;
  2059. if (deps.length) {
  2060. for (let i2 = 0; i2 < deps.length; i2++) {
  2061. deps[i2].delete(effect);
  2062. }
  2063. deps.length = 0;
  2064. }
  2065. }
  2066. let shouldTrack = true;
  2067. const trackStack = [];
  2068. function pauseTracking() {
  2069. trackStack.push(shouldTrack);
  2070. shouldTrack = false;
  2071. }
  2072. function resetTracking() {
  2073. const last = trackStack.pop();
  2074. shouldTrack = last === void 0 ? true : last;
  2075. }
  2076. function track(target, type, key) {
  2077. if (shouldTrack && activeEffect) {
  2078. let depsMap = targetMap.get(target);
  2079. if (!depsMap) {
  2080. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  2081. }
  2082. let dep = depsMap.get(key);
  2083. if (!dep) {
  2084. depsMap.set(key, dep = createDep());
  2085. }
  2086. const eventInfo = { effect: activeEffect, target, type, key };
  2087. trackEffects(dep, eventInfo);
  2088. }
  2089. }
  2090. function trackEffects(dep, debuggerEventExtraInfo) {
  2091. let shouldTrack2 = false;
  2092. if (effectTrackDepth <= maxMarkerBits) {
  2093. if (!newTracked(dep)) {
  2094. dep.n |= trackOpBit;
  2095. shouldTrack2 = !wasTracked(dep);
  2096. }
  2097. } else {
  2098. shouldTrack2 = !dep.has(activeEffect);
  2099. }
  2100. if (shouldTrack2) {
  2101. dep.add(activeEffect);
  2102. activeEffect.deps.push(dep);
  2103. if (activeEffect.onTrack) {
  2104. activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
  2105. }
  2106. }
  2107. }
  2108. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  2109. const depsMap = targetMap.get(target);
  2110. if (!depsMap) {
  2111. return;
  2112. }
  2113. let deps = [];
  2114. if (type === "clear") {
  2115. deps = [...depsMap.values()];
  2116. } else if (key === "length" && isArray$1(target)) {
  2117. const newLength = Number(newValue);
  2118. depsMap.forEach((dep, key2) => {
  2119. if (key2 === "length" || key2 >= newLength) {
  2120. deps.push(dep);
  2121. }
  2122. });
  2123. } else {
  2124. if (key !== void 0) {
  2125. deps.push(depsMap.get(key));
  2126. }
  2127. switch (type) {
  2128. case "add":
  2129. if (!isArray$1(target)) {
  2130. deps.push(depsMap.get(ITERATE_KEY));
  2131. if (isMap(target)) {
  2132. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  2133. }
  2134. } else if (isIntegerKey(key)) {
  2135. deps.push(depsMap.get("length"));
  2136. }
  2137. break;
  2138. case "delete":
  2139. if (!isArray$1(target)) {
  2140. deps.push(depsMap.get(ITERATE_KEY));
  2141. if (isMap(target)) {
  2142. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  2143. }
  2144. }
  2145. break;
  2146. case "set":
  2147. if (isMap(target)) {
  2148. deps.push(depsMap.get(ITERATE_KEY));
  2149. }
  2150. break;
  2151. }
  2152. }
  2153. const eventInfo = { target, type, key, newValue, oldValue, oldTarget };
  2154. if (deps.length === 1) {
  2155. if (deps[0]) {
  2156. {
  2157. triggerEffects(deps[0], eventInfo);
  2158. }
  2159. }
  2160. } else {
  2161. const effects = [];
  2162. for (const dep of deps) {
  2163. if (dep) {
  2164. effects.push(...dep);
  2165. }
  2166. }
  2167. {
  2168. triggerEffects(createDep(effects), eventInfo);
  2169. }
  2170. }
  2171. }
  2172. function triggerEffects(dep, debuggerEventExtraInfo) {
  2173. const effects = isArray$1(dep) ? dep : [...dep];
  2174. for (const effect of effects) {
  2175. if (effect.computed) {
  2176. triggerEffect(effect, debuggerEventExtraInfo);
  2177. }
  2178. }
  2179. for (const effect of effects) {
  2180. if (!effect.computed) {
  2181. triggerEffect(effect, debuggerEventExtraInfo);
  2182. }
  2183. }
  2184. }
  2185. function triggerEffect(effect, debuggerEventExtraInfo) {
  2186. if (effect !== activeEffect || effect.allowRecurse) {
  2187. if (effect.onTrigger) {
  2188. effect.onTrigger(extend({ effect }, debuggerEventExtraInfo));
  2189. }
  2190. if (effect.scheduler) {
  2191. effect.scheduler();
  2192. } else {
  2193. effect.run();
  2194. }
  2195. }
  2196. }
  2197. function getDepFromReactive(object, key) {
  2198. var _a2;
  2199. return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key);
  2200. }
  2201. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  2202. const builtInSymbols = new Set(
  2203. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  2204. );
  2205. const get$1 = /* @__PURE__ */ createGetter();
  2206. const shallowGet = /* @__PURE__ */ createGetter(false, true);
  2207. const readonlyGet = /* @__PURE__ */ createGetter(true);
  2208. const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
  2209. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  2210. function createArrayInstrumentations() {
  2211. const instrumentations = {};
  2212. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  2213. instrumentations[key] = function(...args) {
  2214. const arr = toRaw(this);
  2215. for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
  2216. track(arr, "get", i2 + "");
  2217. }
  2218. const res = arr[key](...args);
  2219. if (res === -1 || res === false) {
  2220. return arr[key](...args.map(toRaw));
  2221. } else {
  2222. return res;
  2223. }
  2224. };
  2225. });
  2226. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  2227. instrumentations[key] = function(...args) {
  2228. pauseTracking();
  2229. const res = toRaw(this)[key].apply(this, args);
  2230. resetTracking();
  2231. return res;
  2232. };
  2233. });
  2234. return instrumentations;
  2235. }
  2236. function hasOwnProperty(key) {
  2237. const obj = toRaw(this);
  2238. track(obj, "has", key);
  2239. return obj.hasOwnProperty(key);
  2240. }
  2241. function createGetter(isReadonly2 = false, shallow = false) {
  2242. return function get2(target, key, receiver) {
  2243. if (key === "__v_isReactive") {
  2244. return !isReadonly2;
  2245. } else if (key === "__v_isReadonly") {
  2246. return isReadonly2;
  2247. } else if (key === "__v_isShallow") {
  2248. return shallow;
  2249. } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
  2250. return target;
  2251. }
  2252. const targetIsArray = isArray$1(target);
  2253. if (!isReadonly2) {
  2254. if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
  2255. return Reflect.get(arrayInstrumentations, key, receiver);
  2256. }
  2257. if (key === "hasOwnProperty") {
  2258. return hasOwnProperty;
  2259. }
  2260. }
  2261. const res = Reflect.get(target, key, receiver);
  2262. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  2263. return res;
  2264. }
  2265. if (!isReadonly2) {
  2266. track(target, "get", key);
  2267. }
  2268. if (shallow) {
  2269. return res;
  2270. }
  2271. if (isRef(res)) {
  2272. return targetIsArray && isIntegerKey(key) ? res : res.value;
  2273. }
  2274. if (isObject$3(res)) {
  2275. return isReadonly2 ? readonly(res) : reactive(res);
  2276. }
  2277. return res;
  2278. };
  2279. }
  2280. const set$1 = /* @__PURE__ */ createSetter();
  2281. const shallowSet = /* @__PURE__ */ createSetter(true);
  2282. function createSetter(shallow = false) {
  2283. return function set2(target, key, value, receiver) {
  2284. let oldValue = target[key];
  2285. if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
  2286. return false;
  2287. }
  2288. if (!shallow) {
  2289. if (!isShallow(value) && !isReadonly(value)) {
  2290. oldValue = toRaw(oldValue);
  2291. value = toRaw(value);
  2292. }
  2293. if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) {
  2294. oldValue.value = value;
  2295. return true;
  2296. }
  2297. }
  2298. const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
  2299. const result2 = Reflect.set(target, key, value, receiver);
  2300. if (target === toRaw(receiver)) {
  2301. if (!hadKey) {
  2302. trigger(target, "add", key, value);
  2303. } else if (hasChanged(value, oldValue)) {
  2304. trigger(target, "set", key, value, oldValue);
  2305. }
  2306. }
  2307. return result2;
  2308. };
  2309. }
  2310. function deleteProperty(target, key) {
  2311. const hadKey = hasOwn$1(target, key);
  2312. const oldValue = target[key];
  2313. const result2 = Reflect.deleteProperty(target, key);
  2314. if (result2 && hadKey) {
  2315. trigger(target, "delete", key, void 0, oldValue);
  2316. }
  2317. return result2;
  2318. }
  2319. function has$1(target, key) {
  2320. const result2 = Reflect.has(target, key);
  2321. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  2322. track(target, "has", key);
  2323. }
  2324. return result2;
  2325. }
  2326. function ownKeys$5(target) {
  2327. track(target, "iterate", isArray$1(target) ? "length" : ITERATE_KEY);
  2328. return Reflect.ownKeys(target);
  2329. }
  2330. const mutableHandlers = {
  2331. get: get$1,
  2332. set: set$1,
  2333. deleteProperty,
  2334. has: has$1,
  2335. ownKeys: ownKeys$5
  2336. };
  2337. const readonlyHandlers = {
  2338. get: readonlyGet,
  2339. set(target, key) {
  2340. {
  2341. warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
  2342. }
  2343. return true;
  2344. },
  2345. deleteProperty(target, key) {
  2346. {
  2347. warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
  2348. }
  2349. return true;
  2350. }
  2351. };
  2352. const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, {
  2353. get: shallowGet,
  2354. set: shallowSet
  2355. });
  2356. const shallowReadonlyHandlers = /* @__PURE__ */ extend({}, readonlyHandlers, {
  2357. get: shallowReadonlyGet
  2358. });
  2359. const toShallow = (value) => value;
  2360. const getProto = (v2) => Reflect.getPrototypeOf(v2);
  2361. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  2362. target = target[
  2363. "__v_raw"
  2364. /* ReactiveFlags.RAW */
  2365. ];
  2366. const rawTarget = toRaw(target);
  2367. const rawKey = toRaw(key);
  2368. if (!isReadonly2) {
  2369. if (key !== rawKey) {
  2370. track(rawTarget, "get", key);
  2371. }
  2372. track(rawTarget, "get", rawKey);
  2373. }
  2374. const { has: has2 } = getProto(rawTarget);
  2375. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2376. if (has2.call(rawTarget, key)) {
  2377. return wrap(target.get(key));
  2378. } else if (has2.call(rawTarget, rawKey)) {
  2379. return wrap(target.get(rawKey));
  2380. } else if (target !== rawTarget) {
  2381. target.get(key);
  2382. }
  2383. }
  2384. function has(key, isReadonly2 = false) {
  2385. const target = this[
  2386. "__v_raw"
  2387. /* ReactiveFlags.RAW */
  2388. ];
  2389. const rawTarget = toRaw(target);
  2390. const rawKey = toRaw(key);
  2391. if (!isReadonly2) {
  2392. if (key !== rawKey) {
  2393. track(rawTarget, "has", key);
  2394. }
  2395. track(rawTarget, "has", rawKey);
  2396. }
  2397. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  2398. }
  2399. function size(target, isReadonly2 = false) {
  2400. target = target[
  2401. "__v_raw"
  2402. /* ReactiveFlags.RAW */
  2403. ];
  2404. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  2405. return Reflect.get(target, "size", target);
  2406. }
  2407. function add(value) {
  2408. value = toRaw(value);
  2409. const target = toRaw(this);
  2410. const proto = getProto(target);
  2411. const hadKey = proto.has.call(target, value);
  2412. if (!hadKey) {
  2413. target.add(value);
  2414. trigger(target, "add", value, value);
  2415. }
  2416. return this;
  2417. }
  2418. function set$2(key, value) {
  2419. value = toRaw(value);
  2420. const target = toRaw(this);
  2421. const { has: has2, get: get2 } = getProto(target);
  2422. let hadKey = has2.call(target, key);
  2423. if (!hadKey) {
  2424. key = toRaw(key);
  2425. hadKey = has2.call(target, key);
  2426. } else {
  2427. checkIdentityKeys(target, has2, key);
  2428. }
  2429. const oldValue = get2.call(target, key);
  2430. target.set(key, value);
  2431. if (!hadKey) {
  2432. trigger(target, "add", key, value);
  2433. } else if (hasChanged(value, oldValue)) {
  2434. trigger(target, "set", key, value, oldValue);
  2435. }
  2436. return this;
  2437. }
  2438. function deleteEntry(key) {
  2439. const target = toRaw(this);
  2440. const { has: has2, get: get2 } = getProto(target);
  2441. let hadKey = has2.call(target, key);
  2442. if (!hadKey) {
  2443. key = toRaw(key);
  2444. hadKey = has2.call(target, key);
  2445. } else {
  2446. checkIdentityKeys(target, has2, key);
  2447. }
  2448. const oldValue = get2 ? get2.call(target, key) : void 0;
  2449. const result2 = target.delete(key);
  2450. if (hadKey) {
  2451. trigger(target, "delete", key, void 0, oldValue);
  2452. }
  2453. return result2;
  2454. }
  2455. function clear() {
  2456. const target = toRaw(this);
  2457. const hadItems = target.size !== 0;
  2458. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  2459. const result2 = target.clear();
  2460. if (hadItems) {
  2461. trigger(target, "clear", void 0, void 0, oldTarget);
  2462. }
  2463. return result2;
  2464. }
  2465. function createForEach(isReadonly2, isShallow2) {
  2466. return function forEach3(callback, thisArg) {
  2467. const observed = this;
  2468. const target = observed[
  2469. "__v_raw"
  2470. /* ReactiveFlags.RAW */
  2471. ];
  2472. const rawTarget = toRaw(target);
  2473. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2474. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  2475. return target.forEach((value, key) => {
  2476. return callback.call(thisArg, wrap(value), wrap(key), observed);
  2477. });
  2478. };
  2479. }
  2480. function createIterableMethod(method, isReadonly2, isShallow2) {
  2481. return function(...args) {
  2482. const target = this[
  2483. "__v_raw"
  2484. /* ReactiveFlags.RAW */
  2485. ];
  2486. const rawTarget = toRaw(target);
  2487. const targetIsMap = isMap(rawTarget);
  2488. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  2489. const isKeyOnly = method === "keys" && targetIsMap;
  2490. const innerIterator = target[method](...args);
  2491. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2492. !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
  2493. return {
  2494. // iterator protocol
  2495. next() {
  2496. const { value, done } = innerIterator.next();
  2497. return done ? { value, done } : {
  2498. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  2499. done
  2500. };
  2501. },
  2502. // iterable protocol
  2503. [Symbol.iterator]() {
  2504. return this;
  2505. }
  2506. };
  2507. };
  2508. }
  2509. function createReadonlyMethod(type) {
  2510. return function(...args) {
  2511. {
  2512. const key = args[0] ? `on key "${args[0]}" ` : ``;
  2513. console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
  2514. }
  2515. return type === "delete" ? false : this;
  2516. };
  2517. }
  2518. function createInstrumentations() {
  2519. const mutableInstrumentations2 = {
  2520. get(key) {
  2521. return get(this, key);
  2522. },
  2523. get size() {
  2524. return size(this);
  2525. },
  2526. has,
  2527. add,
  2528. set: set$2,
  2529. delete: deleteEntry,
  2530. clear,
  2531. forEach: createForEach(false, false)
  2532. };
  2533. const shallowInstrumentations2 = {
  2534. get(key) {
  2535. return get(this, key, false, true);
  2536. },
  2537. get size() {
  2538. return size(this);
  2539. },
  2540. has,
  2541. add,
  2542. set: set$2,
  2543. delete: deleteEntry,
  2544. clear,
  2545. forEach: createForEach(false, true)
  2546. };
  2547. const readonlyInstrumentations2 = {
  2548. get(key) {
  2549. return get(this, key, true);
  2550. },
  2551. get size() {
  2552. return size(this, true);
  2553. },
  2554. has(key) {
  2555. return has.call(this, key, true);
  2556. },
  2557. add: createReadonlyMethod(
  2558. "add"
  2559. /* TriggerOpTypes.ADD */
  2560. ),
  2561. set: createReadonlyMethod(
  2562. "set"
  2563. /* TriggerOpTypes.SET */
  2564. ),
  2565. delete: createReadonlyMethod(
  2566. "delete"
  2567. /* TriggerOpTypes.DELETE */
  2568. ),
  2569. clear: createReadonlyMethod(
  2570. "clear"
  2571. /* TriggerOpTypes.CLEAR */
  2572. ),
  2573. forEach: createForEach(true, false)
  2574. };
  2575. const shallowReadonlyInstrumentations2 = {
  2576. get(key) {
  2577. return get(this, key, true, true);
  2578. },
  2579. get size() {
  2580. return size(this, true);
  2581. },
  2582. has(key) {
  2583. return has.call(this, key, true);
  2584. },
  2585. add: createReadonlyMethod(
  2586. "add"
  2587. /* TriggerOpTypes.ADD */
  2588. ),
  2589. set: createReadonlyMethod(
  2590. "set"
  2591. /* TriggerOpTypes.SET */
  2592. ),
  2593. delete: createReadonlyMethod(
  2594. "delete"
  2595. /* TriggerOpTypes.DELETE */
  2596. ),
  2597. clear: createReadonlyMethod(
  2598. "clear"
  2599. /* TriggerOpTypes.CLEAR */
  2600. ),
  2601. forEach: createForEach(true, true)
  2602. };
  2603. const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
  2604. iteratorMethods.forEach((method) => {
  2605. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  2606. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  2607. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  2608. shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
  2609. });
  2610. return [
  2611. mutableInstrumentations2,
  2612. readonlyInstrumentations2,
  2613. shallowInstrumentations2,
  2614. shallowReadonlyInstrumentations2
  2615. ];
  2616. }
  2617. const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
  2618. function createInstrumentationGetter(isReadonly2, shallow) {
  2619. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  2620. return (target, key, receiver) => {
  2621. if (key === "__v_isReactive") {
  2622. return !isReadonly2;
  2623. } else if (key === "__v_isReadonly") {
  2624. return isReadonly2;
  2625. } else if (key === "__v_raw") {
  2626. return target;
  2627. }
  2628. return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
  2629. };
  2630. }
  2631. const mutableCollectionHandlers = {
  2632. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  2633. };
  2634. const shallowCollectionHandlers = {
  2635. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  2636. };
  2637. const readonlyCollectionHandlers = {
  2638. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  2639. };
  2640. const shallowReadonlyCollectionHandlers = {
  2641. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  2642. };
  2643. function checkIdentityKeys(target, has2, key) {
  2644. const rawKey = toRaw(key);
  2645. if (rawKey !== key && has2.call(target, rawKey)) {
  2646. const type = toRawType(target);
  2647. console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
  2648. }
  2649. }
  2650. const reactiveMap = /* @__PURE__ */ new WeakMap();
  2651. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  2652. const readonlyMap = /* @__PURE__ */ new WeakMap();
  2653. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  2654. function targetTypeMap(rawType) {
  2655. switch (rawType) {
  2656. case "Object":
  2657. case "Array":
  2658. return 1;
  2659. case "Map":
  2660. case "Set":
  2661. case "WeakMap":
  2662. case "WeakSet":
  2663. return 2;
  2664. default:
  2665. return 0;
  2666. }
  2667. }
  2668. function getTargetType(value) {
  2669. return value[
  2670. "__v_skip"
  2671. /* ReactiveFlags.SKIP */
  2672. ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  2673. }
  2674. function reactive(target) {
  2675. if (isReadonly(target)) {
  2676. return target;
  2677. }
  2678. return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
  2679. }
  2680. function shallowReactive(target) {
  2681. return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
  2682. }
  2683. function readonly(target) {
  2684. return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
  2685. }
  2686. function shallowReadonly(target) {
  2687. return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
  2688. }
  2689. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  2690. if (!isObject$3(target)) {
  2691. {
  2692. console.warn(`value cannot be made reactive: ${String(target)}`);
  2693. }
  2694. return target;
  2695. }
  2696. if (target[
  2697. "__v_raw"
  2698. /* ReactiveFlags.RAW */
  2699. ] && !(isReadonly2 && target[
  2700. "__v_isReactive"
  2701. /* ReactiveFlags.IS_REACTIVE */
  2702. ])) {
  2703. return target;
  2704. }
  2705. const existingProxy = proxyMap.get(target);
  2706. if (existingProxy) {
  2707. return existingProxy;
  2708. }
  2709. const targetType = getTargetType(target);
  2710. if (targetType === 0) {
  2711. return target;
  2712. }
  2713. const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
  2714. proxyMap.set(target, proxy);
  2715. return proxy;
  2716. }
  2717. function isReactive(value) {
  2718. if (isReadonly(value)) {
  2719. return isReactive(value[
  2720. "__v_raw"
  2721. /* ReactiveFlags.RAW */
  2722. ]);
  2723. }
  2724. return !!(value && value[
  2725. "__v_isReactive"
  2726. /* ReactiveFlags.IS_REACTIVE */
  2727. ]);
  2728. }
  2729. function isReadonly(value) {
  2730. return !!(value && value[
  2731. "__v_isReadonly"
  2732. /* ReactiveFlags.IS_READONLY */
  2733. ]);
  2734. }
  2735. function isShallow(value) {
  2736. return !!(value && value[
  2737. "__v_isShallow"
  2738. /* ReactiveFlags.IS_SHALLOW */
  2739. ]);
  2740. }
  2741. function isProxy(value) {
  2742. return isReactive(value) || isReadonly(value);
  2743. }
  2744. function toRaw(observed) {
  2745. const raw = observed && observed[
  2746. "__v_raw"
  2747. /* ReactiveFlags.RAW */
  2748. ];
  2749. return raw ? toRaw(raw) : observed;
  2750. }
  2751. function markRaw(value) {
  2752. def(value, "__v_skip", true);
  2753. return value;
  2754. }
  2755. const toReactive = (value) => isObject$3(value) ? reactive(value) : value;
  2756. const toReadonly = (value) => isObject$3(value) ? readonly(value) : value;
  2757. function trackRefValue(ref2) {
  2758. if (shouldTrack && activeEffect) {
  2759. ref2 = toRaw(ref2);
  2760. {
  2761. trackEffects(ref2.dep || (ref2.dep = createDep()), {
  2762. target: ref2,
  2763. type: "get",
  2764. key: "value"
  2765. });
  2766. }
  2767. }
  2768. }
  2769. function triggerRefValue(ref2, newVal) {
  2770. ref2 = toRaw(ref2);
  2771. const dep = ref2.dep;
  2772. if (dep) {
  2773. {
  2774. triggerEffects(dep, {
  2775. target: ref2,
  2776. type: "set",
  2777. key: "value",
  2778. newValue: newVal
  2779. });
  2780. }
  2781. }
  2782. }
  2783. function isRef(r2) {
  2784. return !!(r2 && r2.__v_isRef === true);
  2785. }
  2786. function ref(value) {
  2787. return createRef(value, false);
  2788. }
  2789. function createRef(rawValue, shallow) {
  2790. if (isRef(rawValue)) {
  2791. return rawValue;
  2792. }
  2793. return new RefImpl(rawValue, shallow);
  2794. }
  2795. class RefImpl {
  2796. constructor(value, __v_isShallow) {
  2797. this.__v_isShallow = __v_isShallow;
  2798. this.dep = void 0;
  2799. this.__v_isRef = true;
  2800. this._rawValue = __v_isShallow ? value : toRaw(value);
  2801. this._value = __v_isShallow ? value : toReactive(value);
  2802. }
  2803. get value() {
  2804. trackRefValue(this);
  2805. return this._value;
  2806. }
  2807. set value(newVal) {
  2808. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  2809. newVal = useDirectValue ? newVal : toRaw(newVal);
  2810. if (hasChanged(newVal, this._rawValue)) {
  2811. this._rawValue = newVal;
  2812. this._value = useDirectValue ? newVal : toReactive(newVal);
  2813. triggerRefValue(this, newVal);
  2814. }
  2815. }
  2816. }
  2817. function unref(ref2) {
  2818. return isRef(ref2) ? ref2.value : ref2;
  2819. }
  2820. const shallowUnwrapHandlers = {
  2821. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  2822. set: (target, key, value, receiver) => {
  2823. const oldValue = target[key];
  2824. if (isRef(oldValue) && !isRef(value)) {
  2825. oldValue.value = value;
  2826. return true;
  2827. } else {
  2828. return Reflect.set(target, key, value, receiver);
  2829. }
  2830. }
  2831. };
  2832. function proxyRefs(objectWithRefs) {
  2833. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  2834. }
  2835. function toRefs(object) {
  2836. if (!isProxy(object)) {
  2837. console.warn(`toRefs() expects a reactive object but received a plain one.`);
  2838. }
  2839. const ret = isArray$1(object) ? new Array(object.length) : {};
  2840. for (const key in object) {
  2841. ret[key] = toRef(object, key);
  2842. }
  2843. return ret;
  2844. }
  2845. class ObjectRefImpl {
  2846. constructor(_object, _key, _defaultValue) {
  2847. this._object = _object;
  2848. this._key = _key;
  2849. this._defaultValue = _defaultValue;
  2850. this.__v_isRef = true;
  2851. }
  2852. get value() {
  2853. const val = this._object[this._key];
  2854. return val === void 0 ? this._defaultValue : val;
  2855. }
  2856. set value(newVal) {
  2857. this._object[this._key] = newVal;
  2858. }
  2859. get dep() {
  2860. return getDepFromReactive(toRaw(this._object), this._key);
  2861. }
  2862. }
  2863. function toRef(object, key, defaultValue) {
  2864. const val = object[key];
  2865. return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
  2866. }
  2867. var _a$1;
  2868. class ComputedRefImpl {
  2869. constructor(getter, _setter, isReadonly2, isSSR) {
  2870. this._setter = _setter;
  2871. this.dep = void 0;
  2872. this.__v_isRef = true;
  2873. this[_a$1] = false;
  2874. this._dirty = true;
  2875. this.effect = new ReactiveEffect(getter, () => {
  2876. if (!this._dirty) {
  2877. this._dirty = true;
  2878. triggerRefValue(this);
  2879. }
  2880. });
  2881. this.effect.computed = this;
  2882. this.effect.active = this._cacheable = !isSSR;
  2883. this[
  2884. "__v_isReadonly"
  2885. /* ReactiveFlags.IS_READONLY */
  2886. ] = isReadonly2;
  2887. }
  2888. get value() {
  2889. const self2 = toRaw(this);
  2890. trackRefValue(self2);
  2891. if (self2._dirty || !self2._cacheable) {
  2892. self2._dirty = false;
  2893. self2._value = self2.effect.run();
  2894. }
  2895. return self2._value;
  2896. }
  2897. set value(newValue) {
  2898. this._setter(newValue);
  2899. }
  2900. }
  2901. _a$1 = "__v_isReadonly";
  2902. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  2903. let getter;
  2904. let setter;
  2905. const onlyGetter = isFunction(getterOrOptions);
  2906. if (onlyGetter) {
  2907. getter = getterOrOptions;
  2908. setter = () => {
  2909. console.warn("Write operation failed: computed value is readonly");
  2910. };
  2911. } else {
  2912. getter = getterOrOptions.get;
  2913. setter = getterOrOptions.set;
  2914. }
  2915. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  2916. if (debugOptions && !isSSR) {
  2917. cRef.effect.onTrack = debugOptions.onTrack;
  2918. cRef.effect.onTrigger = debugOptions.onTrigger;
  2919. }
  2920. return cRef;
  2921. }
  2922. const stack = [];
  2923. function pushWarningContext(vnode) {
  2924. stack.push(vnode);
  2925. }
  2926. function popWarningContext() {
  2927. stack.pop();
  2928. }
  2929. function warn(msg, ...args) {
  2930. pauseTracking();
  2931. const instance = stack.length ? stack[stack.length - 1].component : null;
  2932. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2933. const trace = getComponentTrace();
  2934. if (appWarnHandler) {
  2935. callWithErrorHandling(appWarnHandler, instance, 11, [
  2936. msg + args.join(""),
  2937. instance && instance.proxy,
  2938. trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
  2939. trace
  2940. ]);
  2941. } else {
  2942. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2943. if (trace.length && // avoid spamming console during tests
  2944. true) {
  2945. warnArgs.push(`
  2946. `, ...formatTrace(trace));
  2947. }
  2948. console.warn(...warnArgs);
  2949. }
  2950. resetTracking();
  2951. }
  2952. function getComponentTrace() {
  2953. let currentVNode = stack[stack.length - 1];
  2954. if (!currentVNode) {
  2955. return [];
  2956. }
  2957. const normalizedStack = [];
  2958. while (currentVNode) {
  2959. const last = normalizedStack[0];
  2960. if (last && last.vnode === currentVNode) {
  2961. last.recurseCount++;
  2962. } else {
  2963. normalizedStack.push({
  2964. vnode: currentVNode,
  2965. recurseCount: 0
  2966. });
  2967. }
  2968. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2969. currentVNode = parentInstance && parentInstance.vnode;
  2970. }
  2971. return normalizedStack;
  2972. }
  2973. function formatTrace(trace) {
  2974. const logs = [];
  2975. trace.forEach((entry, i2) => {
  2976. logs.push(...i2 === 0 ? [] : [`
  2977. `], ...formatTraceEntry(entry));
  2978. });
  2979. return logs;
  2980. }
  2981. function formatTraceEntry({ vnode, recurseCount }) {
  2982. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2983. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2984. const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
  2985. const close = `>` + postfix;
  2986. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2987. }
  2988. function formatProps(props) {
  2989. const res = [];
  2990. const keys = Object.keys(props);
  2991. keys.slice(0, 3).forEach((key) => {
  2992. res.push(...formatProp(key, props[key]));
  2993. });
  2994. if (keys.length > 3) {
  2995. res.push(` ...`);
  2996. }
  2997. return res;
  2998. }
  2999. function formatProp(key, value, raw) {
  3000. if (isString(value)) {
  3001. value = JSON.stringify(value);
  3002. return raw ? value : [`${key}=${value}`];
  3003. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  3004. return raw ? value : [`${key}=${value}`];
  3005. } else if (isRef(value)) {
  3006. value = formatProp(key, toRaw(value.value), true);
  3007. return raw ? value : [`${key}=Ref<`, value, `>`];
  3008. } else if (isFunction(value)) {
  3009. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  3010. } else {
  3011. value = toRaw(value);
  3012. return raw ? value : [`${key}=`, value];
  3013. }
  3014. }
  3015. const ErrorTypeStrings = {
  3016. [
  3017. "sp"
  3018. /* LifecycleHooks.SERVER_PREFETCH */
  3019. ]: "serverPrefetch hook",
  3020. [
  3021. "bc"
  3022. /* LifecycleHooks.BEFORE_CREATE */
  3023. ]: "beforeCreate hook",
  3024. [
  3025. "c"
  3026. /* LifecycleHooks.CREATED */
  3027. ]: "created hook",
  3028. [
  3029. "bm"
  3030. /* LifecycleHooks.BEFORE_MOUNT */
  3031. ]: "beforeMount hook",
  3032. [
  3033. "m"
  3034. /* LifecycleHooks.MOUNTED */
  3035. ]: "mounted hook",
  3036. [
  3037. "bu"
  3038. /* LifecycleHooks.BEFORE_UPDATE */
  3039. ]: "beforeUpdate hook",
  3040. [
  3041. "u"
  3042. /* LifecycleHooks.UPDATED */
  3043. ]: "updated",
  3044. [
  3045. "bum"
  3046. /* LifecycleHooks.BEFORE_UNMOUNT */
  3047. ]: "beforeUnmount hook",
  3048. [
  3049. "um"
  3050. /* LifecycleHooks.UNMOUNTED */
  3051. ]: "unmounted hook",
  3052. [
  3053. "a"
  3054. /* LifecycleHooks.ACTIVATED */
  3055. ]: "activated hook",
  3056. [
  3057. "da"
  3058. /* LifecycleHooks.DEACTIVATED */
  3059. ]: "deactivated hook",
  3060. [
  3061. "ec"
  3062. /* LifecycleHooks.ERROR_CAPTURED */
  3063. ]: "errorCaptured hook",
  3064. [
  3065. "rtc"
  3066. /* LifecycleHooks.RENDER_TRACKED */
  3067. ]: "renderTracked hook",
  3068. [
  3069. "rtg"
  3070. /* LifecycleHooks.RENDER_TRIGGERED */
  3071. ]: "renderTriggered hook",
  3072. [
  3073. 0
  3074. /* ErrorCodes.SETUP_FUNCTION */
  3075. ]: "setup function",
  3076. [
  3077. 1
  3078. /* ErrorCodes.RENDER_FUNCTION */
  3079. ]: "render function",
  3080. [
  3081. 2
  3082. /* ErrorCodes.WATCH_GETTER */
  3083. ]: "watcher getter",
  3084. [
  3085. 3
  3086. /* ErrorCodes.WATCH_CALLBACK */
  3087. ]: "watcher callback",
  3088. [
  3089. 4
  3090. /* ErrorCodes.WATCH_CLEANUP */
  3091. ]: "watcher cleanup function",
  3092. [
  3093. 5
  3094. /* ErrorCodes.NATIVE_EVENT_HANDLER */
  3095. ]: "native event handler",
  3096. [
  3097. 6
  3098. /* ErrorCodes.COMPONENT_EVENT_HANDLER */
  3099. ]: "component event handler",
  3100. [
  3101. 7
  3102. /* ErrorCodes.VNODE_HOOK */
  3103. ]: "vnode hook",
  3104. [
  3105. 8
  3106. /* ErrorCodes.DIRECTIVE_HOOK */
  3107. ]: "directive hook",
  3108. [
  3109. 9
  3110. /* ErrorCodes.TRANSITION_HOOK */
  3111. ]: "transition hook",
  3112. [
  3113. 10
  3114. /* ErrorCodes.APP_ERROR_HANDLER */
  3115. ]: "app errorHandler",
  3116. [
  3117. 11
  3118. /* ErrorCodes.APP_WARN_HANDLER */
  3119. ]: "app warnHandler",
  3120. [
  3121. 12
  3122. /* ErrorCodes.FUNCTION_REF */
  3123. ]: "ref function",
  3124. [
  3125. 13
  3126. /* ErrorCodes.ASYNC_COMPONENT_LOADER */
  3127. ]: "async component loader",
  3128. [
  3129. 14
  3130. /* ErrorCodes.SCHEDULER */
  3131. ]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
  3132. };
  3133. function callWithErrorHandling(fn, instance, type, args) {
  3134. let res;
  3135. try {
  3136. res = args ? fn(...args) : fn();
  3137. } catch (err) {
  3138. handleError(err, instance, type);
  3139. }
  3140. return res;
  3141. }
  3142. function callWithAsyncErrorHandling(fn, instance, type, args) {
  3143. if (isFunction(fn)) {
  3144. const res = callWithErrorHandling(fn, instance, type, args);
  3145. if (res && isPromise(res)) {
  3146. res.catch((err) => {
  3147. handleError(err, instance, type);
  3148. });
  3149. }
  3150. return res;
  3151. }
  3152. const values = [];
  3153. for (let i2 = 0; i2 < fn.length; i2++) {
  3154. values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
  3155. }
  3156. return values;
  3157. }
  3158. function handleError(err, instance, type, throwInDev = true) {
  3159. const contextVNode = instance ? instance.vnode : null;
  3160. if (instance) {
  3161. let cur = instance.parent;
  3162. const exposedInstance = instance.proxy;
  3163. const errorInfo = ErrorTypeStrings[type] || type;
  3164. while (cur) {
  3165. const errorCapturedHooks = cur.ec;
  3166. if (errorCapturedHooks) {
  3167. for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
  3168. if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
  3169. return;
  3170. }
  3171. }
  3172. }
  3173. cur = cur.parent;
  3174. }
  3175. const appErrorHandler = instance.appContext.config.errorHandler;
  3176. if (appErrorHandler) {
  3177. callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
  3178. return;
  3179. }
  3180. }
  3181. logError(err, type, contextVNode, throwInDev);
  3182. }
  3183. function logError(err, type, contextVNode, throwInDev = true) {
  3184. {
  3185. const info = ErrorTypeStrings[type] || type;
  3186. if (contextVNode) {
  3187. pushWarningContext(contextVNode);
  3188. }
  3189. warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  3190. if (contextVNode) {
  3191. popWarningContext();
  3192. }
  3193. if (throwInDev) {
  3194. console.error(err);
  3195. } else {
  3196. console.error(err);
  3197. }
  3198. }
  3199. }
  3200. let isFlushing = false;
  3201. let isFlushPending = false;
  3202. const queue = [];
  3203. let flushIndex = 0;
  3204. const pendingPostFlushCbs = [];
  3205. let activePostFlushCbs = null;
  3206. let postFlushIndex = 0;
  3207. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  3208. let currentFlushPromise = null;
  3209. const RECURSION_LIMIT = 100;
  3210. function nextTick$1(fn) {
  3211. const p2 = currentFlushPromise || resolvedPromise;
  3212. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  3213. }
  3214. function findInsertionIndex(id) {
  3215. let start = flushIndex + 1;
  3216. let end = queue.length;
  3217. while (start < end) {
  3218. const middle = start + end >>> 1;
  3219. const middleJobId = getId(queue[middle]);
  3220. middleJobId < id ? start = middle + 1 : end = middle;
  3221. }
  3222. return start;
  3223. }
  3224. function queueJob(job) {
  3225. if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
  3226. if (job.id == null) {
  3227. queue.push(job);
  3228. } else {
  3229. queue.splice(findInsertionIndex(job.id), 0, job);
  3230. }
  3231. queueFlush();
  3232. }
  3233. }
  3234. function queueFlush() {
  3235. if (!isFlushing && !isFlushPending) {
  3236. isFlushPending = true;
  3237. currentFlushPromise = resolvedPromise.then(flushJobs);
  3238. }
  3239. }
  3240. function hasQueueJob(job) {
  3241. return queue.indexOf(job) > -1;
  3242. }
  3243. function invalidateJob(job) {
  3244. const i2 = queue.indexOf(job);
  3245. if (i2 > flushIndex) {
  3246. queue.splice(i2, 1);
  3247. }
  3248. }
  3249. function queuePostFlushCb(cb) {
  3250. if (!isArray$1(cb)) {
  3251. if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
  3252. pendingPostFlushCbs.push(cb);
  3253. }
  3254. } else {
  3255. pendingPostFlushCbs.push(...cb);
  3256. }
  3257. queueFlush();
  3258. }
  3259. function flushPreFlushCbs(seen, i2 = isFlushing ? flushIndex + 1 : 0) {
  3260. {
  3261. seen = seen || /* @__PURE__ */ new Map();
  3262. }
  3263. for (; i2 < queue.length; i2++) {
  3264. const cb = queue[i2];
  3265. if (cb && cb.pre) {
  3266. if (checkRecursiveUpdates(seen, cb)) {
  3267. continue;
  3268. }
  3269. queue.splice(i2, 1);
  3270. i2--;
  3271. cb();
  3272. }
  3273. }
  3274. }
  3275. function flushPostFlushCbs(seen) {
  3276. if (pendingPostFlushCbs.length) {
  3277. const deduped = [...new Set(pendingPostFlushCbs)];
  3278. pendingPostFlushCbs.length = 0;
  3279. if (activePostFlushCbs) {
  3280. activePostFlushCbs.push(...deduped);
  3281. return;
  3282. }
  3283. activePostFlushCbs = deduped;
  3284. {
  3285. seen = seen || /* @__PURE__ */ new Map();
  3286. }
  3287. activePostFlushCbs.sort((a2, b2) => getId(a2) - getId(b2));
  3288. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  3289. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  3290. continue;
  3291. }
  3292. activePostFlushCbs[postFlushIndex]();
  3293. }
  3294. activePostFlushCbs = null;
  3295. postFlushIndex = 0;
  3296. }
  3297. }
  3298. const getId = (job) => job.id == null ? Infinity : job.id;
  3299. const comparator = (a2, b2) => {
  3300. const diff2 = getId(a2) - getId(b2);
  3301. if (diff2 === 0) {
  3302. if (a2.pre && !b2.pre)
  3303. return -1;
  3304. if (b2.pre && !a2.pre)
  3305. return 1;
  3306. }
  3307. return diff2;
  3308. };
  3309. function flushJobs(seen) {
  3310. isFlushPending = false;
  3311. isFlushing = true;
  3312. {
  3313. seen = seen || /* @__PURE__ */ new Map();
  3314. }
  3315. queue.sort(comparator);
  3316. const check = (job) => checkRecursiveUpdates(seen, job);
  3317. try {
  3318. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  3319. const job = queue[flushIndex];
  3320. if (job && job.active !== false) {
  3321. if (check(job)) {
  3322. continue;
  3323. }
  3324. callWithErrorHandling(
  3325. job,
  3326. null,
  3327. 14
  3328. /* ErrorCodes.SCHEDULER */
  3329. );
  3330. }
  3331. }
  3332. } finally {
  3333. flushIndex = 0;
  3334. queue.length = 0;
  3335. flushPostFlushCbs(seen);
  3336. isFlushing = false;
  3337. currentFlushPromise = null;
  3338. if (queue.length || pendingPostFlushCbs.length) {
  3339. flushJobs(seen);
  3340. }
  3341. }
  3342. }
  3343. function checkRecursiveUpdates(seen, fn) {
  3344. if (!seen.has(fn)) {
  3345. seen.set(fn, 1);
  3346. } else {
  3347. const count = seen.get(fn);
  3348. if (count > RECURSION_LIMIT) {
  3349. const instance = fn.ownerInstance;
  3350. const componentName = instance && getComponentName(instance.type);
  3351. warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`);
  3352. return true;
  3353. } else {
  3354. seen.set(fn, count + 1);
  3355. }
  3356. }
  3357. }
  3358. let devtools;
  3359. let buffer = [];
  3360. let devtoolsNotInstalled = false;
  3361. function emit$1(event, ...args) {
  3362. if (devtools) {
  3363. devtools.emit(event, ...args);
  3364. } else if (!devtoolsNotInstalled) {
  3365. buffer.push({ event, args });
  3366. }
  3367. }
  3368. function setDevtoolsHook(hook, target) {
  3369. var _a2, _b2;
  3370. devtools = hook;
  3371. if (devtools) {
  3372. devtools.enabled = true;
  3373. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  3374. buffer = [];
  3375. } else if (
  3376. // handle late devtools injection - only do this if we are in an actual
  3377. // browser environment to avoid the timer handle stalling test runner exit
  3378. // (#4815)
  3379. typeof window !== "undefined" && // some envs mock window but not fully
  3380. // eslint-disable-next-line no-restricted-globals
  3381. window.HTMLElement && // also exclude jsdom
  3382. // eslint-disable-next-line no-restricted-globals
  3383. !((_b2 = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b2 === void 0 ? void 0 : _b2.includes("jsdom"))
  3384. ) {
  3385. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  3386. replay.push((newHook) => {
  3387. setDevtoolsHook(newHook, target);
  3388. });
  3389. setTimeout(() => {
  3390. if (!devtools) {
  3391. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  3392. devtoolsNotInstalled = true;
  3393. buffer = [];
  3394. }
  3395. }, 3e3);
  3396. } else {
  3397. devtoolsNotInstalled = true;
  3398. buffer = [];
  3399. }
  3400. }
  3401. function devtoolsInitApp(app, version2) {
  3402. emit$1("app:init", app, version2, {
  3403. Fragment,
  3404. Text,
  3405. Comment,
  3406. Static
  3407. });
  3408. }
  3409. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  3410. "component:added"
  3411. /* DevtoolsHooks.COMPONENT_ADDED */
  3412. );
  3413. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  3414. "component:updated"
  3415. /* DevtoolsHooks.COMPONENT_UPDATED */
  3416. );
  3417. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  3418. "component:removed"
  3419. /* DevtoolsHooks.COMPONENT_REMOVED */
  3420. );
  3421. const devtoolsComponentRemoved = (component) => {
  3422. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  3423. !devtools.cleanupBuffer(component)) {
  3424. _devtoolsComponentRemoved(component);
  3425. }
  3426. };
  3427. function createDevtoolsComponentHook(hook) {
  3428. return (component) => {
  3429. emit$1(
  3430. hook,
  3431. component.appContext.app,
  3432. component.uid,
  3433. // fixed by xxxxxx
  3434. // 为 0 是 App,无 parent 是 Page 指向 App
  3435. component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
  3436. component
  3437. );
  3438. };
  3439. }
  3440. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3441. "perf:start"
  3442. /* DevtoolsHooks.PERFORMANCE_START */
  3443. );
  3444. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3445. "perf:end"
  3446. /* DevtoolsHooks.PERFORMANCE_END */
  3447. );
  3448. function createDevtoolsPerformanceHook(hook) {
  3449. return (component, type, time) => {
  3450. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  3451. };
  3452. }
  3453. function devtoolsComponentEmit(component, event, params) {
  3454. emit$1("component:emit", component.appContext.app, component, event, params);
  3455. }
  3456. function emit(instance, event, ...rawArgs) {
  3457. if (instance.isUnmounted)
  3458. return;
  3459. const props = instance.vnode.props || EMPTY_OBJ;
  3460. {
  3461. const { emitsOptions, propsOptions: [propsOptions] } = instance;
  3462. if (emitsOptions) {
  3463. if (!(event in emitsOptions) && true) {
  3464. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  3465. warn(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`);
  3466. }
  3467. } else {
  3468. const validator = emitsOptions[event];
  3469. if (isFunction(validator)) {
  3470. const isValid = validator(...rawArgs);
  3471. if (!isValid) {
  3472. warn(`Invalid event arguments: event validation failed for event "${event}".`);
  3473. }
  3474. }
  3475. }
  3476. }
  3477. }
  3478. let args = rawArgs;
  3479. const isModelListener2 = event.startsWith("update:");
  3480. const modelArg = isModelListener2 && event.slice(7);
  3481. if (modelArg && modelArg in props) {
  3482. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  3483. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  3484. if (trim) {
  3485. args = rawArgs.map((a2) => isString(a2) ? a2.trim() : a2);
  3486. }
  3487. if (number) {
  3488. args = rawArgs.map(looseToNumber);
  3489. }
  3490. }
  3491. {
  3492. devtoolsComponentEmit(instance, event, args);
  3493. }
  3494. {
  3495. const lowerCaseEvent = event.toLowerCase();
  3496. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  3497. warn(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`);
  3498. }
  3499. }
  3500. let handlerName;
  3501. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  3502. props[handlerName = toHandlerKey(camelize(event))];
  3503. if (!handler && isModelListener2) {
  3504. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  3505. }
  3506. if (handler) {
  3507. callWithAsyncErrorHandling(handler, instance, 6, args);
  3508. }
  3509. const onceHandler = props[handlerName + `Once`];
  3510. if (onceHandler) {
  3511. if (!instance.emitted) {
  3512. instance.emitted = {};
  3513. } else if (instance.emitted[handlerName]) {
  3514. return;
  3515. }
  3516. instance.emitted[handlerName] = true;
  3517. callWithAsyncErrorHandling(onceHandler, instance, 6, args);
  3518. }
  3519. }
  3520. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  3521. const cache = appContext.emitsCache;
  3522. const cached = cache.get(comp);
  3523. if (cached !== void 0) {
  3524. return cached;
  3525. }
  3526. const raw = comp.emits;
  3527. let normalized = {};
  3528. let hasExtends = false;
  3529. if (!isFunction(comp)) {
  3530. const extendEmits = (raw2) => {
  3531. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  3532. if (normalizedFromExtend) {
  3533. hasExtends = true;
  3534. extend(normalized, normalizedFromExtend);
  3535. }
  3536. };
  3537. if (!asMixin && appContext.mixins.length) {
  3538. appContext.mixins.forEach(extendEmits);
  3539. }
  3540. if (comp.extends) {
  3541. extendEmits(comp.extends);
  3542. }
  3543. if (comp.mixins) {
  3544. comp.mixins.forEach(extendEmits);
  3545. }
  3546. }
  3547. if (!raw && !hasExtends) {
  3548. if (isObject$3(comp)) {
  3549. cache.set(comp, null);
  3550. }
  3551. return null;
  3552. }
  3553. if (isArray$1(raw)) {
  3554. raw.forEach((key) => normalized[key] = null);
  3555. } else {
  3556. extend(normalized, raw);
  3557. }
  3558. if (isObject$3(comp)) {
  3559. cache.set(comp, normalized);
  3560. }
  3561. return normalized;
  3562. }
  3563. function isEmitListener(options, key) {
  3564. if (!options || !isOn(key)) {
  3565. return false;
  3566. }
  3567. key = key.slice(2).replace(/Once$/, "");
  3568. return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
  3569. }
  3570. let currentRenderingInstance = null;
  3571. function setCurrentRenderingInstance(instance) {
  3572. const prev = currentRenderingInstance;
  3573. currentRenderingInstance = instance;
  3574. instance && instance.type.__scopeId || null;
  3575. return prev;
  3576. }
  3577. function provide(key, value) {
  3578. if (!currentInstance) {
  3579. {
  3580. warn(`provide() can only be used inside setup().`);
  3581. }
  3582. } else {
  3583. let provides = currentInstance.provides;
  3584. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  3585. if (parentProvides === provides) {
  3586. provides = currentInstance.provides = Object.create(parentProvides);
  3587. }
  3588. provides[key] = value;
  3589. if (currentInstance.type.mpType === "app") {
  3590. currentInstance.appContext.app.provide(key, value);
  3591. }
  3592. }
  3593. }
  3594. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3595. const instance = currentInstance || currentRenderingInstance;
  3596. if (instance) {
  3597. const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
  3598. if (provides && key in provides) {
  3599. return provides[key];
  3600. } else if (arguments.length > 1) {
  3601. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
  3602. } else {
  3603. warn(`injection "${String(key)}" not found.`);
  3604. }
  3605. } else {
  3606. warn(`inject() can only be used inside setup() or functional components.`);
  3607. }
  3608. }
  3609. function watchEffect(effect, options) {
  3610. return doWatch(effect, null, options);
  3611. }
  3612. function watchPostEffect(effect, options) {
  3613. return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: "post" }));
  3614. }
  3615. const INITIAL_WATCHER_VALUE = {};
  3616. function watch(source, cb, options) {
  3617. if (!isFunction(cb)) {
  3618. warn(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
  3619. }
  3620. return doWatch(source, cb, options);
  3621. }
  3622. function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
  3623. if (!cb) {
  3624. if (immediate !== void 0) {
  3625. warn(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
  3626. }
  3627. if (deep !== void 0) {
  3628. warn(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
  3629. }
  3630. }
  3631. const warnInvalidSource = (s2) => {
  3632. warn(`Invalid watch source: `, s2, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
  3633. };
  3634. const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
  3635. let getter;
  3636. let forceTrigger = false;
  3637. let isMultiSource = false;
  3638. if (isRef(source)) {
  3639. getter = () => source.value;
  3640. forceTrigger = isShallow(source);
  3641. } else if (isReactive(source)) {
  3642. getter = () => source;
  3643. deep = true;
  3644. } else if (isArray$1(source)) {
  3645. isMultiSource = true;
  3646. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  3647. getter = () => source.map((s2) => {
  3648. if (isRef(s2)) {
  3649. return s2.value;
  3650. } else if (isReactive(s2)) {
  3651. return traverse(s2);
  3652. } else if (isFunction(s2)) {
  3653. return callWithErrorHandling(
  3654. s2,
  3655. instance,
  3656. 2
  3657. /* ErrorCodes.WATCH_GETTER */
  3658. );
  3659. } else {
  3660. warnInvalidSource(s2);
  3661. }
  3662. });
  3663. } else if (isFunction(source)) {
  3664. if (cb) {
  3665. getter = () => callWithErrorHandling(
  3666. source,
  3667. instance,
  3668. 2
  3669. /* ErrorCodes.WATCH_GETTER */
  3670. );
  3671. } else {
  3672. getter = () => {
  3673. if (instance && instance.isUnmounted) {
  3674. return;
  3675. }
  3676. if (cleanup) {
  3677. cleanup();
  3678. }
  3679. return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
  3680. };
  3681. }
  3682. } else {
  3683. getter = NOOP;
  3684. warnInvalidSource(source);
  3685. }
  3686. if (cb && deep) {
  3687. const baseGetter = getter;
  3688. getter = () => traverse(baseGetter());
  3689. }
  3690. let cleanup;
  3691. let onCleanup = (fn) => {
  3692. cleanup = effect.onStop = () => {
  3693. callWithErrorHandling(
  3694. fn,
  3695. instance,
  3696. 4
  3697. /* ErrorCodes.WATCH_CLEANUP */
  3698. );
  3699. };
  3700. };
  3701. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  3702. const job = () => {
  3703. if (!effect.active) {
  3704. return;
  3705. }
  3706. if (cb) {
  3707. const newValue = effect.run();
  3708. if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue, oldValue)) || false) {
  3709. if (cleanup) {
  3710. cleanup();
  3711. }
  3712. callWithAsyncErrorHandling(cb, instance, 3, [
  3713. newValue,
  3714. // pass undefined as the old value when it's changed for the first time
  3715. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  3716. onCleanup
  3717. ]);
  3718. oldValue = newValue;
  3719. }
  3720. } else {
  3721. effect.run();
  3722. }
  3723. };
  3724. job.allowRecurse = !!cb;
  3725. let scheduler;
  3726. if (flush === "sync") {
  3727. scheduler = job;
  3728. } else if (flush === "post") {
  3729. scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  3730. } else {
  3731. job.pre = true;
  3732. if (instance)
  3733. job.id = instance.uid;
  3734. scheduler = () => queueJob(job);
  3735. }
  3736. const effect = new ReactiveEffect(getter, scheduler);
  3737. {
  3738. effect.onTrack = onTrack;
  3739. effect.onTrigger = onTrigger;
  3740. }
  3741. if (cb) {
  3742. if (immediate) {
  3743. job();
  3744. } else {
  3745. oldValue = effect.run();
  3746. }
  3747. } else if (flush === "post") {
  3748. queuePostRenderEffect$1(effect.run.bind(effect), instance && instance.suspense);
  3749. } else {
  3750. effect.run();
  3751. }
  3752. const unwatch = () => {
  3753. effect.stop();
  3754. if (instance && instance.scope) {
  3755. remove(instance.scope.effects, effect);
  3756. }
  3757. };
  3758. return unwatch;
  3759. }
  3760. function instanceWatch(source, value, options) {
  3761. const publicThis = this.proxy;
  3762. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3763. let cb;
  3764. if (isFunction(value)) {
  3765. cb = value;
  3766. } else {
  3767. cb = value.handler;
  3768. options = value;
  3769. }
  3770. const cur = currentInstance;
  3771. setCurrentInstance(this);
  3772. const res = doWatch(getter, cb.bind(publicThis), options);
  3773. if (cur) {
  3774. setCurrentInstance(cur);
  3775. } else {
  3776. unsetCurrentInstance();
  3777. }
  3778. return res;
  3779. }
  3780. function createPathGetter(ctx, path) {
  3781. const segments = path.split(".");
  3782. return () => {
  3783. let cur = ctx;
  3784. for (let i2 = 0; i2 < segments.length && cur; i2++) {
  3785. cur = cur[segments[i2]];
  3786. }
  3787. return cur;
  3788. };
  3789. }
  3790. function traverse(value, seen) {
  3791. if (!isObject$3(value) || value[
  3792. "__v_skip"
  3793. /* ReactiveFlags.SKIP */
  3794. ]) {
  3795. return value;
  3796. }
  3797. seen = seen || /* @__PURE__ */ new Set();
  3798. if (seen.has(value)) {
  3799. return value;
  3800. }
  3801. seen.add(value);
  3802. if (isRef(value)) {
  3803. traverse(value.value, seen);
  3804. } else if (isArray$1(value)) {
  3805. for (let i2 = 0; i2 < value.length; i2++) {
  3806. traverse(value[i2], seen);
  3807. }
  3808. } else if (isSet(value) || isMap(value)) {
  3809. value.forEach((v2) => {
  3810. traverse(v2, seen);
  3811. });
  3812. } else if (isPlainObject$2(value)) {
  3813. for (const key in value) {
  3814. traverse(value[key], seen);
  3815. }
  3816. }
  3817. return value;
  3818. }
  3819. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3820. function onActivated(hook, target) {
  3821. registerKeepAliveHook(hook, "a", target);
  3822. }
  3823. function onDeactivated(hook, target) {
  3824. registerKeepAliveHook(hook, "da", target);
  3825. }
  3826. function registerKeepAliveHook(hook, type, target = currentInstance) {
  3827. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  3828. let current = target;
  3829. while (current) {
  3830. if (current.isDeactivated) {
  3831. return;
  3832. }
  3833. current = current.parent;
  3834. }
  3835. return hook();
  3836. });
  3837. injectHook(type, wrappedHook, target);
  3838. if (target) {
  3839. let current = target.parent;
  3840. while (current && current.parent) {
  3841. if (isKeepAlive(current.parent.vnode)) {
  3842. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3843. }
  3844. current = current.parent;
  3845. }
  3846. }
  3847. }
  3848. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3849. const injected = injectHook(
  3850. type,
  3851. hook,
  3852. keepAliveRoot,
  3853. true
  3854. /* prepend */
  3855. );
  3856. onUnmounted(() => {
  3857. remove(keepAliveRoot[type], injected);
  3858. }, target);
  3859. }
  3860. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3861. if (target) {
  3862. if (isRootHook(type)) {
  3863. target = target.root;
  3864. }
  3865. const hooks = target[type] || (target[type] = []);
  3866. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3867. if (target.isUnmounted) {
  3868. return;
  3869. }
  3870. pauseTracking();
  3871. setCurrentInstance(target);
  3872. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3873. unsetCurrentInstance();
  3874. resetTracking();
  3875. return res;
  3876. });
  3877. if (prepend) {
  3878. hooks.unshift(wrappedHook);
  3879. } else {
  3880. hooks.push(wrappedHook);
  3881. }
  3882. return wrappedHook;
  3883. } else {
  3884. const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, ""));
  3885. warn(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`);
  3886. }
  3887. }
  3888. const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (
  3889. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  3890. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  3891. );
  3892. const onBeforeMount = createHook$1(
  3893. "bm"
  3894. /* LifecycleHooks.BEFORE_MOUNT */
  3895. );
  3896. const onMounted = createHook$1(
  3897. "m"
  3898. /* LifecycleHooks.MOUNTED */
  3899. );
  3900. const onBeforeUpdate = createHook$1(
  3901. "bu"
  3902. /* LifecycleHooks.BEFORE_UPDATE */
  3903. );
  3904. const onUpdated = createHook$1(
  3905. "u"
  3906. /* LifecycleHooks.UPDATED */
  3907. );
  3908. const onBeforeUnmount = createHook$1(
  3909. "bum"
  3910. /* LifecycleHooks.BEFORE_UNMOUNT */
  3911. );
  3912. const onUnmounted = createHook$1(
  3913. "um"
  3914. /* LifecycleHooks.UNMOUNTED */
  3915. );
  3916. const onServerPrefetch = createHook$1(
  3917. "sp"
  3918. /* LifecycleHooks.SERVER_PREFETCH */
  3919. );
  3920. const onRenderTriggered = createHook$1(
  3921. "rtg"
  3922. /* LifecycleHooks.RENDER_TRIGGERED */
  3923. );
  3924. const onRenderTracked = createHook$1(
  3925. "rtc"
  3926. /* LifecycleHooks.RENDER_TRACKED */
  3927. );
  3928. function onErrorCaptured(hook, target = currentInstance) {
  3929. injectHook("ec", hook, target);
  3930. }
  3931. function validateDirectiveName(name) {
  3932. if (isBuiltInDirective(name)) {
  3933. warn("Do not use built-in directive ids as custom directive id: " + name);
  3934. }
  3935. }
  3936. const COMPONENTS = "components";
  3937. function resolveComponent(name, maybeSelfReference) {
  3938. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3939. }
  3940. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3941. const instance = currentRenderingInstance || currentInstance;
  3942. if (instance) {
  3943. const Component2 = instance.type;
  3944. if (type === COMPONENTS) {
  3945. const selfName = getComponentName(
  3946. Component2,
  3947. false
  3948. /* do not include inferred name to avoid breaking existing code */
  3949. );
  3950. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3951. return Component2;
  3952. }
  3953. }
  3954. const res = (
  3955. // local registration
  3956. // check instance[type] first which is resolved for options API
  3957. resolve(instance[type] || Component2[type], name) || // global registration
  3958. resolve(instance.appContext[type], name)
  3959. );
  3960. if (!res && maybeSelfReference) {
  3961. return Component2;
  3962. }
  3963. if (warnMissing && !res) {
  3964. const extra = type === COMPONENTS ? `
  3965. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3966. warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3967. }
  3968. return res;
  3969. } else {
  3970. warn(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
  3971. }
  3972. }
  3973. function resolve(registry, name) {
  3974. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3975. }
  3976. const getPublicInstance = (i2) => {
  3977. if (!i2)
  3978. return null;
  3979. if (isStatefulComponent(i2))
  3980. return getExposeProxy(i2) || i2.proxy;
  3981. return getPublicInstance(i2.parent);
  3982. };
  3983. const publicPropertiesMap = (
  3984. // Move PURE marker to new line to workaround compiler discarding it
  3985. // due to type annotation
  3986. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3987. $: (i2) => i2,
  3988. // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
  3989. // $el: i => i.vnode.el,
  3990. $el: (i2) => i2.__$el || (i2.__$el = {}),
  3991. $data: (i2) => i2.data,
  3992. $props: (i2) => shallowReadonly(i2.props),
  3993. $attrs: (i2) => shallowReadonly(i2.attrs),
  3994. $slots: (i2) => shallowReadonly(i2.slots),
  3995. $refs: (i2) => shallowReadonly(i2.refs),
  3996. $parent: (i2) => getPublicInstance(i2.parent),
  3997. $root: (i2) => getPublicInstance(i2.root),
  3998. $emit: (i2) => i2.emit,
  3999. $options: (i2) => resolveMergedOptions(i2),
  4000. $forceUpdate: (i2) => i2.f || (i2.f = () => queueJob(i2.update)),
  4001. // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
  4002. $watch: (i2) => instanceWatch.bind(i2)
  4003. })
  4004. );
  4005. const isReservedPrefix = (key) => key === "_" || key === "$";
  4006. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
  4007. const PublicInstanceProxyHandlers = {
  4008. get({ _: instance }, key) {
  4009. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  4010. if (key === "__isVue") {
  4011. return true;
  4012. }
  4013. let normalizedProps;
  4014. if (key[0] !== "$") {
  4015. const n2 = accessCache[key];
  4016. if (n2 !== void 0) {
  4017. switch (n2) {
  4018. case 1:
  4019. return setupState[key];
  4020. case 2:
  4021. return data[key];
  4022. case 4:
  4023. return ctx[key];
  4024. case 3:
  4025. return props[key];
  4026. }
  4027. } else if (hasSetupBinding(setupState, key)) {
  4028. accessCache[key] = 1;
  4029. return setupState[key];
  4030. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  4031. accessCache[key] = 2;
  4032. return data[key];
  4033. } else if (
  4034. // only cache other properties when instance has declared (thus stable)
  4035. // props
  4036. (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
  4037. ) {
  4038. accessCache[key] = 3;
  4039. return props[key];
  4040. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  4041. accessCache[key] = 4;
  4042. return ctx[key];
  4043. } else if (shouldCacheAccess) {
  4044. accessCache[key] = 0;
  4045. }
  4046. }
  4047. const publicGetter = publicPropertiesMap[key];
  4048. let cssModule, globalProperties;
  4049. if (publicGetter) {
  4050. if (key === "$attrs") {
  4051. track(instance, "get", key);
  4052. }
  4053. return publicGetter(instance);
  4054. } else if (
  4055. // css module (injected by vue-loader)
  4056. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  4057. ) {
  4058. return cssModule;
  4059. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  4060. accessCache[key] = 4;
  4061. return ctx[key];
  4062. } else if (
  4063. // global properties
  4064. globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
  4065. ) {
  4066. {
  4067. return globalProperties[key];
  4068. }
  4069. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  4070. // to infinite warning loop
  4071. key.indexOf("__v") !== 0)) {
  4072. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
  4073. warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
  4074. } else if (instance === currentRenderingInstance) {
  4075. warn(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
  4076. }
  4077. }
  4078. },
  4079. set({ _: instance }, key, value) {
  4080. const { data, setupState, ctx } = instance;
  4081. if (hasSetupBinding(setupState, key)) {
  4082. setupState[key] = value;
  4083. return true;
  4084. } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
  4085. warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  4086. return false;
  4087. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  4088. data[key] = value;
  4089. return true;
  4090. } else if (hasOwn$1(instance.props, key)) {
  4091. warn(`Attempting to mutate prop "${key}". Props are readonly.`);
  4092. return false;
  4093. }
  4094. if (key[0] === "$" && key.slice(1) in instance) {
  4095. warn(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
  4096. return false;
  4097. } else {
  4098. if (key in instance.appContext.config.globalProperties) {
  4099. Object.defineProperty(ctx, key, {
  4100. enumerable: true,
  4101. configurable: true,
  4102. value
  4103. });
  4104. } else {
  4105. ctx[key] = value;
  4106. }
  4107. }
  4108. return true;
  4109. },
  4110. has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
  4111. let normalizedProps;
  4112. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
  4113. },
  4114. defineProperty(target, key, descriptor) {
  4115. if (descriptor.get != null) {
  4116. target._.accessCache[key] = 0;
  4117. } else if (hasOwn$1(descriptor, "value")) {
  4118. this.set(target, key, descriptor.value, null);
  4119. }
  4120. return Reflect.defineProperty(target, key, descriptor);
  4121. }
  4122. };
  4123. {
  4124. PublicInstanceProxyHandlers.ownKeys = (target) => {
  4125. warn(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
  4126. return Reflect.ownKeys(target);
  4127. };
  4128. }
  4129. function createDevRenderContext(instance) {
  4130. const target = {};
  4131. Object.defineProperty(target, `_`, {
  4132. configurable: true,
  4133. enumerable: false,
  4134. get: () => instance
  4135. });
  4136. Object.keys(publicPropertiesMap).forEach((key) => {
  4137. Object.defineProperty(target, key, {
  4138. configurable: true,
  4139. enumerable: false,
  4140. get: () => publicPropertiesMap[key](instance),
  4141. // intercepted by the proxy so no need for implementation,
  4142. // but needed to prevent set errors
  4143. set: NOOP
  4144. });
  4145. });
  4146. return target;
  4147. }
  4148. function exposePropsOnRenderContext(instance) {
  4149. const { ctx, propsOptions: [propsOptions] } = instance;
  4150. if (propsOptions) {
  4151. Object.keys(propsOptions).forEach((key) => {
  4152. Object.defineProperty(ctx, key, {
  4153. enumerable: true,
  4154. configurable: true,
  4155. get: () => instance.props[key],
  4156. set: NOOP
  4157. });
  4158. });
  4159. }
  4160. }
  4161. function exposeSetupStateOnRenderContext(instance) {
  4162. const { ctx, setupState } = instance;
  4163. Object.keys(toRaw(setupState)).forEach((key) => {
  4164. if (!setupState.__isScriptSetup) {
  4165. if (isReservedPrefix(key[0])) {
  4166. warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
  4167. return;
  4168. }
  4169. Object.defineProperty(ctx, key, {
  4170. enumerable: true,
  4171. configurable: true,
  4172. get: () => setupState[key],
  4173. set: NOOP
  4174. });
  4175. }
  4176. });
  4177. }
  4178. function createDuplicateChecker() {
  4179. const cache = /* @__PURE__ */ Object.create(null);
  4180. return (type, key) => {
  4181. if (cache[key]) {
  4182. warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
  4183. } else {
  4184. cache[key] = type;
  4185. }
  4186. };
  4187. }
  4188. let shouldCacheAccess = true;
  4189. function applyOptions$1(instance) {
  4190. const options = resolveMergedOptions(instance);
  4191. const publicThis = instance.proxy;
  4192. const ctx = instance.ctx;
  4193. shouldCacheAccess = false;
  4194. if (options.beforeCreate) {
  4195. callHook$1(
  4196. options.beforeCreate,
  4197. instance,
  4198. "bc"
  4199. /* LifecycleHooks.BEFORE_CREATE */
  4200. );
  4201. }
  4202. const {
  4203. // state
  4204. data: dataOptions,
  4205. computed: computedOptions,
  4206. methods,
  4207. watch: watchOptions,
  4208. provide: provideOptions,
  4209. inject: injectOptions,
  4210. // lifecycle
  4211. created,
  4212. beforeMount,
  4213. mounted,
  4214. beforeUpdate,
  4215. updated,
  4216. activated,
  4217. deactivated,
  4218. beforeDestroy,
  4219. beforeUnmount,
  4220. destroyed,
  4221. unmounted,
  4222. render,
  4223. renderTracked,
  4224. renderTriggered,
  4225. errorCaptured,
  4226. serverPrefetch,
  4227. // public API
  4228. expose,
  4229. inheritAttrs,
  4230. // assets
  4231. components,
  4232. directives,
  4233. filters
  4234. } = options;
  4235. const checkDuplicateProperties = createDuplicateChecker();
  4236. {
  4237. const [propsOptions] = instance.propsOptions;
  4238. if (propsOptions) {
  4239. for (const key in propsOptions) {
  4240. checkDuplicateProperties("Props", key);
  4241. }
  4242. }
  4243. }
  4244. if (injectOptions) {
  4245. resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
  4246. }
  4247. if (methods) {
  4248. for (const key in methods) {
  4249. const methodHandler = methods[key];
  4250. if (isFunction(methodHandler)) {
  4251. {
  4252. Object.defineProperty(ctx, key, {
  4253. value: methodHandler.bind(publicThis),
  4254. configurable: true,
  4255. enumerable: true,
  4256. writable: true
  4257. });
  4258. }
  4259. {
  4260. checkDuplicateProperties("Methods", key);
  4261. }
  4262. } else {
  4263. warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`);
  4264. }
  4265. }
  4266. }
  4267. if (dataOptions) {
  4268. if (!isFunction(dataOptions)) {
  4269. warn(`The data option must be a function. Plain object usage is no longer supported.`);
  4270. }
  4271. const data = dataOptions.call(publicThis, publicThis);
  4272. if (isPromise(data)) {
  4273. warn(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
  4274. }
  4275. if (!isObject$3(data)) {
  4276. warn(`data() should return an object.`);
  4277. } else {
  4278. instance.data = reactive(data);
  4279. {
  4280. for (const key in data) {
  4281. checkDuplicateProperties("Data", key);
  4282. if (!isReservedPrefix(key[0])) {
  4283. Object.defineProperty(ctx, key, {
  4284. configurable: true,
  4285. enumerable: true,
  4286. get: () => data[key],
  4287. set: NOOP
  4288. });
  4289. }
  4290. }
  4291. }
  4292. }
  4293. }
  4294. shouldCacheAccess = true;
  4295. if (computedOptions) {
  4296. for (const key in computedOptions) {
  4297. const opt = computedOptions[key];
  4298. const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  4299. if (get2 === NOOP) {
  4300. warn(`Computed property "${key}" has no getter.`);
  4301. }
  4302. const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  4303. warn(`Write operation failed: computed property "${key}" is readonly.`);
  4304. };
  4305. const c2 = computed({
  4306. get: get2,
  4307. set: set2
  4308. });
  4309. Object.defineProperty(ctx, key, {
  4310. enumerable: true,
  4311. configurable: true,
  4312. get: () => c2.value,
  4313. set: (v2) => c2.value = v2
  4314. });
  4315. {
  4316. checkDuplicateProperties("Computed", key);
  4317. }
  4318. }
  4319. }
  4320. if (watchOptions) {
  4321. for (const key in watchOptions) {
  4322. createWatcher(watchOptions[key], ctx, publicThis, key);
  4323. }
  4324. }
  4325. {
  4326. if (provideOptions) {
  4327. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  4328. Reflect.ownKeys(provides).forEach((key) => {
  4329. provide(key, provides[key]);
  4330. });
  4331. }
  4332. }
  4333. {
  4334. if (created) {
  4335. callHook$1(
  4336. created,
  4337. instance,
  4338. "c"
  4339. /* LifecycleHooks.CREATED */
  4340. );
  4341. }
  4342. }
  4343. function registerLifecycleHook(register, hook) {
  4344. if (isArray$1(hook)) {
  4345. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  4346. } else if (hook) {
  4347. register(hook.bind(publicThis));
  4348. }
  4349. }
  4350. registerLifecycleHook(onBeforeMount, beforeMount);
  4351. registerLifecycleHook(onMounted, mounted);
  4352. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  4353. registerLifecycleHook(onUpdated, updated);
  4354. registerLifecycleHook(onActivated, activated);
  4355. registerLifecycleHook(onDeactivated, deactivated);
  4356. registerLifecycleHook(onErrorCaptured, errorCaptured);
  4357. registerLifecycleHook(onRenderTracked, renderTracked);
  4358. registerLifecycleHook(onRenderTriggered, renderTriggered);
  4359. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  4360. registerLifecycleHook(onUnmounted, unmounted);
  4361. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  4362. if (isArray$1(expose)) {
  4363. if (expose.length) {
  4364. const exposed = instance.exposed || (instance.exposed = {});
  4365. expose.forEach((key) => {
  4366. Object.defineProperty(exposed, key, {
  4367. get: () => publicThis[key],
  4368. set: (val) => publicThis[key] = val
  4369. });
  4370. });
  4371. } else if (!instance.exposed) {
  4372. instance.exposed = {};
  4373. }
  4374. }
  4375. if (render && instance.render === NOOP) {
  4376. instance.render = render;
  4377. }
  4378. if (inheritAttrs != null) {
  4379. instance.inheritAttrs = inheritAttrs;
  4380. }
  4381. if (components)
  4382. instance.components = components;
  4383. if (directives)
  4384. instance.directives = directives;
  4385. if (instance.ctx.$onApplyOptions) {
  4386. instance.ctx.$onApplyOptions(options, instance, publicThis);
  4387. }
  4388. }
  4389. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
  4390. if (isArray$1(injectOptions)) {
  4391. injectOptions = normalizeInject(injectOptions);
  4392. }
  4393. for (const key in injectOptions) {
  4394. const opt = injectOptions[key];
  4395. let injected;
  4396. if (isObject$3(opt)) {
  4397. if ("default" in opt) {
  4398. injected = inject(
  4399. opt.from || key,
  4400. opt.default,
  4401. true
  4402. /* treat default function as factory */
  4403. );
  4404. } else {
  4405. injected = inject(opt.from || key);
  4406. }
  4407. } else {
  4408. injected = inject(opt);
  4409. }
  4410. if (isRef(injected)) {
  4411. if (unwrapRef) {
  4412. Object.defineProperty(ctx, key, {
  4413. enumerable: true,
  4414. configurable: true,
  4415. get: () => injected.value,
  4416. set: (v2) => injected.value = v2
  4417. });
  4418. } else {
  4419. {
  4420. warn(`injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`);
  4421. }
  4422. ctx[key] = injected;
  4423. }
  4424. } else {
  4425. ctx[key] = injected;
  4426. }
  4427. {
  4428. checkDuplicateProperties("Inject", key);
  4429. }
  4430. }
  4431. }
  4432. function callHook$1(hook, instance, type) {
  4433. callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
  4434. }
  4435. function createWatcher(raw, ctx, publicThis, key) {
  4436. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  4437. if (isString(raw)) {
  4438. const handler = ctx[raw];
  4439. if (isFunction(handler)) {
  4440. watch(getter, handler);
  4441. } else {
  4442. warn(`Invalid watch handler specified by key "${raw}"`, handler);
  4443. }
  4444. } else if (isFunction(raw)) {
  4445. watch(getter, raw.bind(publicThis));
  4446. } else if (isObject$3(raw)) {
  4447. if (isArray$1(raw)) {
  4448. raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
  4449. } else {
  4450. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  4451. if (isFunction(handler)) {
  4452. watch(getter, handler, raw);
  4453. } else {
  4454. warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  4455. }
  4456. }
  4457. } else {
  4458. warn(`Invalid watch option: "${key}"`, raw);
  4459. }
  4460. }
  4461. function resolveMergedOptions(instance) {
  4462. const base = instance.type;
  4463. const { mixins, extends: extendsOptions } = base;
  4464. const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
  4465. const cached = cache.get(base);
  4466. let resolved;
  4467. if (cached) {
  4468. resolved = cached;
  4469. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  4470. {
  4471. resolved = base;
  4472. }
  4473. } else {
  4474. resolved = {};
  4475. if (globalMixins.length) {
  4476. globalMixins.forEach((m2) => mergeOptions(resolved, m2, optionMergeStrategies, true));
  4477. }
  4478. mergeOptions(resolved, base, optionMergeStrategies);
  4479. }
  4480. if (isObject$3(base)) {
  4481. cache.set(base, resolved);
  4482. }
  4483. return resolved;
  4484. }
  4485. function mergeOptions(to, from, strats, asMixin = false) {
  4486. const { mixins, extends: extendsOptions } = from;
  4487. if (extendsOptions) {
  4488. mergeOptions(to, extendsOptions, strats, true);
  4489. }
  4490. if (mixins) {
  4491. mixins.forEach((m2) => mergeOptions(to, m2, strats, true));
  4492. }
  4493. for (const key in from) {
  4494. if (asMixin && key === "expose") {
  4495. warn(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
  4496. } else {
  4497. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  4498. to[key] = strat ? strat(to[key], from[key]) : from[key];
  4499. }
  4500. }
  4501. return to;
  4502. }
  4503. const internalOptionMergeStrats = {
  4504. data: mergeDataFn,
  4505. props: mergeObjectOptions,
  4506. emits: mergeObjectOptions,
  4507. // objects
  4508. methods: mergeObjectOptions,
  4509. computed: mergeObjectOptions,
  4510. // lifecycle
  4511. beforeCreate: mergeAsArray$1,
  4512. created: mergeAsArray$1,
  4513. beforeMount: mergeAsArray$1,
  4514. mounted: mergeAsArray$1,
  4515. beforeUpdate: mergeAsArray$1,
  4516. updated: mergeAsArray$1,
  4517. beforeDestroy: mergeAsArray$1,
  4518. beforeUnmount: mergeAsArray$1,
  4519. destroyed: mergeAsArray$1,
  4520. unmounted: mergeAsArray$1,
  4521. activated: mergeAsArray$1,
  4522. deactivated: mergeAsArray$1,
  4523. errorCaptured: mergeAsArray$1,
  4524. serverPrefetch: mergeAsArray$1,
  4525. // assets
  4526. components: mergeObjectOptions,
  4527. directives: mergeObjectOptions,
  4528. // watch
  4529. watch: mergeWatchOptions,
  4530. // provide / inject
  4531. provide: mergeDataFn,
  4532. inject: mergeInject
  4533. };
  4534. function mergeDataFn(to, from) {
  4535. if (!from) {
  4536. return to;
  4537. }
  4538. if (!to) {
  4539. return from;
  4540. }
  4541. return function mergedDataFn() {
  4542. return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
  4543. };
  4544. }
  4545. function mergeInject(to, from) {
  4546. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  4547. }
  4548. function normalizeInject(raw) {
  4549. if (isArray$1(raw)) {
  4550. const res = {};
  4551. for (let i2 = 0; i2 < raw.length; i2++) {
  4552. res[raw[i2]] = raw[i2];
  4553. }
  4554. return res;
  4555. }
  4556. return raw;
  4557. }
  4558. function mergeAsArray$1(to, from) {
  4559. return to ? [...new Set([].concat(to, from))] : from;
  4560. }
  4561. function mergeObjectOptions(to, from) {
  4562. return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
  4563. }
  4564. function mergeWatchOptions(to, from) {
  4565. if (!to)
  4566. return from;
  4567. if (!from)
  4568. return to;
  4569. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  4570. for (const key in from) {
  4571. merged[key] = mergeAsArray$1(to[key], from[key]);
  4572. }
  4573. return merged;
  4574. }
  4575. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  4576. const props = {};
  4577. const attrs = {};
  4578. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4579. setFullProps(instance, rawProps, props, attrs);
  4580. for (const key in instance.propsOptions[0]) {
  4581. if (!(key in props)) {
  4582. props[key] = void 0;
  4583. }
  4584. }
  4585. {
  4586. validateProps(rawProps || {}, props, instance);
  4587. }
  4588. if (isStateful) {
  4589. instance.props = isSSR ? props : shallowReactive(props);
  4590. } else {
  4591. if (!instance.type.props) {
  4592. instance.props = attrs;
  4593. } else {
  4594. instance.props = props;
  4595. }
  4596. }
  4597. instance.attrs = attrs;
  4598. }
  4599. function isInHmrContext(instance) {
  4600. while (instance) {
  4601. if (instance.type.__hmrId)
  4602. return true;
  4603. instance = instance.parent;
  4604. }
  4605. }
  4606. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4607. const { props, attrs, vnode: { patchFlag } } = instance;
  4608. const rawCurrentProps = toRaw(props);
  4609. const [options] = instance.propsOptions;
  4610. let hasAttrsChanged = false;
  4611. if (
  4612. // always force full diff in dev
  4613. // - #1942 if hmr is enabled with sfc component
  4614. // - vite#872 non-sfc component used by sfc component
  4615. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4616. ) {
  4617. if (patchFlag & 8) {
  4618. const propsToUpdate = instance.vnode.dynamicProps;
  4619. for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
  4620. let key = propsToUpdate[i2];
  4621. if (isEmitListener(instance.emitsOptions, key)) {
  4622. continue;
  4623. }
  4624. const value = rawProps[key];
  4625. if (options) {
  4626. if (hasOwn$1(attrs, key)) {
  4627. if (value !== attrs[key]) {
  4628. attrs[key] = value;
  4629. hasAttrsChanged = true;
  4630. }
  4631. } else {
  4632. const camelizedKey = camelize(key);
  4633. props[camelizedKey] = resolvePropValue(
  4634. options,
  4635. rawCurrentProps,
  4636. camelizedKey,
  4637. value,
  4638. instance,
  4639. false
  4640. /* isAbsent */
  4641. );
  4642. }
  4643. } else {
  4644. if (value !== attrs[key]) {
  4645. attrs[key] = value;
  4646. hasAttrsChanged = true;
  4647. }
  4648. }
  4649. }
  4650. }
  4651. } else {
  4652. if (setFullProps(instance, rawProps, props, attrs)) {
  4653. hasAttrsChanged = true;
  4654. }
  4655. let kebabKey;
  4656. for (const key in rawCurrentProps) {
  4657. if (!rawProps || // for camelCase
  4658. !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4659. // and converted to camelCase (#955)
  4660. ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
  4661. if (options) {
  4662. if (rawPrevProps && // for camelCase
  4663. (rawPrevProps[key] !== void 0 || // for kebab-case
  4664. rawPrevProps[kebabKey] !== void 0)) {
  4665. props[key] = resolvePropValue(
  4666. options,
  4667. rawCurrentProps,
  4668. key,
  4669. void 0,
  4670. instance,
  4671. true
  4672. /* isAbsent */
  4673. );
  4674. }
  4675. } else {
  4676. delete props[key];
  4677. }
  4678. }
  4679. }
  4680. if (attrs !== rawCurrentProps) {
  4681. for (const key in attrs) {
  4682. if (!rawProps || !hasOwn$1(rawProps, key) && true) {
  4683. delete attrs[key];
  4684. hasAttrsChanged = true;
  4685. }
  4686. }
  4687. }
  4688. }
  4689. if (hasAttrsChanged) {
  4690. trigger(instance, "set", "$attrs");
  4691. }
  4692. {
  4693. validateProps(rawProps || {}, props, instance);
  4694. }
  4695. }
  4696. function setFullProps(instance, rawProps, props, attrs) {
  4697. const [options, needCastKeys] = instance.propsOptions;
  4698. let hasAttrsChanged = false;
  4699. let rawCastValues;
  4700. if (rawProps) {
  4701. for (let key in rawProps) {
  4702. if (isReservedProp(key)) {
  4703. continue;
  4704. }
  4705. const value = rawProps[key];
  4706. let camelKey;
  4707. if (options && hasOwn$1(options, camelKey = camelize(key))) {
  4708. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4709. props[camelKey] = value;
  4710. } else {
  4711. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4712. }
  4713. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4714. if (!(key in attrs) || value !== attrs[key]) {
  4715. attrs[key] = value;
  4716. hasAttrsChanged = true;
  4717. }
  4718. }
  4719. }
  4720. }
  4721. if (needCastKeys) {
  4722. const rawCurrentProps = toRaw(props);
  4723. const castValues = rawCastValues || EMPTY_OBJ;
  4724. for (let i2 = 0; i2 < needCastKeys.length; i2++) {
  4725. const key = needCastKeys[i2];
  4726. props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key));
  4727. }
  4728. }
  4729. return hasAttrsChanged;
  4730. }
  4731. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4732. const opt = options[key];
  4733. if (opt != null) {
  4734. const hasDefault = hasOwn$1(opt, "default");
  4735. if (hasDefault && value === void 0) {
  4736. const defaultValue = opt.default;
  4737. if (opt.type !== Function && isFunction(defaultValue)) {
  4738. const { propsDefaults } = instance;
  4739. if (key in propsDefaults) {
  4740. value = propsDefaults[key];
  4741. } else {
  4742. setCurrentInstance(instance);
  4743. value = propsDefaults[key] = defaultValue.call(null, props);
  4744. unsetCurrentInstance();
  4745. }
  4746. } else {
  4747. value = defaultValue;
  4748. }
  4749. }
  4750. if (opt[
  4751. 0
  4752. /* BooleanFlags.shouldCast */
  4753. ]) {
  4754. if (isAbsent && !hasDefault) {
  4755. value = false;
  4756. } else if (opt[
  4757. 1
  4758. /* BooleanFlags.shouldCastTrue */
  4759. ] && (value === "" || value === hyphenate(key))) {
  4760. value = true;
  4761. }
  4762. }
  4763. }
  4764. return value;
  4765. }
  4766. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4767. const cache = appContext.propsCache;
  4768. const cached = cache.get(comp);
  4769. if (cached) {
  4770. return cached;
  4771. }
  4772. const raw = comp.props;
  4773. const normalized = {};
  4774. const needCastKeys = [];
  4775. let hasExtends = false;
  4776. if (!isFunction(comp)) {
  4777. const extendProps = (raw2) => {
  4778. hasExtends = true;
  4779. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4780. extend(normalized, props);
  4781. if (keys)
  4782. needCastKeys.push(...keys);
  4783. };
  4784. if (!asMixin && appContext.mixins.length) {
  4785. appContext.mixins.forEach(extendProps);
  4786. }
  4787. if (comp.extends) {
  4788. extendProps(comp.extends);
  4789. }
  4790. if (comp.mixins) {
  4791. comp.mixins.forEach(extendProps);
  4792. }
  4793. }
  4794. if (!raw && !hasExtends) {
  4795. if (isObject$3(comp)) {
  4796. cache.set(comp, EMPTY_ARR);
  4797. }
  4798. return EMPTY_ARR;
  4799. }
  4800. if (isArray$1(raw)) {
  4801. for (let i2 = 0; i2 < raw.length; i2++) {
  4802. if (!isString(raw[i2])) {
  4803. warn(`props must be strings when using array syntax.`, raw[i2]);
  4804. }
  4805. const normalizedKey = camelize(raw[i2]);
  4806. if (validatePropName(normalizedKey)) {
  4807. normalized[normalizedKey] = EMPTY_OBJ;
  4808. }
  4809. }
  4810. } else if (raw) {
  4811. if (!isObject$3(raw)) {
  4812. warn(`invalid props options`, raw);
  4813. }
  4814. for (const key in raw) {
  4815. const normalizedKey = camelize(key);
  4816. if (validatePropName(normalizedKey)) {
  4817. const opt = raw[key];
  4818. const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt);
  4819. if (prop) {
  4820. const booleanIndex = getTypeIndex(Boolean, prop.type);
  4821. const stringIndex = getTypeIndex(String, prop.type);
  4822. prop[
  4823. 0
  4824. /* BooleanFlags.shouldCast */
  4825. ] = booleanIndex > -1;
  4826. prop[
  4827. 1
  4828. /* BooleanFlags.shouldCastTrue */
  4829. ] = stringIndex < 0 || booleanIndex < stringIndex;
  4830. if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
  4831. needCastKeys.push(normalizedKey);
  4832. }
  4833. }
  4834. }
  4835. }
  4836. }
  4837. const res = [normalized, needCastKeys];
  4838. if (isObject$3(comp)) {
  4839. cache.set(comp, res);
  4840. }
  4841. return res;
  4842. }
  4843. function validatePropName(key) {
  4844. if (key[0] !== "$") {
  4845. return true;
  4846. } else {
  4847. warn(`Invalid prop name: "${key}" is a reserved property.`);
  4848. }
  4849. return false;
  4850. }
  4851. function getType$1(ctor) {
  4852. const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
  4853. return match ? match[2] : ctor === null ? "null" : "";
  4854. }
  4855. function isSameType(a2, b2) {
  4856. return getType$1(a2) === getType$1(b2);
  4857. }
  4858. function getTypeIndex(type, expectedTypes) {
  4859. if (isArray$1(expectedTypes)) {
  4860. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  4861. } else if (isFunction(expectedTypes)) {
  4862. return isSameType(expectedTypes, type) ? 0 : -1;
  4863. }
  4864. return -1;
  4865. }
  4866. function validateProps(rawProps, props, instance) {
  4867. const resolvedValues = toRaw(props);
  4868. const options = instance.propsOptions[0];
  4869. for (const key in options) {
  4870. let opt = options[key];
  4871. if (opt == null)
  4872. continue;
  4873. validateProp(key, resolvedValues[key], opt, !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key)));
  4874. }
  4875. }
  4876. function validateProp(name, value, prop, isAbsent) {
  4877. const { type, required, validator } = prop;
  4878. if (required && isAbsent) {
  4879. warn('Missing required prop: "' + name + '"');
  4880. return;
  4881. }
  4882. if (value == null && !prop.required) {
  4883. return;
  4884. }
  4885. if (type != null && type !== true) {
  4886. let isValid = false;
  4887. const types = isArray$1(type) ? type : [type];
  4888. const expectedTypes = [];
  4889. for (let i2 = 0; i2 < types.length && !isValid; i2++) {
  4890. const { valid, expectedType } = assertType(value, types[i2]);
  4891. expectedTypes.push(expectedType || "");
  4892. isValid = valid;
  4893. }
  4894. if (!isValid) {
  4895. warn(getInvalidTypeMessage(name, value, expectedTypes));
  4896. return;
  4897. }
  4898. }
  4899. if (validator && !validator(value)) {
  4900. warn('Invalid prop: custom validator check failed for prop "' + name + '".');
  4901. }
  4902. }
  4903. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
  4904. function assertType(value, type) {
  4905. let valid;
  4906. const expectedType = getType$1(type);
  4907. if (isSimpleType(expectedType)) {
  4908. const t2 = typeof value;
  4909. valid = t2 === expectedType.toLowerCase();
  4910. if (!valid && t2 === "object") {
  4911. valid = value instanceof type;
  4912. }
  4913. } else if (expectedType === "Object") {
  4914. valid = isObject$3(value);
  4915. } else if (expectedType === "Array") {
  4916. valid = isArray$1(value);
  4917. } else if (expectedType === "null") {
  4918. valid = value === null;
  4919. } else {
  4920. valid = value instanceof type;
  4921. }
  4922. return {
  4923. valid,
  4924. expectedType
  4925. };
  4926. }
  4927. function getInvalidTypeMessage(name, value, expectedTypes) {
  4928. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4929. const expectedType = expectedTypes[0];
  4930. const receivedType = toRawType(value);
  4931. const expectedValue = styleValue(value, expectedType);
  4932. const receivedValue = styleValue(value, receivedType);
  4933. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4934. message += ` with value ${expectedValue}`;
  4935. }
  4936. message += `, got ${receivedType} `;
  4937. if (isExplicable(receivedType)) {
  4938. message += `with value ${receivedValue}.`;
  4939. }
  4940. return message;
  4941. }
  4942. function styleValue(value, type) {
  4943. if (type === "String") {
  4944. return `"${value}"`;
  4945. } else if (type === "Number") {
  4946. return `${Number(value)}`;
  4947. } else {
  4948. return `${value}`;
  4949. }
  4950. }
  4951. function isExplicable(type) {
  4952. const explicitTypes = ["string", "number", "boolean"];
  4953. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4954. }
  4955. function isBoolean(...args) {
  4956. return args.some((elem) => elem.toLowerCase() === "boolean");
  4957. }
  4958. function createAppContext() {
  4959. return {
  4960. app: null,
  4961. config: {
  4962. isNativeTag: NO,
  4963. performance: false,
  4964. globalProperties: {},
  4965. optionMergeStrategies: {},
  4966. errorHandler: void 0,
  4967. warnHandler: void 0,
  4968. compilerOptions: {}
  4969. },
  4970. mixins: [],
  4971. components: {},
  4972. directives: {},
  4973. provides: /* @__PURE__ */ Object.create(null),
  4974. optionsCache: /* @__PURE__ */ new WeakMap(),
  4975. propsCache: /* @__PURE__ */ new WeakMap(),
  4976. emitsCache: /* @__PURE__ */ new WeakMap()
  4977. };
  4978. }
  4979. let uid$1 = 0;
  4980. function createAppAPI(render, hydrate) {
  4981. return function createApp2(rootComponent, rootProps = null) {
  4982. if (!isFunction(rootComponent)) {
  4983. rootComponent = Object.assign({}, rootComponent);
  4984. }
  4985. if (rootProps != null && !isObject$3(rootProps)) {
  4986. warn(`root props passed to app.mount() must be an object.`);
  4987. rootProps = null;
  4988. }
  4989. const context = createAppContext();
  4990. const installedPlugins = /* @__PURE__ */ new Set();
  4991. const app = context.app = {
  4992. _uid: uid$1++,
  4993. _component: rootComponent,
  4994. _props: rootProps,
  4995. _container: null,
  4996. _context: context,
  4997. _instance: null,
  4998. version,
  4999. get config() {
  5000. return context.config;
  5001. },
  5002. set config(v2) {
  5003. {
  5004. warn(`app.config cannot be replaced. Modify individual options instead.`);
  5005. }
  5006. },
  5007. use(plugin2, ...options) {
  5008. if (installedPlugins.has(plugin2)) {
  5009. warn(`Plugin has already been applied to target app.`);
  5010. } else if (plugin2 && isFunction(plugin2.install)) {
  5011. installedPlugins.add(plugin2);
  5012. plugin2.install(app, ...options);
  5013. } else if (isFunction(plugin2)) {
  5014. installedPlugins.add(plugin2);
  5015. plugin2(app, ...options);
  5016. } else {
  5017. warn(`A plugin must either be a function or an object with an "install" function.`);
  5018. }
  5019. return app;
  5020. },
  5021. mixin(mixin) {
  5022. {
  5023. if (!context.mixins.includes(mixin)) {
  5024. context.mixins.push(mixin);
  5025. } else {
  5026. warn("Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : ""));
  5027. }
  5028. }
  5029. return app;
  5030. },
  5031. component(name, component) {
  5032. {
  5033. validateComponentName(name, context.config);
  5034. }
  5035. if (!component) {
  5036. return context.components[name];
  5037. }
  5038. if (context.components[name]) {
  5039. warn(`Component "${name}" has already been registered in target app.`);
  5040. }
  5041. context.components[name] = component;
  5042. return app;
  5043. },
  5044. directive(name, directive) {
  5045. {
  5046. validateDirectiveName(name);
  5047. }
  5048. if (!directive) {
  5049. return context.directives[name];
  5050. }
  5051. if (context.directives[name]) {
  5052. warn(`Directive "${name}" has already been registered in target app.`);
  5053. }
  5054. context.directives[name] = directive;
  5055. return app;
  5056. },
  5057. // fixed by xxxxxx
  5058. mount() {
  5059. },
  5060. // fixed by xxxxxx
  5061. unmount() {
  5062. },
  5063. provide(key, value) {
  5064. if (key in context.provides) {
  5065. warn(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
  5066. }
  5067. context.provides[key] = value;
  5068. return app;
  5069. }
  5070. };
  5071. return app;
  5072. };
  5073. }
  5074. let supported;
  5075. let perf;
  5076. function startMeasure(instance, type) {
  5077. if (instance.appContext.config.performance && isSupported()) {
  5078. perf.mark(`vue-${type}-${instance.uid}`);
  5079. }
  5080. {
  5081. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  5082. }
  5083. }
  5084. function endMeasure(instance, type) {
  5085. if (instance.appContext.config.performance && isSupported()) {
  5086. const startTag = `vue-${type}-${instance.uid}`;
  5087. const endTag = startTag + `:end`;
  5088. perf.mark(endTag);
  5089. perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);
  5090. perf.clearMarks(startTag);
  5091. perf.clearMarks(endTag);
  5092. }
  5093. {
  5094. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  5095. }
  5096. }
  5097. function isSupported() {
  5098. if (supported !== void 0) {
  5099. return supported;
  5100. }
  5101. if (typeof window !== "undefined" && window.performance) {
  5102. supported = true;
  5103. perf = window.performance;
  5104. } else {
  5105. supported = false;
  5106. }
  5107. return supported;
  5108. }
  5109. const queuePostRenderEffect$1 = queuePostFlushCb;
  5110. const Fragment = Symbol("Fragment");
  5111. const Text = Symbol("Text");
  5112. const Comment = Symbol("Comment");
  5113. const Static = Symbol("Static");
  5114. function isVNode(value) {
  5115. return value ? value.__v_isVNode === true : false;
  5116. }
  5117. const InternalObjectKey = `__vInternal`;
  5118. function guardReactiveProps(props) {
  5119. if (!props)
  5120. return null;
  5121. return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
  5122. }
  5123. const emptyAppContext = createAppContext();
  5124. let uid = 0;
  5125. function createComponentInstance(vnode, parent, suspense) {
  5126. const type = vnode.type;
  5127. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  5128. const instance = {
  5129. uid: uid++,
  5130. vnode,
  5131. type,
  5132. parent,
  5133. appContext,
  5134. root: null,
  5135. next: null,
  5136. subTree: null,
  5137. effect: null,
  5138. update: null,
  5139. scope: new EffectScope(
  5140. true
  5141. /* detached */
  5142. ),
  5143. render: null,
  5144. proxy: null,
  5145. exposed: null,
  5146. exposeProxy: null,
  5147. withProxy: null,
  5148. provides: parent ? parent.provides : Object.create(appContext.provides),
  5149. accessCache: null,
  5150. renderCache: [],
  5151. // local resolved assets
  5152. components: null,
  5153. directives: null,
  5154. // resolved props and emits options
  5155. propsOptions: normalizePropsOptions(type, appContext),
  5156. emitsOptions: normalizeEmitsOptions(type, appContext),
  5157. // emit
  5158. emit: null,
  5159. emitted: null,
  5160. // props default value
  5161. propsDefaults: EMPTY_OBJ,
  5162. // inheritAttrs
  5163. inheritAttrs: type.inheritAttrs,
  5164. // state
  5165. ctx: EMPTY_OBJ,
  5166. data: EMPTY_OBJ,
  5167. props: EMPTY_OBJ,
  5168. attrs: EMPTY_OBJ,
  5169. slots: EMPTY_OBJ,
  5170. refs: EMPTY_OBJ,
  5171. setupState: EMPTY_OBJ,
  5172. setupContext: null,
  5173. // suspense related
  5174. suspense,
  5175. suspenseId: suspense ? suspense.pendingId : 0,
  5176. asyncDep: null,
  5177. asyncResolved: false,
  5178. // lifecycle hooks
  5179. // not using enums here because it results in computed properties
  5180. isMounted: false,
  5181. isUnmounted: false,
  5182. isDeactivated: false,
  5183. bc: null,
  5184. c: null,
  5185. bm: null,
  5186. m: null,
  5187. bu: null,
  5188. u: null,
  5189. um: null,
  5190. bum: null,
  5191. da: null,
  5192. a: null,
  5193. rtg: null,
  5194. rtc: null,
  5195. ec: null,
  5196. sp: null
  5197. };
  5198. {
  5199. instance.ctx = createDevRenderContext(instance);
  5200. }
  5201. instance.root = parent ? parent.root : instance;
  5202. instance.emit = emit.bind(null, instance);
  5203. if (vnode.ce) {
  5204. vnode.ce(instance);
  5205. }
  5206. return instance;
  5207. }
  5208. let currentInstance = null;
  5209. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  5210. const setCurrentInstance = (instance) => {
  5211. currentInstance = instance;
  5212. instance.scope.on();
  5213. };
  5214. const unsetCurrentInstance = () => {
  5215. currentInstance && currentInstance.scope.off();
  5216. currentInstance = null;
  5217. };
  5218. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  5219. function validateComponentName(name, config) {
  5220. const appIsNativeTag = config.isNativeTag || NO;
  5221. if (isBuiltInTag(name) || appIsNativeTag(name)) {
  5222. warn("Do not use built-in or reserved HTML elements as component id: " + name);
  5223. }
  5224. }
  5225. function isStatefulComponent(instance) {
  5226. return instance.vnode.shapeFlag & 4;
  5227. }
  5228. let isInSSRComponentSetup = false;
  5229. function setupComponent(instance, isSSR = false) {
  5230. isInSSRComponentSetup = isSSR;
  5231. const {
  5232. props
  5233. /*, children*/
  5234. } = instance.vnode;
  5235. const isStateful = isStatefulComponent(instance);
  5236. initProps$1(instance, props, isStateful, isSSR);
  5237. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  5238. isInSSRComponentSetup = false;
  5239. return setupResult;
  5240. }
  5241. function setupStatefulComponent(instance, isSSR) {
  5242. const Component2 = instance.type;
  5243. {
  5244. if (Component2.name) {
  5245. validateComponentName(Component2.name, instance.appContext.config);
  5246. }
  5247. if (Component2.components) {
  5248. const names = Object.keys(Component2.components);
  5249. for (let i2 = 0; i2 < names.length; i2++) {
  5250. validateComponentName(names[i2], instance.appContext.config);
  5251. }
  5252. }
  5253. if (Component2.directives) {
  5254. const names = Object.keys(Component2.directives);
  5255. for (let i2 = 0; i2 < names.length; i2++) {
  5256. validateDirectiveName(names[i2]);
  5257. }
  5258. }
  5259. if (Component2.compilerOptions && isRuntimeOnly()) {
  5260. warn(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`);
  5261. }
  5262. }
  5263. instance.accessCache = /* @__PURE__ */ Object.create(null);
  5264. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  5265. {
  5266. exposePropsOnRenderContext(instance);
  5267. }
  5268. const { setup } = Component2;
  5269. if (setup) {
  5270. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  5271. setCurrentInstance(instance);
  5272. pauseTracking();
  5273. const setupResult = callWithErrorHandling(setup, instance, 0, [shallowReadonly(instance.props), setupContext]);
  5274. resetTracking();
  5275. unsetCurrentInstance();
  5276. if (isPromise(setupResult)) {
  5277. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  5278. {
  5279. warn(`setup() returned a Promise, but the version of Vue you are using does not support it yet.`);
  5280. }
  5281. } else {
  5282. handleSetupResult(instance, setupResult, isSSR);
  5283. }
  5284. } else {
  5285. finishComponentSetup(instance, isSSR);
  5286. }
  5287. }
  5288. function handleSetupResult(instance, setupResult, isSSR) {
  5289. if (isFunction(setupResult)) {
  5290. {
  5291. instance.render = setupResult;
  5292. }
  5293. } else if (isObject$3(setupResult)) {
  5294. if (isVNode(setupResult)) {
  5295. warn(`setup() should not return VNodes directly - return a render function instead.`);
  5296. }
  5297. {
  5298. instance.devtoolsRawSetupState = setupResult;
  5299. }
  5300. instance.setupState = proxyRefs(setupResult);
  5301. {
  5302. exposeSetupStateOnRenderContext(instance);
  5303. }
  5304. } else if (setupResult !== void 0) {
  5305. warn(`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`);
  5306. }
  5307. finishComponentSetup(instance, isSSR);
  5308. }
  5309. let compile;
  5310. const isRuntimeOnly = () => !compile;
  5311. function finishComponentSetup(instance, isSSR, skipOptions) {
  5312. const Component2 = instance.type;
  5313. if (!instance.render) {
  5314. instance.render = Component2.render || NOOP;
  5315. }
  5316. {
  5317. setCurrentInstance(instance);
  5318. pauseTracking();
  5319. applyOptions$1(instance);
  5320. resetTracking();
  5321. unsetCurrentInstance();
  5322. }
  5323. if (!Component2.render && instance.render === NOOP && !isSSR) {
  5324. if (Component2.template) {
  5325. warn(
  5326. `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  5327. /* should not happen */
  5328. );
  5329. } else {
  5330. warn(`Component is missing template or render function.`);
  5331. }
  5332. }
  5333. }
  5334. function createAttrsProxy(instance) {
  5335. return new Proxy(
  5336. instance.attrs,
  5337. {
  5338. get(target, key) {
  5339. track(instance, "get", "$attrs");
  5340. return target[key];
  5341. },
  5342. set() {
  5343. warn(`setupContext.attrs is readonly.`);
  5344. return false;
  5345. },
  5346. deleteProperty() {
  5347. warn(`setupContext.attrs is readonly.`);
  5348. return false;
  5349. }
  5350. }
  5351. );
  5352. }
  5353. function createSetupContext(instance) {
  5354. const expose = (exposed) => {
  5355. {
  5356. if (instance.exposed) {
  5357. warn(`expose() should be called only once per setup().`);
  5358. }
  5359. if (exposed != null) {
  5360. let exposedType = typeof exposed;
  5361. if (exposedType === "object") {
  5362. if (isArray$1(exposed)) {
  5363. exposedType = "array";
  5364. } else if (isRef(exposed)) {
  5365. exposedType = "ref";
  5366. }
  5367. }
  5368. if (exposedType !== "object") {
  5369. warn(`expose() should be passed a plain object, received ${exposedType}.`);
  5370. }
  5371. }
  5372. }
  5373. instance.exposed = exposed || {};
  5374. };
  5375. let attrs;
  5376. {
  5377. return Object.freeze({
  5378. get attrs() {
  5379. return attrs || (attrs = createAttrsProxy(instance));
  5380. },
  5381. get slots() {
  5382. return shallowReadonly(instance.slots);
  5383. },
  5384. get emit() {
  5385. return (event, ...args) => instance.emit(event, ...args);
  5386. },
  5387. expose
  5388. });
  5389. }
  5390. }
  5391. function getExposeProxy(instance) {
  5392. if (instance.exposed) {
  5393. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  5394. get(target, key) {
  5395. if (key in target) {
  5396. return target[key];
  5397. }
  5398. return instance.proxy[key];
  5399. },
  5400. has(target, key) {
  5401. return key in target || key in publicPropertiesMap;
  5402. }
  5403. }));
  5404. }
  5405. }
  5406. const classifyRE = /(?:^|[-_])(\w)/g;
  5407. const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
  5408. function getComponentName(Component2, includeInferred = true) {
  5409. return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  5410. }
  5411. function formatComponentName(instance, Component2, isRoot = false) {
  5412. let name = getComponentName(Component2);
  5413. if (!name && Component2.__file) {
  5414. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  5415. if (match) {
  5416. name = match[1];
  5417. }
  5418. }
  5419. if (!name && instance && instance.parent) {
  5420. const inferFromRegistry = (registry) => {
  5421. for (const key in registry) {
  5422. if (registry[key] === Component2) {
  5423. return key;
  5424. }
  5425. }
  5426. };
  5427. name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
  5428. }
  5429. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  5430. }
  5431. const computed = (getterOrOptions, debugOptions) => {
  5432. return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  5433. };
  5434. const version = "3.2.47";
  5435. function unwrapper(target) {
  5436. return unref(target);
  5437. }
  5438. const ARRAYTYPE = "[object Array]";
  5439. const OBJECTTYPE = "[object Object]";
  5440. function diff(current, pre) {
  5441. const result2 = {};
  5442. syncKeys(current, pre);
  5443. _diff(current, pre, "", result2);
  5444. return result2;
  5445. }
  5446. function syncKeys(current, pre) {
  5447. current = unwrapper(current);
  5448. if (current === pre)
  5449. return;
  5450. const rootCurrentType = toTypeString(current);
  5451. const rootPreType = toTypeString(pre);
  5452. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  5453. for (let key in pre) {
  5454. const currentValue = current[key];
  5455. if (currentValue === void 0) {
  5456. current[key] = null;
  5457. } else {
  5458. syncKeys(currentValue, pre[key]);
  5459. }
  5460. }
  5461. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  5462. if (current.length >= pre.length) {
  5463. pre.forEach((item, index2) => {
  5464. syncKeys(current[index2], item);
  5465. });
  5466. }
  5467. }
  5468. }
  5469. function _diff(current, pre, path, result2) {
  5470. current = unwrapper(current);
  5471. if (current === pre)
  5472. return;
  5473. const rootCurrentType = toTypeString(current);
  5474. const rootPreType = toTypeString(pre);
  5475. if (rootCurrentType == OBJECTTYPE) {
  5476. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  5477. setResult(result2, path, current);
  5478. } else {
  5479. for (let key in current) {
  5480. const currentValue = unwrapper(current[key]);
  5481. const preValue = pre[key];
  5482. const currentType = toTypeString(currentValue);
  5483. const preType = toTypeString(preValue);
  5484. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  5485. if (currentValue != preValue) {
  5486. setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
  5487. }
  5488. } else if (currentType == ARRAYTYPE) {
  5489. if (preType != ARRAYTYPE) {
  5490. setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
  5491. } else {
  5492. if (currentValue.length < preValue.length) {
  5493. setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
  5494. } else {
  5495. currentValue.forEach((item, index2) => {
  5496. _diff(item, preValue[index2], (path == "" ? "" : path + ".") + key + "[" + index2 + "]", result2);
  5497. });
  5498. }
  5499. }
  5500. } else if (currentType == OBJECTTYPE) {
  5501. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  5502. setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
  5503. } else {
  5504. for (let subKey in currentValue) {
  5505. _diff(currentValue[subKey], preValue[subKey], (path == "" ? "" : path + ".") + key + "." + subKey, result2);
  5506. }
  5507. }
  5508. }
  5509. }
  5510. }
  5511. } else if (rootCurrentType == ARRAYTYPE) {
  5512. if (rootPreType != ARRAYTYPE) {
  5513. setResult(result2, path, current);
  5514. } else {
  5515. if (current.length < pre.length) {
  5516. setResult(result2, path, current);
  5517. } else {
  5518. current.forEach((item, index2) => {
  5519. _diff(item, pre[index2], path + "[" + index2 + "]", result2);
  5520. });
  5521. }
  5522. }
  5523. } else {
  5524. setResult(result2, path, current);
  5525. }
  5526. }
  5527. function setResult(result2, k, v2) {
  5528. result2[k] = v2;
  5529. }
  5530. function hasComponentEffect(instance) {
  5531. return queue.includes(instance.update);
  5532. }
  5533. function flushCallbacks(instance) {
  5534. const ctx = instance.ctx;
  5535. const callbacks = ctx.__next_tick_callbacks;
  5536. if (callbacks && callbacks.length) {
  5537. const copies = callbacks.slice(0);
  5538. callbacks.length = 0;
  5539. for (let i2 = 0; i2 < copies.length; i2++) {
  5540. copies[i2]();
  5541. }
  5542. }
  5543. }
  5544. function nextTick(instance, fn) {
  5545. const ctx = instance.ctx;
  5546. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  5547. return nextTick$1(fn && fn.bind(instance.proxy));
  5548. }
  5549. let _resolve;
  5550. if (!ctx.__next_tick_callbacks) {
  5551. ctx.__next_tick_callbacks = [];
  5552. }
  5553. ctx.__next_tick_callbacks.push(() => {
  5554. if (fn) {
  5555. callWithErrorHandling(
  5556. fn.bind(instance.proxy),
  5557. instance,
  5558. 14
  5559. /* ErrorCodes.SCHEDULER */
  5560. );
  5561. } else if (_resolve) {
  5562. _resolve(instance.proxy);
  5563. }
  5564. });
  5565. return new Promise((resolve2) => {
  5566. _resolve = resolve2;
  5567. });
  5568. }
  5569. function clone$1(src, seen) {
  5570. src = unwrapper(src);
  5571. const type = typeof src;
  5572. if (type === "object" && src !== null) {
  5573. let copy = seen.get(src);
  5574. if (typeof copy !== "undefined") {
  5575. return copy;
  5576. }
  5577. if (isArray$1(src)) {
  5578. const len = src.length;
  5579. copy = new Array(len);
  5580. seen.set(src, copy);
  5581. for (let i2 = 0; i2 < len; i2++) {
  5582. copy[i2] = clone$1(src[i2], seen);
  5583. }
  5584. } else {
  5585. copy = {};
  5586. seen.set(src, copy);
  5587. for (const name in src) {
  5588. if (hasOwn$1(src, name)) {
  5589. copy[name] = clone$1(src[name], seen);
  5590. }
  5591. }
  5592. }
  5593. return copy;
  5594. }
  5595. if (type !== "symbol") {
  5596. return src;
  5597. }
  5598. }
  5599. function deepCopy(src) {
  5600. return clone$1(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  5601. }
  5602. function getMPInstanceData(instance, keys) {
  5603. const data = instance.data;
  5604. const ret = /* @__PURE__ */ Object.create(null);
  5605. keys.forEach((key) => {
  5606. ret[key] = data[key];
  5607. });
  5608. return ret;
  5609. }
  5610. function patch(instance, data, oldData) {
  5611. if (!data) {
  5612. return;
  5613. }
  5614. data = deepCopy(data);
  5615. const ctx = instance.ctx;
  5616. const mpType = ctx.mpType;
  5617. if (mpType === "page" || mpType === "component") {
  5618. data.r0 = 1;
  5619. const mpInstance = ctx.$scope;
  5620. const keys = Object.keys(data);
  5621. const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
  5622. if (Object.keys(diffData).length) {
  5623. ctx.__next_tick_pending = true;
  5624. mpInstance.setData(diffData, () => {
  5625. ctx.__next_tick_pending = false;
  5626. flushCallbacks(instance);
  5627. });
  5628. flushPreFlushCbs();
  5629. } else {
  5630. flushCallbacks(instance);
  5631. }
  5632. }
  5633. }
  5634. function initAppConfig(appConfig) {
  5635. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  5636. return nextTick(this.$, fn);
  5637. };
  5638. }
  5639. function onApplyOptions(options, instance, publicThis) {
  5640. instance.appContext.config.globalProperties.$applyOptions(options, instance, publicThis);
  5641. const computedOptions = options.computed;
  5642. if (computedOptions) {
  5643. const keys = Object.keys(computedOptions);
  5644. if (keys.length) {
  5645. const ctx = instance.ctx;
  5646. if (!ctx.$computedKeys) {
  5647. ctx.$computedKeys = [];
  5648. }
  5649. ctx.$computedKeys.push(...keys);
  5650. }
  5651. }
  5652. delete instance.ctx.$onApplyOptions;
  5653. }
  5654. function setRef$1(instance, isUnmount = false) {
  5655. const { setupState, $templateRefs, ctx: { $scope, $mpPlatform } } = instance;
  5656. if ($mpPlatform === "mp-alipay") {
  5657. return;
  5658. }
  5659. if (!$templateRefs || !$scope) {
  5660. return;
  5661. }
  5662. if (isUnmount) {
  5663. return $templateRefs.forEach((templateRef) => setTemplateRef(templateRef, null, setupState));
  5664. }
  5665. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  5666. const doSetByRefs = (refs) => {
  5667. const mpComponents = (
  5668. // 字节小程序 selectAllComponents 可能返回 null
  5669. // https://github.com/dcloudio/uni-app/issues/3954
  5670. ($scope.selectAllComponents(".r") || []).concat($scope.selectAllComponents(".r-i-f") || [])
  5671. );
  5672. return refs.filter((templateRef) => {
  5673. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  5674. if (check && refValue === null) {
  5675. return true;
  5676. }
  5677. setTemplateRef(templateRef, refValue, setupState);
  5678. return false;
  5679. });
  5680. };
  5681. const doSet = () => {
  5682. const refs = doSetByRefs($templateRefs);
  5683. if (refs.length && instance.proxy && instance.proxy.$scope) {
  5684. instance.proxy.$scope.setData({ r1: 1 }, () => {
  5685. doSetByRefs(refs);
  5686. });
  5687. }
  5688. };
  5689. if ($scope._$setRef) {
  5690. $scope._$setRef(doSet);
  5691. } else {
  5692. nextTick(instance, doSet);
  5693. }
  5694. }
  5695. function toSkip(value) {
  5696. if (isObject$3(value)) {
  5697. markRaw(value);
  5698. }
  5699. return value;
  5700. }
  5701. function findComponentPublicInstance(mpComponents, id) {
  5702. const mpInstance = mpComponents.find((com) => com && (com.properties || com.props).uI === id);
  5703. if (mpInstance) {
  5704. const vm = mpInstance.$vm;
  5705. if (vm) {
  5706. return getExposeProxy(vm.$) || vm;
  5707. }
  5708. return toSkip(mpInstance);
  5709. }
  5710. return null;
  5711. }
  5712. function setTemplateRef({ r: r2, f: f2 }, refValue, setupState) {
  5713. if (isFunction(r2)) {
  5714. r2(refValue, {});
  5715. } else {
  5716. const _isString = isString(r2);
  5717. const _isRef = isRef(r2);
  5718. if (_isString || _isRef) {
  5719. if (f2) {
  5720. if (!_isRef) {
  5721. return;
  5722. }
  5723. if (!isArray$1(r2.value)) {
  5724. r2.value = [];
  5725. }
  5726. const existing = r2.value;
  5727. if (existing.indexOf(refValue) === -1) {
  5728. existing.push(refValue);
  5729. if (!refValue) {
  5730. return;
  5731. }
  5732. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  5733. }
  5734. } else if (_isString) {
  5735. if (hasOwn$1(setupState, r2)) {
  5736. setupState[r2] = refValue;
  5737. }
  5738. } else if (isRef(r2)) {
  5739. r2.value = refValue;
  5740. } else {
  5741. warnRef(r2);
  5742. }
  5743. } else {
  5744. warnRef(r2);
  5745. }
  5746. }
  5747. }
  5748. function warnRef(ref2) {
  5749. warn("Invalid template ref type:", ref2, `(${typeof ref2})`);
  5750. }
  5751. var MPType;
  5752. (function(MPType2) {
  5753. MPType2["APP"] = "app";
  5754. MPType2["PAGE"] = "page";
  5755. MPType2["COMPONENT"] = "component";
  5756. })(MPType || (MPType = {}));
  5757. const queuePostRenderEffect = queuePostFlushCb;
  5758. function mountComponent(initialVNode, options) {
  5759. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  5760. {
  5761. instance.ctx.$onApplyOptions = onApplyOptions;
  5762. instance.ctx.$children = [];
  5763. }
  5764. if (options.mpType === "app") {
  5765. instance.render = NOOP;
  5766. }
  5767. if (options.onBeforeSetup) {
  5768. options.onBeforeSetup(instance, options);
  5769. }
  5770. {
  5771. pushWarningContext(initialVNode);
  5772. startMeasure(instance, `mount`);
  5773. }
  5774. {
  5775. startMeasure(instance, `init`);
  5776. }
  5777. setupComponent(instance);
  5778. {
  5779. endMeasure(instance, `init`);
  5780. }
  5781. {
  5782. if (options.parentComponent && instance.proxy) {
  5783. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  5784. }
  5785. }
  5786. setupRenderEffect(instance);
  5787. {
  5788. popWarningContext();
  5789. endMeasure(instance, `mount`);
  5790. }
  5791. return instance.proxy;
  5792. }
  5793. const getFunctionalFallthrough = (attrs) => {
  5794. let res;
  5795. for (const key in attrs) {
  5796. if (key === "class" || key === "style" || isOn(key)) {
  5797. (res || (res = {}))[key] = attrs[key];
  5798. }
  5799. }
  5800. return res;
  5801. };
  5802. function renderComponentRoot(instance) {
  5803. const { type: Component2, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit: emit2, render, renderCache, data, setupState, ctx, uid: uid2, appContext: { app: { config: { globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 } } } }, inheritAttrs } = instance;
  5804. instance.$templateRefs = [];
  5805. instance.$ei = 0;
  5806. pruneComponentPropsCache2(uid2);
  5807. instance.__counter = instance.__counter === 0 ? 1 : 0;
  5808. let result2;
  5809. const prev = setCurrentRenderingInstance(instance);
  5810. try {
  5811. if (vnode.shapeFlag & 4) {
  5812. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  5813. const proxyToUse = withProxy || proxy;
  5814. result2 = render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx);
  5815. } else {
  5816. fallthroughAttrs(inheritAttrs, props, propsOptions, Component2.props ? attrs : getFunctionalFallthrough(attrs));
  5817. const render2 = Component2;
  5818. result2 = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
  5819. props,
  5820. null
  5821. /* we know it doesn't need it */
  5822. );
  5823. }
  5824. } catch (err) {
  5825. handleError(
  5826. err,
  5827. instance,
  5828. 1
  5829. /* ErrorCodes.RENDER_FUNCTION */
  5830. );
  5831. result2 = false;
  5832. }
  5833. setRef$1(instance);
  5834. setCurrentRenderingInstance(prev);
  5835. return result2;
  5836. }
  5837. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  5838. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  5839. const keys = Object.keys(fallthroughAttrs2).filter((key) => key !== "class" && key !== "style");
  5840. if (!keys.length) {
  5841. return;
  5842. }
  5843. if (propsOptions && keys.some(isModelListener)) {
  5844. keys.forEach((key) => {
  5845. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  5846. props[key] = fallthroughAttrs2[key];
  5847. }
  5848. });
  5849. } else {
  5850. keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
  5851. }
  5852. }
  5853. }
  5854. const updateComponentPreRender = (instance) => {
  5855. pauseTracking();
  5856. flushPreFlushCbs();
  5857. resetTracking();
  5858. };
  5859. function componentUpdateScopedSlotsFn() {
  5860. const scopedSlotsData = this.$scopedSlotsData;
  5861. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  5862. return;
  5863. }
  5864. const mpInstance = this.ctx.$scope;
  5865. const oldData = mpInstance.data;
  5866. const diffData = /* @__PURE__ */ Object.create(null);
  5867. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  5868. const oldScopedSlotData = getValueByDataPath(oldData, path);
  5869. const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  5870. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  5871. diffData[diffPath] = data;
  5872. } else {
  5873. const diffScopedSlotData = diff(data, oldScopedSlotData[index2]);
  5874. Object.keys(diffScopedSlotData).forEach((name) => {
  5875. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  5876. });
  5877. }
  5878. });
  5879. scopedSlotsData.length = 0;
  5880. if (Object.keys(diffData).length) {
  5881. mpInstance.setData(diffData);
  5882. }
  5883. }
  5884. function toggleRecurse({ effect, update }, allowed) {
  5885. effect.allowRecurse = update.allowRecurse = allowed;
  5886. }
  5887. function setupRenderEffect(instance) {
  5888. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(instance);
  5889. instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  5890. const componentUpdateFn = () => {
  5891. if (!instance.isMounted) {
  5892. onBeforeUnmount(() => {
  5893. setRef$1(instance, true);
  5894. }, instance);
  5895. {
  5896. startMeasure(instance, `patch`);
  5897. }
  5898. patch(instance, renderComponentRoot(instance));
  5899. {
  5900. endMeasure(instance, `patch`);
  5901. }
  5902. {
  5903. devtoolsComponentAdded(instance);
  5904. }
  5905. } else {
  5906. const { next, bu, u: u2 } = instance;
  5907. {
  5908. pushWarningContext(next || instance.vnode);
  5909. }
  5910. toggleRecurse(instance, false);
  5911. updateComponentPreRender();
  5912. if (bu) {
  5913. invokeArrayFns$1(bu);
  5914. }
  5915. toggleRecurse(instance, true);
  5916. {
  5917. startMeasure(instance, `patch`);
  5918. }
  5919. patch(instance, renderComponentRoot(instance));
  5920. {
  5921. endMeasure(instance, `patch`);
  5922. }
  5923. if (u2) {
  5924. queuePostRenderEffect(u2);
  5925. }
  5926. {
  5927. devtoolsComponentUpdated(instance);
  5928. }
  5929. {
  5930. popWarningContext();
  5931. }
  5932. }
  5933. };
  5934. const effect = instance.effect = new ReactiveEffect(
  5935. componentUpdateFn,
  5936. () => queueJob(instance.update),
  5937. instance.scope
  5938. // track it in component's effect scope
  5939. );
  5940. const update = instance.update = effect.run.bind(effect);
  5941. update.id = instance.uid;
  5942. toggleRecurse(instance, true);
  5943. {
  5944. effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  5945. effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  5946. update.ownerInstance = instance;
  5947. }
  5948. update();
  5949. }
  5950. function unmountComponent(instance) {
  5951. const { bum, scope, update, um } = instance;
  5952. if (bum) {
  5953. invokeArrayFns$1(bum);
  5954. }
  5955. scope.stop();
  5956. if (update) {
  5957. update.active = false;
  5958. }
  5959. if (um) {
  5960. queuePostRenderEffect(um);
  5961. }
  5962. queuePostRenderEffect(() => {
  5963. instance.isUnmounted = true;
  5964. });
  5965. {
  5966. devtoolsComponentRemoved(instance);
  5967. }
  5968. }
  5969. const oldCreateApp = createAppAPI();
  5970. function getTarget() {
  5971. if (typeof window !== "undefined") {
  5972. return window;
  5973. }
  5974. if (typeof globalThis !== "undefined") {
  5975. return globalThis;
  5976. }
  5977. if (typeof global !== "undefined") {
  5978. return global;
  5979. }
  5980. if (typeof my !== "undefined") {
  5981. return my;
  5982. }
  5983. }
  5984. function createVueApp(rootComponent, rootProps = null) {
  5985. const target = getTarget();
  5986. target.__VUE__ = true;
  5987. {
  5988. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5989. }
  5990. const app = oldCreateApp(rootComponent, rootProps);
  5991. const appContext = app._context;
  5992. initAppConfig(appContext.config);
  5993. const createVNode = (initialVNode) => {
  5994. initialVNode.appContext = appContext;
  5995. initialVNode.shapeFlag = 6;
  5996. return initialVNode;
  5997. };
  5998. const createComponent2 = function createComponent3(initialVNode, options) {
  5999. return mountComponent(createVNode(initialVNode), options);
  6000. };
  6001. const destroyComponent = function destroyComponent2(component) {
  6002. return component && unmountComponent(component.$);
  6003. };
  6004. app.mount = function mount() {
  6005. rootComponent.render = NOOP;
  6006. const instance = mountComponent(createVNode({ type: rootComponent }), {
  6007. mpType: MPType.APP,
  6008. mpInstance: null,
  6009. parentComponent: null,
  6010. slots: [],
  6011. props: null
  6012. });
  6013. app._instance = instance.$;
  6014. {
  6015. devtoolsInitApp(app, version);
  6016. }
  6017. instance.$app = app;
  6018. instance.$createComponent = createComponent2;
  6019. instance.$destroyComponent = destroyComponent;
  6020. appContext.$appInstance = instance;
  6021. return instance;
  6022. };
  6023. app.unmount = function unmount() {
  6024. warn(`Cannot unmount an app.`);
  6025. };
  6026. return app;
  6027. }
  6028. function useCssVars(getter) {
  6029. const instance = getCurrentInstance();
  6030. if (!instance) {
  6031. warn(`useCssVars is called without current active component instance.`);
  6032. return;
  6033. }
  6034. initCssVarsRender(instance, getter);
  6035. }
  6036. function initCssVarsRender(instance, getter) {
  6037. instance.ctx.__cssVars = () => {
  6038. const vars = getter(instance.proxy);
  6039. const cssVars = {};
  6040. for (const key in vars) {
  6041. cssVars[`--${key}`] = vars[key];
  6042. }
  6043. return cssVars;
  6044. };
  6045. }
  6046. function injectLifecycleHook(name, hook, publicThis, instance) {
  6047. if (isFunction(hook)) {
  6048. injectHook(name, hook.bind(publicThis), instance);
  6049. }
  6050. }
  6051. function initHooks$1(options, instance, publicThis) {
  6052. const mpType = options.mpType || publicThis.$mpType;
  6053. if (!mpType || mpType === "component") {
  6054. return;
  6055. }
  6056. Object.keys(options).forEach((name) => {
  6057. if (isUniLifecycleHook(name, options[name], false)) {
  6058. const hooks = options[name];
  6059. if (isArray$1(hooks)) {
  6060. hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  6061. } else {
  6062. injectLifecycleHook(name, hooks, publicThis, instance);
  6063. }
  6064. }
  6065. });
  6066. }
  6067. function applyOptions$2(options, instance, publicThis) {
  6068. initHooks$1(options, instance, publicThis);
  6069. }
  6070. function set$3(target, key, val) {
  6071. return target[key] = val;
  6072. }
  6073. function $callMethod(method, ...args) {
  6074. const fn = this[method];
  6075. if (fn) {
  6076. return fn(...args);
  6077. }
  6078. console.error(`method ${method} not found`);
  6079. return null;
  6080. }
  6081. function createErrorHandler(app) {
  6082. return function errorHandler(err, instance, _info) {
  6083. if (!instance) {
  6084. throw err;
  6085. }
  6086. const appInstance = app._instance;
  6087. if (!appInstance || !appInstance.proxy) {
  6088. throw err;
  6089. }
  6090. {
  6091. appInstance.proxy.$callHook(ON_ERROR, err);
  6092. }
  6093. };
  6094. }
  6095. function mergeAsArray(to, from) {
  6096. return to ? [...new Set([].concat(to, from))] : from;
  6097. }
  6098. function initOptionMergeStrategies(optionMergeStrategies) {
  6099. UniLifecycleHooks.forEach((name) => {
  6100. optionMergeStrategies[name] = mergeAsArray;
  6101. });
  6102. }
  6103. let realAtob;
  6104. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  6105. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  6106. if (typeof atob !== "function") {
  6107. realAtob = function(str) {
  6108. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  6109. if (!b64re.test(str)) {
  6110. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  6111. }
  6112. str += "==".slice(2 - (str.length & 3));
  6113. var bitmap;
  6114. var result2 = "";
  6115. var r1;
  6116. var r2;
  6117. var i2 = 0;
  6118. for (; i2 < str.length; ) {
  6119. bitmap = b64.indexOf(str.charAt(i2++)) << 18 | b64.indexOf(str.charAt(i2++)) << 12 | (r1 = b64.indexOf(str.charAt(i2++))) << 6 | (r2 = b64.indexOf(str.charAt(i2++)));
  6120. result2 += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  6121. }
  6122. return result2;
  6123. };
  6124. } else {
  6125. realAtob = atob;
  6126. }
  6127. function b64DecodeUnicode(str) {
  6128. return decodeURIComponent(realAtob(str).split("").map(function(c2) {
  6129. return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
  6130. }).join(""));
  6131. }
  6132. function getCurrentUserInfo() {
  6133. const token = index$1.getStorageSync("uni_id_token") || "";
  6134. const tokenArr = token.split(".");
  6135. if (!token || tokenArr.length !== 3) {
  6136. return {
  6137. uid: null,
  6138. role: [],
  6139. permission: [],
  6140. tokenExpired: 0
  6141. };
  6142. }
  6143. let userInfo;
  6144. try {
  6145. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  6146. } catch (error) {
  6147. throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
  6148. }
  6149. userInfo.tokenExpired = userInfo.exp * 1e3;
  6150. delete userInfo.exp;
  6151. delete userInfo.iat;
  6152. return userInfo;
  6153. }
  6154. function uniIdMixin(globalProperties) {
  6155. globalProperties.uniIDHasRole = function(roleId) {
  6156. const { role } = getCurrentUserInfo();
  6157. return role.indexOf(roleId) > -1;
  6158. };
  6159. globalProperties.uniIDHasPermission = function(permissionId) {
  6160. const { permission } = getCurrentUserInfo();
  6161. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  6162. };
  6163. globalProperties.uniIDTokenValid = function() {
  6164. const { tokenExpired } = getCurrentUserInfo();
  6165. return tokenExpired > Date.now();
  6166. };
  6167. }
  6168. function initApp(app) {
  6169. const appConfig = app._context.config;
  6170. appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  6171. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  6172. const globalProperties = appConfig.globalProperties;
  6173. {
  6174. uniIdMixin(globalProperties);
  6175. }
  6176. {
  6177. globalProperties.$set = set$3;
  6178. globalProperties.$applyOptions = applyOptions$2;
  6179. globalProperties.$callMethod = $callMethod;
  6180. }
  6181. {
  6182. index$1.invokeCreateVueAppHook(app);
  6183. }
  6184. }
  6185. const propsCaches = /* @__PURE__ */ Object.create(null);
  6186. function renderProps(props) {
  6187. const { uid: uid2, __counter } = getCurrentInstance();
  6188. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  6189. return uid2 + "," + propsId + "," + __counter;
  6190. }
  6191. function pruneComponentPropsCache(uid2) {
  6192. delete propsCaches[uid2];
  6193. }
  6194. function findComponentPropsData(up) {
  6195. if (!up) {
  6196. return;
  6197. }
  6198. const [uid2, propsId] = up.split(",");
  6199. if (!propsCaches[uid2]) {
  6200. return;
  6201. }
  6202. return propsCaches[uid2][parseInt(propsId)];
  6203. }
  6204. var plugin = {
  6205. install(app) {
  6206. initApp(app);
  6207. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  6208. const oldMount = app.mount;
  6209. app.mount = function mount(rootContainer) {
  6210. const instance = oldMount.call(app, rootContainer);
  6211. const createApp2 = getCreateApp();
  6212. if (createApp2) {
  6213. createApp2(instance);
  6214. } else {
  6215. if (typeof createMiniProgramApp !== "undefined") {
  6216. createMiniProgramApp(instance);
  6217. }
  6218. }
  6219. return instance;
  6220. };
  6221. }
  6222. };
  6223. function getCreateApp() {
  6224. const method = "createApp";
  6225. if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
  6226. return global[method];
  6227. } else if (typeof my !== "undefined") {
  6228. return my[method];
  6229. }
  6230. }
  6231. function vOn(value, key) {
  6232. const instance = getCurrentInstance();
  6233. const ctx = instance.ctx;
  6234. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString(key) || typeof key === "number") ? "_" + key : "";
  6235. const name = "e" + instance.$ei++ + extraKey;
  6236. const mpInstance = ctx.$scope;
  6237. if (!value) {
  6238. delete mpInstance[name];
  6239. return name;
  6240. }
  6241. const existingInvoker = mpInstance[name];
  6242. if (existingInvoker) {
  6243. existingInvoker.value = value;
  6244. } else {
  6245. mpInstance[name] = createInvoker(value, instance);
  6246. }
  6247. return name;
  6248. }
  6249. function createInvoker(initialValue, instance) {
  6250. const invoker = (e2) => {
  6251. patchMPEvent(e2);
  6252. let args = [e2];
  6253. if (e2.detail && e2.detail.__args__) {
  6254. args = e2.detail.__args__;
  6255. }
  6256. const eventValue = invoker.value;
  6257. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  6258. const eventTarget = e2.target;
  6259. const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
  6260. if (bubbles.includes(e2.type) && !eventSync) {
  6261. setTimeout(invoke);
  6262. } else {
  6263. const res = invoke();
  6264. if (e2.type === "input" && (isArray$1(res) || isPromise(res))) {
  6265. return;
  6266. }
  6267. return res;
  6268. }
  6269. };
  6270. invoker.value = initialValue;
  6271. return invoker;
  6272. }
  6273. const bubbles = [
  6274. // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
  6275. // 'touchstart',
  6276. // 'touchmove',
  6277. // 'touchcancel',
  6278. // 'touchend',
  6279. "tap",
  6280. "longpress",
  6281. "longtap",
  6282. "transitionend",
  6283. "animationstart",
  6284. "animationiteration",
  6285. "animationend",
  6286. "touchforcechange"
  6287. ];
  6288. function patchMPEvent(event) {
  6289. if (event.type && event.target) {
  6290. event.preventDefault = NOOP;
  6291. event.stopPropagation = NOOP;
  6292. event.stopImmediatePropagation = NOOP;
  6293. if (!hasOwn$1(event, "detail")) {
  6294. event.detail = {};
  6295. }
  6296. if (hasOwn$1(event, "markerId")) {
  6297. event.detail = typeof event.detail === "object" ? event.detail : {};
  6298. event.detail.markerId = event.markerId;
  6299. }
  6300. if (isPlainObject$2(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
  6301. event.detail.value = event.detail.checked;
  6302. }
  6303. if (isPlainObject$2(event.detail)) {
  6304. event.target = extend({}, event.target, event.detail);
  6305. }
  6306. }
  6307. }
  6308. function patchStopImmediatePropagation(e2, value) {
  6309. if (isArray$1(value)) {
  6310. const originalStop = e2.stopImmediatePropagation;
  6311. e2.stopImmediatePropagation = () => {
  6312. originalStop && originalStop.call(e2);
  6313. e2._stopped = true;
  6314. };
  6315. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  6316. } else {
  6317. return value;
  6318. }
  6319. }
  6320. function vFor(source, renderItem) {
  6321. let ret;
  6322. if (isArray$1(source) || isString(source)) {
  6323. ret = new Array(source.length);
  6324. for (let i2 = 0, l2 = source.length; i2 < l2; i2++) {
  6325. ret[i2] = renderItem(source[i2], i2, i2);
  6326. }
  6327. } else if (typeof source === "number") {
  6328. if (!Number.isInteger(source)) {
  6329. warn(`The v-for range expect an integer value but got ${source}.`);
  6330. return [];
  6331. }
  6332. ret = new Array(source);
  6333. for (let i2 = 0; i2 < source; i2++) {
  6334. ret[i2] = renderItem(i2 + 1, i2, i2);
  6335. }
  6336. } else if (isObject$3(source)) {
  6337. if (source[Symbol.iterator]) {
  6338. ret = Array.from(source, (item, i2) => renderItem(item, i2, i2));
  6339. } else {
  6340. const keys = Object.keys(source);
  6341. ret = new Array(keys.length);
  6342. for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) {
  6343. const key = keys[i2];
  6344. ret[i2] = renderItem(source[key], key, i2);
  6345. }
  6346. }
  6347. } else {
  6348. ret = [];
  6349. }
  6350. return ret;
  6351. }
  6352. function stringifyStyle(value) {
  6353. if (isString(value)) {
  6354. return value;
  6355. }
  6356. return stringify(normalizeStyle(value));
  6357. }
  6358. function stringify(styles) {
  6359. let ret = "";
  6360. if (!styles || isString(styles)) {
  6361. return ret;
  6362. }
  6363. for (const key in styles) {
  6364. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  6365. }
  6366. return ret;
  6367. }
  6368. function setRef(ref2, id, opts = {}) {
  6369. const { $templateRefs } = getCurrentInstance();
  6370. $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
  6371. }
  6372. function withModelModifiers(fn, { number, trim }, isComponent = false) {
  6373. if (isComponent) {
  6374. return (...args) => {
  6375. if (trim) {
  6376. args = args.map((a2) => a2.trim());
  6377. } else if (number) {
  6378. args = args.map(toNumber);
  6379. }
  6380. return fn(...args);
  6381. };
  6382. }
  6383. return (event) => {
  6384. const value = event.detail.value;
  6385. if (trim) {
  6386. event.detail.value = value.trim();
  6387. } else if (number) {
  6388. event.detail.value = toNumber(value);
  6389. }
  6390. return fn(event);
  6391. };
  6392. }
  6393. const o$1 = (value, key) => vOn(value, key);
  6394. const f$1 = (source, renderItem) => vFor(source, renderItem);
  6395. const s$1 = (value) => stringifyStyle(value);
  6396. const e$1 = (target, ...sources) => extend(target, ...sources);
  6397. const n$1 = (value) => normalizeClass(value);
  6398. const t$1 = (val) => toDisplayString(val);
  6399. const p$1 = (props) => renderProps(props);
  6400. const sr = (ref2, id, opts) => setRef(ref2, id, opts);
  6401. const m$1 = (fn, modifiers, isComponent = false) => withModelModifiers(fn, modifiers, isComponent);
  6402. function createApp$1(rootComponent, rootProps = null) {
  6403. rootComponent && (rootComponent.mpType = "app");
  6404. return createVueApp(rootComponent, rootProps).use(plugin);
  6405. }
  6406. const createSSRApp = createApp$1;
  6407. const MP_METHODS = [
  6408. "createSelectorQuery",
  6409. "createIntersectionObserver",
  6410. "selectAllComponents",
  6411. "selectComponent"
  6412. ];
  6413. function createEmitFn(oldEmit, ctx) {
  6414. return function emit2(event, ...args) {
  6415. const scope = ctx.$scope;
  6416. if (scope && event) {
  6417. const detail = { __args__: args };
  6418. {
  6419. scope.triggerEvent(event, detail);
  6420. }
  6421. }
  6422. return oldEmit.apply(this, [event, ...args]);
  6423. };
  6424. }
  6425. function initBaseInstance(instance, options) {
  6426. const ctx = instance.ctx;
  6427. ctx.mpType = options.mpType;
  6428. ctx.$mpType = options.mpType;
  6429. ctx.$mpPlatform = "mp-weixin";
  6430. ctx.$scope = options.mpInstance;
  6431. ctx.$mp = {};
  6432. {
  6433. ctx._self = {};
  6434. }
  6435. instance.slots = {};
  6436. if (isArray$1(options.slots) && options.slots.length) {
  6437. options.slots.forEach((name) => {
  6438. instance.slots[name] = true;
  6439. });
  6440. if (instance.slots[SLOT_DEFAULT_NAME]) {
  6441. instance.slots.default = true;
  6442. }
  6443. }
  6444. ctx.getOpenerEventChannel = function() {
  6445. {
  6446. return options.mpInstance.getOpenerEventChannel();
  6447. }
  6448. };
  6449. ctx.$hasHook = hasHook;
  6450. ctx.$callHook = callHook;
  6451. instance.emit = createEmitFn(instance.emit, ctx);
  6452. }
  6453. function initComponentInstance(instance, options) {
  6454. initBaseInstance(instance, options);
  6455. const ctx = instance.ctx;
  6456. MP_METHODS.forEach((method) => {
  6457. ctx[method] = function(...args) {
  6458. const mpInstance = ctx.$scope;
  6459. if (mpInstance && mpInstance[method]) {
  6460. return mpInstance[method].apply(mpInstance, args);
  6461. }
  6462. };
  6463. });
  6464. }
  6465. function initMocks(instance, mpInstance, mocks2) {
  6466. const ctx = instance.ctx;
  6467. mocks2.forEach((mock) => {
  6468. if (hasOwn$1(mpInstance, mock)) {
  6469. instance[mock] = ctx[mock] = mpInstance[mock];
  6470. }
  6471. });
  6472. }
  6473. function hasHook(name) {
  6474. const hooks = this.$[name];
  6475. if (hooks && hooks.length) {
  6476. return true;
  6477. }
  6478. return false;
  6479. }
  6480. function callHook(name, args) {
  6481. if (name === "mounted") {
  6482. callHook.call(this, "bm");
  6483. this.$.isMounted = true;
  6484. name = "m";
  6485. }
  6486. const hooks = this.$[name];
  6487. return hooks && invokeArrayFns(hooks, args);
  6488. }
  6489. const PAGE_INIT_HOOKS = [
  6490. ON_LOAD,
  6491. ON_SHOW,
  6492. ON_HIDE,
  6493. ON_UNLOAD,
  6494. ON_RESIZE,
  6495. ON_TAB_ITEM_TAP,
  6496. ON_REACH_BOTTOM,
  6497. ON_PULL_DOWN_REFRESH,
  6498. ON_ADD_TO_FAVORITES
  6499. // 'onReady', // lifetimes.ready
  6500. // 'onPageScroll', // 影响性能,开发者手动注册
  6501. // 'onShareTimeline', // 右上角菜单,开发者手动注册
  6502. // 'onShareAppMessage' // 右上角菜单,开发者手动注册
  6503. ];
  6504. function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  6505. if (vueOptions) {
  6506. Object.keys(vueOptions).forEach((name) => {
  6507. if (isUniLifecycleHook(name, vueOptions[name])) {
  6508. hooks.add(name);
  6509. }
  6510. });
  6511. {
  6512. const { extends: extendsOptions, mixins } = vueOptions;
  6513. if (mixins) {
  6514. mixins.forEach((mixin) => findHooks(mixin, hooks));
  6515. }
  6516. if (extendsOptions) {
  6517. findHooks(extendsOptions, hooks);
  6518. }
  6519. }
  6520. }
  6521. return hooks;
  6522. }
  6523. function initHook(mpOptions, hook, excludes) {
  6524. if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
  6525. mpOptions[hook] = function(args) {
  6526. return this.$vm && this.$vm.$callHook(hook, args);
  6527. };
  6528. }
  6529. }
  6530. const EXCLUDE_HOOKS = [ON_READY];
  6531. function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  6532. hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
  6533. }
  6534. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  6535. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  6536. }
  6537. function initRuntimeHooks(mpOptions, runtimeHooks) {
  6538. if (!runtimeHooks) {
  6539. return;
  6540. }
  6541. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6542. hooks.forEach((hook) => {
  6543. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  6544. initHook(mpOptions, hook, []);
  6545. }
  6546. });
  6547. }
  6548. const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  6549. const runtimeHooks = [];
  6550. const app = isFunction(getApp) && getApp({ allowDefault: true });
  6551. if (app && app.$vm && app.$vm.$) {
  6552. const mixins = app.$vm.$.appContext.mixins;
  6553. if (isArray$1(mixins)) {
  6554. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6555. mixins.forEach((mixin) => {
  6556. hooks.forEach((hook) => {
  6557. if (hasOwn$1(mixin, hook) && !runtimeHooks.includes(hook)) {
  6558. runtimeHooks.push(hook);
  6559. }
  6560. });
  6561. });
  6562. }
  6563. }
  6564. return runtimeHooks;
  6565. });
  6566. function initMixinRuntimeHooks(mpOptions) {
  6567. initHooks(mpOptions, findMixinRuntimeHooks());
  6568. }
  6569. const HOOKS = [
  6570. ON_SHOW,
  6571. ON_HIDE,
  6572. ON_ERROR,
  6573. ON_THEME_CHANGE,
  6574. ON_PAGE_NOT_FOUND,
  6575. ON_UNHANDLE_REJECTION
  6576. ];
  6577. function parseApp(instance, parseAppOptions) {
  6578. const internalInstance = instance.$;
  6579. const appOptions = {
  6580. globalData: instance.$options && instance.$options.globalData || {},
  6581. $vm: instance,
  6582. onLaunch(options) {
  6583. this.$vm = instance;
  6584. const ctx = internalInstance.ctx;
  6585. if (this.$vm && ctx.$scope) {
  6586. return;
  6587. }
  6588. initBaseInstance(internalInstance, {
  6589. mpType: "app",
  6590. mpInstance: this,
  6591. slots: []
  6592. });
  6593. ctx.globalData = this.globalData;
  6594. instance.$callHook(ON_LAUNCH, options);
  6595. }
  6596. };
  6597. const { onError: onError2 } = internalInstance;
  6598. if (onError2) {
  6599. internalInstance.appContext.config.errorHandler = (err) => {
  6600. instance.$callHook(ON_ERROR, err);
  6601. };
  6602. }
  6603. initLocale(instance);
  6604. const vueOptions = instance.$.type;
  6605. initHooks(appOptions, HOOKS);
  6606. initUnknownHooks(appOptions, vueOptions);
  6607. {
  6608. const methods = vueOptions.methods;
  6609. methods && extend(appOptions, methods);
  6610. }
  6611. if (parseAppOptions) {
  6612. parseAppOptions.parse(appOptions);
  6613. }
  6614. return appOptions;
  6615. }
  6616. function initCreateApp(parseAppOptions) {
  6617. return function createApp2(vm) {
  6618. return App(parseApp(vm, parseAppOptions));
  6619. };
  6620. }
  6621. function initCreateSubpackageApp(parseAppOptions) {
  6622. return function createApp2(vm) {
  6623. const appOptions = parseApp(vm, parseAppOptions);
  6624. const app = isFunction(getApp) && getApp({
  6625. allowDefault: true
  6626. });
  6627. if (!app)
  6628. return;
  6629. vm.$.ctx.$scope = app;
  6630. const globalData = app.globalData;
  6631. if (globalData) {
  6632. Object.keys(appOptions.globalData).forEach((name) => {
  6633. if (!hasOwn$1(globalData, name)) {
  6634. globalData[name] = appOptions.globalData[name];
  6635. }
  6636. });
  6637. }
  6638. Object.keys(appOptions).forEach((name) => {
  6639. if (!hasOwn$1(app, name)) {
  6640. app[name] = appOptions[name];
  6641. }
  6642. });
  6643. initAppLifecycle(appOptions, vm);
  6644. };
  6645. }
  6646. function initAppLifecycle(appOptions, vm) {
  6647. if (isFunction(appOptions.onLaunch)) {
  6648. const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  6649. appOptions.onLaunch(args);
  6650. }
  6651. if (isFunction(appOptions.onShow) && wx.onAppShow) {
  6652. wx.onAppShow((args) => {
  6653. vm.$callHook("onShow", args);
  6654. });
  6655. }
  6656. if (isFunction(appOptions.onHide) && wx.onAppHide) {
  6657. wx.onAppHide((args) => {
  6658. vm.$callHook("onHide", args);
  6659. });
  6660. }
  6661. }
  6662. function initLocale(appVm) {
  6663. const locale = ref(normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  6664. Object.defineProperty(appVm, "$locale", {
  6665. get() {
  6666. return locale.value;
  6667. },
  6668. set(v2) {
  6669. locale.value = v2;
  6670. }
  6671. });
  6672. }
  6673. function initVueIds(vueIds, mpInstance) {
  6674. if (!vueIds) {
  6675. return;
  6676. }
  6677. const ids = vueIds.split(",");
  6678. const len = ids.length;
  6679. if (len === 1) {
  6680. mpInstance._$vueId = ids[0];
  6681. } else if (len === 2) {
  6682. mpInstance._$vueId = ids[0];
  6683. mpInstance._$vuePid = ids[1];
  6684. }
  6685. }
  6686. const EXTRAS = ["externalClasses"];
  6687. function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  6688. EXTRAS.forEach((name) => {
  6689. if (hasOwn$1(vueOptions, name)) {
  6690. miniProgramComponentOptions[name] = vueOptions[name];
  6691. }
  6692. });
  6693. }
  6694. const WORKLET_RE = /_(.*)_worklet_factory_/;
  6695. function initWorkletMethods(mpMethods, vueMethods) {
  6696. if (vueMethods) {
  6697. Object.keys(vueMethods).forEach((name) => {
  6698. const matches = name.match(WORKLET_RE);
  6699. if (matches) {
  6700. const workletName = matches[1];
  6701. mpMethods[name] = vueMethods[name];
  6702. mpMethods[workletName] = vueMethods[workletName];
  6703. }
  6704. });
  6705. }
  6706. }
  6707. function initWxsCallMethods(methods, wxsCallMethods) {
  6708. if (!isArray$1(wxsCallMethods)) {
  6709. return;
  6710. }
  6711. wxsCallMethods.forEach((callMethod) => {
  6712. methods[callMethod] = function(args) {
  6713. return this.$vm[callMethod](args);
  6714. };
  6715. });
  6716. }
  6717. function selectAllComponents(mpInstance, selector, $refs) {
  6718. const components = mpInstance.selectAllComponents(selector);
  6719. components.forEach((component) => {
  6720. const ref2 = component.properties.uR;
  6721. $refs[ref2] = component.$vm || component;
  6722. });
  6723. }
  6724. function initRefs(instance, mpInstance) {
  6725. Object.defineProperty(instance, "refs", {
  6726. get() {
  6727. const $refs = {};
  6728. selectAllComponents(mpInstance, ".r", $refs);
  6729. const forComponents = mpInstance.selectAllComponents(".r-i-f");
  6730. forComponents.forEach((component) => {
  6731. const ref2 = component.properties.uR;
  6732. if (!ref2) {
  6733. return;
  6734. }
  6735. if (!$refs[ref2]) {
  6736. $refs[ref2] = [];
  6737. }
  6738. $refs[ref2].push(component.$vm || component);
  6739. });
  6740. return $refs;
  6741. }
  6742. });
  6743. }
  6744. function findVmByVueId(instance, vuePid) {
  6745. const $children = instance.$children;
  6746. for (let i2 = $children.length - 1; i2 >= 0; i2--) {
  6747. const childVm = $children[i2];
  6748. if (childVm.$scope._$vueId === vuePid) {
  6749. return childVm;
  6750. }
  6751. }
  6752. let parentVm;
  6753. for (let i2 = $children.length - 1; i2 >= 0; i2--) {
  6754. parentVm = findVmByVueId($children[i2], vuePid);
  6755. if (parentVm) {
  6756. return parentVm;
  6757. }
  6758. }
  6759. }
  6760. const builtInProps = [
  6761. // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
  6762. // event-opts
  6763. "eO",
  6764. // 组件 ref
  6765. "uR",
  6766. // 组件 ref-in-for
  6767. "uRIF",
  6768. // 组件 id
  6769. "uI",
  6770. // 组件类型 m: 小程序组件
  6771. "uT",
  6772. // 组件 props
  6773. "uP",
  6774. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  6775. "uS"
  6776. ];
  6777. function initDefaultProps(options, isBehavior = false) {
  6778. const properties = {};
  6779. if (!isBehavior) {
  6780. builtInProps.forEach((name) => {
  6781. properties[name] = {
  6782. type: null,
  6783. value: ""
  6784. };
  6785. });
  6786. properties.uS = {
  6787. type: null,
  6788. value: [],
  6789. observer: function(newVal) {
  6790. const $slots = /* @__PURE__ */ Object.create(null);
  6791. newVal && newVal.forEach((slotName) => {
  6792. $slots[slotName] = true;
  6793. });
  6794. this.setData({
  6795. $slots
  6796. });
  6797. }
  6798. };
  6799. }
  6800. if (options.behaviors) {
  6801. if (options.behaviors.includes("wx://form-field")) {
  6802. if (!options.properties || !options.properties.name) {
  6803. properties.name = {
  6804. type: null,
  6805. value: ""
  6806. };
  6807. }
  6808. if (!options.properties || !options.properties.value) {
  6809. properties.value = {
  6810. type: null,
  6811. value: ""
  6812. };
  6813. }
  6814. }
  6815. }
  6816. return properties;
  6817. }
  6818. function initVirtualHostProps(options) {
  6819. const properties = {};
  6820. {
  6821. if (options && options.virtualHost) {
  6822. properties.virtualHostStyle = {
  6823. type: null,
  6824. value: ""
  6825. };
  6826. properties.virtualHostClass = {
  6827. type: null,
  6828. value: ""
  6829. };
  6830. }
  6831. }
  6832. return properties;
  6833. }
  6834. function initProps(mpComponentOptions) {
  6835. if (!mpComponentOptions.properties) {
  6836. mpComponentOptions.properties = {};
  6837. }
  6838. extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
  6839. }
  6840. const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  6841. function parsePropType(type, defaultValue) {
  6842. if (isArray$1(type) && type.length === 1) {
  6843. return type[0];
  6844. }
  6845. return type;
  6846. }
  6847. function normalizePropType(type, defaultValue) {
  6848. const res = parsePropType(type);
  6849. return PROP_TYPES.indexOf(res) !== -1 ? res : null;
  6850. }
  6851. function initPageProps({ properties }, rawProps) {
  6852. if (isArray$1(rawProps)) {
  6853. rawProps.forEach((key) => {
  6854. properties[key] = {
  6855. type: String,
  6856. value: ""
  6857. };
  6858. });
  6859. } else if (isPlainObject$2(rawProps)) {
  6860. Object.keys(rawProps).forEach((key) => {
  6861. const opts = rawProps[key];
  6862. if (isPlainObject$2(opts)) {
  6863. let value = opts.default;
  6864. if (isFunction(value)) {
  6865. value = value();
  6866. }
  6867. const type = opts.type;
  6868. opts.type = normalizePropType(type);
  6869. properties[key] = {
  6870. type: opts.type,
  6871. value
  6872. };
  6873. } else {
  6874. properties[key] = {
  6875. type: normalizePropType(opts)
  6876. };
  6877. }
  6878. });
  6879. }
  6880. }
  6881. function findPropsData(properties, isPage2) {
  6882. return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(properties.uP)) || {};
  6883. }
  6884. function findPagePropsData(properties) {
  6885. const propsData = {};
  6886. if (isPlainObject$2(properties)) {
  6887. Object.keys(properties).forEach((name) => {
  6888. if (builtInProps.indexOf(name) === -1) {
  6889. propsData[name] = properties[name];
  6890. }
  6891. });
  6892. }
  6893. return propsData;
  6894. }
  6895. function initFormField(vm) {
  6896. const vueOptions = vm.$options;
  6897. if (isArray$1(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
  6898. vm.$watch("modelValue", () => {
  6899. vm.$scope && vm.$scope.setData({
  6900. name: vm.name,
  6901. value: vm.modelValue
  6902. });
  6903. }, {
  6904. immediate: true
  6905. });
  6906. }
  6907. }
  6908. function initData(_2) {
  6909. return {};
  6910. }
  6911. function initPropsObserver(componentOptions) {
  6912. const observe = function observe2() {
  6913. const up = this.properties.uP;
  6914. if (!up) {
  6915. return;
  6916. }
  6917. if (this.$vm) {
  6918. updateComponentProps(up, this.$vm.$);
  6919. } else if (this.properties.uT === "m") {
  6920. updateMiniProgramComponentProperties(up, this);
  6921. }
  6922. };
  6923. {
  6924. if (!componentOptions.observers) {
  6925. componentOptions.observers = {};
  6926. }
  6927. componentOptions.observers.uP = observe;
  6928. }
  6929. }
  6930. function updateMiniProgramComponentProperties(up, mpInstance) {
  6931. const prevProps = mpInstance.properties;
  6932. const nextProps = findComponentPropsData(up) || {};
  6933. if (hasPropsChanged(prevProps, nextProps, false)) {
  6934. mpInstance.setData(nextProps);
  6935. }
  6936. }
  6937. function updateComponentProps(up, instance) {
  6938. const prevProps = toRaw(instance.props);
  6939. const nextProps = findComponentPropsData(up) || {};
  6940. if (hasPropsChanged(prevProps, nextProps)) {
  6941. updateProps(instance, nextProps, prevProps, false);
  6942. if (hasQueueJob(instance.update)) {
  6943. invalidateJob(instance.update);
  6944. }
  6945. {
  6946. instance.update();
  6947. }
  6948. }
  6949. }
  6950. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  6951. const nextKeys = Object.keys(nextProps);
  6952. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  6953. return true;
  6954. }
  6955. for (let i2 = 0; i2 < nextKeys.length; i2++) {
  6956. const key = nextKeys[i2];
  6957. if (nextProps[key] !== prevProps[key]) {
  6958. return true;
  6959. }
  6960. }
  6961. return false;
  6962. }
  6963. function initBehaviors(vueOptions) {
  6964. const vueBehaviors = vueOptions.behaviors;
  6965. let vueProps = vueOptions.props;
  6966. if (!vueProps) {
  6967. vueOptions.props = vueProps = [];
  6968. }
  6969. const behaviors = [];
  6970. if (isArray$1(vueBehaviors)) {
  6971. vueBehaviors.forEach((behavior) => {
  6972. behaviors.push(behavior.replace("uni://", "wx://"));
  6973. if (behavior === "uni://form-field") {
  6974. if (isArray$1(vueProps)) {
  6975. vueProps.push("name");
  6976. vueProps.push("modelValue");
  6977. } else {
  6978. vueProps.name = {
  6979. type: String,
  6980. default: ""
  6981. };
  6982. vueProps.modelValue = {
  6983. type: [String, Number, Boolean, Array, Object, Date],
  6984. default: ""
  6985. };
  6986. }
  6987. }
  6988. });
  6989. }
  6990. return behaviors;
  6991. }
  6992. function applyOptions(componentOptions, vueOptions) {
  6993. componentOptions.data = initData();
  6994. componentOptions.behaviors = initBehaviors(vueOptions);
  6995. }
  6996. function parseComponent(vueOptions, { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  6997. vueOptions = vueOptions.default || vueOptions;
  6998. const options = {
  6999. multipleSlots: true,
  7000. // styleIsolation: 'apply-shared',
  7001. addGlobalClass: true,
  7002. pureDataPattern: /^uP$/
  7003. };
  7004. if (isArray$1(vueOptions.mixins)) {
  7005. vueOptions.mixins.forEach((item) => {
  7006. if (isObject$3(item.options)) {
  7007. extend(options, item.options);
  7008. }
  7009. });
  7010. }
  7011. if (vueOptions.options) {
  7012. extend(options, vueOptions.options);
  7013. }
  7014. const mpComponentOptions = {
  7015. options,
  7016. lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
  7017. pageLifetimes: {
  7018. show() {
  7019. this.$vm && this.$vm.$callHook("onPageShow");
  7020. },
  7021. hide() {
  7022. this.$vm && this.$vm.$callHook("onPageHide");
  7023. },
  7024. resize(size2) {
  7025. this.$vm && this.$vm.$callHook("onPageResize", size2);
  7026. }
  7027. },
  7028. methods: {
  7029. __l: handleLink2
  7030. }
  7031. };
  7032. {
  7033. applyOptions(mpComponentOptions, vueOptions);
  7034. }
  7035. initProps(mpComponentOptions);
  7036. initPropsObserver(mpComponentOptions);
  7037. initExtraOptions(mpComponentOptions, vueOptions);
  7038. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  7039. {
  7040. initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  7041. }
  7042. if (parse2) {
  7043. parse2(mpComponentOptions, { handleLink: handleLink2 });
  7044. }
  7045. return mpComponentOptions;
  7046. }
  7047. function initCreateComponent(parseOptions2) {
  7048. return function createComponent2(vueComponentOptions) {
  7049. return Component(parseComponent(vueComponentOptions, parseOptions2));
  7050. };
  7051. }
  7052. let $createComponentFn;
  7053. let $destroyComponentFn;
  7054. function getAppVm() {
  7055. return getApp().$vm;
  7056. }
  7057. function $createComponent(initialVNode, options) {
  7058. if (!$createComponentFn) {
  7059. $createComponentFn = getAppVm().$createComponent;
  7060. }
  7061. const proxy = $createComponentFn(initialVNode, options);
  7062. return getExposeProxy(proxy.$) || proxy;
  7063. }
  7064. function $destroyComponent(instance) {
  7065. if (!$destroyComponentFn) {
  7066. $destroyComponentFn = getAppVm().$destroyComponent;
  7067. }
  7068. return $destroyComponentFn(instance);
  7069. }
  7070. function parsePage(vueOptions, parseOptions2) {
  7071. const { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  7072. const miniProgramPageOptions = parseComponent(vueOptions, {
  7073. mocks: mocks2,
  7074. isPage: isPage2,
  7075. initRelation: initRelation2,
  7076. handleLink: handleLink2,
  7077. initLifetimes: initLifetimes2
  7078. });
  7079. initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  7080. const methods = miniProgramPageOptions.methods;
  7081. methods.onLoad = function(query) {
  7082. this.options = query;
  7083. this.$page = {
  7084. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  7085. };
  7086. return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  7087. };
  7088. initHooks(methods, PAGE_INIT_HOOKS);
  7089. {
  7090. initUnknownHooks(methods, vueOptions);
  7091. }
  7092. initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  7093. initMixinRuntimeHooks(methods);
  7094. parse2 && parse2(miniProgramPageOptions, { handleLink: handleLink2 });
  7095. return miniProgramPageOptions;
  7096. }
  7097. function initCreatePage(parseOptions2) {
  7098. return function createPage2(vuePageOptions) {
  7099. return Component(parsePage(vuePageOptions, parseOptions2));
  7100. };
  7101. }
  7102. function initCreatePluginApp(parseAppOptions) {
  7103. return function createApp2(vm) {
  7104. initAppLifecycle(parseApp(vm, parseAppOptions), vm);
  7105. };
  7106. }
  7107. const MPPage = Page;
  7108. const MPComponent = Component;
  7109. function initTriggerEvent(mpInstance) {
  7110. const oldTriggerEvent = mpInstance.triggerEvent;
  7111. const newTriggerEvent = function(event, ...args) {
  7112. return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
  7113. };
  7114. try {
  7115. mpInstance.triggerEvent = newTriggerEvent;
  7116. } catch (error) {
  7117. mpInstance._triggerEvent = newTriggerEvent;
  7118. }
  7119. }
  7120. function initMiniProgramHook(name, options, isComponent) {
  7121. const oldHook = options[name];
  7122. if (!oldHook) {
  7123. options[name] = function() {
  7124. initTriggerEvent(this);
  7125. };
  7126. } else {
  7127. options[name] = function(...args) {
  7128. initTriggerEvent(this);
  7129. return oldHook.apply(this, args);
  7130. };
  7131. }
  7132. }
  7133. Page = function(options) {
  7134. initMiniProgramHook(ON_LOAD, options);
  7135. return MPPage(options);
  7136. };
  7137. Component = function(options) {
  7138. initMiniProgramHook("created", options);
  7139. const isVueComponent = options.properties && options.properties.uP;
  7140. if (!isVueComponent) {
  7141. initProps(options);
  7142. initPropsObserver(options);
  7143. }
  7144. return MPComponent(options);
  7145. };
  7146. function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  7147. return {
  7148. attached() {
  7149. let properties = this.properties;
  7150. initVueIds(properties.uI, this);
  7151. const relationOptions = {
  7152. vuePid: this._$vuePid
  7153. };
  7154. initRelation2(this, relationOptions);
  7155. const mpInstance = this;
  7156. const isMiniProgramPage = isPage2(mpInstance);
  7157. let propsData = properties;
  7158. this.$vm = $createComponent({
  7159. type: vueOptions,
  7160. props: findPropsData(propsData, isMiniProgramPage)
  7161. }, {
  7162. mpType: isMiniProgramPage ? "page" : "component",
  7163. mpInstance,
  7164. slots: properties.uS || {},
  7165. parentComponent: relationOptions.parent && relationOptions.parent.$,
  7166. onBeforeSetup(instance, options) {
  7167. initRefs(instance, mpInstance);
  7168. initMocks(instance, mpInstance, mocks2);
  7169. initComponentInstance(instance, options);
  7170. }
  7171. });
  7172. if (!isMiniProgramPage) {
  7173. initFormField(this.$vm);
  7174. }
  7175. },
  7176. ready() {
  7177. if (this.$vm) {
  7178. {
  7179. this.$vm.$callHook("mounted");
  7180. this.$vm.$callHook(ON_READY);
  7181. }
  7182. }
  7183. },
  7184. detached() {
  7185. if (this.$vm) {
  7186. pruneComponentPropsCache(this.$vm.$.uid);
  7187. $destroyComponent(this.$vm);
  7188. }
  7189. }
  7190. };
  7191. }
  7192. const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  7193. function isPage(mpInstance) {
  7194. return !!mpInstance.route;
  7195. }
  7196. function initRelation(mpInstance, detail) {
  7197. mpInstance.triggerEvent("__l", detail);
  7198. }
  7199. function handleLink(event) {
  7200. const detail = event.detail || event.value;
  7201. const vuePid = detail.vuePid;
  7202. let parentVm;
  7203. if (vuePid) {
  7204. parentVm = findVmByVueId(this.$vm, vuePid);
  7205. }
  7206. if (!parentVm) {
  7207. parentVm = this.$vm;
  7208. }
  7209. detail.parent = parentVm;
  7210. }
  7211. var parseOptions = /* @__PURE__ */ Object.freeze({
  7212. __proto__: null,
  7213. handleLink,
  7214. initLifetimes,
  7215. initRelation,
  7216. isPage,
  7217. mocks
  7218. });
  7219. const createApp = initCreateApp();
  7220. const createPage = initCreatePage(parseOptions);
  7221. const createComponent = initCreateComponent(parseOptions);
  7222. const createPluginApp = initCreatePluginApp();
  7223. const createSubpackageApp = initCreateSubpackageApp();
  7224. {
  7225. wx.createApp = global.createApp = createApp;
  7226. wx.createPage = createPage;
  7227. wx.createComponent = createComponent;
  7228. wx.createPluginApp = global.createPluginApp = createPluginApp;
  7229. wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
  7230. }
  7231. const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
  7232. !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
  7233. };
  7234. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  7235. const onHide = /* @__PURE__ */ createHook(ON_HIDE);
  7236. const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
  7237. const onError = /* @__PURE__ */ createHook(ON_ERROR);
  7238. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  7239. const onReady = /* @__PURE__ */ createHook(ON_READY);
  7240. const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
  7241. const onPageScroll = /* @__PURE__ */ createHook(ON_PAGE_SCROLL);
  7242. const onReachBottom = /* @__PURE__ */ createHook(ON_REACH_BOTTOM);
  7243. const onPullDownRefresh = /* @__PURE__ */ createHook(ON_PULL_DOWN_REFRESH);
  7244. const onShareAppMessage = /* @__PURE__ */ createHook(ON_SHARE_APP_MESSAGE);
  7245. var toString = Object.prototype.toString;
  7246. function isArray(val) {
  7247. return toString.call(val) === "[object Array]";
  7248. }
  7249. function isObject$1(val) {
  7250. return val !== null && typeof val === "object";
  7251. }
  7252. function isDate(val) {
  7253. return toString.call(val) === "[object Date]";
  7254. }
  7255. function isURLSearchParams(val) {
  7256. return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
  7257. }
  7258. function forEach(obj, fn) {
  7259. if (obj === null || typeof obj === "undefined") {
  7260. return;
  7261. }
  7262. if (typeof obj !== "object") {
  7263. obj = [obj];
  7264. }
  7265. if (isArray(obj)) {
  7266. for (var i2 = 0, l2 = obj.length; i2 < l2; i2++) {
  7267. fn.call(null, obj[i2], i2, obj);
  7268. }
  7269. } else {
  7270. for (var key in obj) {
  7271. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  7272. fn.call(null, obj[key], key, obj);
  7273. }
  7274. }
  7275. }
  7276. }
  7277. function isPlainObject$1(obj) {
  7278. return Object.prototype.toString.call(obj) === "[object Object]";
  7279. }
  7280. function deepMerge() {
  7281. let result2 = {};
  7282. function assignValue(val, key) {
  7283. if (typeof result2[key] === "object" && typeof val === "object") {
  7284. result2[key] = deepMerge(result2[key], val);
  7285. } else if (typeof val === "object") {
  7286. result2[key] = deepMerge({}, val);
  7287. } else {
  7288. result2[key] = val;
  7289. }
  7290. }
  7291. for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
  7292. forEach(arguments[i2], assignValue);
  7293. }
  7294. return result2;
  7295. }
  7296. function isUndefined(val) {
  7297. return typeof val === "undefined";
  7298. }
  7299. function encode(val) {
  7300. return encodeURIComponent(val).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  7301. }
  7302. function buildURL(url, params, paramsSerializer) {
  7303. if (!params) {
  7304. return url;
  7305. }
  7306. var serializedParams;
  7307. if (paramsSerializer) {
  7308. serializedParams = paramsSerializer(params);
  7309. } else if (isURLSearchParams(params)) {
  7310. serializedParams = params.toString();
  7311. } else {
  7312. var parts = [];
  7313. forEach(params, function serialize(val, key) {
  7314. if (val === null || typeof val === "undefined") {
  7315. return;
  7316. }
  7317. if (isArray(val)) {
  7318. key = key + "[]";
  7319. } else {
  7320. val = [val];
  7321. }
  7322. forEach(val, function parseValue(v2) {
  7323. if (isDate(v2)) {
  7324. v2 = v2.toISOString();
  7325. } else if (isObject$1(v2)) {
  7326. v2 = JSON.stringify(v2);
  7327. }
  7328. parts.push(encode(key) + "=" + encode(v2));
  7329. });
  7330. });
  7331. serializedParams = parts.join("&");
  7332. }
  7333. if (serializedParams) {
  7334. var hashmarkIndex = url.indexOf("#");
  7335. if (hashmarkIndex !== -1) {
  7336. url = url.slice(0, hashmarkIndex);
  7337. }
  7338. url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  7339. }
  7340. return url;
  7341. }
  7342. function isAbsoluteURL(url) {
  7343. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  7344. }
  7345. function combineURLs(baseURL, relativeURL) {
  7346. return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  7347. }
  7348. function buildFullPath(baseURL, requestedURL) {
  7349. if (baseURL && !isAbsoluteURL(requestedURL)) {
  7350. return combineURLs(baseURL, requestedURL);
  7351. }
  7352. return requestedURL;
  7353. }
  7354. function settle(resolve2, reject, response) {
  7355. const validateStatus2 = response.config.validateStatus;
  7356. const status = response.statusCode;
  7357. if (status && (!validateStatus2 || validateStatus2(status))) {
  7358. resolve2(response);
  7359. } else {
  7360. reject(response);
  7361. }
  7362. }
  7363. const mergeKeys$1 = (keys, config2) => {
  7364. let config = {};
  7365. keys.forEach((prop) => {
  7366. if (!isUndefined(config2[prop])) {
  7367. config[prop] = config2[prop];
  7368. }
  7369. });
  7370. return config;
  7371. };
  7372. const adapter = (config) => {
  7373. return new Promise((resolve2, reject) => {
  7374. let fullPath = buildURL(buildFullPath(config.baseURL, config.url), config.params, config.paramsSerializer);
  7375. const _config = {
  7376. url: fullPath,
  7377. header: config.header,
  7378. complete: (response) => {
  7379. config.fullPath = fullPath;
  7380. response.config = config;
  7381. response.rawData = response.data;
  7382. try {
  7383. let jsonParseHandle = false;
  7384. const forcedJSONParsingType = typeof config.forcedJSONParsing;
  7385. if (forcedJSONParsingType === "boolean") {
  7386. jsonParseHandle = config.forcedJSONParsing;
  7387. } else if (forcedJSONParsingType === "object") {
  7388. const includesMethod = config.forcedJSONParsing.include || [];
  7389. jsonParseHandle = includesMethod.includes(config.method);
  7390. }
  7391. if (jsonParseHandle && typeof response.data === "string") {
  7392. response.data = JSON.parse(response.data);
  7393. }
  7394. } catch (e2) {
  7395. }
  7396. settle(resolve2, reject, response);
  7397. }
  7398. };
  7399. let requestTask;
  7400. if (config.method === "UPLOAD") {
  7401. delete _config.header["content-type"];
  7402. delete _config.header["Content-Type"];
  7403. let otherConfig = {
  7404. filePath: config.filePath,
  7405. name: config.name
  7406. };
  7407. const optionalKeys = [
  7408. "timeout",
  7409. "formData"
  7410. ];
  7411. requestTask = index$1.uploadFile({ ..._config, ...otherConfig, ...mergeKeys$1(optionalKeys, config) });
  7412. } else if (config.method === "DOWNLOAD") {
  7413. const optionalKeys = [
  7414. "timeout",
  7415. "filePath"
  7416. ];
  7417. requestTask = index$1.downloadFile({ ..._config, ...mergeKeys$1(optionalKeys, config) });
  7418. } else {
  7419. const optionalKeys = [
  7420. "data",
  7421. "method",
  7422. "timeout",
  7423. "dataType",
  7424. "responseType",
  7425. "enableHttp2",
  7426. "enableQuic",
  7427. "enableCache",
  7428. "enableHttpDNS",
  7429. "httpDNSServiceId",
  7430. "enableChunked",
  7431. "forceCellularNetwork"
  7432. ];
  7433. requestTask = index$1.request({ ..._config, ...mergeKeys$1(optionalKeys, config) });
  7434. }
  7435. if (config.getTask) {
  7436. config.getTask(requestTask, config);
  7437. }
  7438. });
  7439. };
  7440. const dispatchRequest = (config) => {
  7441. return adapter(config);
  7442. };
  7443. function InterceptorManager() {
  7444. this.handlers = [];
  7445. }
  7446. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  7447. this.handlers.push({
  7448. fulfilled,
  7449. rejected
  7450. });
  7451. return this.handlers.length - 1;
  7452. };
  7453. InterceptorManager.prototype.eject = function eject(id) {
  7454. if (this.handlers[id]) {
  7455. this.handlers[id] = null;
  7456. }
  7457. };
  7458. InterceptorManager.prototype.forEach = function forEach2(fn) {
  7459. this.handlers.forEach((h2) => {
  7460. if (h2 !== null) {
  7461. fn(h2);
  7462. }
  7463. });
  7464. };
  7465. const mergeKeys = (keys, globalsConfig, config2) => {
  7466. let config = {};
  7467. keys.forEach((prop) => {
  7468. if (!isUndefined(config2[prop])) {
  7469. config[prop] = config2[prop];
  7470. } else if (!isUndefined(globalsConfig[prop])) {
  7471. config[prop] = globalsConfig[prop];
  7472. }
  7473. });
  7474. return config;
  7475. };
  7476. const mergeConfig = (globalsConfig, config2 = {}) => {
  7477. const method = config2.method || globalsConfig.method || "GET";
  7478. let config = {
  7479. baseURL: config2.baseURL || globalsConfig.baseURL || "",
  7480. method,
  7481. url: config2.url || "",
  7482. params: config2.params || {},
  7483. custom: { ...globalsConfig.custom || {}, ...config2.custom || {} },
  7484. header: deepMerge(globalsConfig.header || {}, config2.header || {})
  7485. };
  7486. const defaultToConfig2Keys = ["getTask", "validateStatus", "paramsSerializer", "forcedJSONParsing"];
  7487. config = { ...config, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2) };
  7488. if (method === "DOWNLOAD") {
  7489. const downloadKeys = [
  7490. "timeout",
  7491. "filePath"
  7492. ];
  7493. config = { ...config, ...mergeKeys(downloadKeys, globalsConfig, config2) };
  7494. } else if (method === "UPLOAD") {
  7495. delete config.header["content-type"];
  7496. delete config.header["Content-Type"];
  7497. const uploadKeys = [
  7498. "filePath",
  7499. "name",
  7500. "timeout",
  7501. "formData"
  7502. ];
  7503. uploadKeys.forEach((prop) => {
  7504. if (!isUndefined(config2[prop])) {
  7505. config[prop] = config2[prop];
  7506. }
  7507. });
  7508. if (isUndefined(config.timeout) && !isUndefined(globalsConfig.timeout)) {
  7509. config["timeout"] = globalsConfig["timeout"];
  7510. }
  7511. } else {
  7512. const defaultsKeys = [
  7513. "data",
  7514. "timeout",
  7515. "dataType",
  7516. "responseType",
  7517. "enableHttp2",
  7518. "enableQuic",
  7519. "enableCache",
  7520. "enableHttpDNS",
  7521. "httpDNSServiceId",
  7522. "enableChunked",
  7523. "forceCellularNetwork"
  7524. ];
  7525. config = { ...config, ...mergeKeys(defaultsKeys, globalsConfig, config2) };
  7526. }
  7527. return config;
  7528. };
  7529. const defaults = {
  7530. baseURL: "",
  7531. header: {},
  7532. method: "GET",
  7533. dataType: "json",
  7534. paramsSerializer: null,
  7535. responseType: "text",
  7536. custom: {},
  7537. timeout: 6e4,
  7538. validateStatus: function validateStatus(status) {
  7539. return status >= 200 && status < 300;
  7540. },
  7541. // 是否尝试将响应数据json化
  7542. forcedJSONParsing: true
  7543. };
  7544. var clone = function() {
  7545. function _instanceof(obj, type) {
  7546. return type != null && obj instanceof type;
  7547. }
  7548. var nativeMap;
  7549. try {
  7550. nativeMap = Map;
  7551. } catch (_2) {
  7552. nativeMap = function() {
  7553. };
  7554. }
  7555. var nativeSet;
  7556. try {
  7557. nativeSet = Set;
  7558. } catch (_2) {
  7559. nativeSet = function() {
  7560. };
  7561. }
  7562. var nativePromise;
  7563. try {
  7564. nativePromise = Promise;
  7565. } catch (_2) {
  7566. nativePromise = function() {
  7567. };
  7568. }
  7569. function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
  7570. if (typeof circular === "object") {
  7571. depth = circular.depth;
  7572. prototype = circular.prototype;
  7573. includeNonEnumerable = circular.includeNonEnumerable;
  7574. circular = circular.circular;
  7575. }
  7576. var allParents = [];
  7577. var allChildren = [];
  7578. var useBuffer = typeof Buffer != "undefined";
  7579. if (typeof circular == "undefined")
  7580. circular = true;
  7581. if (typeof depth == "undefined")
  7582. depth = Infinity;
  7583. function _clone(parent2, depth2) {
  7584. if (parent2 === null)
  7585. return null;
  7586. if (depth2 === 0)
  7587. return parent2;
  7588. var child;
  7589. var proto;
  7590. if (typeof parent2 != "object") {
  7591. return parent2;
  7592. }
  7593. if (_instanceof(parent2, nativeMap)) {
  7594. child = new nativeMap();
  7595. } else if (_instanceof(parent2, nativeSet)) {
  7596. child = new nativeSet();
  7597. } else if (_instanceof(parent2, nativePromise)) {
  7598. child = new nativePromise(function(resolve2, reject) {
  7599. parent2.then(function(value) {
  7600. resolve2(_clone(value, depth2 - 1));
  7601. }, function(err) {
  7602. reject(_clone(err, depth2 - 1));
  7603. });
  7604. });
  7605. } else if (clone2.__isArray(parent2)) {
  7606. child = [];
  7607. } else if (clone2.__isRegExp(parent2)) {
  7608. child = new RegExp(parent2.source, __getRegExpFlags(parent2));
  7609. if (parent2.lastIndex)
  7610. child.lastIndex = parent2.lastIndex;
  7611. } else if (clone2.__isDate(parent2)) {
  7612. child = new Date(parent2.getTime());
  7613. } else if (useBuffer && Buffer.isBuffer(parent2)) {
  7614. if (Buffer.from) {
  7615. child = Buffer.from(parent2);
  7616. } else {
  7617. child = new Buffer(parent2.length);
  7618. parent2.copy(child);
  7619. }
  7620. return child;
  7621. } else if (_instanceof(parent2, Error)) {
  7622. child = Object.create(parent2);
  7623. } else {
  7624. if (typeof prototype == "undefined") {
  7625. proto = Object.getPrototypeOf(parent2);
  7626. child = Object.create(proto);
  7627. } else {
  7628. child = Object.create(prototype);
  7629. proto = prototype;
  7630. }
  7631. }
  7632. if (circular) {
  7633. var index2 = allParents.indexOf(parent2);
  7634. if (index2 != -1) {
  7635. return allChildren[index2];
  7636. }
  7637. allParents.push(parent2);
  7638. allChildren.push(child);
  7639. }
  7640. if (_instanceof(parent2, nativeMap)) {
  7641. parent2.forEach(function(value, key) {
  7642. var keyChild = _clone(key, depth2 - 1);
  7643. var valueChild = _clone(value, depth2 - 1);
  7644. child.set(keyChild, valueChild);
  7645. });
  7646. }
  7647. if (_instanceof(parent2, nativeSet)) {
  7648. parent2.forEach(function(value) {
  7649. var entryChild = _clone(value, depth2 - 1);
  7650. child.add(entryChild);
  7651. });
  7652. }
  7653. for (var i2 in parent2) {
  7654. var attrs = Object.getOwnPropertyDescriptor(parent2, i2);
  7655. if (attrs) {
  7656. child[i2] = _clone(parent2[i2], depth2 - 1);
  7657. }
  7658. try {
  7659. var objProperty = Object.getOwnPropertyDescriptor(parent2, i2);
  7660. if (objProperty.set === "undefined") {
  7661. continue;
  7662. }
  7663. child[i2] = _clone(parent2[i2], depth2 - 1);
  7664. } catch (e2) {
  7665. if (e2 instanceof TypeError) {
  7666. continue;
  7667. } else if (e2 instanceof ReferenceError) {
  7668. continue;
  7669. }
  7670. }
  7671. }
  7672. if (Object.getOwnPropertySymbols) {
  7673. var symbols = Object.getOwnPropertySymbols(parent2);
  7674. for (var i2 = 0; i2 < symbols.length; i2++) {
  7675. var symbol = symbols[i2];
  7676. var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
  7677. if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
  7678. continue;
  7679. }
  7680. child[symbol] = _clone(parent2[symbol], depth2 - 1);
  7681. Object.defineProperty(child, symbol, descriptor);
  7682. }
  7683. }
  7684. if (includeNonEnumerable) {
  7685. var allPropertyNames = Object.getOwnPropertyNames(parent2);
  7686. for (var i2 = 0; i2 < allPropertyNames.length; i2++) {
  7687. var propertyName = allPropertyNames[i2];
  7688. var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
  7689. if (descriptor && descriptor.enumerable) {
  7690. continue;
  7691. }
  7692. child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
  7693. Object.defineProperty(child, propertyName, descriptor);
  7694. }
  7695. }
  7696. return child;
  7697. }
  7698. return _clone(parent, depth);
  7699. }
  7700. clone2.clonePrototype = function clonePrototype(parent) {
  7701. if (parent === null)
  7702. return null;
  7703. var c2 = function() {
  7704. };
  7705. c2.prototype = parent;
  7706. return new c2();
  7707. };
  7708. function __objToStr(o2) {
  7709. return Object.prototype.toString.call(o2);
  7710. }
  7711. clone2.__objToStr = __objToStr;
  7712. function __isDate(o2) {
  7713. return typeof o2 === "object" && __objToStr(o2) === "[object Date]";
  7714. }
  7715. clone2.__isDate = __isDate;
  7716. function __isArray(o2) {
  7717. return typeof o2 === "object" && __objToStr(o2) === "[object Array]";
  7718. }
  7719. clone2.__isArray = __isArray;
  7720. function __isRegExp(o2) {
  7721. return typeof o2 === "object" && __objToStr(o2) === "[object RegExp]";
  7722. }
  7723. clone2.__isRegExp = __isRegExp;
  7724. function __getRegExpFlags(re2) {
  7725. var flags = "";
  7726. if (re2.global)
  7727. flags += "g";
  7728. if (re2.ignoreCase)
  7729. flags += "i";
  7730. if (re2.multiline)
  7731. flags += "m";
  7732. return flags;
  7733. }
  7734. clone2.__getRegExpFlags = __getRegExpFlags;
  7735. return clone2;
  7736. }();
  7737. class Request {
  7738. /**
  7739. * @param {Object} arg - 全局配置
  7740. * @param {String} arg.baseURL - 全局根路径
  7741. * @param {Object} arg.header - 全局header
  7742. * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
  7743. * @param {String} arg.dataType = [json] - 全局默认的dataType
  7744. * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持
  7745. * @param {Object} arg.custom - 全局默认的自定义参数
  7746. * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序
  7747. * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
  7748. * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
  7749. * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
  7750. * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
  7751. */
  7752. constructor(arg = {}) {
  7753. if (!isPlainObject$1(arg)) {
  7754. arg = {};
  7755. console.warn("设置全局参数必须接收一个Object");
  7756. }
  7757. this.config = clone({ ...defaults, ...arg });
  7758. this.interceptors = {
  7759. request: new InterceptorManager(),
  7760. response: new InterceptorManager()
  7761. };
  7762. }
  7763. /**
  7764. * @Function
  7765. * @param {Request~setConfigCallback} f - 设置全局默认配置
  7766. */
  7767. setConfig(f2) {
  7768. this.config = f2(this.config);
  7769. }
  7770. middleware(config) {
  7771. config = mergeConfig(this.config, config);
  7772. let chain = [dispatchRequest, void 0];
  7773. let promise = Promise.resolve(config);
  7774. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  7775. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  7776. });
  7777. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  7778. chain.push(interceptor.fulfilled, interceptor.rejected);
  7779. });
  7780. while (chain.length) {
  7781. promise = promise.then(chain.shift(), chain.shift());
  7782. }
  7783. return promise;
  7784. }
  7785. /**
  7786. * @Function
  7787. * @param {Object} config - 请求配置项
  7788. * @prop {String} options.url - 请求路径
  7789. * @prop {Object} options.data - 请求参数
  7790. * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
  7791. * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
  7792. * @prop {Object} [options.header = config.header] - 请求header
  7793. * @prop {Object} [options.method = config.method] - 请求方法
  7794. * @returns {Promise<unknown>}
  7795. */
  7796. request(config = {}) {
  7797. return this.middleware(config);
  7798. }
  7799. get(url, options = {}) {
  7800. return this.middleware({
  7801. url,
  7802. method: "GET",
  7803. ...options
  7804. });
  7805. }
  7806. post(url, data, options = {}) {
  7807. return this.middleware({
  7808. url,
  7809. data,
  7810. method: "POST",
  7811. ...options
  7812. });
  7813. }
  7814. put(url, data, options = {}) {
  7815. return this.middleware({
  7816. url,
  7817. data,
  7818. method: "PUT",
  7819. ...options
  7820. });
  7821. }
  7822. delete(url, data, options = {}) {
  7823. return this.middleware({
  7824. url,
  7825. data,
  7826. method: "DELETE",
  7827. ...options
  7828. });
  7829. }
  7830. connect(url, data, options = {}) {
  7831. return this.middleware({
  7832. url,
  7833. data,
  7834. method: "CONNECT",
  7835. ...options
  7836. });
  7837. }
  7838. head(url, data, options = {}) {
  7839. return this.middleware({
  7840. url,
  7841. data,
  7842. method: "HEAD",
  7843. ...options
  7844. });
  7845. }
  7846. options(url, data, options = {}) {
  7847. return this.middleware({
  7848. url,
  7849. data,
  7850. method: "OPTIONS",
  7851. ...options
  7852. });
  7853. }
  7854. trace(url, data, options = {}) {
  7855. return this.middleware({
  7856. url,
  7857. data,
  7858. method: "TRACE",
  7859. ...options
  7860. });
  7861. }
  7862. upload(url, config = {}) {
  7863. config.url = url;
  7864. config.method = "UPLOAD";
  7865. return this.middleware(config);
  7866. }
  7867. download(url, config = {}) {
  7868. config.url = url;
  7869. config.method = "DOWNLOAD";
  7870. return this.middleware(config);
  7871. }
  7872. get version() {
  7873. return "3.1.0";
  7874. }
  7875. }
  7876. var isVue2 = false;
  7877. function set(target, key, val) {
  7878. if (Array.isArray(target)) {
  7879. target.length = Math.max(target.length, key);
  7880. target.splice(key, 1, val);
  7881. return val;
  7882. }
  7883. target[key] = val;
  7884. return val;
  7885. }
  7886. function del(target, key) {
  7887. if (Array.isArray(target)) {
  7888. target.splice(key, 1);
  7889. return;
  7890. }
  7891. delete target[key];
  7892. }
  7893. /*!
  7894. * pinia v2.0.33
  7895. * (c) 2023 Eduardo San Martin Morote
  7896. * @license MIT
  7897. */
  7898. let activePinia;
  7899. const setActivePinia = (pinia) => activePinia = pinia;
  7900. const piniaSymbol = Symbol("pinia");
  7901. function isPlainObject(o2) {
  7902. return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
  7903. }
  7904. var MutationType;
  7905. (function(MutationType2) {
  7906. MutationType2["direct"] = "direct";
  7907. MutationType2["patchObject"] = "patch object";
  7908. MutationType2["patchFunction"] = "patch function";
  7909. })(MutationType || (MutationType = {}));
  7910. const IS_CLIENT = typeof window !== "undefined";
  7911. const USE_DEVTOOLS = IS_CLIENT;
  7912. const componentStateTypes = [];
  7913. const getStoreType = (id) => "🍍 " + id;
  7914. function addStoreToDevtools(app, store) {
  7915. if (!componentStateTypes.includes(getStoreType(store.$id))) {
  7916. componentStateTypes.push(getStoreType(store.$id));
  7917. }
  7918. }
  7919. function patchActionForGrouping(store, actionNames) {
  7920. const actions = actionNames.reduce((storeActions, actionName) => {
  7921. storeActions[actionName] = toRaw(store)[actionName];
  7922. return storeActions;
  7923. }, {});
  7924. for (const actionName in actions) {
  7925. store[actionName] = function() {
  7926. const trackedStore = new Proxy(store, {
  7927. get(...args) {
  7928. return Reflect.get(...args);
  7929. },
  7930. set(...args) {
  7931. return Reflect.set(...args);
  7932. }
  7933. });
  7934. return actions[actionName].apply(trackedStore, arguments);
  7935. };
  7936. }
  7937. }
  7938. function devtoolsPlugin({ app, store, options }) {
  7939. if (store.$id.startsWith("__hot:")) {
  7940. return;
  7941. }
  7942. if (options.state) {
  7943. store._isOptionsAPI = true;
  7944. }
  7945. if (typeof options.state === "function") {
  7946. patchActionForGrouping(
  7947. // @ts-expect-error: can cast the store...
  7948. store,
  7949. Object.keys(options.actions)
  7950. );
  7951. const originalHotUpdate = store._hotUpdate;
  7952. toRaw(store)._hotUpdate = function(newStore) {
  7953. originalHotUpdate.apply(this, arguments);
  7954. patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions));
  7955. };
  7956. }
  7957. addStoreToDevtools(
  7958. app,
  7959. // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
  7960. store
  7961. );
  7962. }
  7963. function createPinia() {
  7964. const scope = effectScope(true);
  7965. const state = scope.run(() => ref({}));
  7966. let _p = [];
  7967. let toBeInstalled = [];
  7968. const pinia = markRaw({
  7969. install(app) {
  7970. setActivePinia(pinia);
  7971. {
  7972. pinia._a = app;
  7973. app.provide(piniaSymbol, pinia);
  7974. app.config.globalProperties.$pinia = pinia;
  7975. toBeInstalled.forEach((plugin2) => _p.push(plugin2));
  7976. toBeInstalled = [];
  7977. }
  7978. },
  7979. use(plugin2) {
  7980. if (!this._a && !isVue2) {
  7981. toBeInstalled.push(plugin2);
  7982. } else {
  7983. _p.push(plugin2);
  7984. }
  7985. return this;
  7986. },
  7987. _p,
  7988. // it's actually undefined here
  7989. // @ts-expect-error
  7990. _a: null,
  7991. _e: scope,
  7992. _s: /* @__PURE__ */ new Map(),
  7993. state
  7994. });
  7995. if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
  7996. pinia.use(devtoolsPlugin);
  7997. }
  7998. return pinia;
  7999. }
  8000. function patchObject(newState, oldState) {
  8001. for (const key in oldState) {
  8002. const subPatch = oldState[key];
  8003. if (!(key in newState)) {
  8004. continue;
  8005. }
  8006. const targetValue = newState[key];
  8007. if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
  8008. newState[key] = patchObject(targetValue, subPatch);
  8009. } else {
  8010. {
  8011. newState[key] = subPatch;
  8012. }
  8013. }
  8014. }
  8015. return newState;
  8016. }
  8017. const noop = () => {
  8018. };
  8019. function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
  8020. subscriptions.push(callback);
  8021. const removeSubscription = () => {
  8022. const idx = subscriptions.indexOf(callback);
  8023. if (idx > -1) {
  8024. subscriptions.splice(idx, 1);
  8025. onCleanup();
  8026. }
  8027. };
  8028. if (!detached && getCurrentScope()) {
  8029. onScopeDispose(removeSubscription);
  8030. }
  8031. return removeSubscription;
  8032. }
  8033. function triggerSubscriptions(subscriptions, ...args) {
  8034. subscriptions.slice().forEach((callback) => {
  8035. callback(...args);
  8036. });
  8037. }
  8038. function mergeReactiveObjects(target, patchToApply) {
  8039. if (target instanceof Map && patchToApply instanceof Map) {
  8040. patchToApply.forEach((value, key) => target.set(key, value));
  8041. }
  8042. if (target instanceof Set && patchToApply instanceof Set) {
  8043. patchToApply.forEach(target.add, target);
  8044. }
  8045. for (const key in patchToApply) {
  8046. if (!patchToApply.hasOwnProperty(key))
  8047. continue;
  8048. const subPatch = patchToApply[key];
  8049. const targetValue = target[key];
  8050. if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
  8051. target[key] = mergeReactiveObjects(targetValue, subPatch);
  8052. } else {
  8053. target[key] = subPatch;
  8054. }
  8055. }
  8056. return target;
  8057. }
  8058. const skipHydrateSymbol = Symbol("pinia:skipHydration");
  8059. function shouldHydrate(obj) {
  8060. return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
  8061. }
  8062. const { assign } = Object;
  8063. function isComputed(o2) {
  8064. return !!(isRef(o2) && o2.effect);
  8065. }
  8066. function createOptionsStore(id, options, pinia, hot) {
  8067. const { state, actions, getters } = options;
  8068. const initialState = pinia.state.value[id];
  8069. let store;
  8070. function setup() {
  8071. if (!initialState && !hot) {
  8072. {
  8073. pinia.state.value[id] = state ? state() : {};
  8074. }
  8075. }
  8076. const localState = hot ? (
  8077. // use ref() to unwrap refs inside state TODO: check if this is still necessary
  8078. toRefs(ref(state ? state() : {}).value)
  8079. ) : toRefs(pinia.state.value[id]);
  8080. return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
  8081. if (name in localState) {
  8082. console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
  8083. }
  8084. computedGetters[name] = markRaw(computed(() => {
  8085. setActivePinia(pinia);
  8086. const store2 = pinia._s.get(id);
  8087. return getters[name].call(store2, store2);
  8088. }));
  8089. return computedGetters;
  8090. }, {}));
  8091. }
  8092. store = createSetupStore(id, setup, options, pinia, hot, true);
  8093. return store;
  8094. }
  8095. function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
  8096. let scope;
  8097. const optionsForPlugin = assign({ actions: {} }, options);
  8098. if (!pinia._e.active) {
  8099. throw new Error("Pinia destroyed");
  8100. }
  8101. const $subscribeOptions = {
  8102. deep: true
  8103. // flush: 'post',
  8104. };
  8105. {
  8106. $subscribeOptions.onTrigger = (event) => {
  8107. if (isListening) {
  8108. debuggerEvents = event;
  8109. } else if (isListening == false && !store._hotUpdating) {
  8110. if (Array.isArray(debuggerEvents)) {
  8111. debuggerEvents.push(event);
  8112. } else {
  8113. console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
  8114. }
  8115. }
  8116. };
  8117. }
  8118. let isListening;
  8119. let isSyncListening;
  8120. let subscriptions = markRaw([]);
  8121. let actionSubscriptions = markRaw([]);
  8122. let debuggerEvents;
  8123. const initialState = pinia.state.value[$id];
  8124. if (!isOptionsStore && !initialState && !hot) {
  8125. {
  8126. pinia.state.value[$id] = {};
  8127. }
  8128. }
  8129. const hotState = ref({});
  8130. let activeListener;
  8131. function $patch(partialStateOrMutator) {
  8132. let subscriptionMutation;
  8133. isListening = isSyncListening = false;
  8134. {
  8135. debuggerEvents = [];
  8136. }
  8137. if (typeof partialStateOrMutator === "function") {
  8138. partialStateOrMutator(pinia.state.value[$id]);
  8139. subscriptionMutation = {
  8140. type: MutationType.patchFunction,
  8141. storeId: $id,
  8142. events: debuggerEvents
  8143. };
  8144. } else {
  8145. mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
  8146. subscriptionMutation = {
  8147. type: MutationType.patchObject,
  8148. payload: partialStateOrMutator,
  8149. storeId: $id,
  8150. events: debuggerEvents
  8151. };
  8152. }
  8153. const myListenerId = activeListener = Symbol();
  8154. nextTick$1().then(() => {
  8155. if (activeListener === myListenerId) {
  8156. isListening = true;
  8157. }
  8158. });
  8159. isSyncListening = true;
  8160. triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
  8161. }
  8162. const $reset = isOptionsStore ? function $reset2() {
  8163. const { state } = options;
  8164. const newState = state ? state() : {};
  8165. this.$patch(($state) => {
  8166. assign($state, newState);
  8167. });
  8168. } : (
  8169. /* istanbul ignore next */
  8170. () => {
  8171. throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
  8172. }
  8173. );
  8174. function $dispose() {
  8175. scope.stop();
  8176. subscriptions = [];
  8177. actionSubscriptions = [];
  8178. pinia._s.delete($id);
  8179. }
  8180. function wrapAction(name, action) {
  8181. return function() {
  8182. setActivePinia(pinia);
  8183. const args = Array.from(arguments);
  8184. const afterCallbackList = [];
  8185. const onErrorCallbackList = [];
  8186. function after(callback) {
  8187. afterCallbackList.push(callback);
  8188. }
  8189. function onError2(callback) {
  8190. onErrorCallbackList.push(callback);
  8191. }
  8192. triggerSubscriptions(actionSubscriptions, {
  8193. args,
  8194. name,
  8195. store,
  8196. after,
  8197. onError: onError2
  8198. });
  8199. let ret;
  8200. try {
  8201. ret = action.apply(this && this.$id === $id ? this : store, args);
  8202. } catch (error) {
  8203. triggerSubscriptions(onErrorCallbackList, error);
  8204. throw error;
  8205. }
  8206. if (ret instanceof Promise) {
  8207. return ret.then((value) => {
  8208. triggerSubscriptions(afterCallbackList, value);
  8209. return value;
  8210. }).catch((error) => {
  8211. triggerSubscriptions(onErrorCallbackList, error);
  8212. return Promise.reject(error);
  8213. });
  8214. }
  8215. triggerSubscriptions(afterCallbackList, ret);
  8216. return ret;
  8217. };
  8218. }
  8219. const _hmrPayload = /* @__PURE__ */ markRaw({
  8220. actions: {},
  8221. getters: {},
  8222. state: [],
  8223. hotState
  8224. });
  8225. const partialStore = {
  8226. _p: pinia,
  8227. // _s: scope,
  8228. $id,
  8229. $onAction: addSubscription.bind(null, actionSubscriptions),
  8230. $patch,
  8231. $reset,
  8232. $subscribe(callback, options2 = {}) {
  8233. const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
  8234. const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
  8235. if (options2.flush === "sync" ? isSyncListening : isListening) {
  8236. callback({
  8237. storeId: $id,
  8238. type: MutationType.direct,
  8239. events: debuggerEvents
  8240. }, state);
  8241. }
  8242. }, assign({}, $subscribeOptions, options2)));
  8243. return removeSubscription;
  8244. },
  8245. $dispose
  8246. };
  8247. const store = reactive(
  8248. assign(
  8249. {
  8250. _hmrPayload,
  8251. _customProperties: markRaw(/* @__PURE__ */ new Set())
  8252. // devtools custom properties
  8253. },
  8254. partialStore
  8255. // must be added later
  8256. // setupStore
  8257. )
  8258. );
  8259. pinia._s.set($id, store);
  8260. const setupStore = pinia._e.run(() => {
  8261. scope = effectScope();
  8262. return scope.run(() => setup());
  8263. });
  8264. for (const key in setupStore) {
  8265. const prop = setupStore[key];
  8266. if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
  8267. if (hot) {
  8268. set(hotState.value, key, toRef(setupStore, key));
  8269. } else if (!isOptionsStore) {
  8270. if (initialState && shouldHydrate(prop)) {
  8271. if (isRef(prop)) {
  8272. prop.value = initialState[key];
  8273. } else {
  8274. mergeReactiveObjects(prop, initialState[key]);
  8275. }
  8276. }
  8277. {
  8278. pinia.state.value[$id][key] = prop;
  8279. }
  8280. }
  8281. {
  8282. _hmrPayload.state.push(key);
  8283. }
  8284. } else if (typeof prop === "function") {
  8285. const actionValue = hot ? prop : wrapAction(key, prop);
  8286. {
  8287. setupStore[key] = actionValue;
  8288. }
  8289. {
  8290. _hmrPayload.actions[key] = prop;
  8291. }
  8292. optionsForPlugin.actions[key] = prop;
  8293. } else {
  8294. if (isComputed(prop)) {
  8295. _hmrPayload.getters[key] = isOptionsStore ? (
  8296. // @ts-expect-error
  8297. options.getters[key]
  8298. ) : prop;
  8299. if (IS_CLIENT) {
  8300. const getters = setupStore._getters || // @ts-expect-error: same
  8301. (setupStore._getters = markRaw([]));
  8302. getters.push(key);
  8303. }
  8304. }
  8305. }
  8306. }
  8307. {
  8308. assign(store, setupStore);
  8309. assign(toRaw(store), setupStore);
  8310. }
  8311. Object.defineProperty(store, "$state", {
  8312. get: () => hot ? hotState.value : pinia.state.value[$id],
  8313. set: (state) => {
  8314. if (hot) {
  8315. throw new Error("cannot set hotState");
  8316. }
  8317. $patch(($state) => {
  8318. assign($state, state);
  8319. });
  8320. }
  8321. });
  8322. {
  8323. store._hotUpdate = markRaw((newStore) => {
  8324. store._hotUpdating = true;
  8325. newStore._hmrPayload.state.forEach((stateKey) => {
  8326. if (stateKey in store.$state) {
  8327. const newStateTarget = newStore.$state[stateKey];
  8328. const oldStateSource = store.$state[stateKey];
  8329. if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
  8330. patchObject(newStateTarget, oldStateSource);
  8331. } else {
  8332. newStore.$state[stateKey] = oldStateSource;
  8333. }
  8334. }
  8335. set(store, stateKey, toRef(newStore.$state, stateKey));
  8336. });
  8337. Object.keys(store.$state).forEach((stateKey) => {
  8338. if (!(stateKey in newStore.$state)) {
  8339. del(store, stateKey);
  8340. }
  8341. });
  8342. isListening = false;
  8343. isSyncListening = false;
  8344. pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState");
  8345. isSyncListening = true;
  8346. nextTick$1().then(() => {
  8347. isListening = true;
  8348. });
  8349. for (const actionName in newStore._hmrPayload.actions) {
  8350. const action = newStore[actionName];
  8351. set(store, actionName, wrapAction(actionName, action));
  8352. }
  8353. for (const getterName in newStore._hmrPayload.getters) {
  8354. const getter = newStore._hmrPayload.getters[getterName];
  8355. const getterValue = isOptionsStore ? (
  8356. // special handling of options api
  8357. computed(() => {
  8358. setActivePinia(pinia);
  8359. return getter.call(store, store);
  8360. })
  8361. ) : getter;
  8362. set(store, getterName, getterValue);
  8363. }
  8364. Object.keys(store._hmrPayload.getters).forEach((key) => {
  8365. if (!(key in newStore._hmrPayload.getters)) {
  8366. del(store, key);
  8367. }
  8368. });
  8369. Object.keys(store._hmrPayload.actions).forEach((key) => {
  8370. if (!(key in newStore._hmrPayload.actions)) {
  8371. del(store, key);
  8372. }
  8373. });
  8374. store._hmrPayload = newStore._hmrPayload;
  8375. store._getters = newStore._getters;
  8376. store._hotUpdating = false;
  8377. });
  8378. }
  8379. if (USE_DEVTOOLS) {
  8380. const nonEnumerable = {
  8381. writable: true,
  8382. configurable: true,
  8383. // avoid warning on devtools trying to display this property
  8384. enumerable: false
  8385. };
  8386. ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
  8387. Object.defineProperty(store, p2, assign({ value: store[p2] }, nonEnumerable));
  8388. });
  8389. }
  8390. pinia._p.forEach((extender) => {
  8391. if (USE_DEVTOOLS) {
  8392. const extensions = scope.run(() => extender({
  8393. store,
  8394. app: pinia._a,
  8395. pinia,
  8396. options: optionsForPlugin
  8397. }));
  8398. Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
  8399. assign(store, extensions);
  8400. } else {
  8401. assign(store, scope.run(() => extender({
  8402. store,
  8403. app: pinia._a,
  8404. pinia,
  8405. options: optionsForPlugin
  8406. })));
  8407. }
  8408. });
  8409. if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
  8410. console.warn(`[🍍]: The "state" must be a plain object. It cannot be
  8411. state: () => new MyClass()
  8412. Found in store "${store.$id}".`);
  8413. }
  8414. if (initialState && isOptionsStore && options.hydrate) {
  8415. options.hydrate(store.$state, initialState);
  8416. }
  8417. isListening = true;
  8418. isSyncListening = true;
  8419. return store;
  8420. }
  8421. function defineStore(idOrOptions, setup, setupOptions) {
  8422. let id;
  8423. let options;
  8424. const isSetupStore = typeof setup === "function";
  8425. if (typeof idOrOptions === "string") {
  8426. id = idOrOptions;
  8427. options = isSetupStore ? setupOptions : setup;
  8428. } else {
  8429. options = idOrOptions;
  8430. id = idOrOptions.id;
  8431. }
  8432. function useStore(pinia, hot) {
  8433. const currentInstance2 = getCurrentInstance();
  8434. pinia = // in test mode, ignore the argument provided as we can always retrieve a
  8435. // pinia instance with getActivePinia()
  8436. pinia || currentInstance2 && inject(piniaSymbol, null);
  8437. if (pinia)
  8438. setActivePinia(pinia);
  8439. if (!activePinia) {
  8440. throw new Error(`[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
  8441. const pinia = createPinia()
  8442. app.use(pinia)
  8443. This will fail in production.`);
  8444. }
  8445. pinia = activePinia;
  8446. if (!pinia._s.has(id)) {
  8447. if (isSetupStore) {
  8448. createSetupStore(id, setup, options, pinia);
  8449. } else {
  8450. createOptionsStore(id, options, pinia);
  8451. }
  8452. {
  8453. useStore._pinia = pinia;
  8454. }
  8455. }
  8456. const store = pinia._s.get(id);
  8457. if (hot) {
  8458. const hotId = "__hot:" + id;
  8459. const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
  8460. hot._hotUpdate(newStore);
  8461. delete pinia.state.value[hotId];
  8462. pinia._s.delete(hotId);
  8463. }
  8464. if (IS_CLIENT && currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement
  8465. !hot) {
  8466. const vm = currentInstance2.proxy;
  8467. const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
  8468. cache[id] = store;
  8469. }
  8470. return store;
  8471. }
  8472. useStore.$id = id;
  8473. return useStore;
  8474. }
  8475. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  8476. function getDefaultExportFromCjs(x) {
  8477. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  8478. }
  8479. var lodash = { exports: {} };
  8480. /**
  8481. * @license
  8482. * Lodash <https://lodash.com/>
  8483. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  8484. * Released under MIT license <https://lodash.com/license>
  8485. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8486. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8487. */
  8488. lodash.exports;
  8489. (function(module2, exports2) {
  8490. (function() {
  8491. var undefined$1;
  8492. var VERSION = "4.17.21";
  8493. var LARGE_ARRAY_SIZE = 200;
  8494. var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
  8495. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  8496. var MAX_MEMOIZE_SIZE = 500;
  8497. var PLACEHOLDER = "__lodash_placeholder__";
  8498. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
  8499. var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
  8500. var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
  8501. var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
  8502. var HOT_COUNT = 800, HOT_SPAN = 16;
  8503. var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
  8504. var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
  8505. var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  8506. var wrapFlags = [
  8507. ["ary", WRAP_ARY_FLAG],
  8508. ["bind", WRAP_BIND_FLAG],
  8509. ["bindKey", WRAP_BIND_KEY_FLAG],
  8510. ["curry", WRAP_CURRY_FLAG],
  8511. ["curryRight", WRAP_CURRY_RIGHT_FLAG],
  8512. ["flip", WRAP_FLIP_FLAG],
  8513. ["partial", WRAP_PARTIAL_FLAG],
  8514. ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
  8515. ["rearg", WRAP_REARG_FLAG]
  8516. ];
  8517. var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
  8518. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  8519. var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  8520. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  8521. var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
  8522. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8523. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
  8524. var reTrimStart = /^\s+/;
  8525. var reWhitespace = /\s/;
  8526. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
  8527. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  8528. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  8529. var reEscapeChar = /\\(\\)?/g;
  8530. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  8531. var reFlags = /\w*$/;
  8532. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  8533. var reIsBinary = /^0b[01]+$/i;
  8534. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8535. var reIsOctal = /^0o[0-7]+$/i;
  8536. var reIsUint = /^(?:0|[1-9]\d*)$/;
  8537. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  8538. var reNoMatch = /($^)/;
  8539. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  8540. var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  8541. var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
  8542. var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
  8543. var reApos = RegExp(rsApos, "g");
  8544. var reComboMark = RegExp(rsCombo, "g");
  8545. var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
  8546. var reUnicodeWord = RegExp([
  8547. rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
  8548. rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
  8549. rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
  8550. rsUpper + "+" + rsOptContrUpper,
  8551. rsOrdUpper,
  8552. rsOrdLower,
  8553. rsDigits,
  8554. rsEmoji
  8555. ].join("|"), "g");
  8556. var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
  8557. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  8558. var contextProps = [
  8559. "Array",
  8560. "Buffer",
  8561. "DataView",
  8562. "Date",
  8563. "Error",
  8564. "Float32Array",
  8565. "Float64Array",
  8566. "Function",
  8567. "Int8Array",
  8568. "Int16Array",
  8569. "Int32Array",
  8570. "Map",
  8571. "Math",
  8572. "Object",
  8573. "Promise",
  8574. "RegExp",
  8575. "Set",
  8576. "String",
  8577. "Symbol",
  8578. "TypeError",
  8579. "Uint8Array",
  8580. "Uint8ClampedArray",
  8581. "Uint16Array",
  8582. "Uint32Array",
  8583. "WeakMap",
  8584. "_",
  8585. "clearTimeout",
  8586. "isFinite",
  8587. "parseInt",
  8588. "setTimeout"
  8589. ];
  8590. var templateCounter = -1;
  8591. var typedArrayTags = {};
  8592. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  8593. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  8594. var cloneableTags = {};
  8595. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  8596. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  8597. var deburredLetters = {
  8598. // Latin-1 Supplement block.
  8599. "À": "A",
  8600. "Á": "A",
  8601. "Â": "A",
  8602. "Ã": "A",
  8603. "Ä": "A",
  8604. "Å": "A",
  8605. "à": "a",
  8606. "á": "a",
  8607. "â": "a",
  8608. "ã": "a",
  8609. "ä": "a",
  8610. "å": "a",
  8611. "Ç": "C",
  8612. "ç": "c",
  8613. "Ð": "D",
  8614. "ð": "d",
  8615. "È": "E",
  8616. "É": "E",
  8617. "Ê": "E",
  8618. "Ë": "E",
  8619. "è": "e",
  8620. "é": "e",
  8621. "ê": "e",
  8622. "ë": "e",
  8623. "Ì": "I",
  8624. "Í": "I",
  8625. "Î": "I",
  8626. "Ï": "I",
  8627. "ì": "i",
  8628. "í": "i",
  8629. "î": "i",
  8630. "ï": "i",
  8631. "Ñ": "N",
  8632. "ñ": "n",
  8633. "Ò": "O",
  8634. "Ó": "O",
  8635. "Ô": "O",
  8636. "Õ": "O",
  8637. "Ö": "O",
  8638. "Ø": "O",
  8639. "ò": "o",
  8640. "ó": "o",
  8641. "ô": "o",
  8642. "õ": "o",
  8643. "ö": "o",
  8644. "ø": "o",
  8645. "Ù": "U",
  8646. "Ú": "U",
  8647. "Û": "U",
  8648. "Ü": "U",
  8649. "ù": "u",
  8650. "ú": "u",
  8651. "û": "u",
  8652. "ü": "u",
  8653. "Ý": "Y",
  8654. "ý": "y",
  8655. "ÿ": "y",
  8656. "Æ": "Ae",
  8657. "æ": "ae",
  8658. "Þ": "Th",
  8659. "þ": "th",
  8660. "ß": "ss",
  8661. // Latin Extended-A block.
  8662. "Ā": "A",
  8663. "Ă": "A",
  8664. "Ą": "A",
  8665. "ā": "a",
  8666. "ă": "a",
  8667. "ą": "a",
  8668. "Ć": "C",
  8669. "Ĉ": "C",
  8670. "Ċ": "C",
  8671. "Č": "C",
  8672. "ć": "c",
  8673. "ĉ": "c",
  8674. "ċ": "c",
  8675. "č": "c",
  8676. "Ď": "D",
  8677. "Đ": "D",
  8678. "ď": "d",
  8679. "đ": "d",
  8680. "Ē": "E",
  8681. "Ĕ": "E",
  8682. "Ė": "E",
  8683. "Ę": "E",
  8684. "Ě": "E",
  8685. "ē": "e",
  8686. "ĕ": "e",
  8687. "ė": "e",
  8688. "ę": "e",
  8689. "ě": "e",
  8690. "Ĝ": "G",
  8691. "Ğ": "G",
  8692. "Ġ": "G",
  8693. "Ģ": "G",
  8694. "ĝ": "g",
  8695. "ğ": "g",
  8696. "ġ": "g",
  8697. "ģ": "g",
  8698. "Ĥ": "H",
  8699. "Ħ": "H",
  8700. "ĥ": "h",
  8701. "ħ": "h",
  8702. "Ĩ": "I",
  8703. "Ī": "I",
  8704. "Ĭ": "I",
  8705. "Į": "I",
  8706. "İ": "I",
  8707. "ĩ": "i",
  8708. "ī": "i",
  8709. "ĭ": "i",
  8710. "į": "i",
  8711. "ı": "i",
  8712. "Ĵ": "J",
  8713. "ĵ": "j",
  8714. "Ķ": "K",
  8715. "ķ": "k",
  8716. "ĸ": "k",
  8717. "Ĺ": "L",
  8718. "Ļ": "L",
  8719. "Ľ": "L",
  8720. "Ŀ": "L",
  8721. "Ł": "L",
  8722. "ĺ": "l",
  8723. "ļ": "l",
  8724. "ľ": "l",
  8725. "ŀ": "l",
  8726. "ł": "l",
  8727. "Ń": "N",
  8728. "Ņ": "N",
  8729. "Ň": "N",
  8730. "Ŋ": "N",
  8731. "ń": "n",
  8732. "ņ": "n",
  8733. "ň": "n",
  8734. "ŋ": "n",
  8735. "Ō": "O",
  8736. "Ŏ": "O",
  8737. "Ő": "O",
  8738. "ō": "o",
  8739. "ŏ": "o",
  8740. "ő": "o",
  8741. "Ŕ": "R",
  8742. "Ŗ": "R",
  8743. "Ř": "R",
  8744. "ŕ": "r",
  8745. "ŗ": "r",
  8746. "ř": "r",
  8747. "Ś": "S",
  8748. "Ŝ": "S",
  8749. "Ş": "S",
  8750. "Š": "S",
  8751. "ś": "s",
  8752. "ŝ": "s",
  8753. "ş": "s",
  8754. "š": "s",
  8755. "Ţ": "T",
  8756. "Ť": "T",
  8757. "Ŧ": "T",
  8758. "ţ": "t",
  8759. "ť": "t",
  8760. "ŧ": "t",
  8761. "Ũ": "U",
  8762. "Ū": "U",
  8763. "Ŭ": "U",
  8764. "Ů": "U",
  8765. "Ű": "U",
  8766. "Ų": "U",
  8767. "ũ": "u",
  8768. "ū": "u",
  8769. "ŭ": "u",
  8770. "ů": "u",
  8771. "ű": "u",
  8772. "ų": "u",
  8773. "Ŵ": "W",
  8774. "ŵ": "w",
  8775. "Ŷ": "Y",
  8776. "ŷ": "y",
  8777. "Ÿ": "Y",
  8778. "Ź": "Z",
  8779. "Ż": "Z",
  8780. "Ž": "Z",
  8781. "ź": "z",
  8782. "ż": "z",
  8783. "ž": "z",
  8784. "IJ": "IJ",
  8785. "ij": "ij",
  8786. "Œ": "Oe",
  8787. "œ": "oe",
  8788. "ʼn": "'n",
  8789. "ſ": "s"
  8790. };
  8791. var htmlEscapes = {
  8792. "&": "&amp;",
  8793. "<": "&lt;",
  8794. ">": "&gt;",
  8795. '"': "&quot;",
  8796. "'": "&#39;"
  8797. };
  8798. var htmlUnescapes = {
  8799. "&amp;": "&",
  8800. "&lt;": "<",
  8801. "&gt;": ">",
  8802. "&quot;": '"',
  8803. "&#39;": "'"
  8804. };
  8805. var stringEscapes = {
  8806. "\\": "\\",
  8807. "'": "'",
  8808. "\n": "n",
  8809. "\r": "r",
  8810. "\u2028": "u2028",
  8811. "\u2029": "u2029"
  8812. };
  8813. var freeParseFloat = parseFloat, freeParseInt = parseInt;
  8814. var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  8815. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  8816. var root = freeGlobal || freeSelf || Function("return this")();
  8817. var freeExports = exports2 && !exports2.nodeType && exports2;
  8818. var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
  8819. var moduleExports = freeModule && freeModule.exports === freeExports;
  8820. var freeProcess = moduleExports && freeGlobal.process;
  8821. var nodeUtil = function() {
  8822. try {
  8823. var types = freeModule && freeModule.require && freeModule.require("util").types;
  8824. if (types) {
  8825. return types;
  8826. }
  8827. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  8828. } catch (e2) {
  8829. }
  8830. }();
  8831. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  8832. function apply(func, thisArg, args) {
  8833. switch (args.length) {
  8834. case 0:
  8835. return func.call(thisArg);
  8836. case 1:
  8837. return func.call(thisArg, args[0]);
  8838. case 2:
  8839. return func.call(thisArg, args[0], args[1]);
  8840. case 3:
  8841. return func.call(thisArg, args[0], args[1], args[2]);
  8842. }
  8843. return func.apply(thisArg, args);
  8844. }
  8845. function arrayAggregator(array, setter, iteratee, accumulator) {
  8846. var index2 = -1, length = array == null ? 0 : array.length;
  8847. while (++index2 < length) {
  8848. var value = array[index2];
  8849. setter(accumulator, value, iteratee(value), array);
  8850. }
  8851. return accumulator;
  8852. }
  8853. function arrayEach(array, iteratee) {
  8854. var index2 = -1, length = array == null ? 0 : array.length;
  8855. while (++index2 < length) {
  8856. if (iteratee(array[index2], index2, array) === false) {
  8857. break;
  8858. }
  8859. }
  8860. return array;
  8861. }
  8862. function arrayEachRight(array, iteratee) {
  8863. var length = array == null ? 0 : array.length;
  8864. while (length--) {
  8865. if (iteratee(array[length], length, array) === false) {
  8866. break;
  8867. }
  8868. }
  8869. return array;
  8870. }
  8871. function arrayEvery(array, predicate) {
  8872. var index2 = -1, length = array == null ? 0 : array.length;
  8873. while (++index2 < length) {
  8874. if (!predicate(array[index2], index2, array)) {
  8875. return false;
  8876. }
  8877. }
  8878. return true;
  8879. }
  8880. function arrayFilter(array, predicate) {
  8881. var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
  8882. while (++index2 < length) {
  8883. var value = array[index2];
  8884. if (predicate(value, index2, array)) {
  8885. result2[resIndex++] = value;
  8886. }
  8887. }
  8888. return result2;
  8889. }
  8890. function arrayIncludes(array, value) {
  8891. var length = array == null ? 0 : array.length;
  8892. return !!length && baseIndexOf(array, value, 0) > -1;
  8893. }
  8894. function arrayIncludesWith(array, value, comparator2) {
  8895. var index2 = -1, length = array == null ? 0 : array.length;
  8896. while (++index2 < length) {
  8897. if (comparator2(value, array[index2])) {
  8898. return true;
  8899. }
  8900. }
  8901. return false;
  8902. }
  8903. function arrayMap(array, iteratee) {
  8904. var index2 = -1, length = array == null ? 0 : array.length, result2 = Array(length);
  8905. while (++index2 < length) {
  8906. result2[index2] = iteratee(array[index2], index2, array);
  8907. }
  8908. return result2;
  8909. }
  8910. function arrayPush(array, values) {
  8911. var index2 = -1, length = values.length, offset = array.length;
  8912. while (++index2 < length) {
  8913. array[offset + index2] = values[index2];
  8914. }
  8915. return array;
  8916. }
  8917. function arrayReduce(array, iteratee, accumulator, initAccum) {
  8918. var index2 = -1, length = array == null ? 0 : array.length;
  8919. if (initAccum && length) {
  8920. accumulator = array[++index2];
  8921. }
  8922. while (++index2 < length) {
  8923. accumulator = iteratee(accumulator, array[index2], index2, array);
  8924. }
  8925. return accumulator;
  8926. }
  8927. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  8928. var length = array == null ? 0 : array.length;
  8929. if (initAccum && length) {
  8930. accumulator = array[--length];
  8931. }
  8932. while (length--) {
  8933. accumulator = iteratee(accumulator, array[length], length, array);
  8934. }
  8935. return accumulator;
  8936. }
  8937. function arraySome(array, predicate) {
  8938. var index2 = -1, length = array == null ? 0 : array.length;
  8939. while (++index2 < length) {
  8940. if (predicate(array[index2], index2, array)) {
  8941. return true;
  8942. }
  8943. }
  8944. return false;
  8945. }
  8946. var asciiSize = baseProperty("length");
  8947. function asciiToArray(string) {
  8948. return string.split("");
  8949. }
  8950. function asciiWords(string) {
  8951. return string.match(reAsciiWord) || [];
  8952. }
  8953. function baseFindKey(collection, predicate, eachFunc) {
  8954. var result2;
  8955. eachFunc(collection, function(value, key, collection2) {
  8956. if (predicate(value, key, collection2)) {
  8957. result2 = key;
  8958. return false;
  8959. }
  8960. });
  8961. return result2;
  8962. }
  8963. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  8964. var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1);
  8965. while (fromRight ? index2-- : ++index2 < length) {
  8966. if (predicate(array[index2], index2, array)) {
  8967. return index2;
  8968. }
  8969. }
  8970. return -1;
  8971. }
  8972. function baseIndexOf(array, value, fromIndex) {
  8973. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  8974. }
  8975. function baseIndexOfWith(array, value, fromIndex, comparator2) {
  8976. var index2 = fromIndex - 1, length = array.length;
  8977. while (++index2 < length) {
  8978. if (comparator2(array[index2], value)) {
  8979. return index2;
  8980. }
  8981. }
  8982. return -1;
  8983. }
  8984. function baseIsNaN(value) {
  8985. return value !== value;
  8986. }
  8987. function baseMean(array, iteratee) {
  8988. var length = array == null ? 0 : array.length;
  8989. return length ? baseSum(array, iteratee) / length : NAN;
  8990. }
  8991. function baseProperty(key) {
  8992. return function(object) {
  8993. return object == null ? undefined$1 : object[key];
  8994. };
  8995. }
  8996. function basePropertyOf(object) {
  8997. return function(key) {
  8998. return object == null ? undefined$1 : object[key];
  8999. };
  9000. }
  9001. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  9002. eachFunc(collection, function(value, index2, collection2) {
  9003. accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2);
  9004. });
  9005. return accumulator;
  9006. }
  9007. function baseSortBy(array, comparer) {
  9008. var length = array.length;
  9009. array.sort(comparer);
  9010. while (length--) {
  9011. array[length] = array[length].value;
  9012. }
  9013. return array;
  9014. }
  9015. function baseSum(array, iteratee) {
  9016. var result2, index2 = -1, length = array.length;
  9017. while (++index2 < length) {
  9018. var current = iteratee(array[index2]);
  9019. if (current !== undefined$1) {
  9020. result2 = result2 === undefined$1 ? current : result2 + current;
  9021. }
  9022. }
  9023. return result2;
  9024. }
  9025. function baseTimes(n2, iteratee) {
  9026. var index2 = -1, result2 = Array(n2);
  9027. while (++index2 < n2) {
  9028. result2[index2] = iteratee(index2);
  9029. }
  9030. return result2;
  9031. }
  9032. function baseToPairs(object, props) {
  9033. return arrayMap(props, function(key) {
  9034. return [key, object[key]];
  9035. });
  9036. }
  9037. function baseTrim(string) {
  9038. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  9039. }
  9040. function baseUnary(func) {
  9041. return function(value) {
  9042. return func(value);
  9043. };
  9044. }
  9045. function baseValues(object, props) {
  9046. return arrayMap(props, function(key) {
  9047. return object[key];
  9048. });
  9049. }
  9050. function cacheHas(cache, key) {
  9051. return cache.has(key);
  9052. }
  9053. function charsStartIndex(strSymbols, chrSymbols) {
  9054. var index2 = -1, length = strSymbols.length;
  9055. while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
  9056. }
  9057. return index2;
  9058. }
  9059. function charsEndIndex(strSymbols, chrSymbols) {
  9060. var index2 = strSymbols.length;
  9061. while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
  9062. }
  9063. return index2;
  9064. }
  9065. function countHolders(array, placeholder) {
  9066. var length = array.length, result2 = 0;
  9067. while (length--) {
  9068. if (array[length] === placeholder) {
  9069. ++result2;
  9070. }
  9071. }
  9072. return result2;
  9073. }
  9074. var deburrLetter = basePropertyOf(deburredLetters);
  9075. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  9076. function escapeStringChar(chr) {
  9077. return "\\" + stringEscapes[chr];
  9078. }
  9079. function getValue(object, key) {
  9080. return object == null ? undefined$1 : object[key];
  9081. }
  9082. function hasUnicode(string) {
  9083. return reHasUnicode.test(string);
  9084. }
  9085. function hasUnicodeWord(string) {
  9086. return reHasUnicodeWord.test(string);
  9087. }
  9088. function iteratorToArray(iterator) {
  9089. var data, result2 = [];
  9090. while (!(data = iterator.next()).done) {
  9091. result2.push(data.value);
  9092. }
  9093. return result2;
  9094. }
  9095. function mapToArray(map) {
  9096. var index2 = -1, result2 = Array(map.size);
  9097. map.forEach(function(value, key) {
  9098. result2[++index2] = [key, value];
  9099. });
  9100. return result2;
  9101. }
  9102. function overArg(func, transform) {
  9103. return function(arg) {
  9104. return func(transform(arg));
  9105. };
  9106. }
  9107. function replaceHolders(array, placeholder) {
  9108. var index2 = -1, length = array.length, resIndex = 0, result2 = [];
  9109. while (++index2 < length) {
  9110. var value = array[index2];
  9111. if (value === placeholder || value === PLACEHOLDER) {
  9112. array[index2] = PLACEHOLDER;
  9113. result2[resIndex++] = index2;
  9114. }
  9115. }
  9116. return result2;
  9117. }
  9118. function setToArray(set2) {
  9119. var index2 = -1, result2 = Array(set2.size);
  9120. set2.forEach(function(value) {
  9121. result2[++index2] = value;
  9122. });
  9123. return result2;
  9124. }
  9125. function setToPairs(set2) {
  9126. var index2 = -1, result2 = Array(set2.size);
  9127. set2.forEach(function(value) {
  9128. result2[++index2] = [value, value];
  9129. });
  9130. return result2;
  9131. }
  9132. function strictIndexOf(array, value, fromIndex) {
  9133. var index2 = fromIndex - 1, length = array.length;
  9134. while (++index2 < length) {
  9135. if (array[index2] === value) {
  9136. return index2;
  9137. }
  9138. }
  9139. return -1;
  9140. }
  9141. function strictLastIndexOf(array, value, fromIndex) {
  9142. var index2 = fromIndex + 1;
  9143. while (index2--) {
  9144. if (array[index2] === value) {
  9145. return index2;
  9146. }
  9147. }
  9148. return index2;
  9149. }
  9150. function stringSize(string) {
  9151. return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
  9152. }
  9153. function stringToArray(string) {
  9154. return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
  9155. }
  9156. function trimmedEndIndex(string) {
  9157. var index2 = string.length;
  9158. while (index2-- && reWhitespace.test(string.charAt(index2))) {
  9159. }
  9160. return index2;
  9161. }
  9162. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  9163. function unicodeSize(string) {
  9164. var result2 = reUnicode.lastIndex = 0;
  9165. while (reUnicode.test(string)) {
  9166. ++result2;
  9167. }
  9168. return result2;
  9169. }
  9170. function unicodeToArray(string) {
  9171. return string.match(reUnicode) || [];
  9172. }
  9173. function unicodeWords(string) {
  9174. return string.match(reUnicodeWord) || [];
  9175. }
  9176. var runInContext = function runInContext2(context) {
  9177. context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps));
  9178. var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
  9179. var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
  9180. var coreJsData = context["__core-js_shared__"];
  9181. var funcToString = funcProto.toString;
  9182. var hasOwnProperty2 = objectProto.hasOwnProperty;
  9183. var idCounter = 0;
  9184. var maskSrcKey = function() {
  9185. var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  9186. return uid2 ? "Symbol(src)_1." + uid2 : "";
  9187. }();
  9188. var nativeObjectToString = objectProto.toString;
  9189. var objectCtorString = funcToString.call(Object2);
  9190. var oldDash = root._;
  9191. var reIsNative = RegExp2(
  9192. "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  9193. );
  9194. var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
  9195. var defineProperty = function() {
  9196. try {
  9197. var func = getNative(Object2, "defineProperty");
  9198. func({}, "", {});
  9199. return func;
  9200. } catch (e2) {
  9201. }
  9202. }();
  9203. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  9204. var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
  9205. var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
  9206. var metaMap = WeakMap2 && new WeakMap2();
  9207. var realNames = {};
  9208. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
  9209. var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
  9210. function lodash2(value) {
  9211. if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) {
  9212. if (value instanceof LodashWrapper) {
  9213. return value;
  9214. }
  9215. if (hasOwnProperty2.call(value, "__wrapped__")) {
  9216. return wrapperClone(value);
  9217. }
  9218. }
  9219. return new LodashWrapper(value);
  9220. }
  9221. var baseCreate = function() {
  9222. function object() {
  9223. }
  9224. return function(proto) {
  9225. if (!isObject2(proto)) {
  9226. return {};
  9227. }
  9228. if (objectCreate) {
  9229. return objectCreate(proto);
  9230. }
  9231. object.prototype = proto;
  9232. var result3 = new object();
  9233. object.prototype = undefined$1;
  9234. return result3;
  9235. };
  9236. }();
  9237. function baseLodash() {
  9238. }
  9239. function LodashWrapper(value, chainAll) {
  9240. this.__wrapped__ = value;
  9241. this.__actions__ = [];
  9242. this.__chain__ = !!chainAll;
  9243. this.__index__ = 0;
  9244. this.__values__ = undefined$1;
  9245. }
  9246. lodash2.templateSettings = {
  9247. /**
  9248. * Used to detect `data` property values to be HTML-escaped.
  9249. *
  9250. * @memberOf _.templateSettings
  9251. * @type {RegExp}
  9252. */
  9253. "escape": reEscape,
  9254. /**
  9255. * Used to detect code to be evaluated.
  9256. *
  9257. * @memberOf _.templateSettings
  9258. * @type {RegExp}
  9259. */
  9260. "evaluate": reEvaluate,
  9261. /**
  9262. * Used to detect `data` property values to inject.
  9263. *
  9264. * @memberOf _.templateSettings
  9265. * @type {RegExp}
  9266. */
  9267. "interpolate": reInterpolate,
  9268. /**
  9269. * Used to reference the data object in the template text.
  9270. *
  9271. * @memberOf _.templateSettings
  9272. * @type {string}
  9273. */
  9274. "variable": "",
  9275. /**
  9276. * Used to import variables into the compiled template.
  9277. *
  9278. * @memberOf _.templateSettings
  9279. * @type {Object}
  9280. */
  9281. "imports": {
  9282. /**
  9283. * A reference to the `lodash` function.
  9284. *
  9285. * @memberOf _.templateSettings.imports
  9286. * @type {Function}
  9287. */
  9288. "_": lodash2
  9289. }
  9290. };
  9291. lodash2.prototype = baseLodash.prototype;
  9292. lodash2.prototype.constructor = lodash2;
  9293. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  9294. LodashWrapper.prototype.constructor = LodashWrapper;
  9295. function LazyWrapper(value) {
  9296. this.__wrapped__ = value;
  9297. this.__actions__ = [];
  9298. this.__dir__ = 1;
  9299. this.__filtered__ = false;
  9300. this.__iteratees__ = [];
  9301. this.__takeCount__ = MAX_ARRAY_LENGTH;
  9302. this.__views__ = [];
  9303. }
  9304. function lazyClone() {
  9305. var result3 = new LazyWrapper(this.__wrapped__);
  9306. result3.__actions__ = copyArray(this.__actions__);
  9307. result3.__dir__ = this.__dir__;
  9308. result3.__filtered__ = this.__filtered__;
  9309. result3.__iteratees__ = copyArray(this.__iteratees__);
  9310. result3.__takeCount__ = this.__takeCount__;
  9311. result3.__views__ = copyArray(this.__views__);
  9312. return result3;
  9313. }
  9314. function lazyReverse() {
  9315. if (this.__filtered__) {
  9316. var result3 = new LazyWrapper(this);
  9317. result3.__dir__ = -1;
  9318. result3.__filtered__ = true;
  9319. } else {
  9320. result3 = this.clone();
  9321. result3.__dir__ *= -1;
  9322. }
  9323. return result3;
  9324. }
  9325. function lazyValue() {
  9326. var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index2 = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
  9327. if (!isArr || !isRight && arrLength == length && takeCount == length) {
  9328. return baseWrapperValue(array, this.__actions__);
  9329. }
  9330. var result3 = [];
  9331. outer:
  9332. while (length-- && resIndex < takeCount) {
  9333. index2 += dir;
  9334. var iterIndex = -1, value = array[index2];
  9335. while (++iterIndex < iterLength) {
  9336. var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed2 = iteratee2(value);
  9337. if (type == LAZY_MAP_FLAG) {
  9338. value = computed2;
  9339. } else if (!computed2) {
  9340. if (type == LAZY_FILTER_FLAG) {
  9341. continue outer;
  9342. } else {
  9343. break outer;
  9344. }
  9345. }
  9346. }
  9347. result3[resIndex++] = value;
  9348. }
  9349. return result3;
  9350. }
  9351. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  9352. LazyWrapper.prototype.constructor = LazyWrapper;
  9353. function Hash(entries) {
  9354. var index2 = -1, length = entries == null ? 0 : entries.length;
  9355. this.clear();
  9356. while (++index2 < length) {
  9357. var entry = entries[index2];
  9358. this.set(entry[0], entry[1]);
  9359. }
  9360. }
  9361. function hashClear() {
  9362. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  9363. this.size = 0;
  9364. }
  9365. function hashDelete(key) {
  9366. var result3 = this.has(key) && delete this.__data__[key];
  9367. this.size -= result3 ? 1 : 0;
  9368. return result3;
  9369. }
  9370. function hashGet(key) {
  9371. var data = this.__data__;
  9372. if (nativeCreate) {
  9373. var result3 = data[key];
  9374. return result3 === HASH_UNDEFINED ? undefined$1 : result3;
  9375. }
  9376. return hasOwnProperty2.call(data, key) ? data[key] : undefined$1;
  9377. }
  9378. function hashHas(key) {
  9379. var data = this.__data__;
  9380. return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty2.call(data, key);
  9381. }
  9382. function hashSet(key, value) {
  9383. var data = this.__data__;
  9384. this.size += this.has(key) ? 0 : 1;
  9385. data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
  9386. return this;
  9387. }
  9388. Hash.prototype.clear = hashClear;
  9389. Hash.prototype["delete"] = hashDelete;
  9390. Hash.prototype.get = hashGet;
  9391. Hash.prototype.has = hashHas;
  9392. Hash.prototype.set = hashSet;
  9393. function ListCache(entries) {
  9394. var index2 = -1, length = entries == null ? 0 : entries.length;
  9395. this.clear();
  9396. while (++index2 < length) {
  9397. var entry = entries[index2];
  9398. this.set(entry[0], entry[1]);
  9399. }
  9400. }
  9401. function listCacheClear() {
  9402. this.__data__ = [];
  9403. this.size = 0;
  9404. }
  9405. function listCacheDelete(key) {
  9406. var data = this.__data__, index2 = assocIndexOf(data, key);
  9407. if (index2 < 0) {
  9408. return false;
  9409. }
  9410. var lastIndex = data.length - 1;
  9411. if (index2 == lastIndex) {
  9412. data.pop();
  9413. } else {
  9414. splice.call(data, index2, 1);
  9415. }
  9416. --this.size;
  9417. return true;
  9418. }
  9419. function listCacheGet(key) {
  9420. var data = this.__data__, index2 = assocIndexOf(data, key);
  9421. return index2 < 0 ? undefined$1 : data[index2][1];
  9422. }
  9423. function listCacheHas(key) {
  9424. return assocIndexOf(this.__data__, key) > -1;
  9425. }
  9426. function listCacheSet(key, value) {
  9427. var data = this.__data__, index2 = assocIndexOf(data, key);
  9428. if (index2 < 0) {
  9429. ++this.size;
  9430. data.push([key, value]);
  9431. } else {
  9432. data[index2][1] = value;
  9433. }
  9434. return this;
  9435. }
  9436. ListCache.prototype.clear = listCacheClear;
  9437. ListCache.prototype["delete"] = listCacheDelete;
  9438. ListCache.prototype.get = listCacheGet;
  9439. ListCache.prototype.has = listCacheHas;
  9440. ListCache.prototype.set = listCacheSet;
  9441. function MapCache(entries) {
  9442. var index2 = -1, length = entries == null ? 0 : entries.length;
  9443. this.clear();
  9444. while (++index2 < length) {
  9445. var entry = entries[index2];
  9446. this.set(entry[0], entry[1]);
  9447. }
  9448. }
  9449. function mapCacheClear() {
  9450. this.size = 0;
  9451. this.__data__ = {
  9452. "hash": new Hash(),
  9453. "map": new (Map2 || ListCache)(),
  9454. "string": new Hash()
  9455. };
  9456. }
  9457. function mapCacheDelete(key) {
  9458. var result3 = getMapData(this, key)["delete"](key);
  9459. this.size -= result3 ? 1 : 0;
  9460. return result3;
  9461. }
  9462. function mapCacheGet(key) {
  9463. return getMapData(this, key).get(key);
  9464. }
  9465. function mapCacheHas(key) {
  9466. return getMapData(this, key).has(key);
  9467. }
  9468. function mapCacheSet(key, value) {
  9469. var data = getMapData(this, key), size3 = data.size;
  9470. data.set(key, value);
  9471. this.size += data.size == size3 ? 0 : 1;
  9472. return this;
  9473. }
  9474. MapCache.prototype.clear = mapCacheClear;
  9475. MapCache.prototype["delete"] = mapCacheDelete;
  9476. MapCache.prototype.get = mapCacheGet;
  9477. MapCache.prototype.has = mapCacheHas;
  9478. MapCache.prototype.set = mapCacheSet;
  9479. function SetCache(values2) {
  9480. var index2 = -1, length = values2 == null ? 0 : values2.length;
  9481. this.__data__ = new MapCache();
  9482. while (++index2 < length) {
  9483. this.add(values2[index2]);
  9484. }
  9485. }
  9486. function setCacheAdd(value) {
  9487. this.__data__.set(value, HASH_UNDEFINED);
  9488. return this;
  9489. }
  9490. function setCacheHas(value) {
  9491. return this.__data__.has(value);
  9492. }
  9493. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  9494. SetCache.prototype.has = setCacheHas;
  9495. function Stack(entries) {
  9496. var data = this.__data__ = new ListCache(entries);
  9497. this.size = data.size;
  9498. }
  9499. function stackClear() {
  9500. this.__data__ = new ListCache();
  9501. this.size = 0;
  9502. }
  9503. function stackDelete(key) {
  9504. var data = this.__data__, result3 = data["delete"](key);
  9505. this.size = data.size;
  9506. return result3;
  9507. }
  9508. function stackGet(key) {
  9509. return this.__data__.get(key);
  9510. }
  9511. function stackHas(key) {
  9512. return this.__data__.has(key);
  9513. }
  9514. function stackSet(key, value) {
  9515. var data = this.__data__;
  9516. if (data instanceof ListCache) {
  9517. var pairs = data.__data__;
  9518. if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  9519. pairs.push([key, value]);
  9520. this.size = ++data.size;
  9521. return this;
  9522. }
  9523. data = this.__data__ = new MapCache(pairs);
  9524. }
  9525. data.set(key, value);
  9526. this.size = data.size;
  9527. return this;
  9528. }
  9529. Stack.prototype.clear = stackClear;
  9530. Stack.prototype["delete"] = stackDelete;
  9531. Stack.prototype.get = stackGet;
  9532. Stack.prototype.has = stackHas;
  9533. Stack.prototype.set = stackSet;
  9534. function arrayLikeKeys(value, inherited) {
  9535. var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result3 = skipIndexes ? baseTimes(value.length, String2) : [], length = result3.length;
  9536. for (var key in value) {
  9537. if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
  9538. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
  9539. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
  9540. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
  9541. isIndex(key, length)))) {
  9542. result3.push(key);
  9543. }
  9544. }
  9545. return result3;
  9546. }
  9547. function arraySample(array) {
  9548. var length = array.length;
  9549. return length ? array[baseRandom(0, length - 1)] : undefined$1;
  9550. }
  9551. function arraySampleSize(array, n2) {
  9552. return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length));
  9553. }
  9554. function arrayShuffle(array) {
  9555. return shuffleSelf(copyArray(array));
  9556. }
  9557. function assignMergeValue(object, key, value) {
  9558. if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) {
  9559. baseAssignValue(object, key, value);
  9560. }
  9561. }
  9562. function assignValue(object, key, value) {
  9563. var objValue = object[key];
  9564. if (!(hasOwnProperty2.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) {
  9565. baseAssignValue(object, key, value);
  9566. }
  9567. }
  9568. function assocIndexOf(array, key) {
  9569. var length = array.length;
  9570. while (length--) {
  9571. if (eq(array[length][0], key)) {
  9572. return length;
  9573. }
  9574. }
  9575. return -1;
  9576. }
  9577. function baseAggregator(collection, setter, iteratee2, accumulator) {
  9578. baseEach(collection, function(value, key, collection2) {
  9579. setter(accumulator, value, iteratee2(value), collection2);
  9580. });
  9581. return accumulator;
  9582. }
  9583. function baseAssign(object, source) {
  9584. return object && copyObject(source, keys(source), object);
  9585. }
  9586. function baseAssignIn(object, source) {
  9587. return object && copyObject(source, keysIn(source), object);
  9588. }
  9589. function baseAssignValue(object, key, value) {
  9590. if (key == "__proto__" && defineProperty) {
  9591. defineProperty(object, key, {
  9592. "configurable": true,
  9593. "enumerable": true,
  9594. "value": value,
  9595. "writable": true
  9596. });
  9597. } else {
  9598. object[key] = value;
  9599. }
  9600. }
  9601. function baseAt(object, paths) {
  9602. var index2 = -1, length = paths.length, result3 = Array2(length), skip = object == null;
  9603. while (++index2 < length) {
  9604. result3[index2] = skip ? undefined$1 : get2(object, paths[index2]);
  9605. }
  9606. return result3;
  9607. }
  9608. function baseClamp(number, lower, upper) {
  9609. if (number === number) {
  9610. if (upper !== undefined$1) {
  9611. number = number <= upper ? number : upper;
  9612. }
  9613. if (lower !== undefined$1) {
  9614. number = number >= lower ? number : lower;
  9615. }
  9616. }
  9617. return number;
  9618. }
  9619. function baseClone(value, bitmask, customizer, key, object, stack2) {
  9620. var result3, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
  9621. if (customizer) {
  9622. result3 = object ? customizer(value, key, object, stack2) : customizer(value);
  9623. }
  9624. if (result3 !== undefined$1) {
  9625. return result3;
  9626. }
  9627. if (!isObject2(value)) {
  9628. return value;
  9629. }
  9630. var isArr = isArray2(value);
  9631. if (isArr) {
  9632. result3 = initCloneArray(value);
  9633. if (!isDeep) {
  9634. return copyArray(value, result3);
  9635. }
  9636. } else {
  9637. var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
  9638. if (isBuffer(value)) {
  9639. return cloneBuffer(value, isDeep);
  9640. }
  9641. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  9642. result3 = isFlat || isFunc ? {} : initCloneObject(value);
  9643. if (!isDeep) {
  9644. return isFlat ? copySymbolsIn(value, baseAssignIn(result3, value)) : copySymbols(value, baseAssign(result3, value));
  9645. }
  9646. } else {
  9647. if (!cloneableTags[tag]) {
  9648. return object ? value : {};
  9649. }
  9650. result3 = initCloneByTag(value, tag, isDeep);
  9651. }
  9652. }
  9653. stack2 || (stack2 = new Stack());
  9654. var stacked = stack2.get(value);
  9655. if (stacked) {
  9656. return stacked;
  9657. }
  9658. stack2.set(value, result3);
  9659. if (isSet2(value)) {
  9660. value.forEach(function(subValue) {
  9661. result3.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2));
  9662. });
  9663. } else if (isMap2(value)) {
  9664. value.forEach(function(subValue, key2) {
  9665. result3.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
  9666. });
  9667. }
  9668. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  9669. var props = isArr ? undefined$1 : keysFunc(value);
  9670. arrayEach(props || value, function(subValue, key2) {
  9671. if (props) {
  9672. key2 = subValue;
  9673. subValue = value[key2];
  9674. }
  9675. assignValue(result3, key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
  9676. });
  9677. return result3;
  9678. }
  9679. function baseConforms(source) {
  9680. var props = keys(source);
  9681. return function(object) {
  9682. return baseConformsTo(object, source, props);
  9683. };
  9684. }
  9685. function baseConformsTo(object, source, props) {
  9686. var length = props.length;
  9687. if (object == null) {
  9688. return !length;
  9689. }
  9690. object = Object2(object);
  9691. while (length--) {
  9692. var key = props[length], predicate = source[key], value = object[key];
  9693. if (value === undefined$1 && !(key in object) || !predicate(value)) {
  9694. return false;
  9695. }
  9696. }
  9697. return true;
  9698. }
  9699. function baseDelay(func, wait, args) {
  9700. if (typeof func != "function") {
  9701. throw new TypeError2(FUNC_ERROR_TEXT);
  9702. }
  9703. return setTimeout2(function() {
  9704. func.apply(undefined$1, args);
  9705. }, wait);
  9706. }
  9707. function baseDifference(array, values2, iteratee2, comparator2) {
  9708. var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result3 = [], valuesLength = values2.length;
  9709. if (!length) {
  9710. return result3;
  9711. }
  9712. if (iteratee2) {
  9713. values2 = arrayMap(values2, baseUnary(iteratee2));
  9714. }
  9715. if (comparator2) {
  9716. includes2 = arrayIncludesWith;
  9717. isCommon = false;
  9718. } else if (values2.length >= LARGE_ARRAY_SIZE) {
  9719. includes2 = cacheHas;
  9720. isCommon = false;
  9721. values2 = new SetCache(values2);
  9722. }
  9723. outer:
  9724. while (++index2 < length) {
  9725. var value = array[index2], computed2 = iteratee2 == null ? value : iteratee2(value);
  9726. value = comparator2 || value !== 0 ? value : 0;
  9727. if (isCommon && computed2 === computed2) {
  9728. var valuesIndex = valuesLength;
  9729. while (valuesIndex--) {
  9730. if (values2[valuesIndex] === computed2) {
  9731. continue outer;
  9732. }
  9733. }
  9734. result3.push(value);
  9735. } else if (!includes2(values2, computed2, comparator2)) {
  9736. result3.push(value);
  9737. }
  9738. }
  9739. return result3;
  9740. }
  9741. var baseEach = createBaseEach(baseForOwn);
  9742. var baseEachRight = createBaseEach(baseForOwnRight, true);
  9743. function baseEvery(collection, predicate) {
  9744. var result3 = true;
  9745. baseEach(collection, function(value, index2, collection2) {
  9746. result3 = !!predicate(value, index2, collection2);
  9747. return result3;
  9748. });
  9749. return result3;
  9750. }
  9751. function baseExtremum(array, iteratee2, comparator2) {
  9752. var index2 = -1, length = array.length;
  9753. while (++index2 < length) {
  9754. var value = array[index2], current = iteratee2(value);
  9755. if (current != null && (computed2 === undefined$1 ? current === current && !isSymbol2(current) : comparator2(current, computed2))) {
  9756. var computed2 = current, result3 = value;
  9757. }
  9758. }
  9759. return result3;
  9760. }
  9761. function baseFill(array, value, start, end) {
  9762. var length = array.length;
  9763. start = toInteger(start);
  9764. if (start < 0) {
  9765. start = -start > length ? 0 : length + start;
  9766. }
  9767. end = end === undefined$1 || end > length ? length : toInteger(end);
  9768. if (end < 0) {
  9769. end += length;
  9770. }
  9771. end = start > end ? 0 : toLength(end);
  9772. while (start < end) {
  9773. array[start++] = value;
  9774. }
  9775. return array;
  9776. }
  9777. function baseFilter(collection, predicate) {
  9778. var result3 = [];
  9779. baseEach(collection, function(value, index2, collection2) {
  9780. if (predicate(value, index2, collection2)) {
  9781. result3.push(value);
  9782. }
  9783. });
  9784. return result3;
  9785. }
  9786. function baseFlatten(array, depth, predicate, isStrict, result3) {
  9787. var index2 = -1, length = array.length;
  9788. predicate || (predicate = isFlattenable);
  9789. result3 || (result3 = []);
  9790. while (++index2 < length) {
  9791. var value = array[index2];
  9792. if (depth > 0 && predicate(value)) {
  9793. if (depth > 1) {
  9794. baseFlatten(value, depth - 1, predicate, isStrict, result3);
  9795. } else {
  9796. arrayPush(result3, value);
  9797. }
  9798. } else if (!isStrict) {
  9799. result3[result3.length] = value;
  9800. }
  9801. }
  9802. return result3;
  9803. }
  9804. var baseFor = createBaseFor();
  9805. var baseForRight = createBaseFor(true);
  9806. function baseForOwn(object, iteratee2) {
  9807. return object && baseFor(object, iteratee2, keys);
  9808. }
  9809. function baseForOwnRight(object, iteratee2) {
  9810. return object && baseForRight(object, iteratee2, keys);
  9811. }
  9812. function baseFunctions(object, props) {
  9813. return arrayFilter(props, function(key) {
  9814. return isFunction2(object[key]);
  9815. });
  9816. }
  9817. function baseGet(object, path) {
  9818. path = castPath(path, object);
  9819. var index2 = 0, length = path.length;
  9820. while (object != null && index2 < length) {
  9821. object = object[toKey(path[index2++])];
  9822. }
  9823. return index2 && index2 == length ? object : undefined$1;
  9824. }
  9825. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  9826. var result3 = keysFunc(object);
  9827. return isArray2(object) ? result3 : arrayPush(result3, symbolsFunc(object));
  9828. }
  9829. function baseGetTag(value) {
  9830. if (value == null) {
  9831. return value === undefined$1 ? undefinedTag : nullTag;
  9832. }
  9833. return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString2(value);
  9834. }
  9835. function baseGt(value, other) {
  9836. return value > other;
  9837. }
  9838. function baseHas(object, key) {
  9839. return object != null && hasOwnProperty2.call(object, key);
  9840. }
  9841. function baseHasIn(object, key) {
  9842. return object != null && key in Object2(object);
  9843. }
  9844. function baseInRange(number, start, end) {
  9845. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  9846. }
  9847. function baseIntersection(arrays, iteratee2, comparator2) {
  9848. var includes2 = comparator2 ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result3 = [];
  9849. while (othIndex--) {
  9850. var array = arrays[othIndex];
  9851. if (othIndex && iteratee2) {
  9852. array = arrayMap(array, baseUnary(iteratee2));
  9853. }
  9854. maxLength = nativeMin(array.length, maxLength);
  9855. caches[othIndex] = !comparator2 && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
  9856. }
  9857. array = arrays[0];
  9858. var index2 = -1, seen = caches[0];
  9859. outer:
  9860. while (++index2 < length && result3.length < maxLength) {
  9861. var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
  9862. value = comparator2 || value !== 0 ? value : 0;
  9863. if (!(seen ? cacheHas(seen, computed2) : includes2(result3, computed2, comparator2))) {
  9864. othIndex = othLength;
  9865. while (--othIndex) {
  9866. var cache = caches[othIndex];
  9867. if (!(cache ? cacheHas(cache, computed2) : includes2(arrays[othIndex], computed2, comparator2))) {
  9868. continue outer;
  9869. }
  9870. }
  9871. if (seen) {
  9872. seen.push(computed2);
  9873. }
  9874. result3.push(value);
  9875. }
  9876. }
  9877. return result3;
  9878. }
  9879. function baseInverter(object, setter, iteratee2, accumulator) {
  9880. baseForOwn(object, function(value, key, object2) {
  9881. setter(accumulator, iteratee2(value), key, object2);
  9882. });
  9883. return accumulator;
  9884. }
  9885. function baseInvoke(object, path, args) {
  9886. path = castPath(path, object);
  9887. object = parent(object, path);
  9888. var func = object == null ? object : object[toKey(last(path))];
  9889. return func == null ? undefined$1 : apply(func, object, args);
  9890. }
  9891. function baseIsArguments(value) {
  9892. return isObjectLike(value) && baseGetTag(value) == argsTag;
  9893. }
  9894. function baseIsArrayBuffer(value) {
  9895. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  9896. }
  9897. function baseIsDate(value) {
  9898. return isObjectLike(value) && baseGetTag(value) == dateTag;
  9899. }
  9900. function baseIsEqual(value, other, bitmask, customizer, stack2) {
  9901. if (value === other) {
  9902. return true;
  9903. }
  9904. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  9905. return value !== value && other !== other;
  9906. }
  9907. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2);
  9908. }
  9909. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
  9910. var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
  9911. objTag = objTag == argsTag ? objectTag : objTag;
  9912. othTag = othTag == argsTag ? objectTag : othTag;
  9913. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  9914. if (isSameTag && isBuffer(object)) {
  9915. if (!isBuffer(other)) {
  9916. return false;
  9917. }
  9918. objIsArr = true;
  9919. objIsObj = false;
  9920. }
  9921. if (isSameTag && !objIsObj) {
  9922. stack2 || (stack2 = new Stack());
  9923. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
  9924. }
  9925. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  9926. var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
  9927. if (objIsWrapped || othIsWrapped) {
  9928. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  9929. stack2 || (stack2 = new Stack());
  9930. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2);
  9931. }
  9932. }
  9933. if (!isSameTag) {
  9934. return false;
  9935. }
  9936. stack2 || (stack2 = new Stack());
  9937. return equalObjects(object, other, bitmask, customizer, equalFunc, stack2);
  9938. }
  9939. function baseIsMap(value) {
  9940. return isObjectLike(value) && getTag(value) == mapTag;
  9941. }
  9942. function baseIsMatch(object, source, matchData, customizer) {
  9943. var index2 = matchData.length, length = index2, noCustomizer = !customizer;
  9944. if (object == null) {
  9945. return !length;
  9946. }
  9947. object = Object2(object);
  9948. while (index2--) {
  9949. var data = matchData[index2];
  9950. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  9951. return false;
  9952. }
  9953. }
  9954. while (++index2 < length) {
  9955. data = matchData[index2];
  9956. var key = data[0], objValue = object[key], srcValue = data[1];
  9957. if (noCustomizer && data[2]) {
  9958. if (objValue === undefined$1 && !(key in object)) {
  9959. return false;
  9960. }
  9961. } else {
  9962. var stack2 = new Stack();
  9963. if (customizer) {
  9964. var result3 = customizer(objValue, srcValue, key, object, source, stack2);
  9965. }
  9966. if (!(result3 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack2) : result3)) {
  9967. return false;
  9968. }
  9969. }
  9970. }
  9971. return true;
  9972. }
  9973. function baseIsNative(value) {
  9974. if (!isObject2(value) || isMasked(value)) {
  9975. return false;
  9976. }
  9977. var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
  9978. return pattern.test(toSource(value));
  9979. }
  9980. function baseIsRegExp(value) {
  9981. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  9982. }
  9983. function baseIsSet(value) {
  9984. return isObjectLike(value) && getTag(value) == setTag;
  9985. }
  9986. function baseIsTypedArray(value) {
  9987. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  9988. }
  9989. function baseIteratee(value) {
  9990. if (typeof value == "function") {
  9991. return value;
  9992. }
  9993. if (value == null) {
  9994. return identity;
  9995. }
  9996. if (typeof value == "object") {
  9997. return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  9998. }
  9999. return property(value);
  10000. }
  10001. function baseKeys(object) {
  10002. if (!isPrototype(object)) {
  10003. return nativeKeys(object);
  10004. }
  10005. var result3 = [];
  10006. for (var key in Object2(object)) {
  10007. if (hasOwnProperty2.call(object, key) && key != "constructor") {
  10008. result3.push(key);
  10009. }
  10010. }
  10011. return result3;
  10012. }
  10013. function baseKeysIn(object) {
  10014. if (!isObject2(object)) {
  10015. return nativeKeysIn(object);
  10016. }
  10017. var isProto = isPrototype(object), result3 = [];
  10018. for (var key in object) {
  10019. if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) {
  10020. result3.push(key);
  10021. }
  10022. }
  10023. return result3;
  10024. }
  10025. function baseLt(value, other) {
  10026. return value < other;
  10027. }
  10028. function baseMap(collection, iteratee2) {
  10029. var index2 = -1, result3 = isArrayLike(collection) ? Array2(collection.length) : [];
  10030. baseEach(collection, function(value, key, collection2) {
  10031. result3[++index2] = iteratee2(value, key, collection2);
  10032. });
  10033. return result3;
  10034. }
  10035. function baseMatches(source) {
  10036. var matchData = getMatchData(source);
  10037. if (matchData.length == 1 && matchData[0][2]) {
  10038. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  10039. }
  10040. return function(object) {
  10041. return object === source || baseIsMatch(object, source, matchData);
  10042. };
  10043. }
  10044. function baseMatchesProperty(path, srcValue) {
  10045. if (isKey(path) && isStrictComparable(srcValue)) {
  10046. return matchesStrictComparable(toKey(path), srcValue);
  10047. }
  10048. return function(object) {
  10049. var objValue = get2(object, path);
  10050. return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  10051. };
  10052. }
  10053. function baseMerge(object, source, srcIndex, customizer, stack2) {
  10054. if (object === source) {
  10055. return;
  10056. }
  10057. baseFor(source, function(srcValue, key) {
  10058. stack2 || (stack2 = new Stack());
  10059. if (isObject2(srcValue)) {
  10060. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
  10061. } else {
  10062. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : undefined$1;
  10063. if (newValue === undefined$1) {
  10064. newValue = srcValue;
  10065. }
  10066. assignMergeValue(object, key, newValue);
  10067. }
  10068. }, keysIn);
  10069. }
  10070. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) {
  10071. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue);
  10072. if (stacked) {
  10073. assignMergeValue(object, key, stacked);
  10074. return;
  10075. }
  10076. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : undefined$1;
  10077. var isCommon = newValue === undefined$1;
  10078. if (isCommon) {
  10079. var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  10080. newValue = srcValue;
  10081. if (isArr || isBuff || isTyped) {
  10082. if (isArray2(objValue)) {
  10083. newValue = objValue;
  10084. } else if (isArrayLikeObject(objValue)) {
  10085. newValue = copyArray(objValue);
  10086. } else if (isBuff) {
  10087. isCommon = false;
  10088. newValue = cloneBuffer(srcValue, true);
  10089. } else if (isTyped) {
  10090. isCommon = false;
  10091. newValue = cloneTypedArray(srcValue, true);
  10092. } else {
  10093. newValue = [];
  10094. }
  10095. } else if (isPlainObject2(srcValue) || isArguments(srcValue)) {
  10096. newValue = objValue;
  10097. if (isArguments(objValue)) {
  10098. newValue = toPlainObject(objValue);
  10099. } else if (!isObject2(objValue) || isFunction2(objValue)) {
  10100. newValue = initCloneObject(srcValue);
  10101. }
  10102. } else {
  10103. isCommon = false;
  10104. }
  10105. }
  10106. if (isCommon) {
  10107. stack2.set(srcValue, newValue);
  10108. mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
  10109. stack2["delete"](srcValue);
  10110. }
  10111. assignMergeValue(object, key, newValue);
  10112. }
  10113. function baseNth(array, n2) {
  10114. var length = array.length;
  10115. if (!length) {
  10116. return;
  10117. }
  10118. n2 += n2 < 0 ? length : 0;
  10119. return isIndex(n2, length) ? array[n2] : undefined$1;
  10120. }
  10121. function baseOrderBy(collection, iteratees, orders) {
  10122. if (iteratees.length) {
  10123. iteratees = arrayMap(iteratees, function(iteratee2) {
  10124. if (isArray2(iteratee2)) {
  10125. return function(value) {
  10126. return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
  10127. };
  10128. }
  10129. return iteratee2;
  10130. });
  10131. } else {
  10132. iteratees = [identity];
  10133. }
  10134. var index2 = -1;
  10135. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  10136. var result3 = baseMap(collection, function(value, key, collection2) {
  10137. var criteria = arrayMap(iteratees, function(iteratee2) {
  10138. return iteratee2(value);
  10139. });
  10140. return { "criteria": criteria, "index": ++index2, "value": value };
  10141. });
  10142. return baseSortBy(result3, function(object, other) {
  10143. return compareMultiple(object, other, orders);
  10144. });
  10145. }
  10146. function basePick(object, paths) {
  10147. return basePickBy(object, paths, function(value, path) {
  10148. return hasIn(object, path);
  10149. });
  10150. }
  10151. function basePickBy(object, paths, predicate) {
  10152. var index2 = -1, length = paths.length, result3 = {};
  10153. while (++index2 < length) {
  10154. var path = paths[index2], value = baseGet(object, path);
  10155. if (predicate(value, path)) {
  10156. baseSet(result3, castPath(path, object), value);
  10157. }
  10158. }
  10159. return result3;
  10160. }
  10161. function basePropertyDeep(path) {
  10162. return function(object) {
  10163. return baseGet(object, path);
  10164. };
  10165. }
  10166. function basePullAll(array, values2, iteratee2, comparator2) {
  10167. var indexOf2 = comparator2 ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array;
  10168. if (array === values2) {
  10169. values2 = copyArray(values2);
  10170. }
  10171. if (iteratee2) {
  10172. seen = arrayMap(array, baseUnary(iteratee2));
  10173. }
  10174. while (++index2 < length) {
  10175. var fromIndex = 0, value = values2[index2], computed2 = iteratee2 ? iteratee2(value) : value;
  10176. while ((fromIndex = indexOf2(seen, computed2, fromIndex, comparator2)) > -1) {
  10177. if (seen !== array) {
  10178. splice.call(seen, fromIndex, 1);
  10179. }
  10180. splice.call(array, fromIndex, 1);
  10181. }
  10182. }
  10183. return array;
  10184. }
  10185. function basePullAt(array, indexes) {
  10186. var length = array ? indexes.length : 0, lastIndex = length - 1;
  10187. while (length--) {
  10188. var index2 = indexes[length];
  10189. if (length == lastIndex || index2 !== previous) {
  10190. var previous = index2;
  10191. if (isIndex(index2)) {
  10192. splice.call(array, index2, 1);
  10193. } else {
  10194. baseUnset(array, index2);
  10195. }
  10196. }
  10197. }
  10198. return array;
  10199. }
  10200. function baseRandom(lower, upper) {
  10201. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  10202. }
  10203. function baseRange(start, end, step, fromRight) {
  10204. var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result3 = Array2(length);
  10205. while (length--) {
  10206. result3[fromRight ? length : ++index2] = start;
  10207. start += step;
  10208. }
  10209. return result3;
  10210. }
  10211. function baseRepeat(string, n2) {
  10212. var result3 = "";
  10213. if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) {
  10214. return result3;
  10215. }
  10216. do {
  10217. if (n2 % 2) {
  10218. result3 += string;
  10219. }
  10220. n2 = nativeFloor(n2 / 2);
  10221. if (n2) {
  10222. string += string;
  10223. }
  10224. } while (n2);
  10225. return result3;
  10226. }
  10227. function baseRest(func, start) {
  10228. return setToString(overRest(func, start, identity), func + "");
  10229. }
  10230. function baseSample(collection) {
  10231. return arraySample(values(collection));
  10232. }
  10233. function baseSampleSize(collection, n2) {
  10234. var array = values(collection);
  10235. return shuffleSelf(array, baseClamp(n2, 0, array.length));
  10236. }
  10237. function baseSet(object, path, value, customizer) {
  10238. if (!isObject2(object)) {
  10239. return object;
  10240. }
  10241. path = castPath(path, object);
  10242. var index2 = -1, length = path.length, lastIndex = length - 1, nested = object;
  10243. while (nested != null && ++index2 < length) {
  10244. var key = toKey(path[index2]), newValue = value;
  10245. if (key === "__proto__" || key === "constructor" || key === "prototype") {
  10246. return object;
  10247. }
  10248. if (index2 != lastIndex) {
  10249. var objValue = nested[key];
  10250. newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
  10251. if (newValue === undefined$1) {
  10252. newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
  10253. }
  10254. }
  10255. assignValue(nested, key, newValue);
  10256. nested = nested[key];
  10257. }
  10258. return object;
  10259. }
  10260. var baseSetData = !metaMap ? identity : function(func, data) {
  10261. metaMap.set(func, data);
  10262. return func;
  10263. };
  10264. var baseSetToString = !defineProperty ? identity : function(func, string) {
  10265. return defineProperty(func, "toString", {
  10266. "configurable": true,
  10267. "enumerable": false,
  10268. "value": constant(string),
  10269. "writable": true
  10270. });
  10271. };
  10272. function baseShuffle(collection) {
  10273. return shuffleSelf(values(collection));
  10274. }
  10275. function baseSlice(array, start, end) {
  10276. var index2 = -1, length = array.length;
  10277. if (start < 0) {
  10278. start = -start > length ? 0 : length + start;
  10279. }
  10280. end = end > length ? length : end;
  10281. if (end < 0) {
  10282. end += length;
  10283. }
  10284. length = start > end ? 0 : end - start >>> 0;
  10285. start >>>= 0;
  10286. var result3 = Array2(length);
  10287. while (++index2 < length) {
  10288. result3[index2] = array[index2 + start];
  10289. }
  10290. return result3;
  10291. }
  10292. function baseSome(collection, predicate) {
  10293. var result3;
  10294. baseEach(collection, function(value, index2, collection2) {
  10295. result3 = predicate(value, index2, collection2);
  10296. return !result3;
  10297. });
  10298. return !!result3;
  10299. }
  10300. function baseSortedIndex(array, value, retHighest) {
  10301. var low = 0, high = array == null ? low : array.length;
  10302. if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  10303. while (low < high) {
  10304. var mid = low + high >>> 1, computed2 = array[mid];
  10305. if (computed2 !== null && !isSymbol2(computed2) && (retHighest ? computed2 <= value : computed2 < value)) {
  10306. low = mid + 1;
  10307. } else {
  10308. high = mid;
  10309. }
  10310. }
  10311. return high;
  10312. }
  10313. return baseSortedIndexBy(array, value, identity, retHighest);
  10314. }
  10315. function baseSortedIndexBy(array, value, iteratee2, retHighest) {
  10316. var low = 0, high = array == null ? 0 : array.length;
  10317. if (high === 0) {
  10318. return 0;
  10319. }
  10320. value = iteratee2(value);
  10321. var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol2(value), valIsUndefined = value === undefined$1;
  10322. while (low < high) {
  10323. var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol = isSymbol2(computed2);
  10324. if (valIsNaN) {
  10325. var setLow = retHighest || othIsReflexive;
  10326. } else if (valIsUndefined) {
  10327. setLow = othIsReflexive && (retHighest || othIsDefined);
  10328. } else if (valIsNull) {
  10329. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  10330. } else if (valIsSymbol) {
  10331. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  10332. } else if (othIsNull || othIsSymbol) {
  10333. setLow = false;
  10334. } else {
  10335. setLow = retHighest ? computed2 <= value : computed2 < value;
  10336. }
  10337. if (setLow) {
  10338. low = mid + 1;
  10339. } else {
  10340. high = mid;
  10341. }
  10342. }
  10343. return nativeMin(high, MAX_ARRAY_INDEX);
  10344. }
  10345. function baseSortedUniq(array, iteratee2) {
  10346. var index2 = -1, length = array.length, resIndex = 0, result3 = [];
  10347. while (++index2 < length) {
  10348. var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
  10349. if (!index2 || !eq(computed2, seen)) {
  10350. var seen = computed2;
  10351. result3[resIndex++] = value === 0 ? 0 : value;
  10352. }
  10353. }
  10354. return result3;
  10355. }
  10356. function baseToNumber(value) {
  10357. if (typeof value == "number") {
  10358. return value;
  10359. }
  10360. if (isSymbol2(value)) {
  10361. return NAN;
  10362. }
  10363. return +value;
  10364. }
  10365. function baseToString(value) {
  10366. if (typeof value == "string") {
  10367. return value;
  10368. }
  10369. if (isArray2(value)) {
  10370. return arrayMap(value, baseToString) + "";
  10371. }
  10372. if (isSymbol2(value)) {
  10373. return symbolToString ? symbolToString.call(value) : "";
  10374. }
  10375. var result3 = value + "";
  10376. return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
  10377. }
  10378. function baseUniq(array, iteratee2, comparator2) {
  10379. var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result3 = [], seen = result3;
  10380. if (comparator2) {
  10381. isCommon = false;
  10382. includes2 = arrayIncludesWith;
  10383. } else if (length >= LARGE_ARRAY_SIZE) {
  10384. var set3 = iteratee2 ? null : createSet(array);
  10385. if (set3) {
  10386. return setToArray(set3);
  10387. }
  10388. isCommon = false;
  10389. includes2 = cacheHas;
  10390. seen = new SetCache();
  10391. } else {
  10392. seen = iteratee2 ? [] : result3;
  10393. }
  10394. outer:
  10395. while (++index2 < length) {
  10396. var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
  10397. value = comparator2 || value !== 0 ? value : 0;
  10398. if (isCommon && computed2 === computed2) {
  10399. var seenIndex = seen.length;
  10400. while (seenIndex--) {
  10401. if (seen[seenIndex] === computed2) {
  10402. continue outer;
  10403. }
  10404. }
  10405. if (iteratee2) {
  10406. seen.push(computed2);
  10407. }
  10408. result3.push(value);
  10409. } else if (!includes2(seen, computed2, comparator2)) {
  10410. if (seen !== result3) {
  10411. seen.push(computed2);
  10412. }
  10413. result3.push(value);
  10414. }
  10415. }
  10416. return result3;
  10417. }
  10418. function baseUnset(object, path) {
  10419. path = castPath(path, object);
  10420. object = parent(object, path);
  10421. return object == null || delete object[toKey(last(path))];
  10422. }
  10423. function baseUpdate(object, path, updater, customizer) {
  10424. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  10425. }
  10426. function baseWhile(array, predicate, isDrop, fromRight) {
  10427. var length = array.length, index2 = fromRight ? length : -1;
  10428. while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) {
  10429. }
  10430. return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
  10431. }
  10432. function baseWrapperValue(value, actions) {
  10433. var result3 = value;
  10434. if (result3 instanceof LazyWrapper) {
  10435. result3 = result3.value();
  10436. }
  10437. return arrayReduce(actions, function(result4, action) {
  10438. return action.func.apply(action.thisArg, arrayPush([result4], action.args));
  10439. }, result3);
  10440. }
  10441. function baseXor(arrays, iteratee2, comparator2) {
  10442. var length = arrays.length;
  10443. if (length < 2) {
  10444. return length ? baseUniq(arrays[0]) : [];
  10445. }
  10446. var index2 = -1, result3 = Array2(length);
  10447. while (++index2 < length) {
  10448. var array = arrays[index2], othIndex = -1;
  10449. while (++othIndex < length) {
  10450. if (othIndex != index2) {
  10451. result3[index2] = baseDifference(result3[index2] || array, arrays[othIndex], iteratee2, comparator2);
  10452. }
  10453. }
  10454. }
  10455. return baseUniq(baseFlatten(result3, 1), iteratee2, comparator2);
  10456. }
  10457. function baseZipObject(props, values2, assignFunc) {
  10458. var index2 = -1, length = props.length, valsLength = values2.length, result3 = {};
  10459. while (++index2 < length) {
  10460. var value = index2 < valsLength ? values2[index2] : undefined$1;
  10461. assignFunc(result3, props[index2], value);
  10462. }
  10463. return result3;
  10464. }
  10465. function castArrayLikeObject(value) {
  10466. return isArrayLikeObject(value) ? value : [];
  10467. }
  10468. function castFunction(value) {
  10469. return typeof value == "function" ? value : identity;
  10470. }
  10471. function castPath(value, object) {
  10472. if (isArray2(value)) {
  10473. return value;
  10474. }
  10475. return isKey(value, object) ? [value] : stringToPath(toString2(value));
  10476. }
  10477. var castRest = baseRest;
  10478. function castSlice(array, start, end) {
  10479. var length = array.length;
  10480. end = end === undefined$1 ? length : end;
  10481. return !start && end >= length ? array : baseSlice(array, start, end);
  10482. }
  10483. var clearTimeout2 = ctxClearTimeout || function(id) {
  10484. return root.clearTimeout(id);
  10485. };
  10486. function cloneBuffer(buffer2, isDeep) {
  10487. if (isDeep) {
  10488. return buffer2.slice();
  10489. }
  10490. var length = buffer2.length, result3 = allocUnsafe ? allocUnsafe(length) : new buffer2.constructor(length);
  10491. buffer2.copy(result3);
  10492. return result3;
  10493. }
  10494. function cloneArrayBuffer(arrayBuffer) {
  10495. var result3 = new arrayBuffer.constructor(arrayBuffer.byteLength);
  10496. new Uint8Array2(result3).set(new Uint8Array2(arrayBuffer));
  10497. return result3;
  10498. }
  10499. function cloneDataView(dataView, isDeep) {
  10500. var buffer2 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  10501. return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength);
  10502. }
  10503. function cloneRegExp(regexp) {
  10504. var result3 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  10505. result3.lastIndex = regexp.lastIndex;
  10506. return result3;
  10507. }
  10508. function cloneSymbol(symbol) {
  10509. return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
  10510. }
  10511. function cloneTypedArray(typedArray, isDeep) {
  10512. var buffer2 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  10513. return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length);
  10514. }
  10515. function compareAscending(value, other) {
  10516. if (value !== other) {
  10517. var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol2(value);
  10518. var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other);
  10519. if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
  10520. return 1;
  10521. }
  10522. if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
  10523. return -1;
  10524. }
  10525. }
  10526. return 0;
  10527. }
  10528. function compareMultiple(object, other, orders) {
  10529. var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
  10530. while (++index2 < length) {
  10531. var result3 = compareAscending(objCriteria[index2], othCriteria[index2]);
  10532. if (result3) {
  10533. if (index2 >= ordersLength) {
  10534. return result3;
  10535. }
  10536. var order = orders[index2];
  10537. return result3 * (order == "desc" ? -1 : 1);
  10538. }
  10539. }
  10540. return object.index - other.index;
  10541. }
  10542. function composeArgs(args, partials, holders, isCurried) {
  10543. var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result3 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
  10544. while (++leftIndex < leftLength) {
  10545. result3[leftIndex] = partials[leftIndex];
  10546. }
  10547. while (++argsIndex < holdersLength) {
  10548. if (isUncurried || argsIndex < argsLength) {
  10549. result3[holders[argsIndex]] = args[argsIndex];
  10550. }
  10551. }
  10552. while (rangeLength--) {
  10553. result3[leftIndex++] = args[argsIndex++];
  10554. }
  10555. return result3;
  10556. }
  10557. function composeArgsRight(args, partials, holders, isCurried) {
  10558. var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result3 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
  10559. while (++argsIndex < rangeLength) {
  10560. result3[argsIndex] = args[argsIndex];
  10561. }
  10562. var offset = argsIndex;
  10563. while (++rightIndex < rightLength) {
  10564. result3[offset + rightIndex] = partials[rightIndex];
  10565. }
  10566. while (++holdersIndex < holdersLength) {
  10567. if (isUncurried || argsIndex < argsLength) {
  10568. result3[offset + holders[holdersIndex]] = args[argsIndex++];
  10569. }
  10570. }
  10571. return result3;
  10572. }
  10573. function copyArray(source, array) {
  10574. var index2 = -1, length = source.length;
  10575. array || (array = Array2(length));
  10576. while (++index2 < length) {
  10577. array[index2] = source[index2];
  10578. }
  10579. return array;
  10580. }
  10581. function copyObject(source, props, object, customizer) {
  10582. var isNew = !object;
  10583. object || (object = {});
  10584. var index2 = -1, length = props.length;
  10585. while (++index2 < length) {
  10586. var key = props[index2];
  10587. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
  10588. if (newValue === undefined$1) {
  10589. newValue = source[key];
  10590. }
  10591. if (isNew) {
  10592. baseAssignValue(object, key, newValue);
  10593. } else {
  10594. assignValue(object, key, newValue);
  10595. }
  10596. }
  10597. return object;
  10598. }
  10599. function copySymbols(source, object) {
  10600. return copyObject(source, getSymbols(source), object);
  10601. }
  10602. function copySymbolsIn(source, object) {
  10603. return copyObject(source, getSymbolsIn(source), object);
  10604. }
  10605. function createAggregator(setter, initializer) {
  10606. return function(collection, iteratee2) {
  10607. var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
  10608. return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
  10609. };
  10610. }
  10611. function createAssigner(assigner) {
  10612. return baseRest(function(object, sources) {
  10613. var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
  10614. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
  10615. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  10616. customizer = length < 3 ? undefined$1 : customizer;
  10617. length = 1;
  10618. }
  10619. object = Object2(object);
  10620. while (++index2 < length) {
  10621. var source = sources[index2];
  10622. if (source) {
  10623. assigner(object, source, index2, customizer);
  10624. }
  10625. }
  10626. return object;
  10627. });
  10628. }
  10629. function createBaseEach(eachFunc, fromRight) {
  10630. return function(collection, iteratee2) {
  10631. if (collection == null) {
  10632. return collection;
  10633. }
  10634. if (!isArrayLike(collection)) {
  10635. return eachFunc(collection, iteratee2);
  10636. }
  10637. var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection);
  10638. while (fromRight ? index2-- : ++index2 < length) {
  10639. if (iteratee2(iterable[index2], index2, iterable) === false) {
  10640. break;
  10641. }
  10642. }
  10643. return collection;
  10644. };
  10645. }
  10646. function createBaseFor(fromRight) {
  10647. return function(object, iteratee2, keysFunc) {
  10648. var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
  10649. while (length--) {
  10650. var key = props[fromRight ? length : ++index2];
  10651. if (iteratee2(iterable[key], key, iterable) === false) {
  10652. break;
  10653. }
  10654. }
  10655. return object;
  10656. };
  10657. }
  10658. function createBind(func, bitmask, thisArg) {
  10659. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  10660. function wrapper() {
  10661. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  10662. return fn.apply(isBind ? thisArg : this, arguments);
  10663. }
  10664. return wrapper;
  10665. }
  10666. function createCaseFirst(methodName) {
  10667. return function(string) {
  10668. string = toString2(string);
  10669. var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
  10670. var chr = strSymbols ? strSymbols[0] : string.charAt(0);
  10671. var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
  10672. return chr[methodName]() + trailing;
  10673. };
  10674. }
  10675. function createCompounder(callback) {
  10676. return function(string) {
  10677. return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
  10678. };
  10679. }
  10680. function createCtor(Ctor) {
  10681. return function() {
  10682. var args = arguments;
  10683. switch (args.length) {
  10684. case 0:
  10685. return new Ctor();
  10686. case 1:
  10687. return new Ctor(args[0]);
  10688. case 2:
  10689. return new Ctor(args[0], args[1]);
  10690. case 3:
  10691. return new Ctor(args[0], args[1], args[2]);
  10692. case 4:
  10693. return new Ctor(args[0], args[1], args[2], args[3]);
  10694. case 5:
  10695. return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  10696. case 6:
  10697. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  10698. case 7:
  10699. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  10700. }
  10701. var thisBinding = baseCreate(Ctor.prototype), result3 = Ctor.apply(thisBinding, args);
  10702. return isObject2(result3) ? result3 : thisBinding;
  10703. };
  10704. }
  10705. function createCurry(func, bitmask, arity) {
  10706. var Ctor = createCtor(func);
  10707. function wrapper() {
  10708. var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper);
  10709. while (index2--) {
  10710. args[index2] = arguments[index2];
  10711. }
  10712. var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
  10713. length -= holders.length;
  10714. if (length < arity) {
  10715. return createRecurry(
  10716. func,
  10717. bitmask,
  10718. createHybrid,
  10719. wrapper.placeholder,
  10720. undefined$1,
  10721. args,
  10722. holders,
  10723. undefined$1,
  10724. undefined$1,
  10725. arity - length
  10726. );
  10727. }
  10728. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  10729. return apply(fn, this, args);
  10730. }
  10731. return wrapper;
  10732. }
  10733. function createFind(findIndexFunc) {
  10734. return function(collection, predicate, fromIndex) {
  10735. var iterable = Object2(collection);
  10736. if (!isArrayLike(collection)) {
  10737. var iteratee2 = getIteratee(predicate, 3);
  10738. collection = keys(collection);
  10739. predicate = function(key) {
  10740. return iteratee2(iterable[key], key, iterable);
  10741. };
  10742. }
  10743. var index2 = findIndexFunc(collection, predicate, fromIndex);
  10744. return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined$1;
  10745. };
  10746. }
  10747. function createFlow(fromRight) {
  10748. return flatRest(function(funcs) {
  10749. var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru;
  10750. if (fromRight) {
  10751. funcs.reverse();
  10752. }
  10753. while (index2--) {
  10754. var func = funcs[index2];
  10755. if (typeof func != "function") {
  10756. throw new TypeError2(FUNC_ERROR_TEXT);
  10757. }
  10758. if (prereq && !wrapper && getFuncName(func) == "wrapper") {
  10759. var wrapper = new LodashWrapper([], true);
  10760. }
  10761. }
  10762. index2 = wrapper ? index2 : length;
  10763. while (++index2 < length) {
  10764. func = funcs[index2];
  10765. var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
  10766. if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
  10767. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  10768. } else {
  10769. wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
  10770. }
  10771. }
  10772. return function() {
  10773. var args = arguments, value = args[0];
  10774. if (wrapper && args.length == 1 && isArray2(value)) {
  10775. return wrapper.plant(value).value();
  10776. }
  10777. var index3 = 0, result3 = length ? funcs[index3].apply(this, args) : value;
  10778. while (++index3 < length) {
  10779. result3 = funcs[index3].call(this, result3);
  10780. }
  10781. return result3;
  10782. };
  10783. });
  10784. }
  10785. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
  10786. var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func);
  10787. function wrapper() {
  10788. var length = arguments.length, args = Array2(length), index2 = length;
  10789. while (index2--) {
  10790. args[index2] = arguments[index2];
  10791. }
  10792. if (isCurried) {
  10793. var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
  10794. }
  10795. if (partials) {
  10796. args = composeArgs(args, partials, holders, isCurried);
  10797. }
  10798. if (partialsRight) {
  10799. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  10800. }
  10801. length -= holdersCount;
  10802. if (isCurried && length < arity) {
  10803. var newHolders = replaceHolders(args, placeholder);
  10804. return createRecurry(
  10805. func,
  10806. bitmask,
  10807. createHybrid,
  10808. wrapper.placeholder,
  10809. thisArg,
  10810. args,
  10811. newHolders,
  10812. argPos,
  10813. ary2,
  10814. arity - length
  10815. );
  10816. }
  10817. var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
  10818. length = args.length;
  10819. if (argPos) {
  10820. args = reorder(args, argPos);
  10821. } else if (isFlip && length > 1) {
  10822. args.reverse();
  10823. }
  10824. if (isAry && ary2 < length) {
  10825. args.length = ary2;
  10826. }
  10827. if (this && this !== root && this instanceof wrapper) {
  10828. fn = Ctor || createCtor(fn);
  10829. }
  10830. return fn.apply(thisBinding, args);
  10831. }
  10832. return wrapper;
  10833. }
  10834. function createInverter(setter, toIteratee) {
  10835. return function(object, iteratee2) {
  10836. return baseInverter(object, setter, toIteratee(iteratee2), {});
  10837. };
  10838. }
  10839. function createMathOperation(operator, defaultValue) {
  10840. return function(value, other) {
  10841. var result3;
  10842. if (value === undefined$1 && other === undefined$1) {
  10843. return defaultValue;
  10844. }
  10845. if (value !== undefined$1) {
  10846. result3 = value;
  10847. }
  10848. if (other !== undefined$1) {
  10849. if (result3 === undefined$1) {
  10850. return other;
  10851. }
  10852. if (typeof value == "string" || typeof other == "string") {
  10853. value = baseToString(value);
  10854. other = baseToString(other);
  10855. } else {
  10856. value = baseToNumber(value);
  10857. other = baseToNumber(other);
  10858. }
  10859. result3 = operator(value, other);
  10860. }
  10861. return result3;
  10862. };
  10863. }
  10864. function createOver(arrayFunc) {
  10865. return flatRest(function(iteratees) {
  10866. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  10867. return baseRest(function(args) {
  10868. var thisArg = this;
  10869. return arrayFunc(iteratees, function(iteratee2) {
  10870. return apply(iteratee2, thisArg, args);
  10871. });
  10872. });
  10873. });
  10874. }
  10875. function createPadding(length, chars) {
  10876. chars = chars === undefined$1 ? " " : baseToString(chars);
  10877. var charsLength = chars.length;
  10878. if (charsLength < 2) {
  10879. return charsLength ? baseRepeat(chars, length) : chars;
  10880. }
  10881. var result3 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  10882. return hasUnicode(chars) ? castSlice(stringToArray(result3), 0, length).join("") : result3.slice(0, length);
  10883. }
  10884. function createPartial(func, bitmask, thisArg, partials) {
  10885. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  10886. function wrapper() {
  10887. var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  10888. while (++leftIndex < leftLength) {
  10889. args[leftIndex] = partials[leftIndex];
  10890. }
  10891. while (argsLength--) {
  10892. args[leftIndex++] = arguments[++argsIndex];
  10893. }
  10894. return apply(fn, isBind ? thisArg : this, args);
  10895. }
  10896. return wrapper;
  10897. }
  10898. function createRange(fromRight) {
  10899. return function(start, end, step) {
  10900. if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
  10901. end = step = undefined$1;
  10902. }
  10903. start = toFinite(start);
  10904. if (end === undefined$1) {
  10905. end = start;
  10906. start = 0;
  10907. } else {
  10908. end = toFinite(end);
  10909. }
  10910. step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
  10911. return baseRange(start, end, step, fromRight);
  10912. };
  10913. }
  10914. function createRelationalOperation(operator) {
  10915. return function(value, other) {
  10916. if (!(typeof value == "string" && typeof other == "string")) {
  10917. value = toNumber2(value);
  10918. other = toNumber2(other);
  10919. }
  10920. return operator(value, other);
  10921. };
  10922. }
  10923. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
  10924. var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
  10925. bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
  10926. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  10927. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  10928. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  10929. }
  10930. var newData = [
  10931. func,
  10932. bitmask,
  10933. thisArg,
  10934. newPartials,
  10935. newHolders,
  10936. newPartialsRight,
  10937. newHoldersRight,
  10938. argPos,
  10939. ary2,
  10940. arity
  10941. ];
  10942. var result3 = wrapFunc.apply(undefined$1, newData);
  10943. if (isLaziable(func)) {
  10944. setData(result3, newData);
  10945. }
  10946. result3.placeholder = placeholder;
  10947. return setWrapToString(result3, func, bitmask);
  10948. }
  10949. function createRound(methodName) {
  10950. var func = Math2[methodName];
  10951. return function(number, precision) {
  10952. number = toNumber2(number);
  10953. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  10954. if (precision && nativeIsFinite(number)) {
  10955. var pair = (toString2(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
  10956. pair = (toString2(value) + "e").split("e");
  10957. return +(pair[0] + "e" + (+pair[1] - precision));
  10958. }
  10959. return func(number);
  10960. };
  10961. }
  10962. var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) {
  10963. return new Set2(values2);
  10964. };
  10965. function createToPairs(keysFunc) {
  10966. return function(object) {
  10967. var tag = getTag(object);
  10968. if (tag == mapTag) {
  10969. return mapToArray(object);
  10970. }
  10971. if (tag == setTag) {
  10972. return setToPairs(object);
  10973. }
  10974. return baseToPairs(object, keysFunc(object));
  10975. };
  10976. }
  10977. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
  10978. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  10979. if (!isBindKey && typeof func != "function") {
  10980. throw new TypeError2(FUNC_ERROR_TEXT);
  10981. }
  10982. var length = partials ? partials.length : 0;
  10983. if (!length) {
  10984. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  10985. partials = holders = undefined$1;
  10986. }
  10987. ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
  10988. arity = arity === undefined$1 ? arity : toInteger(arity);
  10989. length -= holders ? holders.length : 0;
  10990. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  10991. var partialsRight = partials, holdersRight = holders;
  10992. partials = holders = undefined$1;
  10993. }
  10994. var data = isBindKey ? undefined$1 : getData(func);
  10995. var newData = [
  10996. func,
  10997. bitmask,
  10998. thisArg,
  10999. partials,
  11000. holders,
  11001. partialsRight,
  11002. holdersRight,
  11003. argPos,
  11004. ary2,
  11005. arity
  11006. ];
  11007. if (data) {
  11008. mergeData(newData, data);
  11009. }
  11010. func = newData[0];
  11011. bitmask = newData[1];
  11012. thisArg = newData[2];
  11013. partials = newData[3];
  11014. holders = newData[4];
  11015. arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
  11016. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  11017. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  11018. }
  11019. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  11020. var result3 = createBind(func, bitmask, thisArg);
  11021. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  11022. result3 = createCurry(func, bitmask, arity);
  11023. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  11024. result3 = createPartial(func, bitmask, thisArg, partials);
  11025. } else {
  11026. result3 = createHybrid.apply(undefined$1, newData);
  11027. }
  11028. var setter = data ? baseSetData : setData;
  11029. return setWrapToString(setter(result3, newData), func, bitmask);
  11030. }
  11031. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  11032. if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
  11033. return srcValue;
  11034. }
  11035. return objValue;
  11036. }
  11037. function customDefaultsMerge(objValue, srcValue, key, object, source, stack2) {
  11038. if (isObject2(objValue) && isObject2(srcValue)) {
  11039. stack2.set(srcValue, objValue);
  11040. baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack2);
  11041. stack2["delete"](srcValue);
  11042. }
  11043. return objValue;
  11044. }
  11045. function customOmitClone(value) {
  11046. return isPlainObject2(value) ? undefined$1 : value;
  11047. }
  11048. function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
  11049. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
  11050. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  11051. return false;
  11052. }
  11053. var arrStacked = stack2.get(array);
  11054. var othStacked = stack2.get(other);
  11055. if (arrStacked && othStacked) {
  11056. return arrStacked == other && othStacked == array;
  11057. }
  11058. var index2 = -1, result3 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
  11059. stack2.set(array, other);
  11060. stack2.set(other, array);
  11061. while (++index2 < arrLength) {
  11062. var arrValue = array[index2], othValue = other[index2];
  11063. if (customizer) {
  11064. var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack2) : customizer(arrValue, othValue, index2, array, other, stack2);
  11065. }
  11066. if (compared !== undefined$1) {
  11067. if (compared) {
  11068. continue;
  11069. }
  11070. result3 = false;
  11071. break;
  11072. }
  11073. if (seen) {
  11074. if (!arraySome(other, function(othValue2, othIndex) {
  11075. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
  11076. return seen.push(othIndex);
  11077. }
  11078. })) {
  11079. result3 = false;
  11080. break;
  11081. }
  11082. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
  11083. result3 = false;
  11084. break;
  11085. }
  11086. }
  11087. stack2["delete"](array);
  11088. stack2["delete"](other);
  11089. return result3;
  11090. }
  11091. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) {
  11092. switch (tag) {
  11093. case dataViewTag:
  11094. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  11095. return false;
  11096. }
  11097. object = object.buffer;
  11098. other = other.buffer;
  11099. case arrayBufferTag:
  11100. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
  11101. return false;
  11102. }
  11103. return true;
  11104. case boolTag:
  11105. case dateTag:
  11106. case numberTag:
  11107. return eq(+object, +other);
  11108. case errorTag:
  11109. return object.name == other.name && object.message == other.message;
  11110. case regexpTag:
  11111. case stringTag:
  11112. return object == other + "";
  11113. case mapTag:
  11114. var convert = mapToArray;
  11115. case setTag:
  11116. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  11117. convert || (convert = setToArray);
  11118. if (object.size != other.size && !isPartial) {
  11119. return false;
  11120. }
  11121. var stacked = stack2.get(object);
  11122. if (stacked) {
  11123. return stacked == other;
  11124. }
  11125. bitmask |= COMPARE_UNORDERED_FLAG;
  11126. stack2.set(object, other);
  11127. var result3 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
  11128. stack2["delete"](object);
  11129. return result3;
  11130. case symbolTag:
  11131. if (symbolValueOf) {
  11132. return symbolValueOf.call(object) == symbolValueOf.call(other);
  11133. }
  11134. }
  11135. return false;
  11136. }
  11137. function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
  11138. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  11139. if (objLength != othLength && !isPartial) {
  11140. return false;
  11141. }
  11142. var index2 = objLength;
  11143. while (index2--) {
  11144. var key = objProps[index2];
  11145. if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
  11146. return false;
  11147. }
  11148. }
  11149. var objStacked = stack2.get(object);
  11150. var othStacked = stack2.get(other);
  11151. if (objStacked && othStacked) {
  11152. return objStacked == other && othStacked == object;
  11153. }
  11154. var result3 = true;
  11155. stack2.set(object, other);
  11156. stack2.set(other, object);
  11157. var skipCtor = isPartial;
  11158. while (++index2 < objLength) {
  11159. key = objProps[index2];
  11160. var objValue = object[key], othValue = other[key];
  11161. if (customizer) {
  11162. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2);
  11163. }
  11164. if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
  11165. result3 = false;
  11166. break;
  11167. }
  11168. skipCtor || (skipCtor = key == "constructor");
  11169. }
  11170. if (result3 && !skipCtor) {
  11171. var objCtor = object.constructor, othCtor = other.constructor;
  11172. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  11173. result3 = false;
  11174. }
  11175. }
  11176. stack2["delete"](object);
  11177. stack2["delete"](other);
  11178. return result3;
  11179. }
  11180. function flatRest(func) {
  11181. return setToString(overRest(func, undefined$1, flatten), func + "");
  11182. }
  11183. function getAllKeys(object) {
  11184. return baseGetAllKeys(object, keys, getSymbols);
  11185. }
  11186. function getAllKeysIn(object) {
  11187. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  11188. }
  11189. var getData = !metaMap ? noop2 : function(func) {
  11190. return metaMap.get(func);
  11191. };
  11192. function getFuncName(func) {
  11193. var result3 = func.name + "", array = realNames[result3], length = hasOwnProperty2.call(realNames, result3) ? array.length : 0;
  11194. while (length--) {
  11195. var data = array[length], otherFunc = data.func;
  11196. if (otherFunc == null || otherFunc == func) {
  11197. return data.name;
  11198. }
  11199. }
  11200. return result3;
  11201. }
  11202. function getHolder(func) {
  11203. var object = hasOwnProperty2.call(lodash2, "placeholder") ? lodash2 : func;
  11204. return object.placeholder;
  11205. }
  11206. function getIteratee() {
  11207. var result3 = lodash2.iteratee || iteratee;
  11208. result3 = result3 === iteratee ? baseIteratee : result3;
  11209. return arguments.length ? result3(arguments[0], arguments[1]) : result3;
  11210. }
  11211. function getMapData(map2, key) {
  11212. var data = map2.__data__;
  11213. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  11214. }
  11215. function getMatchData(object) {
  11216. var result3 = keys(object), length = result3.length;
  11217. while (length--) {
  11218. var key = result3[length], value = object[key];
  11219. result3[length] = [key, value, isStrictComparable(value)];
  11220. }
  11221. return result3;
  11222. }
  11223. function getNative(object, key) {
  11224. var value = getValue(object, key);
  11225. return baseIsNative(value) ? value : undefined$1;
  11226. }
  11227. function getRawTag(value) {
  11228. var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
  11229. try {
  11230. value[symToStringTag] = undefined$1;
  11231. var unmasked = true;
  11232. } catch (e2) {
  11233. }
  11234. var result3 = nativeObjectToString.call(value);
  11235. if (unmasked) {
  11236. if (isOwn) {
  11237. value[symToStringTag] = tag;
  11238. } else {
  11239. delete value[symToStringTag];
  11240. }
  11241. }
  11242. return result3;
  11243. }
  11244. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  11245. if (object == null) {
  11246. return [];
  11247. }
  11248. object = Object2(object);
  11249. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  11250. return propertyIsEnumerable.call(object, symbol);
  11251. });
  11252. };
  11253. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  11254. var result3 = [];
  11255. while (object) {
  11256. arrayPush(result3, getSymbols(object));
  11257. object = getPrototype(object);
  11258. }
  11259. return result3;
  11260. };
  11261. var getTag = baseGetTag;
  11262. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
  11263. getTag = function(value) {
  11264. var result3 = baseGetTag(value), Ctor = result3 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
  11265. if (ctorString) {
  11266. switch (ctorString) {
  11267. case dataViewCtorString:
  11268. return dataViewTag;
  11269. case mapCtorString:
  11270. return mapTag;
  11271. case promiseCtorString:
  11272. return promiseTag;
  11273. case setCtorString:
  11274. return setTag;
  11275. case weakMapCtorString:
  11276. return weakMapTag;
  11277. }
  11278. }
  11279. return result3;
  11280. };
  11281. }
  11282. function getView(start, end, transforms) {
  11283. var index2 = -1, length = transforms.length;
  11284. while (++index2 < length) {
  11285. var data = transforms[index2], size3 = data.size;
  11286. switch (data.type) {
  11287. case "drop":
  11288. start += size3;
  11289. break;
  11290. case "dropRight":
  11291. end -= size3;
  11292. break;
  11293. case "take":
  11294. end = nativeMin(end, start + size3);
  11295. break;
  11296. case "takeRight":
  11297. start = nativeMax(start, end - size3);
  11298. break;
  11299. }
  11300. }
  11301. return { "start": start, "end": end };
  11302. }
  11303. function getWrapDetails(source) {
  11304. var match = source.match(reWrapDetails);
  11305. return match ? match[1].split(reSplitDetails) : [];
  11306. }
  11307. function hasPath(object, path, hasFunc) {
  11308. path = castPath(path, object);
  11309. var index2 = -1, length = path.length, result3 = false;
  11310. while (++index2 < length) {
  11311. var key = toKey(path[index2]);
  11312. if (!(result3 = object != null && hasFunc(object, key))) {
  11313. break;
  11314. }
  11315. object = object[key];
  11316. }
  11317. if (result3 || ++index2 != length) {
  11318. return result3;
  11319. }
  11320. length = object == null ? 0 : object.length;
  11321. return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
  11322. }
  11323. function initCloneArray(array) {
  11324. var length = array.length, result3 = new array.constructor(length);
  11325. if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) {
  11326. result3.index = array.index;
  11327. result3.input = array.input;
  11328. }
  11329. return result3;
  11330. }
  11331. function initCloneObject(object) {
  11332. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  11333. }
  11334. function initCloneByTag(object, tag, isDeep) {
  11335. var Ctor = object.constructor;
  11336. switch (tag) {
  11337. case arrayBufferTag:
  11338. return cloneArrayBuffer(object);
  11339. case boolTag:
  11340. case dateTag:
  11341. return new Ctor(+object);
  11342. case dataViewTag:
  11343. return cloneDataView(object, isDeep);
  11344. case float32Tag:
  11345. case float64Tag:
  11346. case int8Tag:
  11347. case int16Tag:
  11348. case int32Tag:
  11349. case uint8Tag:
  11350. case uint8ClampedTag:
  11351. case uint16Tag:
  11352. case uint32Tag:
  11353. return cloneTypedArray(object, isDeep);
  11354. case mapTag:
  11355. return new Ctor();
  11356. case numberTag:
  11357. case stringTag:
  11358. return new Ctor(object);
  11359. case regexpTag:
  11360. return cloneRegExp(object);
  11361. case setTag:
  11362. return new Ctor();
  11363. case symbolTag:
  11364. return cloneSymbol(object);
  11365. }
  11366. }
  11367. function insertWrapDetails(source, details) {
  11368. var length = details.length;
  11369. if (!length) {
  11370. return source;
  11371. }
  11372. var lastIndex = length - 1;
  11373. details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
  11374. details = details.join(length > 2 ? ", " : " ");
  11375. return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
  11376. }
  11377. function isFlattenable(value) {
  11378. return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  11379. }
  11380. function isIndex(value, length) {
  11381. var type = typeof value;
  11382. length = length == null ? MAX_SAFE_INTEGER : length;
  11383. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  11384. }
  11385. function isIterateeCall(value, index2, object) {
  11386. if (!isObject2(object)) {
  11387. return false;
  11388. }
  11389. var type = typeof index2;
  11390. if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
  11391. return eq(object[index2], value);
  11392. }
  11393. return false;
  11394. }
  11395. function isKey(value, object) {
  11396. if (isArray2(value)) {
  11397. return false;
  11398. }
  11399. var type = typeof value;
  11400. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) {
  11401. return true;
  11402. }
  11403. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
  11404. }
  11405. function isKeyable(value) {
  11406. var type = typeof value;
  11407. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  11408. }
  11409. function isLaziable(func) {
  11410. var funcName = getFuncName(func), other = lodash2[funcName];
  11411. if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
  11412. return false;
  11413. }
  11414. if (func === other) {
  11415. return true;
  11416. }
  11417. var data = getData(other);
  11418. return !!data && func === data[0];
  11419. }
  11420. function isMasked(func) {
  11421. return !!maskSrcKey && maskSrcKey in func;
  11422. }
  11423. var isMaskable = coreJsData ? isFunction2 : stubFalse;
  11424. function isPrototype(value) {
  11425. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  11426. return value === proto;
  11427. }
  11428. function isStrictComparable(value) {
  11429. return value === value && !isObject2(value);
  11430. }
  11431. function matchesStrictComparable(key, srcValue) {
  11432. return function(object) {
  11433. if (object == null) {
  11434. return false;
  11435. }
  11436. return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
  11437. };
  11438. }
  11439. function memoizeCapped(func) {
  11440. var result3 = memoize(func, function(key) {
  11441. if (cache.size === MAX_MEMOIZE_SIZE) {
  11442. cache.clear();
  11443. }
  11444. return key;
  11445. });
  11446. var cache = result3.cache;
  11447. return result3;
  11448. }
  11449. function mergeData(data, source) {
  11450. var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  11451. var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
  11452. if (!(isCommon || isCombo)) {
  11453. return data;
  11454. }
  11455. if (srcBitmask & WRAP_BIND_FLAG) {
  11456. data[2] = source[2];
  11457. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  11458. }
  11459. var value = source[3];
  11460. if (value) {
  11461. var partials = data[3];
  11462. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  11463. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  11464. }
  11465. value = source[5];
  11466. if (value) {
  11467. partials = data[5];
  11468. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  11469. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  11470. }
  11471. value = source[7];
  11472. if (value) {
  11473. data[7] = value;
  11474. }
  11475. if (srcBitmask & WRAP_ARY_FLAG) {
  11476. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  11477. }
  11478. if (data[9] == null) {
  11479. data[9] = source[9];
  11480. }
  11481. data[0] = source[0];
  11482. data[1] = newBitmask;
  11483. return data;
  11484. }
  11485. function nativeKeysIn(object) {
  11486. var result3 = [];
  11487. if (object != null) {
  11488. for (var key in Object2(object)) {
  11489. result3.push(key);
  11490. }
  11491. }
  11492. return result3;
  11493. }
  11494. function objectToString2(value) {
  11495. return nativeObjectToString.call(value);
  11496. }
  11497. function overRest(func, start, transform2) {
  11498. start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
  11499. return function() {
  11500. var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
  11501. while (++index2 < length) {
  11502. array[index2] = args[start + index2];
  11503. }
  11504. index2 = -1;
  11505. var otherArgs = Array2(start + 1);
  11506. while (++index2 < start) {
  11507. otherArgs[index2] = args[index2];
  11508. }
  11509. otherArgs[start] = transform2(array);
  11510. return apply(func, this, otherArgs);
  11511. };
  11512. }
  11513. function parent(object, path) {
  11514. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  11515. }
  11516. function reorder(array, indexes) {
  11517. var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
  11518. while (length--) {
  11519. var index2 = indexes[length];
  11520. array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined$1;
  11521. }
  11522. return array;
  11523. }
  11524. function safeGet(object, key) {
  11525. if (key === "constructor" && typeof object[key] === "function") {
  11526. return;
  11527. }
  11528. if (key == "__proto__") {
  11529. return;
  11530. }
  11531. return object[key];
  11532. }
  11533. var setData = shortOut(baseSetData);
  11534. var setTimeout2 = ctxSetTimeout || function(func, wait) {
  11535. return root.setTimeout(func, wait);
  11536. };
  11537. var setToString = shortOut(baseSetToString);
  11538. function setWrapToString(wrapper, reference, bitmask) {
  11539. var source = reference + "";
  11540. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  11541. }
  11542. function shortOut(func) {
  11543. var count = 0, lastCalled = 0;
  11544. return function() {
  11545. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  11546. lastCalled = stamp;
  11547. if (remaining > 0) {
  11548. if (++count >= HOT_COUNT) {
  11549. return arguments[0];
  11550. }
  11551. } else {
  11552. count = 0;
  11553. }
  11554. return func.apply(undefined$1, arguments);
  11555. };
  11556. }
  11557. function shuffleSelf(array, size3) {
  11558. var index2 = -1, length = array.length, lastIndex = length - 1;
  11559. size3 = size3 === undefined$1 ? length : size3;
  11560. while (++index2 < size3) {
  11561. var rand = baseRandom(index2, lastIndex), value = array[rand];
  11562. array[rand] = array[index2];
  11563. array[index2] = value;
  11564. }
  11565. array.length = size3;
  11566. return array;
  11567. }
  11568. var stringToPath = memoizeCapped(function(string) {
  11569. var result3 = [];
  11570. if (string.charCodeAt(0) === 46) {
  11571. result3.push("");
  11572. }
  11573. string.replace(rePropName, function(match, number, quote, subString) {
  11574. result3.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  11575. });
  11576. return result3;
  11577. });
  11578. function toKey(value) {
  11579. if (typeof value == "string" || isSymbol2(value)) {
  11580. return value;
  11581. }
  11582. var result3 = value + "";
  11583. return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
  11584. }
  11585. function toSource(func) {
  11586. if (func != null) {
  11587. try {
  11588. return funcToString.call(func);
  11589. } catch (e2) {
  11590. }
  11591. try {
  11592. return func + "";
  11593. } catch (e2) {
  11594. }
  11595. }
  11596. return "";
  11597. }
  11598. function updateWrapDetails(details, bitmask) {
  11599. arrayEach(wrapFlags, function(pair) {
  11600. var value = "_." + pair[0];
  11601. if (bitmask & pair[1] && !arrayIncludes(details, value)) {
  11602. details.push(value);
  11603. }
  11604. });
  11605. return details.sort();
  11606. }
  11607. function wrapperClone(wrapper) {
  11608. if (wrapper instanceof LazyWrapper) {
  11609. return wrapper.clone();
  11610. }
  11611. var result3 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  11612. result3.__actions__ = copyArray(wrapper.__actions__);
  11613. result3.__index__ = wrapper.__index__;
  11614. result3.__values__ = wrapper.__values__;
  11615. return result3;
  11616. }
  11617. function chunk(array, size3, guard) {
  11618. if (guard ? isIterateeCall(array, size3, guard) : size3 === undefined$1) {
  11619. size3 = 1;
  11620. } else {
  11621. size3 = nativeMax(toInteger(size3), 0);
  11622. }
  11623. var length = array == null ? 0 : array.length;
  11624. if (!length || size3 < 1) {
  11625. return [];
  11626. }
  11627. var index2 = 0, resIndex = 0, result3 = Array2(nativeCeil(length / size3));
  11628. while (index2 < length) {
  11629. result3[resIndex++] = baseSlice(array, index2, index2 += size3);
  11630. }
  11631. return result3;
  11632. }
  11633. function compact(array) {
  11634. var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result3 = [];
  11635. while (++index2 < length) {
  11636. var value = array[index2];
  11637. if (value) {
  11638. result3[resIndex++] = value;
  11639. }
  11640. }
  11641. return result3;
  11642. }
  11643. function concat() {
  11644. var length = arguments.length;
  11645. if (!length) {
  11646. return [];
  11647. }
  11648. var args = Array2(length - 1), array = arguments[0], index2 = length;
  11649. while (index2--) {
  11650. args[index2 - 1] = arguments[index2];
  11651. }
  11652. return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  11653. }
  11654. var difference = baseRest(function(array, values2) {
  11655. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
  11656. });
  11657. var differenceBy = baseRest(function(array, values2) {
  11658. var iteratee2 = last(values2);
  11659. if (isArrayLikeObject(iteratee2)) {
  11660. iteratee2 = undefined$1;
  11661. }
  11662. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
  11663. });
  11664. var differenceWith = baseRest(function(array, values2) {
  11665. var comparator2 = last(values2);
  11666. if (isArrayLikeObject(comparator2)) {
  11667. comparator2 = undefined$1;
  11668. }
  11669. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator2) : [];
  11670. });
  11671. function drop(array, n2, guard) {
  11672. var length = array == null ? 0 : array.length;
  11673. if (!length) {
  11674. return [];
  11675. }
  11676. n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
  11677. return baseSlice(array, n2 < 0 ? 0 : n2, length);
  11678. }
  11679. function dropRight(array, n2, guard) {
  11680. var length = array == null ? 0 : array.length;
  11681. if (!length) {
  11682. return [];
  11683. }
  11684. n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
  11685. n2 = length - n2;
  11686. return baseSlice(array, 0, n2 < 0 ? 0 : n2);
  11687. }
  11688. function dropRightWhile(array, predicate) {
  11689. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
  11690. }
  11691. function dropWhile(array, predicate) {
  11692. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
  11693. }
  11694. function fill(array, value, start, end) {
  11695. var length = array == null ? 0 : array.length;
  11696. if (!length) {
  11697. return [];
  11698. }
  11699. if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
  11700. start = 0;
  11701. end = length;
  11702. }
  11703. return baseFill(array, value, start, end);
  11704. }
  11705. function findIndex(array, predicate, fromIndex) {
  11706. var length = array == null ? 0 : array.length;
  11707. if (!length) {
  11708. return -1;
  11709. }
  11710. var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
  11711. if (index2 < 0) {
  11712. index2 = nativeMax(length + index2, 0);
  11713. }
  11714. return baseFindIndex(array, getIteratee(predicate, 3), index2);
  11715. }
  11716. function findLastIndex(array, predicate, fromIndex) {
  11717. var length = array == null ? 0 : array.length;
  11718. if (!length) {
  11719. return -1;
  11720. }
  11721. var index2 = length - 1;
  11722. if (fromIndex !== undefined$1) {
  11723. index2 = toInteger(fromIndex);
  11724. index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
  11725. }
  11726. return baseFindIndex(array, getIteratee(predicate, 3), index2, true);
  11727. }
  11728. function flatten(array) {
  11729. var length = array == null ? 0 : array.length;
  11730. return length ? baseFlatten(array, 1) : [];
  11731. }
  11732. function flattenDeep(array) {
  11733. var length = array == null ? 0 : array.length;
  11734. return length ? baseFlatten(array, INFINITY) : [];
  11735. }
  11736. function flattenDepth(array, depth) {
  11737. var length = array == null ? 0 : array.length;
  11738. if (!length) {
  11739. return [];
  11740. }
  11741. depth = depth === undefined$1 ? 1 : toInteger(depth);
  11742. return baseFlatten(array, depth);
  11743. }
  11744. function fromPairs(pairs) {
  11745. var index2 = -1, length = pairs == null ? 0 : pairs.length, result3 = {};
  11746. while (++index2 < length) {
  11747. var pair = pairs[index2];
  11748. result3[pair[0]] = pair[1];
  11749. }
  11750. return result3;
  11751. }
  11752. function head(array) {
  11753. return array && array.length ? array[0] : undefined$1;
  11754. }
  11755. function indexOf(array, value, fromIndex) {
  11756. var length = array == null ? 0 : array.length;
  11757. if (!length) {
  11758. return -1;
  11759. }
  11760. var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
  11761. if (index2 < 0) {
  11762. index2 = nativeMax(length + index2, 0);
  11763. }
  11764. return baseIndexOf(array, value, index2);
  11765. }
  11766. function initial(array) {
  11767. var length = array == null ? 0 : array.length;
  11768. return length ? baseSlice(array, 0, -1) : [];
  11769. }
  11770. var intersection = baseRest(function(arrays) {
  11771. var mapped = arrayMap(arrays, castArrayLikeObject);
  11772. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
  11773. });
  11774. var intersectionBy = baseRest(function(arrays) {
  11775. var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  11776. if (iteratee2 === last(mapped)) {
  11777. iteratee2 = undefined$1;
  11778. } else {
  11779. mapped.pop();
  11780. }
  11781. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
  11782. });
  11783. var intersectionWith = baseRest(function(arrays) {
  11784. var comparator2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  11785. comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
  11786. if (comparator2) {
  11787. mapped.pop();
  11788. }
  11789. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator2) : [];
  11790. });
  11791. function join(array, separator) {
  11792. return array == null ? "" : nativeJoin.call(array, separator);
  11793. }
  11794. function last(array) {
  11795. var length = array == null ? 0 : array.length;
  11796. return length ? array[length - 1] : undefined$1;
  11797. }
  11798. function lastIndexOf(array, value, fromIndex) {
  11799. var length = array == null ? 0 : array.length;
  11800. if (!length) {
  11801. return -1;
  11802. }
  11803. var index2 = length;
  11804. if (fromIndex !== undefined$1) {
  11805. index2 = toInteger(fromIndex);
  11806. index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
  11807. }
  11808. return value === value ? strictLastIndexOf(array, value, index2) : baseFindIndex(array, baseIsNaN, index2, true);
  11809. }
  11810. function nth(array, n2) {
  11811. return array && array.length ? baseNth(array, toInteger(n2)) : undefined$1;
  11812. }
  11813. var pull = baseRest(pullAll);
  11814. function pullAll(array, values2) {
  11815. return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
  11816. }
  11817. function pullAllBy(array, values2, iteratee2) {
  11818. return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
  11819. }
  11820. function pullAllWith(array, values2, comparator2) {
  11821. return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator2) : array;
  11822. }
  11823. var pullAt = flatRest(function(array, indexes) {
  11824. var length = array == null ? 0 : array.length, result3 = baseAt(array, indexes);
  11825. basePullAt(array, arrayMap(indexes, function(index2) {
  11826. return isIndex(index2, length) ? +index2 : index2;
  11827. }).sort(compareAscending));
  11828. return result3;
  11829. });
  11830. function remove2(array, predicate) {
  11831. var result3 = [];
  11832. if (!(array && array.length)) {
  11833. return result3;
  11834. }
  11835. var index2 = -1, indexes = [], length = array.length;
  11836. predicate = getIteratee(predicate, 3);
  11837. while (++index2 < length) {
  11838. var value = array[index2];
  11839. if (predicate(value, index2, array)) {
  11840. result3.push(value);
  11841. indexes.push(index2);
  11842. }
  11843. }
  11844. basePullAt(array, indexes);
  11845. return result3;
  11846. }
  11847. function reverse(array) {
  11848. return array == null ? array : nativeReverse.call(array);
  11849. }
  11850. function slice(array, start, end) {
  11851. var length = array == null ? 0 : array.length;
  11852. if (!length) {
  11853. return [];
  11854. }
  11855. if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
  11856. start = 0;
  11857. end = length;
  11858. } else {
  11859. start = start == null ? 0 : toInteger(start);
  11860. end = end === undefined$1 ? length : toInteger(end);
  11861. }
  11862. return baseSlice(array, start, end);
  11863. }
  11864. function sortedIndex(array, value) {
  11865. return baseSortedIndex(array, value);
  11866. }
  11867. function sortedIndexBy(array, value, iteratee2) {
  11868. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
  11869. }
  11870. function sortedIndexOf(array, value) {
  11871. var length = array == null ? 0 : array.length;
  11872. if (length) {
  11873. var index2 = baseSortedIndex(array, value);
  11874. if (index2 < length && eq(array[index2], value)) {
  11875. return index2;
  11876. }
  11877. }
  11878. return -1;
  11879. }
  11880. function sortedLastIndex(array, value) {
  11881. return baseSortedIndex(array, value, true);
  11882. }
  11883. function sortedLastIndexBy(array, value, iteratee2) {
  11884. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
  11885. }
  11886. function sortedLastIndexOf(array, value) {
  11887. var length = array == null ? 0 : array.length;
  11888. if (length) {
  11889. var index2 = baseSortedIndex(array, value, true) - 1;
  11890. if (eq(array[index2], value)) {
  11891. return index2;
  11892. }
  11893. }
  11894. return -1;
  11895. }
  11896. function sortedUniq(array) {
  11897. return array && array.length ? baseSortedUniq(array) : [];
  11898. }
  11899. function sortedUniqBy(array, iteratee2) {
  11900. return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
  11901. }
  11902. function tail(array) {
  11903. var length = array == null ? 0 : array.length;
  11904. return length ? baseSlice(array, 1, length) : [];
  11905. }
  11906. function take(array, n2, guard) {
  11907. if (!(array && array.length)) {
  11908. return [];
  11909. }
  11910. n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
  11911. return baseSlice(array, 0, n2 < 0 ? 0 : n2);
  11912. }
  11913. function takeRight(array, n2, guard) {
  11914. var length = array == null ? 0 : array.length;
  11915. if (!length) {
  11916. return [];
  11917. }
  11918. n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
  11919. n2 = length - n2;
  11920. return baseSlice(array, n2 < 0 ? 0 : n2, length);
  11921. }
  11922. function takeRightWhile(array, predicate) {
  11923. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
  11924. }
  11925. function takeWhile(array, predicate) {
  11926. return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
  11927. }
  11928. var union = baseRest(function(arrays) {
  11929. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  11930. });
  11931. var unionBy = baseRest(function(arrays) {
  11932. var iteratee2 = last(arrays);
  11933. if (isArrayLikeObject(iteratee2)) {
  11934. iteratee2 = undefined$1;
  11935. }
  11936. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
  11937. });
  11938. var unionWith = baseRest(function(arrays) {
  11939. var comparator2 = last(arrays);
  11940. comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
  11941. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator2);
  11942. });
  11943. function uniq(array) {
  11944. return array && array.length ? baseUniq(array) : [];
  11945. }
  11946. function uniqBy(array, iteratee2) {
  11947. return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
  11948. }
  11949. function uniqWith(array, comparator2) {
  11950. comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
  11951. return array && array.length ? baseUniq(array, undefined$1, comparator2) : [];
  11952. }
  11953. function unzip(array) {
  11954. if (!(array && array.length)) {
  11955. return [];
  11956. }
  11957. var length = 0;
  11958. array = arrayFilter(array, function(group) {
  11959. if (isArrayLikeObject(group)) {
  11960. length = nativeMax(group.length, length);
  11961. return true;
  11962. }
  11963. });
  11964. return baseTimes(length, function(index2) {
  11965. return arrayMap(array, baseProperty(index2));
  11966. });
  11967. }
  11968. function unzipWith(array, iteratee2) {
  11969. if (!(array && array.length)) {
  11970. return [];
  11971. }
  11972. var result3 = unzip(array);
  11973. if (iteratee2 == null) {
  11974. return result3;
  11975. }
  11976. return arrayMap(result3, function(group) {
  11977. return apply(iteratee2, undefined$1, group);
  11978. });
  11979. }
  11980. var without = baseRest(function(array, values2) {
  11981. return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
  11982. });
  11983. var xor = baseRest(function(arrays) {
  11984. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  11985. });
  11986. var xorBy = baseRest(function(arrays) {
  11987. var iteratee2 = last(arrays);
  11988. if (isArrayLikeObject(iteratee2)) {
  11989. iteratee2 = undefined$1;
  11990. }
  11991. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
  11992. });
  11993. var xorWith = baseRest(function(arrays) {
  11994. var comparator2 = last(arrays);
  11995. comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
  11996. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator2);
  11997. });
  11998. var zip = baseRest(unzip);
  11999. function zipObject(props, values2) {
  12000. return baseZipObject(props || [], values2 || [], assignValue);
  12001. }
  12002. function zipObjectDeep(props, values2) {
  12003. return baseZipObject(props || [], values2 || [], baseSet);
  12004. }
  12005. var zipWith = baseRest(function(arrays) {
  12006. var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
  12007. iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
  12008. return unzipWith(arrays, iteratee2);
  12009. });
  12010. function chain(value) {
  12011. var result3 = lodash2(value);
  12012. result3.__chain__ = true;
  12013. return result3;
  12014. }
  12015. function tap(value, interceptor) {
  12016. interceptor(value);
  12017. return value;
  12018. }
  12019. function thru(value, interceptor) {
  12020. return interceptor(value);
  12021. }
  12022. var wrapperAt = flatRest(function(paths) {
  12023. var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
  12024. return baseAt(object, paths);
  12025. };
  12026. if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
  12027. return this.thru(interceptor);
  12028. }
  12029. value = value.slice(start, +start + (length ? 1 : 0));
  12030. value.__actions__.push({
  12031. "func": thru,
  12032. "args": [interceptor],
  12033. "thisArg": undefined$1
  12034. });
  12035. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  12036. if (length && !array.length) {
  12037. array.push(undefined$1);
  12038. }
  12039. return array;
  12040. });
  12041. });
  12042. function wrapperChain() {
  12043. return chain(this);
  12044. }
  12045. function wrapperCommit() {
  12046. return new LodashWrapper(this.value(), this.__chain__);
  12047. }
  12048. function wrapperNext() {
  12049. if (this.__values__ === undefined$1) {
  12050. this.__values__ = toArray(this.value());
  12051. }
  12052. var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
  12053. return { "done": done, "value": value };
  12054. }
  12055. function wrapperToIterator() {
  12056. return this;
  12057. }
  12058. function wrapperPlant(value) {
  12059. var result3, parent2 = this;
  12060. while (parent2 instanceof baseLodash) {
  12061. var clone3 = wrapperClone(parent2);
  12062. clone3.__index__ = 0;
  12063. clone3.__values__ = undefined$1;
  12064. if (result3) {
  12065. previous.__wrapped__ = clone3;
  12066. } else {
  12067. result3 = clone3;
  12068. }
  12069. var previous = clone3;
  12070. parent2 = parent2.__wrapped__;
  12071. }
  12072. previous.__wrapped__ = value;
  12073. return result3;
  12074. }
  12075. function wrapperReverse() {
  12076. var value = this.__wrapped__;
  12077. if (value instanceof LazyWrapper) {
  12078. var wrapped = value;
  12079. if (this.__actions__.length) {
  12080. wrapped = new LazyWrapper(this);
  12081. }
  12082. wrapped = wrapped.reverse();
  12083. wrapped.__actions__.push({
  12084. "func": thru,
  12085. "args": [reverse],
  12086. "thisArg": undefined$1
  12087. });
  12088. return new LodashWrapper(wrapped, this.__chain__);
  12089. }
  12090. return this.thru(reverse);
  12091. }
  12092. function wrapperValue() {
  12093. return baseWrapperValue(this.__wrapped__, this.__actions__);
  12094. }
  12095. var countBy = createAggregator(function(result3, value, key) {
  12096. if (hasOwnProperty2.call(result3, key)) {
  12097. ++result3[key];
  12098. } else {
  12099. baseAssignValue(result3, key, 1);
  12100. }
  12101. });
  12102. function every(collection, predicate, guard) {
  12103. var func = isArray2(collection) ? arrayEvery : baseEvery;
  12104. if (guard && isIterateeCall(collection, predicate, guard)) {
  12105. predicate = undefined$1;
  12106. }
  12107. return func(collection, getIteratee(predicate, 3));
  12108. }
  12109. function filter(collection, predicate) {
  12110. var func = isArray2(collection) ? arrayFilter : baseFilter;
  12111. return func(collection, getIteratee(predicate, 3));
  12112. }
  12113. var find = createFind(findIndex);
  12114. var findLast = createFind(findLastIndex);
  12115. function flatMap(collection, iteratee2) {
  12116. return baseFlatten(map(collection, iteratee2), 1);
  12117. }
  12118. function flatMapDeep(collection, iteratee2) {
  12119. return baseFlatten(map(collection, iteratee2), INFINITY);
  12120. }
  12121. function flatMapDepth(collection, iteratee2, depth) {
  12122. depth = depth === undefined$1 ? 1 : toInteger(depth);
  12123. return baseFlatten(map(collection, iteratee2), depth);
  12124. }
  12125. function forEach3(collection, iteratee2) {
  12126. var func = isArray2(collection) ? arrayEach : baseEach;
  12127. return func(collection, getIteratee(iteratee2, 3));
  12128. }
  12129. function forEachRight(collection, iteratee2) {
  12130. var func = isArray2(collection) ? arrayEachRight : baseEachRight;
  12131. return func(collection, getIteratee(iteratee2, 3));
  12132. }
  12133. var groupBy = createAggregator(function(result3, value, key) {
  12134. if (hasOwnProperty2.call(result3, key)) {
  12135. result3[key].push(value);
  12136. } else {
  12137. baseAssignValue(result3, key, [value]);
  12138. }
  12139. });
  12140. function includes(collection, value, fromIndex, guard) {
  12141. collection = isArrayLike(collection) ? collection : values(collection);
  12142. fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
  12143. var length = collection.length;
  12144. if (fromIndex < 0) {
  12145. fromIndex = nativeMax(length + fromIndex, 0);
  12146. }
  12147. return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
  12148. }
  12149. var invokeMap = baseRest(function(collection, path, args) {
  12150. var index2 = -1, isFunc = typeof path == "function", result3 = isArrayLike(collection) ? Array2(collection.length) : [];
  12151. baseEach(collection, function(value) {
  12152. result3[++index2] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  12153. });
  12154. return result3;
  12155. });
  12156. var keyBy = createAggregator(function(result3, value, key) {
  12157. baseAssignValue(result3, key, value);
  12158. });
  12159. function map(collection, iteratee2) {
  12160. var func = isArray2(collection) ? arrayMap : baseMap;
  12161. return func(collection, getIteratee(iteratee2, 3));
  12162. }
  12163. function orderBy(collection, iteratees, orders, guard) {
  12164. if (collection == null) {
  12165. return [];
  12166. }
  12167. if (!isArray2(iteratees)) {
  12168. iteratees = iteratees == null ? [] : [iteratees];
  12169. }
  12170. orders = guard ? undefined$1 : orders;
  12171. if (!isArray2(orders)) {
  12172. orders = orders == null ? [] : [orders];
  12173. }
  12174. return baseOrderBy(collection, iteratees, orders);
  12175. }
  12176. var partition = createAggregator(function(result3, value, key) {
  12177. result3[key ? 0 : 1].push(value);
  12178. }, function() {
  12179. return [[], []];
  12180. });
  12181. function reduce(collection, iteratee2, accumulator) {
  12182. var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
  12183. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
  12184. }
  12185. function reduceRight(collection, iteratee2, accumulator) {
  12186. var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
  12187. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
  12188. }
  12189. function reject(collection, predicate) {
  12190. var func = isArray2(collection) ? arrayFilter : baseFilter;
  12191. return func(collection, negate(getIteratee(predicate, 3)));
  12192. }
  12193. function sample(collection) {
  12194. var func = isArray2(collection) ? arraySample : baseSample;
  12195. return func(collection);
  12196. }
  12197. function sampleSize(collection, n2, guard) {
  12198. if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined$1) {
  12199. n2 = 1;
  12200. } else {
  12201. n2 = toInteger(n2);
  12202. }
  12203. var func = isArray2(collection) ? arraySampleSize : baseSampleSize;
  12204. return func(collection, n2);
  12205. }
  12206. function shuffle(collection) {
  12207. var func = isArray2(collection) ? arrayShuffle : baseShuffle;
  12208. return func(collection);
  12209. }
  12210. function size2(collection) {
  12211. if (collection == null) {
  12212. return 0;
  12213. }
  12214. if (isArrayLike(collection)) {
  12215. return isString2(collection) ? stringSize(collection) : collection.length;
  12216. }
  12217. var tag = getTag(collection);
  12218. if (tag == mapTag || tag == setTag) {
  12219. return collection.size;
  12220. }
  12221. return baseKeys(collection).length;
  12222. }
  12223. function some(collection, predicate, guard) {
  12224. var func = isArray2(collection) ? arraySome : baseSome;
  12225. if (guard && isIterateeCall(collection, predicate, guard)) {
  12226. predicate = undefined$1;
  12227. }
  12228. return func(collection, getIteratee(predicate, 3));
  12229. }
  12230. var sortBy = baseRest(function(collection, iteratees) {
  12231. if (collection == null) {
  12232. return [];
  12233. }
  12234. var length = iteratees.length;
  12235. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  12236. iteratees = [];
  12237. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  12238. iteratees = [iteratees[0]];
  12239. }
  12240. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  12241. });
  12242. var now = ctxNow || function() {
  12243. return root.Date.now();
  12244. };
  12245. function after(n2, func) {
  12246. if (typeof func != "function") {
  12247. throw new TypeError2(FUNC_ERROR_TEXT);
  12248. }
  12249. n2 = toInteger(n2);
  12250. return function() {
  12251. if (--n2 < 1) {
  12252. return func.apply(this, arguments);
  12253. }
  12254. };
  12255. }
  12256. function ary(func, n2, guard) {
  12257. n2 = guard ? undefined$1 : n2;
  12258. n2 = func && n2 == null ? func.length : n2;
  12259. return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n2);
  12260. }
  12261. function before(n2, func) {
  12262. var result3;
  12263. if (typeof func != "function") {
  12264. throw new TypeError2(FUNC_ERROR_TEXT);
  12265. }
  12266. n2 = toInteger(n2);
  12267. return function() {
  12268. if (--n2 > 0) {
  12269. result3 = func.apply(this, arguments);
  12270. }
  12271. if (n2 <= 1) {
  12272. func = undefined$1;
  12273. }
  12274. return result3;
  12275. };
  12276. }
  12277. var bind = baseRest(function(func, thisArg, partials) {
  12278. var bitmask = WRAP_BIND_FLAG;
  12279. if (partials.length) {
  12280. var holders = replaceHolders(partials, getHolder(bind));
  12281. bitmask |= WRAP_PARTIAL_FLAG;
  12282. }
  12283. return createWrap(func, bitmask, thisArg, partials, holders);
  12284. });
  12285. var bindKey = baseRest(function(object, key, partials) {
  12286. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  12287. if (partials.length) {
  12288. var holders = replaceHolders(partials, getHolder(bindKey));
  12289. bitmask |= WRAP_PARTIAL_FLAG;
  12290. }
  12291. return createWrap(key, bitmask, object, partials, holders);
  12292. });
  12293. function curry(func, arity, guard) {
  12294. arity = guard ? undefined$1 : arity;
  12295. var result3 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
  12296. result3.placeholder = curry.placeholder;
  12297. return result3;
  12298. }
  12299. function curryRight(func, arity, guard) {
  12300. arity = guard ? undefined$1 : arity;
  12301. var result3 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
  12302. result3.placeholder = curryRight.placeholder;
  12303. return result3;
  12304. }
  12305. function debounce(func, wait, options) {
  12306. var lastArgs, lastThis, maxWait, result3, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  12307. if (typeof func != "function") {
  12308. throw new TypeError2(FUNC_ERROR_TEXT);
  12309. }
  12310. wait = toNumber2(wait) || 0;
  12311. if (isObject2(options)) {
  12312. leading = !!options.leading;
  12313. maxing = "maxWait" in options;
  12314. maxWait = maxing ? nativeMax(toNumber2(options.maxWait) || 0, wait) : maxWait;
  12315. trailing = "trailing" in options ? !!options.trailing : trailing;
  12316. }
  12317. function invokeFunc(time) {
  12318. var args = lastArgs, thisArg = lastThis;
  12319. lastArgs = lastThis = undefined$1;
  12320. lastInvokeTime = time;
  12321. result3 = func.apply(thisArg, args);
  12322. return result3;
  12323. }
  12324. function leadingEdge(time) {
  12325. lastInvokeTime = time;
  12326. timerId = setTimeout2(timerExpired, wait);
  12327. return leading ? invokeFunc(time) : result3;
  12328. }
  12329. function remainingWait(time) {
  12330. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  12331. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  12332. }
  12333. function shouldInvoke(time) {
  12334. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  12335. return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  12336. }
  12337. function timerExpired() {
  12338. var time = now();
  12339. if (shouldInvoke(time)) {
  12340. return trailingEdge(time);
  12341. }
  12342. timerId = setTimeout2(timerExpired, remainingWait(time));
  12343. }
  12344. function trailingEdge(time) {
  12345. timerId = undefined$1;
  12346. if (trailing && lastArgs) {
  12347. return invokeFunc(time);
  12348. }
  12349. lastArgs = lastThis = undefined$1;
  12350. return result3;
  12351. }
  12352. function cancel() {
  12353. if (timerId !== undefined$1) {
  12354. clearTimeout2(timerId);
  12355. }
  12356. lastInvokeTime = 0;
  12357. lastArgs = lastCallTime = lastThis = timerId = undefined$1;
  12358. }
  12359. function flush() {
  12360. return timerId === undefined$1 ? result3 : trailingEdge(now());
  12361. }
  12362. function debounced() {
  12363. var time = now(), isInvoking = shouldInvoke(time);
  12364. lastArgs = arguments;
  12365. lastThis = this;
  12366. lastCallTime = time;
  12367. if (isInvoking) {
  12368. if (timerId === undefined$1) {
  12369. return leadingEdge(lastCallTime);
  12370. }
  12371. if (maxing) {
  12372. clearTimeout2(timerId);
  12373. timerId = setTimeout2(timerExpired, wait);
  12374. return invokeFunc(lastCallTime);
  12375. }
  12376. }
  12377. if (timerId === undefined$1) {
  12378. timerId = setTimeout2(timerExpired, wait);
  12379. }
  12380. return result3;
  12381. }
  12382. debounced.cancel = cancel;
  12383. debounced.flush = flush;
  12384. return debounced;
  12385. }
  12386. var defer = baseRest(function(func, args) {
  12387. return baseDelay(func, 1, args);
  12388. });
  12389. var delay = baseRest(function(func, wait, args) {
  12390. return baseDelay(func, toNumber2(wait) || 0, args);
  12391. });
  12392. function flip(func) {
  12393. return createWrap(func, WRAP_FLIP_FLAG);
  12394. }
  12395. function memoize(func, resolver) {
  12396. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  12397. throw new TypeError2(FUNC_ERROR_TEXT);
  12398. }
  12399. var memoized = function() {
  12400. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  12401. if (cache.has(key)) {
  12402. return cache.get(key);
  12403. }
  12404. var result3 = func.apply(this, args);
  12405. memoized.cache = cache.set(key, result3) || cache;
  12406. return result3;
  12407. };
  12408. memoized.cache = new (memoize.Cache || MapCache)();
  12409. return memoized;
  12410. }
  12411. memoize.Cache = MapCache;
  12412. function negate(predicate) {
  12413. if (typeof predicate != "function") {
  12414. throw new TypeError2(FUNC_ERROR_TEXT);
  12415. }
  12416. return function() {
  12417. var args = arguments;
  12418. switch (args.length) {
  12419. case 0:
  12420. return !predicate.call(this);
  12421. case 1:
  12422. return !predicate.call(this, args[0]);
  12423. case 2:
  12424. return !predicate.call(this, args[0], args[1]);
  12425. case 3:
  12426. return !predicate.call(this, args[0], args[1], args[2]);
  12427. }
  12428. return !predicate.apply(this, args);
  12429. };
  12430. }
  12431. function once2(func) {
  12432. return before(2, func);
  12433. }
  12434. var overArgs = castRest(function(func, transforms) {
  12435. transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  12436. var funcsLength = transforms.length;
  12437. return baseRest(function(args) {
  12438. var index2 = -1, length = nativeMin(args.length, funcsLength);
  12439. while (++index2 < length) {
  12440. args[index2] = transforms[index2].call(this, args[index2]);
  12441. }
  12442. return apply(func, this, args);
  12443. });
  12444. });
  12445. var partial = baseRest(function(func, partials) {
  12446. var holders = replaceHolders(partials, getHolder(partial));
  12447. return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
  12448. });
  12449. var partialRight = baseRest(function(func, partials) {
  12450. var holders = replaceHolders(partials, getHolder(partialRight));
  12451. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
  12452. });
  12453. var rearg = flatRest(function(func, indexes) {
  12454. return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
  12455. });
  12456. function rest(func, start) {
  12457. if (typeof func != "function") {
  12458. throw new TypeError2(FUNC_ERROR_TEXT);
  12459. }
  12460. start = start === undefined$1 ? start : toInteger(start);
  12461. return baseRest(func, start);
  12462. }
  12463. function spread(func, start) {
  12464. if (typeof func != "function") {
  12465. throw new TypeError2(FUNC_ERROR_TEXT);
  12466. }
  12467. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  12468. return baseRest(function(args) {
  12469. var array = args[start], otherArgs = castSlice(args, 0, start);
  12470. if (array) {
  12471. arrayPush(otherArgs, array);
  12472. }
  12473. return apply(func, this, otherArgs);
  12474. });
  12475. }
  12476. function throttle(func, wait, options) {
  12477. var leading = true, trailing = true;
  12478. if (typeof func != "function") {
  12479. throw new TypeError2(FUNC_ERROR_TEXT);
  12480. }
  12481. if (isObject2(options)) {
  12482. leading = "leading" in options ? !!options.leading : leading;
  12483. trailing = "trailing" in options ? !!options.trailing : trailing;
  12484. }
  12485. return debounce(func, wait, {
  12486. "leading": leading,
  12487. "maxWait": wait,
  12488. "trailing": trailing
  12489. });
  12490. }
  12491. function unary(func) {
  12492. return ary(func, 1);
  12493. }
  12494. function wrap(value, wrapper) {
  12495. return partial(castFunction(wrapper), value);
  12496. }
  12497. function castArray() {
  12498. if (!arguments.length) {
  12499. return [];
  12500. }
  12501. var value = arguments[0];
  12502. return isArray2(value) ? value : [value];
  12503. }
  12504. function clone2(value) {
  12505. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12506. }
  12507. function cloneWith(value, customizer) {
  12508. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12509. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12510. }
  12511. function cloneDeep(value) {
  12512. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12513. }
  12514. function cloneDeepWith(value, customizer) {
  12515. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12516. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12517. }
  12518. function conformsTo(object, source) {
  12519. return source == null || baseConformsTo(object, source, keys(source));
  12520. }
  12521. function eq(value, other) {
  12522. return value === other || value !== value && other !== other;
  12523. }
  12524. var gt2 = createRelationalOperation(baseGt);
  12525. var gte = createRelationalOperation(function(value, other) {
  12526. return value >= other;
  12527. });
  12528. var isArguments = baseIsArguments(function() {
  12529. return arguments;
  12530. }()) ? baseIsArguments : function(value) {
  12531. return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  12532. };
  12533. var isArray2 = Array2.isArray;
  12534. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12535. function isArrayLike(value) {
  12536. return value != null && isLength(value.length) && !isFunction2(value);
  12537. }
  12538. function isArrayLikeObject(value) {
  12539. return isObjectLike(value) && isArrayLike(value);
  12540. }
  12541. function isBoolean2(value) {
  12542. return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
  12543. }
  12544. var isBuffer = nativeIsBuffer || stubFalse;
  12545. var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12546. function isElement(value) {
  12547. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value);
  12548. }
  12549. function isEmpty(value) {
  12550. if (value == null) {
  12551. return true;
  12552. }
  12553. if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12554. return !value.length;
  12555. }
  12556. var tag = getTag(value);
  12557. if (tag == mapTag || tag == setTag) {
  12558. return !value.size;
  12559. }
  12560. if (isPrototype(value)) {
  12561. return !baseKeys(value).length;
  12562. }
  12563. for (var key in value) {
  12564. if (hasOwnProperty2.call(value, key)) {
  12565. return false;
  12566. }
  12567. }
  12568. return true;
  12569. }
  12570. function isEqual(value, other) {
  12571. return baseIsEqual(value, other);
  12572. }
  12573. function isEqualWith(value, other, customizer) {
  12574. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12575. var result3 = customizer ? customizer(value, other) : undefined$1;
  12576. return result3 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result3;
  12577. }
  12578. function isError(value) {
  12579. if (!isObjectLike(value)) {
  12580. return false;
  12581. }
  12582. var tag = baseGetTag(value);
  12583. return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value);
  12584. }
  12585. function isFinite2(value) {
  12586. return typeof value == "number" && nativeIsFinite(value);
  12587. }
  12588. function isFunction2(value) {
  12589. if (!isObject2(value)) {
  12590. return false;
  12591. }
  12592. var tag = baseGetTag(value);
  12593. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12594. }
  12595. function isInteger(value) {
  12596. return typeof value == "number" && value == toInteger(value);
  12597. }
  12598. function isLength(value) {
  12599. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12600. }
  12601. function isObject2(value) {
  12602. var type = typeof value;
  12603. return value != null && (type == "object" || type == "function");
  12604. }
  12605. function isObjectLike(value) {
  12606. return value != null && typeof value == "object";
  12607. }
  12608. var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12609. function isMatch(object, source) {
  12610. return object === source || baseIsMatch(object, source, getMatchData(source));
  12611. }
  12612. function isMatchWith(object, source, customizer) {
  12613. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12614. return baseIsMatch(object, source, getMatchData(source), customizer);
  12615. }
  12616. function isNaN2(value) {
  12617. return isNumber(value) && value != +value;
  12618. }
  12619. function isNative(value) {
  12620. if (isMaskable(value)) {
  12621. throw new Error2(CORE_ERROR_TEXT);
  12622. }
  12623. return baseIsNative(value);
  12624. }
  12625. function isNull(value) {
  12626. return value === null;
  12627. }
  12628. function isNil(value) {
  12629. return value == null;
  12630. }
  12631. function isNumber(value) {
  12632. return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
  12633. }
  12634. function isPlainObject2(value) {
  12635. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12636. return false;
  12637. }
  12638. var proto = getPrototype(value);
  12639. if (proto === null) {
  12640. return true;
  12641. }
  12642. var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
  12643. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  12644. }
  12645. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12646. function isSafeInteger(value) {
  12647. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12648. }
  12649. var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12650. function isString2(value) {
  12651. return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
  12652. }
  12653. function isSymbol2(value) {
  12654. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  12655. }
  12656. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12657. function isUndefined2(value) {
  12658. return value === undefined$1;
  12659. }
  12660. function isWeakMap(value) {
  12661. return isObjectLike(value) && getTag(value) == weakMapTag;
  12662. }
  12663. function isWeakSet(value) {
  12664. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12665. }
  12666. var lt2 = createRelationalOperation(baseLt);
  12667. var lte = createRelationalOperation(function(value, other) {
  12668. return value <= other;
  12669. });
  12670. function toArray(value) {
  12671. if (!value) {
  12672. return [];
  12673. }
  12674. if (isArrayLike(value)) {
  12675. return isString2(value) ? stringToArray(value) : copyArray(value);
  12676. }
  12677. if (symIterator && value[symIterator]) {
  12678. return iteratorToArray(value[symIterator]());
  12679. }
  12680. var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
  12681. return func(value);
  12682. }
  12683. function toFinite(value) {
  12684. if (!value) {
  12685. return value === 0 ? value : 0;
  12686. }
  12687. value = toNumber2(value);
  12688. if (value === INFINITY || value === -INFINITY) {
  12689. var sign = value < 0 ? -1 : 1;
  12690. return sign * MAX_INTEGER;
  12691. }
  12692. return value === value ? value : 0;
  12693. }
  12694. function toInteger(value) {
  12695. var result3 = toFinite(value), remainder = result3 % 1;
  12696. return result3 === result3 ? remainder ? result3 - remainder : result3 : 0;
  12697. }
  12698. function toLength(value) {
  12699. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12700. }
  12701. function toNumber2(value) {
  12702. if (typeof value == "number") {
  12703. return value;
  12704. }
  12705. if (isSymbol2(value)) {
  12706. return NAN;
  12707. }
  12708. if (isObject2(value)) {
  12709. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  12710. value = isObject2(other) ? other + "" : other;
  12711. }
  12712. if (typeof value != "string") {
  12713. return value === 0 ? value : +value;
  12714. }
  12715. value = baseTrim(value);
  12716. var isBinary = reIsBinary.test(value);
  12717. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  12718. }
  12719. function toPlainObject(value) {
  12720. return copyObject(value, keysIn(value));
  12721. }
  12722. function toSafeInteger(value) {
  12723. return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
  12724. }
  12725. function toString2(value) {
  12726. return value == null ? "" : baseToString(value);
  12727. }
  12728. var assign2 = createAssigner(function(object, source) {
  12729. if (isPrototype(source) || isArrayLike(source)) {
  12730. copyObject(source, keys(source), object);
  12731. return;
  12732. }
  12733. for (var key in source) {
  12734. if (hasOwnProperty2.call(source, key)) {
  12735. assignValue(object, key, source[key]);
  12736. }
  12737. }
  12738. });
  12739. var assignIn = createAssigner(function(object, source) {
  12740. copyObject(source, keysIn(source), object);
  12741. });
  12742. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  12743. copyObject(source, keysIn(source), object, customizer);
  12744. });
  12745. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  12746. copyObject(source, keys(source), object, customizer);
  12747. });
  12748. var at2 = flatRest(baseAt);
  12749. function create(prototype, properties) {
  12750. var result3 = baseCreate(prototype);
  12751. return properties == null ? result3 : baseAssign(result3, properties);
  12752. }
  12753. var defaults2 = baseRest(function(object, sources) {
  12754. object = Object2(object);
  12755. var index2 = -1;
  12756. var length = sources.length;
  12757. var guard = length > 2 ? sources[2] : undefined$1;
  12758. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  12759. length = 1;
  12760. }
  12761. while (++index2 < length) {
  12762. var source = sources[index2];
  12763. var props = keysIn(source);
  12764. var propsIndex = -1;
  12765. var propsLength = props.length;
  12766. while (++propsIndex < propsLength) {
  12767. var key = props[propsIndex];
  12768. var value = object[key];
  12769. if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
  12770. object[key] = source[key];
  12771. }
  12772. }
  12773. }
  12774. return object;
  12775. });
  12776. var defaultsDeep = baseRest(function(args) {
  12777. args.push(undefined$1, customDefaultsMerge);
  12778. return apply(mergeWith, undefined$1, args);
  12779. });
  12780. function findKey(object, predicate) {
  12781. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  12782. }
  12783. function findLastKey(object, predicate) {
  12784. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  12785. }
  12786. function forIn(object, iteratee2) {
  12787. return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
  12788. }
  12789. function forInRight(object, iteratee2) {
  12790. return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
  12791. }
  12792. function forOwn(object, iteratee2) {
  12793. return object && baseForOwn(object, getIteratee(iteratee2, 3));
  12794. }
  12795. function forOwnRight(object, iteratee2) {
  12796. return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
  12797. }
  12798. function functions(object) {
  12799. return object == null ? [] : baseFunctions(object, keys(object));
  12800. }
  12801. function functionsIn(object) {
  12802. return object == null ? [] : baseFunctions(object, keysIn(object));
  12803. }
  12804. function get2(object, path, defaultValue) {
  12805. var result3 = object == null ? undefined$1 : baseGet(object, path);
  12806. return result3 === undefined$1 ? defaultValue : result3;
  12807. }
  12808. function has2(object, path) {
  12809. return object != null && hasPath(object, path, baseHas);
  12810. }
  12811. function hasIn(object, path) {
  12812. return object != null && hasPath(object, path, baseHasIn);
  12813. }
  12814. var invert = createInverter(function(result3, value, key) {
  12815. if (value != null && typeof value.toString != "function") {
  12816. value = nativeObjectToString.call(value);
  12817. }
  12818. result3[value] = key;
  12819. }, constant(identity));
  12820. var invertBy = createInverter(function(result3, value, key) {
  12821. if (value != null && typeof value.toString != "function") {
  12822. value = nativeObjectToString.call(value);
  12823. }
  12824. if (hasOwnProperty2.call(result3, value)) {
  12825. result3[value].push(key);
  12826. } else {
  12827. result3[value] = [key];
  12828. }
  12829. }, getIteratee);
  12830. var invoke = baseRest(baseInvoke);
  12831. function keys(object) {
  12832. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  12833. }
  12834. function keysIn(object) {
  12835. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  12836. }
  12837. function mapKeys(object, iteratee2) {
  12838. var result3 = {};
  12839. iteratee2 = getIteratee(iteratee2, 3);
  12840. baseForOwn(object, function(value, key, object2) {
  12841. baseAssignValue(result3, iteratee2(value, key, object2), value);
  12842. });
  12843. return result3;
  12844. }
  12845. function mapValues(object, iteratee2) {
  12846. var result3 = {};
  12847. iteratee2 = getIteratee(iteratee2, 3);
  12848. baseForOwn(object, function(value, key, object2) {
  12849. baseAssignValue(result3, key, iteratee2(value, key, object2));
  12850. });
  12851. return result3;
  12852. }
  12853. var merge = createAssigner(function(object, source, srcIndex) {
  12854. baseMerge(object, source, srcIndex);
  12855. });
  12856. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  12857. baseMerge(object, source, srcIndex, customizer);
  12858. });
  12859. var omit = flatRest(function(object, paths) {
  12860. var result3 = {};
  12861. if (object == null) {
  12862. return result3;
  12863. }
  12864. var isDeep = false;
  12865. paths = arrayMap(paths, function(path) {
  12866. path = castPath(path, object);
  12867. isDeep || (isDeep = path.length > 1);
  12868. return path;
  12869. });
  12870. copyObject(object, getAllKeysIn(object), result3);
  12871. if (isDeep) {
  12872. result3 = baseClone(result3, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  12873. }
  12874. var length = paths.length;
  12875. while (length--) {
  12876. baseUnset(result3, paths[length]);
  12877. }
  12878. return result3;
  12879. });
  12880. function omitBy(object, predicate) {
  12881. return pickBy(object, negate(getIteratee(predicate)));
  12882. }
  12883. var pick = flatRest(function(object, paths) {
  12884. return object == null ? {} : basePick(object, paths);
  12885. });
  12886. function pickBy(object, predicate) {
  12887. if (object == null) {
  12888. return {};
  12889. }
  12890. var props = arrayMap(getAllKeysIn(object), function(prop) {
  12891. return [prop];
  12892. });
  12893. predicate = getIteratee(predicate);
  12894. return basePickBy(object, props, function(value, path) {
  12895. return predicate(value, path[0]);
  12896. });
  12897. }
  12898. function result2(object, path, defaultValue) {
  12899. path = castPath(path, object);
  12900. var index2 = -1, length = path.length;
  12901. if (!length) {
  12902. length = 1;
  12903. object = undefined$1;
  12904. }
  12905. while (++index2 < length) {
  12906. var value = object == null ? undefined$1 : object[toKey(path[index2])];
  12907. if (value === undefined$1) {
  12908. index2 = length;
  12909. value = defaultValue;
  12910. }
  12911. object = isFunction2(value) ? value.call(object) : value;
  12912. }
  12913. return object;
  12914. }
  12915. function set2(object, path, value) {
  12916. return object == null ? object : baseSet(object, path, value);
  12917. }
  12918. function setWith(object, path, value, customizer) {
  12919. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12920. return object == null ? object : baseSet(object, path, value, customizer);
  12921. }
  12922. var toPairs = createToPairs(keys);
  12923. var toPairsIn = createToPairs(keysIn);
  12924. function transform(object, iteratee2, accumulator) {
  12925. var isArr = isArray2(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  12926. iteratee2 = getIteratee(iteratee2, 4);
  12927. if (accumulator == null) {
  12928. var Ctor = object && object.constructor;
  12929. if (isArrLike) {
  12930. accumulator = isArr ? new Ctor() : [];
  12931. } else if (isObject2(object)) {
  12932. accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
  12933. } else {
  12934. accumulator = {};
  12935. }
  12936. }
  12937. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index2, object2) {
  12938. return iteratee2(accumulator, value, index2, object2);
  12939. });
  12940. return accumulator;
  12941. }
  12942. function unset(object, path) {
  12943. return object == null ? true : baseUnset(object, path);
  12944. }
  12945. function update(object, path, updater) {
  12946. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  12947. }
  12948. function updateWith(object, path, updater, customizer) {
  12949. customizer = typeof customizer == "function" ? customizer : undefined$1;
  12950. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  12951. }
  12952. function values(object) {
  12953. return object == null ? [] : baseValues(object, keys(object));
  12954. }
  12955. function valuesIn(object) {
  12956. return object == null ? [] : baseValues(object, keysIn(object));
  12957. }
  12958. function clamp(number, lower, upper) {
  12959. if (upper === undefined$1) {
  12960. upper = lower;
  12961. lower = undefined$1;
  12962. }
  12963. if (upper !== undefined$1) {
  12964. upper = toNumber2(upper);
  12965. upper = upper === upper ? upper : 0;
  12966. }
  12967. if (lower !== undefined$1) {
  12968. lower = toNumber2(lower);
  12969. lower = lower === lower ? lower : 0;
  12970. }
  12971. return baseClamp(toNumber2(number), lower, upper);
  12972. }
  12973. function inRange(number, start, end) {
  12974. start = toFinite(start);
  12975. if (end === undefined$1) {
  12976. end = start;
  12977. start = 0;
  12978. } else {
  12979. end = toFinite(end);
  12980. }
  12981. number = toNumber2(number);
  12982. return baseInRange(number, start, end);
  12983. }
  12984. function random(lower, upper, floating) {
  12985. if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
  12986. upper = floating = undefined$1;
  12987. }
  12988. if (floating === undefined$1) {
  12989. if (typeof upper == "boolean") {
  12990. floating = upper;
  12991. upper = undefined$1;
  12992. } else if (typeof lower == "boolean") {
  12993. floating = lower;
  12994. lower = undefined$1;
  12995. }
  12996. }
  12997. if (lower === undefined$1 && upper === undefined$1) {
  12998. lower = 0;
  12999. upper = 1;
  13000. } else {
  13001. lower = toFinite(lower);
  13002. if (upper === undefined$1) {
  13003. upper = lower;
  13004. lower = 0;
  13005. } else {
  13006. upper = toFinite(upper);
  13007. }
  13008. }
  13009. if (lower > upper) {
  13010. var temp = lower;
  13011. lower = upper;
  13012. upper = temp;
  13013. }
  13014. if (floating || lower % 1 || upper % 1) {
  13015. var rand = nativeRandom();
  13016. return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
  13017. }
  13018. return baseRandom(lower, upper);
  13019. }
  13020. var camelCase = createCompounder(function(result3, word, index2) {
  13021. word = word.toLowerCase();
  13022. return result3 + (index2 ? capitalize2(word) : word);
  13023. });
  13024. function capitalize2(string) {
  13025. return upperFirst(toString2(string).toLowerCase());
  13026. }
  13027. function deburr(string) {
  13028. string = toString2(string);
  13029. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
  13030. }
  13031. function endsWith(string, target, position) {
  13032. string = toString2(string);
  13033. target = baseToString(target);
  13034. var length = string.length;
  13035. position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
  13036. var end = position;
  13037. position -= target.length;
  13038. return position >= 0 && string.slice(position, end) == target;
  13039. }
  13040. function escape2(string) {
  13041. string = toString2(string);
  13042. return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
  13043. }
  13044. function escapeRegExp(string) {
  13045. string = toString2(string);
  13046. return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
  13047. }
  13048. var kebabCase = createCompounder(function(result3, word, index2) {
  13049. return result3 + (index2 ? "-" : "") + word.toLowerCase();
  13050. });
  13051. var lowerCase = createCompounder(function(result3, word, index2) {
  13052. return result3 + (index2 ? " " : "") + word.toLowerCase();
  13053. });
  13054. var lowerFirst = createCaseFirst("toLowerCase");
  13055. function pad(string, length, chars) {
  13056. string = toString2(string);
  13057. length = toInteger(length);
  13058. var strLength = length ? stringSize(string) : 0;
  13059. if (!length || strLength >= length) {
  13060. return string;
  13061. }
  13062. var mid = (length - strLength) / 2;
  13063. return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
  13064. }
  13065. function padEnd(string, length, chars) {
  13066. string = toString2(string);
  13067. length = toInteger(length);
  13068. var strLength = length ? stringSize(string) : 0;
  13069. return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
  13070. }
  13071. function padStart(string, length, chars) {
  13072. string = toString2(string);
  13073. length = toInteger(length);
  13074. var strLength = length ? stringSize(string) : 0;
  13075. return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
  13076. }
  13077. function parseInt2(string, radix, guard) {
  13078. if (guard || radix == null) {
  13079. radix = 0;
  13080. } else if (radix) {
  13081. radix = +radix;
  13082. }
  13083. return nativeParseInt(toString2(string).replace(reTrimStart, ""), radix || 0);
  13084. }
  13085. function repeat(string, n2, guard) {
  13086. if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined$1) {
  13087. n2 = 1;
  13088. } else {
  13089. n2 = toInteger(n2);
  13090. }
  13091. return baseRepeat(toString2(string), n2);
  13092. }
  13093. function replace() {
  13094. var args = arguments, string = toString2(args[0]);
  13095. return args.length < 3 ? string : string.replace(args[1], args[2]);
  13096. }
  13097. var snakeCase = createCompounder(function(result3, word, index2) {
  13098. return result3 + (index2 ? "_" : "") + word.toLowerCase();
  13099. });
  13100. function split(string, separator, limit) {
  13101. if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
  13102. separator = limit = undefined$1;
  13103. }
  13104. limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
  13105. if (!limit) {
  13106. return [];
  13107. }
  13108. string = toString2(string);
  13109. if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
  13110. separator = baseToString(separator);
  13111. if (!separator && hasUnicode(string)) {
  13112. return castSlice(stringToArray(string), 0, limit);
  13113. }
  13114. }
  13115. return string.split(separator, limit);
  13116. }
  13117. var startCase = createCompounder(function(result3, word, index2) {
  13118. return result3 + (index2 ? " " : "") + upperFirst(word);
  13119. });
  13120. function startsWith2(string, target, position) {
  13121. string = toString2(string);
  13122. position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
  13123. target = baseToString(target);
  13124. return string.slice(position, position + target.length) == target;
  13125. }
  13126. function template(string, options, guard) {
  13127. var settings = lodash2.templateSettings;
  13128. if (guard && isIterateeCall(string, options, guard)) {
  13129. options = undefined$1;
  13130. }
  13131. string = toString2(string);
  13132. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  13133. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
  13134. var isEscaping, isEvaluating, index2 = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
  13135. var reDelimiters = RegExp2(
  13136. (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
  13137. "g"
  13138. );
  13139. var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
  13140. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  13141. interpolateValue || (interpolateValue = esTemplateValue);
  13142. source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar);
  13143. if (escapeValue) {
  13144. isEscaping = true;
  13145. source += "' +\n__e(" + escapeValue + ") +\n'";
  13146. }
  13147. if (evaluateValue) {
  13148. isEvaluating = true;
  13149. source += "';\n" + evaluateValue + ";\n__p += '";
  13150. }
  13151. if (interpolateValue) {
  13152. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  13153. }
  13154. index2 = offset + match.length;
  13155. return match;
  13156. });
  13157. source += "';\n";
  13158. var variable = hasOwnProperty2.call(options, "variable") && options.variable;
  13159. if (!variable) {
  13160. source = "with (obj) {\n" + source + "\n}\n";
  13161. } else if (reForbiddenIdentifierChars.test(variable)) {
  13162. throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
  13163. }
  13164. source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
  13165. source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
  13166. var result3 = attempt(function() {
  13167. return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
  13168. });
  13169. result3.source = source;
  13170. if (isError(result3)) {
  13171. throw result3;
  13172. }
  13173. return result3;
  13174. }
  13175. function toLower(value) {
  13176. return toString2(value).toLowerCase();
  13177. }
  13178. function toUpper(value) {
  13179. return toString2(value).toUpperCase();
  13180. }
  13181. function trim(string, chars, guard) {
  13182. string = toString2(string);
  13183. if (string && (guard || chars === undefined$1)) {
  13184. return baseTrim(string);
  13185. }
  13186. if (!string || !(chars = baseToString(chars))) {
  13187. return string;
  13188. }
  13189. var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
  13190. return castSlice(strSymbols, start, end).join("");
  13191. }
  13192. function trimEnd(string, chars, guard) {
  13193. string = toString2(string);
  13194. if (string && (guard || chars === undefined$1)) {
  13195. return string.slice(0, trimmedEndIndex(string) + 1);
  13196. }
  13197. if (!string || !(chars = baseToString(chars))) {
  13198. return string;
  13199. }
  13200. var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  13201. return castSlice(strSymbols, 0, end).join("");
  13202. }
  13203. function trimStart(string, chars, guard) {
  13204. string = toString2(string);
  13205. if (string && (guard || chars === undefined$1)) {
  13206. return string.replace(reTrimStart, "");
  13207. }
  13208. if (!string || !(chars = baseToString(chars))) {
  13209. return string;
  13210. }
  13211. var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
  13212. return castSlice(strSymbols, start).join("");
  13213. }
  13214. function truncate(string, options) {
  13215. var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
  13216. if (isObject2(options)) {
  13217. var separator = "separator" in options ? options.separator : separator;
  13218. length = "length" in options ? toInteger(options.length) : length;
  13219. omission = "omission" in options ? baseToString(options.omission) : omission;
  13220. }
  13221. string = toString2(string);
  13222. var strLength = string.length;
  13223. if (hasUnicode(string)) {
  13224. var strSymbols = stringToArray(string);
  13225. strLength = strSymbols.length;
  13226. }
  13227. if (length >= strLength) {
  13228. return string;
  13229. }
  13230. var end = length - stringSize(omission);
  13231. if (end < 1) {
  13232. return omission;
  13233. }
  13234. var result3 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
  13235. if (separator === undefined$1) {
  13236. return result3 + omission;
  13237. }
  13238. if (strSymbols) {
  13239. end += result3.length - end;
  13240. }
  13241. if (isRegExp(separator)) {
  13242. if (string.slice(end).search(separator)) {
  13243. var match, substring = result3;
  13244. if (!separator.global) {
  13245. separator = RegExp2(separator.source, toString2(reFlags.exec(separator)) + "g");
  13246. }
  13247. separator.lastIndex = 0;
  13248. while (match = separator.exec(substring)) {
  13249. var newEnd = match.index;
  13250. }
  13251. result3 = result3.slice(0, newEnd === undefined$1 ? end : newEnd);
  13252. }
  13253. } else if (string.indexOf(baseToString(separator), end) != end) {
  13254. var index2 = result3.lastIndexOf(separator);
  13255. if (index2 > -1) {
  13256. result3 = result3.slice(0, index2);
  13257. }
  13258. }
  13259. return result3 + omission;
  13260. }
  13261. function unescape2(string) {
  13262. string = toString2(string);
  13263. return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
  13264. }
  13265. var upperCase = createCompounder(function(result3, word, index2) {
  13266. return result3 + (index2 ? " " : "") + word.toUpperCase();
  13267. });
  13268. var upperFirst = createCaseFirst("toUpperCase");
  13269. function words(string, pattern, guard) {
  13270. string = toString2(string);
  13271. pattern = guard ? undefined$1 : pattern;
  13272. if (pattern === undefined$1) {
  13273. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  13274. }
  13275. return string.match(pattern) || [];
  13276. }
  13277. var attempt = baseRest(function(func, args) {
  13278. try {
  13279. return apply(func, undefined$1, args);
  13280. } catch (e2) {
  13281. return isError(e2) ? e2 : new Error2(e2);
  13282. }
  13283. });
  13284. var bindAll = flatRest(function(object, methodNames) {
  13285. arrayEach(methodNames, function(key) {
  13286. key = toKey(key);
  13287. baseAssignValue(object, key, bind(object[key], object));
  13288. });
  13289. return object;
  13290. });
  13291. function cond(pairs) {
  13292. var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
  13293. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  13294. if (typeof pair[1] != "function") {
  13295. throw new TypeError2(FUNC_ERROR_TEXT);
  13296. }
  13297. return [toIteratee(pair[0]), pair[1]];
  13298. });
  13299. return baseRest(function(args) {
  13300. var index2 = -1;
  13301. while (++index2 < length) {
  13302. var pair = pairs[index2];
  13303. if (apply(pair[0], this, args)) {
  13304. return apply(pair[1], this, args);
  13305. }
  13306. }
  13307. });
  13308. }
  13309. function conforms(source) {
  13310. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  13311. }
  13312. function constant(value) {
  13313. return function() {
  13314. return value;
  13315. };
  13316. }
  13317. function defaultTo(value, defaultValue) {
  13318. return value == null || value !== value ? defaultValue : value;
  13319. }
  13320. var flow = createFlow();
  13321. var flowRight = createFlow(true);
  13322. function identity(value) {
  13323. return value;
  13324. }
  13325. function iteratee(func) {
  13326. return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
  13327. }
  13328. function matches(source) {
  13329. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  13330. }
  13331. function matchesProperty(path, srcValue) {
  13332. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  13333. }
  13334. var method = baseRest(function(path, args) {
  13335. return function(object) {
  13336. return baseInvoke(object, path, args);
  13337. };
  13338. });
  13339. var methodOf = baseRest(function(object, args) {
  13340. return function(path) {
  13341. return baseInvoke(object, path, args);
  13342. };
  13343. });
  13344. function mixin(object, source, options) {
  13345. var props = keys(source), methodNames = baseFunctions(source, props);
  13346. if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
  13347. options = source;
  13348. source = object;
  13349. object = this;
  13350. methodNames = baseFunctions(source, keys(source));
  13351. }
  13352. var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
  13353. arrayEach(methodNames, function(methodName) {
  13354. var func = source[methodName];
  13355. object[methodName] = func;
  13356. if (isFunc) {
  13357. object.prototype[methodName] = function() {
  13358. var chainAll = this.__chain__;
  13359. if (chain2 || chainAll) {
  13360. var result3 = object(this.__wrapped__), actions = result3.__actions__ = copyArray(this.__actions__);
  13361. actions.push({ "func": func, "args": arguments, "thisArg": object });
  13362. result3.__chain__ = chainAll;
  13363. return result3;
  13364. }
  13365. return func.apply(object, arrayPush([this.value()], arguments));
  13366. };
  13367. }
  13368. });
  13369. return object;
  13370. }
  13371. function noConflict() {
  13372. if (root._ === this) {
  13373. root._ = oldDash;
  13374. }
  13375. return this;
  13376. }
  13377. function noop2() {
  13378. }
  13379. function nthArg(n2) {
  13380. n2 = toInteger(n2);
  13381. return baseRest(function(args) {
  13382. return baseNth(args, n2);
  13383. });
  13384. }
  13385. var over = createOver(arrayMap);
  13386. var overEvery = createOver(arrayEvery);
  13387. var overSome = createOver(arraySome);
  13388. function property(path) {
  13389. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  13390. }
  13391. function propertyOf(object) {
  13392. return function(path) {
  13393. return object == null ? undefined$1 : baseGet(object, path);
  13394. };
  13395. }
  13396. var range = createRange();
  13397. var rangeRight = createRange(true);
  13398. function stubArray() {
  13399. return [];
  13400. }
  13401. function stubFalse() {
  13402. return false;
  13403. }
  13404. function stubObject() {
  13405. return {};
  13406. }
  13407. function stubString() {
  13408. return "";
  13409. }
  13410. function stubTrue() {
  13411. return true;
  13412. }
  13413. function times(n2, iteratee2) {
  13414. n2 = toInteger(n2);
  13415. if (n2 < 1 || n2 > MAX_SAFE_INTEGER) {
  13416. return [];
  13417. }
  13418. var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH);
  13419. iteratee2 = getIteratee(iteratee2);
  13420. n2 -= MAX_ARRAY_LENGTH;
  13421. var result3 = baseTimes(length, iteratee2);
  13422. while (++index2 < n2) {
  13423. iteratee2(index2);
  13424. }
  13425. return result3;
  13426. }
  13427. function toPath(value) {
  13428. if (isArray2(value)) {
  13429. return arrayMap(value, toKey);
  13430. }
  13431. return isSymbol2(value) ? [value] : copyArray(stringToPath(toString2(value)));
  13432. }
  13433. function uniqueId(prefix) {
  13434. var id = ++idCounter;
  13435. return toString2(prefix) + id;
  13436. }
  13437. var add2 = createMathOperation(function(augend, addend) {
  13438. return augend + addend;
  13439. }, 0);
  13440. var ceil = createRound("ceil");
  13441. var divide = createMathOperation(function(dividend, divisor) {
  13442. return dividend / divisor;
  13443. }, 1);
  13444. var floor = createRound("floor");
  13445. function max(array) {
  13446. return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1;
  13447. }
  13448. function maxBy(array, iteratee2) {
  13449. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
  13450. }
  13451. function mean(array) {
  13452. return baseMean(array, identity);
  13453. }
  13454. function meanBy(array, iteratee2) {
  13455. return baseMean(array, getIteratee(iteratee2, 2));
  13456. }
  13457. function min(array) {
  13458. return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1;
  13459. }
  13460. function minBy(array, iteratee2) {
  13461. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
  13462. }
  13463. var multiply = createMathOperation(function(multiplier, multiplicand) {
  13464. return multiplier * multiplicand;
  13465. }, 1);
  13466. var round = createRound("round");
  13467. var subtract = createMathOperation(function(minuend, subtrahend) {
  13468. return minuend - subtrahend;
  13469. }, 0);
  13470. function sum(array) {
  13471. return array && array.length ? baseSum(array, identity) : 0;
  13472. }
  13473. function sumBy(array, iteratee2) {
  13474. return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
  13475. }
  13476. lodash2.after = after;
  13477. lodash2.ary = ary;
  13478. lodash2.assign = assign2;
  13479. lodash2.assignIn = assignIn;
  13480. lodash2.assignInWith = assignInWith;
  13481. lodash2.assignWith = assignWith;
  13482. lodash2.at = at2;
  13483. lodash2.before = before;
  13484. lodash2.bind = bind;
  13485. lodash2.bindAll = bindAll;
  13486. lodash2.bindKey = bindKey;
  13487. lodash2.castArray = castArray;
  13488. lodash2.chain = chain;
  13489. lodash2.chunk = chunk;
  13490. lodash2.compact = compact;
  13491. lodash2.concat = concat;
  13492. lodash2.cond = cond;
  13493. lodash2.conforms = conforms;
  13494. lodash2.constant = constant;
  13495. lodash2.countBy = countBy;
  13496. lodash2.create = create;
  13497. lodash2.curry = curry;
  13498. lodash2.curryRight = curryRight;
  13499. lodash2.debounce = debounce;
  13500. lodash2.defaults = defaults2;
  13501. lodash2.defaultsDeep = defaultsDeep;
  13502. lodash2.defer = defer;
  13503. lodash2.delay = delay;
  13504. lodash2.difference = difference;
  13505. lodash2.differenceBy = differenceBy;
  13506. lodash2.differenceWith = differenceWith;
  13507. lodash2.drop = drop;
  13508. lodash2.dropRight = dropRight;
  13509. lodash2.dropRightWhile = dropRightWhile;
  13510. lodash2.dropWhile = dropWhile;
  13511. lodash2.fill = fill;
  13512. lodash2.filter = filter;
  13513. lodash2.flatMap = flatMap;
  13514. lodash2.flatMapDeep = flatMapDeep;
  13515. lodash2.flatMapDepth = flatMapDepth;
  13516. lodash2.flatten = flatten;
  13517. lodash2.flattenDeep = flattenDeep;
  13518. lodash2.flattenDepth = flattenDepth;
  13519. lodash2.flip = flip;
  13520. lodash2.flow = flow;
  13521. lodash2.flowRight = flowRight;
  13522. lodash2.fromPairs = fromPairs;
  13523. lodash2.functions = functions;
  13524. lodash2.functionsIn = functionsIn;
  13525. lodash2.groupBy = groupBy;
  13526. lodash2.initial = initial;
  13527. lodash2.intersection = intersection;
  13528. lodash2.intersectionBy = intersectionBy;
  13529. lodash2.intersectionWith = intersectionWith;
  13530. lodash2.invert = invert;
  13531. lodash2.invertBy = invertBy;
  13532. lodash2.invokeMap = invokeMap;
  13533. lodash2.iteratee = iteratee;
  13534. lodash2.keyBy = keyBy;
  13535. lodash2.keys = keys;
  13536. lodash2.keysIn = keysIn;
  13537. lodash2.map = map;
  13538. lodash2.mapKeys = mapKeys;
  13539. lodash2.mapValues = mapValues;
  13540. lodash2.matches = matches;
  13541. lodash2.matchesProperty = matchesProperty;
  13542. lodash2.memoize = memoize;
  13543. lodash2.merge = merge;
  13544. lodash2.mergeWith = mergeWith;
  13545. lodash2.method = method;
  13546. lodash2.methodOf = methodOf;
  13547. lodash2.mixin = mixin;
  13548. lodash2.negate = negate;
  13549. lodash2.nthArg = nthArg;
  13550. lodash2.omit = omit;
  13551. lodash2.omitBy = omitBy;
  13552. lodash2.once = once2;
  13553. lodash2.orderBy = orderBy;
  13554. lodash2.over = over;
  13555. lodash2.overArgs = overArgs;
  13556. lodash2.overEvery = overEvery;
  13557. lodash2.overSome = overSome;
  13558. lodash2.partial = partial;
  13559. lodash2.partialRight = partialRight;
  13560. lodash2.partition = partition;
  13561. lodash2.pick = pick;
  13562. lodash2.pickBy = pickBy;
  13563. lodash2.property = property;
  13564. lodash2.propertyOf = propertyOf;
  13565. lodash2.pull = pull;
  13566. lodash2.pullAll = pullAll;
  13567. lodash2.pullAllBy = pullAllBy;
  13568. lodash2.pullAllWith = pullAllWith;
  13569. lodash2.pullAt = pullAt;
  13570. lodash2.range = range;
  13571. lodash2.rangeRight = rangeRight;
  13572. lodash2.rearg = rearg;
  13573. lodash2.reject = reject;
  13574. lodash2.remove = remove2;
  13575. lodash2.rest = rest;
  13576. lodash2.reverse = reverse;
  13577. lodash2.sampleSize = sampleSize;
  13578. lodash2.set = set2;
  13579. lodash2.setWith = setWith;
  13580. lodash2.shuffle = shuffle;
  13581. lodash2.slice = slice;
  13582. lodash2.sortBy = sortBy;
  13583. lodash2.sortedUniq = sortedUniq;
  13584. lodash2.sortedUniqBy = sortedUniqBy;
  13585. lodash2.split = split;
  13586. lodash2.spread = spread;
  13587. lodash2.tail = tail;
  13588. lodash2.take = take;
  13589. lodash2.takeRight = takeRight;
  13590. lodash2.takeRightWhile = takeRightWhile;
  13591. lodash2.takeWhile = takeWhile;
  13592. lodash2.tap = tap;
  13593. lodash2.throttle = throttle;
  13594. lodash2.thru = thru;
  13595. lodash2.toArray = toArray;
  13596. lodash2.toPairs = toPairs;
  13597. lodash2.toPairsIn = toPairsIn;
  13598. lodash2.toPath = toPath;
  13599. lodash2.toPlainObject = toPlainObject;
  13600. lodash2.transform = transform;
  13601. lodash2.unary = unary;
  13602. lodash2.union = union;
  13603. lodash2.unionBy = unionBy;
  13604. lodash2.unionWith = unionWith;
  13605. lodash2.uniq = uniq;
  13606. lodash2.uniqBy = uniqBy;
  13607. lodash2.uniqWith = uniqWith;
  13608. lodash2.unset = unset;
  13609. lodash2.unzip = unzip;
  13610. lodash2.unzipWith = unzipWith;
  13611. lodash2.update = update;
  13612. lodash2.updateWith = updateWith;
  13613. lodash2.values = values;
  13614. lodash2.valuesIn = valuesIn;
  13615. lodash2.without = without;
  13616. lodash2.words = words;
  13617. lodash2.wrap = wrap;
  13618. lodash2.xor = xor;
  13619. lodash2.xorBy = xorBy;
  13620. lodash2.xorWith = xorWith;
  13621. lodash2.zip = zip;
  13622. lodash2.zipObject = zipObject;
  13623. lodash2.zipObjectDeep = zipObjectDeep;
  13624. lodash2.zipWith = zipWith;
  13625. lodash2.entries = toPairs;
  13626. lodash2.entriesIn = toPairsIn;
  13627. lodash2.extend = assignIn;
  13628. lodash2.extendWith = assignInWith;
  13629. mixin(lodash2, lodash2);
  13630. lodash2.add = add2;
  13631. lodash2.attempt = attempt;
  13632. lodash2.camelCase = camelCase;
  13633. lodash2.capitalize = capitalize2;
  13634. lodash2.ceil = ceil;
  13635. lodash2.clamp = clamp;
  13636. lodash2.clone = clone2;
  13637. lodash2.cloneDeep = cloneDeep;
  13638. lodash2.cloneDeepWith = cloneDeepWith;
  13639. lodash2.cloneWith = cloneWith;
  13640. lodash2.conformsTo = conformsTo;
  13641. lodash2.deburr = deburr;
  13642. lodash2.defaultTo = defaultTo;
  13643. lodash2.divide = divide;
  13644. lodash2.endsWith = endsWith;
  13645. lodash2.eq = eq;
  13646. lodash2.escape = escape2;
  13647. lodash2.escapeRegExp = escapeRegExp;
  13648. lodash2.every = every;
  13649. lodash2.find = find;
  13650. lodash2.findIndex = findIndex;
  13651. lodash2.findKey = findKey;
  13652. lodash2.findLast = findLast;
  13653. lodash2.findLastIndex = findLastIndex;
  13654. lodash2.findLastKey = findLastKey;
  13655. lodash2.floor = floor;
  13656. lodash2.forEach = forEach3;
  13657. lodash2.forEachRight = forEachRight;
  13658. lodash2.forIn = forIn;
  13659. lodash2.forInRight = forInRight;
  13660. lodash2.forOwn = forOwn;
  13661. lodash2.forOwnRight = forOwnRight;
  13662. lodash2.get = get2;
  13663. lodash2.gt = gt2;
  13664. lodash2.gte = gte;
  13665. lodash2.has = has2;
  13666. lodash2.hasIn = hasIn;
  13667. lodash2.head = head;
  13668. lodash2.identity = identity;
  13669. lodash2.includes = includes;
  13670. lodash2.indexOf = indexOf;
  13671. lodash2.inRange = inRange;
  13672. lodash2.invoke = invoke;
  13673. lodash2.isArguments = isArguments;
  13674. lodash2.isArray = isArray2;
  13675. lodash2.isArrayBuffer = isArrayBuffer;
  13676. lodash2.isArrayLike = isArrayLike;
  13677. lodash2.isArrayLikeObject = isArrayLikeObject;
  13678. lodash2.isBoolean = isBoolean2;
  13679. lodash2.isBuffer = isBuffer;
  13680. lodash2.isDate = isDate2;
  13681. lodash2.isElement = isElement;
  13682. lodash2.isEmpty = isEmpty;
  13683. lodash2.isEqual = isEqual;
  13684. lodash2.isEqualWith = isEqualWith;
  13685. lodash2.isError = isError;
  13686. lodash2.isFinite = isFinite2;
  13687. lodash2.isFunction = isFunction2;
  13688. lodash2.isInteger = isInteger;
  13689. lodash2.isLength = isLength;
  13690. lodash2.isMap = isMap2;
  13691. lodash2.isMatch = isMatch;
  13692. lodash2.isMatchWith = isMatchWith;
  13693. lodash2.isNaN = isNaN2;
  13694. lodash2.isNative = isNative;
  13695. lodash2.isNil = isNil;
  13696. lodash2.isNull = isNull;
  13697. lodash2.isNumber = isNumber;
  13698. lodash2.isObject = isObject2;
  13699. lodash2.isObjectLike = isObjectLike;
  13700. lodash2.isPlainObject = isPlainObject2;
  13701. lodash2.isRegExp = isRegExp;
  13702. lodash2.isSafeInteger = isSafeInteger;
  13703. lodash2.isSet = isSet2;
  13704. lodash2.isString = isString2;
  13705. lodash2.isSymbol = isSymbol2;
  13706. lodash2.isTypedArray = isTypedArray;
  13707. lodash2.isUndefined = isUndefined2;
  13708. lodash2.isWeakMap = isWeakMap;
  13709. lodash2.isWeakSet = isWeakSet;
  13710. lodash2.join = join;
  13711. lodash2.kebabCase = kebabCase;
  13712. lodash2.last = last;
  13713. lodash2.lastIndexOf = lastIndexOf;
  13714. lodash2.lowerCase = lowerCase;
  13715. lodash2.lowerFirst = lowerFirst;
  13716. lodash2.lt = lt2;
  13717. lodash2.lte = lte;
  13718. lodash2.max = max;
  13719. lodash2.maxBy = maxBy;
  13720. lodash2.mean = mean;
  13721. lodash2.meanBy = meanBy;
  13722. lodash2.min = min;
  13723. lodash2.minBy = minBy;
  13724. lodash2.stubArray = stubArray;
  13725. lodash2.stubFalse = stubFalse;
  13726. lodash2.stubObject = stubObject;
  13727. lodash2.stubString = stubString;
  13728. lodash2.stubTrue = stubTrue;
  13729. lodash2.multiply = multiply;
  13730. lodash2.nth = nth;
  13731. lodash2.noConflict = noConflict;
  13732. lodash2.noop = noop2;
  13733. lodash2.now = now;
  13734. lodash2.pad = pad;
  13735. lodash2.padEnd = padEnd;
  13736. lodash2.padStart = padStart;
  13737. lodash2.parseInt = parseInt2;
  13738. lodash2.random = random;
  13739. lodash2.reduce = reduce;
  13740. lodash2.reduceRight = reduceRight;
  13741. lodash2.repeat = repeat;
  13742. lodash2.replace = replace;
  13743. lodash2.result = result2;
  13744. lodash2.round = round;
  13745. lodash2.runInContext = runInContext2;
  13746. lodash2.sample = sample;
  13747. lodash2.size = size2;
  13748. lodash2.snakeCase = snakeCase;
  13749. lodash2.some = some;
  13750. lodash2.sortedIndex = sortedIndex;
  13751. lodash2.sortedIndexBy = sortedIndexBy;
  13752. lodash2.sortedIndexOf = sortedIndexOf;
  13753. lodash2.sortedLastIndex = sortedLastIndex;
  13754. lodash2.sortedLastIndexBy = sortedLastIndexBy;
  13755. lodash2.sortedLastIndexOf = sortedLastIndexOf;
  13756. lodash2.startCase = startCase;
  13757. lodash2.startsWith = startsWith2;
  13758. lodash2.subtract = subtract;
  13759. lodash2.sum = sum;
  13760. lodash2.sumBy = sumBy;
  13761. lodash2.template = template;
  13762. lodash2.times = times;
  13763. lodash2.toFinite = toFinite;
  13764. lodash2.toInteger = toInteger;
  13765. lodash2.toLength = toLength;
  13766. lodash2.toLower = toLower;
  13767. lodash2.toNumber = toNumber2;
  13768. lodash2.toSafeInteger = toSafeInteger;
  13769. lodash2.toString = toString2;
  13770. lodash2.toUpper = toUpper;
  13771. lodash2.trim = trim;
  13772. lodash2.trimEnd = trimEnd;
  13773. lodash2.trimStart = trimStart;
  13774. lodash2.truncate = truncate;
  13775. lodash2.unescape = unescape2;
  13776. lodash2.uniqueId = uniqueId;
  13777. lodash2.upperCase = upperCase;
  13778. lodash2.upperFirst = upperFirst;
  13779. lodash2.each = forEach3;
  13780. lodash2.eachRight = forEachRight;
  13781. lodash2.first = head;
  13782. mixin(lodash2, function() {
  13783. var source = {};
  13784. baseForOwn(lodash2, function(func, methodName) {
  13785. if (!hasOwnProperty2.call(lodash2.prototype, methodName)) {
  13786. source[methodName] = func;
  13787. }
  13788. });
  13789. return source;
  13790. }(), { "chain": false });
  13791. lodash2.VERSION = VERSION;
  13792. arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
  13793. lodash2[methodName].placeholder = lodash2;
  13794. });
  13795. arrayEach(["drop", "take"], function(methodName, index2) {
  13796. LazyWrapper.prototype[methodName] = function(n2) {
  13797. n2 = n2 === undefined$1 ? 1 : nativeMax(toInteger(n2), 0);
  13798. var result3 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone();
  13799. if (result3.__filtered__) {
  13800. result3.__takeCount__ = nativeMin(n2, result3.__takeCount__);
  13801. } else {
  13802. result3.__views__.push({
  13803. "size": nativeMin(n2, MAX_ARRAY_LENGTH),
  13804. "type": methodName + (result3.__dir__ < 0 ? "Right" : "")
  13805. });
  13806. }
  13807. return result3;
  13808. };
  13809. LazyWrapper.prototype[methodName + "Right"] = function(n2) {
  13810. return this.reverse()[methodName](n2).reverse();
  13811. };
  13812. });
  13813. arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) {
  13814. var type = index2 + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  13815. LazyWrapper.prototype[methodName] = function(iteratee2) {
  13816. var result3 = this.clone();
  13817. result3.__iteratees__.push({
  13818. "iteratee": getIteratee(iteratee2, 3),
  13819. "type": type
  13820. });
  13821. result3.__filtered__ = result3.__filtered__ || isFilter;
  13822. return result3;
  13823. };
  13824. });
  13825. arrayEach(["head", "last"], function(methodName, index2) {
  13826. var takeName = "take" + (index2 ? "Right" : "");
  13827. LazyWrapper.prototype[methodName] = function() {
  13828. return this[takeName](1).value()[0];
  13829. };
  13830. });
  13831. arrayEach(["initial", "tail"], function(methodName, index2) {
  13832. var dropName = "drop" + (index2 ? "" : "Right");
  13833. LazyWrapper.prototype[methodName] = function() {
  13834. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  13835. };
  13836. });
  13837. LazyWrapper.prototype.compact = function() {
  13838. return this.filter(identity);
  13839. };
  13840. LazyWrapper.prototype.find = function(predicate) {
  13841. return this.filter(predicate).head();
  13842. };
  13843. LazyWrapper.prototype.findLast = function(predicate) {
  13844. return this.reverse().find(predicate);
  13845. };
  13846. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  13847. if (typeof path == "function") {
  13848. return new LazyWrapper(this);
  13849. }
  13850. return this.map(function(value) {
  13851. return baseInvoke(value, path, args);
  13852. });
  13853. });
  13854. LazyWrapper.prototype.reject = function(predicate) {
  13855. return this.filter(negate(getIteratee(predicate)));
  13856. };
  13857. LazyWrapper.prototype.slice = function(start, end) {
  13858. start = toInteger(start);
  13859. var result3 = this;
  13860. if (result3.__filtered__ && (start > 0 || end < 0)) {
  13861. return new LazyWrapper(result3);
  13862. }
  13863. if (start < 0) {
  13864. result3 = result3.takeRight(-start);
  13865. } else if (start) {
  13866. result3 = result3.drop(start);
  13867. }
  13868. if (end !== undefined$1) {
  13869. end = toInteger(end);
  13870. result3 = end < 0 ? result3.dropRight(-end) : result3.take(end - start);
  13871. }
  13872. return result3;
  13873. };
  13874. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  13875. return this.reverse().takeWhile(predicate).reverse();
  13876. };
  13877. LazyWrapper.prototype.toArray = function() {
  13878. return this.take(MAX_ARRAY_LENGTH);
  13879. };
  13880. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  13881. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
  13882. if (!lodashFunc) {
  13883. return;
  13884. }
  13885. lodash2.prototype[methodName] = function() {
  13886. var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value);
  13887. var interceptor = function(value2) {
  13888. var result4 = lodashFunc.apply(lodash2, arrayPush([value2], args));
  13889. return isTaker && chainAll ? result4[0] : result4;
  13890. };
  13891. if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
  13892. isLazy = useLazy = false;
  13893. }
  13894. var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
  13895. if (!retUnwrapped && useLazy) {
  13896. value = onlyLazy ? value : new LazyWrapper(this);
  13897. var result3 = func.apply(value, args);
  13898. result3.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
  13899. return new LodashWrapper(result3, chainAll);
  13900. }
  13901. if (isUnwrapped && onlyLazy) {
  13902. return func.apply(this, args);
  13903. }
  13904. result3 = this.thru(interceptor);
  13905. return isUnwrapped ? isTaker ? result3.value()[0] : result3.value() : result3;
  13906. };
  13907. });
  13908. arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
  13909. var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  13910. lodash2.prototype[methodName] = function() {
  13911. var args = arguments;
  13912. if (retUnwrapped && !this.__chain__) {
  13913. var value = this.value();
  13914. return func.apply(isArray2(value) ? value : [], args);
  13915. }
  13916. return this[chainName](function(value2) {
  13917. return func.apply(isArray2(value2) ? value2 : [], args);
  13918. });
  13919. };
  13920. });
  13921. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  13922. var lodashFunc = lodash2[methodName];
  13923. if (lodashFunc) {
  13924. var key = lodashFunc.name + "";
  13925. if (!hasOwnProperty2.call(realNames, key)) {
  13926. realNames[key] = [];
  13927. }
  13928. realNames[key].push({ "name": methodName, "func": lodashFunc });
  13929. }
  13930. });
  13931. realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
  13932. "name": "wrapper",
  13933. "func": undefined$1
  13934. }];
  13935. LazyWrapper.prototype.clone = lazyClone;
  13936. LazyWrapper.prototype.reverse = lazyReverse;
  13937. LazyWrapper.prototype.value = lazyValue;
  13938. lodash2.prototype.at = wrapperAt;
  13939. lodash2.prototype.chain = wrapperChain;
  13940. lodash2.prototype.commit = wrapperCommit;
  13941. lodash2.prototype.next = wrapperNext;
  13942. lodash2.prototype.plant = wrapperPlant;
  13943. lodash2.prototype.reverse = wrapperReverse;
  13944. lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
  13945. lodash2.prototype.first = lodash2.prototype.head;
  13946. if (symIterator) {
  13947. lodash2.prototype[symIterator] = wrapperToIterator;
  13948. }
  13949. return lodash2;
  13950. };
  13951. var _2 = runInContext();
  13952. if (freeModule) {
  13953. (freeModule.exports = _2)._ = _2;
  13954. freeExports._ = _2;
  13955. } else {
  13956. root._ = _2;
  13957. }
  13958. }).call(commonjsGlobal);
  13959. })(lodash, lodash.exports);
  13960. var lodashExports = lodash.exports;
  13961. const _$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
  13962. var dayjs_min = { exports: {} };
  13963. (function(module2, exports2) {
  13964. !function(t2, e2) {
  13965. module2.exports = e2();
  13966. }(commonjsGlobal, function() {
  13967. var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
  13968. var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
  13969. return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
  13970. } }, m2 = function(t3, e3, n3) {
  13971. var r3 = String(t3);
  13972. return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
  13973. }, v2 = { s: m2, z: function(t3) {
  13974. var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
  13975. return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
  13976. }, m: function t3(e3, n3) {
  13977. if (e3.date() < n3.date())
  13978. return -t3(n3, e3);
  13979. var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2);
  13980. return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
  13981. }, a: function(t3) {
  13982. return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
  13983. }, p: function(t3) {
  13984. return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
  13985. }, u: function(t3) {
  13986. return void 0 === t3;
  13987. } }, g2 = "en", D2 = {};
  13988. D2[g2] = M2;
  13989. var p2 = "$isDayjsObject", S2 = function(t3) {
  13990. return t3 instanceof _2 || !(!t3 || !t3[p2]);
  13991. }, w2 = function t3(e3, n3, r3) {
  13992. var i3;
  13993. if (!e3)
  13994. return g2;
  13995. if ("string" == typeof e3) {
  13996. var s3 = e3.toLowerCase();
  13997. D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
  13998. var u3 = e3.split("-");
  13999. if (!i3 && u3.length > 1)
  14000. return t3(u3[0]);
  14001. } else {
  14002. var a3 = e3.name;
  14003. D2[a3] = e3, i3 = a3;
  14004. }
  14005. return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
  14006. }, O2 = function(t3, e3) {
  14007. if (S2(t3))
  14008. return t3.clone();
  14009. var n3 = "object" == typeof e3 ? e3 : {};
  14010. return n3.date = t3, n3.args = arguments, new _2(n3);
  14011. }, b2 = v2;
  14012. b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
  14013. return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
  14014. };
  14015. var _2 = function() {
  14016. function M3(t3) {
  14017. this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
  14018. }
  14019. var m3 = M3.prototype;
  14020. return m3.parse = function(t3) {
  14021. this.$d = function(t4) {
  14022. var e3 = t4.date, n3 = t4.utc;
  14023. if (null === e3)
  14024. return /* @__PURE__ */ new Date(NaN);
  14025. if (b2.u(e3))
  14026. return /* @__PURE__ */ new Date();
  14027. if (e3 instanceof Date)
  14028. return new Date(e3);
  14029. if ("string" == typeof e3 && !/Z$/i.test(e3)) {
  14030. var r3 = e3.match($2);
  14031. if (r3) {
  14032. var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
  14033. return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
  14034. }
  14035. }
  14036. return new Date(e3);
  14037. }(t3), this.init();
  14038. }, m3.init = function() {
  14039. var t3 = this.$d;
  14040. this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
  14041. }, m3.$utils = function() {
  14042. return b2;
  14043. }, m3.isValid = function() {
  14044. return !(this.$d.toString() === l2);
  14045. }, m3.isSame = function(t3, e3) {
  14046. var n3 = O2(t3);
  14047. return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
  14048. }, m3.isAfter = function(t3, e3) {
  14049. return O2(t3) < this.startOf(e3);
  14050. }, m3.isBefore = function(t3, e3) {
  14051. return this.endOf(e3) < O2(t3);
  14052. }, m3.$g = function(t3, e3, n3) {
  14053. return b2.u(t3) ? this[e3] : this.set(n3, t3);
  14054. }, m3.unix = function() {
  14055. return Math.floor(this.valueOf() / 1e3);
  14056. }, m3.valueOf = function() {
  14057. return this.$d.getTime();
  14058. }, m3.startOf = function(t3, e3) {
  14059. var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
  14060. var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
  14061. return r3 ? i3 : i3.endOf(a2);
  14062. }, $3 = function(t4, e4) {
  14063. return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
  14064. }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
  14065. switch (f3) {
  14066. case h2:
  14067. return r3 ? l3(1, 0) : l3(31, 11);
  14068. case c2:
  14069. return r3 ? l3(1, M4) : l3(0, M4 + 1);
  14070. case o2:
  14071. var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
  14072. return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
  14073. case a2:
  14074. case d2:
  14075. return $3(v3 + "Hours", 0);
  14076. case u2:
  14077. return $3(v3 + "Minutes", 1);
  14078. case s2:
  14079. return $3(v3 + "Seconds", 2);
  14080. case i2:
  14081. return $3(v3 + "Milliseconds", 3);
  14082. default:
  14083. return this.clone();
  14084. }
  14085. }, m3.endOf = function(t3) {
  14086. return this.startOf(t3, false);
  14087. }, m3.$set = function(t3, e3) {
  14088. var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
  14089. if (o3 === c2 || o3 === h2) {
  14090. var y3 = this.clone().set(d2, 1);
  14091. y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
  14092. } else
  14093. l3 && this.$d[l3]($3);
  14094. return this.init(), this;
  14095. }, m3.set = function(t3, e3) {
  14096. return this.clone().$set(t3, e3);
  14097. }, m3.get = function(t3) {
  14098. return this[b2.p(t3)]();
  14099. }, m3.add = function(r3, f3) {
  14100. var d3, l3 = this;
  14101. r3 = Number(r3);
  14102. var $3 = b2.p(f3), y3 = function(t3) {
  14103. var e3 = O2(l3);
  14104. return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
  14105. };
  14106. if ($3 === c2)
  14107. return this.set(c2, this.$M + r3);
  14108. if ($3 === h2)
  14109. return this.set(h2, this.$y + r3);
  14110. if ($3 === a2)
  14111. return y3(1);
  14112. if ($3 === o2)
  14113. return y3(7);
  14114. var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
  14115. return b2.w(m4, this);
  14116. }, m3.subtract = function(t3, e3) {
  14117. return this.add(-1 * t3, e3);
  14118. }, m3.format = function(t3) {
  14119. var e3 = this, n3 = this.$locale();
  14120. if (!this.isValid())
  14121. return n3.invalidDate || l2;
  14122. var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) {
  14123. return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
  14124. }, d3 = function(t4) {
  14125. return b2.s(s3 % 12 || 12, t4, "0");
  14126. }, $3 = f3 || function(t4, e4, n4) {
  14127. var r4 = t4 < 12 ? "AM" : "PM";
  14128. return n4 ? r4.toLowerCase() : r4;
  14129. };
  14130. return r3.replace(y2, function(t4, r4) {
  14131. return r4 || function(t5) {
  14132. switch (t5) {
  14133. case "YY":
  14134. return String(e3.$y).slice(-2);
  14135. case "YYYY":
  14136. return b2.s(e3.$y, 4, "0");
  14137. case "M":
  14138. return a3 + 1;
  14139. case "MM":
  14140. return b2.s(a3 + 1, 2, "0");
  14141. case "MMM":
  14142. return h3(n3.monthsShort, a3, c3, 3);
  14143. case "MMMM":
  14144. return h3(c3, a3);
  14145. case "D":
  14146. return e3.$D;
  14147. case "DD":
  14148. return b2.s(e3.$D, 2, "0");
  14149. case "d":
  14150. return String(e3.$W);
  14151. case "dd":
  14152. return h3(n3.weekdaysMin, e3.$W, o3, 2);
  14153. case "ddd":
  14154. return h3(n3.weekdaysShort, e3.$W, o3, 3);
  14155. case "dddd":
  14156. return o3[e3.$W];
  14157. case "H":
  14158. return String(s3);
  14159. case "HH":
  14160. return b2.s(s3, 2, "0");
  14161. case "h":
  14162. return d3(1);
  14163. case "hh":
  14164. return d3(2);
  14165. case "a":
  14166. return $3(s3, u3, true);
  14167. case "A":
  14168. return $3(s3, u3, false);
  14169. case "m":
  14170. return String(u3);
  14171. case "mm":
  14172. return b2.s(u3, 2, "0");
  14173. case "s":
  14174. return String(e3.$s);
  14175. case "ss":
  14176. return b2.s(e3.$s, 2, "0");
  14177. case "SSS":
  14178. return b2.s(e3.$ms, 3, "0");
  14179. case "Z":
  14180. return i3;
  14181. }
  14182. return null;
  14183. }(t4) || i3.replace(":", "");
  14184. });
  14185. }, m3.utcOffset = function() {
  14186. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  14187. }, m3.diff = function(r3, d3, l3) {
  14188. var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
  14189. return b2.m(y3, m4);
  14190. };
  14191. switch (M4) {
  14192. case h2:
  14193. $3 = D3() / 12;
  14194. break;
  14195. case c2:
  14196. $3 = D3();
  14197. break;
  14198. case f2:
  14199. $3 = D3() / 3;
  14200. break;
  14201. case o2:
  14202. $3 = (g3 - v3) / 6048e5;
  14203. break;
  14204. case a2:
  14205. $3 = (g3 - v3) / 864e5;
  14206. break;
  14207. case u2:
  14208. $3 = g3 / n2;
  14209. break;
  14210. case s2:
  14211. $3 = g3 / e2;
  14212. break;
  14213. case i2:
  14214. $3 = g3 / t2;
  14215. break;
  14216. default:
  14217. $3 = g3;
  14218. }
  14219. return l3 ? $3 : b2.a($3);
  14220. }, m3.daysInMonth = function() {
  14221. return this.endOf(c2).$D;
  14222. }, m3.$locale = function() {
  14223. return D2[this.$L];
  14224. }, m3.locale = function(t3, e3) {
  14225. if (!t3)
  14226. return this.$L;
  14227. var n3 = this.clone(), r3 = w2(t3, e3, true);
  14228. return r3 && (n3.$L = r3), n3;
  14229. }, m3.clone = function() {
  14230. return b2.w(this.$d, this);
  14231. }, m3.toDate = function() {
  14232. return new Date(this.valueOf());
  14233. }, m3.toJSON = function() {
  14234. return this.isValid() ? this.toISOString() : null;
  14235. }, m3.toISOString = function() {
  14236. return this.$d.toISOString();
  14237. }, m3.toString = function() {
  14238. return this.$d.toUTCString();
  14239. }, M3;
  14240. }(), k = _2.prototype;
  14241. return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
  14242. k[t3[1]] = function(e3) {
  14243. return this.$g(e3, t3[0], t3[1]);
  14244. };
  14245. }), O2.extend = function(t3, e3) {
  14246. return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
  14247. }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
  14248. return O2(1e3 * t3);
  14249. }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
  14250. });
  14251. })(dayjs_min);
  14252. var dayjs_minExports = dayjs_min.exports;
  14253. const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
  14254. var _a, _b;
  14255. const isH5 = typeof index$1 !== "undefined" ? ["web", "h5", void 0].includes((_b = (_a = index$1 == null ? void 0 : index$1.getSystemInfoSync()) == null ? void 0 : _a.uniPlatform) == null ? void 0 : _b.toLocaleLowerCase()) : true;
  14256. const updateStorage = (strategy, store, options) => {
  14257. const storage = strategy.storage;
  14258. const storeKey = strategy.key || store.$id;
  14259. const isCustomStorage = isH5 || (options == null ? void 0 : options.enforceCustomStorage);
  14260. if (strategy.paths) {
  14261. const partialState = strategy.paths.reduce((finalObj, key) => {
  14262. finalObj[key] = store.$state[key];
  14263. return finalObj;
  14264. }, {});
  14265. if (isCustomStorage && storage) {
  14266. storage.setItem(storeKey, JSON.stringify(partialState));
  14267. } else {
  14268. index$1.setStorage({ key: storeKey, data: JSON.stringify(partialState) });
  14269. }
  14270. } else if (isCustomStorage && storage) {
  14271. storage.setItem(storeKey, JSON.stringify(store.$state));
  14272. } else {
  14273. index$1.setStorage({ key: storeKey, data: JSON.stringify(store.$state) });
  14274. }
  14275. };
  14276. var index = ({ options, store }) => {
  14277. var _a2, _b2, _c, _d, _e2, _f;
  14278. if ((_a2 = options.persist) == null ? void 0 : _a2.enabled) {
  14279. const defaultStrat = [
  14280. {
  14281. key: store.$id,
  14282. storage: ((_b2 = options.persist) == null ? void 0 : _b2.H5Storage) || (window == null ? void 0 : window.sessionStorage)
  14283. }
  14284. ];
  14285. const strategies = ((_d = (_c = options.persist) == null ? void 0 : _c.strategies) == null ? void 0 : _d.length) ? (_e2 = options.persist) == null ? void 0 : _e2.strategies : defaultStrat;
  14286. strategies.forEach((strategy) => {
  14287. var _a3, _b3;
  14288. const storage = strategy.storage || ((_a3 = options.persist) == null ? void 0 : _a3.H5Storage) || (window == null ? void 0 : window.sessionStorage);
  14289. const storeKey = strategy.key || store.$id;
  14290. let storageResult;
  14291. if (isH5 || ((_b3 = options.persist) == null ? void 0 : _b3.enforceCustomStorage)) {
  14292. storageResult = storage.getItem(storeKey);
  14293. } else {
  14294. storageResult = index$1.getStorageSync(storeKey);
  14295. }
  14296. if (storageResult) {
  14297. store.$patch(JSON.parse(storageResult));
  14298. updateStorage(strategy, store, options.persist);
  14299. }
  14300. });
  14301. store.$subscribe(() => {
  14302. strategies.forEach((strategy) => {
  14303. updateStorage(strategy, store, options.persist);
  14304. });
  14305. }, { detached: ((_f = options.persist) == null ? void 0 : _f.detached) ? true : false });
  14306. }
  14307. };
  14308. var relativeTime$1 = { exports: {} };
  14309. (function(module2, exports2) {
  14310. !function(r2, e2) {
  14311. module2.exports = e2();
  14312. }(commonjsGlobal, function() {
  14313. return function(r2, e2, t2) {
  14314. r2 = r2 || {};
  14315. var n2 = e2.prototype, o2 = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
  14316. function i2(r3, e3, t3, o3) {
  14317. return n2.fromToBase(r3, e3, t3, o3);
  14318. }
  14319. t2.en.relativeTime = o2, n2.fromToBase = function(e3, n3, i3, d3, u2) {
  14320. for (var f2, a2, s2, l2 = i3.$locale().relativeTime || o2, h2 = r2.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m2 = h2.length, c2 = 0; c2 < m2; c2 += 1) {
  14321. var y2 = h2[c2];
  14322. y2.d && (f2 = d3 ? t2(e3).diff(i3, y2.d, true) : i3.diff(e3, y2.d, true));
  14323. var p2 = (r2.rounding || Math.round)(Math.abs(f2));
  14324. if (s2 = f2 > 0, p2 <= y2.r || !y2.r) {
  14325. p2 <= 1 && c2 > 0 && (y2 = h2[c2 - 1]);
  14326. var v2 = l2[y2.l];
  14327. u2 && (p2 = u2("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s2);
  14328. break;
  14329. }
  14330. }
  14331. if (n3)
  14332. return a2;
  14333. var M2 = s2 ? l2.future : l2.past;
  14334. return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2);
  14335. }, n2.to = function(r3, e3) {
  14336. return i2(r3, e3, this, true);
  14337. }, n2.from = function(r3, e3) {
  14338. return i2(r3, e3, this);
  14339. };
  14340. var d2 = function(r3) {
  14341. return r3.$u ? t2.utc() : t2();
  14342. };
  14343. n2.toNow = function(r3) {
  14344. return this.to(d2(this), r3);
  14345. }, n2.fromNow = function(r3) {
  14346. return this.from(d2(this), r3);
  14347. };
  14348. };
  14349. });
  14350. })(relativeTime$1);
  14351. var relativeTimeExports = relativeTime$1.exports;
  14352. const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
  14353. var duration$1 = { exports: {} };
  14354. (function(module2, exports2) {
  14355. !function(t2, s2) {
  14356. module2.exports = s2();
  14357. }(commonjsGlobal, function() {
  14358. var t2, s2, n2 = 1e3, i2 = 6e4, e2 = 36e5, r2 = 864e5, o2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u2 = 31536e6, d2 = 2628e6, a2 = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h2 = { years: u2, months: d2, days: r2, hours: e2, minutes: i2, seconds: n2, milliseconds: 1, weeks: 6048e5 }, c2 = function(t3) {
  14359. return t3 instanceof g2;
  14360. }, f2 = function(t3, s3, n3) {
  14361. return new g2(t3, n3, s3.$l);
  14362. }, m2 = function(t3) {
  14363. return s2.p(t3) + "s";
  14364. }, l2 = function(t3) {
  14365. return t3 < 0;
  14366. }, $2 = function(t3) {
  14367. return l2(t3) ? Math.ceil(t3) : Math.floor(t3);
  14368. }, y2 = function(t3) {
  14369. return Math.abs(t3);
  14370. }, v2 = function(t3, s3) {
  14371. return t3 ? l2(t3) ? { negative: true, format: "" + y2(t3) + s3 } : { negative: false, format: "" + t3 + s3 } : { negative: false, format: "" };
  14372. }, g2 = function() {
  14373. function l3(t3, s3, n3) {
  14374. var i3 = this;
  14375. if (this.$d = {}, this.$l = n3, void 0 === t3 && (this.$ms = 0, this.parseFromMilliseconds()), s3)
  14376. return f2(t3 * h2[m2(s3)], this);
  14377. if ("number" == typeof t3)
  14378. return this.$ms = t3, this.parseFromMilliseconds(), this;
  14379. if ("object" == typeof t3)
  14380. return Object.keys(t3).forEach(function(s4) {
  14381. i3.$d[m2(s4)] = t3[s4];
  14382. }), this.calMilliseconds(), this;
  14383. if ("string" == typeof t3) {
  14384. var e3 = t3.match(a2);
  14385. if (e3) {
  14386. var r3 = e3.slice(2).map(function(t4) {
  14387. return null != t4 ? Number(t4) : 0;
  14388. });
  14389. return this.$d.years = r3[0], this.$d.months = r3[1], this.$d.weeks = r3[2], this.$d.days = r3[3], this.$d.hours = r3[4], this.$d.minutes = r3[5], this.$d.seconds = r3[6], this.calMilliseconds(), this;
  14390. }
  14391. }
  14392. return this;
  14393. }
  14394. var y3 = l3.prototype;
  14395. return y3.calMilliseconds = function() {
  14396. var t3 = this;
  14397. this.$ms = Object.keys(this.$d).reduce(function(s3, n3) {
  14398. return s3 + (t3.$d[n3] || 0) * h2[n3];
  14399. }, 0);
  14400. }, y3.parseFromMilliseconds = function() {
  14401. var t3 = this.$ms;
  14402. this.$d.years = $2(t3 / u2), t3 %= u2, this.$d.months = $2(t3 / d2), t3 %= d2, this.$d.days = $2(t3 / r2), t3 %= r2, this.$d.hours = $2(t3 / e2), t3 %= e2, this.$d.minutes = $2(t3 / i2), t3 %= i2, this.$d.seconds = $2(t3 / n2), t3 %= n2, this.$d.milliseconds = t3;
  14403. }, y3.toISOString = function() {
  14404. var t3 = v2(this.$d.years, "Y"), s3 = v2(this.$d.months, "M"), n3 = +this.$d.days || 0;
  14405. this.$d.weeks && (n3 += 7 * this.$d.weeks);
  14406. var i3 = v2(n3, "D"), e3 = v2(this.$d.hours, "H"), r3 = v2(this.$d.minutes, "M"), o3 = this.$d.seconds || 0;
  14407. this.$d.milliseconds && (o3 += this.$d.milliseconds / 1e3, o3 = Math.round(1e3 * o3) / 1e3);
  14408. var u3 = v2(o3, "S"), d3 = t3.negative || s3.negative || i3.negative || e3.negative || r3.negative || u3.negative, a3 = e3.format || r3.format || u3.format ? "T" : "", h3 = (d3 ? "-" : "") + "P" + t3.format + s3.format + i3.format + a3 + e3.format + r3.format + u3.format;
  14409. return "P" === h3 || "-P" === h3 ? "P0D" : h3;
  14410. }, y3.toJSON = function() {
  14411. return this.toISOString();
  14412. }, y3.format = function(t3) {
  14413. var n3 = t3 || "YYYY-MM-DDTHH:mm:ss", i3 = { Y: this.$d.years, YY: s2.s(this.$d.years, 2, "0"), YYYY: s2.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s2.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s2.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s2.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s2.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s2.s(this.$d.seconds, 2, "0"), SSS: s2.s(this.$d.milliseconds, 3, "0") };
  14414. return n3.replace(o2, function(t4, s3) {
  14415. return s3 || String(i3[t4]);
  14416. });
  14417. }, y3.as = function(t3) {
  14418. return this.$ms / h2[m2(t3)];
  14419. }, y3.get = function(t3) {
  14420. var s3 = this.$ms, n3 = m2(t3);
  14421. return "milliseconds" === n3 ? s3 %= 1e3 : s3 = "weeks" === n3 ? $2(s3 / h2[n3]) : this.$d[n3], s3 || 0;
  14422. }, y3.add = function(t3, s3, n3) {
  14423. var i3;
  14424. return i3 = s3 ? t3 * h2[m2(s3)] : c2(t3) ? t3.$ms : f2(t3, this).$ms, f2(this.$ms + i3 * (n3 ? -1 : 1), this);
  14425. }, y3.subtract = function(t3, s3) {
  14426. return this.add(t3, s3, true);
  14427. }, y3.locale = function(t3) {
  14428. var s3 = this.clone();
  14429. return s3.$l = t3, s3;
  14430. }, y3.clone = function() {
  14431. return f2(this.$ms, this);
  14432. }, y3.humanize = function(s3) {
  14433. return t2().add(this.$ms, "ms").locale(this.$l).fromNow(!s3);
  14434. }, y3.valueOf = function() {
  14435. return this.asMilliseconds();
  14436. }, y3.milliseconds = function() {
  14437. return this.get("milliseconds");
  14438. }, y3.asMilliseconds = function() {
  14439. return this.as("milliseconds");
  14440. }, y3.seconds = function() {
  14441. return this.get("seconds");
  14442. }, y3.asSeconds = function() {
  14443. return this.as("seconds");
  14444. }, y3.minutes = function() {
  14445. return this.get("minutes");
  14446. }, y3.asMinutes = function() {
  14447. return this.as("minutes");
  14448. }, y3.hours = function() {
  14449. return this.get("hours");
  14450. }, y3.asHours = function() {
  14451. return this.as("hours");
  14452. }, y3.days = function() {
  14453. return this.get("days");
  14454. }, y3.asDays = function() {
  14455. return this.as("days");
  14456. }, y3.weeks = function() {
  14457. return this.get("weeks");
  14458. }, y3.asWeeks = function() {
  14459. return this.as("weeks");
  14460. }, y3.months = function() {
  14461. return this.get("months");
  14462. }, y3.asMonths = function() {
  14463. return this.as("months");
  14464. }, y3.years = function() {
  14465. return this.get("years");
  14466. }, y3.asYears = function() {
  14467. return this.as("years");
  14468. }, l3;
  14469. }(), p2 = function(t3, s3, n3) {
  14470. return t3.add(s3.years() * n3, "y").add(s3.months() * n3, "M").add(s3.days() * n3, "d").add(s3.hours() * n3, "h").add(s3.minutes() * n3, "m").add(s3.seconds() * n3, "s").add(s3.milliseconds() * n3, "ms");
  14471. };
  14472. return function(n3, i3, e3) {
  14473. t2 = e3, s2 = e3().$utils(), e3.duration = function(t3, s3) {
  14474. var n4 = e3.locale();
  14475. return f2(t3, { $l: n4 }, s3);
  14476. }, e3.isDuration = c2;
  14477. var r3 = i3.prototype.add, o3 = i3.prototype.subtract;
  14478. i3.prototype.add = function(t3, s3) {
  14479. return c2(t3) ? p2(this, t3, 1) : r3.bind(this)(t3, s3);
  14480. }, i3.prototype.subtract = function(t3, s3) {
  14481. return c2(t3) ? p2(this, t3, -1) : o3.bind(this)(t3, s3);
  14482. };
  14483. };
  14484. });
  14485. })(duration$1);
  14486. var durationExports = duration$1.exports;
  14487. const duration = /* @__PURE__ */ getDefaultExportFromCjs(durationExports);
  14488. var zhCn = { exports: {} };
  14489. (function(module2, exports2) {
  14490. !function(e2, _2) {
  14491. module2.exports = _2(dayjs_minExports);
  14492. }(commonjsGlobal, function(e2) {
  14493. function _2(e3) {
  14494. return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
  14495. }
  14496. var t2 = _2(e2), d2 = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e3, _3) {
  14497. return "W" === _3 ? e3 + "周" : e3 + "日";
  14498. }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e3, _3) {
  14499. var t3 = 100 * e3 + _3;
  14500. return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
  14501. } };
  14502. return t2.default.locale(d2, null, true), d2;
  14503. });
  14504. })(zhCn);
  14505. var qsCanvas = { exports: {} };
  14506. (function(module2) {
  14507. (function() {
  14508. var _nc;
  14509. const platform = getPlatform(), isUni = platform == "uni", isNode = platform == "node", isWeb = platform == "web", imgCache = {}, vmCache = {}, asyncDrawWhiteList = Object.freeze([
  14510. "init",
  14511. "initAsyncDrawMode",
  14512. "initArgs",
  14513. "initCanvas",
  14514. "handleCtx",
  14515. "initData",
  14516. "draw",
  14517. "toImage",
  14518. "updateCanvasWH",
  14519. "clear",
  14520. "restoreAsyncDrawMode"
  14521. ]), calcMethods = Object.freeze([
  14522. "setPaintbrush",
  14523. "setPaintbrushProp",
  14524. "resetPaintbrush",
  14525. "savePaintbrush",
  14526. "restorePaintbrush",
  14527. "calcText",
  14528. "calcImg",
  14529. "measureText",
  14530. "loadImage"
  14531. ]), asyncDrawMethods = Object.freeze([
  14532. "setPaintbrush",
  14533. "setPaintbrushProp",
  14534. "resetPaintbrush",
  14535. "savePaintbrush",
  14536. "restorePaintbrush",
  14537. "drawText",
  14538. "drawStraightLine",
  14539. "drawDoubleStraightLine",
  14540. "drawDotted",
  14541. "drawDottedStraightLine",
  14542. "drawLine",
  14543. "drawTextDecoration",
  14544. "drawImg",
  14545. "drawQrCode",
  14546. "setCircle",
  14547. "setRect"
  14548. ]), allSelfMethods = Object.freeze([
  14549. "setPaintbrush",
  14550. "setPaintbrushProp",
  14551. "resetPaintbrush",
  14552. "savePaintbrush",
  14553. "restorePaintbrush",
  14554. "drawText",
  14555. "drawStraightLine",
  14556. "drawDoubleStraightLine",
  14557. "drawDotted",
  14558. "drawDottedStraightLine",
  14559. "drawLine",
  14560. "drawTextDecoration",
  14561. "drawImg",
  14562. "drawQrCode",
  14563. "setCircle",
  14564. "setRect",
  14565. "calcText",
  14566. "calcImg",
  14567. "measureText",
  14568. "loadImage",
  14569. "drawArray",
  14570. "drawItem"
  14571. ]), needReturnMethods = Object.freeze(["drawText", "drawImg"]), commonMethods = Object.freeze([
  14572. "drawImage",
  14573. "putImageData",
  14574. "getImageData",
  14575. "createImageData",
  14576. "addPage",
  14577. "save",
  14578. "restore",
  14579. "rotate",
  14580. "translate",
  14581. "transform",
  14582. "getTransform",
  14583. "resetTransform",
  14584. "setTransform",
  14585. "isPointInPath",
  14586. "scale",
  14587. "clip",
  14588. "fill",
  14589. "stroke",
  14590. "fillText",
  14591. "strokeText",
  14592. "fillRect",
  14593. "strokeRect",
  14594. "clearRect",
  14595. "rect",
  14596. "measureText",
  14597. "moveTo",
  14598. "lineTo",
  14599. "bezierCurveTo",
  14600. "quadraticCurveTo",
  14601. "beginPath",
  14602. "closePath",
  14603. "arc",
  14604. "arcTo",
  14605. "ellipse",
  14606. "setLineDash",
  14607. "getLineDash",
  14608. "createPattern",
  14609. "createLinearGradient",
  14610. "createRadialGradient"
  14611. ]);
  14612. let nodeCanvas, id = 1;
  14613. function notUnd(t2) {
  14614. return String(t2) != "undefined";
  14615. }
  14616. function isNull(a2) {
  14617. return !((a2 || a2 == 0) && !["undefined", "null"].includes(String(a2)));
  14618. }
  14619. function getPlatform() {
  14620. if (notUnd(typeof index$1))
  14621. return "uni";
  14622. if (notUnd(typeof window) && notUnd(typeof document))
  14623. return "web";
  14624. return "node";
  14625. }
  14626. function getCtx(vm, args) {
  14627. if (isUni) {
  14628. if (!args.canvasId) {
  14629. throw new Error("canvasId 不能为空");
  14630. }
  14631. }
  14632. let canvas, obj = {};
  14633. switch (platform) {
  14634. case "uni":
  14635. canvas = index$1.createCanvasContext(args.canvasId, vm);
  14636. obj.canvas = canvas;
  14637. obj.ctx = canvas;
  14638. break;
  14639. case "web":
  14640. canvas = (args == null ? void 0 : args.canvasId) ? document.getElementById(args == null ? void 0 : args.canvasId) : document.createElement("canvas");
  14641. canvas.width = (args == null ? void 0 : args.width) || 10;
  14642. canvas.height = (args == null ? void 0 : args.height) || 10;
  14643. obj.canvas = canvas;
  14644. obj.ctx = canvas.getContext("2d");
  14645. break;
  14646. case "node":
  14647. canvas = nodeCanvas.createCanvas((args == null ? void 0 : args.width) || 10, (args == null ? void 0 : args.height) || 10);
  14648. obj.canvas = canvas;
  14649. obj.ctx = canvas.getContext("2d");
  14650. break;
  14651. }
  14652. return obj;
  14653. }
  14654. const _QSCanvas = class {
  14655. constructor(obj, vm) {
  14656. __privateAdd(this, _nc, void 0);
  14657. this._id = id++;
  14658. vmCache[this._id] = vm;
  14659. if (obj) {
  14660. this.init(obj);
  14661. }
  14662. }
  14663. init(obj = {}) {
  14664. this.initArgs(obj).initData().initCanvas().handleCtx().resetPaintbrush();
  14665. if (this._data.asyncDrawMode === true) {
  14666. __privateSet(this, _nc, new _QSCanvas({ asyncDrawMode: false }));
  14667. this.initAsyncDrawMode();
  14668. }
  14669. }
  14670. initAsyncDrawMode() {
  14671. if (isUni)
  14672. return;
  14673. const ctxMethods = this._data.ctxMethods;
  14674. const arr = [.../* @__PURE__ */ new Set([...allSelfMethods, ...ctxMethods])];
  14675. for (let i2 = 0; i2 < arr.length; i2++) {
  14676. const item = arr[i2];
  14677. this.handleAsyncDrawModeItem(item);
  14678. }
  14679. }
  14680. handleAsyncDrawModeItem(i2) {
  14681. if (isUni)
  14682. return;
  14683. if (asyncDrawWhiteList.includes(i2)) {
  14684. console.log("白名单跳过");
  14685. return;
  14686. }
  14687. if (typeof this[i2] == "function") {
  14688. if (!this._data.nMethods[i2])
  14689. this._data.nMethods[i2] = this[i2];
  14690. let _this = this;
  14691. this[i2] = function() {
  14692. let r2;
  14693. if (calcMethods.includes(i2)) {
  14694. r2 = __privateGet(_this, _nc)[i2](...arguments);
  14695. }
  14696. if (r2 && r2 !== _this && r2 !== __privateGet(_this, _nc))
  14697. return r2;
  14698. if (asyncDrawMethods.includes(i2) || _this._data.ctxMethods.includes(i2)) {
  14699. _this._data.asyncDrawQueue.push({ method: i2, args: arguments });
  14700. }
  14701. if (needReturnMethods.includes(i2)) {
  14702. return __privateGet(_this, _nc)[i2](...arguments);
  14703. }
  14704. };
  14705. }
  14706. }
  14707. restoreAsyncDrawMode() {
  14708. if (isUni)
  14709. return;
  14710. const nMethods = this._data.nMethods;
  14711. for (const i2 in nMethods) {
  14712. this[i2] = nMethods[i2];
  14713. }
  14714. }
  14715. initArgs(obj = {}) {
  14716. this._args = obj;
  14717. return this;
  14718. }
  14719. initCanvas() {
  14720. const canvasObj = getCtx(vmCache[this._id], this._args);
  14721. this.canvas = canvasObj.canvas;
  14722. this.ctx = canvasObj.ctx;
  14723. return this;
  14724. }
  14725. /**
  14726. * 使QSCanvas拥有原有方法
  14727. */
  14728. handleCtx() {
  14729. const ctx = this.ctx;
  14730. const active = (i2) => {
  14731. this._data.ctxMethods.push(i2);
  14732. this[i2] = ctx[i2].bind(ctx);
  14733. return;
  14734. };
  14735. for (const i2 in ctx) {
  14736. if (typeof ctx[i2] == "function") {
  14737. if (!this[i2]) {
  14738. active(i2);
  14739. }
  14740. }
  14741. }
  14742. for (let k = 0; k < commonMethods.length; k++) {
  14743. const i2 = commonMethods[k];
  14744. if (typeof ctx[i2] == "function") {
  14745. if (!this[i2]) {
  14746. active(i2);
  14747. }
  14748. }
  14749. }
  14750. return this;
  14751. }
  14752. initData() {
  14753. this._data = {
  14754. oldPaintbrushProps: {},
  14755. savedPaintbrushProps: [],
  14756. font: { fontStyle: "normal", fontVariant: "normal", fontWeight: "normal", fontSize: 10, fontFamily: "sans-serif" },
  14757. height: this._args.height || 10,
  14758. width: this._args.width || 10,
  14759. whChange: false,
  14760. asyncDrawQueue: [],
  14761. nMethods: {},
  14762. asyncDrawMode: isNode || isWeb ? this._args.asyncDrawMode !== false : false,
  14763. ctxMethods: []
  14764. };
  14765. return this;
  14766. }
  14767. /**
  14768. * 设置画笔
  14769. */
  14770. setPaintbrush(obj = {}) {
  14771. filterPaintbrushProps(obj);
  14772. for (const k in obj) {
  14773. this.setPaintbrushProp(k, obj[k]);
  14774. }
  14775. return this;
  14776. }
  14777. /**
  14778. * 设置画笔操作兼容uni
  14779. */
  14780. setPaintbrushProp(prop, data) {
  14781. if (isNull(prop) || isNull(data))
  14782. return;
  14783. prop = hyphen2Hump(prop);
  14784. const ctx = this.ctx;
  14785. if (prop == "font") {
  14786. if (data) {
  14787. if (typeof data != "object") {
  14788. console.warn("font属性需Object格式");
  14789. return;
  14790. }
  14791. for (const k in data)
  14792. if (isNull(data[k]))
  14793. delete data[k];
  14794. const font = { ...this._data.font, ...data };
  14795. if (isUni)
  14796. font.fontSize = Math.round(font.fontSize);
  14797. this._data.font = font;
  14798. const f2 = this._data.font;
  14799. this._data.oldPaintbrushProps[prop] = f2;
  14800. const setFont = () => {
  14801. ctx.font = `${f2.fontStyle || "normal"} ${f2.fontVariant || "normal"} ${f2.fontWeight || "normal"} ${f2.fontSize ?? 10}px ${f2.fontFamily || "sans-serif"}`;
  14802. };
  14803. if (isUni) {
  14804. setFont();
  14805. } else
  14806. setFont();
  14807. }
  14808. } else {
  14809. this._data.oldPaintbrushProps[prop] = data;
  14810. const fnn = "set" + prop[0].toUpperCase() + prop.slice(1);
  14811. if (typeof (ctx == null ? void 0 : ctx[fnn]) == "function") {
  14812. ctx[fnn](data);
  14813. } else {
  14814. ctx[prop] = data;
  14815. }
  14816. }
  14817. return this;
  14818. }
  14819. /**
  14820. * 重置画笔
  14821. */
  14822. resetPaintbrush(obj = {}) {
  14823. this.setPaintbrush({
  14824. fillStyle: "#000000",
  14825. strokeStyle: "#000000",
  14826. shadowColor: "#000000",
  14827. shadowBlur: 0,
  14828. shadowOffsetX: 0,
  14829. shadowOffsetY: 0,
  14830. lineCap: "butt",
  14831. lineJoin: "miter",
  14832. lineWidth: 1,
  14833. miterLimit: 10,
  14834. font: this._data.font,
  14835. textAlign: "start",
  14836. textBaseline: "top",
  14837. globalAlpha: 1,
  14838. globalCompositeOperation: "source-over",
  14839. ...obj
  14840. });
  14841. return this;
  14842. }
  14843. saveAndSetPaintbrush(paintbrushProps = {}) {
  14844. this.savePaintbrush();
  14845. this.setPaintbrush(paintbrushProps);
  14846. return this;
  14847. }
  14848. /**
  14849. * 保存画笔设置
  14850. */
  14851. savePaintbrush() {
  14852. this._data.savedPaintbrushProps.unshift({ ...this._data.oldPaintbrushProps });
  14853. return this;
  14854. }
  14855. /**
  14856. * 恢复上次保存的画笔设置
  14857. */
  14858. restorePaintbrush() {
  14859. const savedProps = this._data.savedPaintbrushProps.shift();
  14860. if (savedProps)
  14861. this._data.oldPaintbrushProps = { ...this._data.oldPaintbrushProps, ...savedProps };
  14862. this.resetPaintbrush({ ...this._data.oldPaintbrushProps });
  14863. return this;
  14864. }
  14865. /**
  14866. * 更新画布宽高
  14867. */
  14868. updateCanvasWH(obj = {}) {
  14869. var _a2, _b2, _c;
  14870. let { width, height, delay } = obj, setCanvasWH = (_a2 = this._args) == null ? void 0 : _a2.setCanvasWH;
  14871. width = width || ((_b2 = this._data) == null ? void 0 : _b2.width) || 10;
  14872. height = height || ((_c = this._data) == null ? void 0 : _c.height) || 10;
  14873. return new Promise((rs2, rj) => {
  14874. if (isUni) {
  14875. if (!setCanvasWH || typeof setCanvasWH != "function") {
  14876. rj("setCanvasWH异常, uni-app 请在初始化时传入setCanvasWH函数");
  14877. return;
  14878. }
  14879. setCanvasWH({ height, width });
  14880. setTimeout(() => {
  14881. rs2();
  14882. }, delay ?? 50);
  14883. } else {
  14884. this.canvas.height = height;
  14885. this.canvas.width = width;
  14886. rs2();
  14887. }
  14888. }).then((r2) => {
  14889. if (this._data.width != width || this._data.height != height) {
  14890. this._data.whChange = true;
  14891. }
  14892. this._data.width = width;
  14893. this._data.height = height;
  14894. if (!this._data.asyncDrawMode)
  14895. this.resetPaintbrush(this._data.oldPaintbrushProps);
  14896. });
  14897. }
  14898. /**
  14899. * 清除画布内容
  14900. */
  14901. clear() {
  14902. this.ctx.clearRect(0, 0, this._data.width || 999999, this._data.height || 999999);
  14903. return this;
  14904. }
  14905. /**
  14906. * 兼容uni draw
  14907. */
  14908. draw(obj = {}) {
  14909. const { reserve } = obj;
  14910. return new Promise((rs2, rj) => {
  14911. if (isUni) {
  14912. let done = false;
  14913. const settimeoutkey = setTimeout(() => {
  14914. if (!done) {
  14915. rs2();
  14916. } else {
  14917. clearTimeout(settimeoutkey);
  14918. }
  14919. }, 3e3);
  14920. this.ctx.draw(reserve ?? false, () => {
  14921. done = true;
  14922. clearTimeout(settimeoutkey);
  14923. rs2();
  14924. });
  14925. } else {
  14926. if (this._data.asyncDrawMode) {
  14927. if (reserve !== true)
  14928. this.clear();
  14929. this.restoreAsyncDrawMode();
  14930. this.resetPaintbrush();
  14931. const arr = this._data.asyncDrawQueue;
  14932. new Promise(async (resolve2, reject) => {
  14933. for (let i2 = 0; i2 < arr.length; i2++) {
  14934. const item = arr[i2];
  14935. try {
  14936. const r2 = this[item.method].call(this, ...item.args);
  14937. if (typeof (r2 == null ? void 0 : r2.then) == "function")
  14938. await r2;
  14939. } catch (error) {
  14940. reject(error);
  14941. return;
  14942. }
  14943. }
  14944. resolve2();
  14945. }).then(() => {
  14946. this._data.asyncDrawQueue = [];
  14947. this.initAsyncDrawMode();
  14948. rs2();
  14949. }).catch((err) => {
  14950. this.initAsyncDrawMode();
  14951. rj(err);
  14952. });
  14953. } else {
  14954. rs2();
  14955. }
  14956. }
  14957. });
  14958. }
  14959. /**
  14960. * canvas2image
  14961. */
  14962. toImage(obj = {}) {
  14963. return new Promise((rs2, rj) => {
  14964. if (isUni) {
  14965. const canvasId = this._args.canvasId;
  14966. if (!canvasId) {
  14967. rj("canvasId不存在");
  14968. return;
  14969. }
  14970. index$1.canvasToTempFilePath({
  14971. ...obj,
  14972. canvasId,
  14973. success: (r2) => {
  14974. var _a2;
  14975. (_a2 = obj.success) == null ? void 0 : _a2.call(obj, r2);
  14976. rs2(r2.tempFilePath);
  14977. },
  14978. fail: (err) => {
  14979. var _a2;
  14980. (_a2 = obj.fail) == null ? void 0 : _a2.call(obj, err);
  14981. rj(err);
  14982. }
  14983. }, vmCache[this._id]);
  14984. } else {
  14985. rs2(this.canvas.toDataURL(`image/${["jpg", "jpeg"].includes(obj.fileType) ? "jpeg" : "png"}`, obj.quality ?? 1));
  14986. }
  14987. });
  14988. }
  14989. /**
  14990. * 计算文字多行
  14991. */
  14992. calcText(obj = {}) {
  14993. const line = obj.line || -1;
  14994. return new Promise((rs2, rj) => {
  14995. try {
  14996. let run = function(text, endLine) {
  14997. let endLineWidth = 0;
  14998. const textWidth = mt2(text).width;
  14999. if (endLine) {
  15000. if (textWidth < obj.maxWidth || text.length < 2) {
  15001. return { index: text.length, ellipsis: false, width: textWidth };
  15002. } else {
  15003. endLineWidth = mt2("...").width;
  15004. }
  15005. }
  15006. const textWidthEndLineWidth = textWidth + endLineWidth;
  15007. if (textWidthEndLineWidth < obj.maxWidth || text.length < 2) {
  15008. return { index: text.length, ellipsis: false, width: textWidthEndLineWidth };
  15009. }
  15010. let loop = true, mid = Math.floor((text.length + 1) / 2), oldMid = 1, mode = "", tw;
  15011. while (loop) {
  15012. if (mid <= 1) {
  15013. loop = false;
  15014. break;
  15015. }
  15016. if (mid > text.length) {
  15017. mid = text.length;
  15018. loop = false;
  15019. break;
  15020. }
  15021. const t2 = text.substr(0, mid);
  15022. tw = mt2(t2).width + endLineWidth;
  15023. if (tw > obj.maxWidth) {
  15024. text = t2;
  15025. if (mode == "xy" && Math.abs(oldMid - mid) < 1) {
  15026. loop = false;
  15027. } else {
  15028. mode = "dy";
  15029. oldMid = mid;
  15030. mid = Math.floor((t2.length + 1) / 2);
  15031. }
  15032. } else if (tw == obj.maxWidth) {
  15033. loop = false;
  15034. } else {
  15035. if (mid <= 1 || Math.abs(oldMid - mid) < 1) {
  15036. loop = false;
  15037. } else {
  15038. mode = "xy";
  15039. oldMid = mid;
  15040. mid += Math.floor((text.length - mid) / 2);
  15041. }
  15042. }
  15043. }
  15044. return { index: mid, ellipsis: endLine, width: tw };
  15045. };
  15046. this.saveAndSetPaintbrush({
  15047. ...obj.paintbrushProps || {}
  15048. });
  15049. const mt2 = this.measureText;
  15050. let splitTexts = [], str = obj.val, width = 0;
  15051. const font = { ...this._data.font };
  15052. if (obj.maxWidth) {
  15053. let i2 = 0;
  15054. while (str.length) {
  15055. const endLine = line > 0 && splitTexts.length + 1 >= line, { index: len, ellipsis, width: width2 } = run(str, endLine);
  15056. const txt = str.substr(0, len);
  15057. splitTexts.push({ ...obj, val: txt, y: i2 ? obj.y + (font.fontSize + (obj.lineHeight || 0)) * i2 : obj.y, width: width2 });
  15058. if (endLine) {
  15059. if (ellipsis)
  15060. splitTexts[splitTexts.length - 1].val += "...";
  15061. str = "";
  15062. } else
  15063. str = str.slice(len);
  15064. i2++;
  15065. }
  15066. width = splitTexts.length == 1 ? splitTexts[0].width : splitTexts.length > 1 ? obj.maxWidth : 0;
  15067. } else {
  15068. splitTexts = [obj];
  15069. width = mt2(obj.val).width;
  15070. }
  15071. this.restorePaintbrush();
  15072. rs2({
  15073. ...obj,
  15074. calcTexts: splitTexts,
  15075. _calc: true,
  15076. left: obj.x,
  15077. top: obj.y,
  15078. right: obj.x + width,
  15079. bottom: splitTexts[splitTexts.length - 1].y + font.fontSize,
  15080. width,
  15081. height: splitTexts[splitTexts.length - 1].y + font.fontSize - obj.y,
  15082. fontSize: font.fontSize
  15083. });
  15084. } catch (error) {
  15085. rj(error);
  15086. }
  15087. });
  15088. }
  15089. /* 绘制 */
  15090. /**
  15091. * 绘制文本
  15092. */
  15093. drawText(obj = {}) {
  15094. return new Promise(async (rs2, rj) => {
  15095. try {
  15096. if (!obj.val) {
  15097. console.warn(`需绘制的文本为空`);
  15098. rs2();
  15099. return;
  15100. }
  15101. this.saveAndSetPaintbrush({
  15102. ...obj.paintbrushProps || {}
  15103. });
  15104. const ft2 = (obj2) => {
  15105. this.fillText(obj2.val, obj2.x, obj2.y);
  15106. }, ftItem = (item) => {
  15107. ft2(item);
  15108. if (item.textDecoration)
  15109. this.drawTextDecoration(item);
  15110. };
  15111. const calcR = obj._calc ? obj : await this.calcText(obj);
  15112. for (let i2 = 0; i2 < calcR.calcTexts.length; i2++) {
  15113. ftItem(calcR.calcTexts[i2]);
  15114. }
  15115. this.restorePaintbrush();
  15116. rs2(calcR);
  15117. } catch (error) {
  15118. rj(error);
  15119. }
  15120. });
  15121. }
  15122. drawStraightLine(obj = {}) {
  15123. const { x1, y1, x2, y2, paintbrushProps } = obj, ctx = this.ctx;
  15124. ctx.beginPath();
  15125. ctx.moveTo(x1, y1);
  15126. ctx.lineTo(x2, y2);
  15127. this.saveAndSetPaintbrush(paintbrushProps || {});
  15128. ctx.stroke();
  15129. this.restorePaintbrush();
  15130. }
  15131. drawDoubleStraightLine(obj = {}) {
  15132. let { gap } = obj;
  15133. gap = gap ?? 1;
  15134. this.drawStraightLine(obj);
  15135. this.drawStraightLine({ ...obj, y1: obj.y1 + gap, y2: obj.y2 + gap });
  15136. }
  15137. drawDotted(obj = {}) {
  15138. this.setCircle(obj);
  15139. if (obj.clip)
  15140. obj.clip = false;
  15141. this.saveAndSetPaintbrush(obj.paintbrushProps || {});
  15142. this.ctx.fill();
  15143. this.restorePaintbrush();
  15144. }
  15145. drawDottedStraightLine(obj = {}) {
  15146. let { x1, x2, y1, y2, gap, width, paintbrushProps } = obj;
  15147. x2 = x2 - width;
  15148. gap = gap || 1;
  15149. const len = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
  15150. const points = getPoints(x1, y1, x2, y2, Math.floor((len - gap) / (width + gap)), 9999999999);
  15151. this.saveAndSetPaintbrush(paintbrushProps);
  15152. this.drawDotted({ x: x1, y: y1, d: width });
  15153. for (let i2 = 0; i2 < points.length; i2++)
  15154. this.drawDotted({ x: points[i2][0], y: points[i2][1], d: width });
  15155. this.drawDotted({ x: x2, y: y2, d: width });
  15156. this.restorePaintbrush();
  15157. }
  15158. drawLine(obj = {}) {
  15159. const { style } = obj;
  15160. switch (style) {
  15161. case "double":
  15162. obj.gap = (obj.width || 1) * 1.5;
  15163. this.drawDoubleStraightLine(obj);
  15164. break;
  15165. case "solide":
  15166. this.drawStraightLine(obj);
  15167. break;
  15168. case "dotted":
  15169. obj.gap = (obj.gap || 1) * 1.5;
  15170. obj.paintbrushProps = { fillStyle: obj.color };
  15171. this.drawDottedStraightLine(obj);
  15172. break;
  15173. }
  15174. }
  15175. /**
  15176. * {
  15177. ...(drawText属性),
  15178. textDecoration: {
  15179. line, //类型 同css text-decoration-line
  15180. color, //线颜色
  15181. width, //线宽度
  15182. * }
  15183. * }
  15184. */
  15185. drawTextDecoration(obj = {}) {
  15186. this.savePaintbrush();
  15187. const oldProps = this._data.oldPaintbrushProps, tw = this.measureText(obj.val).width, tD = obj.textDecoration, line = tD.line || "line-through", color = tD.color || obj.color || oldProps.fillStyle || "#000000", width = tD.thickness || tD.width || (obj.fontSize ? obj.fontSize * 0.1 : false) || 1, style = tD.style || "solide", offset = tD.offset || 0, gap = tD.gap ?? 1, fontSize = obj.fontSize || this._data.font.fontSize;
  15188. this.setPaintbrush({ lineWidth: width, strokeStyle: color });
  15189. let y2 = 0;
  15190. switch (line) {
  15191. case "line-through":
  15192. y2 = obj.y + fontSize / 2 - width / 2;
  15193. break;
  15194. case "underline":
  15195. y2 = obj.y + fontSize;
  15196. break;
  15197. case "overline":
  15198. y2 = obj.y;
  15199. break;
  15200. }
  15201. switch (oldProps.textBaseline) {
  15202. case "top":
  15203. y2 += width / 2;
  15204. break;
  15205. case "bottom":
  15206. y2 -= fontSize;
  15207. break;
  15208. case "center":
  15209. y2 -= fontSize / 2;
  15210. break;
  15211. }
  15212. y2 += offset;
  15213. switch (line) {
  15214. case "line-through":
  15215. case "underline":
  15216. case "overline":
  15217. this.drawLine({ x1: obj.x, y1: y2, x2: obj.x + tw, y2, style, gap, width, color });
  15218. break;
  15219. }
  15220. this.restorePaintbrush();
  15221. }
  15222. /**
  15223. * 绘制图片
  15224. */
  15225. drawImg(obj = {}) {
  15226. return new Promise(async (rs2, rj) => {
  15227. try {
  15228. if (!obj.val) {
  15229. console.warn(`需绘制的图片为空`);
  15230. rs2();
  15231. return;
  15232. }
  15233. const calcR = obj._calc ? obj : await this.calcImg(obj);
  15234. if ((calcR == null ? void 0 : calcR.drawImageArgs) && Array.isArray(calcR.drawImageArgs))
  15235. this.ctx.drawImage(...(calcR == null ? void 0 : calcR.drawImageArgs) || []);
  15236. rs2(calcR);
  15237. } catch (error) {
  15238. rj(error);
  15239. }
  15240. });
  15241. }
  15242. calcImg(obj = {}) {
  15243. return new Promise(async (rs2, rj) => {
  15244. try {
  15245. if (!obj.val) {
  15246. console.warn(`需绘制的图片为空`);
  15247. rs2();
  15248. return;
  15249. }
  15250. const img = await this.loadImage(obj.val), mode = obj.mode || "scaleToFill";
  15251. let arr, x = obj.x || 0, y2 = obj.y || 0, w2 = obj.width || 0, h2 = obj.height || 0, sw = img.width, sh = img.height, sx = 0, sy = 0;
  15252. const get_6 = () => {
  15253. if (isUni) {
  15254. }
  15255. return [sx, sy, sw, sh, x, y2, w2, h2];
  15256. };
  15257. switch (mode) {
  15258. case "aspectFit":
  15259. h2 = img.height / img.width * w2;
  15260. if (h2 < obj.height) {
  15261. y2 = Number(obj.y) + obj.height / 2 - h2 / 2;
  15262. } else {
  15263. h2 = obj.height;
  15264. w2 = img.width / img.height * h2;
  15265. x = Number(obj.x) + obj.width / 2 - w2 / 2;
  15266. }
  15267. arr = get_6();
  15268. break;
  15269. case "aspectFill":
  15270. h2 = img.height / img.width * w2;
  15271. if (h2 < obj.height) {
  15272. h2 = obj.height;
  15273. sx = img.width / img.height * obj.height;
  15274. sx = (sx - obj.width) / sx * img.width / 2;
  15275. sw = img.width - sx * 2;
  15276. } else {
  15277. sy = (h2 - obj.height) / h2 * img.height / 2;
  15278. sh = img.height - sy * 2;
  15279. }
  15280. w2 = obj.width;
  15281. h2 = obj.height;
  15282. arr = get_6();
  15283. break;
  15284. case "widthFix":
  15285. h2 = obj.height = img.height / img.width * obj.width;
  15286. arr = [x, y2, w2, h2];
  15287. break;
  15288. case "heightFix":
  15289. w2 = obj.width = img.width / img.height * obj.height;
  15290. arr = [x, y2, w2, h2];
  15291. break;
  15292. default:
  15293. arr = [x, y2, w2, h2];
  15294. }
  15295. arr.unshift(isUni ? img.toString() : img);
  15296. rs2({ ...obj, drawImageArgs: [...arr], img, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.height, _calc: true });
  15297. } catch (error) {
  15298. rj(error);
  15299. }
  15300. });
  15301. }
  15302. /**
  15303. * 绘制二维码
  15304. * 诗小柒 的二维码生成器代码
  15305. */
  15306. drawQrCode(obj = {}) {
  15307. return new Promise((rs2, rj) => {
  15308. if (!(obj == null ? void 0 : obj.val)) {
  15309. console.warn("绘制二维码val为空");
  15310. rs2();
  15311. return;
  15312. }
  15313. this.savePaintbrush();
  15314. let qrcodeAlgObjCache = [];
  15315. let options = {
  15316. text: String(obj.val || "") || "",
  15317. // 生成内容
  15318. size: Number(obj.size || 0) || 200,
  15319. // 二维码大小
  15320. background: String(obj.background || "") || "#ffffff",
  15321. // 背景色
  15322. foreground: String(obj.foreground || "") || "#000000",
  15323. // 前景色
  15324. pdground: String(obj.pdground || "") || "#000000",
  15325. // 定位角点颜色
  15326. correctLevel: Number(obj.correctLevel || 0) || 3,
  15327. // 容错级别
  15328. dx: Number(obj.x || 0) || 0,
  15329. // x轴距离
  15330. dy: Number(obj.y || 0) || 0
  15331. // y轴距离
  15332. };
  15333. let qrCodeAlg = null;
  15334. let d2 = 0;
  15335. for (var i2 = 0, l2 = qrcodeAlgObjCache.length; i2 < l2; i2++) {
  15336. d2 = i2;
  15337. if (qrcodeAlgObjCache[i2].text == options.text && qrcodeAlgObjCache[i2].text.correctLevel == options.correctLevel) {
  15338. qrCodeAlg = qrcodeAlgObjCache[i2].obj;
  15339. break;
  15340. }
  15341. }
  15342. if (d2 == l2) {
  15343. qrCodeAlg = new QRCodeAlg(options.text, options.correctLevel);
  15344. qrcodeAlgObjCache.push({
  15345. text: options.text,
  15346. correctLevel: options.correctLevel,
  15347. obj: qrCodeAlg
  15348. });
  15349. }
  15350. let getForeGround = function(config) {
  15351. let options2 = config.options;
  15352. if (options2.pdground && (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 || config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 || config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2)) {
  15353. return options2.pdground;
  15354. }
  15355. return options2.foreground;
  15356. };
  15357. let count = qrCodeAlg.getModuleCount();
  15358. let ratioSize = options.size;
  15359. let tileW = ratioSize / count;
  15360. let tileH = ratioSize / count;
  15361. for (let row = 0; row < count; row++) {
  15362. for (let col = 0; col < count; col++) {
  15363. let w2 = (col + 1) * tileW - col * tileW;
  15364. let h2 = (row + 1) * tileW - row * tileW;
  15365. let foreground = getForeGround({
  15366. row,
  15367. col,
  15368. count,
  15369. options
  15370. });
  15371. this.setPaintbrush({ fillStyle: qrCodeAlg.modules[row][col] ? foreground : options.background });
  15372. this.ctx.fillRect(options.dx + col * tileW, options.dy + row * tileH, w2, h2);
  15373. }
  15374. }
  15375. this.restorePaintbrush();
  15376. rs2({ ...obj, height: obj.size, width: obj.size, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.size });
  15377. });
  15378. }
  15379. /**
  15380. * 圆形
  15381. */
  15382. setCircle(obj = {}) {
  15383. const ctx = this.ctx;
  15384. let { x, y: y2, d: d2, mode } = obj;
  15385. mode = mode || "leftTop";
  15386. const r2 = d2 / 2;
  15387. if (obj.clip)
  15388. ctx.save();
  15389. ctx.beginPath();
  15390. switch (mode) {
  15391. case "leftTop":
  15392. ctx.arc(x + r2, y2 + r2, r2, 0, 2 * Math.PI);
  15393. break;
  15394. case "center":
  15395. ctx.arc(x, y2, r2, 0, 2 * Math.PI);
  15396. break;
  15397. }
  15398. ctx.closePath();
  15399. if (obj.clip)
  15400. ctx.clip();
  15401. return this;
  15402. }
  15403. /**
  15404. * 矩形
  15405. */
  15406. setRect(obj = {}) {
  15407. const ctx = this.ctx;
  15408. const { x, y: y2, r: r2, height, width } = obj;
  15409. if (obj.clip)
  15410. ctx.save();
  15411. ctx.beginPath();
  15412. if (r2 && r2 > 0) {
  15413. ctx.arc(x + r2, y2 + r2, r2, 1 * Math.PI, 1.5 * Math.PI);
  15414. ctx.lineTo(x + width - r2, y2);
  15415. ctx.arc(x + width - r2, y2 + r2, r2, 1.5 * Math.PI, 0);
  15416. ctx.lineTo(x + width, y2 + height - r2);
  15417. ctx.arc(x + width - r2, y2 + height - r2, r2, 0, 0.5 * Math.PI);
  15418. ctx.lineTo(x + r2, y2 + height);
  15419. ctx.arc(x + r2, y2 + height - r2, r2, 0.5 * Math.PI, 1 * Math.PI);
  15420. ctx.lineTo(x, y2 + r2);
  15421. } else {
  15422. ctx.moveTo(x, y2);
  15423. ctx.lineTo(x + width, y2);
  15424. ctx.lineTo(x + width, y2 + height);
  15425. ctx.lineTo(x, y2 + height);
  15426. ctx.lineTo(x, y2);
  15427. }
  15428. ctx.closePath();
  15429. if (obj.clip)
  15430. ctx.clip();
  15431. return this;
  15432. }
  15433. /**
  15434. * 加载图片
  15435. */
  15436. loadImage(url) {
  15437. return new Promise(async (resolve2, reject) => {
  15438. if (!url) {
  15439. console.warn("加载图片url为空");
  15440. resolve2();
  15441. return;
  15442. }
  15443. if (imgCache[url]) {
  15444. resolve2(imgCache[url]);
  15445. return;
  15446. }
  15447. let img;
  15448. try {
  15449. switch (platform) {
  15450. case "uni":
  15451. img = await new Promise((rs2, rj) => {
  15452. if (url._loaded) {
  15453. rs2(url);
  15454. return;
  15455. }
  15456. if (~url.indexOf("data:image")) {
  15457. let tempFilePath = url, imageInfoR = {};
  15458. imgTools.base64ToPath(url).then((t2) => {
  15459. tempFilePath = t2;
  15460. index$1.getImageInfo({
  15461. src: tempFilePath,
  15462. success: (imgInfo) => {
  15463. imageInfoR = imgInfo;
  15464. const uniImg = new String(tempFilePath);
  15465. for (const i2 in imageInfoR)
  15466. uniImg[i2] = imageInfoR[i2];
  15467. uniImg._loaded = true;
  15468. rs2(uniImg);
  15469. },
  15470. fail: (err) => rj(err)
  15471. });
  15472. }).catch((err) => {
  15473. rj(err);
  15474. });
  15475. } else if (url.substr(0, 4) == "http") {
  15476. index$1.downloadFile({
  15477. url,
  15478. success: ({ tempFilePath }) => {
  15479. index$1.getImageInfo({
  15480. src: tempFilePath,
  15481. success: (imageInfoR) => {
  15482. const uniImg = new String(tempFilePath);
  15483. for (const i2 in imageInfoR)
  15484. uniImg[i2] = imageInfoR[i2];
  15485. uniImg._loaded = true;
  15486. rs2(uniImg);
  15487. },
  15488. fail: (err) => rj(err)
  15489. });
  15490. },
  15491. fail: (error) => rj(error)
  15492. });
  15493. } else {
  15494. index$1.getImageInfo({
  15495. src: url,
  15496. success: (imageInfoR) => {
  15497. const uniImg = new String(url);
  15498. for (const i2 in imageInfoR)
  15499. uniImg[i2] = imageInfoR[i2];
  15500. uniImg._loaded = true;
  15501. rs2(uniImg);
  15502. },
  15503. fail: (err) => rj(err)
  15504. });
  15505. }
  15506. });
  15507. break;
  15508. case "web":
  15509. img = await new Promise((rs2, rj) => {
  15510. if (typeof url != "string") {
  15511. rs2(url);
  15512. return;
  15513. }
  15514. const imgObj = new Image();
  15515. imgObj.onload = () => {
  15516. rs2(imgObj);
  15517. };
  15518. imgObj.onerror = (err) => {
  15519. rj(err);
  15520. };
  15521. imgObj.src = url;
  15522. });
  15523. break;
  15524. case "node":
  15525. img = await new Promise((rs2, rj) => {
  15526. if (typeof url != "string") {
  15527. rs2(url);
  15528. return;
  15529. }
  15530. nodeCanvas.loadImage(url).then((res) => {
  15531. rs2(res);
  15532. }).catch((err) => {
  15533. rj(err);
  15534. });
  15535. });
  15536. break;
  15537. }
  15538. } catch (error) {
  15539. reject(error);
  15540. }
  15541. imgCache[url] = img;
  15542. resolve2(img);
  15543. });
  15544. }
  15545. drawArray(data) {
  15546. return new Promise(async (rs2, rj) => {
  15547. try {
  15548. if (!data) {
  15549. rj("drawArray需绘制参数不存在");
  15550. return;
  15551. }
  15552. if (!Array.isArray(data)) {
  15553. rj("drawArray参数需要是Array");
  15554. return;
  15555. }
  15556. data = [...data].sort((a2, b2) => ((a2 == null ? void 0 : a2.zIndex) ?? 0) - ((b2 == null ? void 0 : b2.zIndex) ?? 0));
  15557. const arr = [];
  15558. for (let i2 = 0; i2 < data.length; i2++) {
  15559. const item = data[i2];
  15560. let r2;
  15561. switch (typeof item) {
  15562. case "function":
  15563. r2 = item();
  15564. if (typeof (r2 == null ? void 0 : r2.then) == "function")
  15565. r2 = await r2;
  15566. break;
  15567. case "object":
  15568. if (Array.isArray(item))
  15569. r2 = await this.drawArray(item);
  15570. else
  15571. r2 = await this.drawItem(item);
  15572. break;
  15573. }
  15574. arr.push({ item, result: r2 });
  15575. }
  15576. rs2(arr);
  15577. } catch (error) {
  15578. rj(error);
  15579. }
  15580. });
  15581. }
  15582. drawItem(obj = {}) {
  15583. return new Promise(async (rs2, rj) => {
  15584. var _a2, _b2;
  15585. try {
  15586. let r2;
  15587. switch (obj.type) {
  15588. case "text":
  15589. r2 = await this.drawText(obj);
  15590. break;
  15591. case "image":
  15592. r2 = await this.drawImg(obj);
  15593. break;
  15594. case "qrcode":
  15595. r2 = await this.drawQrCode(obj);
  15596. break;
  15597. case "method":
  15598. r2 = (_a2 = this[obj.name]) == null ? void 0 : _a2.call(this, ...obj.data ? Array.isArray(obj.data) ? obj.data : [obj.data] : []);
  15599. if (typeof (r2 == null ? void 0 : r2.then) == "function")
  15600. r2 = await r2;
  15601. break;
  15602. case "function":
  15603. r2 = (_b2 = obj.val) == null ? void 0 : _b2.call(obj);
  15604. if (typeof (r2 == null ? void 0 : r2.then) == "function")
  15605. r2 = await r2;
  15606. break;
  15607. }
  15608. rs2(r2);
  15609. } catch (error) {
  15610. rj(error);
  15611. }
  15612. });
  15613. }
  15614. drawRichText(html) {
  15615. return new Promise(async (rs2, rj) => {
  15616. if (!html) {
  15617. rj("drawRichText需绘制参数不存在");
  15618. return;
  15619. }
  15620. if (typeof html == "string")
  15621. html = htmlParse(html);
  15622. const result2 = [];
  15623. function run(arr, parent) {
  15624. return new Promise(async (res, rej) => {
  15625. var _a2;
  15626. for (let i2 = 0; i2 < arr.length; i2++) {
  15627. const item = arr[i2];
  15628. if (item.type == "text")
  15629. ;
  15630. else {
  15631. switch (item.name) {
  15632. }
  15633. }
  15634. result2.push(item);
  15635. if ((_a2 = item.children) == null ? void 0 : _a2.length) {
  15636. item.__handle = function(obj) {
  15637. };
  15638. try {
  15639. await run(item.children, item);
  15640. } catch (error) {
  15641. rej(error);
  15642. return;
  15643. }
  15644. }
  15645. }
  15646. res(result2);
  15647. });
  15648. }
  15649. try {
  15650. rs2({ html, htmlParses: await run(html) });
  15651. } catch (error) {
  15652. rj(error);
  15653. }
  15654. });
  15655. }
  15656. };
  15657. let QSCanvas2 = _QSCanvas;
  15658. _nc = new WeakMap();
  15659. function filterPaintbrushProps(obj) {
  15660. switch (obj == null ? void 0 : obj.textBaseline) {
  15661. case "normal":
  15662. if (isUni)
  15663. obj.textBaseline = "alphabetic";
  15664. break;
  15665. case "hanging":
  15666. if (isUni)
  15667. obj.textBaseline = "top";
  15668. break;
  15669. case "ideographic":
  15670. if (isUni)
  15671. obj.textBaseline = "bottom";
  15672. break;
  15673. }
  15674. switch (obj == null ? void 0 : obj.textAlign) {
  15675. case "start":
  15676. obj.textAlign = "left";
  15677. break;
  15678. case "end":
  15679. obj.textAlign = "right";
  15680. break;
  15681. }
  15682. }
  15683. function hyphen2Hump(s2) {
  15684. if (!s2)
  15685. return "";
  15686. const arr = s2.split("-");
  15687. for (var i2 = 1; i2 < arr.length; i2++) {
  15688. arr[i2] = arr[i2].charAt(0).toUpperCase() + arr[i2].substring(1);
  15689. }
  15690. return arr.join("");
  15691. }
  15692. function getPoints(x1, y1, x2, y2, pointCount, level) {
  15693. let a2, b2, rSquare, k, kv, points = [];
  15694. if (x1 === x2) {
  15695. a2 = x1 + (y2 - y1) * level;
  15696. b2 = y1 + (y2 - y1) / 2;
  15697. rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
  15698. } else if (y1 === y2) {
  15699. a2 = x1 + (x2 - x1) / 2;
  15700. b2 = y1 - (x2 - x1) * level;
  15701. rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
  15702. } else {
  15703. let xc = (x1 + x2) / 2, yc = (y1 + y2) / 2, lenSquare = ((x2 - x1) ** 2 + (y2 - y1) ** 2) * level ** 2;
  15704. k = (x2 - x1) / (y1 - y2);
  15705. let l2 = yc - k * xc;
  15706. let a1 = 1 + k ** 2, b1 = 2 * k * (l2 - yc) - 2 * xc, c1 = xc ** 2 + (l2 - yc) ** 2 - lenSquare;
  15707. kv = -1 / k;
  15708. a2 = (-b1 + Math.sqrt(b1 ** 2 - 4 * a1 * c1) * (kv > 0 && x2 > x1 || kv < 0 && x2 < x1 ? 1 : -1)) / (2 * a1);
  15709. b2 = k * a2 + l2;
  15710. rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
  15711. }
  15712. if (x1 === x2 || Math.abs(kv) > 1) {
  15713. let yDistance = y2 - y1;
  15714. let yDis = yDistance / (pointCount + 1);
  15715. for (let i2 = 0; i2 < pointCount; i2++) {
  15716. let y3 = y1 + yDis * (i2 + 1);
  15717. let x = Math.sqrt(rSquare - (y3 - b2) ** 2) * (y2 > y1 ? -1 : 1) + a2;
  15718. points.push([x, y3]);
  15719. }
  15720. } else {
  15721. let xDistance = x2 - x1;
  15722. let xDis = xDistance / (pointCount + 1);
  15723. for (let i2 = 0; i2 < pointCount; i2++) {
  15724. let x = x1 + xDis * (i2 + 1);
  15725. let y3 = Math.sqrt(rSquare - (x - a2) ** 2) * (x2 > x1 ? 1 : -1) + b2;
  15726. points.push([x, y3]);
  15727. }
  15728. }
  15729. return points;
  15730. }
  15731. var QRCodeAlg = function() {
  15732. function unicodeFormat8(code) {
  15733. var c0, c1, c2;
  15734. if (code < 128) {
  15735. return [code];
  15736. } else if (code < 2048) {
  15737. c0 = 192 + (code >> 6);
  15738. c1 = 128 + (code & 63);
  15739. return [c0, c1];
  15740. } else {
  15741. c0 = 224 + (code >> 12);
  15742. c1 = 128 + (code >> 6 & 63);
  15743. c2 = 128 + (code & 63);
  15744. return [c0, c1, c2];
  15745. }
  15746. }
  15747. function getUTF8Bytes(string) {
  15748. var utf8codes = [];
  15749. for (var i3 = 0; i3 < string.length; i3++) {
  15750. var code = string.charCodeAt(i3);
  15751. var utf8 = unicodeFormat8(code);
  15752. for (var j2 = 0; j2 < utf8.length; j2++) {
  15753. utf8codes.push(utf8[j2]);
  15754. }
  15755. }
  15756. return utf8codes;
  15757. }
  15758. function QRCodeAlg2(data, errorCorrectLevel) {
  15759. this.typeNumber = -1;
  15760. this.errorCorrectLevel = errorCorrectLevel;
  15761. this.modules = null;
  15762. this.moduleCount = 0;
  15763. this.dataCache = null;
  15764. this.rsBlocks = null;
  15765. this.totalDataCount = -1;
  15766. this.data = data;
  15767. this.utf8bytes = getUTF8Bytes(data);
  15768. this.make();
  15769. }
  15770. QRCodeAlg2.prototype = { constructor: QRCodeAlg2, getModuleCount: function() {
  15771. return this.moduleCount;
  15772. }, make: function() {
  15773. this.getRightType();
  15774. this.dataCache = this.createData();
  15775. this.createQrcode();
  15776. }, makeImpl: function(maskPattern) {
  15777. this.moduleCount = this.typeNumber * 4 + 17;
  15778. this.modules = new Array(this.moduleCount);
  15779. for (var row = 0; row < this.moduleCount; row++) {
  15780. this.modules[row] = new Array(this.moduleCount);
  15781. }
  15782. this.setupPositionProbePattern(0, 0);
  15783. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  15784. this.setupPositionProbePattern(0, this.moduleCount - 7);
  15785. this.setupPositionAdjustPattern();
  15786. this.setupTimingPattern();
  15787. this.setupTypeInfo(true, maskPattern);
  15788. if (this.typeNumber >= 7) {
  15789. this.setupTypeNumber(true);
  15790. }
  15791. this.mapData(this.dataCache, maskPattern);
  15792. }, setupPositionProbePattern: function(row, col) {
  15793. for (var r2 = -1; r2 <= 7; r2++) {
  15794. if (row + r2 <= -1 || this.moduleCount <= row + r2)
  15795. continue;
  15796. for (var c2 = -1; c2 <= 7; c2++) {
  15797. if (col + c2 <= -1 || this.moduleCount <= col + c2)
  15798. continue;
  15799. if (0 <= r2 && r2 <= 6 && (c2 == 0 || c2 == 6) || 0 <= c2 && c2 <= 6 && (r2 == 0 || r2 == 6) || 2 <= r2 && r2 <= 4 && 2 <= c2 && c2 <= 4) {
  15800. this.modules[row + r2][col + c2] = true;
  15801. } else {
  15802. this.modules[row + r2][col + c2] = false;
  15803. }
  15804. }
  15805. }
  15806. }, createQrcode: function() {
  15807. var minLostPoint = 0;
  15808. var pattern = 0;
  15809. var bestModules = null;
  15810. for (var i3 = 0; i3 < 8; i3++) {
  15811. this.makeImpl(i3);
  15812. var lostPoint = QRUtil.getLostPoint(this);
  15813. if (i3 == 0 || minLostPoint > lostPoint) {
  15814. minLostPoint = lostPoint;
  15815. pattern = i3;
  15816. bestModules = this.modules;
  15817. }
  15818. }
  15819. this.modules = bestModules;
  15820. this.setupTypeInfo(false, pattern);
  15821. if (this.typeNumber >= 7) {
  15822. this.setupTypeNumber(false);
  15823. }
  15824. }, setupTimingPattern: function() {
  15825. for (var r2 = 8; r2 < this.moduleCount - 8; r2++) {
  15826. if (this.modules[r2][6] != null) {
  15827. continue;
  15828. }
  15829. this.modules[r2][6] = r2 % 2 == 0;
  15830. if (this.modules[6][r2] != null) {
  15831. continue;
  15832. }
  15833. this.modules[6][r2] = r2 % 2 == 0;
  15834. }
  15835. }, setupPositionAdjustPattern: function() {
  15836. var pos = QRUtil.getPatternPosition(this.typeNumber);
  15837. for (var i3 = 0; i3 < pos.length; i3++) {
  15838. for (var j2 = 0; j2 < pos.length; j2++) {
  15839. var row = pos[i3];
  15840. var col = pos[j2];
  15841. if (this.modules[row][col] != null) {
  15842. continue;
  15843. }
  15844. for (var r2 = -2; r2 <= 2; r2++) {
  15845. for (var c2 = -2; c2 <= 2; c2++) {
  15846. if (r2 == -2 || r2 == 2 || c2 == -2 || c2 == 2 || r2 == 0 && c2 == 0) {
  15847. this.modules[row + r2][col + c2] = true;
  15848. } else {
  15849. this.modules[row + r2][col + c2] = false;
  15850. }
  15851. }
  15852. }
  15853. }
  15854. }
  15855. }, setupTypeNumber: function(test) {
  15856. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  15857. for (var i3 = 0; i3 < 18; i3++) {
  15858. var mod = !test && (bits >> i3 & 1) == 1;
  15859. this.modules[Math.floor(i3 / 3)][i3 % 3 + this.moduleCount - 8 - 3] = mod;
  15860. this.modules[i3 % 3 + this.moduleCount - 8 - 3][Math.floor(i3 / 3)] = mod;
  15861. }
  15862. }, setupTypeInfo: function(test, maskPattern) {
  15863. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  15864. var bits = QRUtil.getBCHTypeInfo(data);
  15865. for (var i3 = 0; i3 < 15; i3++) {
  15866. var mod = !test && (bits >> i3 & 1) == 1;
  15867. if (i3 < 6) {
  15868. this.modules[i3][8] = mod;
  15869. } else if (i3 < 8) {
  15870. this.modules[i3 + 1][8] = mod;
  15871. } else {
  15872. this.modules[this.moduleCount - 15 + i3][8] = mod;
  15873. }
  15874. var mod = !test && (bits >> i3 & 1) == 1;
  15875. if (i3 < 8) {
  15876. this.modules[8][this.moduleCount - i3 - 1] = mod;
  15877. } else if (i3 < 9) {
  15878. this.modules[8][15 - i3 - 1 + 1] = mod;
  15879. } else {
  15880. this.modules[8][15 - i3 - 1] = mod;
  15881. }
  15882. }
  15883. this.modules[this.moduleCount - 8][8] = !test;
  15884. }, createData: function() {
  15885. var buffer2 = new QRBitBuffer();
  15886. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  15887. buffer2.put(4, 4);
  15888. buffer2.put(this.utf8bytes.length, lengthBits);
  15889. for (var i3 = 0, l2 = this.utf8bytes.length; i3 < l2; i3++) {
  15890. buffer2.put(this.utf8bytes[i3], 8);
  15891. }
  15892. if (buffer2.length + 4 <= this.totalDataCount * 8) {
  15893. buffer2.put(0, 4);
  15894. }
  15895. while (buffer2.length % 8 != 0) {
  15896. buffer2.putBit(false);
  15897. }
  15898. while (true) {
  15899. if (buffer2.length >= this.totalDataCount * 8) {
  15900. break;
  15901. }
  15902. buffer2.put(QRCodeAlg2.PAD0, 8);
  15903. if (buffer2.length >= this.totalDataCount * 8) {
  15904. break;
  15905. }
  15906. buffer2.put(QRCodeAlg2.PAD1, 8);
  15907. }
  15908. return this.createBytes(buffer2);
  15909. }, createBytes: function(buffer2) {
  15910. var offset = 0;
  15911. var maxDcCount = 0;
  15912. var maxEcCount = 0;
  15913. var length = this.rsBlock.length / 3;
  15914. var rsBlocks = new Array();
  15915. for (var i3 = 0; i3 < length; i3++) {
  15916. var count = this.rsBlock[i3 * 3 + 0];
  15917. var totalCount = this.rsBlock[i3 * 3 + 1];
  15918. var dataCount = this.rsBlock[i3 * 3 + 2];
  15919. for (var j2 = 0; j2 < count; j2++) {
  15920. rsBlocks.push([dataCount, totalCount]);
  15921. }
  15922. }
  15923. var dcdata = new Array(rsBlocks.length);
  15924. var ecdata = new Array(rsBlocks.length);
  15925. for (var r2 = 0; r2 < rsBlocks.length; r2++) {
  15926. var dcCount = rsBlocks[r2][0];
  15927. var ecCount = rsBlocks[r2][1] - dcCount;
  15928. maxDcCount = Math.max(maxDcCount, dcCount);
  15929. maxEcCount = Math.max(maxEcCount, ecCount);
  15930. dcdata[r2] = new Array(dcCount);
  15931. for (var i3 = 0; i3 < dcdata[r2].length; i3++) {
  15932. dcdata[r2][i3] = 255 & buffer2.buffer[i3 + offset];
  15933. }
  15934. offset += dcCount;
  15935. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  15936. var rawPoly = new QRPolynomial(dcdata[r2], rsPoly.getLength() - 1);
  15937. var modPoly = rawPoly.mod(rsPoly);
  15938. ecdata[r2] = new Array(rsPoly.getLength() - 1);
  15939. for (var i3 = 0; i3 < ecdata[r2].length; i3++) {
  15940. var modIndex = i3 + modPoly.getLength() - ecdata[r2].length;
  15941. ecdata[r2][i3] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  15942. }
  15943. }
  15944. var data = new Array(this.totalDataCount);
  15945. var index2 = 0;
  15946. for (var i3 = 0; i3 < maxDcCount; i3++) {
  15947. for (var r2 = 0; r2 < rsBlocks.length; r2++) {
  15948. if (i3 < dcdata[r2].length) {
  15949. data[index2++] = dcdata[r2][i3];
  15950. }
  15951. }
  15952. }
  15953. for (var i3 = 0; i3 < maxEcCount; i3++) {
  15954. for (var r2 = 0; r2 < rsBlocks.length; r2++) {
  15955. if (i3 < ecdata[r2].length) {
  15956. data[index2++] = ecdata[r2][i3];
  15957. }
  15958. }
  15959. }
  15960. return data;
  15961. }, mapData: function(data, maskPattern) {
  15962. var inc = -1;
  15963. var row = this.moduleCount - 1;
  15964. var bitIndex = 7;
  15965. var byteIndex = 0;
  15966. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  15967. if (col == 6)
  15968. col--;
  15969. while (true) {
  15970. for (var c2 = 0; c2 < 2; c2++) {
  15971. if (this.modules[row][col - c2] == null) {
  15972. var dark = false;
  15973. if (byteIndex < data.length) {
  15974. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  15975. }
  15976. var mask = QRUtil.getMask(maskPattern, row, col - c2);
  15977. if (mask) {
  15978. dark = !dark;
  15979. }
  15980. this.modules[row][col - c2] = dark;
  15981. bitIndex--;
  15982. if (bitIndex == -1) {
  15983. byteIndex++;
  15984. bitIndex = 7;
  15985. }
  15986. }
  15987. }
  15988. row += inc;
  15989. if (row < 0 || this.moduleCount <= row) {
  15990. row -= inc;
  15991. inc = -inc;
  15992. break;
  15993. }
  15994. }
  15995. }
  15996. } };
  15997. QRCodeAlg2.PAD0 = 236;
  15998. QRCodeAlg2.PAD1 = 17;
  15999. var QRErrorCorrectLevel = [1, 0, 3, 2];
  16000. var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };
  16001. var QRUtil = { PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0, G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0, G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1, getBCHTypeInfo: function(data) {
  16002. var d2 = data << 10;
  16003. while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  16004. d2 ^= QRUtil.G15 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15);
  16005. }
  16006. return (data << 10 | d2) ^ QRUtil.G15_MASK;
  16007. }, getBCHTypeNumber: function(data) {
  16008. var d2 = data << 12;
  16009. while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  16010. d2 ^= QRUtil.G18 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18);
  16011. }
  16012. return data << 12 | d2;
  16013. }, getBCHDigit: function(data) {
  16014. var digit = 0;
  16015. while (data != 0) {
  16016. digit++;
  16017. data >>>= 1;
  16018. }
  16019. return digit;
  16020. }, getPatternPosition: function(typeNumber) {
  16021. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  16022. }, getMask: function(maskPattern, i3, j2) {
  16023. switch (maskPattern) {
  16024. case QRMaskPattern.PATTERN000:
  16025. return (i3 + j2) % 2 == 0;
  16026. case QRMaskPattern.PATTERN001:
  16027. return i3 % 2 == 0;
  16028. case QRMaskPattern.PATTERN010:
  16029. return j2 % 3 == 0;
  16030. case QRMaskPattern.PATTERN011:
  16031. return (i3 + j2) % 3 == 0;
  16032. case QRMaskPattern.PATTERN100:
  16033. return (Math.floor(i3 / 2) + Math.floor(j2 / 3)) % 2 == 0;
  16034. case QRMaskPattern.PATTERN101:
  16035. return i3 * j2 % 2 + i3 * j2 % 3 == 0;
  16036. case QRMaskPattern.PATTERN110:
  16037. return (i3 * j2 % 2 + i3 * j2 % 3) % 2 == 0;
  16038. case QRMaskPattern.PATTERN111:
  16039. return (i3 * j2 % 3 + (i3 + j2) % 2) % 2 == 0;
  16040. default:
  16041. throw new Error("bad maskPattern:" + maskPattern);
  16042. }
  16043. }, getErrorCorrectPolynomial: function(errorCorrectLength) {
  16044. var a2 = new QRPolynomial([1], 0);
  16045. for (var i3 = 0; i3 < errorCorrectLength; i3++) {
  16046. a2 = a2.multiply(new QRPolynomial([1, QRMath.gexp(i3)], 0));
  16047. }
  16048. return a2;
  16049. }, getLostPoint: function(qrCode) {
  16050. var moduleCount = qrCode.getModuleCount(), lostPoint = 0, darkCount = 0;
  16051. for (var row = 0; row < moduleCount; row++) {
  16052. var sameCount = 0;
  16053. var head = qrCode.modules[row][0];
  16054. for (var col = 0; col < moduleCount; col++) {
  16055. var current = qrCode.modules[row][col];
  16056. if (col < moduleCount - 6) {
  16057. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  16058. if (col < moduleCount - 10) {
  16059. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  16060. lostPoint += 40;
  16061. }
  16062. } else if (col > 3) {
  16063. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  16064. lostPoint += 40;
  16065. }
  16066. }
  16067. }
  16068. }
  16069. if (row < moduleCount - 1 && col < moduleCount - 1) {
  16070. var count = 0;
  16071. if (current)
  16072. count++;
  16073. if (qrCode.modules[row + 1][col])
  16074. count++;
  16075. if (qrCode.modules[row][col + 1])
  16076. count++;
  16077. if (qrCode.modules[row + 1][col + 1])
  16078. count++;
  16079. if (count == 0 || count == 4) {
  16080. lostPoint += 3;
  16081. }
  16082. }
  16083. if (head ^ current) {
  16084. sameCount++;
  16085. } else {
  16086. head = current;
  16087. if (sameCount >= 5) {
  16088. lostPoint += 3 + sameCount - 5;
  16089. }
  16090. sameCount = 1;
  16091. }
  16092. if (current) {
  16093. darkCount++;
  16094. }
  16095. }
  16096. }
  16097. for (var col = 0; col < moduleCount; col++) {
  16098. var sameCount = 0;
  16099. var head = qrCode.modules[0][col];
  16100. for (var row = 0; row < moduleCount; row++) {
  16101. var current = qrCode.modules[row][col];
  16102. if (row < moduleCount - 6) {
  16103. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  16104. if (row < moduleCount - 10) {
  16105. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  16106. lostPoint += 40;
  16107. }
  16108. } else if (row > 3) {
  16109. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  16110. lostPoint += 40;
  16111. }
  16112. }
  16113. }
  16114. }
  16115. if (head ^ current) {
  16116. sameCount++;
  16117. } else {
  16118. head = current;
  16119. if (sameCount >= 5) {
  16120. lostPoint += 3 + sameCount - 5;
  16121. }
  16122. sameCount = 1;
  16123. }
  16124. }
  16125. }
  16126. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  16127. lostPoint += ratio * 10;
  16128. return lostPoint;
  16129. } };
  16130. var QRMath = { glog: function(n2) {
  16131. if (n2 < 1) {
  16132. throw new Error("glog(" + n2 + ")");
  16133. }
  16134. return QRMath.LOG_TABLE[n2];
  16135. }, gexp: function(n2) {
  16136. while (n2 < 0) {
  16137. n2 += 255;
  16138. }
  16139. while (n2 >= 256) {
  16140. n2 -= 255;
  16141. }
  16142. return QRMath.EXP_TABLE[n2];
  16143. }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256) };
  16144. for (var i2 = 0; i2 < 8; i2++) {
  16145. QRMath.EXP_TABLE[i2] = 1 << i2;
  16146. }
  16147. for (var i2 = 8; i2 < 256; i2++) {
  16148. QRMath.EXP_TABLE[i2] = QRMath.EXP_TABLE[i2 - 4] ^ QRMath.EXP_TABLE[i2 - 5] ^ QRMath.EXP_TABLE[i2 - 6] ^ QRMath.EXP_TABLE[i2 - 8];
  16149. }
  16150. for (var i2 = 0; i2 < 255; i2++) {
  16151. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i2]] = i2;
  16152. }
  16153. function QRPolynomial(num, shift) {
  16154. if (num.length == void 0) {
  16155. throw new Error(num.length + "/" + shift);
  16156. }
  16157. var offset = 0;
  16158. while (offset < num.length && num[offset] == 0) {
  16159. offset++;
  16160. }
  16161. this.num = new Array(num.length - offset + shift);
  16162. for (var i3 = 0; i3 < num.length - offset; i3++) {
  16163. this.num[i3] = num[i3 + offset];
  16164. }
  16165. }
  16166. QRPolynomial.prototype = { get: function(index2) {
  16167. return this.num[index2];
  16168. }, getLength: function() {
  16169. return this.num.length;
  16170. }, multiply: function(e2) {
  16171. var num = new Array(this.getLength() + e2.getLength() - 1);
  16172. for (var i3 = 0; i3 < this.getLength(); i3++) {
  16173. for (var j2 = 0; j2 < e2.getLength(); j2++) {
  16174. num[i3 + j2] ^= QRMath.gexp(QRMath.glog(this.get(i3)) + QRMath.glog(e2.get(j2)));
  16175. }
  16176. }
  16177. return new QRPolynomial(num, 0);
  16178. }, mod: function(e2) {
  16179. var tl = this.getLength(), el = e2.getLength();
  16180. if (tl - el < 0) {
  16181. return this;
  16182. }
  16183. var num = new Array(tl);
  16184. for (var i3 = 0; i3 < tl; i3++) {
  16185. num[i3] = this.get(i3);
  16186. }
  16187. while (num.length >= el) {
  16188. var ratio = QRMath.glog(num[0]) - QRMath.glog(e2.get(0));
  16189. for (var i3 = 0; i3 < e2.getLength(); i3++) {
  16190. num[i3] ^= QRMath.gexp(QRMath.glog(e2.get(i3)) + ratio);
  16191. }
  16192. while (num[0] == 0) {
  16193. num.shift();
  16194. }
  16195. }
  16196. return new QRPolynomial(num, 0);
  16197. } };
  16198. var RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  16199. QRCodeAlg2.prototype.getRightType = function() {
  16200. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  16201. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  16202. if (rsBlock == void 0) {
  16203. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  16204. }
  16205. var length = rsBlock.length / 3;
  16206. var totalDataCount = 0;
  16207. for (var i3 = 0; i3 < length; i3++) {
  16208. var count = rsBlock[i3 * 3 + 0];
  16209. var dataCount = rsBlock[i3 * 3 + 2];
  16210. totalDataCount += dataCount * count;
  16211. }
  16212. var lengthBytes = typeNumber > 9 ? 2 : 1;
  16213. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  16214. this.typeNumber = typeNumber;
  16215. this.rsBlock = rsBlock;
  16216. this.totalDataCount = totalDataCount;
  16217. break;
  16218. }
  16219. }
  16220. };
  16221. function QRBitBuffer() {
  16222. this.buffer = new Array();
  16223. this.length = 0;
  16224. }
  16225. QRBitBuffer.prototype = { get: function(index2) {
  16226. var bufIndex = Math.floor(index2 / 8);
  16227. return this.buffer[bufIndex] >>> 7 - index2 % 8 & 1;
  16228. }, put: function(num, length) {
  16229. for (var i3 = 0; i3 < length; i3++) {
  16230. this.putBit(num >>> length - i3 - 1 & 1);
  16231. }
  16232. }, putBit: function(bit) {
  16233. var bufIndex = Math.floor(this.length / 8);
  16234. if (this.buffer.length <= bufIndex) {
  16235. this.buffer.push(0);
  16236. }
  16237. if (bit) {
  16238. this.buffer[bufIndex] |= 128 >>> this.length % 8;
  16239. }
  16240. this.length++;
  16241. } };
  16242. return QRCodeAlg2;
  16243. }();
  16244. var htmlParse = function() {
  16245. var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
  16246. var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
  16247. var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
  16248. var empty = makeMap2("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
  16249. var block = makeMap2("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
  16250. var inline = makeMap2("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
  16251. var closeSelf = makeMap2("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
  16252. var fillAttrs = makeMap2("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
  16253. var special = makeMap2("script,style");
  16254. function HTMLParser(html, handler) {
  16255. var index2;
  16256. var chars;
  16257. var match;
  16258. var stack2 = [];
  16259. var last = html;
  16260. stack2.last = function() {
  16261. return this[this.length - 1];
  16262. };
  16263. while (html) {
  16264. chars = true;
  16265. if (!stack2.last() || !special[stack2.last()]) {
  16266. if (html.indexOf("<!--") == 0) {
  16267. index2 = html.indexOf("-->");
  16268. if (index2 >= 0) {
  16269. if (handler.comment) {
  16270. handler.comment(html.substring(4, index2));
  16271. }
  16272. html = html.substring(index2 + 3);
  16273. chars = false;
  16274. }
  16275. } else if (html.indexOf("</") == 0) {
  16276. match = html.match(endTag);
  16277. if (match) {
  16278. html = html.substring(match[0].length);
  16279. match[0].replace(endTag, parseEndTag);
  16280. chars = false;
  16281. }
  16282. } else if (html.indexOf("<") == 0) {
  16283. match = html.match(startTag);
  16284. if (match) {
  16285. html = html.substring(match[0].length);
  16286. match[0].replace(startTag, parseStartTag);
  16287. chars = false;
  16288. }
  16289. }
  16290. if (chars) {
  16291. index2 = html.indexOf("<");
  16292. var text = index2 < 0 ? html : html.substring(0, index2);
  16293. html = index2 < 0 ? "" : html.substring(index2);
  16294. if (handler.chars) {
  16295. handler.chars(text);
  16296. }
  16297. }
  16298. } else {
  16299. html = html.replace(new RegExp("([\\s\\S]*?)</" + stack2.last() + "[^>]*>"), function(all, text2) {
  16300. text2 = text2.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
  16301. if (handler.chars) {
  16302. handler.chars(text2);
  16303. }
  16304. return "";
  16305. });
  16306. parseEndTag("", stack2.last());
  16307. }
  16308. if (html == last) {
  16309. throw "Parse Error: " + html;
  16310. }
  16311. last = html;
  16312. }
  16313. parseEndTag();
  16314. function parseStartTag(tag, tagName, rest, unary) {
  16315. tagName = tagName.toLowerCase();
  16316. if (block[tagName]) {
  16317. while (stack2.last() && inline[stack2.last()]) {
  16318. parseEndTag("", stack2.last());
  16319. }
  16320. }
  16321. if (closeSelf[tagName] && stack2.last() == tagName) {
  16322. parseEndTag("", tagName);
  16323. }
  16324. unary = empty[tagName] || !!unary;
  16325. if (!unary) {
  16326. stack2.push(tagName);
  16327. }
  16328. if (handler.start) {
  16329. var attrs = [];
  16330. rest.replace(attr, function(match2, name) {
  16331. var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : "";
  16332. attrs.push({ name, value, escaped: value.replace(/(^|[^\\])"/g, '$1\\"') });
  16333. });
  16334. if (handler.start) {
  16335. handler.start(tagName, attrs, unary);
  16336. }
  16337. }
  16338. }
  16339. function parseEndTag(tag, tagName) {
  16340. if (!tagName) {
  16341. var pos = 0;
  16342. } else {
  16343. for (var pos = stack2.length - 1; pos >= 0; pos--) {
  16344. if (stack2[pos] == tagName) {
  16345. break;
  16346. }
  16347. }
  16348. }
  16349. if (pos >= 0) {
  16350. for (var i2 = stack2.length - 1; i2 >= pos; i2--) {
  16351. if (handler.end) {
  16352. handler.end(stack2[i2]);
  16353. }
  16354. }
  16355. stack2.length = pos;
  16356. }
  16357. }
  16358. }
  16359. function makeMap2(str) {
  16360. var obj = {};
  16361. var items = str.split(",");
  16362. for (var i2 = 0; i2 < items.length; i2++) {
  16363. obj[items[i2]] = true;
  16364. }
  16365. return obj;
  16366. }
  16367. function removeDOCTYPE(html) {
  16368. return html.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*>\n/, "").replace(/<!DOCTYPE.*>\n/, "");
  16369. }
  16370. function parseAttrs(attrs) {
  16371. return attrs.reduce(function(pre, attr2) {
  16372. var value = attr2.value;
  16373. var name = attr2.name;
  16374. if (pre[name]) {
  16375. pre[name] = pre[name] + " " + value;
  16376. } else {
  16377. pre[name] = value;
  16378. }
  16379. return pre;
  16380. }, {});
  16381. }
  16382. function parseHtml(html) {
  16383. html = removeDOCTYPE(html);
  16384. var stacks = [];
  16385. var results = { node: "root", children: [] };
  16386. HTMLParser(html, { start: function start(tag, attrs, unary) {
  16387. var node = { name: tag };
  16388. if (attrs.length !== 0) {
  16389. node.attrs = parseAttrs(attrs);
  16390. }
  16391. if (unary) {
  16392. var parent = stacks[0] || results;
  16393. if (!parent.children) {
  16394. parent.children = [];
  16395. }
  16396. parent.children.push(node);
  16397. } else {
  16398. stacks.unshift(node);
  16399. }
  16400. }, end: function end(tag) {
  16401. var node = stacks.shift();
  16402. if (node.name !== tag)
  16403. console.error("invalid state: mismatch end tag");
  16404. if (stacks.length === 0) {
  16405. results.children.push(node);
  16406. } else {
  16407. var parent = stacks[0];
  16408. if (!parent.children) {
  16409. parent.children = [];
  16410. }
  16411. parent.children.push(node);
  16412. }
  16413. }, chars: function chars(text) {
  16414. var node = { type: "text", text };
  16415. if (stacks.length === 0) {
  16416. results.children.push(node);
  16417. } else {
  16418. var parent = stacks[0];
  16419. if (!parent.children) {
  16420. parent.children = [];
  16421. }
  16422. parent.children.push(node);
  16423. }
  16424. }, comment: function comment(text) {
  16425. var node = { node: "comment", text };
  16426. var parent = stacks[0];
  16427. if (!parent.children) {
  16428. parent.children = [];
  16429. }
  16430. parent.children.push(node);
  16431. } });
  16432. return results.children;
  16433. }
  16434. return parseHtml;
  16435. }();
  16436. var imgTools = function() {
  16437. function getLocalFilePath(path) {
  16438. if (path.indexOf("_www") === 0 || path.indexOf("_doc") === 0 || path.indexOf("_documents") === 0 || path.indexOf("_downloads") === 0) {
  16439. return path;
  16440. }
  16441. if (path.indexOf("file://") === 0) {
  16442. return path;
  16443. }
  16444. if (path.indexOf("/storage/emulated/0/") === 0) {
  16445. return path;
  16446. }
  16447. if (path.indexOf("/") === 0) {
  16448. var localFilePath = plus.io.convertAbsoluteFileSystem(path);
  16449. if (localFilePath !== path) {
  16450. return localFilePath;
  16451. } else {
  16452. path = path.substr(1);
  16453. }
  16454. }
  16455. return "_www/" + path;
  16456. }
  16457. function dataUrlToBase64(str) {
  16458. var array = str.split(",");
  16459. return array[array.length - 1];
  16460. }
  16461. var index2 = 0;
  16462. function getNewFileId() {
  16463. return Date.now() + String(index2++);
  16464. }
  16465. function biggerThan(v1, v2) {
  16466. var v1Array = v1.split(".");
  16467. var v2Array = v2.split(".");
  16468. var update = false;
  16469. for (var index3 = 0; index3 < v2Array.length; index3++) {
  16470. var diff2 = v1Array[index3] - v2Array[index3];
  16471. if (diff2 !== 0) {
  16472. update = diff2 > 0;
  16473. break;
  16474. }
  16475. }
  16476. return update;
  16477. }
  16478. function pathToBase64(path) {
  16479. return new Promise(function(resolve2, reject) {
  16480. if (typeof window === "object" && "document" in window) {
  16481. if (typeof FileReader === "function") {
  16482. var xhr = new XMLHttpRequest();
  16483. xhr.open("GET", path, true);
  16484. xhr.responseType = "blob";
  16485. xhr.onload = function() {
  16486. if (this.status === 200) {
  16487. let fileReader = new FileReader();
  16488. fileReader.onload = function(e2) {
  16489. resolve2(e2.target.result);
  16490. };
  16491. fileReader.onerror = reject;
  16492. fileReader.readAsDataURL(this.response);
  16493. }
  16494. };
  16495. xhr.onerror = reject;
  16496. xhr.send();
  16497. return;
  16498. }
  16499. var canvas = document.createElement("canvas");
  16500. var c2x = canvas.getContext("2d");
  16501. var img = new Image();
  16502. img.onload = function() {
  16503. canvas.width = img.width;
  16504. canvas.height = img.height;
  16505. c2x.drawImage(img, 0, 0);
  16506. resolve2(canvas.toDataURL());
  16507. canvas.height = canvas.width = 0;
  16508. };
  16509. img.onerror = reject;
  16510. img.src = path;
  16511. return;
  16512. }
  16513. if (typeof plus === "object") {
  16514. plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
  16515. entry.file(function(file) {
  16516. var fileReader = new plus.io.FileReader();
  16517. fileReader.onload = function(data) {
  16518. resolve2(data.target.result);
  16519. };
  16520. fileReader.onerror = function(error) {
  16521. reject(error);
  16522. };
  16523. fileReader.readAsDataURL(file);
  16524. }, function(error) {
  16525. reject(error);
  16526. });
  16527. }, function(error) {
  16528. reject(error);
  16529. });
  16530. return;
  16531. }
  16532. if (typeof wx$1 === "object" && wx$1.canIUse("getFileSystemManager")) {
  16533. wx$1.getFileSystemManager().readFile({
  16534. filePath: path,
  16535. encoding: "base64",
  16536. success: function(res) {
  16537. resolve2("data:image/png;base64," + res.data);
  16538. },
  16539. fail: function(error) {
  16540. reject(error);
  16541. }
  16542. });
  16543. return;
  16544. }
  16545. reject(new Error("not support"));
  16546. });
  16547. }
  16548. function base64ToPath(base64) {
  16549. return new Promise(function(resolve2, reject) {
  16550. if (typeof window === "object" && "document" in window) {
  16551. base64 = base64.split(",");
  16552. var type = base64[0].match(/:(.*?);/)[1];
  16553. var str = atob(base64[1]);
  16554. var n2 = str.length;
  16555. var array = new Uint8Array(n2);
  16556. while (n2--) {
  16557. array[n2] = str.charCodeAt(n2);
  16558. }
  16559. return resolve2((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type })));
  16560. }
  16561. var extName = base64.split(",")[0].match(/data\:\S+\/(\S+);/);
  16562. if (extName) {
  16563. extName = extName[1];
  16564. } else {
  16565. reject(new Error("base64 error"));
  16566. }
  16567. var fileName = getNewFileId() + "." + extName;
  16568. if (typeof plus === "object") {
  16569. var basePath = "_doc";
  16570. var dirPath = "uniapp_temp";
  16571. var filePath = basePath + "/" + dirPath + "/" + fileName;
  16572. if (!biggerThan(plus.os.name === "Android" ? "1.9.9.80627" : "1.9.9.80472", plus.runtime.innerVersion)) {
  16573. plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
  16574. entry.getDirectory(dirPath, {
  16575. create: true,
  16576. exclusive: false
  16577. }, function(entry2) {
  16578. entry2.getFile(fileName, {
  16579. create: true,
  16580. exclusive: false
  16581. }, function(entry3) {
  16582. entry3.createWriter(function(writer) {
  16583. writer.onwrite = function() {
  16584. resolve2(filePath);
  16585. };
  16586. writer.onerror = reject;
  16587. writer.seek(0);
  16588. writer.writeAsBinary(dataUrlToBase64(base64));
  16589. }, reject);
  16590. }, reject);
  16591. }, reject);
  16592. }, reject);
  16593. return;
  16594. }
  16595. var bitmap = new plus.nativeObj.Bitmap(fileName);
  16596. bitmap.loadBase64Data(base64, function() {
  16597. bitmap.save(filePath, {}, function() {
  16598. bitmap.clear();
  16599. resolve2(filePath);
  16600. }, function(error) {
  16601. bitmap.clear();
  16602. reject(error);
  16603. });
  16604. }, function(error) {
  16605. bitmap.clear();
  16606. reject(error);
  16607. });
  16608. return;
  16609. }
  16610. function getEnvPath() {
  16611. var _a2, _b2, _c, _d, _e2, _f;
  16612. if (typeof my === "object" && ((_a2 = my == null ? void 0 : my.env) == null ? void 0 : _a2.USER_DATA_PATH)) {
  16613. return my.env.USER_DATA_PATH;
  16614. }
  16615. if (typeof swan === "object" && ((_b2 = swan == null ? void 0 : swan.env) == null ? void 0 : _b2.USER_DATA_PATH)) {
  16616. return swan.env.USER_DATA_PATH;
  16617. }
  16618. if (typeof tt === "object" && ((_c = tt == null ? void 0 : tt.env) == null ? void 0 : _c.USER_DATA_PATH)) {
  16619. return tt.env.USER_DATA_PATH;
  16620. }
  16621. if (typeof qq === "object" && ((_d = qq == null ? void 0 : qq.env) == null ? void 0 : _d.USER_DATA_PATH)) {
  16622. return qq.env.USER_DATA_PATH;
  16623. }
  16624. if (typeof qh === "object" && ((_e2 = qh == null ? void 0 : qh.env) == null ? void 0 : _e2.USER_DATA_PATH)) {
  16625. return qh.env.USER_DATA_PATH;
  16626. }
  16627. if (typeof wx$1 === "object" && ((_f = wx$1 == null ? void 0 : wx$1.env) == null ? void 0 : _f.USER_DATA_PATH)) {
  16628. return wx$1.env.USER_DATA_PATH;
  16629. }
  16630. return "https://user";
  16631. }
  16632. try {
  16633. var filePath = getEnvPath() + "/" + fileName;
  16634. index$1.getFileSystemManager().writeFile({
  16635. filePath,
  16636. data: dataUrlToBase64(base64),
  16637. encoding: "base64",
  16638. success: function() {
  16639. resolve2(filePath);
  16640. },
  16641. fail: function(error) {
  16642. reject(error);
  16643. }
  16644. });
  16645. } catch (e2) {
  16646. reject(new Error("not support"));
  16647. }
  16648. });
  16649. }
  16650. return { pathToBase64, base64ToPath };
  16651. }();
  16652. if (notUnd("object")) {
  16653. module2.exports = QSCanvas2;
  16654. }
  16655. return QSCanvas2;
  16656. })();
  16657. })(qsCanvas);
  16658. var qsCanvasExports = qsCanvas.exports;
  16659. const QSCanvas = /* @__PURE__ */ getDefaultExportFromCjs(qsCanvasExports);
  16660. var uniSocket_io = { exports: {} };
  16661. (function(module2, exports2) {
  16662. !function(t2, e2) {
  16663. module2.exports = e2();
  16664. }(window, function() {
  16665. return function(t2) {
  16666. var e2 = {};
  16667. function r2(n2) {
  16668. if (e2[n2])
  16669. return e2[n2].exports;
  16670. var o2 = e2[n2] = { i: n2, l: false, exports: {} };
  16671. return t2[n2].call(o2.exports, o2, o2.exports, r2), o2.l = true, o2.exports;
  16672. }
  16673. return r2.m = t2, r2.c = e2, r2.d = function(t3, e3, n2) {
  16674. r2.o(t3, e3) || Object.defineProperty(t3, e3, { enumerable: true, get: n2 });
  16675. }, r2.r = function(t3) {
  16676. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true });
  16677. }, r2.t = function(t3, e3) {
  16678. if (1 & e3 && (t3 = r2(t3)), 8 & e3)
  16679. return t3;
  16680. if (4 & e3 && "object" == typeof t3 && t3 && t3.__esModule)
  16681. return t3;
  16682. var n2 = /* @__PURE__ */ Object.create(null);
  16683. if (r2.r(n2), Object.defineProperty(n2, "default", { enumerable: true, value: t3 }), 2 & e3 && "string" != typeof t3)
  16684. for (var o2 in t3)
  16685. r2.d(n2, o2, function(e4) {
  16686. return t3[e4];
  16687. }.bind(null, o2));
  16688. return n2;
  16689. }, r2.n = function(t3) {
  16690. var e3 = t3 && t3.__esModule ? function() {
  16691. return t3.default;
  16692. } : function() {
  16693. return t3;
  16694. };
  16695. return r2.d(e3, "a", e3), e3;
  16696. }, r2.o = function(t3, e3) {
  16697. return Object.prototype.hasOwnProperty.call(t3, e3);
  16698. }, r2.p = "", r2(r2.s = 22);
  16699. }([function(t2, e2) {
  16700. t2.exports = function() {
  16701. return function() {
  16702. };
  16703. };
  16704. }, function(t2, e2, r2) {
  16705. function n2(t3) {
  16706. if (t3)
  16707. return function(t4) {
  16708. for (var e3 in n2.prototype)
  16709. t4[e3] = n2.prototype[e3];
  16710. return t4;
  16711. }(t3);
  16712. }
  16713. t2.exports = n2, n2.prototype.on = n2.prototype.addEventListener = function(t3, e3) {
  16714. return this._callbacks = this._callbacks || {}, (this._callbacks["$" + t3] = this._callbacks["$" + t3] || []).push(e3), this;
  16715. }, n2.prototype.once = function(t3, e3) {
  16716. function r3() {
  16717. this.off(t3, r3), e3.apply(this, arguments);
  16718. }
  16719. return r3.fn = e3, this.on(t3, r3), this;
  16720. }, n2.prototype.off = n2.prototype.removeListener = n2.prototype.removeAllListeners = n2.prototype.removeEventListener = function(t3, e3) {
  16721. if (this._callbacks = this._callbacks || {}, 0 == arguments.length)
  16722. return this._callbacks = {}, this;
  16723. var r3, n3 = this._callbacks["$" + t3];
  16724. if (!n3)
  16725. return this;
  16726. if (1 == arguments.length)
  16727. return delete this._callbacks["$" + t3], this;
  16728. for (var o2 = 0; o2 < n3.length; o2++)
  16729. if ((r3 = n3[o2]) === e3 || r3.fn === e3) {
  16730. n3.splice(o2, 1);
  16731. break;
  16732. }
  16733. return this;
  16734. }, n2.prototype.emit = function(t3) {
  16735. this._callbacks = this._callbacks || {};
  16736. var e3 = [].slice.call(arguments, 1), r3 = this._callbacks["$" + t3];
  16737. if (r3)
  16738. for (var n3 = 0, o2 = (r3 = r3.slice(0)).length; n3 < o2; ++n3)
  16739. r3[n3].apply(this, e3);
  16740. return this;
  16741. }, n2.prototype.listeners = function(t3) {
  16742. return this._callbacks = this._callbacks || {}, this._callbacks["$" + t3] || [];
  16743. }, n2.prototype.hasListeners = function(t3) {
  16744. return !!this.listeners(t3).length;
  16745. };
  16746. }, function(t2, e2, r2) {
  16747. var n2, o2 = r2(33), i2 = r2(16), s2 = r2(35), a2 = r2(36), c2 = r2(37);
  16748. "undefined" != typeof ArrayBuffer && (n2 = r2(38));
  16749. var h2 = "undefined" != typeof navigator && /Android/i.test(navigator.userAgent), u2 = "undefined" != typeof navigator && /PhantomJS/i.test(navigator.userAgent), f2 = h2 || u2;
  16750. e2.protocol = 3;
  16751. var p2 = e2.packets = { open: 0, close: 1, ping: 2, pong: 3, message: 4, upgrade: 5, noop: 6 }, l2 = o2(p2), d2 = { type: "error", data: "parser error" }, y2 = r2(39);
  16752. function g2(t3, e3, r3) {
  16753. for (var n3 = new Array(t3.length), o3 = a2(t3.length, r3), i3 = function(t4, r4, o4) {
  16754. e3(r4, function(e4, r5) {
  16755. n3[t4] = r5, o4(e4, n3);
  16756. });
  16757. }, s3 = 0; s3 < t3.length; s3++)
  16758. i3(s3, t3[s3], o3);
  16759. }
  16760. e2.encodePacket = function(t3, r3, n3, o3) {
  16761. "function" == typeof r3 && (o3 = r3, r3 = false), "function" == typeof n3 && (o3 = n3, n3 = null);
  16762. var i3 = void 0 === t3.data ? void 0 : t3.data.buffer || t3.data;
  16763. if ("undefined" != typeof ArrayBuffer && i3 instanceof ArrayBuffer)
  16764. return function(t4, r4, n4) {
  16765. if (!r4)
  16766. return e2.encodeBase64Packet(t4, n4);
  16767. var o4 = t4.data, i4 = new Uint8Array(o4), s4 = new Uint8Array(1 + o4.byteLength);
  16768. s4[0] = p2[t4.type];
  16769. for (var a3 = 0; a3 < i4.length; a3++)
  16770. s4[a3 + 1] = i4[a3];
  16771. return n4(s4.buffer);
  16772. }(t3, r3, o3);
  16773. if (void 0 !== y2 && i3 instanceof y2)
  16774. return function(t4, r4, n4) {
  16775. if (!r4)
  16776. return e2.encodeBase64Packet(t4, n4);
  16777. if (f2)
  16778. return function(t5, r5, n5) {
  16779. if (!r5)
  16780. return e2.encodeBase64Packet(t5, n5);
  16781. var o5 = new FileReader();
  16782. return o5.onload = function() {
  16783. e2.encodePacket({ type: t5.type, data: o5.result }, r5, true, n5);
  16784. }, o5.readAsArrayBuffer(t5.data);
  16785. }(t4, r4, n4);
  16786. var o4 = new Uint8Array(1);
  16787. o4[0] = p2[t4.type];
  16788. var i4 = new y2([o4.buffer, t4.data]);
  16789. return n4(i4);
  16790. }(t3, r3, o3);
  16791. if (i3 && i3.base64)
  16792. return function(t4, r4) {
  16793. var n4 = "b" + e2.packets[t4.type] + t4.data.data;
  16794. return r4(n4);
  16795. }(t3, o3);
  16796. var s3 = p2[t3.type];
  16797. return void 0 !== t3.data && (s3 += n3 ? c2.encode(String(t3.data), { strict: false }) : String(t3.data)), o3("" + s3);
  16798. }, e2.encodeBase64Packet = function(t3, r3) {
  16799. var n3, o3 = "b" + e2.packets[t3.type];
  16800. if (void 0 !== y2 && t3.data instanceof y2) {
  16801. var i3 = new FileReader();
  16802. return i3.onload = function() {
  16803. var t4 = i3.result.split(",")[1];
  16804. r3(o3 + t4);
  16805. }, i3.readAsDataURL(t3.data);
  16806. }
  16807. try {
  16808. n3 = String.fromCharCode.apply(null, new Uint8Array(t3.data));
  16809. } catch (e3) {
  16810. for (var s3 = new Uint8Array(t3.data), a3 = new Array(s3.length), c3 = 0; c3 < s3.length; c3++)
  16811. a3[c3] = s3[c3];
  16812. n3 = String.fromCharCode.apply(null, a3);
  16813. }
  16814. return o3 += btoa(n3), r3(o3);
  16815. }, e2.decodePacket = function(t3, r3, n3) {
  16816. if (void 0 === t3)
  16817. return d2;
  16818. if ("string" == typeof t3) {
  16819. if ("b" === t3.charAt(0))
  16820. return e2.decodeBase64Packet(t3.substr(1), r3);
  16821. if (n3 && false === (t3 = function(t4) {
  16822. try {
  16823. t4 = c2.decode(t4, { strict: false });
  16824. } catch (t5) {
  16825. return false;
  16826. }
  16827. return t4;
  16828. }(t3)))
  16829. return d2;
  16830. var o3 = t3.charAt(0);
  16831. return Number(o3) == o3 && l2[o3] ? t3.length > 1 ? { type: l2[o3], data: t3.substring(1) } : { type: l2[o3] } : d2;
  16832. }
  16833. o3 = new Uint8Array(t3)[0];
  16834. var i3 = s2(t3, 1);
  16835. return y2 && "blob" === r3 && (i3 = new y2([i3])), { type: l2[o3], data: i3 };
  16836. }, e2.decodeBase64Packet = function(t3, e3) {
  16837. var r3 = l2[t3.charAt(0)];
  16838. if (!n2)
  16839. return { type: r3, data: { base64: true, data: t3.substr(1) } };
  16840. var o3 = n2.decode(t3.substr(1));
  16841. return "blob" === e3 && y2 && (o3 = new y2([o3])), { type: r3, data: o3 };
  16842. }, e2.encodePayload = function(t3, r3, n3) {
  16843. "function" == typeof r3 && (n3 = r3, r3 = null);
  16844. var o3 = i2(t3);
  16845. if (r3 && o3)
  16846. return y2 && !f2 ? e2.encodePayloadAsBlob(t3, n3) : e2.encodePayloadAsArrayBuffer(t3, n3);
  16847. if (!t3.length)
  16848. return n3("0:");
  16849. g2(t3, function(t4, n4) {
  16850. e2.encodePacket(t4, !!o3 && r3, false, function(t5) {
  16851. n4(null, function(t6) {
  16852. return t6.length + ":" + t6;
  16853. }(t5));
  16854. });
  16855. }, function(t4, e3) {
  16856. return n3(e3.join(""));
  16857. });
  16858. }, e2.decodePayload = function(t3, r3, n3) {
  16859. if ("string" != typeof t3)
  16860. return e2.decodePayloadAsBinary(t3, r3, n3);
  16861. var o3;
  16862. if ("function" == typeof r3 && (n3 = r3, r3 = null), "" === t3)
  16863. return n3(d2, 0, 1);
  16864. for (var i3, s3, a3 = "", c3 = 0, h3 = t3.length; c3 < h3; c3++) {
  16865. var u3 = t3.charAt(c3);
  16866. if (":" === u3) {
  16867. if ("" === a3 || a3 != (i3 = Number(a3)))
  16868. return n3(d2, 0, 1);
  16869. if (a3 != (s3 = t3.substr(c3 + 1, i3)).length)
  16870. return n3(d2, 0, 1);
  16871. if (s3.length) {
  16872. if (o3 = e2.decodePacket(s3, r3, false), d2.type === o3.type && d2.data === o3.data)
  16873. return n3(d2, 0, 1);
  16874. if (false === n3(o3, c3 + i3, h3))
  16875. return;
  16876. }
  16877. c3 += i3, a3 = "";
  16878. } else
  16879. a3 += u3;
  16880. }
  16881. return "" !== a3 ? n3(d2, 0, 1) : void 0;
  16882. }, e2.encodePayloadAsArrayBuffer = function(t3, r3) {
  16883. if (!t3.length)
  16884. return r3(new ArrayBuffer(0));
  16885. g2(t3, function(t4, r4) {
  16886. e2.encodePacket(t4, true, true, function(t5) {
  16887. return r4(null, t5);
  16888. });
  16889. }, function(t4, e3) {
  16890. var n3 = e3.reduce(function(t5, e4) {
  16891. var r4;
  16892. return t5 + (r4 = "string" == typeof e4 ? e4.length : e4.byteLength).toString().length + r4 + 2;
  16893. }, 0), o3 = new Uint8Array(n3), i3 = 0;
  16894. return e3.forEach(function(t5) {
  16895. var e4 = "string" == typeof t5, r4 = t5;
  16896. if (e4) {
  16897. for (var n4 = new Uint8Array(t5.length), s3 = 0; s3 < t5.length; s3++)
  16898. n4[s3] = t5.charCodeAt(s3);
  16899. r4 = n4.buffer;
  16900. }
  16901. o3[i3++] = e4 ? 0 : 1;
  16902. var a3 = r4.byteLength.toString();
  16903. for (s3 = 0; s3 < a3.length; s3++)
  16904. o3[i3++] = parseInt(a3[s3]);
  16905. o3[i3++] = 255;
  16906. for (n4 = new Uint8Array(r4), s3 = 0; s3 < n4.length; s3++)
  16907. o3[i3++] = n4[s3];
  16908. }), r3(o3.buffer);
  16909. });
  16910. }, e2.encodePayloadAsBlob = function(t3, r3) {
  16911. g2(t3, function(t4, r4) {
  16912. e2.encodePacket(t4, true, true, function(t5) {
  16913. var e3 = new Uint8Array(1);
  16914. if (e3[0] = 1, "string" == typeof t5) {
  16915. for (var n3 = new Uint8Array(t5.length), o3 = 0; o3 < t5.length; o3++)
  16916. n3[o3] = t5.charCodeAt(o3);
  16917. t5 = n3.buffer, e3[0] = 0;
  16918. }
  16919. var i3 = (t5 instanceof ArrayBuffer ? t5.byteLength : t5.size).toString(), s3 = new Uint8Array(i3.length + 1);
  16920. for (o3 = 0; o3 < i3.length; o3++)
  16921. s3[o3] = parseInt(i3[o3]);
  16922. if (s3[i3.length] = 255, y2) {
  16923. var a3 = new y2([e3.buffer, s3.buffer, t5]);
  16924. r4(null, a3);
  16925. }
  16926. });
  16927. }, function(t4, e3) {
  16928. return r3(new y2(e3));
  16929. });
  16930. }, e2.decodePayloadAsBinary = function(t3, r3, n3) {
  16931. "function" == typeof r3 && (n3 = r3, r3 = null);
  16932. for (var o3 = t3, i3 = []; o3.byteLength > 0; ) {
  16933. for (var a3 = new Uint8Array(o3), c3 = 0 === a3[0], h3 = "", u3 = 1; 255 !== a3[u3]; u3++) {
  16934. if (h3.length > 310)
  16935. return n3(d2, 0, 1);
  16936. h3 += a3[u3];
  16937. }
  16938. o3 = s2(o3, 2 + h3.length), h3 = parseInt(h3);
  16939. var f3 = s2(o3, 0, h3);
  16940. if (c3)
  16941. try {
  16942. f3 = String.fromCharCode.apply(null, new Uint8Array(f3));
  16943. } catch (t4) {
  16944. var p3 = new Uint8Array(f3);
  16945. f3 = "";
  16946. for (u3 = 0; u3 < p3.length; u3++)
  16947. f3 += String.fromCharCode(p3[u3]);
  16948. }
  16949. i3.push(f3), o3 = s2(o3, h3);
  16950. }
  16951. var l3 = i3.length;
  16952. i3.forEach(function(t4, o4) {
  16953. n3(e2.decodePacket(t4, r3, true), o4, l3);
  16954. });
  16955. };
  16956. }, function(t2, e2) {
  16957. e2.encode = function(t3) {
  16958. var e3 = "";
  16959. for (var r2 in t3)
  16960. t3.hasOwnProperty(r2) && (e3.length && (e3 += "&"), e3 += encodeURIComponent(r2) + "=" + encodeURIComponent(t3[r2]));
  16961. return e3;
  16962. }, e2.decode = function(t3) {
  16963. for (var e3 = {}, r2 = t3.split("&"), n2 = 0, o2 = r2.length; n2 < o2; n2++) {
  16964. var i2 = r2[n2].split("=");
  16965. e3[decodeURIComponent(i2[0])] = decodeURIComponent(i2[1]);
  16966. }
  16967. return e3;
  16968. };
  16969. }, function(t2, e2) {
  16970. t2.exports = function(t3, e3) {
  16971. var r2 = function() {
  16972. };
  16973. r2.prototype = e3.prototype, t3.prototype = new r2(), t3.prototype.constructor = t3;
  16974. };
  16975. }, function(t2, e2, r2) {
  16976. var n2 = r2(0)("socket.io-parser"), o2 = r2(1), i2 = r2(25), s2 = r2(10), a2 = r2(11);
  16977. function c2() {
  16978. }
  16979. e2.protocol = 4, e2.types = ["CONNECT", "DISCONNECT", "EVENT", "ACK", "ERROR", "BINARY_EVENT", "BINARY_ACK"], e2.CONNECT = 0, e2.DISCONNECT = 1, e2.EVENT = 2, e2.ACK = 3, e2.ERROR = 4, e2.BINARY_EVENT = 5, e2.BINARY_ACK = 6, e2.Encoder = c2, e2.Decoder = f2;
  16980. var h2 = e2.ERROR + '"encode error"';
  16981. function u2(t3) {
  16982. var r3 = "" + t3.type;
  16983. if (e2.BINARY_EVENT !== t3.type && e2.BINARY_ACK !== t3.type || (r3 += t3.attachments + "-"), t3.nsp && "/" !== t3.nsp && (r3 += t3.nsp + ","), null != t3.id && (r3 += t3.id), null != t3.data) {
  16984. var o3 = function(t4) {
  16985. try {
  16986. return JSON.stringify(t4);
  16987. } catch (t5) {
  16988. return false;
  16989. }
  16990. }(t3.data);
  16991. if (false === o3)
  16992. return h2;
  16993. r3 += o3;
  16994. }
  16995. return n2("encoded %j as %s", t3, r3), r3;
  16996. }
  16997. function f2() {
  16998. this.reconstructor = null;
  16999. }
  17000. function p2(t3) {
  17001. this.reconPack = t3, this.buffers = [];
  17002. }
  17003. function l2(t3) {
  17004. return { type: e2.ERROR, data: "parser error: " + t3 };
  17005. }
  17006. c2.prototype.encode = function(t3, r3) {
  17007. (n2("encoding packet %j", t3), e2.BINARY_EVENT === t3.type || e2.BINARY_ACK === t3.type) ? function(t4, e3) {
  17008. i2.removeBlobs(t4, function(t5) {
  17009. var r4 = i2.deconstructPacket(t5), n3 = u2(r4.packet), o3 = r4.buffers;
  17010. o3.unshift(n3), e3(o3);
  17011. });
  17012. }(t3, r3) : r3([u2(t3)]);
  17013. }, o2(f2.prototype), f2.prototype.add = function(t3) {
  17014. var r3;
  17015. if ("string" == typeof t3)
  17016. r3 = function(t4) {
  17017. var r4 = 0, o3 = { type: Number(t4.charAt(0)) };
  17018. if (null == e2.types[o3.type])
  17019. return l2("unknown packet type " + o3.type);
  17020. if (e2.BINARY_EVENT === o3.type || e2.BINARY_ACK === o3.type) {
  17021. for (var i3 = ""; "-" !== t4.charAt(++r4) && (i3 += t4.charAt(r4), r4 != t4.length); )
  17022. ;
  17023. if (i3 != Number(i3) || "-" !== t4.charAt(r4))
  17024. throw new Error("Illegal attachments");
  17025. o3.attachments = Number(i3);
  17026. }
  17027. if ("/" === t4.charAt(r4 + 1))
  17028. for (o3.nsp = ""; ++r4; ) {
  17029. if ("," === (c3 = t4.charAt(r4)))
  17030. break;
  17031. if (o3.nsp += c3, r4 === t4.length)
  17032. break;
  17033. }
  17034. else
  17035. o3.nsp = "/";
  17036. var a3 = t4.charAt(r4 + 1);
  17037. if ("" !== a3 && Number(a3) == a3) {
  17038. for (o3.id = ""; ++r4; ) {
  17039. var c3;
  17040. if (null == (c3 = t4.charAt(r4)) || Number(c3) != c3) {
  17041. --r4;
  17042. break;
  17043. }
  17044. if (o3.id += t4.charAt(r4), r4 === t4.length)
  17045. break;
  17046. }
  17047. o3.id = Number(o3.id);
  17048. }
  17049. if (t4.charAt(++r4)) {
  17050. var h3 = function(t5) {
  17051. try {
  17052. return JSON.parse(t5);
  17053. } catch (t6) {
  17054. return false;
  17055. }
  17056. }(t4.substr(r4));
  17057. if (!(false !== h3 && (o3.type === e2.ERROR || s2(h3))))
  17058. return l2("invalid payload");
  17059. o3.data = h3;
  17060. }
  17061. return n2("decoded %s as %j", t4, o3), o3;
  17062. }(t3), e2.BINARY_EVENT === r3.type || e2.BINARY_ACK === r3.type ? (this.reconstructor = new p2(r3), 0 === this.reconstructor.reconPack.attachments && this.emit("decoded", r3)) : this.emit("decoded", r3);
  17063. else {
  17064. if (!a2(t3) && !t3.base64)
  17065. throw new Error("Unknown type: " + t3);
  17066. if (!this.reconstructor)
  17067. throw new Error("got binary data when not reconstructing a packet");
  17068. (r3 = this.reconstructor.takeBinaryData(t3)) && (this.reconstructor = null, this.emit("decoded", r3));
  17069. }
  17070. }, f2.prototype.destroy = function() {
  17071. this.reconstructor && this.reconstructor.finishedReconstruction();
  17072. }, p2.prototype.takeBinaryData = function(t3) {
  17073. if (this.buffers.push(t3), this.buffers.length === this.reconPack.attachments) {
  17074. var e3 = i2.reconstructPacket(this.reconPack, this.buffers);
  17075. return this.finishedReconstruction(), e3;
  17076. }
  17077. return null;
  17078. }, p2.prototype.finishedReconstruction = function() {
  17079. this.reconPack = null, this.buffers = [];
  17080. };
  17081. }, function(t2, e2, r2) {
  17082. (function(t3) {
  17083. /*!
  17084. * The buffer module from node.js, for the browser.
  17085. *
  17086. * @author Feross Aboukhadijeh <http://feross.org>
  17087. * @license MIT
  17088. */
  17089. var n2 = r2(26), o2 = r2(27), i2 = r2(28);
  17090. function s2() {
  17091. return c2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  17092. }
  17093. function a2(t4, e3) {
  17094. if (s2() < e3)
  17095. throw new RangeError("Invalid typed array length");
  17096. return c2.TYPED_ARRAY_SUPPORT ? (t4 = new Uint8Array(e3)).__proto__ = c2.prototype : (null === t4 && (t4 = new c2(e3)), t4.length = e3), t4;
  17097. }
  17098. function c2(t4, e3, r3) {
  17099. if (!(c2.TYPED_ARRAY_SUPPORT || this instanceof c2))
  17100. return new c2(t4, e3, r3);
  17101. if ("number" == typeof t4) {
  17102. if ("string" == typeof e3)
  17103. throw new Error("If encoding is specified then the first argument must be a string");
  17104. return f2(this, t4);
  17105. }
  17106. return h2(this, t4, e3, r3);
  17107. }
  17108. function h2(t4, e3, r3, n3) {
  17109. if ("number" == typeof e3)
  17110. throw new TypeError('"value" argument must not be a number');
  17111. return "undefined" != typeof ArrayBuffer && e3 instanceof ArrayBuffer ? function(t5, e4, r4, n4) {
  17112. if (e4.byteLength, r4 < 0 || e4.byteLength < r4)
  17113. throw new RangeError("'offset' is out of bounds");
  17114. if (e4.byteLength < r4 + (n4 || 0))
  17115. throw new RangeError("'length' is out of bounds");
  17116. e4 = void 0 === r4 && void 0 === n4 ? new Uint8Array(e4) : void 0 === n4 ? new Uint8Array(e4, r4) : new Uint8Array(e4, r4, n4);
  17117. c2.TYPED_ARRAY_SUPPORT ? (t5 = e4).__proto__ = c2.prototype : t5 = p2(t5, e4);
  17118. return t5;
  17119. }(t4, e3, r3, n3) : "string" == typeof e3 ? function(t5, e4, r4) {
  17120. "string" == typeof r4 && "" !== r4 || (r4 = "utf8");
  17121. if (!c2.isEncoding(r4))
  17122. throw new TypeError('"encoding" must be a valid string encoding');
  17123. var n4 = 0 | d2(e4, r4), o3 = (t5 = a2(t5, n4)).write(e4, r4);
  17124. o3 !== n4 && (t5 = t5.slice(0, o3));
  17125. return t5;
  17126. }(t4, e3, r3) : function(t5, e4) {
  17127. if (c2.isBuffer(e4)) {
  17128. var r4 = 0 | l2(e4.length);
  17129. return 0 === (t5 = a2(t5, r4)).length || e4.copy(t5, 0, 0, r4), t5;
  17130. }
  17131. if (e4) {
  17132. if ("undefined" != typeof ArrayBuffer && e4.buffer instanceof ArrayBuffer || "length" in e4)
  17133. return "number" != typeof e4.length || (n4 = e4.length) != n4 ? a2(t5, 0) : p2(t5, e4);
  17134. if ("Buffer" === e4.type && i2(e4.data))
  17135. return p2(t5, e4.data);
  17136. }
  17137. var n4;
  17138. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
  17139. }(t4, e3);
  17140. }
  17141. function u2(t4) {
  17142. if ("number" != typeof t4)
  17143. throw new TypeError('"size" argument must be a number');
  17144. if (t4 < 0)
  17145. throw new RangeError('"size" argument must not be negative');
  17146. }
  17147. function f2(t4, e3) {
  17148. if (u2(e3), t4 = a2(t4, e3 < 0 ? 0 : 0 | l2(e3)), !c2.TYPED_ARRAY_SUPPORT)
  17149. for (var r3 = 0; r3 < e3; ++r3)
  17150. t4[r3] = 0;
  17151. return t4;
  17152. }
  17153. function p2(t4, e3) {
  17154. var r3 = e3.length < 0 ? 0 : 0 | l2(e3.length);
  17155. t4 = a2(t4, r3);
  17156. for (var n3 = 0; n3 < r3; n3 += 1)
  17157. t4[n3] = 255 & e3[n3];
  17158. return t4;
  17159. }
  17160. function l2(t4) {
  17161. if (t4 >= s2())
  17162. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s2().toString(16) + " bytes");
  17163. return 0 | t4;
  17164. }
  17165. function d2(t4, e3) {
  17166. if (c2.isBuffer(t4))
  17167. return t4.length;
  17168. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t4) || t4 instanceof ArrayBuffer))
  17169. return t4.byteLength;
  17170. "string" != typeof t4 && (t4 = "" + t4);
  17171. var r3 = t4.length;
  17172. if (0 === r3)
  17173. return 0;
  17174. for (var n3 = false; ; )
  17175. switch (e3) {
  17176. case "ascii":
  17177. case "latin1":
  17178. case "binary":
  17179. return r3;
  17180. case "utf8":
  17181. case "utf-8":
  17182. case void 0:
  17183. return q2(t4).length;
  17184. case "ucs2":
  17185. case "ucs-2":
  17186. case "utf16le":
  17187. case "utf-16le":
  17188. return 2 * r3;
  17189. case "hex":
  17190. return r3 >>> 1;
  17191. case "base64":
  17192. return Y2(t4).length;
  17193. default:
  17194. if (n3)
  17195. return q2(t4).length;
  17196. e3 = ("" + e3).toLowerCase(), n3 = true;
  17197. }
  17198. }
  17199. function y2(t4, e3, r3) {
  17200. var n3 = false;
  17201. if ((void 0 === e3 || e3 < 0) && (e3 = 0), e3 > this.length)
  17202. return "";
  17203. if ((void 0 === r3 || r3 > this.length) && (r3 = this.length), r3 <= 0)
  17204. return "";
  17205. if ((r3 >>>= 0) <= (e3 >>>= 0))
  17206. return "";
  17207. for (t4 || (t4 = "utf8"); ; )
  17208. switch (t4) {
  17209. case "hex":
  17210. return C2(this, e3, r3);
  17211. case "utf8":
  17212. case "utf-8":
  17213. return x(this, e3, r3);
  17214. case "ascii":
  17215. return R2(this, e3, r3);
  17216. case "latin1":
  17217. case "binary":
  17218. return S2(this, e3, r3);
  17219. case "base64":
  17220. return _2(this, e3, r3);
  17221. case "ucs2":
  17222. case "ucs-2":
  17223. case "utf16le":
  17224. case "utf-16le":
  17225. return P2(this, e3, r3);
  17226. default:
  17227. if (n3)
  17228. throw new TypeError("Unknown encoding: " + t4);
  17229. t4 = (t4 + "").toLowerCase(), n3 = true;
  17230. }
  17231. }
  17232. function g2(t4, e3, r3) {
  17233. var n3 = t4[e3];
  17234. t4[e3] = t4[r3], t4[r3] = n3;
  17235. }
  17236. function v2(t4, e3, r3, n3, o3) {
  17237. if (0 === t4.length)
  17238. return -1;
  17239. if ("string" == typeof r3 ? (n3 = r3, r3 = 0) : r3 > 2147483647 ? r3 = 2147483647 : r3 < -2147483648 && (r3 = -2147483648), r3 = +r3, isNaN(r3) && (r3 = o3 ? 0 : t4.length - 1), r3 < 0 && (r3 = t4.length + r3), r3 >= t4.length) {
  17240. if (o3)
  17241. return -1;
  17242. r3 = t4.length - 1;
  17243. } else if (r3 < 0) {
  17244. if (!o3)
  17245. return -1;
  17246. r3 = 0;
  17247. }
  17248. if ("string" == typeof e3 && (e3 = c2.from(e3, n3)), c2.isBuffer(e3))
  17249. return 0 === e3.length ? -1 : m2(t4, e3, r3, n3, o3);
  17250. if ("number" == typeof e3)
  17251. return e3 &= 255, c2.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o3 ? Uint8Array.prototype.indexOf.call(t4, e3, r3) : Uint8Array.prototype.lastIndexOf.call(t4, e3, r3) : m2(t4, [e3], r3, n3, o3);
  17252. throw new TypeError("val must be string, number or Buffer");
  17253. }
  17254. function m2(t4, e3, r3, n3, o3) {
  17255. var i3, s3 = 1, a3 = t4.length, c3 = e3.length;
  17256. if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) {
  17257. if (t4.length < 2 || e3.length < 2)
  17258. return -1;
  17259. s3 = 2, a3 /= 2, c3 /= 2, r3 /= 2;
  17260. }
  17261. function h3(t5, e4) {
  17262. return 1 === s3 ? t5[e4] : t5.readUInt16BE(e4 * s3);
  17263. }
  17264. if (o3) {
  17265. var u3 = -1;
  17266. for (i3 = r3; i3 < a3; i3++)
  17267. if (h3(t4, i3) === h3(e3, -1 === u3 ? 0 : i3 - u3)) {
  17268. if (-1 === u3 && (u3 = i3), i3 - u3 + 1 === c3)
  17269. return u3 * s3;
  17270. } else
  17271. -1 !== u3 && (i3 -= i3 - u3), u3 = -1;
  17272. } else
  17273. for (r3 + c3 > a3 && (r3 = a3 - c3), i3 = r3; i3 >= 0; i3--) {
  17274. for (var f3 = true, p3 = 0; p3 < c3; p3++)
  17275. if (h3(t4, i3 + p3) !== h3(e3, p3)) {
  17276. f3 = false;
  17277. break;
  17278. }
  17279. if (f3)
  17280. return i3;
  17281. }
  17282. return -1;
  17283. }
  17284. function b2(t4, e3, r3, n3) {
  17285. r3 = Number(r3) || 0;
  17286. var o3 = t4.length - r3;
  17287. n3 ? (n3 = Number(n3)) > o3 && (n3 = o3) : n3 = o3;
  17288. var i3 = e3.length;
  17289. if (i3 % 2 != 0)
  17290. throw new TypeError("Invalid hex string");
  17291. n3 > i3 / 2 && (n3 = i3 / 2);
  17292. for (var s3 = 0; s3 < n3; ++s3) {
  17293. var a3 = parseInt(e3.substr(2 * s3, 2), 16);
  17294. if (isNaN(a3))
  17295. return s3;
  17296. t4[r3 + s3] = a3;
  17297. }
  17298. return s3;
  17299. }
  17300. function w2(t4, e3, r3, n3) {
  17301. return H2(q2(e3, t4.length - r3), t4, r3, n3);
  17302. }
  17303. function A2(t4, e3, r3, n3) {
  17304. return H2(function(t5) {
  17305. for (var e4 = [], r4 = 0; r4 < t5.length; ++r4)
  17306. e4.push(255 & t5.charCodeAt(r4));
  17307. return e4;
  17308. }(e3), t4, r3, n3);
  17309. }
  17310. function k(t4, e3, r3, n3) {
  17311. return A2(t4, e3, r3, n3);
  17312. }
  17313. function E2(t4, e3, r3, n3) {
  17314. return H2(Y2(e3), t4, r3, n3);
  17315. }
  17316. function B2(t4, e3, r3, n3) {
  17317. return H2(function(t5, e4) {
  17318. for (var r4, n4, o3, i3 = [], s3 = 0; s3 < t5.length && !((e4 -= 2) < 0); ++s3)
  17319. r4 = t5.charCodeAt(s3), n4 = r4 >> 8, o3 = r4 % 256, i3.push(o3), i3.push(n4);
  17320. return i3;
  17321. }(e3, t4.length - r3), t4, r3, n3);
  17322. }
  17323. function _2(t4, e3, r3) {
  17324. return 0 === e3 && r3 === t4.length ? n2.fromByteArray(t4) : n2.fromByteArray(t4.slice(e3, r3));
  17325. }
  17326. function x(t4, e3, r3) {
  17327. r3 = Math.min(t4.length, r3);
  17328. for (var n3 = [], o3 = e3; o3 < r3; ) {
  17329. var i3, s3, a3, c3, h3 = t4[o3], u3 = null, f3 = h3 > 239 ? 4 : h3 > 223 ? 3 : h3 > 191 ? 2 : 1;
  17330. if (o3 + f3 <= r3)
  17331. switch (f3) {
  17332. case 1:
  17333. h3 < 128 && (u3 = h3);
  17334. break;
  17335. case 2:
  17336. 128 == (192 & (i3 = t4[o3 + 1])) && (c3 = (31 & h3) << 6 | 63 & i3) > 127 && (u3 = c3);
  17337. break;
  17338. case 3:
  17339. i3 = t4[o3 + 1], s3 = t4[o3 + 2], 128 == (192 & i3) && 128 == (192 & s3) && (c3 = (15 & h3) << 12 | (63 & i3) << 6 | 63 & s3) > 2047 && (c3 < 55296 || c3 > 57343) && (u3 = c3);
  17340. break;
  17341. case 4:
  17342. i3 = t4[o3 + 1], s3 = t4[o3 + 2], a3 = t4[o3 + 3], 128 == (192 & i3) && 128 == (192 & s3) && 128 == (192 & a3) && (c3 = (15 & h3) << 18 | (63 & i3) << 12 | (63 & s3) << 6 | 63 & a3) > 65535 && c3 < 1114112 && (u3 = c3);
  17343. }
  17344. null === u3 ? (u3 = 65533, f3 = 1) : u3 > 65535 && (u3 -= 65536, n3.push(u3 >>> 10 & 1023 | 55296), u3 = 56320 | 1023 & u3), n3.push(u3), o3 += f3;
  17345. }
  17346. return function(t5) {
  17347. var e4 = t5.length;
  17348. if (e4 <= 4096)
  17349. return String.fromCharCode.apply(String, t5);
  17350. var r4 = "", n4 = 0;
  17351. for (; n4 < e4; )
  17352. r4 += String.fromCharCode.apply(String, t5.slice(n4, n4 += 4096));
  17353. return r4;
  17354. }(n3);
  17355. }
  17356. e2.Buffer = c2, e2.SlowBuffer = function(t4) {
  17357. +t4 != t4 && (t4 = 0);
  17358. return c2.alloc(+t4);
  17359. }, e2.INSPECT_MAX_BYTES = 50, c2.TYPED_ARRAY_SUPPORT = void 0 !== t3.TYPED_ARRAY_SUPPORT ? t3.TYPED_ARRAY_SUPPORT : function() {
  17360. try {
  17361. var t4 = new Uint8Array(1);
  17362. return t4.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
  17363. return 42;
  17364. } }, 42 === t4.foo() && "function" == typeof t4.subarray && 0 === t4.subarray(1, 1).byteLength;
  17365. } catch (t5) {
  17366. return false;
  17367. }
  17368. }(), e2.kMaxLength = s2(), c2.poolSize = 8192, c2._augment = function(t4) {
  17369. return t4.__proto__ = c2.prototype, t4;
  17370. }, c2.from = function(t4, e3, r3) {
  17371. return h2(null, t4, e3, r3);
  17372. }, c2.TYPED_ARRAY_SUPPORT && (c2.prototype.__proto__ = Uint8Array.prototype, c2.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && c2[Symbol.species] === c2 && Object.defineProperty(c2, Symbol.species, { value: null, configurable: true })), c2.alloc = function(t4, e3, r3) {
  17373. return function(t5, e4, r4, n3) {
  17374. return u2(e4), e4 <= 0 ? a2(t5, e4) : void 0 !== r4 ? "string" == typeof n3 ? a2(t5, e4).fill(r4, n3) : a2(t5, e4).fill(r4) : a2(t5, e4);
  17375. }(null, t4, e3, r3);
  17376. }, c2.allocUnsafe = function(t4) {
  17377. return f2(null, t4);
  17378. }, c2.allocUnsafeSlow = function(t4) {
  17379. return f2(null, t4);
  17380. }, c2.isBuffer = function(t4) {
  17381. return !(null == t4 || !t4._isBuffer);
  17382. }, c2.compare = function(t4, e3) {
  17383. if (!c2.isBuffer(t4) || !c2.isBuffer(e3))
  17384. throw new TypeError("Arguments must be Buffers");
  17385. if (t4 === e3)
  17386. return 0;
  17387. for (var r3 = t4.length, n3 = e3.length, o3 = 0, i3 = Math.min(r3, n3); o3 < i3; ++o3)
  17388. if (t4[o3] !== e3[o3]) {
  17389. r3 = t4[o3], n3 = e3[o3];
  17390. break;
  17391. }
  17392. return r3 < n3 ? -1 : n3 < r3 ? 1 : 0;
  17393. }, c2.isEncoding = function(t4) {
  17394. switch (String(t4).toLowerCase()) {
  17395. case "hex":
  17396. case "utf8":
  17397. case "utf-8":
  17398. case "ascii":
  17399. case "latin1":
  17400. case "binary":
  17401. case "base64":
  17402. case "ucs2":
  17403. case "ucs-2":
  17404. case "utf16le":
  17405. case "utf-16le":
  17406. return true;
  17407. default:
  17408. return false;
  17409. }
  17410. }, c2.concat = function(t4, e3) {
  17411. if (!i2(t4))
  17412. throw new TypeError('"list" argument must be an Array of Buffers');
  17413. if (0 === t4.length)
  17414. return c2.alloc(0);
  17415. var r3;
  17416. if (void 0 === e3)
  17417. for (e3 = 0, r3 = 0; r3 < t4.length; ++r3)
  17418. e3 += t4[r3].length;
  17419. var n3 = c2.allocUnsafe(e3), o3 = 0;
  17420. for (r3 = 0; r3 < t4.length; ++r3) {
  17421. var s3 = t4[r3];
  17422. if (!c2.isBuffer(s3))
  17423. throw new TypeError('"list" argument must be an Array of Buffers');
  17424. s3.copy(n3, o3), o3 += s3.length;
  17425. }
  17426. return n3;
  17427. }, c2.byteLength = d2, c2.prototype._isBuffer = true, c2.prototype.swap16 = function() {
  17428. var t4 = this.length;
  17429. if (t4 % 2 != 0)
  17430. throw new RangeError("Buffer size must be a multiple of 16-bits");
  17431. for (var e3 = 0; e3 < t4; e3 += 2)
  17432. g2(this, e3, e3 + 1);
  17433. return this;
  17434. }, c2.prototype.swap32 = function() {
  17435. var t4 = this.length;
  17436. if (t4 % 4 != 0)
  17437. throw new RangeError("Buffer size must be a multiple of 32-bits");
  17438. for (var e3 = 0; e3 < t4; e3 += 4)
  17439. g2(this, e3, e3 + 3), g2(this, e3 + 1, e3 + 2);
  17440. return this;
  17441. }, c2.prototype.swap64 = function() {
  17442. var t4 = this.length;
  17443. if (t4 % 8 != 0)
  17444. throw new RangeError("Buffer size must be a multiple of 64-bits");
  17445. for (var e3 = 0; e3 < t4; e3 += 8)
  17446. g2(this, e3, e3 + 7), g2(this, e3 + 1, e3 + 6), g2(this, e3 + 2, e3 + 5), g2(this, e3 + 3, e3 + 4);
  17447. return this;
  17448. }, c2.prototype.toString = function() {
  17449. var t4 = 0 | this.length;
  17450. return 0 === t4 ? "" : 0 === arguments.length ? x(this, 0, t4) : y2.apply(this, arguments);
  17451. }, c2.prototype.equals = function(t4) {
  17452. if (!c2.isBuffer(t4))
  17453. throw new TypeError("Argument must be a Buffer");
  17454. return this === t4 || 0 === c2.compare(this, t4);
  17455. }, c2.prototype.inspect = function() {
  17456. var t4 = "", r3 = e2.INSPECT_MAX_BYTES;
  17457. return this.length > 0 && (t4 = this.toString("hex", 0, r3).match(/.{2}/g).join(" "), this.length > r3 && (t4 += " ... ")), "<Buffer " + t4 + ">";
  17458. }, c2.prototype.compare = function(t4, e3, r3, n3, o3) {
  17459. if (!c2.isBuffer(t4))
  17460. throw new TypeError("Argument must be a Buffer");
  17461. if (void 0 === e3 && (e3 = 0), void 0 === r3 && (r3 = t4 ? t4.length : 0), void 0 === n3 && (n3 = 0), void 0 === o3 && (o3 = this.length), e3 < 0 || r3 > t4.length || n3 < 0 || o3 > this.length)
  17462. throw new RangeError("out of range index");
  17463. if (n3 >= o3 && e3 >= r3)
  17464. return 0;
  17465. if (n3 >= o3)
  17466. return -1;
  17467. if (e3 >= r3)
  17468. return 1;
  17469. if (this === t4)
  17470. return 0;
  17471. for (var i3 = (o3 >>>= 0) - (n3 >>>= 0), s3 = (r3 >>>= 0) - (e3 >>>= 0), a3 = Math.min(i3, s3), h3 = this.slice(n3, o3), u3 = t4.slice(e3, r3), f3 = 0; f3 < a3; ++f3)
  17472. if (h3[f3] !== u3[f3]) {
  17473. i3 = h3[f3], s3 = u3[f3];
  17474. break;
  17475. }
  17476. return i3 < s3 ? -1 : s3 < i3 ? 1 : 0;
  17477. }, c2.prototype.includes = function(t4, e3, r3) {
  17478. return -1 !== this.indexOf(t4, e3, r3);
  17479. }, c2.prototype.indexOf = function(t4, e3, r3) {
  17480. return v2(this, t4, e3, r3, true);
  17481. }, c2.prototype.lastIndexOf = function(t4, e3, r3) {
  17482. return v2(this, t4, e3, r3, false);
  17483. }, c2.prototype.write = function(t4, e3, r3, n3) {
  17484. if (void 0 === e3)
  17485. n3 = "utf8", r3 = this.length, e3 = 0;
  17486. else if (void 0 === r3 && "string" == typeof e3)
  17487. n3 = e3, r3 = this.length, e3 = 0;
  17488. else {
  17489. if (!isFinite(e3))
  17490. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  17491. e3 |= 0, isFinite(r3) ? (r3 |= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r3, r3 = void 0);
  17492. }
  17493. var o3 = this.length - e3;
  17494. if ((void 0 === r3 || r3 > o3) && (r3 = o3), t4.length > 0 && (r3 < 0 || e3 < 0) || e3 > this.length)
  17495. throw new RangeError("Attempt to write outside buffer bounds");
  17496. n3 || (n3 = "utf8");
  17497. for (var i3 = false; ; )
  17498. switch (n3) {
  17499. case "hex":
  17500. return b2(this, t4, e3, r3);
  17501. case "utf8":
  17502. case "utf-8":
  17503. return w2(this, t4, e3, r3);
  17504. case "ascii":
  17505. return A2(this, t4, e3, r3);
  17506. case "latin1":
  17507. case "binary":
  17508. return k(this, t4, e3, r3);
  17509. case "base64":
  17510. return E2(this, t4, e3, r3);
  17511. case "ucs2":
  17512. case "ucs-2":
  17513. case "utf16le":
  17514. case "utf-16le":
  17515. return B2(this, t4, e3, r3);
  17516. default:
  17517. if (i3)
  17518. throw new TypeError("Unknown encoding: " + n3);
  17519. n3 = ("" + n3).toLowerCase(), i3 = true;
  17520. }
  17521. }, c2.prototype.toJSON = function() {
  17522. return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
  17523. };
  17524. function R2(t4, e3, r3) {
  17525. var n3 = "";
  17526. r3 = Math.min(t4.length, r3);
  17527. for (var o3 = e3; o3 < r3; ++o3)
  17528. n3 += String.fromCharCode(127 & t4[o3]);
  17529. return n3;
  17530. }
  17531. function S2(t4, e3, r3) {
  17532. var n3 = "";
  17533. r3 = Math.min(t4.length, r3);
  17534. for (var o3 = e3; o3 < r3; ++o3)
  17535. n3 += String.fromCharCode(t4[o3]);
  17536. return n3;
  17537. }
  17538. function C2(t4, e3, r3) {
  17539. var n3 = t4.length;
  17540. (!e3 || e3 < 0) && (e3 = 0), (!r3 || r3 < 0 || r3 > n3) && (r3 = n3);
  17541. for (var o3 = "", i3 = e3; i3 < r3; ++i3)
  17542. o3 += M2(t4[i3]);
  17543. return o3;
  17544. }
  17545. function P2(t4, e3, r3) {
  17546. for (var n3 = t4.slice(e3, r3), o3 = "", i3 = 0; i3 < n3.length; i3 += 2)
  17547. o3 += String.fromCharCode(n3[i3] + 256 * n3[i3 + 1]);
  17548. return o3;
  17549. }
  17550. function T2(t4, e3, r3) {
  17551. if (t4 % 1 != 0 || t4 < 0)
  17552. throw new RangeError("offset is not uint");
  17553. if (t4 + e3 > r3)
  17554. throw new RangeError("Trying to access beyond buffer length");
  17555. }
  17556. function O2(t4, e3, r3, n3, o3, i3) {
  17557. if (!c2.isBuffer(t4))
  17558. throw new TypeError('"buffer" argument must be a Buffer instance');
  17559. if (e3 > o3 || e3 < i3)
  17560. throw new RangeError('"value" argument is out of bounds');
  17561. if (r3 + n3 > t4.length)
  17562. throw new RangeError("Index out of range");
  17563. }
  17564. function N2(t4, e3, r3, n3) {
  17565. e3 < 0 && (e3 = 65535 + e3 + 1);
  17566. for (var o3 = 0, i3 = Math.min(t4.length - r3, 2); o3 < i3; ++o3)
  17567. t4[r3 + o3] = (e3 & 255 << 8 * (n3 ? o3 : 1 - o3)) >>> 8 * (n3 ? o3 : 1 - o3);
  17568. }
  17569. function L2(t4, e3, r3, n3) {
  17570. e3 < 0 && (e3 = 4294967295 + e3 + 1);
  17571. for (var o3 = 0, i3 = Math.min(t4.length - r3, 4); o3 < i3; ++o3)
  17572. t4[r3 + o3] = e3 >>> 8 * (n3 ? o3 : 3 - o3) & 255;
  17573. }
  17574. function U2(t4, e3, r3, n3, o3, i3) {
  17575. if (r3 + n3 > t4.length)
  17576. throw new RangeError("Index out of range");
  17577. if (r3 < 0)
  17578. throw new RangeError("Index out of range");
  17579. }
  17580. function I2(t4, e3, r3, n3, i3) {
  17581. return i3 || U2(t4, 0, r3, 4), o2.write(t4, e3, r3, n3, 23, 4), r3 + 4;
  17582. }
  17583. function j2(t4, e3, r3, n3, i3) {
  17584. return i3 || U2(t4, 0, r3, 8), o2.write(t4, e3, r3, n3, 52, 8), r3 + 8;
  17585. }
  17586. c2.prototype.slice = function(t4, e3) {
  17587. var r3, n3 = this.length;
  17588. if ((t4 = ~~t4) < 0 ? (t4 += n3) < 0 && (t4 = 0) : t4 > n3 && (t4 = n3), (e3 = void 0 === e3 ? n3 : ~~e3) < 0 ? (e3 += n3) < 0 && (e3 = 0) : e3 > n3 && (e3 = n3), e3 < t4 && (e3 = t4), c2.TYPED_ARRAY_SUPPORT)
  17589. (r3 = this.subarray(t4, e3)).__proto__ = c2.prototype;
  17590. else {
  17591. var o3 = e3 - t4;
  17592. r3 = new c2(o3, void 0);
  17593. for (var i3 = 0; i3 < o3; ++i3)
  17594. r3[i3] = this[i3 + t4];
  17595. }
  17596. return r3;
  17597. }, c2.prototype.readUIntLE = function(t4, e3, r3) {
  17598. t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
  17599. for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
  17600. n3 += this[t4 + i3] * o3;
  17601. return n3;
  17602. }, c2.prototype.readUIntBE = function(t4, e3, r3) {
  17603. t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
  17604. for (var n3 = this[t4 + --e3], o3 = 1; e3 > 0 && (o3 *= 256); )
  17605. n3 += this[t4 + --e3] * o3;
  17606. return n3;
  17607. }, c2.prototype.readUInt8 = function(t4, e3) {
  17608. return e3 || T2(t4, 1, this.length), this[t4];
  17609. }, c2.prototype.readUInt16LE = function(t4, e3) {
  17610. return e3 || T2(t4, 2, this.length), this[t4] | this[t4 + 1] << 8;
  17611. }, c2.prototype.readUInt16BE = function(t4, e3) {
  17612. return e3 || T2(t4, 2, this.length), this[t4] << 8 | this[t4 + 1];
  17613. }, c2.prototype.readUInt32LE = function(t4, e3) {
  17614. return e3 || T2(t4, 4, this.length), (this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16) + 16777216 * this[t4 + 3];
  17615. }, c2.prototype.readUInt32BE = function(t4, e3) {
  17616. return e3 || T2(t4, 4, this.length), 16777216 * this[t4] + (this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3]);
  17617. }, c2.prototype.readIntLE = function(t4, e3, r3) {
  17618. t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
  17619. for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
  17620. n3 += this[t4 + i3] * o3;
  17621. return n3 >= (o3 *= 128) && (n3 -= Math.pow(2, 8 * e3)), n3;
  17622. }, c2.prototype.readIntBE = function(t4, e3, r3) {
  17623. t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
  17624. for (var n3 = e3, o3 = 1, i3 = this[t4 + --n3]; n3 > 0 && (o3 *= 256); )
  17625. i3 += this[t4 + --n3] * o3;
  17626. return i3 >= (o3 *= 128) && (i3 -= Math.pow(2, 8 * e3)), i3;
  17627. }, c2.prototype.readInt8 = function(t4, e3) {
  17628. return e3 || T2(t4, 1, this.length), 128 & this[t4] ? -1 * (255 - this[t4] + 1) : this[t4];
  17629. }, c2.prototype.readInt16LE = function(t4, e3) {
  17630. e3 || T2(t4, 2, this.length);
  17631. var r3 = this[t4] | this[t4 + 1] << 8;
  17632. return 32768 & r3 ? 4294901760 | r3 : r3;
  17633. }, c2.prototype.readInt16BE = function(t4, e3) {
  17634. e3 || T2(t4, 2, this.length);
  17635. var r3 = this[t4 + 1] | this[t4] << 8;
  17636. return 32768 & r3 ? 4294901760 | r3 : r3;
  17637. }, c2.prototype.readInt32LE = function(t4, e3) {
  17638. return e3 || T2(t4, 4, this.length), this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16 | this[t4 + 3] << 24;
  17639. }, c2.prototype.readInt32BE = function(t4, e3) {
  17640. return e3 || T2(t4, 4, this.length), this[t4] << 24 | this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3];
  17641. }, c2.prototype.readFloatLE = function(t4, e3) {
  17642. return e3 || T2(t4, 4, this.length), o2.read(this, t4, true, 23, 4);
  17643. }, c2.prototype.readFloatBE = function(t4, e3) {
  17644. return e3 || T2(t4, 4, this.length), o2.read(this, t4, false, 23, 4);
  17645. }, c2.prototype.readDoubleLE = function(t4, e3) {
  17646. return e3 || T2(t4, 8, this.length), o2.read(this, t4, true, 52, 8);
  17647. }, c2.prototype.readDoubleBE = function(t4, e3) {
  17648. return e3 || T2(t4, 8, this.length), o2.read(this, t4, false, 52, 8);
  17649. }, c2.prototype.writeUIntLE = function(t4, e3, r3, n3) {
  17650. (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
  17651. var o3 = 1, i3 = 0;
  17652. for (this[e3] = 255 & t4; ++i3 < r3 && (o3 *= 256); )
  17653. this[e3 + i3] = t4 / o3 & 255;
  17654. return e3 + r3;
  17655. }, c2.prototype.writeUIntBE = function(t4, e3, r3, n3) {
  17656. (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
  17657. var o3 = r3 - 1, i3 = 1;
  17658. for (this[e3 + o3] = 255 & t4; --o3 >= 0 && (i3 *= 256); )
  17659. this[e3 + o3] = t4 / i3 & 255;
  17660. return e3 + r3;
  17661. }, c2.prototype.writeUInt8 = function(t4, e3, r3) {
  17662. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 1, 255, 0), c2.TYPED_ARRAY_SUPPORT || (t4 = Math.floor(t4)), this[e3] = 255 & t4, e3 + 1;
  17663. }, c2.prototype.writeUInt16LE = function(t4, e3, r3) {
  17664. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 65535, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8) : N2(this, t4, e3, true), e3 + 2;
  17665. }, c2.prototype.writeUInt16BE = function(t4, e3, r3) {
  17666. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 65535, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 8, this[e3 + 1] = 255 & t4) : N2(this, t4, e3, false), e3 + 2;
  17667. }, c2.prototype.writeUInt32LE = function(t4, e3, r3) {
  17668. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 4294967295, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3 + 3] = t4 >>> 24, this[e3 + 2] = t4 >>> 16, this[e3 + 1] = t4 >>> 8, this[e3] = 255 & t4) : L2(this, t4, e3, true), e3 + 4;
  17669. }, c2.prototype.writeUInt32BE = function(t4, e3, r3) {
  17670. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 4294967295, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 24, this[e3 + 1] = t4 >>> 16, this[e3 + 2] = t4 >>> 8, this[e3 + 3] = 255 & t4) : L2(this, t4, e3, false), e3 + 4;
  17671. }, c2.prototype.writeIntLE = function(t4, e3, r3, n3) {
  17672. if (t4 = +t4, e3 |= 0, !n3) {
  17673. var o3 = Math.pow(2, 8 * r3 - 1);
  17674. O2(this, t4, e3, r3, o3 - 1, -o3);
  17675. }
  17676. var i3 = 0, s3 = 1, a3 = 0;
  17677. for (this[e3] = 255 & t4; ++i3 < r3 && (s3 *= 256); )
  17678. t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 - 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
  17679. return e3 + r3;
  17680. }, c2.prototype.writeIntBE = function(t4, e3, r3, n3) {
  17681. if (t4 = +t4, e3 |= 0, !n3) {
  17682. var o3 = Math.pow(2, 8 * r3 - 1);
  17683. O2(this, t4, e3, r3, o3 - 1, -o3);
  17684. }
  17685. var i3 = r3 - 1, s3 = 1, a3 = 0;
  17686. for (this[e3 + i3] = 255 & t4; --i3 >= 0 && (s3 *= 256); )
  17687. t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 + 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
  17688. return e3 + r3;
  17689. }, c2.prototype.writeInt8 = function(t4, e3, r3) {
  17690. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 1, 127, -128), c2.TYPED_ARRAY_SUPPORT || (t4 = Math.floor(t4)), t4 < 0 && (t4 = 255 + t4 + 1), this[e3] = 255 & t4, e3 + 1;
  17691. }, c2.prototype.writeInt16LE = function(t4, e3, r3) {
  17692. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 32767, -32768), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8) : N2(this, t4, e3, true), e3 + 2;
  17693. }, c2.prototype.writeInt16BE = function(t4, e3, r3) {
  17694. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 32767, -32768), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 8, this[e3 + 1] = 255 & t4) : N2(this, t4, e3, false), e3 + 2;
  17695. }, c2.prototype.writeInt32LE = function(t4, e3, r3) {
  17696. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 2147483647, -2147483648), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8, this[e3 + 2] = t4 >>> 16, this[e3 + 3] = t4 >>> 24) : L2(this, t4, e3, true), e3 + 4;
  17697. }, c2.prototype.writeInt32BE = function(t4, e3, r3) {
  17698. return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 2147483647, -2147483648), t4 < 0 && (t4 = 4294967295 + t4 + 1), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 24, this[e3 + 1] = t4 >>> 16, this[e3 + 2] = t4 >>> 8, this[e3 + 3] = 255 & t4) : L2(this, t4, e3, false), e3 + 4;
  17699. }, c2.prototype.writeFloatLE = function(t4, e3, r3) {
  17700. return I2(this, t4, e3, true, r3);
  17701. }, c2.prototype.writeFloatBE = function(t4, e3, r3) {
  17702. return I2(this, t4, e3, false, r3);
  17703. }, c2.prototype.writeDoubleLE = function(t4, e3, r3) {
  17704. return j2(this, t4, e3, true, r3);
  17705. }, c2.prototype.writeDoubleBE = function(t4, e3, r3) {
  17706. return j2(this, t4, e3, false, r3);
  17707. }, c2.prototype.copy = function(t4, e3, r3, n3) {
  17708. if (r3 || (r3 = 0), n3 || 0 === n3 || (n3 = this.length), e3 >= t4.length && (e3 = t4.length), e3 || (e3 = 0), n3 > 0 && n3 < r3 && (n3 = r3), n3 === r3)
  17709. return 0;
  17710. if (0 === t4.length || 0 === this.length)
  17711. return 0;
  17712. if (e3 < 0)
  17713. throw new RangeError("targetStart out of bounds");
  17714. if (r3 < 0 || r3 >= this.length)
  17715. throw new RangeError("sourceStart out of bounds");
  17716. if (n3 < 0)
  17717. throw new RangeError("sourceEnd out of bounds");
  17718. n3 > this.length && (n3 = this.length), t4.length - e3 < n3 - r3 && (n3 = t4.length - e3 + r3);
  17719. var o3, i3 = n3 - r3;
  17720. if (this === t4 && r3 < e3 && e3 < n3)
  17721. for (o3 = i3 - 1; o3 >= 0; --o3)
  17722. t4[o3 + e3] = this[o3 + r3];
  17723. else if (i3 < 1e3 || !c2.TYPED_ARRAY_SUPPORT)
  17724. for (o3 = 0; o3 < i3; ++o3)
  17725. t4[o3 + e3] = this[o3 + r3];
  17726. else
  17727. Uint8Array.prototype.set.call(t4, this.subarray(r3, r3 + i3), e3);
  17728. return i3;
  17729. }, c2.prototype.fill = function(t4, e3, r3, n3) {
  17730. if ("string" == typeof t4) {
  17731. if ("string" == typeof e3 ? (n3 = e3, e3 = 0, r3 = this.length) : "string" == typeof r3 && (n3 = r3, r3 = this.length), 1 === t4.length) {
  17732. var o3 = t4.charCodeAt(0);
  17733. o3 < 256 && (t4 = o3);
  17734. }
  17735. if (void 0 !== n3 && "string" != typeof n3)
  17736. throw new TypeError("encoding must be a string");
  17737. if ("string" == typeof n3 && !c2.isEncoding(n3))
  17738. throw new TypeError("Unknown encoding: " + n3);
  17739. } else
  17740. "number" == typeof t4 && (t4 &= 255);
  17741. if (e3 < 0 || this.length < e3 || this.length < r3)
  17742. throw new RangeError("Out of range index");
  17743. if (r3 <= e3)
  17744. return this;
  17745. var i3;
  17746. if (e3 >>>= 0, r3 = void 0 === r3 ? this.length : r3 >>> 0, t4 || (t4 = 0), "number" == typeof t4)
  17747. for (i3 = e3; i3 < r3; ++i3)
  17748. this[i3] = t4;
  17749. else {
  17750. var s3 = c2.isBuffer(t4) ? t4 : q2(new c2(t4, n3).toString()), a3 = s3.length;
  17751. for (i3 = 0; i3 < r3 - e3; ++i3)
  17752. this[i3 + e3] = s3[i3 % a3];
  17753. }
  17754. return this;
  17755. };
  17756. var D2 = /[^+\/0-9A-Za-z-_]/g;
  17757. function M2(t4) {
  17758. return t4 < 16 ? "0" + t4.toString(16) : t4.toString(16);
  17759. }
  17760. function q2(t4, e3) {
  17761. var r3;
  17762. e3 = e3 || 1 / 0;
  17763. for (var n3 = t4.length, o3 = null, i3 = [], s3 = 0; s3 < n3; ++s3) {
  17764. if ((r3 = t4.charCodeAt(s3)) > 55295 && r3 < 57344) {
  17765. if (!o3) {
  17766. if (r3 > 56319) {
  17767. (e3 -= 3) > -1 && i3.push(239, 191, 189);
  17768. continue;
  17769. }
  17770. if (s3 + 1 === n3) {
  17771. (e3 -= 3) > -1 && i3.push(239, 191, 189);
  17772. continue;
  17773. }
  17774. o3 = r3;
  17775. continue;
  17776. }
  17777. if (r3 < 56320) {
  17778. (e3 -= 3) > -1 && i3.push(239, 191, 189), o3 = r3;
  17779. continue;
  17780. }
  17781. r3 = 65536 + (o3 - 55296 << 10 | r3 - 56320);
  17782. } else
  17783. o3 && (e3 -= 3) > -1 && i3.push(239, 191, 189);
  17784. if (o3 = null, r3 < 128) {
  17785. if ((e3 -= 1) < 0)
  17786. break;
  17787. i3.push(r3);
  17788. } else if (r3 < 2048) {
  17789. if ((e3 -= 2) < 0)
  17790. break;
  17791. i3.push(r3 >> 6 | 192, 63 & r3 | 128);
  17792. } else if (r3 < 65536) {
  17793. if ((e3 -= 3) < 0)
  17794. break;
  17795. i3.push(r3 >> 12 | 224, r3 >> 6 & 63 | 128, 63 & r3 | 128);
  17796. } else {
  17797. if (!(r3 < 1114112))
  17798. throw new Error("Invalid code point");
  17799. if ((e3 -= 4) < 0)
  17800. break;
  17801. i3.push(r3 >> 18 | 240, r3 >> 12 & 63 | 128, r3 >> 6 & 63 | 128, 63 & r3 | 128);
  17802. }
  17803. }
  17804. return i3;
  17805. }
  17806. function Y2(t4) {
  17807. return n2.toByteArray(function(t5) {
  17808. if ((t5 = function(t6) {
  17809. return t6.trim ? t6.trim() : t6.replace(/^\s+|\s+$/g, "");
  17810. }(t5).replace(D2, "")).length < 2)
  17811. return "";
  17812. for (; t5.length % 4 != 0; )
  17813. t5 += "=";
  17814. return t5;
  17815. }(t4));
  17816. }
  17817. function H2(t4, e3, r3, n3) {
  17818. for (var o3 = 0; o3 < n3 && !(o3 + r3 >= e3.length || o3 >= t4.length); ++o3)
  17819. e3[o3 + r3] = t4[o3];
  17820. return o3;
  17821. }
  17822. }).call(this, r2(12));
  17823. }, function(t2, e2, r2) {
  17824. var n2 = r2(31);
  17825. t2.exports = function(t3) {
  17826. var e3 = t3.xdomain, r3 = t3.xscheme, o2 = t3.enablesXDR;
  17827. try {
  17828. if ("undefined" != typeof XMLHttpRequest && (!e3 || n2))
  17829. return new XMLHttpRequest();
  17830. } catch (t4) {
  17831. }
  17832. try {
  17833. if ("undefined" != typeof XDomainRequest && !r3 && o2)
  17834. return new XDomainRequest();
  17835. } catch (t4) {
  17836. }
  17837. if (!e3)
  17838. try {
  17839. return new self[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
  17840. } catch (t4) {
  17841. }
  17842. };
  17843. }, function(t2, e2, r2) {
  17844. var n2 = r2(2), o2 = r2(1);
  17845. function i2(t3) {
  17846. this.path = t3.path, this.hostname = t3.hostname, this.port = t3.port, this.secure = t3.secure, this.query = t3.query, this.timestampParam = t3.timestampParam, this.timestampRequests = t3.timestampRequests, this.readyState = "", this.agent = t3.agent || false, this.socket = t3.socket, this.enablesXDR = t3.enablesXDR, this.withCredentials = t3.withCredentials, this.pfx = t3.pfx, this.key = t3.key, this.passphrase = t3.passphrase, this.cert = t3.cert, this.ca = t3.ca, this.ciphers = t3.ciphers, this.rejectUnauthorized = t3.rejectUnauthorized, this.forceNode = t3.forceNode, this.isReactNative = t3.isReactNative, this.extraHeaders = t3.extraHeaders, this.localAddress = t3.localAddress;
  17847. }
  17848. t2.exports = i2, o2(i2.prototype), i2.prototype.onError = function(t3, e3) {
  17849. var r3 = new Error(t3);
  17850. return r3.type = "TransportError", r3.description = e3, this.emit("error", r3), this;
  17851. }, i2.prototype.open = function() {
  17852. return "closed" !== this.readyState && "" !== this.readyState || (this.readyState = "opening", this.doOpen()), this;
  17853. }, i2.prototype.close = function() {
  17854. return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this;
  17855. }, i2.prototype.send = function(t3) {
  17856. if ("open" !== this.readyState)
  17857. throw new Error("Transport not open");
  17858. this.write(t3);
  17859. }, i2.prototype.onOpen = function() {
  17860. this.readyState = "open", this.writable = true, this.emit("open");
  17861. }, i2.prototype.onData = function(t3) {
  17862. var e3 = n2.decodePacket(t3, this.socket.binaryType);
  17863. this.onPacket(e3);
  17864. }, i2.prototype.onPacket = function(t3) {
  17865. this.emit("packet", t3);
  17866. }, i2.prototype.onClose = function() {
  17867. this.readyState = "closed", this.emit("close");
  17868. };
  17869. }, function(t2, e2) {
  17870. var r2 = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, n2 = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"];
  17871. t2.exports = function(t3) {
  17872. var e3 = t3, o2 = t3.indexOf("["), i2 = t3.indexOf("]");
  17873. -1 != o2 && -1 != i2 && (t3 = t3.substring(0, o2) + t3.substring(o2, i2).replace(/:/g, ";") + t3.substring(i2, t3.length));
  17874. for (var s2 = r2.exec(t3 || ""), a2 = {}, c2 = 14; c2--; )
  17875. a2[n2[c2]] = s2[c2] || "";
  17876. return -1 != o2 && -1 != i2 && (a2.source = e3, a2.host = a2.host.substring(1, a2.host.length - 1).replace(/;/g, ":"), a2.authority = a2.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a2.ipv6uri = true), a2;
  17877. };
  17878. }, function(t2, e2) {
  17879. var r2 = {}.toString;
  17880. t2.exports = Array.isArray || function(t3) {
  17881. return "[object Array]" == r2.call(t3);
  17882. };
  17883. }, function(t2, e2, r2) {
  17884. (function(e3) {
  17885. t2.exports = function(t3) {
  17886. return r3 && e3.isBuffer(t3) || n2 && (t3 instanceof ArrayBuffer || function(t4) {
  17887. return "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(t4) : t4.buffer instanceof ArrayBuffer;
  17888. }(t3));
  17889. };
  17890. var r3 = "function" == typeof e3 && "function" == typeof e3.isBuffer, n2 = "function" == typeof ArrayBuffer;
  17891. }).call(this, r2(6).Buffer);
  17892. }, function(t2, e2) {
  17893. var r2;
  17894. r2 = function() {
  17895. return this;
  17896. }();
  17897. try {
  17898. r2 = r2 || new Function("return this")();
  17899. } catch (t3) {
  17900. "object" == typeof window && (r2 = window);
  17901. }
  17902. t2.exports = r2;
  17903. }, function(t2, e2, r2) {
  17904. var n2 = r2(29), o2 = r2(19), i2 = r2(1), s2 = r2(5), a2 = r2(20), c2 = r2(21), h2 = r2(0)("socket.io-client:manager"), u2 = r2(18), f2 = r2(46), p2 = Object.prototype.hasOwnProperty;
  17905. function l2(t3, e3) {
  17906. if (!(this instanceof l2))
  17907. return new l2(t3, e3);
  17908. t3 && "object" == typeof t3 && (e3 = t3, t3 = void 0), (e3 = e3 || {}).path = e3.path || "/socket.io", this.nsps = {}, this.subs = [], this.opts = e3, this.reconnection(false !== e3.reconnection), this.reconnectionAttempts(e3.reconnectionAttempts || 1 / 0), this.reconnectionDelay(e3.reconnectionDelay || 1e3), this.reconnectionDelayMax(e3.reconnectionDelayMax || 5e3), this.randomizationFactor(e3.randomizationFactor || 0.5), this.backoff = new f2({ min: this.reconnectionDelay(), max: this.reconnectionDelayMax(), jitter: this.randomizationFactor() }), this.timeout(null == e3.timeout ? 2e4 : e3.timeout), this.readyState = "closed", this.uri = t3, this.connecting = [], this.lastPing = null, this.encoding = false, this.packetBuffer = [];
  17909. var r3 = e3.parser || s2;
  17910. this.encoder = new r3.Encoder(), this.decoder = new r3.Decoder(), this.autoConnect = false !== e3.autoConnect, this.autoConnect && this.open();
  17911. }
  17912. t2.exports = l2, l2.prototype.emitAll = function() {
  17913. for (var t3 in this.emit.apply(this, arguments), this.nsps)
  17914. p2.call(this.nsps, t3) && this.nsps[t3].emit.apply(this.nsps[t3], arguments);
  17915. }, l2.prototype.updateSocketIds = function() {
  17916. for (var t3 in this.nsps)
  17917. p2.call(this.nsps, t3) && (this.nsps[t3].id = this.generateId(t3));
  17918. }, l2.prototype.generateId = function(t3) {
  17919. return ("/" === t3 ? "" : t3 + "#") + this.engine.id;
  17920. }, i2(l2.prototype), l2.prototype.reconnection = function(t3) {
  17921. return arguments.length ? (this._reconnection = !!t3, this) : this._reconnection;
  17922. }, l2.prototype.reconnectionAttempts = function(t3) {
  17923. return arguments.length ? (this._reconnectionAttempts = t3, this) : this._reconnectionAttempts;
  17924. }, l2.prototype.reconnectionDelay = function(t3) {
  17925. return arguments.length ? (this._reconnectionDelay = t3, this.backoff && this.backoff.setMin(t3), this) : this._reconnectionDelay;
  17926. }, l2.prototype.randomizationFactor = function(t3) {
  17927. return arguments.length ? (this._randomizationFactor = t3, this.backoff && this.backoff.setJitter(t3), this) : this._randomizationFactor;
  17928. }, l2.prototype.reconnectionDelayMax = function(t3) {
  17929. return arguments.length ? (this._reconnectionDelayMax = t3, this.backoff && this.backoff.setMax(t3), this) : this._reconnectionDelayMax;
  17930. }, l2.prototype.timeout = function(t3) {
  17931. return arguments.length ? (this._timeout = t3, this) : this._timeout;
  17932. }, l2.prototype.maybeReconnectOnOpen = function() {
  17933. !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect();
  17934. }, l2.prototype.open = l2.prototype.connect = function(t3, e3) {
  17935. if (h2("readyState %s", this.readyState), ~this.readyState.indexOf("open"))
  17936. return this;
  17937. h2("opening %s", this.uri), this.engine = n2(this.uri, this.opts);
  17938. var r3 = this.engine, o3 = this;
  17939. this.readyState = "opening", this.skipReconnect = false;
  17940. var i3 = a2(r3, "open", function() {
  17941. o3.onopen(), t3 && t3();
  17942. }), s3 = a2(r3, "error", function(e4) {
  17943. if (h2("connect_error"), o3.cleanup(), o3.readyState = "closed", o3.emitAll("connect_error", e4), t3) {
  17944. var r4 = new Error("Connection error");
  17945. r4.data = e4, t3(r4);
  17946. } else
  17947. o3.maybeReconnectOnOpen();
  17948. });
  17949. if (false !== this._timeout) {
  17950. var c3 = this._timeout;
  17951. h2("connect attempt will timeout after %d", c3);
  17952. var u3 = setTimeout(function() {
  17953. h2("connect attempt timed out after %d", c3), i3.destroy(), r3.close(), r3.emit("error", "timeout"), o3.emitAll("connect_timeout", c3);
  17954. }, c3);
  17955. this.subs.push({ destroy: function() {
  17956. clearTimeout(u3);
  17957. } });
  17958. }
  17959. return this.subs.push(i3), this.subs.push(s3), this;
  17960. }, l2.prototype.onopen = function() {
  17961. h2("open"), this.cleanup(), this.readyState = "open", this.emit("open");
  17962. var t3 = this.engine;
  17963. this.subs.push(a2(t3, "data", c2(this, "ondata"))), this.subs.push(a2(t3, "ping", c2(this, "onping"))), this.subs.push(a2(t3, "pong", c2(this, "onpong"))), this.subs.push(a2(t3, "error", c2(this, "onerror"))), this.subs.push(a2(t3, "close", c2(this, "onclose"))), this.subs.push(a2(this.decoder, "decoded", c2(this, "ondecoded")));
  17964. }, l2.prototype.onping = function() {
  17965. this.lastPing = /* @__PURE__ */ new Date(), this.emitAll("ping");
  17966. }, l2.prototype.onpong = function() {
  17967. this.emitAll("pong", /* @__PURE__ */ new Date() - this.lastPing);
  17968. }, l2.prototype.ondata = function(t3) {
  17969. this.decoder.add(t3);
  17970. }, l2.prototype.ondecoded = function(t3) {
  17971. this.emit("packet", t3);
  17972. }, l2.prototype.onerror = function(t3) {
  17973. h2("error", t3), this.emitAll("error", t3);
  17974. }, l2.prototype.socket = function(t3, e3) {
  17975. var r3 = this.nsps[t3];
  17976. if (!r3) {
  17977. r3 = new o2(this, t3, e3), this.nsps[t3] = r3;
  17978. var n3 = this;
  17979. r3.on("connecting", i3), r3.on("connect", function() {
  17980. r3.id = n3.generateId(t3);
  17981. }), this.autoConnect && i3();
  17982. }
  17983. function i3() {
  17984. ~u2(n3.connecting, r3) || n3.connecting.push(r3);
  17985. }
  17986. return r3;
  17987. }, l2.prototype.destroy = function(t3) {
  17988. var e3 = u2(this.connecting, t3);
  17989. ~e3 && this.connecting.splice(e3, 1), this.connecting.length || this.close();
  17990. }, l2.prototype.packet = function(t3) {
  17991. h2("writing packet %j", t3);
  17992. var e3 = this;
  17993. t3.query && 0 === t3.type && (t3.nsp += "?" + t3.query), e3.encoding ? e3.packetBuffer.push(t3) : (e3.encoding = true, this.encoder.encode(t3, function(r3) {
  17994. for (var n3 = 0; n3 < r3.length; n3++)
  17995. e3.engine.write(r3[n3], t3.options);
  17996. e3.encoding = false, e3.processPacketQueue();
  17997. }));
  17998. }, l2.prototype.processPacketQueue = function() {
  17999. if (this.packetBuffer.length > 0 && !this.encoding) {
  18000. var t3 = this.packetBuffer.shift();
  18001. this.packet(t3);
  18002. }
  18003. }, l2.prototype.cleanup = function() {
  18004. h2("cleanup");
  18005. for (var t3 = this.subs.length, e3 = 0; e3 < t3; e3++) {
  18006. this.subs.shift().destroy();
  18007. }
  18008. this.packetBuffer = [], this.encoding = false, this.lastPing = null, this.decoder.destroy();
  18009. }, l2.prototype.close = l2.prototype.disconnect = function() {
  18010. h2("disconnect"), this.skipReconnect = true, this.reconnecting = false, "opening" === this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close();
  18011. }, l2.prototype.onclose = function(t3) {
  18012. h2("onclose"), this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", t3), this._reconnection && !this.skipReconnect && this.reconnect();
  18013. }, l2.prototype.reconnect = function() {
  18014. if (this.reconnecting || this.skipReconnect)
  18015. return this;
  18016. var t3 = this;
  18017. if (this.backoff.attempts >= this._reconnectionAttempts)
  18018. h2("reconnect failed"), this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = false;
  18019. else {
  18020. var e3 = this.backoff.duration();
  18021. h2("will wait %dms before reconnect attempt", e3), this.reconnecting = true;
  18022. var r3 = setTimeout(function() {
  18023. t3.skipReconnect || (h2("attempting reconnect"), t3.emitAll("reconnect_attempt", t3.backoff.attempts), t3.emitAll("reconnecting", t3.backoff.attempts), t3.skipReconnect || t3.open(function(e4) {
  18024. e4 ? (h2("reconnect attempt error"), t3.reconnecting = false, t3.reconnect(), t3.emitAll("reconnect_error", e4.data)) : (h2("reconnect success"), t3.onreconnect());
  18025. }));
  18026. }, e3);
  18027. this.subs.push({ destroy: function() {
  18028. clearTimeout(r3);
  18029. } });
  18030. }
  18031. }, l2.prototype.onreconnect = function() {
  18032. var t3 = this.backoff.attempts;
  18033. this.reconnecting = false, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", t3);
  18034. };
  18035. }, function(t2, e2, r2) {
  18036. var n2 = r2(7), o2 = r2(32), i2 = r2(40), s2 = r2(41);
  18037. e2.polling = function(t3) {
  18038. var e3 = false, r3 = false, s3 = false !== t3.jsonp;
  18039. if ("undefined" != typeof location) {
  18040. var a2 = "https:" === location.protocol, c2 = location.port;
  18041. c2 || (c2 = a2 ? 443 : 80), e3 = t3.hostname !== location.hostname || c2 !== t3.port, r3 = t3.secure !== a2;
  18042. }
  18043. if (t3.xdomain = e3, t3.xscheme = r3, "open" in new n2(t3) && !t3.forceJSONP)
  18044. return new o2(t3);
  18045. if (!s3)
  18046. throw new Error("JSONP disabled");
  18047. return new i2(t3);
  18048. }, e2.websocket = s2;
  18049. }, function(t2, e2, r2) {
  18050. var n2 = r2(8), o2 = r2(3), i2 = r2(2), s2 = r2(4), a2 = r2(17), c2 = r2(0)("engine.io-client:polling");
  18051. t2.exports = u2;
  18052. var h2 = null != new (r2(7))({ xdomain: false }).responseType;
  18053. function u2(t3) {
  18054. var e3 = t3 && t3.forceBase64;
  18055. h2 && !e3 || (this.supportsBinary = false), n2.call(this, t3);
  18056. }
  18057. s2(u2, n2), u2.prototype.name = "polling", u2.prototype.doOpen = function() {
  18058. this.poll();
  18059. }, u2.prototype.pause = function(t3) {
  18060. var e3 = this;
  18061. function r3() {
  18062. c2("paused"), e3.readyState = "paused", t3();
  18063. }
  18064. if (this.readyState = "pausing", this.polling || !this.writable) {
  18065. var n3 = 0;
  18066. this.polling && (c2("we are currently polling - waiting to pause"), n3++, this.once("pollComplete", function() {
  18067. c2("pre-pause polling complete"), --n3 || r3();
  18068. })), this.writable || (c2("we are currently writing - waiting to pause"), n3++, this.once("drain", function() {
  18069. c2("pre-pause writing complete"), --n3 || r3();
  18070. }));
  18071. } else
  18072. r3();
  18073. }, u2.prototype.poll = function() {
  18074. c2("polling"), this.polling = true, this.doPoll(), this.emit("poll");
  18075. }, u2.prototype.onData = function(t3) {
  18076. var e3 = this;
  18077. c2("polling got data %s", t3);
  18078. i2.decodePayload(t3, this.socket.binaryType, function(t4, r3, n3) {
  18079. if ("opening" === e3.readyState && e3.onOpen(), "close" === t4.type)
  18080. return e3.onClose(), false;
  18081. e3.onPacket(t4);
  18082. }), "closed" !== this.readyState && (this.polling = false, this.emit("pollComplete"), "open" === this.readyState ? this.poll() : c2('ignoring poll - transport state "%s"', this.readyState));
  18083. }, u2.prototype.doClose = function() {
  18084. var t3 = this;
  18085. function e3() {
  18086. c2("writing close packet"), t3.write([{ type: "close" }]);
  18087. }
  18088. "open" === this.readyState ? (c2("transport open - closing"), e3()) : (c2("transport not open - deferring close"), this.once("open", e3));
  18089. }, u2.prototype.write = function(t3) {
  18090. var e3 = this;
  18091. this.writable = false;
  18092. var r3 = function() {
  18093. e3.writable = true, e3.emit("drain");
  18094. };
  18095. i2.encodePayload(t3, this.supportsBinary, function(t4) {
  18096. e3.doWrite(t4, r3);
  18097. });
  18098. }, u2.prototype.uri = function() {
  18099. var t3 = this.query || {}, e3 = this.secure ? "https" : "http", r3 = "";
  18100. return false !== this.timestampRequests && (t3[this.timestampParam] = a2()), this.supportsBinary || t3.sid || (t3.b64 = 1), t3 = o2.encode(t3), this.port && ("https" === e3 && 443 !== Number(this.port) || "http" === e3 && 80 !== Number(this.port)) && (r3 = ":" + this.port), t3.length && (t3 = "?" + t3), e3 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + r3 + this.path + t3;
  18101. };
  18102. }, function(t2, e2, r2) {
  18103. (function(e3) {
  18104. var n2 = r2(34), o2 = Object.prototype.toString, i2 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === o2.call(Blob), s2 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === o2.call(File);
  18105. t2.exports = function t3(r3) {
  18106. if (!r3 || "object" != typeof r3)
  18107. return false;
  18108. if (n2(r3)) {
  18109. for (var o3 = 0, a2 = r3.length; o3 < a2; o3++)
  18110. if (t3(r3[o3]))
  18111. return true;
  18112. return false;
  18113. }
  18114. if ("function" == typeof e3 && e3.isBuffer && e3.isBuffer(r3) || "function" == typeof ArrayBuffer && r3 instanceof ArrayBuffer || i2 && r3 instanceof Blob || s2 && r3 instanceof File)
  18115. return true;
  18116. if (r3.toJSON && "function" == typeof r3.toJSON && 1 === arguments.length)
  18117. return t3(r3.toJSON(), true);
  18118. for (var c2 in r3)
  18119. if (Object.prototype.hasOwnProperty.call(r3, c2) && t3(r3[c2]))
  18120. return true;
  18121. return false;
  18122. };
  18123. }).call(this, r2(6).Buffer);
  18124. }, function(t2, e2, r2) {
  18125. var n2, o2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), i2 = {}, s2 = 0, a2 = 0;
  18126. function c2(t3) {
  18127. var e3 = "";
  18128. do {
  18129. e3 = o2[t3 % 64] + e3, t3 = Math.floor(t3 / 64);
  18130. } while (t3 > 0);
  18131. return e3;
  18132. }
  18133. function h2() {
  18134. var t3 = c2(+/* @__PURE__ */ new Date());
  18135. return t3 !== n2 ? (s2 = 0, n2 = t3) : t3 + "." + c2(s2++);
  18136. }
  18137. for (; a2 < 64; a2++)
  18138. i2[o2[a2]] = a2;
  18139. h2.encode = c2, h2.decode = function(t3) {
  18140. var e3 = 0;
  18141. for (a2 = 0; a2 < t3.length; a2++)
  18142. e3 = 64 * e3 + i2[t3.charAt(a2)];
  18143. return e3;
  18144. }, t2.exports = h2;
  18145. }, function(t2, e2) {
  18146. var r2 = [].indexOf;
  18147. t2.exports = function(t3, e3) {
  18148. if (r2)
  18149. return t3.indexOf(e3);
  18150. for (var n2 = 0; n2 < t3.length; ++n2)
  18151. if (t3[n2] === e3)
  18152. return n2;
  18153. return -1;
  18154. };
  18155. }, function(t2, e2, r2) {
  18156. var n2 = r2(5), o2 = r2(1), i2 = r2(45), s2 = r2(20), a2 = r2(21), c2 = r2(0)("socket.io-client:socket"), h2 = r2(3), u2 = r2(16);
  18157. t2.exports = l2;
  18158. var f2 = { connect: 1, connect_error: 1, connect_timeout: 1, connecting: 1, disconnect: 1, error: 1, reconnect: 1, reconnect_attempt: 1, reconnect_failed: 1, reconnect_error: 1, reconnecting: 1, ping: 1, pong: 1 }, p2 = o2.prototype.emit;
  18159. function l2(t3, e3, r3) {
  18160. this.io = t3, this.nsp = e3, this.json = this, this.ids = 0, this.acks = {}, this.receiveBuffer = [], this.sendBuffer = [], this.connected = false, this.disconnected = true, this.flags = {}, r3 && r3.query && (this.query = r3.query), this.io.autoConnect && this.open();
  18161. }
  18162. o2(l2.prototype), l2.prototype.subEvents = function() {
  18163. if (!this.subs) {
  18164. var t3 = this.io;
  18165. this.subs = [s2(t3, "open", a2(this, "onopen")), s2(t3, "packet", a2(this, "onpacket")), s2(t3, "close", a2(this, "onclose"))];
  18166. }
  18167. }, l2.prototype.open = l2.prototype.connect = function() {
  18168. return this.connected || (this.subEvents(), this.io.open(), "open" === this.io.readyState && this.onopen(), this.emit("connecting")), this;
  18169. }, l2.prototype.send = function() {
  18170. var t3 = i2(arguments);
  18171. return t3.unshift("message"), this.emit.apply(this, t3), this;
  18172. }, l2.prototype.emit = function(t3) {
  18173. if (f2.hasOwnProperty(t3))
  18174. return p2.apply(this, arguments), this;
  18175. var e3 = i2(arguments), r3 = { type: (void 0 !== this.flags.binary ? this.flags.binary : u2(e3)) ? n2.BINARY_EVENT : n2.EVENT, data: e3, options: {} };
  18176. return r3.options.compress = !this.flags || false !== this.flags.compress, "function" == typeof e3[e3.length - 1] && (c2("emitting packet with ack id %d", this.ids), this.acks[this.ids] = e3.pop(), r3.id = this.ids++), this.connected ? this.packet(r3) : this.sendBuffer.push(r3), this.flags = {}, this;
  18177. }, l2.prototype.packet = function(t3) {
  18178. t3.nsp = this.nsp, this.io.packet(t3);
  18179. }, l2.prototype.onopen = function() {
  18180. if (c2("transport is open - connecting"), "/" !== this.nsp)
  18181. if (this.query) {
  18182. var t3 = "object" == typeof this.query ? h2.encode(this.query) : this.query;
  18183. c2("sending connect packet with query %s", t3), this.packet({ type: n2.CONNECT, query: t3 });
  18184. } else
  18185. this.packet({ type: n2.CONNECT });
  18186. }, l2.prototype.onclose = function(t3) {
  18187. c2("close (%s)", t3), this.connected = false, this.disconnected = true, delete this.id, this.emit("disconnect", t3);
  18188. }, l2.prototype.onpacket = function(t3) {
  18189. var e3 = t3.nsp === this.nsp, r3 = t3.type === n2.ERROR && "/" === t3.nsp;
  18190. if (e3 || r3)
  18191. switch (t3.type) {
  18192. case n2.CONNECT:
  18193. this.onconnect();
  18194. break;
  18195. case n2.EVENT:
  18196. case n2.BINARY_EVENT:
  18197. this.onevent(t3);
  18198. break;
  18199. case n2.ACK:
  18200. case n2.BINARY_ACK:
  18201. this.onack(t3);
  18202. break;
  18203. case n2.DISCONNECT:
  18204. this.ondisconnect();
  18205. break;
  18206. case n2.ERROR:
  18207. this.emit("error", t3.data);
  18208. }
  18209. }, l2.prototype.onevent = function(t3) {
  18210. var e3 = t3.data || [];
  18211. c2("emitting event %j", e3), null != t3.id && (c2("attaching ack callback to event"), e3.push(this.ack(t3.id))), this.connected ? p2.apply(this, e3) : this.receiveBuffer.push(e3);
  18212. }, l2.prototype.ack = function(t3) {
  18213. var e3 = this, r3 = false;
  18214. return function() {
  18215. if (!r3) {
  18216. r3 = true;
  18217. var o3 = i2(arguments);
  18218. c2("sending ack %j", o3), e3.packet({ type: u2(o3) ? n2.BINARY_ACK : n2.ACK, id: t3, data: o3 });
  18219. }
  18220. };
  18221. }, l2.prototype.onack = function(t3) {
  18222. var e3 = this.acks[t3.id];
  18223. "function" == typeof e3 ? (c2("calling ack %s with %j", t3.id, t3.data), e3.apply(this, t3.data), delete this.acks[t3.id]) : c2("bad ack %s", t3.id);
  18224. }, l2.prototype.onconnect = function() {
  18225. this.connected = true, this.disconnected = false, this.emit("connect"), this.emitBuffered();
  18226. }, l2.prototype.emitBuffered = function() {
  18227. var t3;
  18228. for (t3 = 0; t3 < this.receiveBuffer.length; t3++)
  18229. p2.apply(this, this.receiveBuffer[t3]);
  18230. for (this.receiveBuffer = [], t3 = 0; t3 < this.sendBuffer.length; t3++)
  18231. this.packet(this.sendBuffer[t3]);
  18232. this.sendBuffer = [];
  18233. }, l2.prototype.ondisconnect = function() {
  18234. c2("server disconnect (%s)", this.nsp), this.destroy(), this.onclose("io server disconnect");
  18235. }, l2.prototype.destroy = function() {
  18236. if (this.subs) {
  18237. for (var t3 = 0; t3 < this.subs.length; t3++)
  18238. this.subs[t3].destroy();
  18239. this.subs = null;
  18240. }
  18241. this.io.destroy(this);
  18242. }, l2.prototype.close = l2.prototype.disconnect = function() {
  18243. return this.connected && (c2("performing disconnect (%s)", this.nsp), this.packet({ type: n2.DISCONNECT })), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
  18244. }, l2.prototype.compress = function(t3) {
  18245. return this.flags.compress = t3, this;
  18246. }, l2.prototype.binary = function(t3) {
  18247. return this.flags.binary = t3, this;
  18248. };
  18249. }, function(t2, e2) {
  18250. t2.exports = function(t3, e3, r2) {
  18251. return t3.on(e3, r2), { destroy: function() {
  18252. t3.removeListener(e3, r2);
  18253. } };
  18254. };
  18255. }, function(t2, e2) {
  18256. var r2 = [].slice;
  18257. t2.exports = function(t3, e3) {
  18258. if ("string" == typeof e3 && (e3 = t3[e3]), "function" != typeof e3)
  18259. throw new Error("bind() requires a function");
  18260. var n2 = r2.call(arguments, 2);
  18261. return function() {
  18262. return e3.apply(t3, n2.concat(r2.call(arguments)));
  18263. };
  18264. };
  18265. }, function(t2, e2, r2) {
  18266. t2.exports = r2(23);
  18267. }, function(t2, e2, r2) {
  18268. var n2 = r2(24), o2 = r2(5), i2 = r2(13), s2 = r2(0)("socket.io-client");
  18269. t2.exports = e2 = c2;
  18270. var a2 = e2.managers = {};
  18271. function c2(t3, e3) {
  18272. "object" == typeof t3 && (e3 = t3, t3 = void 0), e3 = e3 || {};
  18273. var r3, o3 = n2(t3), c3 = o3.source, h2 = o3.id, u2 = o3.path, f2 = a2[h2] && u2 in a2[h2].nsps;
  18274. return e3.forceNew || e3["force new connection"] || false === e3.multiplex || f2 ? (s2("ignoring socket cache for %s", c3), r3 = i2(c3, e3)) : (a2[h2] || (s2("new io instance for %s", c3), a2[h2] = i2(c3, e3)), r3 = a2[h2]), o3.query && !e3.query && (e3.query = o3.query), r3.socket(o3.path, e3);
  18275. }
  18276. e2.protocol = o2.protocol, e2.connect = c2, e2.Manager = r2(13), e2.Socket = r2(19);
  18277. }, function(t2, e2, r2) {
  18278. var n2 = r2(9), o2 = r2(0)("socket.io-client:url");
  18279. t2.exports = function(t3, e3) {
  18280. var r3 = t3;
  18281. e3 = e3 || "undefined" != typeof location && location, null == t3 && (t3 = e3.protocol + "//" + e3.host);
  18282. "string" == typeof t3 && ("/" === t3.charAt(0) && (t3 = "/" === t3.charAt(1) ? e3.protocol + t3 : e3.host + t3), /^(https?|wss?):\/\//.test(t3) || (o2("protocol-less url %s", t3), t3 = void 0 !== e3 ? e3.protocol + "//" + t3 : "https://" + t3), o2("parse %s", t3), r3 = n2(t3));
  18283. r3.port || (/^(http|ws)$/.test(r3.protocol) ? r3.port = "80" : /^(http|ws)s$/.test(r3.protocol) && (r3.port = "443"));
  18284. r3.path = r3.path || "/";
  18285. var i2 = -1 !== r3.host.indexOf(":") ? "[" + r3.host + "]" : r3.host;
  18286. return r3.id = r3.protocol + "://" + i2 + ":" + r3.port, r3.href = r3.protocol + "://" + i2 + (e3 && e3.port === r3.port ? "" : ":" + r3.port), r3;
  18287. };
  18288. }, function(t2, e2, r2) {
  18289. var n2 = r2(10), o2 = r2(11), i2 = Object.prototype.toString, s2 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === i2.call(Blob), a2 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === i2.call(File);
  18290. e2.deconstructPacket = function(t3) {
  18291. var e3 = [], r3 = t3.data, i3 = t3;
  18292. return i3.data = function t4(e4, r4) {
  18293. if (!e4)
  18294. return e4;
  18295. if (o2(e4)) {
  18296. var i4 = { _placeholder: true, num: r4.length };
  18297. return r4.push(e4), i4;
  18298. }
  18299. if (n2(e4)) {
  18300. for (var s3 = new Array(e4.length), a3 = 0; a3 < e4.length; a3++)
  18301. s3[a3] = t4(e4[a3], r4);
  18302. return s3;
  18303. }
  18304. if ("object" == typeof e4 && !(e4 instanceof Date)) {
  18305. s3 = {};
  18306. for (var c2 in e4)
  18307. s3[c2] = t4(e4[c2], r4);
  18308. return s3;
  18309. }
  18310. return e4;
  18311. }(r3, e3), i3.attachments = e3.length, { packet: i3, buffers: e3 };
  18312. }, e2.reconstructPacket = function(t3, e3) {
  18313. return t3.data = function t4(e4, r3) {
  18314. if (!e4)
  18315. return e4;
  18316. if (e4 && e4._placeholder)
  18317. return r3[e4.num];
  18318. if (n2(e4))
  18319. for (var o3 = 0; o3 < e4.length; o3++)
  18320. e4[o3] = t4(e4[o3], r3);
  18321. else if ("object" == typeof e4)
  18322. for (var i3 in e4)
  18323. e4[i3] = t4(e4[i3], r3);
  18324. return e4;
  18325. }(t3.data, e3), t3.attachments = void 0, t3;
  18326. }, e2.removeBlobs = function(t3, e3) {
  18327. var r3 = 0, i3 = t3;
  18328. !function t4(c2, h2, u2) {
  18329. if (!c2)
  18330. return c2;
  18331. if (s2 && c2 instanceof Blob || a2 && c2 instanceof File) {
  18332. r3++;
  18333. var f2 = new FileReader();
  18334. f2.onload = function() {
  18335. u2 ? u2[h2] = this.result : i3 = this.result, --r3 || e3(i3);
  18336. }, f2.readAsArrayBuffer(c2);
  18337. } else if (n2(c2))
  18338. for (var p2 = 0; p2 < c2.length; p2++)
  18339. t4(c2[p2], p2, c2);
  18340. else if ("object" == typeof c2 && !o2(c2))
  18341. for (var l2 in c2)
  18342. t4(c2[l2], l2, c2);
  18343. }(i3), r3 || e3(i3);
  18344. };
  18345. }, function(t2, e2, r2) {
  18346. e2.byteLength = function(t3) {
  18347. var e3 = h2(t3), r3 = e3[0], n3 = e3[1];
  18348. return 3 * (r3 + n3) / 4 - n3;
  18349. }, e2.toByteArray = function(t3) {
  18350. var e3, r3, n3 = h2(t3), s3 = n3[0], a3 = n3[1], c3 = new i2(function(t4, e4, r4) {
  18351. return 3 * (e4 + r4) / 4 - r4;
  18352. }(0, s3, a3)), u3 = 0, f2 = a3 > 0 ? s3 - 4 : s3;
  18353. for (r3 = 0; r3 < f2; r3 += 4)
  18354. e3 = o2[t3.charCodeAt(r3)] << 18 | o2[t3.charCodeAt(r3 + 1)] << 12 | o2[t3.charCodeAt(r3 + 2)] << 6 | o2[t3.charCodeAt(r3 + 3)], c3[u3++] = e3 >> 16 & 255, c3[u3++] = e3 >> 8 & 255, c3[u3++] = 255 & e3;
  18355. 2 === a3 && (e3 = o2[t3.charCodeAt(r3)] << 2 | o2[t3.charCodeAt(r3 + 1)] >> 4, c3[u3++] = 255 & e3);
  18356. 1 === a3 && (e3 = o2[t3.charCodeAt(r3)] << 10 | o2[t3.charCodeAt(r3 + 1)] << 4 | o2[t3.charCodeAt(r3 + 2)] >> 2, c3[u3++] = e3 >> 8 & 255, c3[u3++] = 255 & e3);
  18357. return c3;
  18358. }, e2.fromByteArray = function(t3) {
  18359. for (var e3, r3 = t3.length, o3 = r3 % 3, i3 = [], s3 = 0, a3 = r3 - o3; s3 < a3; s3 += 16383)
  18360. i3.push(u2(t3, s3, s3 + 16383 > a3 ? a3 : s3 + 16383));
  18361. 1 === o3 ? (e3 = t3[r3 - 1], i3.push(n2[e3 >> 2] + n2[e3 << 4 & 63] + "==")) : 2 === o3 && (e3 = (t3[r3 - 2] << 8) + t3[r3 - 1], i3.push(n2[e3 >> 10] + n2[e3 >> 4 & 63] + n2[e3 << 2 & 63] + "="));
  18362. return i3.join("");
  18363. };
  18364. for (var n2 = [], o2 = [], i2 = "undefined" != typeof Uint8Array ? Uint8Array : Array, s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a2 = 0, c2 = s2.length; a2 < c2; ++a2)
  18365. n2[a2] = s2[a2], o2[s2.charCodeAt(a2)] = a2;
  18366. function h2(t3) {
  18367. var e3 = t3.length;
  18368. if (e3 % 4 > 0)
  18369. throw new Error("Invalid string. Length must be a multiple of 4");
  18370. var r3 = t3.indexOf("=");
  18371. return -1 === r3 && (r3 = e3), [r3, r3 === e3 ? 0 : 4 - r3 % 4];
  18372. }
  18373. function u2(t3, e3, r3) {
  18374. for (var o3, i3, s3 = [], a3 = e3; a3 < r3; a3 += 3)
  18375. o3 = (t3[a3] << 16 & 16711680) + (t3[a3 + 1] << 8 & 65280) + (255 & t3[a3 + 2]), s3.push(n2[(i3 = o3) >> 18 & 63] + n2[i3 >> 12 & 63] + n2[i3 >> 6 & 63] + n2[63 & i3]);
  18376. return s3.join("");
  18377. }
  18378. o2["-".charCodeAt(0)] = 62, o2["_".charCodeAt(0)] = 63;
  18379. }, function(t2, e2) {
  18380. e2.read = function(t3, e3, r2, n2, o2) {
  18381. var i2, s2, a2 = 8 * o2 - n2 - 1, c2 = (1 << a2) - 1, h2 = c2 >> 1, u2 = -7, f2 = r2 ? o2 - 1 : 0, p2 = r2 ? -1 : 1, l2 = t3[e3 + f2];
  18382. for (f2 += p2, i2 = l2 & (1 << -u2) - 1, l2 >>= -u2, u2 += a2; u2 > 0; i2 = 256 * i2 + t3[e3 + f2], f2 += p2, u2 -= 8)
  18383. ;
  18384. for (s2 = i2 & (1 << -u2) - 1, i2 >>= -u2, u2 += n2; u2 > 0; s2 = 256 * s2 + t3[e3 + f2], f2 += p2, u2 -= 8)
  18385. ;
  18386. if (0 === i2)
  18387. i2 = 1 - h2;
  18388. else {
  18389. if (i2 === c2)
  18390. return s2 ? NaN : 1 / 0 * (l2 ? -1 : 1);
  18391. s2 += Math.pow(2, n2), i2 -= h2;
  18392. }
  18393. return (l2 ? -1 : 1) * s2 * Math.pow(2, i2 - n2);
  18394. }, e2.write = function(t3, e3, r2, n2, o2, i2) {
  18395. var s2, a2, c2, h2 = 8 * i2 - o2 - 1, u2 = (1 << h2) - 1, f2 = u2 >> 1, p2 = 23 === o2 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, l2 = n2 ? 0 : i2 - 1, d2 = n2 ? 1 : -1, y2 = e3 < 0 || 0 === e3 && 1 / e3 < 0 ? 1 : 0;
  18396. for (e3 = Math.abs(e3), isNaN(e3) || e3 === 1 / 0 ? (a2 = isNaN(e3) ? 1 : 0, s2 = u2) : (s2 = Math.floor(Math.log(e3) / Math.LN2), e3 * (c2 = Math.pow(2, -s2)) < 1 && (s2--, c2 *= 2), (e3 += s2 + f2 >= 1 ? p2 / c2 : p2 * Math.pow(2, 1 - f2)) * c2 >= 2 && (s2++, c2 /= 2), s2 + f2 >= u2 ? (a2 = 0, s2 = u2) : s2 + f2 >= 1 ? (a2 = (e3 * c2 - 1) * Math.pow(2, o2), s2 += f2) : (a2 = e3 * Math.pow(2, f2 - 1) * Math.pow(2, o2), s2 = 0)); o2 >= 8; t3[r2 + l2] = 255 & a2, l2 += d2, a2 /= 256, o2 -= 8)
  18397. ;
  18398. for (s2 = s2 << o2 | a2, h2 += o2; h2 > 0; t3[r2 + l2] = 255 & s2, l2 += d2, s2 /= 256, h2 -= 8)
  18399. ;
  18400. t3[r2 + l2 - d2] |= 128 * y2;
  18401. };
  18402. }, function(t2, e2) {
  18403. var r2 = {}.toString;
  18404. t2.exports = Array.isArray || function(t3) {
  18405. return "[object Array]" == r2.call(t3);
  18406. };
  18407. }, function(t2, e2, r2) {
  18408. t2.exports = r2(30), t2.exports.parser = r2(2);
  18409. }, function(t2, e2, r2) {
  18410. var n2 = r2(14), o2 = r2(1), i2 = r2(0)("engine.io-client:socket"), s2 = r2(18), a2 = r2(2), c2 = r2(9), h2 = r2(3);
  18411. function u2(t3, e3) {
  18412. if (!(this instanceof u2))
  18413. return new u2(t3, e3);
  18414. e3 = e3 || {}, t3 && "object" == typeof t3 && (e3 = t3, t3 = null), t3 ? (t3 = c2(t3), e3.hostname = t3.host, e3.secure = "https" === t3.protocol || "wss" === t3.protocol, e3.port = t3.port, t3.query && (e3.query = t3.query)) : e3.host && (e3.hostname = c2(e3.host).host), this.secure = null != e3.secure ? e3.secure : "undefined" != typeof location && "https:" === location.protocol, e3.hostname && !e3.port && (e3.port = this.secure ? "443" : "80"), this.agent = e3.agent || false, this.hostname = e3.hostname || ("undefined" != typeof location ? location.hostname : "localhost"), this.port = e3.port || ("undefined" != typeof location && location.port ? location.port : this.secure ? 443 : 80), this.query = e3.query || {}, "string" == typeof this.query && (this.query = h2.decode(this.query)), this.upgrade = false !== e3.upgrade, this.path = (e3.path || "/engine.io").replace(/\/$/, "") + "/", this.forceJSONP = !!e3.forceJSONP, this.jsonp = false !== e3.jsonp, this.forceBase64 = !!e3.forceBase64, this.enablesXDR = !!e3.enablesXDR, this.withCredentials = false !== e3.withCredentials, this.timestampParam = e3.timestampParam || "t", this.timestampRequests = e3.timestampRequests, this.transports = e3.transports || ["polling", "websocket"], this.transportOptions = e3.transportOptions || {}, this.readyState = "", this.writeBuffer = [], this.prevBufferLen = 0, this.policyPort = e3.policyPort || 843, this.rememberUpgrade = e3.rememberUpgrade || false, this.binaryType = null, this.onlyBinaryUpgrades = e3.onlyBinaryUpgrades, this.perMessageDeflate = false !== e3.perMessageDeflate && (e3.perMessageDeflate || {}), true === this.perMessageDeflate && (this.perMessageDeflate = {}), this.perMessageDeflate && null == this.perMessageDeflate.threshold && (this.perMessageDeflate.threshold = 1024), this.pfx = e3.pfx || null, this.key = e3.key || null, this.passphrase = e3.passphrase || null, this.cert = e3.cert || null, this.ca = e3.ca || null, this.ciphers = e3.ciphers || null, this.rejectUnauthorized = void 0 === e3.rejectUnauthorized || e3.rejectUnauthorized, this.forceNode = !!e3.forceNode, this.isReactNative = "undefined" != typeof navigator && "string" == typeof navigator.product && "reactnative" === navigator.product.toLowerCase(), ("undefined" == typeof self || this.isReactNative) && (e3.extraHeaders && Object.keys(e3.extraHeaders).length > 0 && (this.extraHeaders = e3.extraHeaders), e3.localAddress && (this.localAddress = e3.localAddress)), this.id = null, this.upgrades = null, this.pingInterval = null, this.pingTimeout = null, this.pingIntervalTimer = null, this.pingTimeoutTimer = null, this.open();
  18415. }
  18416. t2.exports = u2, u2.priorWebsocketSuccess = false, o2(u2.prototype), u2.protocol = a2.protocol, u2.Socket = u2, u2.Transport = r2(8), u2.transports = r2(14), u2.parser = r2(2), u2.prototype.createTransport = function(t3) {
  18417. i2('creating transport "%s"', t3);
  18418. var e3 = function(t4) {
  18419. var e4 = {};
  18420. for (var r4 in t4)
  18421. t4.hasOwnProperty(r4) && (e4[r4] = t4[r4]);
  18422. return e4;
  18423. }(this.query);
  18424. e3.EIO = a2.protocol, e3.transport = t3;
  18425. var r3 = this.transportOptions[t3] || {};
  18426. return this.id && (e3.sid = this.id), new n2[t3]({ query: e3, socket: this, agent: r3.agent || this.agent, hostname: r3.hostname || this.hostname, port: r3.port || this.port, secure: r3.secure || this.secure, path: r3.path || this.path, forceJSONP: r3.forceJSONP || this.forceJSONP, jsonp: r3.jsonp || this.jsonp, forceBase64: r3.forceBase64 || this.forceBase64, enablesXDR: r3.enablesXDR || this.enablesXDR, withCredentials: r3.withCredentials || this.withCredentials, timestampRequests: r3.timestampRequests || this.timestampRequests, timestampParam: r3.timestampParam || this.timestampParam, policyPort: r3.policyPort || this.policyPort, pfx: r3.pfx || this.pfx, key: r3.key || this.key, passphrase: r3.passphrase || this.passphrase, cert: r3.cert || this.cert, ca: r3.ca || this.ca, ciphers: r3.ciphers || this.ciphers, rejectUnauthorized: r3.rejectUnauthorized || this.rejectUnauthorized, perMessageDeflate: r3.perMessageDeflate || this.perMessageDeflate, extraHeaders: r3.extraHeaders || this.extraHeaders, forceNode: r3.forceNode || this.forceNode, localAddress: r3.localAddress || this.localAddress, requestTimeout: r3.requestTimeout || this.requestTimeout, protocols: r3.protocols || void 0, isReactNative: this.isReactNative });
  18427. }, u2.prototype.open = function() {
  18428. var t3;
  18429. if (this.rememberUpgrade && u2.priorWebsocketSuccess && -1 !== this.transports.indexOf("websocket"))
  18430. t3 = "websocket";
  18431. else {
  18432. if (0 === this.transports.length) {
  18433. var e3 = this;
  18434. return void setTimeout(function() {
  18435. e3.emit("error", "No transports available");
  18436. }, 0);
  18437. }
  18438. t3 = this.transports[0];
  18439. }
  18440. this.readyState = "opening";
  18441. try {
  18442. t3 = this.createTransport(t3);
  18443. } catch (t4) {
  18444. return this.transports.shift(), void this.open();
  18445. }
  18446. t3.open(), this.setTransport(t3);
  18447. }, u2.prototype.setTransport = function(t3) {
  18448. i2("setting transport %s", t3.name);
  18449. var e3 = this;
  18450. this.transport && (i2("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = t3, t3.on("drain", function() {
  18451. e3.onDrain();
  18452. }).on("packet", function(t4) {
  18453. e3.onPacket(t4);
  18454. }).on("error", function(t4) {
  18455. e3.onError(t4);
  18456. }).on("close", function() {
  18457. e3.onClose("transport close");
  18458. });
  18459. }, u2.prototype.probe = function(t3) {
  18460. i2('probing transport "%s"', t3);
  18461. var e3 = this.createTransport(t3, { probe: 1 }), r3 = false, n3 = this;
  18462. function o3() {
  18463. if (n3.onlyBinaryUpgrades) {
  18464. var o4 = !this.supportsBinary && n3.transport.supportsBinary;
  18465. r3 = r3 || o4;
  18466. }
  18467. r3 || (i2('probe transport "%s" opened', t3), e3.send([{ type: "ping", data: "probe" }]), e3.once("packet", function(o5) {
  18468. if (!r3)
  18469. if ("pong" === o5.type && "probe" === o5.data) {
  18470. if (i2('probe transport "%s" pong', t3), n3.upgrading = true, n3.emit("upgrading", e3), !e3)
  18471. return;
  18472. u2.priorWebsocketSuccess = "websocket" === e3.name, i2('pausing current transport "%s"', n3.transport.name), n3.transport.pause(function() {
  18473. r3 || "closed" !== n3.readyState && (i2("changing transport and sending upgrade packet"), p2(), n3.setTransport(e3), e3.send([{ type: "upgrade" }]), n3.emit("upgrade", e3), e3 = null, n3.upgrading = false, n3.flush());
  18474. });
  18475. } else {
  18476. i2('probe transport "%s" failed', t3);
  18477. var s4 = new Error("probe error");
  18478. s4.transport = e3.name, n3.emit("upgradeError", s4);
  18479. }
  18480. }));
  18481. }
  18482. function s3() {
  18483. r3 || (r3 = true, p2(), e3.close(), e3 = null);
  18484. }
  18485. function a3(r4) {
  18486. var o4 = new Error("probe error: " + r4);
  18487. o4.transport = e3.name, s3(), i2('probe transport "%s" failed because of error: %s', t3, r4), n3.emit("upgradeError", o4);
  18488. }
  18489. function c3() {
  18490. a3("transport closed");
  18491. }
  18492. function h3() {
  18493. a3("socket closed");
  18494. }
  18495. function f2(t4) {
  18496. e3 && t4.name !== e3.name && (i2('"%s" works - aborting "%s"', t4.name, e3.name), s3());
  18497. }
  18498. function p2() {
  18499. e3.removeListener("open", o3), e3.removeListener("error", a3), e3.removeListener("close", c3), n3.removeListener("close", h3), n3.removeListener("upgrading", f2);
  18500. }
  18501. u2.priorWebsocketSuccess = false, e3.once("open", o3), e3.once("error", a3), e3.once("close", c3), this.once("close", h3), this.once("upgrading", f2), e3.open();
  18502. }, u2.prototype.onOpen = function() {
  18503. if (i2("socket open"), this.readyState = "open", u2.priorWebsocketSuccess = "websocket" === this.transport.name, this.emit("open"), this.flush(), "open" === this.readyState && this.upgrade && this.transport.pause) {
  18504. i2("starting upgrade probes");
  18505. for (var t3 = 0, e3 = this.upgrades.length; t3 < e3; t3++)
  18506. this.probe(this.upgrades[t3]);
  18507. }
  18508. }, u2.prototype.onPacket = function(t3) {
  18509. if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState)
  18510. switch (i2('socket receive: type "%s", data "%s"', t3.type, t3.data), this.emit("packet", t3), this.emit("heartbeat"), t3.type) {
  18511. case "open":
  18512. this.onHandshake(JSON.parse(t3.data));
  18513. break;
  18514. case "pong":
  18515. this.setPing(), this.emit("pong");
  18516. break;
  18517. case "error":
  18518. var e3 = new Error("server error");
  18519. e3.code = t3.data, this.onError(e3);
  18520. break;
  18521. case "message":
  18522. this.emit("data", t3.data), this.emit("message", t3.data);
  18523. }
  18524. else
  18525. i2('packet received with socket readyState "%s"', this.readyState);
  18526. }, u2.prototype.onHandshake = function(t3) {
  18527. this.emit("handshake", t3), this.id = t3.sid, this.transport.query.sid = t3.sid, this.upgrades = this.filterUpgrades(t3.upgrades), this.pingInterval = t3.pingInterval, this.pingTimeout = t3.pingTimeout, this.onOpen(), "closed" !== this.readyState && (this.setPing(), this.removeListener("heartbeat", this.onHeartbeat), this.on("heartbeat", this.onHeartbeat));
  18528. }, u2.prototype.onHeartbeat = function(t3) {
  18529. clearTimeout(this.pingTimeoutTimer);
  18530. var e3 = this;
  18531. e3.pingTimeoutTimer = setTimeout(function() {
  18532. "closed" !== e3.readyState && e3.onClose("ping timeout");
  18533. }, t3 || e3.pingInterval + e3.pingTimeout);
  18534. }, u2.prototype.setPing = function() {
  18535. var t3 = this;
  18536. clearTimeout(t3.pingIntervalTimer), t3.pingIntervalTimer = setTimeout(function() {
  18537. i2("writing ping packet - expecting pong within %sms", t3.pingTimeout), t3.ping(), t3.onHeartbeat(t3.pingTimeout);
  18538. }, t3.pingInterval);
  18539. }, u2.prototype.ping = function() {
  18540. var t3 = this;
  18541. this.sendPacket("ping", function() {
  18542. t3.emit("ping");
  18543. });
  18544. }, u2.prototype.onDrain = function() {
  18545. this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush();
  18546. }, u2.prototype.flush = function() {
  18547. "closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (i2("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush"));
  18548. }, u2.prototype.write = u2.prototype.send = function(t3, e3, r3) {
  18549. return this.sendPacket("message", t3, e3, r3), this;
  18550. }, u2.prototype.sendPacket = function(t3, e3, r3, n3) {
  18551. if ("function" == typeof e3 && (n3 = e3, e3 = void 0), "function" == typeof r3 && (n3 = r3, r3 = null), "closing" !== this.readyState && "closed" !== this.readyState) {
  18552. (r3 = r3 || {}).compress = false !== r3.compress;
  18553. var o3 = { type: t3, data: e3, options: r3 };
  18554. this.emit("packetCreate", o3), this.writeBuffer.push(o3), n3 && this.once("flush", n3), this.flush();
  18555. }
  18556. }, u2.prototype.close = function() {
  18557. if ("opening" === this.readyState || "open" === this.readyState) {
  18558. this.readyState = "closing";
  18559. var t3 = this;
  18560. this.writeBuffer.length ? this.once("drain", function() {
  18561. this.upgrading ? n3() : e3();
  18562. }) : this.upgrading ? n3() : e3();
  18563. }
  18564. function e3() {
  18565. t3.onClose("forced close"), i2("socket closing - telling transport to close"), t3.transport.close();
  18566. }
  18567. function r3() {
  18568. t3.removeListener("upgrade", r3), t3.removeListener("upgradeError", r3), e3();
  18569. }
  18570. function n3() {
  18571. t3.once("upgrade", r3), t3.once("upgradeError", r3);
  18572. }
  18573. return this;
  18574. }, u2.prototype.onError = function(t3) {
  18575. i2("socket error %j", t3), u2.priorWebsocketSuccess = false, this.emit("error", t3), this.onClose("transport error", t3);
  18576. }, u2.prototype.onClose = function(t3, e3) {
  18577. if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
  18578. i2('socket close with reason: "%s"', t3);
  18579. clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", t3, e3), this.writeBuffer = [], this.prevBufferLen = 0;
  18580. }
  18581. }, u2.prototype.filterUpgrades = function(t3) {
  18582. for (var e3 = [], r3 = 0, n3 = t3.length; r3 < n3; r3++)
  18583. ~s2(this.transports, t3[r3]) && e3.push(t3[r3]);
  18584. return e3;
  18585. };
  18586. }, function(t2, e2) {
  18587. try {
  18588. t2.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest();
  18589. } catch (e3) {
  18590. t2.exports = false;
  18591. }
  18592. }, function(t2, e2, r2) {
  18593. var n2 = r2(7), o2 = r2(15), i2 = r2(1), s2 = r2(4), a2 = r2(0)("engine.io-client:polling-xhr");
  18594. function c2() {
  18595. }
  18596. function h2(t3) {
  18597. if (o2.call(this, t3), this.requestTimeout = t3.requestTimeout, this.extraHeaders = t3.extraHeaders, "undefined" != typeof location) {
  18598. var e3 = "https:" === location.protocol, r3 = location.port;
  18599. r3 || (r3 = e3 ? 443 : 80), this.xd = "undefined" != typeof location && t3.hostname !== location.hostname || r3 !== t3.port, this.xs = t3.secure !== e3;
  18600. }
  18601. }
  18602. function u2(t3) {
  18603. this.method = t3.method || "GET", this.uri = t3.uri, this.xd = !!t3.xd, this.xs = !!t3.xs, this.async = false !== t3.async, this.data = void 0 !== t3.data ? t3.data : null, this.agent = t3.agent, this.isBinary = t3.isBinary, this.supportsBinary = t3.supportsBinary, this.enablesXDR = t3.enablesXDR, this.withCredentials = t3.withCredentials, this.requestTimeout = t3.requestTimeout, this.pfx = t3.pfx, this.key = t3.key, this.passphrase = t3.passphrase, this.cert = t3.cert, this.ca = t3.ca, this.ciphers = t3.ciphers, this.rejectUnauthorized = t3.rejectUnauthorized, this.extraHeaders = t3.extraHeaders, this.create();
  18604. }
  18605. if (t2.exports = h2, t2.exports.Request = u2, s2(h2, o2), h2.prototype.supportsBinary = true, h2.prototype.request = function(t3) {
  18606. return (t3 = t3 || {}).uri = this.uri(), t3.xd = this.xd, t3.xs = this.xs, t3.agent = this.agent || false, t3.supportsBinary = this.supportsBinary, t3.enablesXDR = this.enablesXDR, t3.withCredentials = this.withCredentials, t3.pfx = this.pfx, t3.key = this.key, t3.passphrase = this.passphrase, t3.cert = this.cert, t3.ca = this.ca, t3.ciphers = this.ciphers, t3.rejectUnauthorized = this.rejectUnauthorized, t3.requestTimeout = this.requestTimeout, t3.extraHeaders = this.extraHeaders, new u2(t3);
  18607. }, h2.prototype.doWrite = function(t3, e3) {
  18608. var r3 = "string" != typeof t3 && void 0 !== t3, n3 = this.request({ method: "POST", data: t3, isBinary: r3 }), o3 = this;
  18609. n3.on("success", e3), n3.on("error", function(t4) {
  18610. o3.onError("xhr post error", t4);
  18611. }), this.sendXhr = n3;
  18612. }, h2.prototype.doPoll = function() {
  18613. a2("xhr poll");
  18614. var t3 = this.request(), e3 = this;
  18615. t3.on("data", function(t4) {
  18616. e3.onData(t4);
  18617. }), t3.on("error", function(t4) {
  18618. e3.onError("xhr poll error", t4);
  18619. }), this.pollXhr = t3;
  18620. }, i2(u2.prototype), u2.prototype.create = function() {
  18621. var t3 = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
  18622. t3.pfx = this.pfx, t3.key = this.key, t3.passphrase = this.passphrase, t3.cert = this.cert, t3.ca = this.ca, t3.ciphers = this.ciphers, t3.rejectUnauthorized = this.rejectUnauthorized;
  18623. var e3 = this.xhr = new n2(t3), r3 = this;
  18624. try {
  18625. a2("xhr open %s: %s", this.method, this.uri), e3.open(this.method, this.uri, this.async);
  18626. try {
  18627. if (this.extraHeaders)
  18628. for (var o3 in e3.setDisableHeaderCheck && e3.setDisableHeaderCheck(true), this.extraHeaders)
  18629. this.extraHeaders.hasOwnProperty(o3) && e3.setRequestHeader(o3, this.extraHeaders[o3]);
  18630. } catch (t4) {
  18631. }
  18632. if ("POST" === this.method)
  18633. try {
  18634. this.isBinary ? e3.setRequestHeader("Content-type", "application/octet-stream") : e3.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
  18635. } catch (t4) {
  18636. }
  18637. try {
  18638. e3.setRequestHeader("Accept", "*/*");
  18639. } catch (t4) {
  18640. }
  18641. "withCredentials" in e3 && (e3.withCredentials = this.withCredentials), this.requestTimeout && (e3.timeout = this.requestTimeout), this.hasXDR() ? (e3.onload = function() {
  18642. r3.onLoad();
  18643. }, e3.onerror = function() {
  18644. r3.onError(e3.responseText);
  18645. }) : e3.onreadystatechange = function() {
  18646. if (2 === e3.readyState)
  18647. try {
  18648. var t4 = e3.getResponseHeader("Content-Type");
  18649. (r3.supportsBinary && "application/octet-stream" === t4 || "application/octet-stream; charset=UTF-8" === t4) && (e3.responseType = "arraybuffer");
  18650. } catch (t5) {
  18651. }
  18652. 4 === e3.readyState && (200 === e3.status || 1223 === e3.status ? r3.onLoad() : setTimeout(function() {
  18653. r3.onError("number" == typeof e3.status ? e3.status : 0);
  18654. }, 0));
  18655. }, a2("xhr data %s", this.data), e3.send(this.data);
  18656. } catch (t4) {
  18657. return void setTimeout(function() {
  18658. r3.onError(t4);
  18659. }, 0);
  18660. }
  18661. "undefined" != typeof document && (this.index = u2.requestsCount++, u2.requests[this.index] = this);
  18662. }, u2.prototype.onSuccess = function() {
  18663. this.emit("success"), this.cleanup();
  18664. }, u2.prototype.onData = function(t3) {
  18665. this.emit("data", t3), this.onSuccess();
  18666. }, u2.prototype.onError = function(t3) {
  18667. this.emit("error", t3), this.cleanup(true);
  18668. }, u2.prototype.cleanup = function(t3) {
  18669. if (void 0 !== this.xhr && null !== this.xhr) {
  18670. if (this.hasXDR() ? this.xhr.onload = this.xhr.onerror = c2 : this.xhr.onreadystatechange = c2, t3)
  18671. try {
  18672. this.xhr.abort();
  18673. } catch (t4) {
  18674. }
  18675. "undefined" != typeof document && delete u2.requests[this.index], this.xhr = null;
  18676. }
  18677. }, u2.prototype.onLoad = function() {
  18678. var t3;
  18679. try {
  18680. var e3;
  18681. try {
  18682. e3 = this.xhr.getResponseHeader("Content-Type");
  18683. } catch (t4) {
  18684. }
  18685. t3 = ("application/octet-stream" === e3 || "application/octet-stream; charset=UTF-8" === e3) && this.xhr.response || this.xhr.responseText;
  18686. } catch (t4) {
  18687. this.onError(t4);
  18688. }
  18689. null != t3 && this.onData(t3);
  18690. }, u2.prototype.hasXDR = function() {
  18691. return "undefined" != typeof XDomainRequest && !this.xs && this.enablesXDR;
  18692. }, u2.prototype.abort = function() {
  18693. this.cleanup();
  18694. }, u2.requestsCount = 0, u2.requests = {}, "undefined" != typeof document) {
  18695. if ("function" == typeof attachEvent)
  18696. attachEvent("onunload", p2);
  18697. else if ("function" == typeof addEventListener) {
  18698. var f2 = "onpagehide" in self ? "pagehide" : "unload";
  18699. addEventListener(f2, p2, false);
  18700. }
  18701. }
  18702. function p2() {
  18703. for (var t3 in u2.requests)
  18704. u2.requests.hasOwnProperty(t3) && u2.requests[t3].abort();
  18705. }
  18706. }, function(t2, e2) {
  18707. t2.exports = Object.keys || function(t3) {
  18708. var e3 = [], r2 = Object.prototype.hasOwnProperty;
  18709. for (var n2 in t3)
  18710. r2.call(t3, n2) && e3.push(n2);
  18711. return e3;
  18712. };
  18713. }, function(t2, e2) {
  18714. var r2 = {}.toString;
  18715. t2.exports = Array.isArray || function(t3) {
  18716. return "[object Array]" == r2.call(t3);
  18717. };
  18718. }, function(t2, e2) {
  18719. t2.exports = function(t3, e3, r2) {
  18720. var n2 = t3.byteLength;
  18721. if (e3 = e3 || 0, r2 = r2 || n2, t3.slice)
  18722. return t3.slice(e3, r2);
  18723. if (e3 < 0 && (e3 += n2), r2 < 0 && (r2 += n2), r2 > n2 && (r2 = n2), e3 >= n2 || e3 >= r2 || 0 === n2)
  18724. return new ArrayBuffer(0);
  18725. for (var o2 = new Uint8Array(t3), i2 = new Uint8Array(r2 - e3), s2 = e3, a2 = 0; s2 < r2; s2++, a2++)
  18726. i2[a2] = o2[s2];
  18727. return i2.buffer;
  18728. };
  18729. }, function(t2, e2) {
  18730. function r2() {
  18731. }
  18732. t2.exports = function(t3, e3, n2) {
  18733. var o2 = false;
  18734. return n2 = n2 || r2, i2.count = t3, 0 === t3 ? e3() : i2;
  18735. function i2(t4, r3) {
  18736. if (i2.count <= 0)
  18737. throw new Error("after called too many times");
  18738. --i2.count, t4 ? (o2 = true, e3(t4), e3 = n2) : 0 !== i2.count || o2 || e3(null, r3);
  18739. }
  18740. };
  18741. }, function(t2, e2) {
  18742. /*! https://mths.be/utf8js v2.1.2 by @mathias */
  18743. var r2, n2, o2, i2 = String.fromCharCode;
  18744. function s2(t3) {
  18745. for (var e3, r3, n3 = [], o3 = 0, i3 = t3.length; o3 < i3; )
  18746. (e3 = t3.charCodeAt(o3++)) >= 55296 && e3 <= 56319 && o3 < i3 ? 56320 == (64512 & (r3 = t3.charCodeAt(o3++))) ? n3.push(((1023 & e3) << 10) + (1023 & r3) + 65536) : (n3.push(e3), o3--) : n3.push(e3);
  18747. return n3;
  18748. }
  18749. function a2(t3, e3) {
  18750. if (t3 >= 55296 && t3 <= 57343) {
  18751. if (e3)
  18752. throw Error("Lone surrogate U+" + t3.toString(16).toUpperCase() + " is not a scalar value");
  18753. return false;
  18754. }
  18755. return true;
  18756. }
  18757. function c2(t3, e3) {
  18758. return i2(t3 >> e3 & 63 | 128);
  18759. }
  18760. function h2(t3, e3) {
  18761. if (0 == (4294967168 & t3))
  18762. return i2(t3);
  18763. var r3 = "";
  18764. return 0 == (4294965248 & t3) ? r3 = i2(t3 >> 6 & 31 | 192) : 0 == (4294901760 & t3) ? (a2(t3, e3) || (t3 = 65533), r3 = i2(t3 >> 12 & 15 | 224), r3 += c2(t3, 6)) : 0 == (4292870144 & t3) && (r3 = i2(t3 >> 18 & 7 | 240), r3 += c2(t3, 12), r3 += c2(t3, 6)), r3 += i2(63 & t3 | 128);
  18765. }
  18766. function u2() {
  18767. if (o2 >= n2)
  18768. throw Error("Invalid byte index");
  18769. var t3 = 255 & r2[o2];
  18770. if (o2++, 128 == (192 & t3))
  18771. return 63 & t3;
  18772. throw Error("Invalid continuation byte");
  18773. }
  18774. function f2(t3) {
  18775. var e3, i3;
  18776. if (o2 > n2)
  18777. throw Error("Invalid byte index");
  18778. if (o2 == n2)
  18779. return false;
  18780. if (e3 = 255 & r2[o2], o2++, 0 == (128 & e3))
  18781. return e3;
  18782. if (192 == (224 & e3)) {
  18783. if ((i3 = (31 & e3) << 6 | u2()) >= 128)
  18784. return i3;
  18785. throw Error("Invalid continuation byte");
  18786. }
  18787. if (224 == (240 & e3)) {
  18788. if ((i3 = (15 & e3) << 12 | u2() << 6 | u2()) >= 2048)
  18789. return a2(i3, t3) ? i3 : 65533;
  18790. throw Error("Invalid continuation byte");
  18791. }
  18792. if (240 == (248 & e3) && (i3 = (7 & e3) << 18 | u2() << 12 | u2() << 6 | u2()) >= 65536 && i3 <= 1114111)
  18793. return i3;
  18794. throw Error("Invalid UTF-8 detected");
  18795. }
  18796. t2.exports = { version: "2.1.2", encode: function(t3, e3) {
  18797. for (var r3 = false !== (e3 = e3 || {}).strict, n3 = s2(t3), o3 = n3.length, i3 = -1, a3 = ""; ++i3 < o3; )
  18798. a3 += h2(n3[i3], r3);
  18799. return a3;
  18800. }, decode: function(t3, e3) {
  18801. var a3 = false !== (e3 = e3 || {}).strict;
  18802. r2 = s2(t3), n2 = r2.length, o2 = 0;
  18803. for (var c3, h3 = []; false !== (c3 = f2(a3)); )
  18804. h3.push(c3);
  18805. return function(t4) {
  18806. for (var e4, r3 = t4.length, n3 = -1, o3 = ""; ++n3 < r3; )
  18807. (e4 = t4[n3]) > 65535 && (o3 += i2((e4 -= 65536) >>> 10 & 1023 | 55296), e4 = 56320 | 1023 & e4), o3 += i2(e4);
  18808. return o3;
  18809. }(h3);
  18810. } };
  18811. }, function(t2, e2) {
  18812. !function() {
  18813. for (var t3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r2 = new Uint8Array(256), n2 = 0; n2 < t3.length; n2++)
  18814. r2[t3.charCodeAt(n2)] = n2;
  18815. e2.encode = function(e3) {
  18816. var r3, n3 = new Uint8Array(e3), o2 = n3.length, i2 = "";
  18817. for (r3 = 0; r3 < o2; r3 += 3)
  18818. i2 += t3[n3[r3] >> 2], i2 += t3[(3 & n3[r3]) << 4 | n3[r3 + 1] >> 4], i2 += t3[(15 & n3[r3 + 1]) << 2 | n3[r3 + 2] >> 6], i2 += t3[63 & n3[r3 + 2]];
  18819. return o2 % 3 == 2 ? i2 = i2.substring(0, i2.length - 1) + "=" : o2 % 3 == 1 && (i2 = i2.substring(0, i2.length - 2) + "=="), i2;
  18820. }, e2.decode = function(t4) {
  18821. var e3, n3, o2, i2, s2, a2 = 0.75 * t4.length, c2 = t4.length, h2 = 0;
  18822. "=" === t4[t4.length - 1] && (a2--, "=" === t4[t4.length - 2] && a2--);
  18823. var u2 = new ArrayBuffer(a2), f2 = new Uint8Array(u2);
  18824. for (e3 = 0; e3 < c2; e3 += 4)
  18825. n3 = r2[t4.charCodeAt(e3)], o2 = r2[t4.charCodeAt(e3 + 1)], i2 = r2[t4.charCodeAt(e3 + 2)], s2 = r2[t4.charCodeAt(e3 + 3)], f2[h2++] = n3 << 2 | o2 >> 4, f2[h2++] = (15 & o2) << 4 | i2 >> 2, f2[h2++] = (3 & i2) << 6 | 63 & s2;
  18826. return u2;
  18827. };
  18828. }();
  18829. }, function(t2, e2) {
  18830. var r2 = void 0 !== r2 ? r2 : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder && MozBlobBuilder, n2 = function() {
  18831. try {
  18832. return 2 === new Blob(["hi"]).size;
  18833. } catch (t3) {
  18834. return false;
  18835. }
  18836. }(), o2 = n2 && function() {
  18837. try {
  18838. return 2 === new Blob([new Uint8Array([1, 2])]).size;
  18839. } catch (t3) {
  18840. return false;
  18841. }
  18842. }(), i2 = r2 && r2.prototype.append && r2.prototype.getBlob;
  18843. function s2(t3) {
  18844. return t3.map(function(t4) {
  18845. if (t4.buffer instanceof ArrayBuffer) {
  18846. var e3 = t4.buffer;
  18847. if (t4.byteLength !== e3.byteLength) {
  18848. var r3 = new Uint8Array(t4.byteLength);
  18849. r3.set(new Uint8Array(e3, t4.byteOffset, t4.byteLength)), e3 = r3.buffer;
  18850. }
  18851. return e3;
  18852. }
  18853. return t4;
  18854. });
  18855. }
  18856. function a2(t3, e3) {
  18857. e3 = e3 || {};
  18858. var n3 = new r2();
  18859. return s2(t3).forEach(function(t4) {
  18860. n3.append(t4);
  18861. }), e3.type ? n3.getBlob(e3.type) : n3.getBlob();
  18862. }
  18863. function c2(t3, e3) {
  18864. return new Blob(s2(t3), e3 || {});
  18865. }
  18866. "undefined" != typeof Blob && (a2.prototype = Blob.prototype, c2.prototype = Blob.prototype), t2.exports = n2 ? o2 ? Blob : c2 : i2 ? a2 : void 0;
  18867. }, function(t2, e2, r2) {
  18868. (function(e3) {
  18869. var n2 = r2(15), o2 = r2(4);
  18870. t2.exports = u2;
  18871. var i2, s2 = /\n/g, a2 = /\\n/g;
  18872. function c2() {
  18873. }
  18874. function h2() {
  18875. return "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== e3 ? e3 : {};
  18876. }
  18877. function u2(t3) {
  18878. if (n2.call(this, t3), this.query = this.query || {}, !i2) {
  18879. var e4 = h2();
  18880. i2 = e4.___eio = e4.___eio || [];
  18881. }
  18882. this.index = i2.length;
  18883. var r3 = this;
  18884. i2.push(function(t4) {
  18885. r3.onData(t4);
  18886. }), this.query.j = this.index, "function" == typeof addEventListener && addEventListener("beforeunload", function() {
  18887. r3.script && (r3.script.onerror = c2);
  18888. }, false);
  18889. }
  18890. o2(u2, n2), u2.prototype.supportsBinary = false, u2.prototype.doClose = function() {
  18891. this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), n2.prototype.doClose.call(this);
  18892. }, u2.prototype.doPoll = function() {
  18893. var t3 = this, e4 = document.createElement("script");
  18894. this.script && (this.script.parentNode.removeChild(this.script), this.script = null), e4.async = true, e4.src = this.uri(), e4.onerror = function(e5) {
  18895. t3.onError("jsonp poll error", e5);
  18896. };
  18897. var r3 = document.getElementsByTagName("script")[0];
  18898. r3 ? r3.parentNode.insertBefore(e4, r3) : (document.head || document.body).appendChild(e4), this.script = e4, "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent) && setTimeout(function() {
  18899. var t4 = document.createElement("iframe");
  18900. document.body.appendChild(t4), document.body.removeChild(t4);
  18901. }, 100);
  18902. }, u2.prototype.doWrite = function(t3, e4) {
  18903. var r3 = this;
  18904. if (!this.form) {
  18905. var n3, o3 = document.createElement("form"), i3 = document.createElement("textarea"), c3 = this.iframeId = "eio_iframe_" + this.index;
  18906. o3.className = "socketio", o3.style.position = "absolute", o3.style.top = "-1000px", o3.style.left = "-1000px", o3.target = c3, o3.method = "POST", o3.setAttribute("accept-charset", "utf-8"), i3.name = "d", o3.appendChild(i3), document.body.appendChild(o3), this.form = o3, this.area = i3;
  18907. }
  18908. function h3() {
  18909. u3(), e4();
  18910. }
  18911. function u3() {
  18912. if (r3.iframe)
  18913. try {
  18914. r3.form.removeChild(r3.iframe);
  18915. } catch (t5) {
  18916. r3.onError("jsonp polling iframe removal error", t5);
  18917. }
  18918. try {
  18919. var t4 = '<iframe src="javascript:0" name="' + r3.iframeId + '">';
  18920. n3 = document.createElement(t4);
  18921. } catch (t5) {
  18922. (n3 = document.createElement("iframe")).name = r3.iframeId, n3.src = "javascript:0";
  18923. }
  18924. n3.id = r3.iframeId, r3.form.appendChild(n3), r3.iframe = n3;
  18925. }
  18926. this.form.action = this.uri(), u3(), t3 = t3.replace(a2, "\\\n"), this.area.value = t3.replace(s2, "\\n");
  18927. try {
  18928. this.form.submit();
  18929. } catch (t4) {
  18930. }
  18931. this.iframe.attachEvent ? this.iframe.onreadystatechange = function() {
  18932. "complete" === r3.iframe.readyState && h3();
  18933. } : this.iframe.onload = h3;
  18934. };
  18935. }).call(this, r2(12));
  18936. }, function(t2, e2, r2) {
  18937. (function(e3) {
  18938. var n2, o2, i2 = r2(8), s2 = r2(2), a2 = r2(3), c2 = r2(4), h2 = r2(17), u2 = r2(0)("engine.io-client:websocket");
  18939. if ("undefined" != typeof WebSocket ? n2 = WebSocket : "undefined" != typeof self && (n2 = self.WebSocket || self.MozWebSocket), "undefined" == typeof window)
  18940. try {
  18941. o2 = r2(42);
  18942. } catch (t3) {
  18943. }
  18944. var f2 = n2 || o2;
  18945. function p2(t3) {
  18946. t3 && t3.forceBase64 && (this.supportsBinary = false), this.perMessageDeflate = t3.perMessageDeflate, this.usingBrowserWebSocket = n2 && !t3.forceNode, this.protocols = t3.protocols, this.usingBrowserWebSocket || (f2 = o2), i2.call(this, t3);
  18947. }
  18948. t2.exports = p2, c2(p2, i2), p2.prototype.name = "websocket", p2.prototype.supportsBinary = true, p2.prototype.doOpen = function() {
  18949. if (this.check()) {
  18950. var t3 = this.uri(), e4 = this.protocols, r3 = { agent: this.agent, perMessageDeflate: this.perMessageDeflate };
  18951. r3.pfx = this.pfx, r3.key = this.key, r3.passphrase = this.passphrase, r3.cert = this.cert, r3.ca = this.ca, r3.ciphers = this.ciphers, r3.rejectUnauthorized = this.rejectUnauthorized, this.extraHeaders && (r3.headers = this.extraHeaders), this.localAddress && (r3.localAddress = this.localAddress);
  18952. try {
  18953. this.ws = this.usingBrowserWebSocket && !this.isReactNative ? e4 ? new f2(t3, e4) : new f2(t3) : new f2(t3, e4, r3);
  18954. } catch (t4) {
  18955. return this.emit("error", t4);
  18956. }
  18957. void 0 === this.ws.binaryType && (this.supportsBinary = false), this.ws.supports && this.ws.supports.binary ? (this.supportsBinary = true, this.ws.binaryType = "nodebuffer") : this.ws.binaryType = "arraybuffer", this.addEventListeners();
  18958. }
  18959. }, p2.prototype.addEventListeners = function() {
  18960. var t3 = this;
  18961. this.ws.onopen = function() {
  18962. t3.onOpen();
  18963. }, this.ws.onclose = function() {
  18964. t3.onClose();
  18965. }, this.ws.onmessage = function(e4) {
  18966. t3.onData(e4.data);
  18967. }, this.ws.onerror = function(e4) {
  18968. t3.onError("websocket error", e4);
  18969. };
  18970. }, p2.prototype.write = function(t3) {
  18971. var r3 = this;
  18972. this.writable = false;
  18973. for (var n3 = t3.length, o3 = 0, i3 = n3; o3 < i3; o3++)
  18974. !function(t4) {
  18975. s2.encodePacket(t4, r3.supportsBinary, function(o4) {
  18976. if (!r3.usingBrowserWebSocket) {
  18977. var i4 = {};
  18978. if (t4.options && (i4.compress = t4.options.compress), r3.perMessageDeflate)
  18979. ("string" == typeof o4 ? e3.byteLength(o4) : o4.length) < r3.perMessageDeflate.threshold && (i4.compress = false);
  18980. }
  18981. try {
  18982. r3.usingBrowserWebSocket ? r3.ws.send(o4) : r3.ws.send(o4, i4);
  18983. } catch (t5) {
  18984. u2("websocket closed before onclose event");
  18985. }
  18986. --n3 || a3();
  18987. });
  18988. }(t3[o3]);
  18989. function a3() {
  18990. r3.emit("flush"), setTimeout(function() {
  18991. r3.writable = true, r3.emit("drain");
  18992. }, 0);
  18993. }
  18994. }, p2.prototype.onClose = function() {
  18995. i2.prototype.onClose.call(this);
  18996. }, p2.prototype.doClose = function() {
  18997. void 0 !== this.ws && this.ws.close();
  18998. }, p2.prototype.uri = function() {
  18999. var t3 = this.query || {}, e4 = this.secure ? "wss" : "ws", r3 = "";
  19000. return this.port && ("wss" === e4 && 443 !== Number(this.port) || "ws" === e4 && 80 !== Number(this.port)) && (r3 = ":" + this.port), this.timestampRequests && (t3[this.timestampParam] = h2()), this.supportsBinary || (t3.b64 = 1), (t3 = a2.encode(t3)).length && (t3 = "?" + t3), e4 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + r3 + this.path + t3;
  19001. }, p2.prototype.check = function() {
  19002. return !(!f2 || "__initialize" in f2 && this.name === p2.prototype.name);
  19003. };
  19004. }).call(this, r2(6).Buffer);
  19005. }, function(t2, e2, r2) {
  19006. const n2 = r2(43), o2 = r2(44), i2 = r2(0)("@hyoga/uni-socket:"), s2 = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], a2 = index$1 || wx$1;
  19007. class c2 extends n2 {
  19008. constructor(t3, e3, r3) {
  19009. super(), this.readyState = c2.CONNECTING, this.protocol = "", this._socket = null, null !== t3 && (Array.isArray(e3) ? e3 = e3.join(", ") : "object" == typeof e3 && null !== e3 && (r3 = e3, e3 = void 0), h2.call(this, t3, e3, r3));
  19010. }
  19011. get CONNECTING() {
  19012. return c2.CONNECTING;
  19013. }
  19014. get CLOSING() {
  19015. return c2.CLOSING;
  19016. }
  19017. get CLOSED() {
  19018. return c2.CLOSED;
  19019. }
  19020. get OPEN() {
  19021. return c2.OPEN;
  19022. }
  19023. addSocketEventListeners() {
  19024. this._socket.onOpen(() => {
  19025. this.readyState = c2.OPEN, this.onopen();
  19026. }), this._socket.onClose((t3) => {
  19027. i2("onclose: ", t3), this.readyState = c2.CLOSED, this.onclose(t3.code, t3.reason);
  19028. }), this._socket.onError((t3) => {
  19029. i2("onerror: ", t3), this.onerror(t3);
  19030. }), this._socket.onMessage((t3) => {
  19031. this.onmessage(t3);
  19032. });
  19033. }
  19034. send(t3) {
  19035. i2("send data: ", t3, this.readyState), this.readyState === c2.OPEN && this._socket.send({ data: t3 });
  19036. }
  19037. close(t3, e3) {
  19038. i2("close socket: ", t3, e3), this.readyState = c2.CLOSING, this._socket.close({ code: t3, reason: e3 });
  19039. }
  19040. }
  19041. function h2(t3, e3, r3) {
  19042. Object.assign(r3, { url: t3, header: { "content-type": "application/json" }, protocols: e3, method: "GET" }), this._socket = function(t4) {
  19043. const e4 = a2.connectSocket({ complete: () => {
  19044. }, ...t4 });
  19045. if (e4)
  19046. return e4;
  19047. return { onClose: a2.onSocketClose, onOpen: a2.onSocketOpen, onError: a2.onSocketError, onMessage: a2.onSocketMessage, send: a2.sendSocketMessage, close: a2.closeSocket };
  19048. }(r3), this.addSocketEventListeners();
  19049. }
  19050. s2.forEach((t3, e3) => {
  19051. c2[s2[e3]] = e3;
  19052. });
  19053. ["open", "error", "close", "message"].forEach((t3) => {
  19054. Object.defineProperty(c2.prototype, `on${t3}`, { get() {
  19055. const e3 = this.listeners(t3);
  19056. for (var r3 = 0; r3 < e3.length; r3++)
  19057. if (e3[r3]._listener)
  19058. return e3[r3]._listener;
  19059. }, set(e3) {
  19060. const r3 = this.listeners(t3);
  19061. for (var n3 = 0; n3 < r3.length; n3++)
  19062. r3[n3]._listener && this.removeListener(t3, r3[n3]);
  19063. this.addEventListener(t3, e3);
  19064. } });
  19065. }), c2.prototype.addEventListener = o2.addEventListener, c2.prototype.removeEventListener = o2.removeEventListener, t2.exports = c2;
  19066. }, function(t2, e2, r2) {
  19067. var n2, o2 = "object" == typeof Reflect ? Reflect : null, i2 = o2 && "function" == typeof o2.apply ? o2.apply : function(t3, e3, r3) {
  19068. return Function.prototype.apply.call(t3, e3, r3);
  19069. };
  19070. n2 = o2 && "function" == typeof o2.ownKeys ? o2.ownKeys : Object.getOwnPropertySymbols ? function(t3) {
  19071. return Object.getOwnPropertyNames(t3).concat(Object.getOwnPropertySymbols(t3));
  19072. } : function(t3) {
  19073. return Object.getOwnPropertyNames(t3);
  19074. };
  19075. var s2 = Number.isNaN || function(t3) {
  19076. return t3 != t3;
  19077. };
  19078. function a2() {
  19079. a2.init.call(this);
  19080. }
  19081. t2.exports = a2, a2.EventEmitter = a2, a2.prototype._events = void 0, a2.prototype._eventsCount = 0, a2.prototype._maxListeners = void 0;
  19082. var c2 = 10;
  19083. function h2(t3) {
  19084. if ("function" != typeof t3)
  19085. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t3);
  19086. }
  19087. function u2(t3) {
  19088. return void 0 === t3._maxListeners ? a2.defaultMaxListeners : t3._maxListeners;
  19089. }
  19090. function f2(t3, e3, r3, n3) {
  19091. var o3, i3, s3, a3;
  19092. if (h2(r3), void 0 === (i3 = t3._events) ? (i3 = t3._events = /* @__PURE__ */ Object.create(null), t3._eventsCount = 0) : (void 0 !== i3.newListener && (t3.emit("newListener", e3, r3.listener ? r3.listener : r3), i3 = t3._events), s3 = i3[e3]), void 0 === s3)
  19093. s3 = i3[e3] = r3, ++t3._eventsCount;
  19094. else if ("function" == typeof s3 ? s3 = i3[e3] = n3 ? [r3, s3] : [s3, r3] : n3 ? s3.unshift(r3) : s3.push(r3), (o3 = u2(t3)) > 0 && s3.length > o3 && !s3.warned) {
  19095. s3.warned = true;
  19096. var c3 = new Error("Possible EventEmitter memory leak detected. " + s3.length + " " + String(e3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  19097. c3.name = "MaxListenersExceededWarning", c3.emitter = t3, c3.type = e3, c3.count = s3.length, a3 = c3, console && console.warn && console.warn(a3);
  19098. }
  19099. return t3;
  19100. }
  19101. function p2() {
  19102. if (!this.fired)
  19103. return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
  19104. }
  19105. function l2(t3, e3, r3) {
  19106. var n3 = { fired: false, wrapFn: void 0, target: t3, type: e3, listener: r3 }, o3 = p2.bind(n3);
  19107. return o3.listener = r3, n3.wrapFn = o3, o3;
  19108. }
  19109. function d2(t3, e3, r3) {
  19110. var n3 = t3._events;
  19111. if (void 0 === n3)
  19112. return [];
  19113. var o3 = n3[e3];
  19114. return void 0 === o3 ? [] : "function" == typeof o3 ? r3 ? [o3.listener || o3] : [o3] : r3 ? function(t4) {
  19115. for (var e4 = new Array(t4.length), r4 = 0; r4 < e4.length; ++r4)
  19116. e4[r4] = t4[r4].listener || t4[r4];
  19117. return e4;
  19118. }(o3) : g2(o3, o3.length);
  19119. }
  19120. function y2(t3) {
  19121. var e3 = this._events;
  19122. if (void 0 !== e3) {
  19123. var r3 = e3[t3];
  19124. if ("function" == typeof r3)
  19125. return 1;
  19126. if (void 0 !== r3)
  19127. return r3.length;
  19128. }
  19129. return 0;
  19130. }
  19131. function g2(t3, e3) {
  19132. for (var r3 = new Array(e3), n3 = 0; n3 < e3; ++n3)
  19133. r3[n3] = t3[n3];
  19134. return r3;
  19135. }
  19136. Object.defineProperty(a2, "defaultMaxListeners", { enumerable: true, get: function() {
  19137. return c2;
  19138. }, set: function(t3) {
  19139. if ("number" != typeof t3 || t3 < 0 || s2(t3))
  19140. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t3 + ".");
  19141. c2 = t3;
  19142. } }), a2.init = function() {
  19143. void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
  19144. }, a2.prototype.setMaxListeners = function(t3) {
  19145. if ("number" != typeof t3 || t3 < 0 || s2(t3))
  19146. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t3 + ".");
  19147. return this._maxListeners = t3, this;
  19148. }, a2.prototype.getMaxListeners = function() {
  19149. return u2(this);
  19150. }, a2.prototype.emit = function(t3) {
  19151. for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
  19152. e3.push(arguments[r3]);
  19153. var n3 = "error" === t3, o3 = this._events;
  19154. if (void 0 !== o3)
  19155. n3 = n3 && void 0 === o3.error;
  19156. else if (!n3)
  19157. return false;
  19158. if (n3) {
  19159. var s3;
  19160. if (e3.length > 0 && (s3 = e3[0]), s3 instanceof Error)
  19161. throw s3;
  19162. var a3 = new Error("Unhandled error." + (s3 ? " (" + s3.message + ")" : ""));
  19163. throw a3.context = s3, a3;
  19164. }
  19165. var c3 = o3[t3];
  19166. if (void 0 === c3)
  19167. return false;
  19168. if ("function" == typeof c3)
  19169. i2(c3, this, e3);
  19170. else {
  19171. var h3 = c3.length, u3 = g2(c3, h3);
  19172. for (r3 = 0; r3 < h3; ++r3)
  19173. i2(u3[r3], this, e3);
  19174. }
  19175. return true;
  19176. }, a2.prototype.addListener = function(t3, e3) {
  19177. return f2(this, t3, e3, false);
  19178. }, a2.prototype.on = a2.prototype.addListener, a2.prototype.prependListener = function(t3, e3) {
  19179. return f2(this, t3, e3, true);
  19180. }, a2.prototype.once = function(t3, e3) {
  19181. return h2(e3), this.on(t3, l2(this, t3, e3)), this;
  19182. }, a2.prototype.prependOnceListener = function(t3, e3) {
  19183. return h2(e3), this.prependListener(t3, l2(this, t3, e3)), this;
  19184. }, a2.prototype.removeListener = function(t3, e3) {
  19185. var r3, n3, o3, i3, s3;
  19186. if (h2(e3), void 0 === (n3 = this._events))
  19187. return this;
  19188. if (void 0 === (r3 = n3[t3]))
  19189. return this;
  19190. if (r3 === e3 || r3.listener === e3)
  19191. 0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete n3[t3], n3.removeListener && this.emit("removeListener", t3, r3.listener || e3));
  19192. else if ("function" != typeof r3) {
  19193. for (o3 = -1, i3 = r3.length - 1; i3 >= 0; i3--)
  19194. if (r3[i3] === e3 || r3[i3].listener === e3) {
  19195. s3 = r3[i3].listener, o3 = i3;
  19196. break;
  19197. }
  19198. if (o3 < 0)
  19199. return this;
  19200. 0 === o3 ? r3.shift() : function(t4, e4) {
  19201. for (; e4 + 1 < t4.length; e4++)
  19202. t4[e4] = t4[e4 + 1];
  19203. t4.pop();
  19204. }(r3, o3), 1 === r3.length && (n3[t3] = r3[0]), void 0 !== n3.removeListener && this.emit("removeListener", t3, s3 || e3);
  19205. }
  19206. return this;
  19207. }, a2.prototype.off = a2.prototype.removeListener, a2.prototype.removeAllListeners = function(t3) {
  19208. var e3, r3, n3;
  19209. if (void 0 === (r3 = this._events))
  19210. return this;
  19211. if (void 0 === r3.removeListener)
  19212. return 0 === arguments.length ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : void 0 !== r3[t3] && (0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : delete r3[t3]), this;
  19213. if (0 === arguments.length) {
  19214. var o3, i3 = Object.keys(r3);
  19215. for (n3 = 0; n3 < i3.length; ++n3)
  19216. "removeListener" !== (o3 = i3[n3]) && this.removeAllListeners(o3);
  19217. return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
  19218. }
  19219. if ("function" == typeof (e3 = r3[t3]))
  19220. this.removeListener(t3, e3);
  19221. else if (void 0 !== e3)
  19222. for (n3 = e3.length - 1; n3 >= 0; n3--)
  19223. this.removeListener(t3, e3[n3]);
  19224. return this;
  19225. }, a2.prototype.listeners = function(t3) {
  19226. return d2(this, t3, true);
  19227. }, a2.prototype.rawListeners = function(t3) {
  19228. return d2(this, t3, false);
  19229. }, a2.listenerCount = function(t3, e3) {
  19230. return "function" == typeof t3.listenerCount ? t3.listenerCount(e3) : y2.call(t3, e3);
  19231. }, a2.prototype.listenerCount = y2, a2.prototype.eventNames = function() {
  19232. return this._eventsCount > 0 ? n2(this._events) : [];
  19233. };
  19234. }, function(t2, e2, r2) {
  19235. class n2 {
  19236. constructor(t3, e3) {
  19237. this.target = e3, this.type = t3;
  19238. }
  19239. }
  19240. class o2 extends n2 {
  19241. constructor(t3, e3) {
  19242. super("message", e3), this.data = t3;
  19243. }
  19244. }
  19245. class i2 extends n2 {
  19246. constructor(t3, e3, r3) {
  19247. super("close", r3), this.wasClean = r3._closeFrameReceived && r3._closeFrameSent, this.reason = e3, this.code = t3;
  19248. }
  19249. }
  19250. class s2 extends n2 {
  19251. constructor(t3) {
  19252. super("open", t3);
  19253. }
  19254. }
  19255. class a2 extends n2 {
  19256. constructor(t3, e3) {
  19257. super("error", e3), this.message = t3.message, this.error = t3;
  19258. }
  19259. }
  19260. const c2 = { addEventListener(t3, e3) {
  19261. function r3(t4) {
  19262. e3.call(this, new o2(t4, this));
  19263. }
  19264. function n3(t4, r4) {
  19265. e3.call(this, new i2(t4, r4, this));
  19266. }
  19267. function c3(t4) {
  19268. e3.call(this, new a2(t4, this));
  19269. }
  19270. function h2() {
  19271. e3.call(this, new s2(this));
  19272. }
  19273. "function" == typeof e3 && ("message" === t3 ? (r3._listener = e3, this.on(t3, r3)) : "close" === t3 ? (n3._listener = e3, this.on(t3, n3)) : "error" === t3 ? (c3._listener = e3, this.on(t3, c3)) : "open" === t3 ? (h2._listener = e3, this.on(t3, h2)) : this.on(t3, e3));
  19274. }, removeEventListener(t3, e3) {
  19275. const r3 = this.listeners(t3);
  19276. for (var n3 = 0; n3 < r3.length; n3++)
  19277. r3[n3] !== e3 && r3[n3]._listener !== e3 || this.removeListener(t3, r3[n3]);
  19278. } };
  19279. t2.exports = c2;
  19280. }, function(t2, e2) {
  19281. t2.exports = function(t3, e3) {
  19282. for (var r2 = [], n2 = (e3 = e3 || 0) || 0; n2 < t3.length; n2++)
  19283. r2[n2 - e3] = t3[n2];
  19284. return r2;
  19285. };
  19286. }, function(t2, e2) {
  19287. function r2(t3) {
  19288. t3 = t3 || {}, this.ms = t3.min || 100, this.max = t3.max || 1e4, this.factor = t3.factor || 2, this.jitter = t3.jitter > 0 && t3.jitter <= 1 ? t3.jitter : 0, this.attempts = 0;
  19289. }
  19290. t2.exports = r2, r2.prototype.duration = function() {
  19291. var t3 = this.ms * Math.pow(this.factor, this.attempts++);
  19292. if (this.jitter) {
  19293. var e3 = Math.random(), r3 = Math.floor(e3 * this.jitter * t3);
  19294. t3 = 0 == (1 & Math.floor(10 * e3)) ? t3 - r3 : t3 + r3;
  19295. }
  19296. return 0 | Math.min(t3, this.max);
  19297. }, r2.prototype.reset = function() {
  19298. this.attempts = 0;
  19299. }, r2.prototype.setMin = function(t3) {
  19300. this.ms = t3;
  19301. }, r2.prototype.setMax = function(t3) {
  19302. this.max = t3;
  19303. }, r2.prototype.setJitter = function(t3) {
  19304. this.jitter = t3;
  19305. };
  19306. }]);
  19307. });
  19308. })(uniSocket_io);
  19309. var uniSocket_ioExports = uniSocket_io.exports;
  19310. const io = /* @__PURE__ */ getDefaultExportFromCjs(uniSocket_ioExports);
  19311. function _typeof$1(obj) {
  19312. "@babel/helpers - typeof";
  19313. return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
  19314. return typeof obj2;
  19315. } : function(obj2) {
  19316. return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  19317. }, _typeof$1(obj);
  19318. }
  19319. function _defineProperties$2(target, props) {
  19320. for (var i2 = 0; i2 < props.length; i2++) {
  19321. var descriptor = props[i2];
  19322. descriptor.enumerable = descriptor.enumerable || false;
  19323. descriptor.configurable = true;
  19324. if ("value" in descriptor)
  19325. descriptor.writable = true;
  19326. Object.defineProperty(target, descriptor.key, descriptor);
  19327. }
  19328. }
  19329. function _createClass$2(Constructor, protoProps, staticProps) {
  19330. if (protoProps)
  19331. _defineProperties$2(Constructor.prototype, protoProps);
  19332. if (staticProps)
  19333. _defineProperties$2(Constructor, staticProps);
  19334. Object.defineProperty(Constructor, "prototype", { writable: false });
  19335. return Constructor;
  19336. }
  19337. function _classCallCheck$2(instance, Constructor) {
  19338. if (!(instance instanceof Constructor)) {
  19339. throw new TypeError("Cannot call a class as a function");
  19340. }
  19341. }
  19342. function _inherits(subClass, superClass) {
  19343. if (typeof superClass !== "function" && superClass !== null) {
  19344. throw new TypeError("Super expression must either be null or a function");
  19345. }
  19346. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  19347. Object.defineProperty(subClass, "prototype", { writable: false });
  19348. if (superClass)
  19349. _setPrototypeOf(subClass, superClass);
  19350. }
  19351. function _createSuper(Derived) {
  19352. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  19353. return function _createSuperInternal() {
  19354. var Super = _getPrototypeOf(Derived), result2;
  19355. if (hasNativeReflectConstruct) {
  19356. var NewTarget = _getPrototypeOf(this).constructor;
  19357. result2 = Reflect.construct(Super, arguments, NewTarget);
  19358. } else {
  19359. result2 = Super.apply(this, arguments);
  19360. }
  19361. return _possibleConstructorReturn(this, result2);
  19362. };
  19363. }
  19364. function _possibleConstructorReturn(self2, call) {
  19365. if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
  19366. return call;
  19367. } else if (call !== void 0) {
  19368. throw new TypeError("Derived constructors may only return object or undefined");
  19369. }
  19370. return _assertThisInitialized(self2);
  19371. }
  19372. function _assertThisInitialized(self2) {
  19373. if (self2 === void 0) {
  19374. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  19375. }
  19376. return self2;
  19377. }
  19378. function _wrapNativeSuper(Class) {
  19379. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  19380. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  19381. if (Class2 === null || !_isNativeFunction(Class2))
  19382. return Class2;
  19383. if (typeof Class2 !== "function") {
  19384. throw new TypeError("Super expression must either be null or a function");
  19385. }
  19386. if (typeof _cache !== "undefined") {
  19387. if (_cache.has(Class2))
  19388. return _cache.get(Class2);
  19389. _cache.set(Class2, Wrapper);
  19390. }
  19391. function Wrapper() {
  19392. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  19393. }
  19394. Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
  19395. return _setPrototypeOf(Wrapper, Class2);
  19396. };
  19397. return _wrapNativeSuper(Class);
  19398. }
  19399. function _construct(Parent, args, Class) {
  19400. if (_isNativeReflectConstruct()) {
  19401. _construct = Reflect.construct;
  19402. } else {
  19403. _construct = function _construct2(Parent2, args2, Class2) {
  19404. var a2 = [null];
  19405. a2.push.apply(a2, args2);
  19406. var Constructor = Function.bind.apply(Parent2, a2);
  19407. var instance = new Constructor();
  19408. if (Class2)
  19409. _setPrototypeOf(instance, Class2.prototype);
  19410. return instance;
  19411. };
  19412. }
  19413. return _construct.apply(null, arguments);
  19414. }
  19415. function _isNativeReflectConstruct() {
  19416. if (typeof Reflect === "undefined" || !Reflect.construct)
  19417. return false;
  19418. if (Reflect.construct.sham)
  19419. return false;
  19420. if (typeof Proxy === "function")
  19421. return true;
  19422. try {
  19423. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  19424. }));
  19425. return true;
  19426. } catch (e2) {
  19427. return false;
  19428. }
  19429. }
  19430. function _isNativeFunction(fn) {
  19431. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  19432. }
  19433. function _setPrototypeOf(o2, p2) {
  19434. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
  19435. o3.__proto__ = p3;
  19436. return o3;
  19437. };
  19438. return _setPrototypeOf(o2, p2);
  19439. }
  19440. function _getPrototypeOf(o2) {
  19441. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
  19442. return o3.__proto__ || Object.getPrototypeOf(o3);
  19443. };
  19444. return _getPrototypeOf(o2);
  19445. }
  19446. var ParseError = /* @__PURE__ */ function(_Error) {
  19447. _inherits(ParseError2, _Error);
  19448. var _super = _createSuper(ParseError2);
  19449. function ParseError2(code) {
  19450. var _this;
  19451. _classCallCheck$2(this, ParseError2);
  19452. _this = _super.call(this, code);
  19453. Object.setPrototypeOf(_assertThisInitialized(_this), ParseError2.prototype);
  19454. _this.name = _this.constructor.name;
  19455. return _this;
  19456. }
  19457. return _createClass$2(ParseError2);
  19458. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  19459. var MIN_LENGTH_FOR_NSN = 2;
  19460. var MAX_LENGTH_FOR_NSN = 17;
  19461. var MAX_LENGTH_COUNTRY_CODE = 3;
  19462. var VALID_DIGITS = "0-90-9٠-٩۰-۹";
  19463. var DASHES = "-‐-―−ー-";
  19464. var SLASHES = "//";
  19465. var DOTS = "..";
  19466. var WHITESPACE = "  ­​⁠ ";
  19467. var BRACKETS = "()()[]\\[\\]";
  19468. var TILDES = "~⁓∼~";
  19469. var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
  19470. var PLUS_CHARS = "++";
  19471. function compare(a2, b2) {
  19472. a2 = a2.split("-");
  19473. b2 = b2.split("-");
  19474. var pa = a2[0].split(".");
  19475. var pb = b2[0].split(".");
  19476. for (var i2 = 0; i2 < 3; i2++) {
  19477. var na = Number(pa[i2]);
  19478. var nb = Number(pb[i2]);
  19479. if (na > nb)
  19480. return 1;
  19481. if (nb > na)
  19482. return -1;
  19483. if (!isNaN(na) && isNaN(nb))
  19484. return 1;
  19485. if (isNaN(na) && !isNaN(nb))
  19486. return -1;
  19487. }
  19488. if (a2[1] && b2[1]) {
  19489. return a2[1] > b2[1] ? 1 : a2[1] < b2[1] ? -1 : 0;
  19490. }
  19491. return !a2[1] && b2[1] ? 1 : a2[1] && !b2[1] ? -1 : 0;
  19492. }
  19493. var objectConstructor = {}.constructor;
  19494. function isObject(object) {
  19495. return object !== void 0 && object !== null && object.constructor === objectConstructor;
  19496. }
  19497. function _typeof(obj) {
  19498. "@babel/helpers - typeof";
  19499. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
  19500. return typeof obj2;
  19501. } : function(obj2) {
  19502. return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  19503. }, _typeof(obj);
  19504. }
  19505. function _classCallCheck$1(instance, Constructor) {
  19506. if (!(instance instanceof Constructor)) {
  19507. throw new TypeError("Cannot call a class as a function");
  19508. }
  19509. }
  19510. function _defineProperties$1(target, props) {
  19511. for (var i2 = 0; i2 < props.length; i2++) {
  19512. var descriptor = props[i2];
  19513. descriptor.enumerable = descriptor.enumerable || false;
  19514. descriptor.configurable = true;
  19515. if ("value" in descriptor)
  19516. descriptor.writable = true;
  19517. Object.defineProperty(target, descriptor.key, descriptor);
  19518. }
  19519. }
  19520. function _createClass$1(Constructor, protoProps, staticProps) {
  19521. if (protoProps)
  19522. _defineProperties$1(Constructor.prototype, protoProps);
  19523. if (staticProps)
  19524. _defineProperties$1(Constructor, staticProps);
  19525. Object.defineProperty(Constructor, "prototype", { writable: false });
  19526. return Constructor;
  19527. }
  19528. var V3 = "1.2.0";
  19529. var V4 = "1.7.35";
  19530. var DEFAULT_EXT_PREFIX = " ext. ";
  19531. var CALLING_CODE_REG_EXP = /^\d+$/;
  19532. var Metadata = /* @__PURE__ */ function() {
  19533. function Metadata2(metadata2) {
  19534. _classCallCheck$1(this, Metadata2);
  19535. validateMetadata(metadata2);
  19536. this.metadata = metadata2;
  19537. setVersion.call(this, metadata2);
  19538. }
  19539. _createClass$1(Metadata2, [{
  19540. key: "getCountries",
  19541. value: function getCountries() {
  19542. return Object.keys(this.metadata.countries).filter(function(_2) {
  19543. return _2 !== "001";
  19544. });
  19545. }
  19546. }, {
  19547. key: "getCountryMetadata",
  19548. value: function getCountryMetadata(countryCode) {
  19549. return this.metadata.countries[countryCode];
  19550. }
  19551. }, {
  19552. key: "nonGeographic",
  19553. value: function nonGeographic() {
  19554. if (this.v1 || this.v2 || this.v3)
  19555. return;
  19556. return this.metadata.nonGeographic || this.metadata.nonGeographical;
  19557. }
  19558. }, {
  19559. key: "hasCountry",
  19560. value: function hasCountry(country) {
  19561. return this.getCountryMetadata(country) !== void 0;
  19562. }
  19563. }, {
  19564. key: "hasCallingCode",
  19565. value: function hasCallingCode(callingCode) {
  19566. if (this.getCountryCodesForCallingCode(callingCode)) {
  19567. return true;
  19568. }
  19569. if (this.nonGeographic()) {
  19570. if (this.nonGeographic()[callingCode]) {
  19571. return true;
  19572. }
  19573. } else {
  19574. var countryCodes = this.countryCallingCodes()[callingCode];
  19575. if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
  19576. return true;
  19577. }
  19578. }
  19579. }
  19580. }, {
  19581. key: "isNonGeographicCallingCode",
  19582. value: function isNonGeographicCallingCode(callingCode) {
  19583. if (this.nonGeographic()) {
  19584. return this.nonGeographic()[callingCode] ? true : false;
  19585. } else {
  19586. return this.getCountryCodesForCallingCode(callingCode) ? false : true;
  19587. }
  19588. }
  19589. // Deprecated.
  19590. }, {
  19591. key: "country",
  19592. value: function country(countryCode) {
  19593. return this.selectNumberingPlan(countryCode);
  19594. }
  19595. }, {
  19596. key: "selectNumberingPlan",
  19597. value: function selectNumberingPlan(countryCode, callingCode) {
  19598. if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
  19599. callingCode = countryCode;
  19600. countryCode = null;
  19601. }
  19602. if (countryCode && countryCode !== "001") {
  19603. if (!this.hasCountry(countryCode)) {
  19604. throw new Error("Unknown country: ".concat(countryCode));
  19605. }
  19606. this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
  19607. } else if (callingCode) {
  19608. if (!this.hasCallingCode(callingCode)) {
  19609. throw new Error("Unknown calling code: ".concat(callingCode));
  19610. }
  19611. this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
  19612. } else {
  19613. this.numberingPlan = void 0;
  19614. }
  19615. return this;
  19616. }
  19617. }, {
  19618. key: "getCountryCodesForCallingCode",
  19619. value: function getCountryCodesForCallingCode(callingCode) {
  19620. var countryCodes = this.countryCallingCodes()[callingCode];
  19621. if (countryCodes) {
  19622. if (countryCodes.length === 1 && countryCodes[0].length === 3) {
  19623. return;
  19624. }
  19625. return countryCodes;
  19626. }
  19627. }
  19628. }, {
  19629. key: "getCountryCodeForCallingCode",
  19630. value: function getCountryCodeForCallingCode(callingCode) {
  19631. var countryCodes = this.getCountryCodesForCallingCode(callingCode);
  19632. if (countryCodes) {
  19633. return countryCodes[0];
  19634. }
  19635. }
  19636. }, {
  19637. key: "getNumberingPlanMetadata",
  19638. value: function getNumberingPlanMetadata(callingCode) {
  19639. var countryCode = this.getCountryCodeForCallingCode(callingCode);
  19640. if (countryCode) {
  19641. return this.getCountryMetadata(countryCode);
  19642. }
  19643. if (this.nonGeographic()) {
  19644. var metadata2 = this.nonGeographic()[callingCode];
  19645. if (metadata2) {
  19646. return metadata2;
  19647. }
  19648. } else {
  19649. var countryCodes = this.countryCallingCodes()[callingCode];
  19650. if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
  19651. return this.metadata.countries["001"];
  19652. }
  19653. }
  19654. }
  19655. // Deprecated.
  19656. }, {
  19657. key: "countryCallingCode",
  19658. value: function countryCallingCode() {
  19659. return this.numberingPlan.callingCode();
  19660. }
  19661. // Deprecated.
  19662. }, {
  19663. key: "IDDPrefix",
  19664. value: function IDDPrefix() {
  19665. return this.numberingPlan.IDDPrefix();
  19666. }
  19667. // Deprecated.
  19668. }, {
  19669. key: "defaultIDDPrefix",
  19670. value: function defaultIDDPrefix() {
  19671. return this.numberingPlan.defaultIDDPrefix();
  19672. }
  19673. // Deprecated.
  19674. }, {
  19675. key: "nationalNumberPattern",
  19676. value: function nationalNumberPattern() {
  19677. return this.numberingPlan.nationalNumberPattern();
  19678. }
  19679. // Deprecated.
  19680. }, {
  19681. key: "possibleLengths",
  19682. value: function possibleLengths() {
  19683. return this.numberingPlan.possibleLengths();
  19684. }
  19685. // Deprecated.
  19686. }, {
  19687. key: "formats",
  19688. value: function formats() {
  19689. return this.numberingPlan.formats();
  19690. }
  19691. // Deprecated.
  19692. }, {
  19693. key: "nationalPrefixForParsing",
  19694. value: function nationalPrefixForParsing() {
  19695. return this.numberingPlan.nationalPrefixForParsing();
  19696. }
  19697. // Deprecated.
  19698. }, {
  19699. key: "nationalPrefixTransformRule",
  19700. value: function nationalPrefixTransformRule() {
  19701. return this.numberingPlan.nationalPrefixTransformRule();
  19702. }
  19703. // Deprecated.
  19704. }, {
  19705. key: "leadingDigits",
  19706. value: function leadingDigits() {
  19707. return this.numberingPlan.leadingDigits();
  19708. }
  19709. // Deprecated.
  19710. }, {
  19711. key: "hasTypes",
  19712. value: function hasTypes() {
  19713. return this.numberingPlan.hasTypes();
  19714. }
  19715. // Deprecated.
  19716. }, {
  19717. key: "type",
  19718. value: function type(_type) {
  19719. return this.numberingPlan.type(_type);
  19720. }
  19721. // Deprecated.
  19722. }, {
  19723. key: "ext",
  19724. value: function ext() {
  19725. return this.numberingPlan.ext();
  19726. }
  19727. }, {
  19728. key: "countryCallingCodes",
  19729. value: function countryCallingCodes() {
  19730. if (this.v1)
  19731. return this.metadata.country_phone_code_to_countries;
  19732. return this.metadata.country_calling_codes;
  19733. }
  19734. // Deprecated.
  19735. }, {
  19736. key: "chooseCountryByCountryCallingCode",
  19737. value: function chooseCountryByCountryCallingCode(callingCode) {
  19738. return this.selectNumberingPlan(callingCode);
  19739. }
  19740. }, {
  19741. key: "hasSelectedNumberingPlan",
  19742. value: function hasSelectedNumberingPlan() {
  19743. return this.numberingPlan !== void 0;
  19744. }
  19745. }]);
  19746. return Metadata2;
  19747. }();
  19748. var NumberingPlan = /* @__PURE__ */ function() {
  19749. function NumberingPlan2(metadata2, globalMetadataObject) {
  19750. _classCallCheck$1(this, NumberingPlan2);
  19751. this.globalMetadataObject = globalMetadataObject;
  19752. this.metadata = metadata2;
  19753. setVersion.call(this, globalMetadataObject.metadata);
  19754. }
  19755. _createClass$1(NumberingPlan2, [{
  19756. key: "callingCode",
  19757. value: function callingCode() {
  19758. return this.metadata[0];
  19759. }
  19760. // Formatting information for regions which share
  19761. // a country calling code is contained by only one region
  19762. // for performance reasons. For example, for NANPA region
  19763. // ("North American Numbering Plan Administration",
  19764. // which includes USA, Canada, Cayman Islands, Bahamas, etc)
  19765. // it will be contained in the metadata for `US`.
  19766. }, {
  19767. key: "getDefaultCountryMetadataForRegion",
  19768. value: function getDefaultCountryMetadataForRegion() {
  19769. return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
  19770. }
  19771. // Is always present.
  19772. }, {
  19773. key: "IDDPrefix",
  19774. value: function IDDPrefix() {
  19775. if (this.v1 || this.v2)
  19776. return;
  19777. return this.metadata[1];
  19778. }
  19779. // Is only present when a country supports multiple IDD prefixes.
  19780. }, {
  19781. key: "defaultIDDPrefix",
  19782. value: function defaultIDDPrefix() {
  19783. if (this.v1 || this.v2)
  19784. return;
  19785. return this.metadata[12];
  19786. }
  19787. }, {
  19788. key: "nationalNumberPattern",
  19789. value: function nationalNumberPattern() {
  19790. if (this.v1 || this.v2)
  19791. return this.metadata[1];
  19792. return this.metadata[2];
  19793. }
  19794. // "possible length" data is always present in Google's metadata.
  19795. }, {
  19796. key: "possibleLengths",
  19797. value: function possibleLengths() {
  19798. if (this.v1)
  19799. return;
  19800. return this.metadata[this.v2 ? 2 : 3];
  19801. }
  19802. }, {
  19803. key: "_getFormats",
  19804. value: function _getFormats(metadata2) {
  19805. return metadata2[this.v1 ? 2 : this.v2 ? 3 : 4];
  19806. }
  19807. // For countries of the same region (e.g. NANPA)
  19808. // formats are all stored in the "main" country for that region.
  19809. // E.g. "RU" and "KZ", "US" and "CA".
  19810. }, {
  19811. key: "formats",
  19812. value: function formats() {
  19813. var _this = this;
  19814. var formats2 = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
  19815. return formats2.map(function(_2) {
  19816. return new Format(_2, _this);
  19817. });
  19818. }
  19819. }, {
  19820. key: "nationalPrefix",
  19821. value: function nationalPrefix() {
  19822. return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
  19823. }
  19824. }, {
  19825. key: "_getNationalPrefixFormattingRule",
  19826. value: function _getNationalPrefixFormattingRule(metadata2) {
  19827. return metadata2[this.v1 ? 4 : this.v2 ? 5 : 6];
  19828. }
  19829. // For countries of the same region (e.g. NANPA)
  19830. // national prefix formatting rule is stored in the "main" country for that region.
  19831. // E.g. "RU" and "KZ", "US" and "CA".
  19832. }, {
  19833. key: "nationalPrefixFormattingRule",
  19834. value: function nationalPrefixFormattingRule() {
  19835. return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
  19836. }
  19837. }, {
  19838. key: "_nationalPrefixForParsing",
  19839. value: function _nationalPrefixForParsing() {
  19840. return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
  19841. }
  19842. }, {
  19843. key: "nationalPrefixForParsing",
  19844. value: function nationalPrefixForParsing() {
  19845. return this._nationalPrefixForParsing() || this.nationalPrefix();
  19846. }
  19847. }, {
  19848. key: "nationalPrefixTransformRule",
  19849. value: function nationalPrefixTransformRule() {
  19850. return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
  19851. }
  19852. }, {
  19853. key: "_getNationalPrefixIsOptionalWhenFormatting",
  19854. value: function _getNationalPrefixIsOptionalWhenFormatting() {
  19855. return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
  19856. }
  19857. // For countries of the same region (e.g. NANPA)
  19858. // "national prefix is optional when formatting" flag is
  19859. // stored in the "main" country for that region.
  19860. // E.g. "RU" and "KZ", "US" and "CA".
  19861. }, {
  19862. key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
  19863. value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
  19864. return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
  19865. }
  19866. }, {
  19867. key: "leadingDigits",
  19868. value: function leadingDigits() {
  19869. return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
  19870. }
  19871. }, {
  19872. key: "types",
  19873. value: function types() {
  19874. return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
  19875. }
  19876. }, {
  19877. key: "hasTypes",
  19878. value: function hasTypes() {
  19879. if (this.types() && this.types().length === 0) {
  19880. return false;
  19881. }
  19882. return !!this.types();
  19883. }
  19884. }, {
  19885. key: "type",
  19886. value: function type(_type2) {
  19887. if (this.hasTypes() && getType(this.types(), _type2)) {
  19888. return new Type(getType(this.types(), _type2), this);
  19889. }
  19890. }
  19891. }, {
  19892. key: "ext",
  19893. value: function ext() {
  19894. if (this.v1 || this.v2)
  19895. return DEFAULT_EXT_PREFIX;
  19896. return this.metadata[13] || DEFAULT_EXT_PREFIX;
  19897. }
  19898. }]);
  19899. return NumberingPlan2;
  19900. }();
  19901. var Format = /* @__PURE__ */ function() {
  19902. function Format2(format, metadata2) {
  19903. _classCallCheck$1(this, Format2);
  19904. this._format = format;
  19905. this.metadata = metadata2;
  19906. }
  19907. _createClass$1(Format2, [{
  19908. key: "pattern",
  19909. value: function pattern() {
  19910. return this._format[0];
  19911. }
  19912. }, {
  19913. key: "format",
  19914. value: function format() {
  19915. return this._format[1];
  19916. }
  19917. }, {
  19918. key: "leadingDigitsPatterns",
  19919. value: function leadingDigitsPatterns() {
  19920. return this._format[2] || [];
  19921. }
  19922. }, {
  19923. key: "nationalPrefixFormattingRule",
  19924. value: function nationalPrefixFormattingRule() {
  19925. return this._format[3] || this.metadata.nationalPrefixFormattingRule();
  19926. }
  19927. }, {
  19928. key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
  19929. value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
  19930. return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
  19931. }
  19932. }, {
  19933. key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
  19934. value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
  19935. return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
  19936. }
  19937. // Checks whether national prefix formatting rule contains national prefix.
  19938. }, {
  19939. key: "usesNationalPrefix",
  19940. value: function usesNationalPrefix() {
  19941. return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
  19942. !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
  19943. }
  19944. }, {
  19945. key: "internationalFormat",
  19946. value: function internationalFormat() {
  19947. return this._format[5] || this.format();
  19948. }
  19949. }]);
  19950. return Format2;
  19951. }();
  19952. var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
  19953. var Type = /* @__PURE__ */ function() {
  19954. function Type2(type, metadata2) {
  19955. _classCallCheck$1(this, Type2);
  19956. this.type = type;
  19957. this.metadata = metadata2;
  19958. }
  19959. _createClass$1(Type2, [{
  19960. key: "pattern",
  19961. value: function pattern() {
  19962. if (this.metadata.v1)
  19963. return this.type;
  19964. return this.type[0];
  19965. }
  19966. }, {
  19967. key: "possibleLengths",
  19968. value: function possibleLengths() {
  19969. if (this.metadata.v1)
  19970. return;
  19971. return this.type[1] || this.metadata.possibleLengths();
  19972. }
  19973. }]);
  19974. return Type2;
  19975. }();
  19976. function getType(types, type) {
  19977. switch (type) {
  19978. case "FIXED_LINE":
  19979. return types[0];
  19980. case "MOBILE":
  19981. return types[1];
  19982. case "TOLL_FREE":
  19983. return types[2];
  19984. case "PREMIUM_RATE":
  19985. return types[3];
  19986. case "PERSONAL_NUMBER":
  19987. return types[4];
  19988. case "VOICEMAIL":
  19989. return types[5];
  19990. case "UAN":
  19991. return types[6];
  19992. case "PAGER":
  19993. return types[7];
  19994. case "VOIP":
  19995. return types[8];
  19996. case "SHARED_COST":
  19997. return types[9];
  19998. }
  19999. }
  20000. function validateMetadata(metadata2) {
  20001. if (!metadata2) {
  20002. throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
  20003. }
  20004. if (!isObject(metadata2) || !isObject(metadata2.countries)) {
  20005. throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(isObject(metadata2) ? "an object of shape: { " + Object.keys(metadata2).join(", ") + " }" : "a " + typeOf(metadata2) + ": " + metadata2, "."));
  20006. }
  20007. }
  20008. var typeOf = function typeOf2(_2) {
  20009. return _typeof(_2);
  20010. };
  20011. function getCountryCallingCode(country, metadata2) {
  20012. metadata2 = new Metadata(metadata2);
  20013. if (metadata2.hasCountry(country)) {
  20014. return metadata2.country(country).countryCallingCode();
  20015. }
  20016. throw new Error("Unknown country: ".concat(country));
  20017. }
  20018. function isSupportedCountry(country, metadata2) {
  20019. return metadata2.countries.hasOwnProperty(country);
  20020. }
  20021. function setVersion(metadata2) {
  20022. var version2 = metadata2.version;
  20023. if (typeof version2 === "number") {
  20024. this.v1 = version2 === 1;
  20025. this.v2 = version2 === 2;
  20026. this.v3 = version2 === 3;
  20027. this.v4 = version2 === 4;
  20028. } else {
  20029. if (!version2) {
  20030. this.v1 = true;
  20031. } else if (compare(version2, V3) === -1) {
  20032. this.v2 = true;
  20033. } else if (compare(version2, V4) === -1) {
  20034. this.v3 = true;
  20035. } else {
  20036. this.v4 = true;
  20037. }
  20038. }
  20039. }
  20040. var RFC3966_EXTN_PREFIX = ";ext=";
  20041. var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
  20042. return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
  20043. };
  20044. function createExtensionPattern(purpose) {
  20045. var extLimitAfterExplicitLabel = "20";
  20046. var extLimitAfterLikelyLabel = "15";
  20047. var extLimitAfterAmbiguousChar = "9";
  20048. var extLimitWhenNotSure = "6";
  20049. var possibleSeparatorsBetweenNumberAndExtLabel = "[  \\t,]*";
  20050. var possibleCharsAfterExtLabel = "[:\\..]?[  \\t,-]*";
  20051. var optionalExtnSuffix = "#?";
  20052. var explicitExtLabels = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)";
  20053. var ambiguousExtLabels = "(?:[xx##~~]|int|int)";
  20054. var ambiguousSeparator = "[- ]+";
  20055. var possibleSeparatorsNumberExtLabelNoComma = "[  \\t]*";
  20056. var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
  20057. var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
  20058. var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
  20059. var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  20060. var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
  20061. var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
  20062. var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  20063. return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
  20064. }
  20065. var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
  20066. var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
  20067. var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
  20068. var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
  20069. "(?:" + createExtensionPattern() + ")?";
  20070. var VALID_PHONE_NUMBER_PATTERN = new RegExp(
  20071. // Either a short two-digit-only phone number
  20072. "^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
  20073. "i"
  20074. );
  20075. function isViablePhoneNumber(number) {
  20076. return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
  20077. }
  20078. function isViablePhoneNumberStart(number) {
  20079. return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
  20080. }
  20081. var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
  20082. function extractExtension(number) {
  20083. var start = number.search(EXTN_PATTERN);
  20084. if (start < 0) {
  20085. return {};
  20086. }
  20087. var numberWithoutExtension = number.slice(0, start);
  20088. var matches = number.match(EXTN_PATTERN);
  20089. var i2 = 1;
  20090. while (i2 < matches.length) {
  20091. if (matches[i2]) {
  20092. return {
  20093. number: numberWithoutExtension,
  20094. ext: matches[i2]
  20095. };
  20096. }
  20097. i2++;
  20098. }
  20099. }
  20100. var DIGITS = {
  20101. "0": "0",
  20102. "1": "1",
  20103. "2": "2",
  20104. "3": "3",
  20105. "4": "4",
  20106. "5": "5",
  20107. "6": "6",
  20108. "7": "7",
  20109. "8": "8",
  20110. "9": "9",
  20111. "0": "0",
  20112. // Fullwidth digit 0
  20113. "1": "1",
  20114. // Fullwidth digit 1
  20115. "2": "2",
  20116. // Fullwidth digit 2
  20117. "3": "3",
  20118. // Fullwidth digit 3
  20119. "4": "4",
  20120. // Fullwidth digit 4
  20121. "5": "5",
  20122. // Fullwidth digit 5
  20123. "6": "6",
  20124. // Fullwidth digit 6
  20125. "7": "7",
  20126. // Fullwidth digit 7
  20127. "8": "8",
  20128. // Fullwidth digit 8
  20129. "9": "9",
  20130. // Fullwidth digit 9
  20131. "٠": "0",
  20132. // Arabic-indic digit 0
  20133. "١": "1",
  20134. // Arabic-indic digit 1
  20135. "٢": "2",
  20136. // Arabic-indic digit 2
  20137. "٣": "3",
  20138. // Arabic-indic digit 3
  20139. "٤": "4",
  20140. // Arabic-indic digit 4
  20141. "٥": "5",
  20142. // Arabic-indic digit 5
  20143. "٦": "6",
  20144. // Arabic-indic digit 6
  20145. "٧": "7",
  20146. // Arabic-indic digit 7
  20147. "٨": "8",
  20148. // Arabic-indic digit 8
  20149. "٩": "9",
  20150. // Arabic-indic digit 9
  20151. "۰": "0",
  20152. // Eastern-Arabic digit 0
  20153. "۱": "1",
  20154. // Eastern-Arabic digit 1
  20155. "۲": "2",
  20156. // Eastern-Arabic digit 2
  20157. "۳": "3",
  20158. // Eastern-Arabic digit 3
  20159. "۴": "4",
  20160. // Eastern-Arabic digit 4
  20161. "۵": "5",
  20162. // Eastern-Arabic digit 5
  20163. "۶": "6",
  20164. // Eastern-Arabic digit 6
  20165. "۷": "7",
  20166. // Eastern-Arabic digit 7
  20167. "۸": "8",
  20168. // Eastern-Arabic digit 8
  20169. "۹": "9"
  20170. // Eastern-Arabic digit 9
  20171. };
  20172. function parseDigit(character) {
  20173. return DIGITS[character];
  20174. }
  20175. function _createForOfIteratorHelperLoose$4(o2, allowArrayLike) {
  20176. var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
  20177. if (it2)
  20178. return (it2 = it2.call(o2)).next.bind(it2);
  20179. if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$5(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
  20180. if (it2)
  20181. o2 = it2;
  20182. var i2 = 0;
  20183. return function() {
  20184. if (i2 >= o2.length)
  20185. return { done: true };
  20186. return { done: false, value: o2[i2++] };
  20187. };
  20188. }
  20189. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  20190. }
  20191. function _unsupportedIterableToArray$5(o2, minLen) {
  20192. if (!o2)
  20193. return;
  20194. if (typeof o2 === "string")
  20195. return _arrayLikeToArray$5(o2, minLen);
  20196. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  20197. if (n2 === "Object" && o2.constructor)
  20198. n2 = o2.constructor.name;
  20199. if (n2 === "Map" || n2 === "Set")
  20200. return Array.from(o2);
  20201. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  20202. return _arrayLikeToArray$5(o2, minLen);
  20203. }
  20204. function _arrayLikeToArray$5(arr, len) {
  20205. if (len == null || len > arr.length)
  20206. len = arr.length;
  20207. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  20208. arr2[i2] = arr[i2];
  20209. }
  20210. return arr2;
  20211. }
  20212. function parseIncompletePhoneNumber(string) {
  20213. var result2 = "";
  20214. for (var _iterator = _createForOfIteratorHelperLoose$4(string.split("")), _step; !(_step = _iterator()).done; ) {
  20215. var character = _step.value;
  20216. result2 += parsePhoneNumberCharacter(character, result2) || "";
  20217. }
  20218. return result2;
  20219. }
  20220. function parsePhoneNumberCharacter(character, prevParsedCharacters, emitEvent) {
  20221. if (character === "+") {
  20222. if (prevParsedCharacters) {
  20223. if (typeof emitEvent === "function") {
  20224. emitEvent("end");
  20225. }
  20226. return;
  20227. }
  20228. return "+";
  20229. }
  20230. return parseDigit(character);
  20231. }
  20232. function _createForOfIteratorHelperLoose$3(o2, allowArrayLike) {
  20233. var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
  20234. if (it2)
  20235. return (it2 = it2.call(o2)).next.bind(it2);
  20236. if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$4(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
  20237. if (it2)
  20238. o2 = it2;
  20239. var i2 = 0;
  20240. return function() {
  20241. if (i2 >= o2.length)
  20242. return { done: true };
  20243. return { done: false, value: o2[i2++] };
  20244. };
  20245. }
  20246. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  20247. }
  20248. function _unsupportedIterableToArray$4(o2, minLen) {
  20249. if (!o2)
  20250. return;
  20251. if (typeof o2 === "string")
  20252. return _arrayLikeToArray$4(o2, minLen);
  20253. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  20254. if (n2 === "Object" && o2.constructor)
  20255. n2 = o2.constructor.name;
  20256. if (n2 === "Map" || n2 === "Set")
  20257. return Array.from(o2);
  20258. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  20259. return _arrayLikeToArray$4(o2, minLen);
  20260. }
  20261. function _arrayLikeToArray$4(arr, len) {
  20262. if (len == null || len > arr.length)
  20263. len = arr.length;
  20264. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  20265. arr2[i2] = arr[i2];
  20266. }
  20267. return arr2;
  20268. }
  20269. function mergeArrays(a2, b2) {
  20270. var merged = a2.slice();
  20271. for (var _iterator = _createForOfIteratorHelperLoose$3(b2), _step; !(_step = _iterator()).done; ) {
  20272. var element = _step.value;
  20273. if (a2.indexOf(element) < 0) {
  20274. merged.push(element);
  20275. }
  20276. }
  20277. return merged.sort(function(a3, b3) {
  20278. return a3 - b3;
  20279. });
  20280. }
  20281. function checkNumberLength(nationalNumber, metadata2) {
  20282. return checkNumberLengthForType(nationalNumber, void 0, metadata2);
  20283. }
  20284. function checkNumberLengthForType(nationalNumber, type, metadata2) {
  20285. var type_info = metadata2.type(type);
  20286. var possible_lengths = type_info && type_info.possibleLengths() || metadata2.possibleLengths();
  20287. if (!possible_lengths) {
  20288. return "IS_POSSIBLE";
  20289. }
  20290. if (type === "FIXED_LINE_OR_MOBILE") {
  20291. if (!metadata2.type("FIXED_LINE")) {
  20292. return checkNumberLengthForType(nationalNumber, "MOBILE", metadata2);
  20293. }
  20294. var mobile_type = metadata2.type("MOBILE");
  20295. if (mobile_type) {
  20296. possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
  20297. }
  20298. } else if (type && !type_info) {
  20299. return "INVALID_LENGTH";
  20300. }
  20301. var actual_length = nationalNumber.length;
  20302. var minimum_length = possible_lengths[0];
  20303. if (minimum_length === actual_length) {
  20304. return "IS_POSSIBLE";
  20305. }
  20306. if (minimum_length > actual_length) {
  20307. return "TOO_SHORT";
  20308. }
  20309. if (possible_lengths[possible_lengths.length - 1] < actual_length) {
  20310. return "TOO_LONG";
  20311. }
  20312. return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
  20313. }
  20314. function isPossiblePhoneNumber(input, options, metadata2) {
  20315. if (options === void 0) {
  20316. options = {};
  20317. }
  20318. metadata2 = new Metadata(metadata2);
  20319. if (options.v2) {
  20320. if (!input.countryCallingCode) {
  20321. throw new Error("Invalid phone number object passed");
  20322. }
  20323. metadata2.selectNumberingPlan(input.countryCallingCode);
  20324. } else {
  20325. if (!input.phone) {
  20326. return false;
  20327. }
  20328. if (input.country) {
  20329. if (!metadata2.hasCountry(input.country)) {
  20330. throw new Error("Unknown country: ".concat(input.country));
  20331. }
  20332. metadata2.country(input.country);
  20333. } else {
  20334. if (!input.countryCallingCode) {
  20335. throw new Error("Invalid phone number object passed");
  20336. }
  20337. metadata2.selectNumberingPlan(input.countryCallingCode);
  20338. }
  20339. }
  20340. if (metadata2.possibleLengths()) {
  20341. return isPossibleNumber(input.phone || input.nationalNumber, metadata2);
  20342. } else {
  20343. if (input.countryCallingCode && metadata2.isNonGeographicCallingCode(input.countryCallingCode)) {
  20344. return true;
  20345. } else {
  20346. throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
  20347. }
  20348. }
  20349. }
  20350. function isPossibleNumber(nationalNumber, metadata2) {
  20351. switch (checkNumberLength(nationalNumber, metadata2)) {
  20352. case "IS_POSSIBLE":
  20353. return true;
  20354. default:
  20355. return false;
  20356. }
  20357. }
  20358. function matchesEntirely(text, regular_expression) {
  20359. text = text || "";
  20360. return new RegExp("^(?:" + regular_expression + ")$").test(text);
  20361. }
  20362. function _createForOfIteratorHelperLoose$2(o2, allowArrayLike) {
  20363. var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
  20364. if (it2)
  20365. return (it2 = it2.call(o2)).next.bind(it2);
  20366. if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$3(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
  20367. if (it2)
  20368. o2 = it2;
  20369. var i2 = 0;
  20370. return function() {
  20371. if (i2 >= o2.length)
  20372. return { done: true };
  20373. return { done: false, value: o2[i2++] };
  20374. };
  20375. }
  20376. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  20377. }
  20378. function _unsupportedIterableToArray$3(o2, minLen) {
  20379. if (!o2)
  20380. return;
  20381. if (typeof o2 === "string")
  20382. return _arrayLikeToArray$3(o2, minLen);
  20383. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  20384. if (n2 === "Object" && o2.constructor)
  20385. n2 = o2.constructor.name;
  20386. if (n2 === "Map" || n2 === "Set")
  20387. return Array.from(o2);
  20388. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  20389. return _arrayLikeToArray$3(o2, minLen);
  20390. }
  20391. function _arrayLikeToArray$3(arr, len) {
  20392. if (len == null || len > arr.length)
  20393. len = arr.length;
  20394. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  20395. arr2[i2] = arr[i2];
  20396. }
  20397. return arr2;
  20398. }
  20399. var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
  20400. function getNumberType(input, options, metadata2) {
  20401. options = options || {};
  20402. if (!input.country && !input.countryCallingCode) {
  20403. return;
  20404. }
  20405. metadata2 = new Metadata(metadata2);
  20406. metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
  20407. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  20408. if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern())) {
  20409. return;
  20410. }
  20411. if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata2)) {
  20412. if (metadata2.type("MOBILE") && metadata2.type("MOBILE").pattern() === "") {
  20413. return "FIXED_LINE_OR_MOBILE";
  20414. }
  20415. if (!metadata2.type("MOBILE")) {
  20416. return "FIXED_LINE_OR_MOBILE";
  20417. }
  20418. if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata2)) {
  20419. return "FIXED_LINE_OR_MOBILE";
  20420. }
  20421. return "FIXED_LINE";
  20422. }
  20423. for (var _iterator = _createForOfIteratorHelperLoose$2(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
  20424. var type = _step.value;
  20425. if (isNumberTypeEqualTo(nationalNumber, type, metadata2)) {
  20426. return type;
  20427. }
  20428. }
  20429. }
  20430. function isNumberTypeEqualTo(nationalNumber, type, metadata2) {
  20431. type = metadata2.type(type);
  20432. if (!type || !type.pattern()) {
  20433. return false;
  20434. }
  20435. if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
  20436. return false;
  20437. }
  20438. return matchesEntirely(nationalNumber, type.pattern());
  20439. }
  20440. function isValidNumber(input, options, metadata2) {
  20441. options = options || {};
  20442. metadata2 = new Metadata(metadata2);
  20443. metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
  20444. if (metadata2.hasTypes()) {
  20445. return getNumberType(input, options, metadata2.metadata) !== void 0;
  20446. }
  20447. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  20448. return matchesEntirely(nationalNumber, metadata2.nationalNumberPattern());
  20449. }
  20450. function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata2) {
  20451. var _metadata = new Metadata(metadata2);
  20452. var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
  20453. if (!possibleCountries) {
  20454. return [];
  20455. }
  20456. return possibleCountries.filter(function(country) {
  20457. return couldNationalNumberBelongToCountry(nationalNumber, country, metadata2);
  20458. });
  20459. }
  20460. function couldNationalNumberBelongToCountry(nationalNumber, country, metadata2) {
  20461. var _metadata = new Metadata(metadata2);
  20462. _metadata.selectNumberingPlan(country);
  20463. if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {
  20464. return true;
  20465. }
  20466. return false;
  20467. }
  20468. function applyInternationalSeparatorStyle(formattedNumber) {
  20469. return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
  20470. }
  20471. var FIRST_GROUP_PATTERN = /(\$\d)/;
  20472. function formatNationalNumberUsingFormat(number, format, _ref) {
  20473. var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix;
  20474. _ref.carrierCode;
  20475. _ref.metadata;
  20476. var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : (
  20477. // This library doesn't use `domestic_carrier_code_formatting_rule`,
  20478. // because that one is only used when formatting phone numbers
  20479. // for dialing from a mobile phone, and this is not a dialing library.
  20480. // carrierCode && format.domesticCarrierCodeFormattingRule()
  20481. // // First, replace the $CC in the formatting rule with the desired carrier code.
  20482. // // Then, replace the $FG in the formatting rule with the first group
  20483. // // and the carrier code combined in the appropriate way.
  20484. // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
  20485. // : (
  20486. // withNationalPrefix && format.nationalPrefixFormattingRule()
  20487. // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
  20488. // : format.format()
  20489. // )
  20490. withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format()
  20491. ));
  20492. if (useInternationalFormat) {
  20493. return applyInternationalSeparatorStyle(formattedNumber);
  20494. }
  20495. return formattedNumber;
  20496. }
  20497. var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
  20498. function getIddPrefix(country, callingCode, metadata2) {
  20499. var countryMetadata = new Metadata(metadata2);
  20500. countryMetadata.selectNumberingPlan(country, callingCode);
  20501. if (countryMetadata.defaultIDDPrefix()) {
  20502. return countryMetadata.defaultIDDPrefix();
  20503. }
  20504. if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
  20505. return countryMetadata.IDDPrefix();
  20506. }
  20507. }
  20508. function formatRFC3966(_ref) {
  20509. var number = _ref.number, ext = _ref.ext;
  20510. if (!number) {
  20511. return "";
  20512. }
  20513. if (number[0] !== "+") {
  20514. throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
  20515. }
  20516. return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
  20517. }
  20518. function _createForOfIteratorHelperLoose$1(o2, allowArrayLike) {
  20519. var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
  20520. if (it2)
  20521. return (it2 = it2.call(o2)).next.bind(it2);
  20522. if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$2(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
  20523. if (it2)
  20524. o2 = it2;
  20525. var i2 = 0;
  20526. return function() {
  20527. if (i2 >= o2.length)
  20528. return { done: true };
  20529. return { done: false, value: o2[i2++] };
  20530. };
  20531. }
  20532. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  20533. }
  20534. function _unsupportedIterableToArray$2(o2, minLen) {
  20535. if (!o2)
  20536. return;
  20537. if (typeof o2 === "string")
  20538. return _arrayLikeToArray$2(o2, minLen);
  20539. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  20540. if (n2 === "Object" && o2.constructor)
  20541. n2 = o2.constructor.name;
  20542. if (n2 === "Map" || n2 === "Set")
  20543. return Array.from(o2);
  20544. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  20545. return _arrayLikeToArray$2(o2, minLen);
  20546. }
  20547. function _arrayLikeToArray$2(arr, len) {
  20548. if (len == null || len > arr.length)
  20549. len = arr.length;
  20550. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  20551. arr2[i2] = arr[i2];
  20552. }
  20553. return arr2;
  20554. }
  20555. function ownKeys$4(object, enumerableOnly) {
  20556. var keys = Object.keys(object);
  20557. if (Object.getOwnPropertySymbols) {
  20558. var symbols = Object.getOwnPropertySymbols(object);
  20559. enumerableOnly && (symbols = symbols.filter(function(sym) {
  20560. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  20561. })), keys.push.apply(keys, symbols);
  20562. }
  20563. return keys;
  20564. }
  20565. function _objectSpread$4(target) {
  20566. for (var i2 = 1; i2 < arguments.length; i2++) {
  20567. var source = null != arguments[i2] ? arguments[i2] : {};
  20568. i2 % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
  20569. _defineProperty$4(target, key, source[key]);
  20570. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
  20571. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  20572. });
  20573. }
  20574. return target;
  20575. }
  20576. function _defineProperty$4(obj, key, value) {
  20577. if (key in obj) {
  20578. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  20579. } else {
  20580. obj[key] = value;
  20581. }
  20582. return obj;
  20583. }
  20584. var DEFAULT_OPTIONS = {
  20585. formatExtension: function formatExtension(formattedNumber, extension, metadata2) {
  20586. return "".concat(formattedNumber).concat(metadata2.ext()).concat(extension);
  20587. }
  20588. };
  20589. function formatNumber(input, format, options, metadata2) {
  20590. if (options) {
  20591. options = _objectSpread$4(_objectSpread$4({}, DEFAULT_OPTIONS), options);
  20592. } else {
  20593. options = DEFAULT_OPTIONS;
  20594. }
  20595. metadata2 = new Metadata(metadata2);
  20596. if (input.country && input.country !== "001") {
  20597. if (!metadata2.hasCountry(input.country)) {
  20598. throw new Error("Unknown country: ".concat(input.country));
  20599. }
  20600. metadata2.country(input.country);
  20601. } else if (input.countryCallingCode) {
  20602. metadata2.selectNumberingPlan(input.countryCallingCode);
  20603. } else
  20604. return input.phone || "";
  20605. var countryCallingCode = metadata2.countryCallingCode();
  20606. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  20607. var number;
  20608. switch (format) {
  20609. case "NATIONAL":
  20610. if (!nationalNumber) {
  20611. return "";
  20612. }
  20613. number = formatNationalNumber(nationalNumber, input.carrierCode, "NATIONAL", metadata2, options);
  20614. return addExtension(number, input.ext, metadata2, options.formatExtension);
  20615. case "INTERNATIONAL":
  20616. if (!nationalNumber) {
  20617. return "+".concat(countryCallingCode);
  20618. }
  20619. number = formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata2, options);
  20620. number = "+".concat(countryCallingCode, " ").concat(number);
  20621. return addExtension(number, input.ext, metadata2, options.formatExtension);
  20622. case "E.164":
  20623. return "+".concat(countryCallingCode).concat(nationalNumber);
  20624. case "RFC3966":
  20625. return formatRFC3966({
  20626. number: "+".concat(countryCallingCode).concat(nationalNumber),
  20627. ext: input.ext
  20628. });
  20629. case "IDD":
  20630. if (!options.fromCountry) {
  20631. return;
  20632. }
  20633. var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata2);
  20634. return addExtension(formattedNumber, input.ext, metadata2, options.formatExtension);
  20635. default:
  20636. throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format, '"'));
  20637. }
  20638. }
  20639. function formatNationalNumber(number, carrierCode, formatAs, metadata2, options) {
  20640. var format = chooseFormatForNumber(metadata2.formats(), number);
  20641. if (!format) {
  20642. return number;
  20643. }
  20644. return formatNationalNumberUsingFormat(number, format, {
  20645. useInternationalFormat: formatAs === "INTERNATIONAL",
  20646. withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
  20647. carrierCode,
  20648. metadata: metadata2
  20649. });
  20650. }
  20651. function chooseFormatForNumber(availableFormats, nationalNnumber) {
  20652. for (var _iterator = _createForOfIteratorHelperLoose$1(availableFormats), _step; !(_step = _iterator()).done; ) {
  20653. var format = _step.value;
  20654. if (format.leadingDigitsPatterns().length > 0) {
  20655. var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];
  20656. if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
  20657. continue;
  20658. }
  20659. }
  20660. if (matchesEntirely(nationalNnumber, format.pattern())) {
  20661. return format;
  20662. }
  20663. }
  20664. }
  20665. function addExtension(formattedNumber, ext, metadata2, formatExtension2) {
  20666. return ext ? formatExtension2(formattedNumber, ext, metadata2) : formattedNumber;
  20667. }
  20668. function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata2) {
  20669. var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata2.metadata);
  20670. if (fromCountryCallingCode === countryCallingCode) {
  20671. var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, "NATIONAL", metadata2);
  20672. if (countryCallingCode === "1") {
  20673. return countryCallingCode + " " + formattedNumber;
  20674. }
  20675. return formattedNumber;
  20676. }
  20677. var iddPrefix = getIddPrefix(fromCountry, void 0, metadata2.metadata);
  20678. if (iddPrefix) {
  20679. return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata2));
  20680. }
  20681. }
  20682. function ownKeys$3(object, enumerableOnly) {
  20683. var keys = Object.keys(object);
  20684. if (Object.getOwnPropertySymbols) {
  20685. var symbols = Object.getOwnPropertySymbols(object);
  20686. enumerableOnly && (symbols = symbols.filter(function(sym) {
  20687. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  20688. })), keys.push.apply(keys, symbols);
  20689. }
  20690. return keys;
  20691. }
  20692. function _objectSpread$3(target) {
  20693. for (var i2 = 1; i2 < arguments.length; i2++) {
  20694. var source = null != arguments[i2] ? arguments[i2] : {};
  20695. i2 % 2 ? ownKeys$3(Object(source), true).forEach(function(key) {
  20696. _defineProperty$3(target, key, source[key]);
  20697. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function(key) {
  20698. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  20699. });
  20700. }
  20701. return target;
  20702. }
  20703. function _defineProperty$3(obj, key, value) {
  20704. if (key in obj) {
  20705. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  20706. } else {
  20707. obj[key] = value;
  20708. }
  20709. return obj;
  20710. }
  20711. function _classCallCheck(instance, Constructor) {
  20712. if (!(instance instanceof Constructor)) {
  20713. throw new TypeError("Cannot call a class as a function");
  20714. }
  20715. }
  20716. function _defineProperties(target, props) {
  20717. for (var i2 = 0; i2 < props.length; i2++) {
  20718. var descriptor = props[i2];
  20719. descriptor.enumerable = descriptor.enumerable || false;
  20720. descriptor.configurable = true;
  20721. if ("value" in descriptor)
  20722. descriptor.writable = true;
  20723. Object.defineProperty(target, descriptor.key, descriptor);
  20724. }
  20725. }
  20726. function _createClass(Constructor, protoProps, staticProps) {
  20727. if (protoProps)
  20728. _defineProperties(Constructor.prototype, protoProps);
  20729. if (staticProps)
  20730. _defineProperties(Constructor, staticProps);
  20731. Object.defineProperty(Constructor, "prototype", { writable: false });
  20732. return Constructor;
  20733. }
  20734. var PhoneNumber = /* @__PURE__ */ function() {
  20735. function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata2) {
  20736. _classCallCheck(this, PhoneNumber2);
  20737. if (!countryOrCountryCallingCode) {
  20738. throw new TypeError("`country` or `countryCallingCode` not passed");
  20739. }
  20740. if (!nationalNumber) {
  20741. throw new TypeError("`nationalNumber` not passed");
  20742. }
  20743. if (!metadata2) {
  20744. throw new TypeError("`metadata` not passed");
  20745. }
  20746. var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata2), country = _getCountryAndCountry.country, countryCallingCode = _getCountryAndCountry.countryCallingCode;
  20747. this.country = country;
  20748. this.countryCallingCode = countryCallingCode;
  20749. this.nationalNumber = nationalNumber;
  20750. this.number = "+" + this.countryCallingCode + this.nationalNumber;
  20751. this.getMetadata = function() {
  20752. return metadata2;
  20753. };
  20754. }
  20755. _createClass(PhoneNumber2, [{
  20756. key: "setExt",
  20757. value: function setExt(ext) {
  20758. this.ext = ext;
  20759. }
  20760. }, {
  20761. key: "getPossibleCountries",
  20762. value: function getPossibleCountries() {
  20763. if (this.country) {
  20764. return [this.country];
  20765. }
  20766. return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
  20767. }
  20768. }, {
  20769. key: "isPossible",
  20770. value: function isPossible() {
  20771. return isPossiblePhoneNumber(this, {
  20772. v2: true
  20773. }, this.getMetadata());
  20774. }
  20775. }, {
  20776. key: "isValid",
  20777. value: function isValid() {
  20778. return isValidNumber(this, {
  20779. v2: true
  20780. }, this.getMetadata());
  20781. }
  20782. }, {
  20783. key: "isNonGeographic",
  20784. value: function isNonGeographic() {
  20785. var metadata2 = new Metadata(this.getMetadata());
  20786. return metadata2.isNonGeographicCallingCode(this.countryCallingCode);
  20787. }
  20788. }, {
  20789. key: "isEqual",
  20790. value: function isEqual(phoneNumber) {
  20791. return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
  20792. }
  20793. // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
  20794. // but later it was found out that it doesn't include the possible `TOO_SHORT` result
  20795. // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
  20796. // so eventually I simply commented out this method from the `PhoneNumber` class
  20797. // and just left the `validatePhoneNumberLength()` function, even though that one would require
  20798. // and additional step to also validate the actual country / calling code of the phone number.
  20799. // validateLength() {
  20800. // const metadata = new Metadata(this.getMetadata())
  20801. // metadata.selectNumberingPlan(this.countryCallingCode)
  20802. // const result = checkNumberLength(this.nationalNumber, metadata)
  20803. // if (result !== 'IS_POSSIBLE') {
  20804. // return result
  20805. // }
  20806. // }
  20807. }, {
  20808. key: "getType",
  20809. value: function getType2() {
  20810. return getNumberType(this, {
  20811. v2: true
  20812. }, this.getMetadata());
  20813. }
  20814. }, {
  20815. key: "format",
  20816. value: function format(_format, options) {
  20817. return formatNumber(this, _format, options ? _objectSpread$3(_objectSpread$3({}, options), {}, {
  20818. v2: true
  20819. }) : {
  20820. v2: true
  20821. }, this.getMetadata());
  20822. }
  20823. }, {
  20824. key: "formatNational",
  20825. value: function formatNational(options) {
  20826. return this.format("NATIONAL", options);
  20827. }
  20828. }, {
  20829. key: "formatInternational",
  20830. value: function formatInternational(options) {
  20831. return this.format("INTERNATIONAL", options);
  20832. }
  20833. }, {
  20834. key: "getURI",
  20835. value: function getURI(options) {
  20836. return this.format("RFC3966", options);
  20837. }
  20838. }]);
  20839. return PhoneNumber2;
  20840. }();
  20841. var isCountryCode = function isCountryCode2(value) {
  20842. return /^[A-Z]{2}$/.test(value);
  20843. };
  20844. function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {
  20845. var country;
  20846. var countryCallingCode;
  20847. var metadata2 = new Metadata(metadataJson);
  20848. if (isCountryCode(countryOrCountryCallingCode)) {
  20849. country = countryOrCountryCallingCode;
  20850. metadata2.selectNumberingPlan(country);
  20851. countryCallingCode = metadata2.countryCallingCode();
  20852. } else {
  20853. countryCallingCode = countryOrCountryCallingCode;
  20854. }
  20855. return {
  20856. country,
  20857. countryCallingCode
  20858. };
  20859. }
  20860. var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
  20861. function stripIddPrefix(number, country, callingCode, metadata2) {
  20862. if (!country) {
  20863. return;
  20864. }
  20865. var countryMetadata = new Metadata(metadata2);
  20866. countryMetadata.selectNumberingPlan(country, callingCode);
  20867. var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
  20868. if (number.search(IDDPrefixPattern) !== 0) {
  20869. return;
  20870. }
  20871. number = number.slice(number.match(IDDPrefixPattern)[0].length);
  20872. var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
  20873. if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
  20874. if (matchedGroups[1] === "0") {
  20875. return;
  20876. }
  20877. }
  20878. return number;
  20879. }
  20880. function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata2) {
  20881. if (number && metadata2.numberingPlan.nationalPrefixForParsing()) {
  20882. var prefixPattern = new RegExp("^(?:" + metadata2.numberingPlan.nationalPrefixForParsing() + ")");
  20883. var prefixMatch = prefixPattern.exec(number);
  20884. if (prefixMatch) {
  20885. var nationalNumber;
  20886. var carrierCode;
  20887. var capturedGroupsCount = prefixMatch.length - 1;
  20888. var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
  20889. if (metadata2.nationalPrefixTransformRule() && hasCapturedGroups) {
  20890. nationalNumber = number.replace(prefixPattern, metadata2.nationalPrefixTransformRule());
  20891. if (capturedGroupsCount > 1) {
  20892. carrierCode = prefixMatch[1];
  20893. }
  20894. } else {
  20895. var prefixBeforeNationalNumber = prefixMatch[0];
  20896. nationalNumber = number.slice(prefixBeforeNationalNumber.length);
  20897. if (hasCapturedGroups) {
  20898. carrierCode = prefixMatch[1];
  20899. }
  20900. }
  20901. var nationalPrefix;
  20902. if (hasCapturedGroups) {
  20903. var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
  20904. var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
  20905. if (possibleNationalPrefix === metadata2.numberingPlan.nationalPrefix()) {
  20906. nationalPrefix = metadata2.numberingPlan.nationalPrefix();
  20907. }
  20908. } else {
  20909. nationalPrefix = prefixMatch[0];
  20910. }
  20911. return {
  20912. nationalNumber,
  20913. nationalPrefix,
  20914. carrierCode
  20915. };
  20916. }
  20917. }
  20918. return {
  20919. nationalNumber: number
  20920. };
  20921. }
  20922. function extractNationalNumber(number, metadata2) {
  20923. var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata2), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
  20924. if (nationalNumber !== number) {
  20925. if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata2)) {
  20926. return {
  20927. nationalNumber: number
  20928. };
  20929. }
  20930. if (metadata2.possibleLengths()) {
  20931. if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata2)) {
  20932. return {
  20933. nationalNumber: number
  20934. };
  20935. }
  20936. }
  20937. }
  20938. return {
  20939. nationalNumber,
  20940. carrierCode
  20941. };
  20942. }
  20943. function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata2) {
  20944. if (matchesEntirely(nationalNumberBefore, metadata2.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata2.nationalNumberPattern())) {
  20945. return false;
  20946. }
  20947. return true;
  20948. }
  20949. function isPossibleIncompleteNationalNumber(nationalNumber, metadata2) {
  20950. switch (checkNumberLength(nationalNumber, metadata2)) {
  20951. case "TOO_SHORT":
  20952. case "INVALID_LENGTH":
  20953. return false;
  20954. default:
  20955. return true;
  20956. }
  20957. }
  20958. function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata2) {
  20959. var countryCallingCode = country ? getCountryCallingCode(country, metadata2) : callingCode;
  20960. if (number.indexOf(countryCallingCode) === 0) {
  20961. metadata2 = new Metadata(metadata2);
  20962. metadata2.selectNumberingPlan(country, callingCode);
  20963. var possibleShorterNumber = number.slice(countryCallingCode.length);
  20964. var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata2), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
  20965. var _extractNationalNumbe2 = extractNationalNumber(number, metadata2), nationalNumber = _extractNationalNumbe2.nationalNumber;
  20966. if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata2.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata2) === "TOO_LONG") {
  20967. return {
  20968. countryCallingCode,
  20969. number: possibleShorterNumber
  20970. };
  20971. }
  20972. }
  20973. return {
  20974. number
  20975. };
  20976. }
  20977. function extractCountryCallingCode(number, country, callingCode, metadata2) {
  20978. if (!number) {
  20979. return {};
  20980. }
  20981. var isNumberWithIddPrefix;
  20982. if (number[0] !== "+") {
  20983. var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata2);
  20984. if (numberWithoutIDD && numberWithoutIDD !== number) {
  20985. isNumberWithIddPrefix = true;
  20986. number = "+" + numberWithoutIDD;
  20987. } else {
  20988. if (country || callingCode) {
  20989. var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata2), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
  20990. if (countryCallingCode) {
  20991. return {
  20992. countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
  20993. countryCallingCode,
  20994. number: shorterNumber
  20995. };
  20996. }
  20997. }
  20998. return {
  20999. // No need to set it to `UNSPECIFIED`. It can be just `undefined`.
  21000. // countryCallingCodeSource: 'UNSPECIFIED',
  21001. number
  21002. };
  21003. }
  21004. }
  21005. if (number[1] === "0") {
  21006. return {};
  21007. }
  21008. metadata2 = new Metadata(metadata2);
  21009. var i2 = 2;
  21010. while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number.length) {
  21011. var _countryCallingCode = number.slice(1, i2);
  21012. if (metadata2.hasCallingCode(_countryCallingCode)) {
  21013. metadata2.selectNumberingPlan(_countryCallingCode);
  21014. return {
  21015. countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
  21016. countryCallingCode: _countryCallingCode,
  21017. number: number.slice(i2)
  21018. };
  21019. }
  21020. i2++;
  21021. }
  21022. return {};
  21023. }
  21024. function _createForOfIteratorHelperLoose(o2, allowArrayLike) {
  21025. var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
  21026. if (it2)
  21027. return (it2 = it2.call(o2)).next.bind(it2);
  21028. if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$1(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
  21029. if (it2)
  21030. o2 = it2;
  21031. var i2 = 0;
  21032. return function() {
  21033. if (i2 >= o2.length)
  21034. return { done: true };
  21035. return { done: false, value: o2[i2++] };
  21036. };
  21037. }
  21038. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  21039. }
  21040. function _unsupportedIterableToArray$1(o2, minLen) {
  21041. if (!o2)
  21042. return;
  21043. if (typeof o2 === "string")
  21044. return _arrayLikeToArray$1(o2, minLen);
  21045. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  21046. if (n2 === "Object" && o2.constructor)
  21047. n2 = o2.constructor.name;
  21048. if (n2 === "Map" || n2 === "Set")
  21049. return Array.from(o2);
  21050. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  21051. return _arrayLikeToArray$1(o2, minLen);
  21052. }
  21053. function _arrayLikeToArray$1(arr, len) {
  21054. if (len == null || len > arr.length)
  21055. len = arr.length;
  21056. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  21057. arr2[i2] = arr[i2];
  21058. }
  21059. return arr2;
  21060. }
  21061. function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
  21062. var countries = _ref.countries, defaultCountry = _ref.defaultCountry, metadata2 = _ref.metadata;
  21063. metadata2 = new Metadata(metadata2);
  21064. var matchingCountries = [];
  21065. for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done; ) {
  21066. var country = _step.value;
  21067. metadata2.country(country);
  21068. if (metadata2.leadingDigits()) {
  21069. if (nationalPhoneNumber && nationalPhoneNumber.search(metadata2.leadingDigits()) === 0) {
  21070. return country;
  21071. }
  21072. } else if (getNumberType({
  21073. phone: nationalPhoneNumber,
  21074. country
  21075. }, void 0, metadata2.metadata)) {
  21076. if (defaultCountry) {
  21077. if (country === defaultCountry) {
  21078. return country;
  21079. }
  21080. matchingCountries.push(country);
  21081. } else {
  21082. return country;
  21083. }
  21084. }
  21085. }
  21086. if (matchingCountries.length > 0) {
  21087. return matchingCountries[0];
  21088. }
  21089. }
  21090. var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
  21091. function getCountryByCallingCode(callingCode, _ref) {
  21092. var nationalPhoneNumber = _ref.nationalNumber, defaultCountry = _ref.defaultCountry, metadata2 = _ref.metadata;
  21093. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
  21094. if (metadata2.isNonGeographicCallingCode(callingCode)) {
  21095. return "001";
  21096. }
  21097. }
  21098. var possibleCountries = metadata2.getCountryCodesForCallingCode(callingCode);
  21099. if (!possibleCountries) {
  21100. return;
  21101. }
  21102. if (possibleCountries.length === 1) {
  21103. return possibleCountries[0];
  21104. }
  21105. return getCountryByNationalNumber(nationalPhoneNumber, {
  21106. countries: possibleCountries,
  21107. defaultCountry,
  21108. metadata: metadata2.metadata
  21109. });
  21110. }
  21111. var PLUS_SIGN = "+";
  21112. var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
  21113. var RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
  21114. var RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
  21115. var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
  21116. var ALPHANUM_ = VALID_DIGITS;
  21117. var RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
  21118. var VALID_ALPHA_ = "a-zA-Z";
  21119. var RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
  21120. var RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
  21121. var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
  21122. var RFC3966_PREFIX_ = "tel:";
  21123. var RFC3966_PHONE_CONTEXT_ = ";phone-context=";
  21124. var RFC3966_ISDN_SUBADDRESS_ = ";isub=";
  21125. function extractPhoneContext(numberToExtractFrom) {
  21126. var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
  21127. if (indexOfPhoneContext < 0) {
  21128. return null;
  21129. }
  21130. var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
  21131. if (phoneContextStart >= numberToExtractFrom.length) {
  21132. return "";
  21133. }
  21134. var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
  21135. if (phoneContextEnd >= 0) {
  21136. return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
  21137. } else {
  21138. return numberToExtractFrom.substring(phoneContextStart);
  21139. }
  21140. }
  21141. function isPhoneContextValid(phoneContext) {
  21142. if (phoneContext === null) {
  21143. return true;
  21144. }
  21145. if (phoneContext.length === 0) {
  21146. return false;
  21147. }
  21148. return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
  21149. }
  21150. function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
  21151. var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;
  21152. var phoneContext = extractPhoneContext(numberToParse);
  21153. if (!isPhoneContextValid(phoneContext)) {
  21154. throw new ParseError("NOT_A_NUMBER");
  21155. }
  21156. var phoneNumberString;
  21157. if (phoneContext === null) {
  21158. phoneNumberString = extractFormattedPhoneNumber(numberToParse) || "";
  21159. } else {
  21160. phoneNumberString = "";
  21161. if (phoneContext.charAt(0) === PLUS_SIGN) {
  21162. phoneNumberString += phoneContext;
  21163. }
  21164. var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
  21165. var indexOfNationalNumber;
  21166. if (indexOfRfc3966Prefix >= 0) {
  21167. indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
  21168. } else {
  21169. indexOfNationalNumber = 0;
  21170. }
  21171. var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
  21172. phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
  21173. }
  21174. var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
  21175. if (indexOfIsdn > 0) {
  21176. phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
  21177. }
  21178. if (phoneNumberString !== "") {
  21179. return phoneNumberString;
  21180. }
  21181. }
  21182. var MAX_INPUT_STRING_LENGTH = 250;
  21183. var PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
  21184. var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
  21185. function parse(text, options, metadata2) {
  21186. options = options || {};
  21187. metadata2 = new Metadata(metadata2);
  21188. if (options.defaultCountry && !metadata2.hasCountry(options.defaultCountry)) {
  21189. if (options.v2) {
  21190. throw new ParseError("INVALID_COUNTRY");
  21191. }
  21192. throw new Error("Unknown country: ".concat(options.defaultCountry));
  21193. }
  21194. var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error = _parseInput.error;
  21195. if (!formattedPhoneNumber) {
  21196. if (options.v2) {
  21197. if (error === "TOO_SHORT") {
  21198. throw new ParseError("TOO_SHORT");
  21199. }
  21200. throw new ParseError("NOT_A_NUMBER");
  21201. }
  21202. return {};
  21203. }
  21204. var _parsePhoneNumber = parsePhoneNumber$3(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata2), country = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource, carrierCode = _parsePhoneNumber.carrierCode;
  21205. if (!metadata2.hasSelectedNumberingPlan()) {
  21206. if (options.v2) {
  21207. throw new ParseError("INVALID_COUNTRY");
  21208. }
  21209. return {};
  21210. }
  21211. if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
  21212. if (options.v2) {
  21213. throw new ParseError("TOO_SHORT");
  21214. }
  21215. return {};
  21216. }
  21217. if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
  21218. if (options.v2) {
  21219. throw new ParseError("TOO_LONG");
  21220. }
  21221. return {};
  21222. }
  21223. if (options.v2) {
  21224. var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata2.metadata);
  21225. if (country) {
  21226. phoneNumber.country = country;
  21227. }
  21228. if (carrierCode) {
  21229. phoneNumber.carrierCode = carrierCode;
  21230. }
  21231. if (ext) {
  21232. phoneNumber.ext = ext;
  21233. }
  21234. phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
  21235. return phoneNumber;
  21236. }
  21237. var valid = (options.extended ? metadata2.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) : false;
  21238. if (!options.extended) {
  21239. return valid ? result(country, nationalNumber, ext) : {};
  21240. }
  21241. return {
  21242. country,
  21243. countryCallingCode,
  21244. carrierCode,
  21245. valid,
  21246. possible: valid ? true : options.extended === true && metadata2.possibleLengths() && isPossibleNumber(nationalNumber, metadata2) ? true : false,
  21247. phone: nationalNumber,
  21248. ext
  21249. };
  21250. }
  21251. function _extractFormattedPhoneNumber(text, extract, throwOnError) {
  21252. if (!text) {
  21253. return;
  21254. }
  21255. if (text.length > MAX_INPUT_STRING_LENGTH) {
  21256. if (throwOnError) {
  21257. throw new ParseError("TOO_LONG");
  21258. }
  21259. return;
  21260. }
  21261. if (extract === false) {
  21262. return text;
  21263. }
  21264. var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
  21265. if (startsAt < 0) {
  21266. return;
  21267. }
  21268. return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
  21269. }
  21270. function parseInput(text, v2, extract) {
  21271. var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
  21272. extractFormattedPhoneNumber: function extractFormattedPhoneNumber(text2) {
  21273. return _extractFormattedPhoneNumber(text2, extract, v2);
  21274. }
  21275. });
  21276. if (!number) {
  21277. return {};
  21278. }
  21279. if (!isViablePhoneNumber(number)) {
  21280. if (isViablePhoneNumberStart(number)) {
  21281. return {
  21282. error: "TOO_SHORT"
  21283. };
  21284. }
  21285. return {};
  21286. }
  21287. var withExtensionStripped = extractExtension(number);
  21288. if (withExtensionStripped.ext) {
  21289. return withExtensionStripped;
  21290. }
  21291. return {
  21292. number
  21293. };
  21294. }
  21295. function result(country, nationalNumber, ext) {
  21296. var result2 = {
  21297. country,
  21298. phone: nationalNumber
  21299. };
  21300. if (ext) {
  21301. result2.ext = ext;
  21302. }
  21303. return result2;
  21304. }
  21305. function parsePhoneNumber$3(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata2) {
  21306. var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata2.metadata), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
  21307. var country;
  21308. if (countryCallingCode) {
  21309. metadata2.selectNumberingPlan(countryCallingCode);
  21310. } else if (number && (defaultCountry || defaultCallingCode)) {
  21311. metadata2.selectNumberingPlan(defaultCountry, defaultCallingCode);
  21312. if (defaultCountry) {
  21313. country = defaultCountry;
  21314. }
  21315. countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata2.metadata);
  21316. } else
  21317. return {};
  21318. if (!number) {
  21319. return {
  21320. countryCallingCodeSource,
  21321. countryCallingCode
  21322. };
  21323. }
  21324. var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata2), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
  21325. var exactCountry = getCountryByCallingCode(countryCallingCode, {
  21326. nationalNumber,
  21327. defaultCountry,
  21328. metadata: metadata2
  21329. });
  21330. if (exactCountry) {
  21331. country = exactCountry;
  21332. if (exactCountry === "001")
  21333. ;
  21334. else {
  21335. metadata2.country(country);
  21336. }
  21337. }
  21338. return {
  21339. country,
  21340. countryCallingCode,
  21341. countryCallingCodeSource,
  21342. nationalNumber,
  21343. carrierCode
  21344. };
  21345. }
  21346. function ownKeys$2(object, enumerableOnly) {
  21347. var keys = Object.keys(object);
  21348. if (Object.getOwnPropertySymbols) {
  21349. var symbols = Object.getOwnPropertySymbols(object);
  21350. enumerableOnly && (symbols = symbols.filter(function(sym) {
  21351. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  21352. })), keys.push.apply(keys, symbols);
  21353. }
  21354. return keys;
  21355. }
  21356. function _objectSpread$2(target) {
  21357. for (var i2 = 1; i2 < arguments.length; i2++) {
  21358. var source = null != arguments[i2] ? arguments[i2] : {};
  21359. i2 % 2 ? ownKeys$2(Object(source), true).forEach(function(key) {
  21360. _defineProperty$2(target, key, source[key]);
  21361. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function(key) {
  21362. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  21363. });
  21364. }
  21365. return target;
  21366. }
  21367. function _defineProperty$2(obj, key, value) {
  21368. if (key in obj) {
  21369. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  21370. } else {
  21371. obj[key] = value;
  21372. }
  21373. return obj;
  21374. }
  21375. function parsePhoneNumberWithError(text, options, metadata2) {
  21376. return parse(text, _objectSpread$2(_objectSpread$2({}, options), {}, {
  21377. v2: true
  21378. }), metadata2);
  21379. }
  21380. function ownKeys$1(object, enumerableOnly) {
  21381. var keys = Object.keys(object);
  21382. if (Object.getOwnPropertySymbols) {
  21383. var symbols = Object.getOwnPropertySymbols(object);
  21384. enumerableOnly && (symbols = symbols.filter(function(sym) {
  21385. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  21386. })), keys.push.apply(keys, symbols);
  21387. }
  21388. return keys;
  21389. }
  21390. function _objectSpread$1(target) {
  21391. for (var i2 = 1; i2 < arguments.length; i2++) {
  21392. var source = null != arguments[i2] ? arguments[i2] : {};
  21393. i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
  21394. _defineProperty$1(target, key, source[key]);
  21395. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
  21396. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  21397. });
  21398. }
  21399. return target;
  21400. }
  21401. function _defineProperty$1(obj, key, value) {
  21402. if (key in obj) {
  21403. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  21404. } else {
  21405. obj[key] = value;
  21406. }
  21407. return obj;
  21408. }
  21409. function _slicedToArray(arr, i2) {
  21410. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
  21411. }
  21412. function _nonIterableRest() {
  21413. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  21414. }
  21415. function _unsupportedIterableToArray(o2, minLen) {
  21416. if (!o2)
  21417. return;
  21418. if (typeof o2 === "string")
  21419. return _arrayLikeToArray(o2, minLen);
  21420. var n2 = Object.prototype.toString.call(o2).slice(8, -1);
  21421. if (n2 === "Object" && o2.constructor)
  21422. n2 = o2.constructor.name;
  21423. if (n2 === "Map" || n2 === "Set")
  21424. return Array.from(o2);
  21425. if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
  21426. return _arrayLikeToArray(o2, minLen);
  21427. }
  21428. function _arrayLikeToArray(arr, len) {
  21429. if (len == null || len > arr.length)
  21430. len = arr.length;
  21431. for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
  21432. arr2[i2] = arr[i2];
  21433. }
  21434. return arr2;
  21435. }
  21436. function _iterableToArrayLimit(arr, i2) {
  21437. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  21438. if (_i == null)
  21439. return;
  21440. var _arr = [];
  21441. var _n = true;
  21442. var _d = false;
  21443. var _s2, _e2;
  21444. try {
  21445. for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
  21446. _arr.push(_s2.value);
  21447. if (i2 && _arr.length === i2)
  21448. break;
  21449. }
  21450. } catch (err) {
  21451. _d = true;
  21452. _e2 = err;
  21453. } finally {
  21454. try {
  21455. if (!_n && _i["return"] != null)
  21456. _i["return"]();
  21457. } finally {
  21458. if (_d)
  21459. throw _e2;
  21460. }
  21461. }
  21462. return _arr;
  21463. }
  21464. function _arrayWithHoles(arr) {
  21465. if (Array.isArray(arr))
  21466. return arr;
  21467. }
  21468. function normalizeArguments(args) {
  21469. var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
  21470. var text;
  21471. var options;
  21472. var metadata2;
  21473. if (typeof arg_1 === "string") {
  21474. text = arg_1;
  21475. } else
  21476. throw new TypeError("A text for parsing must be a string.");
  21477. if (!arg_2 || typeof arg_2 === "string") {
  21478. if (arg_4) {
  21479. options = arg_3;
  21480. metadata2 = arg_4;
  21481. } else {
  21482. options = void 0;
  21483. metadata2 = arg_3;
  21484. }
  21485. if (arg_2) {
  21486. options = _objectSpread$1({
  21487. defaultCountry: arg_2
  21488. }, options);
  21489. }
  21490. } else if (isObject(arg_2)) {
  21491. if (arg_3) {
  21492. options = arg_2;
  21493. metadata2 = arg_3;
  21494. } else {
  21495. metadata2 = arg_2;
  21496. }
  21497. } else
  21498. throw new Error("Invalid second argument: ".concat(arg_2));
  21499. return {
  21500. text,
  21501. options,
  21502. metadata: metadata2
  21503. };
  21504. }
  21505. function ownKeys(object, enumerableOnly) {
  21506. var keys = Object.keys(object);
  21507. if (Object.getOwnPropertySymbols) {
  21508. var symbols = Object.getOwnPropertySymbols(object);
  21509. enumerableOnly && (symbols = symbols.filter(function(sym) {
  21510. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  21511. })), keys.push.apply(keys, symbols);
  21512. }
  21513. return keys;
  21514. }
  21515. function _objectSpread(target) {
  21516. for (var i2 = 1; i2 < arguments.length; i2++) {
  21517. var source = null != arguments[i2] ? arguments[i2] : {};
  21518. i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
  21519. _defineProperty(target, key, source[key]);
  21520. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
  21521. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  21522. });
  21523. }
  21524. return target;
  21525. }
  21526. function _defineProperty(obj, key, value) {
  21527. if (key in obj) {
  21528. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  21529. } else {
  21530. obj[key] = value;
  21531. }
  21532. return obj;
  21533. }
  21534. function parsePhoneNumber$2(text, options, metadata2) {
  21535. if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata2)) {
  21536. options = _objectSpread(_objectSpread({}, options), {}, {
  21537. defaultCountry: void 0
  21538. });
  21539. }
  21540. try {
  21541. return parsePhoneNumberWithError(text, options, metadata2);
  21542. } catch (error) {
  21543. if (error instanceof ParseError)
  21544. ;
  21545. else {
  21546. throw error;
  21547. }
  21548. }
  21549. }
  21550. function parsePhoneNumber$1() {
  21551. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata2 = _normalizeArguments.metadata;
  21552. return parsePhoneNumber$2(text, options, metadata2);
  21553. }
  21554. const metadata = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6], 0, 0, 0, 0, 0, 0, 0, [0, ["4\\d{4}", [5]]]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["690\\d{6}|[356]\\d{5}", [6, 9]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["5[024-68]\\d{7}", [9]]]], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7\\d{8}"]]], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268", [0, ["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"]]], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264", [0, ["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"]]], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[78][2-9]|9\\d)\\d{6}", [9]]]], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"]]], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]], 0, 0, 0, 0, 0, 0, [0, ["9[1-579]\\d{7}"]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1", 0, 0, [0, ["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|5[3-6]|8[3-68]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"]]], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684", [0, ["684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}"]]], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}", [7, 8, 9, 10, 11, 12, 13]]]], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", [0, ["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}", [6, 7, 8, 9, 10]]], "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"]]], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"]]], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246", [0, ["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"]]], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|22"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}", [10]]]], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4[5-9]\\d{7}", [9]]]], "BF": ["226", "00", "[025-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[025-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:0[1-35-7]|5[0-8]|[67]\\d)\\d{6}"]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}", [8, 9]]]], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:29|[67][125-9])\\d{6}"]]], "BJ": ["229", "00", "[24-689]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-689]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:4[0-7]|[56]\\d|9[013-9])\\d{6}"]]], "BL": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441", [0, ["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"]]], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:22[89]|[78]\\d\\d)\\d{4}"]]], "BO": ["591", "00(?:1\\d)?", "(?:[2-467]\\d\\d|8001)\\d{5}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[23]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?", 0, 0, 0, [0, ["[67]\\d{7}", [8]]]], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]", [0, ["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37)", "4(?:02|37)0|[34]00"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2", 0, 0, [0, ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}", [10, 11]]]], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242", [0, ["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"]]], "BT": ["975", "00", "[17]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1[67]|77)\\d{6}", [8]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:321|7[1-8]\\d)\\d{5}", [8]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, [0, ["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}", [9]]], "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["6[0-35-7]\\d{5}", [7]]]], "CA": ["1", "011", "(?:[2-8]\\d|90)\\d{8}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [0, ["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "CD": ["243", "00", "[189]\\d{8}|[1-68]\\d{6}", [7, 9], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["88\\d{5}|(?:8[0-69]|9[017-9])\\d{7}"]]], "CF": ["236", "00", "(?:[27]\\d{3}|8776)\\d{4}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[278]"]]], 0, 0, 0, 0, 0, 0, [0, ["7[024-7]\\d{6}"]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]], 0, 0, 0, 0, 0, 0, [0, ["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[89]|7[235-9])\\d{7}"]]], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["0[157]\\d{8}"]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]], 0, 0, 0, 0, 0, 0, [0, ["[578]\\d{4}"]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9[2-9]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]], 0, 0, 0, 0, 0, 0, [0, ["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-3])|600)|646[59])|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}", [9]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:24[23]|6[25-9]\\d)\\d{6}", [9]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]", "(?:10|2[0-57-9])(?:10|9[56])", "10(?:10|9[56])|2[0-57-9](?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, [0, ["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}", [11]]], "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}", [10, 11], [["(\\d{3})(\\d{7})", "$1 $2", ["6"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|91"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?", 0, 0, 0, [0, ["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:24[1-9]|3(?:00|3[0-24-9]))|9101)\\d{6}|3(?:0[0-5]|1\\d|2[0-3]|5[01]|70)\\d{7}", [10]]]], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))", 0, 0, 0, [0, ["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}", [8]]]], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:5\\d|6[2-4])\\d{6}", [8]]]], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:36|5[1-389]|9\\d)\\d{5}"]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]", [0, ["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"]]], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["9(?:10|[4-79]\\d)\\d{5}"]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:60[1-8]\\d|7(?:0(?:[2-5]\\d|60)|190|[2379]\\d\\d))\\d{5}"]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["15(?:[0-25-9]\\d\\d|310)\\d{6}|1(?:6[023]|7\\d)\\d{7,8}", [10, 11]]]], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]], 0, 0, 0, 0, 0, 0, [0, ["77\\d{6}"]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[2-7]\\d|8[126-9]|9[1-46-9])\\d{6}"]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767", [0, ["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"]]], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9", [0, ["8[024]9[2-9]\\d{6}"]]], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:5(?:4[0-29]|5\\d|6[0-2])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}", [9]]]], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}", [9]]]], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[236]|1\\d)|(?:2[0-59]|[3-79]\\d)\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-6]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}", [7, 8]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["1[0-25]\\d{8}", [10]]]], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, "528[89]", [0, ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"]]], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:17[1-3]|7\\d\\d)\\d{4}"]]], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"]]], "ET": ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|22|77|86|99)|9\\d\\d)\\d{6}"]]], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:1[3-79]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", [0, ["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}", [6, 7, 8, 9, 10]]], "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}", [7]]], "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5], 0, 0, 0, 0, 0, 0, 0, [0, ["[56]\\d{4}"]]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]], 0, 0, 0, 0, 0, 0, [0, ["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))", 0, 0, 0, [0, ["(?:[27][1-9]|5\\d|9[16])\\d{4}"]]], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"]]], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1", 0, 0, [0, ["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473", [0, ["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[68])|5(?:2[01]|3[3-8])|901)\\d{4}"]]], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|(?:5(?:0(?:0(?:0\\d|11|22|3[0-6]|44|5[05]|77|88|9[09])|111|77\\d)|1(?:1(?:[03][01]|[124]\\d)|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200)|6[89]\\d\\d|7(?:[0147-9]\\d\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}"]]], "GF": ["594", "00", "[56]94\\d{6}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[56]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["694(?:[0-249]\\d|3[0-8])\\d{4}"]]], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0", "1481$1", 0, 0, [0, ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]]]], "GH": ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}", [9]]]], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]], 0, 0, 0, 0, 0, 0, [0, ["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["[245]\\d{5}"]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[23679]\\d|5[0-489])\\d{5}"]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]], 0, 0, 0, 0, 0, 0, [0, ["6[0-356]\\d{7}", [9]]]], "GP": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:222|55\\d)\\d{6}"]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["68[57-9]\\d{7}|(?:69|94)\\d{8}", [10]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[3-5]\\d\\d|80[0-4])\\d{5}", [8]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671", [0, ["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-46-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"]]], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]], 0, 0, 0, 0, 0, 0, [0, ["9(?:5\\d|6[569]|77)\\d{6}", [9]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:510|6\\d\\d|7(?:[013]\\d|2[0-25-8]|4[0-29]|5[1-9]))\\d{4}"]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:4(?:44[0-25-9]|6(?:1[0-7]|4[0-57-9]|6[0-4]))|5(?:73[0-6]|95[0-8])|6(?:26[013-8]|66[0-3])|70(?:7[1-8]|8[0-4])|848[0-35-9]|9(?:29[013-9]|39[01]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-8]|6[02357-9])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[129]|84[0-29]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}", [8]]], "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["[37-9]\\d{7}", [8]]]], "HR": ["385", "00", "(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}", [6, 7, 8, 9], [["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-7])))\\d{4}|98\\d{6}", [8, 9]]]], "HT": ["509", "00", "(?:[2-489]\\d|55)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[34]\\d|55)\\d{6}"]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06", 0, 0, 0, 0, 0, [0, ["(?:[257]0|3[01])\\d{7}", [9]]]], "ID": ["62", "00[89]", "(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["8[1-35-9]\\d{7,10}", [9, 10, 11, 12]]]], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["8(?:22|[35-9]\\d)\\d{6}", [9]]]], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0", 0, 0, 0, 0, 0, [0, ["55410\\d{4}|5(?:(?:[02][02-9]|[149][2-9]|[36]\\d|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", [9]]]], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0", "1624$1", 0, "74576|(?:16|7[56])24", [0, ["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"]]], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["1(?:6|8[06])", "1(?:6|8[06]0)"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0", 0, 0, 0, 0, 0, [0, ["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}", [10]]]], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["38\\d{5}"]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[3-9]\\d{8}", [10]]]], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9(?:(?:0(?:[0-35]\\d|4[4-6])|(?:[13]\\d|2[0-3])\\d)\\d|9(?:[0-46]\\d\\d|5[15]0|8(?:[12]\\d|88)|9(?:0[0-3]|[19]\\d|21|69|77|8[7-9])))\\d{5}", [10]]]], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"]], "00"], "IT": ["39", "00", "0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0", "1534$1", 0, 0, [0, ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876", [0, ["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"]]], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[78][0-25-9]|9\\d)\\d{6}", [9]]]], "JP": ["81", "010", "00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["[36]|4(?:2[09]|7[01])", "[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[257-9]"], "0$1"]], "0", 0, "(000[259]\\d{6})$|(?:(?:003768)0?)|0", "$1", 0, 0, [0, ["[7-9]0[1-9]\\d{7}", [10]]]], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1(?:0[0-8]|1[0-5]|2[014]|30)|7\\d\\d)\\d{6}", [9]]]], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}", [9]]]], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}", [8, 9]]]], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0", 0, 0, 0, 0, 0, [0, ["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}", [8]]]], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]], 0, 0, 0, 0, 0, 0, [0, ["[34]\\d{6}"]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869", [0, ["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"]]], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["19[1-3]\\d{7}", [10]]]], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?", 0, 0, 0, [0, ["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}", [9, 10]]]], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}", [8]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345", [0, ["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"]]], "KZ": ["7", "810", "(?:33622|8\\d{8})\\d{5}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "33|7", [0, ["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}", [10]]], "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["30[013-9]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:20(?:[23579]\\d|88)|30(?:2\\d|4))\\d{6}", [9, 10]]]], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0", 0, 0, 0, 0, 0, [0, ["793(?:[01]\\d|2[0-4])\\d{3}|(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[12]))\\d{5}"]]], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758", [0, ["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"]]], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0", 0, 0, 0, [0, ["(?:6(?:(?:4[5-9]|5[0-469])\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"]]], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[0-25-8]\\d|4[0-4])\\d{6}"]]], "LR": ["231", "00", "(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:(?:22|33)0|555|(?:77|88)\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}", [7, 9]]]], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]], 0, 0, 0, 0, 0, 0, [0, ["[56]\\d{7}"]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]", 0, 0, 0, [0, ["6\\d{7}"]]], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["2(?:[0367]|4[3-8])"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)", 0, 0, 0, [0, ["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}", [9]]]], "LV": ["371", "00", "(?:[268]\\d|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[269]|8[01]"]]], 0, 0, 0, 0, 0, 0, [0, ["23(?:23[0-57-9]|33[0238])\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[024-9]|3[0-24-9]))\\d{4}"]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9[1-6]\\d{7}"]]], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[45]"], "0$1"], ["(\\d{4})(\\d{5})", "$1-$2", ["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8"], "0$1"], ["(\\d{3})(\\d{6})", "$1-$2", ["[5-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"]]], "MC": ["377", "00", "(?:[3489]|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4(?:[469]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"]]], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"]]], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}", [8]]]], "MF": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1", 0, 0, [0, ["3[2-47-9]\\d{7}"]]], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1", 0, 0, 0, 0, 0, [0, ["(?:(?:23|54)5|329|45[35-8])\\d{4}"]]], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-48]\\d|6[01]|7[01578])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"]]], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[2-49])\\d{6}"]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}", [7, 8, 9, 10]]]], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:83[01]|92[039])\\d{5}|(?:5[05]|6[069]|8[015689]|9[013-9])\\d{6}", [8]]]], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]], 0, 0, 0, 0, 0, 0, [0, ["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}", [8]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670", [0, ["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"]]], "MQ": ["596", "00", "596\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69(?:6(?:[0-46-9]\\d|5[0-6])|727)\\d{4}"]]], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]], 0, 0, 0, 0, 0, 0, [0, ["[2-4][0-46-9]\\d{6}"]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664", [0, ["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"]]], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-3]|3[013]))\\d{5}", [8]]], "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:46[46]|[79]\\d\\d)\\d{4}", [7]]], "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["111\\d{6}|(?:31|77|[89][89])\\d{7}", [9]]]], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["657[12]\\d{6}|(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[25-7][1-9]|3[1-8]|4\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"]], "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-7]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}", [9, 10]]]], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["8[2-79]\\d{7}", [9]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:60|8[1245])\\d{7}", [9]]]], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5[0-4]|[79]\\d|8[0-79])\\d{4}"]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:23|7[0467]|[89]\\d)\\d{6}"]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1", 0, 0, [0, ["(?:14|3[58])\\d{4}"]]], "NG": ["234", "009", "2[0-24-9]\\d{8}|[78]\\d{10,13}|[7-9]\\d{9}|[1-9]\\d{7}|[124-7]\\d{6}", [7, 8, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["78"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|9(?:0[3-9]|[1-9])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[3-6]|7(?:0[0-689]|[1-79])|8[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}", [10]]]], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[1-58]|970\\d)\\d{7}", [9, 11]]]], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]", [0, ["(?:4[015-8]|9\\d)\\d{6}", [8]]]], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9(?:00|6[0-3]|7[024-6]|8[0-24-68])\\d{7}", [10]]]], "NR": ["674", "00", "(?:444|(?:55|8\\d)\\d|666)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-68]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:55[3-9]|666|8\\d\\d)\\d{4}"]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[56]|888[1-9])\\d{3}"]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}", [8, 9, 10]]], "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1505|90[1-9]\\d)\\d{4}|(?:7[126-9]|9[1-9])\\d{6}", [8]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}", [7, 8]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9\\d{8}", [9]]], "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["8[7-9]\\d{6}", [8]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7\\d|8[1-38])\\d{6}", [8]]], "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}", [10]]]], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}", [10]]]], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["21(?:1[013-5]|2\\d)\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}", [9]]]], "PM": ["508", "00", "[45]\\d{5}|(?:708|80\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:4[02-4]|5[056]|708[45][0-5])\\d{4}"]]], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939", [0, ["(?:787|939)[2-9]\\d{6}"]]], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["5[69]\\d{7}", [9]]]], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:(?:46|83)[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}"]]], "PY": ["595", "00", "59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}", [9]]]], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[16]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["[35-7]\\d{7}", [8]]]], "RE": ["262", "00", "(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:630|702)0\\d{5}|(?:6(?:[04]0|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}", [9]]], 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[0-689]|7\\d)\\d{6,7}", [8, 9, 10]]]], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "3[04-689]|[489]", [0, ["9\\d{9}", [10]]], "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[237-9]\\d{7}", [9]]]], "SA": ["966", "00", "92\\d{7}|(?:[15]|8\\d)\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["81"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, 0, 0, 0, 0, [0, ["579[01]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}", [9]]]], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]], 0, 0, 0, 0, 0, 0, [0, ["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"]]], "SC": ["248", "010|0[0-2]", "800\\d{4}|(?:[249]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, [0, ["2[125-8]\\d{5}"]], "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1[0-2]|9[0-3569])\\d{7}"]]], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0", 0, 0, 0, 0, 0, [0, ["7[02369]\\d{7}", [9]]]], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, ["8(?:09[0-6]|95[0-2])\\d{4}|(?:8(?:0[1-8]|[1-8]\\d|9[0-4])|9[0-8]\\d)\\d{5}", [8]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]", [0, ["[56]\\d{4}", [5]]]], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}", [8]]], "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79", [0, ["(?:4[015-8]|9\\d)\\d{6}", [8]]]], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}", [9]]]], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["(?:25|3[0-5]|66|7[2-9]|8[08]|9[09])\\d{6}"]]], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1", 0, 0, [0, ["6[16]\\d{6}", [8]]]], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]], 0, 0, 0, 0, 0, 0, [0, ["7(?:(?:[06-8]\\d|21|90)\\d|5(?:01|[19]0|25|[38]3|[4-7]\\d))\\d{5}"]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|77|9[2-9]"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:15|(?:3[59]|4[89]|6\\d|7[79]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}", [7, 8, 9]]]], "SR": ["597", "00", "(?:[2-5]|68|[78]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-8]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[124-7]|8[124-9])\\d{5}", [7]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:12|9[1257-9])\\d{7}"]]], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]], 0, 0, 0, 0, 0, 0, [0, ["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]], "SV": ["503", "00", "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[267]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["[67]\\d{7}", [8]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721", [0, ["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"]]], "SY": ["963", "00", "[1-39]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-5]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["9[1-689]\\d{7}", [9]]]], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["7[6-9]\\d{6}", [8]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649", [0, ["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"]]], "TD": ["235", "00|16", "(?:22|[69]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2679]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:6[0-689]|77|9\\d)\\d{6}"]], "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[019]|9[0-36-9])\\d{6}"]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["67(?:1[0-8]|2[4-7])\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}", [9]]]], "TJ": ["992", "810", "[0-57-9]\\d{8}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3[1-5]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[0-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:0[0-57-9]|1[017]|2[02]|[34]0|5[05]|7[01578]|8[078]|9\\d)\\d{7}"]], "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7], 0, 0, 0, 0, 0, 0, 0, [0, ["7[2-4]\\d{2,5}"]]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["7[2-8]\\d{6}", [8]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, [0, ["(?:6\\d|71)\\d{6}"]], "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}", [7]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|61[06])", "5(?:[0-59]|61[06]1)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["561(?:011|61\\d)\\d{4}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}", [10]]]], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868", [0, ["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"]]], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[01]\\d|90)\\d{4}", [6, 7]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}", [9]]], 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[125-9]|7[13-9])\\d{7}"]]], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}", [9]]], "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["72(?:[48]0|6[01])\\d{5}|7(?:[015-8]\\d|20|36|4[0-5]|9[89])\\d{6}"]]], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [0, ["(?:5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", [6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, [0, ["9[1-9]\\d{6}", [8]]], "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-79]\\d|88)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:(?:[25]0|33|88|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|3[01]|5\\d|7[0-4])|(?:5[67]|7\\d)\\d|6(?:2[0-26]|8\\d)))|7(?:[07]\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11], 0, 0, 0, 0, 0, 0, "06698", [0, ["3[1-9]\\d{8}|3[2-9]\\d{7}", [9, 10]]]], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784", [0, ["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"]]], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4(?:1[24-8]|2[46])\\d{7}"]]], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284", [0, ["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"]]], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340", [0, ["340(?:2(?:0\\d|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"]]], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}", [9]]]], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[58]\\d|7[013-7])\\d{5}", [7]]]], "WF": ["681", "00", "(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[478]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:72|8[23])\\d{4}", [6]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[1-35-7]|8(?:[3-7]|9\\d{3}))\\d{5}", [7, 10]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4[3-9]\\d{6}", [8]]]], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[01378]\\d{7}", [9]]]], "YT": ["262", "00", "(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:6\\d|7[0-46-9])\\d{3}|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}", [5, 6, 7, 8, 9]]]], "ZM": ["260", "00", "800\\d{6}|(?:21|63|[79]\\d)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[79]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:7[5-79]|9[5-8])\\d{7}"]]], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[1278]\\d|3[1-9])\\d{6}", [9]]]] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[35-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[35-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, 0, 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
  21555. function withMetadataArgument(func, _arguments) {
  21556. var args = Array.prototype.slice.call(_arguments);
  21557. args.push(metadata);
  21558. return func.apply(this, args);
  21559. }
  21560. function parsePhoneNumber() {
  21561. return withMetadataArgument(parsePhoneNumber$1, arguments);
  21562. }
  21563. const easycom = {
  21564. autoscan: true,
  21565. custom: {
  21566. "^s-(.*)": "@/sheep/components/s-$1/s-$1.vue",
  21567. "^su-(.*)": "@/sheep/ui/su-$1/su-$1.vue"
  21568. }
  21569. };
  21570. const pages = [
  21571. {
  21572. path: "pages/index/index",
  21573. aliasPath: "/",
  21574. style: {
  21575. navigationBarTitleText: "首页",
  21576. enablePullDownRefresh: true
  21577. },
  21578. meta: {
  21579. auth: false,
  21580. sync: true,
  21581. title: "首页",
  21582. group: "商城"
  21583. }
  21584. },
  21585. {
  21586. path: "pages/index/user",
  21587. style: {
  21588. navigationBarTitleText: "个人中心",
  21589. enablePullDownRefresh: true
  21590. },
  21591. meta: {
  21592. sync: true,
  21593. title: "个人中心",
  21594. group: "商城"
  21595. }
  21596. },
  21597. {
  21598. path: "pages/index/category",
  21599. style: {
  21600. navigationBarTitleText: "商品分类"
  21601. },
  21602. meta: {
  21603. sync: true,
  21604. title: "商品分类",
  21605. group: "商城"
  21606. }
  21607. },
  21608. {
  21609. path: "pages/index/cart",
  21610. style: {
  21611. navigationBarTitleText: "购物车"
  21612. },
  21613. meta: {
  21614. sync: true,
  21615. title: "购物车",
  21616. group: "商城"
  21617. }
  21618. },
  21619. {
  21620. path: "pages/index/login"
  21621. },
  21622. {
  21623. path: "pages/index/search",
  21624. style: {
  21625. navigationBarTitleText: "搜索"
  21626. },
  21627. meta: {
  21628. sync: true,
  21629. title: "搜索",
  21630. group: "商城"
  21631. }
  21632. },
  21633. {
  21634. path: "pages/index/page",
  21635. style: {
  21636. navigationBarTitleText: ""
  21637. },
  21638. meta: {
  21639. auth: false,
  21640. sync: true,
  21641. title: "自定义页面",
  21642. group: "商城"
  21643. }
  21644. }
  21645. ];
  21646. const subPackages = [
  21647. {
  21648. root: "pages/goods",
  21649. pages: [
  21650. {
  21651. path: "index",
  21652. style: {
  21653. navigationBarTitleText: "商品详情"
  21654. },
  21655. meta: {
  21656. sync: true,
  21657. title: "普通商品",
  21658. group: "商品"
  21659. }
  21660. },
  21661. {
  21662. path: "groupon",
  21663. style: {
  21664. navigationBarTitleText: "拼团商品"
  21665. },
  21666. meta: {
  21667. sync: true,
  21668. title: "拼团商品",
  21669. group: "商品"
  21670. }
  21671. },
  21672. {
  21673. path: "seckill",
  21674. style: {
  21675. navigationBarTitleText: "秒杀商品"
  21676. },
  21677. meta: {
  21678. sync: true,
  21679. title: "秒杀商品",
  21680. group: "商品"
  21681. }
  21682. },
  21683. {
  21684. path: "list",
  21685. style: {
  21686. navigationBarTitleText: "商品列表"
  21687. },
  21688. meta: {
  21689. sync: true,
  21690. title: "商品列表",
  21691. group: "商品"
  21692. }
  21693. },
  21694. {
  21695. path: "comment/add",
  21696. style: {
  21697. navigationBarTitleText: "评价商品"
  21698. },
  21699. meta: {
  21700. auth: true
  21701. }
  21702. },
  21703. {
  21704. path: "comment/list",
  21705. style: {
  21706. navigationBarTitleText: "商品评价"
  21707. }
  21708. }
  21709. ]
  21710. },
  21711. {
  21712. root: "pages/order",
  21713. pages: [
  21714. {
  21715. path: "detail",
  21716. style: {
  21717. navigationBarTitleText: "订单详情"
  21718. },
  21719. meta: {
  21720. auth: true,
  21721. title: "订单详情"
  21722. }
  21723. },
  21724. {
  21725. path: "confirm",
  21726. style: {
  21727. navigationBarTitleText: "确认订单"
  21728. },
  21729. meta: {
  21730. auth: true,
  21731. title: "确认订单"
  21732. }
  21733. },
  21734. {
  21735. path: "list",
  21736. style: {
  21737. navigationBarTitleText: "我的订单",
  21738. enablePullDownRefresh: true
  21739. },
  21740. meta: {
  21741. auth: true,
  21742. sync: true,
  21743. title: "用户订单",
  21744. group: "订单中心"
  21745. }
  21746. },
  21747. {
  21748. path: "aftersale/apply",
  21749. style: {
  21750. navigationBarTitleText: "申请售后"
  21751. },
  21752. meta: {
  21753. auth: true,
  21754. title: "申请售后"
  21755. }
  21756. },
  21757. {
  21758. path: "aftersale/return-delivery",
  21759. style: {
  21760. navigationBarTitleText: "退货物流"
  21761. },
  21762. meta: {
  21763. auth: true,
  21764. title: "退货物流"
  21765. }
  21766. },
  21767. {
  21768. path: "aftersale/list",
  21769. style: {
  21770. navigationBarTitleText: "售后列表"
  21771. },
  21772. meta: {
  21773. auth: true,
  21774. sync: true,
  21775. title: "售后订单",
  21776. group: "订单中心"
  21777. }
  21778. },
  21779. {
  21780. path: "aftersale/detail",
  21781. style: {
  21782. navigationBarTitleText: "售后详情"
  21783. },
  21784. meta: {
  21785. auth: true,
  21786. title: "售后详情"
  21787. }
  21788. },
  21789. {
  21790. path: "aftersale/log",
  21791. style: {
  21792. navigationBarTitleText: "售后进度"
  21793. },
  21794. meta: {
  21795. auth: true,
  21796. title: "售后进度"
  21797. }
  21798. },
  21799. {
  21800. path: "express/log",
  21801. style: {
  21802. navigationBarTitleText: "物流轨迹"
  21803. },
  21804. meta: {
  21805. auth: true,
  21806. title: "物流轨迹"
  21807. }
  21808. },
  21809. {
  21810. path: "otherlist",
  21811. style: {
  21812. navigationBarTitleText: "",
  21813. enablePullDownRefresh: false
  21814. }
  21815. }
  21816. ]
  21817. },
  21818. {
  21819. root: "pages/user",
  21820. pages: [
  21821. {
  21822. path: "info",
  21823. style: {
  21824. navigationBarTitleText: "我的信息"
  21825. },
  21826. meta: {
  21827. auth: true,
  21828. sync: true,
  21829. title: "用户信息",
  21830. group: "用户中心"
  21831. }
  21832. },
  21833. {
  21834. path: "setting",
  21835. style: {
  21836. navigationBarTitleText: "用户设置"
  21837. },
  21838. meta: {
  21839. auth: true,
  21840. sync: true,
  21841. title: "用户设置",
  21842. group: "用户中心"
  21843. }
  21844. },
  21845. {
  21846. path: "qrcode-share",
  21847. style: {
  21848. navigationBarTitleText: "我的二维码/分享页"
  21849. },
  21850. meta: {
  21851. auth: true,
  21852. sync: true,
  21853. title: "我的二维码/分享页",
  21854. group: "用户中心"
  21855. }
  21856. },
  21857. {
  21858. path: "goods-collect",
  21859. style: {
  21860. navigationBarTitleText: "我的收藏"
  21861. },
  21862. meta: {
  21863. auth: true,
  21864. sync: true,
  21865. title: "商品收藏",
  21866. group: "用户中心"
  21867. }
  21868. },
  21869. {
  21870. path: "goods-log",
  21871. style: {
  21872. navigationBarTitleText: "我的足迹"
  21873. },
  21874. meta: {
  21875. auth: true,
  21876. sync: true,
  21877. title: "浏览记录",
  21878. group: "用户中心"
  21879. }
  21880. },
  21881. {
  21882. path: "address/list",
  21883. style: {
  21884. navigationBarTitleText: "实体商品收货地址"
  21885. },
  21886. meta: {
  21887. auth: true,
  21888. sync: true,
  21889. title: "地址管理",
  21890. group: "用户中心"
  21891. }
  21892. },
  21893. {
  21894. path: "dummyAddress/list",
  21895. style: {
  21896. navigationBarTitleText: "虚拟商品收货地址"
  21897. },
  21898. meta: {
  21899. auth: true,
  21900. sync: true,
  21901. title: "虚拟商品收货地址",
  21902. group: "用户中心"
  21903. }
  21904. },
  21905. {
  21906. path: "invoice/edit",
  21907. style: {
  21908. navigationBarTitleText: "发票抬头编辑"
  21909. },
  21910. meta: {
  21911. auth: true,
  21912. title: "发票抬头"
  21913. }
  21914. },
  21915. {
  21916. path: "invoice/list",
  21917. style: {
  21918. navigationBarTitleText: "发票抬头管理"
  21919. },
  21920. meta: {
  21921. auth: true,
  21922. sync: true,
  21923. title: "发票抬头管理",
  21924. group: "用户中心"
  21925. }
  21926. },
  21927. {
  21928. path: "address/edit",
  21929. style: {
  21930. navigationBarTitleText: "编辑地址"
  21931. },
  21932. meta: {
  21933. auth: true,
  21934. title: "编辑地址"
  21935. }
  21936. },
  21937. {
  21938. path: "dummyAddress/edit",
  21939. style: {
  21940. navigationBarTitleText: "编辑地址"
  21941. },
  21942. meta: {
  21943. auth: true,
  21944. title: "编辑地址"
  21945. }
  21946. },
  21947. {
  21948. path: "wallet/money",
  21949. style: {
  21950. navigationBarTitleText: "我的余额"
  21951. },
  21952. meta: {
  21953. auth: true,
  21954. sync: true,
  21955. title: "用户余额",
  21956. group: "用户中心"
  21957. }
  21958. },
  21959. {
  21960. path: "wallet/score",
  21961. style: {
  21962. navigationBarTitleText: "我的积分"
  21963. },
  21964. meta: {
  21965. auth: true,
  21966. sync: true,
  21967. title: "用户积分",
  21968. group: "用户中心"
  21969. }
  21970. },
  21971. {
  21972. path: "wallet/scoreToMoney",
  21973. style: {
  21974. navigationBarTitleText: "积分兑换"
  21975. },
  21976. meta: {
  21977. auth: true,
  21978. sync: true,
  21979. title: "积分兑换",
  21980. group: "用户中心"
  21981. }
  21982. },
  21983. {
  21984. path: "wallet/ScoreLog"
  21985. },
  21986. {
  21987. path: "wallet/maxScoreLog"
  21988. },
  21989. {
  21990. path: "wallet/team",
  21991. style: {
  21992. navigationBarTitleText: "团队"
  21993. },
  21994. meta: {
  21995. auth: true,
  21996. sync: true,
  21997. title: "团队",
  21998. group: "用户中心"
  21999. }
  22000. }
  22001. ]
  22002. },
  22003. {
  22004. root: "pages/commission",
  22005. pages: [
  22006. {
  22007. path: "index",
  22008. style: {
  22009. navigationBarTitleText: "分销"
  22010. },
  22011. meta: {
  22012. auth: true,
  22013. sync: true,
  22014. title: "分销中心",
  22015. group: "分销商城"
  22016. }
  22017. },
  22018. {
  22019. path: "wallet",
  22020. style: {
  22021. navigationBarTitleText: "我的佣金"
  22022. },
  22023. meta: {
  22024. auth: true,
  22025. sync: true,
  22026. title: "用户佣金",
  22027. group: "分销中心"
  22028. }
  22029. },
  22030. {
  22031. path: "goods",
  22032. style: {
  22033. navigationBarTitleText: "推广商品"
  22034. },
  22035. meta: {
  22036. auth: true,
  22037. sync: true,
  22038. title: "推广商品",
  22039. group: "分销商城"
  22040. }
  22041. },
  22042. {
  22043. path: "order",
  22044. style: {
  22045. navigationBarTitleText: "分销订单"
  22046. },
  22047. meta: {
  22048. auth: true,
  22049. sync: true,
  22050. title: "分销订单",
  22051. group: "分销商城"
  22052. }
  22053. },
  22054. {
  22055. path: "team",
  22056. style: {
  22057. navigationBarTitleText: "我的团队"
  22058. },
  22059. meta: {
  22060. auth: true,
  22061. sync: true,
  22062. title: "我的团队",
  22063. group: "分销商城"
  22064. }
  22065. },
  22066. {
  22067. path: "promoter",
  22068. style: {
  22069. navigationBarTitleText: "推广人排行榜"
  22070. },
  22071. meta: {
  22072. auth: true,
  22073. sync: true,
  22074. title: "推广人排行榜",
  22075. group: "分销商城"
  22076. }
  22077. },
  22078. {
  22079. path: "commission-ranking",
  22080. style: {
  22081. navigationBarTitleText: "佣金排行榜"
  22082. },
  22083. meta: {
  22084. auth: true,
  22085. sync: true,
  22086. title: "佣金排行榜",
  22087. group: "分销商城"
  22088. }
  22089. },
  22090. {
  22091. path: "withdraw",
  22092. style: {
  22093. navigationBarTitleText: "申请提现"
  22094. },
  22095. meta: {
  22096. auth: true,
  22097. sync: true,
  22098. title: "申请提现",
  22099. group: "分销商城"
  22100. }
  22101. }
  22102. ]
  22103. },
  22104. {
  22105. root: "pages/app",
  22106. pages: [
  22107. {
  22108. path: "sign",
  22109. style: {
  22110. navigationBarTitleText: "签到中心"
  22111. },
  22112. meta: {
  22113. auth: true,
  22114. sync: true,
  22115. title: "签到中心",
  22116. group: "应用"
  22117. }
  22118. }
  22119. ]
  22120. },
  22121. {
  22122. root: "pages/shop",
  22123. pages: [
  22124. {
  22125. path: "index",
  22126. style: {
  22127. navigationBarTitleText: "店铺首页"
  22128. },
  22129. meta: {
  22130. auth: true,
  22131. sync: true,
  22132. title: "店铺首页",
  22133. group: "应用"
  22134. }
  22135. }
  22136. ]
  22137. },
  22138. {
  22139. root: "pages/public",
  22140. pages: [
  22141. {
  22142. path: "setting",
  22143. style: {
  22144. navigationBarTitleText: "系统设置"
  22145. },
  22146. meta: {
  22147. sync: true,
  22148. title: "系统设置",
  22149. group: "通用"
  22150. }
  22151. },
  22152. {
  22153. path: "richtext",
  22154. style: {
  22155. navigationBarTitleText: "富文本"
  22156. },
  22157. meta: {
  22158. sync: true,
  22159. title: "富文本",
  22160. group: "通用"
  22161. }
  22162. },
  22163. {
  22164. path: "faq",
  22165. style: {
  22166. navigationBarTitleText: "常见问题"
  22167. },
  22168. meta: {
  22169. sync: true,
  22170. title: "常见问题",
  22171. group: "通用"
  22172. }
  22173. },
  22174. {
  22175. path: "error",
  22176. style: {
  22177. navigationBarTitleText: "错误页面"
  22178. }
  22179. },
  22180. {
  22181. path: "webview",
  22182. style: {
  22183. navigationBarTitleText: ""
  22184. }
  22185. }
  22186. ]
  22187. },
  22188. {
  22189. root: "pages/coupon",
  22190. pages: [
  22191. {
  22192. path: "list",
  22193. style: {
  22194. navigationBarTitleText: "领券中心"
  22195. },
  22196. meta: {
  22197. sync: true,
  22198. title: "领券中心",
  22199. group: "优惠券"
  22200. }
  22201. },
  22202. {
  22203. path: "detail",
  22204. style: {
  22205. navigationBarTitleText: "优惠券"
  22206. },
  22207. meta: {
  22208. auth: false,
  22209. sync: true,
  22210. title: "优惠券详情",
  22211. group: "优惠券"
  22212. }
  22213. }
  22214. ]
  22215. },
  22216. {
  22217. root: "pages/chat",
  22218. pages: [
  22219. {
  22220. path: "index",
  22221. style: {
  22222. navigationBarTitleText: "客服"
  22223. },
  22224. meta: {
  22225. auth: true,
  22226. sync: true,
  22227. title: "客服",
  22228. group: "客服"
  22229. }
  22230. },
  22231. {
  22232. path: "speechtotext",
  22233. style: {
  22234. navigationBarTitleText: "语音转文字",
  22235. enablePullDownRefresh: false
  22236. },
  22237. meta: {
  22238. auth: true,
  22239. sync: true,
  22240. title: "语音转文字",
  22241. group: "语音转文字"
  22242. }
  22243. }
  22244. ]
  22245. },
  22246. {
  22247. root: "pages/pay",
  22248. pages: [
  22249. {
  22250. path: "index",
  22251. style: {
  22252. navigationBarTitleText: "收银台"
  22253. }
  22254. },
  22255. {
  22256. path: "result",
  22257. style: {
  22258. navigationBarTitleText: "支付结果"
  22259. }
  22260. },
  22261. {
  22262. path: "recharge",
  22263. style: {
  22264. navigationBarTitleText: "充值余额"
  22265. },
  22266. meta: {
  22267. auth: true,
  22268. sync: true,
  22269. title: "充值余额",
  22270. group: "支付"
  22271. }
  22272. },
  22273. {
  22274. path: "recharge-log",
  22275. style: {
  22276. navigationBarTitleText: "充值记录"
  22277. },
  22278. meta: {
  22279. auth: true,
  22280. sync: true,
  22281. title: "充值记录",
  22282. group: "支付"
  22283. }
  22284. }
  22285. ]
  22286. },
  22287. {
  22288. root: "pages/activity",
  22289. pages: [
  22290. {
  22291. path: "groupon/detail",
  22292. style: {
  22293. navigationBarTitleText: "拼团详情"
  22294. }
  22295. },
  22296. {
  22297. path: "groupon/order",
  22298. style: {
  22299. navigationBarTitleText: "我的拼团",
  22300. enablePullDownRefresh: true
  22301. },
  22302. meta: {
  22303. auth: true,
  22304. sync: true,
  22305. title: "拼团订单",
  22306. group: "营销活动"
  22307. }
  22308. },
  22309. {
  22310. path: "index",
  22311. style: {
  22312. navigationBarTitleText: "营销商品"
  22313. },
  22314. meta: {
  22315. sync: true,
  22316. title: "营销商品",
  22317. group: "营销活动"
  22318. }
  22319. },
  22320. {
  22321. path: "groupon/list",
  22322. style: {
  22323. navigationBarTitleText: "拼团活动"
  22324. },
  22325. meta: {
  22326. sync: true,
  22327. title: "拼团活动",
  22328. group: "营销活动"
  22329. }
  22330. },
  22331. {
  22332. path: "seckill/list",
  22333. style: {
  22334. navigationBarTitleText: "秒杀活动"
  22335. },
  22336. meta: {
  22337. sync: true,
  22338. title: "秒杀活动",
  22339. group: "营销活动"
  22340. }
  22341. },
  22342. {
  22343. path: "bargain/list",
  22344. style: {
  22345. navigationBarTitleText: "砍价列表"
  22346. },
  22347. meta: {
  22348. sync: true,
  22349. title: "砍价列表",
  22350. group: "营销活动"
  22351. }
  22352. },
  22353. {
  22354. path: "bargain/detail",
  22355. style: {
  22356. navigationBarTitleText: "砍价详情"
  22357. },
  22358. meta: {
  22359. sync: true,
  22360. title: "砍价详情",
  22361. group: "营销活动"
  22362. }
  22363. }
  22364. ]
  22365. }
  22366. ];
  22367. const globalStyle = {
  22368. navigationBarTextStyle: "black",
  22369. navigationBarTitleText: "常来此购",
  22370. navigationBarBackgroundColor: "#FFFFFF",
  22371. backgroundColor: "#FFFFFF",
  22372. navigationStyle: "custom"
  22373. };
  22374. const tabBar = {
  22375. list: [
  22376. {
  22377. pagePath: "pages/index/index"
  22378. },
  22379. {
  22380. pagePath: "pages/index/cart"
  22381. },
  22382. {
  22383. pagePath: "pages/index/user"
  22384. }
  22385. ]
  22386. };
  22387. const condition = {
  22388. current: 0,
  22389. list: [
  22390. {
  22391. name: "",
  22392. path: "",
  22393. query: ""
  22394. }
  22395. ]
  22396. };
  22397. const usingComponents = {
  22398. richtext: "@/pages/public/richtext"
  22399. };
  22400. const e = {
  22401. easycom,
  22402. pages,
  22403. subPackages,
  22404. globalStyle,
  22405. tabBar,
  22406. condition,
  22407. usingComponents
  22408. };
  22409. function t(e2) {
  22410. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  22411. }
  22412. function n(e2, t2, n2) {
  22413. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  22414. return function() {
  22415. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  22416. }(null == t3 && n2.path);
  22417. } }, n2.exports), n2.exports;
  22418. }
  22419. var s = n(function(e2, t2) {
  22420. var n2;
  22421. e2.exports = (n2 = n2 || function(e3, t3) {
  22422. var n3 = Object.create || function() {
  22423. function e4() {
  22424. }
  22425. return function(t4) {
  22426. var n4;
  22427. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  22428. };
  22429. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  22430. var t4 = n3(this);
  22431. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  22432. t4.$super.init.apply(this, arguments);
  22433. }), t4.init.prototype = t4, t4.$super = this, t4;
  22434. }, create: function() {
  22435. var e4 = this.extend();
  22436. return e4.init.apply(e4, arguments), e4;
  22437. }, init: function() {
  22438. }, mixIn: function(e4) {
  22439. for (var t4 in e4)
  22440. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  22441. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  22442. }, clone: function() {
  22443. return this.init.prototype.extend(this);
  22444. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  22445. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  22446. }, toString: function(e4) {
  22447. return (e4 || c2).stringify(this);
  22448. }, concat: function(e4) {
  22449. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  22450. if (this.clamp(), s3 % 4)
  22451. for (var i3 = 0; i3 < r3; i3++) {
  22452. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  22453. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  22454. }
  22455. else
  22456. for (i3 = 0; i3 < r3; i3 += 4)
  22457. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  22458. return this.sigBytes += r3, this;
  22459. }, clamp: function() {
  22460. var t4 = this.words, n4 = this.sigBytes;
  22461. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  22462. }, clone: function() {
  22463. var e4 = i2.clone.call(this);
  22464. return e4.words = this.words.slice(0), e4;
  22465. }, random: function(t4) {
  22466. for (var n4, s3 = [], r3 = function(t5) {
  22467. t5 = t5;
  22468. var n5 = 987654321, s4 = 4294967295;
  22469. return function() {
  22470. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  22471. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  22472. };
  22473. }, i3 = 0; i3 < t4; i3 += 4) {
  22474. var a3 = r3(4294967296 * (n4 || e3.random()));
  22475. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  22476. }
  22477. return new o2.init(s3, t4);
  22478. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  22479. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  22480. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  22481. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  22482. }
  22483. return s3.join("");
  22484. }, parse: function(e4) {
  22485. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  22486. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  22487. return new o2.init(n4, t4 / 2);
  22488. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  22489. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  22490. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  22491. s3.push(String.fromCharCode(i3));
  22492. }
  22493. return s3.join("");
  22494. }, parse: function(e4) {
  22495. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  22496. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  22497. return new o2.init(n4, t4);
  22498. } }, h2 = a2.Utf8 = { stringify: function(e4) {
  22499. try {
  22500. return decodeURIComponent(escape(u2.stringify(e4)));
  22501. } catch (e5) {
  22502. throw new Error("Malformed UTF-8 data");
  22503. }
  22504. }, parse: function(e4) {
  22505. return u2.parse(unescape(encodeURIComponent(e4)));
  22506. } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  22507. this._data = new o2.init(), this._nDataBytes = 0;
  22508. }, _append: function(e4) {
  22509. "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  22510. }, _process: function(t4) {
  22511. var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3);
  22512. if (c3) {
  22513. for (var h3 = 0; h3 < c3; h3 += i3)
  22514. this._doProcessBlock(s3, h3);
  22515. var l3 = s3.splice(0, c3);
  22516. n4.sigBytes -= u3;
  22517. }
  22518. return new o2.init(l3, u3);
  22519. }, clone: function() {
  22520. var e4 = i2.clone.call(this);
  22521. return e4._data = this._data.clone(), e4;
  22522. }, _minBufferSize: 0 });
  22523. r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
  22524. this.cfg = this.cfg.extend(e4), this.reset();
  22525. }, reset: function() {
  22526. l2.reset.call(this), this._doReset();
  22527. }, update: function(e4) {
  22528. return this._append(e4), this._process(), this;
  22529. }, finalize: function(e4) {
  22530. return e4 && this._append(e4), this._doFinalize();
  22531. }, blockSize: 16, _createHelper: function(e4) {
  22532. return function(t4, n4) {
  22533. return new e4.init(n4).finalize(t4);
  22534. };
  22535. }, _createHmacHelper: function(e4) {
  22536. return function(t4, n4) {
  22537. return new d2.HMAC.init(e4, n4).finalize(t4);
  22538. };
  22539. } });
  22540. var d2 = s2.algo = {};
  22541. return s2;
  22542. }(Math), n2);
  22543. }), r = s, i = (n(function(e2, t2) {
  22544. var n2;
  22545. e2.exports = (n2 = r, function(e3) {
  22546. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  22547. !function() {
  22548. for (var t4 = 0; t4 < 64; t4++)
  22549. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  22550. }();
  22551. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  22552. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  22553. }, _doProcessBlock: function(e4, t4) {
  22554. for (var n3 = 0; n3 < 16; n3++) {
  22555. var s3 = t4 + n3, r3 = e4[s3];
  22556. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  22557. }
  22558. var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k = e4[t4 + 13], A2 = e4[t4 + 14], P2 = e4[t4 + 15], T2 = i3[0], C2 = i3[1], x = i3[2], O2 = i3[3];
  22559. T2 = u2(T2, C2, x, O2, o3, 7, a2[0]), O2 = u2(O2, T2, C2, x, c3, 12, a2[1]), x = u2(x, O2, T2, C2, p2, 17, a2[2]), C2 = u2(C2, x, O2, T2, f2, 22, a2[3]), T2 = u2(T2, C2, x, O2, g2, 7, a2[4]), O2 = u2(O2, T2, C2, x, m2, 12, a2[5]), x = u2(x, O2, T2, C2, y2, 17, a2[6]), C2 = u2(C2, x, O2, T2, _2, 22, a2[7]), T2 = u2(T2, C2, x, O2, w2, 7, a2[8]), O2 = u2(O2, T2, C2, x, v2, 12, a2[9]), x = u2(x, O2, T2, C2, I2, 17, a2[10]), C2 = u2(C2, x, O2, T2, S2, 22, a2[11]), T2 = u2(T2, C2, x, O2, b2, 7, a2[12]), O2 = u2(O2, T2, C2, x, k, 12, a2[13]), x = u2(x, O2, T2, C2, A2, 17, a2[14]), T2 = h2(T2, C2 = u2(C2, x, O2, T2, P2, 22, a2[15]), x, O2, c3, 5, a2[16]), O2 = h2(O2, T2, C2, x, y2, 9, a2[17]), x = h2(x, O2, T2, C2, S2, 14, a2[18]), C2 = h2(C2, x, O2, T2, o3, 20, a2[19]), T2 = h2(T2, C2, x, O2, m2, 5, a2[20]), O2 = h2(O2, T2, C2, x, I2, 9, a2[21]), x = h2(x, O2, T2, C2, P2, 14, a2[22]), C2 = h2(C2, x, O2, T2, g2, 20, a2[23]), T2 = h2(T2, C2, x, O2, v2, 5, a2[24]), O2 = h2(O2, T2, C2, x, A2, 9, a2[25]), x = h2(x, O2, T2, C2, f2, 14, a2[26]), C2 = h2(C2, x, O2, T2, w2, 20, a2[27]), T2 = h2(T2, C2, x, O2, k, 5, a2[28]), O2 = h2(O2, T2, C2, x, p2, 9, a2[29]), x = h2(x, O2, T2, C2, _2, 14, a2[30]), T2 = l2(T2, C2 = h2(C2, x, O2, T2, b2, 20, a2[31]), x, O2, m2, 4, a2[32]), O2 = l2(O2, T2, C2, x, w2, 11, a2[33]), x = l2(x, O2, T2, C2, S2, 16, a2[34]), C2 = l2(C2, x, O2, T2, A2, 23, a2[35]), T2 = l2(T2, C2, x, O2, c3, 4, a2[36]), O2 = l2(O2, T2, C2, x, g2, 11, a2[37]), x = l2(x, O2, T2, C2, _2, 16, a2[38]), C2 = l2(C2, x, O2, T2, I2, 23, a2[39]), T2 = l2(T2, C2, x, O2, k, 4, a2[40]), O2 = l2(O2, T2, C2, x, o3, 11, a2[41]), x = l2(x, O2, T2, C2, f2, 16, a2[42]), C2 = l2(C2, x, O2, T2, y2, 23, a2[43]), T2 = l2(T2, C2, x, O2, v2, 4, a2[44]), O2 = l2(O2, T2, C2, x, b2, 11, a2[45]), x = l2(x, O2, T2, C2, P2, 16, a2[46]), T2 = d2(T2, C2 = l2(C2, x, O2, T2, p2, 23, a2[47]), x, O2, o3, 6, a2[48]), O2 = d2(O2, T2, C2, x, _2, 10, a2[49]), x = d2(x, O2, T2, C2, A2, 15, a2[50]), C2 = d2(C2, x, O2, T2, m2, 21, a2[51]), T2 = d2(T2, C2, x, O2, b2, 6, a2[52]), O2 = d2(O2, T2, C2, x, f2, 10, a2[53]), x = d2(x, O2, T2, C2, I2, 15, a2[54]), C2 = d2(C2, x, O2, T2, c3, 21, a2[55]), T2 = d2(T2, C2, x, O2, w2, 6, a2[56]), O2 = d2(O2, T2, C2, x, P2, 10, a2[57]), x = d2(x, O2, T2, C2, y2, 15, a2[58]), C2 = d2(C2, x, O2, T2, k, 21, a2[59]), T2 = d2(T2, C2, x, O2, g2, 6, a2[60]), O2 = d2(O2, T2, C2, x, S2, 10, a2[61]), x = d2(x, O2, T2, C2, p2, 15, a2[62]), C2 = d2(C2, x, O2, T2, v2, 21, a2[63]), i3[0] = i3[0] + T2 | 0, i3[1] = i3[1] + C2 | 0, i3[2] = i3[2] + x | 0, i3[3] = i3[3] + O2 | 0;
  22560. }, _doFinalize: function() {
  22561. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  22562. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  22563. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  22564. n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process();
  22565. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  22566. var h3 = c3[u3];
  22567. c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
  22568. }
  22569. return a3;
  22570. }, clone: function() {
  22571. var e4 = i2.clone.call(this);
  22572. return e4._hash = this._hash.clone(), e4;
  22573. } });
  22574. function u2(e4, t4, n3, s3, r3, i3, o3) {
  22575. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  22576. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  22577. }
  22578. function h2(e4, t4, n3, s3, r3, i3, o3) {
  22579. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  22580. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  22581. }
  22582. function l2(e4, t4, n3, s3, r3, i3, o3) {
  22583. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  22584. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  22585. }
  22586. function d2(e4, t4, n3, s3, r3, i3, o3) {
  22587. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  22588. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  22589. }
  22590. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  22591. }(Math), n2.MD5);
  22592. }), n(function(e2, t2) {
  22593. var n2;
  22594. e2.exports = (n2 = r, void function() {
  22595. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  22596. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  22597. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  22598. var n3 = e4.blockSize, r2 = 4 * n3;
  22599. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  22600. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  22601. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  22602. i2.sigBytes = o2.sigBytes = r2, this.reset();
  22603. }, reset: function() {
  22604. var e4 = this._hasher;
  22605. e4.reset(), e4.update(this._iKey);
  22606. }, update: function(e4) {
  22607. return this._hasher.update(e4), this;
  22608. }, finalize: function(e4) {
  22609. var t4 = this._hasher, n3 = t4.finalize(e4);
  22610. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  22611. } });
  22612. }());
  22613. }), n(function(e2, t2) {
  22614. e2.exports = r.HmacMD5;
  22615. })), o = n(function(e2, t2) {
  22616. e2.exports = r.enc.Utf8;
  22617. }), a = n(function(e2, t2) {
  22618. var n2;
  22619. e2.exports = (n2 = r, function() {
  22620. var e3 = n2, t3 = e3.lib.WordArray;
  22621. function s2(e4, n3, s3) {
  22622. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  22623. if (o2 % 4) {
  22624. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  22625. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  22626. }
  22627. return t3.create(r2, i2);
  22628. }
  22629. e3.enc.Base64 = { stringify: function(e4) {
  22630. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  22631. e4.clamp();
  22632. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  22633. for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++)
  22634. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  22635. var c2 = s3.charAt(64);
  22636. if (c2)
  22637. for (; r2.length % 4; )
  22638. r2.push(c2);
  22639. return r2.join("");
  22640. }, parse: function(e4) {
  22641. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  22642. if (!r2) {
  22643. r2 = this._reverseMap = [];
  22644. for (var i2 = 0; i2 < n3.length; i2++)
  22645. r2[n3.charCodeAt(i2)] = i2;
  22646. }
  22647. var o2 = n3.charAt(64);
  22648. if (o2) {
  22649. var a2 = e4.indexOf(o2);
  22650. -1 !== a2 && (t4 = a2);
  22651. }
  22652. return s2(e4, t4, r2);
  22653. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  22654. }(), n2.enc.Base64);
  22655. });
  22656. const c = "FUNCTION", u = "OBJECT", h = "CLIENT_DB", l = "pending", d = "fulfilled", p = "rejected";
  22657. function f(e2) {
  22658. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  22659. }
  22660. function g(e2) {
  22661. return "object" === f(e2);
  22662. }
  22663. function m(e2) {
  22664. return "function" == typeof e2;
  22665. }
  22666. function y(e2) {
  22667. return function() {
  22668. try {
  22669. return e2.apply(e2, arguments);
  22670. } catch (e3) {
  22671. console.error(e3);
  22672. }
  22673. };
  22674. }
  22675. const _ = "REJECTED", w = "NOT_PENDING";
  22676. class v {
  22677. constructor({ createPromise: e2, retryRule: t2 = _ } = {}) {
  22678. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  22679. }
  22680. get needRetry() {
  22681. if (!this.status)
  22682. return true;
  22683. switch (this.retryRule) {
  22684. case _:
  22685. return this.status === p;
  22686. case w:
  22687. return this.status !== l;
  22688. }
  22689. }
  22690. exec() {
  22691. return this.needRetry ? (this.status = l, this.promise = this.createPromise().then((e2) => (this.status = d, Promise.resolve(e2)), (e2) => (this.status = p, Promise.reject(e2))), this.promise) : this.promise;
  22692. }
  22693. }
  22694. function I(e2) {
  22695. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  22696. }
  22697. const S = true, b = "mp-weixin", A = I([]), P = b, T = I(""), C = I("[]") || [];
  22698. let O = "";
  22699. try {
  22700. O = "__UNI__7806143";
  22701. } catch (e2) {
  22702. }
  22703. let E = {};
  22704. function L(e2, t2 = {}) {
  22705. var n2, s2;
  22706. return n2 = E, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (E[e2] = t2), E[e2];
  22707. }
  22708. const R = ["invoke", "success", "fail", "complete"], U = L("_globalUniCloudInterceptor");
  22709. function N(e2, t2) {
  22710. U[e2] || (U[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => {
  22711. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  22712. let s2 = U[e3][t3];
  22713. s2 || (s2 = U[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3);
  22714. }(e2, n2, t2[n2]);
  22715. });
  22716. }
  22717. function D(e2, t2) {
  22718. U[e2] || (U[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => {
  22719. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  22720. const s2 = U[e3][t3];
  22721. if (!s2)
  22722. return;
  22723. const r2 = s2.indexOf(n3);
  22724. r2 > -1 && s2.splice(r2, 1);
  22725. }(e2, n2, t2[n2]);
  22726. }) : delete U[e2];
  22727. }
  22728. function M(e2, t2) {
  22729. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  22730. }
  22731. function q(e2, t2) {
  22732. return U[e2] && U[e2][t2] || [];
  22733. }
  22734. function F(e2) {
  22735. N("callObject", e2);
  22736. }
  22737. const K = L("_globalUniCloudListener"), j = "response", $ = "needLogin", B = "refreshToken", W = "clientdb", H = "cloudfunction", z = "cloudobject";
  22738. function J(e2) {
  22739. return K[e2] || (K[e2] = []), K[e2];
  22740. }
  22741. function G(e2, t2) {
  22742. const n2 = J(e2);
  22743. n2.includes(t2) || n2.push(t2);
  22744. }
  22745. function V(e2, t2) {
  22746. const n2 = J(e2), s2 = n2.indexOf(t2);
  22747. -1 !== s2 && n2.splice(s2, 1);
  22748. }
  22749. function Y(e2, t2) {
  22750. const n2 = J(e2);
  22751. for (let e3 = 0; e3 < n2.length; e3++) {
  22752. (0, n2[e3])(t2);
  22753. }
  22754. }
  22755. let Q, X = false;
  22756. function Z() {
  22757. return Q || (Q = new Promise((e2) => {
  22758. X && e2(), function t2() {
  22759. if ("function" == typeof getCurrentPages) {
  22760. const t3 = getCurrentPages();
  22761. t3 && t3[0] && (X = true, e2());
  22762. }
  22763. X || setTimeout(() => {
  22764. t2();
  22765. }, 30);
  22766. }();
  22767. }), Q);
  22768. }
  22769. function ee(e2) {
  22770. const t2 = {};
  22771. for (const n2 in e2) {
  22772. const s2 = e2[n2];
  22773. m(s2) && (t2[n2] = y(s2));
  22774. }
  22775. return t2;
  22776. }
  22777. class te extends Error {
  22778. constructor(e2) {
  22779. super(e2.message), this.errMsg = e2.message || e2.errMsg || "unknown system error", this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId;
  22780. }
  22781. toJson(e2 = 0) {
  22782. if (!(e2 >= 10))
  22783. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  22784. }
  22785. }
  22786. var ne = { request: (e2) => index$1.request(e2), uploadFile: (e2) => index$1.uploadFile(e2), setStorageSync: (e2, t2) => index$1.setStorageSync(e2, t2), getStorageSync: (e2) => index$1.getStorageSync(e2), removeStorageSync: (e2) => index$1.removeStorageSync(e2), clearStorageSync: () => index$1.clearStorageSync() };
  22787. function se(e2) {
  22788. return e2 && se(e2.__v_raw) || e2;
  22789. }
  22790. function re() {
  22791. return { token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"), tokenExpired: ne.getStorageSync("uni_id_token_expired") };
  22792. }
  22793. function ie({ token: e2, tokenExpired: t2 } = {}) {
  22794. e2 && ne.setStorageSync("uni_id_token", e2), t2 && ne.setStorageSync("uni_id_token_expired", t2);
  22795. }
  22796. let oe, ae;
  22797. function ce() {
  22798. return oe || (oe = index$1.getSystemInfoSync()), oe;
  22799. }
  22800. function ue() {
  22801. let e2, t2;
  22802. try {
  22803. if (index$1.getLaunchOptionsSync) {
  22804. if (index$1.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  22805. return;
  22806. const { scene: n2, channel: s2 } = index$1.getLaunchOptionsSync();
  22807. e2 = s2, t2 = n2;
  22808. }
  22809. } catch (e3) {
  22810. }
  22811. return { channel: e2, scene: t2 };
  22812. }
  22813. function he() {
  22814. const e2 = index$1.getLocale && index$1.getLocale() || "en";
  22815. if (ae)
  22816. return { ...ae, locale: e2, LOCALE: e2 };
  22817. const t2 = ce(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  22818. for (let e3 = 0; e3 < o2.length; e3++) {
  22819. delete t2[o2[e3]];
  22820. }
  22821. return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...ae, locale: e2, LOCALE: e2 };
  22822. }
  22823. var le = { sign: function(e2, t2) {
  22824. let n2 = "";
  22825. return Object.keys(e2).sort().forEach(function(t3) {
  22826. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  22827. }), n2 = n2.slice(1), i(n2, t2).toString();
  22828. }, wrappedRequest: function(e2, t2) {
  22829. return new Promise((n2, s2) => {
  22830. t2(Object.assign(e2, { complete(e3) {
  22831. e3 || (e3 = {});
  22832. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  22833. if (!e3.statusCode || e3.statusCode >= 400)
  22834. return s2(new te({ code: "SYS_ERR", message: e3.errMsg || "request:fail", requestId: t3 }));
  22835. const r2 = e3.data;
  22836. if (r2.error)
  22837. return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  22838. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  22839. } }));
  22840. });
  22841. }, toBase64: function(e2) {
  22842. return a.stringify(o.parse(e2));
  22843. } };
  22844. var de = class {
  22845. constructor(e2) {
  22846. ["spaceId", "clientSecret"].forEach((t2) => {
  22847. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  22848. throw new Error(`${t2} required`);
  22849. }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new v({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  22850. if (!e3.result || !e3.result.accessToken)
  22851. throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  22852. this.setAccessToken(e3.result.accessToken);
  22853. }), retryRule: w });
  22854. }
  22855. get hasAccessToken() {
  22856. return !!this.accessToken;
  22857. }
  22858. setAccessToken(e2) {
  22859. this.accessToken = e2;
  22860. }
  22861. requestWrapped(e2) {
  22862. return le.wrappedRequest(e2, this.adapter.request);
  22863. }
  22864. requestAuth(e2) {
  22865. return this.requestWrapped(e2);
  22866. }
  22867. request(e2, t2) {
  22868. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  22869. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  22870. }).then(() => this.getAccessToken()).then(() => {
  22871. const t4 = this.rebuildRequest(e2);
  22872. return this.request(t4, true);
  22873. })) : this.getAccessToken().then(() => {
  22874. const t3 = this.rebuildRequest(e2);
  22875. return this.request(t3, true);
  22876. }));
  22877. }
  22878. rebuildRequest(e2) {
  22879. const t2 = Object.assign({}, e2);
  22880. return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = le.sign(t2.data, this.config.clientSecret), t2;
  22881. }
  22882. setupRequest(e2, t2) {
  22883. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  22884. return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = le.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 };
  22885. }
  22886. getAccessToken() {
  22887. return this._getAccessTokenPromiseHub.exec();
  22888. }
  22889. async authorize() {
  22890. await this.getAccessToken();
  22891. }
  22892. callFunction(e2) {
  22893. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  22894. return this.request(this.setupRequest(t2));
  22895. }
  22896. getOSSUploadOptionsFromPath(e2) {
  22897. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  22898. return this.request(this.setupRequest(t2));
  22899. }
  22900. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  22901. return new Promise((o2, a2) => {
  22902. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  22903. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  22904. }, fail(e3) {
  22905. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  22906. } });
  22907. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  22908. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  22909. });
  22910. });
  22911. }
  22912. reportOSSUpload(e2) {
  22913. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  22914. return this.request(this.setupRequest(t2));
  22915. }
  22916. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  22917. if ("string" !== f(t2))
  22918. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  22919. if (!(t2 = t2.trim()))
  22920. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  22921. if (/:\/\//.test(t2))
  22922. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  22923. const o2 = i2 && i2.envType || this.config.envType;
  22924. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  22925. throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  22926. const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: h2, signature: l2, host: d2, ossPath: p2, id: g2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: h2, Signature: l2, host: d2, id: g2, key: p2, policy: m2, success_action_status: 200 };
  22927. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  22928. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  22929. _2.callback = le.toBase64(e3);
  22930. }
  22931. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  22932. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  22933. return { success: true, filePath: e2, fileID: c2 };
  22934. if ((await this.reportOSSUpload({ id: g2 })).success)
  22935. return { success: true, filePath: e2, fileID: c2 };
  22936. throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  22937. }
  22938. getTempFileURL({ fileList: e2 } = {}) {
  22939. return new Promise((t2, n2) => {
  22940. Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  22941. });
  22942. }
  22943. async getFileInfo({ fileList: e2 } = {}) {
  22944. if (!Array.isArray(e2) || 0 === e2.length)
  22945. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  22946. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  22947. return { fileList: (await this.request(this.setupRequest(t2))).result };
  22948. }
  22949. };
  22950. var pe = { init(e2) {
  22951. const t2 = new de(e2), n2 = { signInAnonymously: function() {
  22952. return t2.authorize();
  22953. }, getLoginState: function() {
  22954. return Promise.resolve(false);
  22955. } };
  22956. return t2.auth = function() {
  22957. return n2;
  22958. }, t2.customAuth = t2.auth, t2;
  22959. } };
  22960. const fe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  22961. var ge;
  22962. !function(e2) {
  22963. e2.local = "local", e2.none = "none", e2.session = "session";
  22964. }(ge || (ge = {}));
  22965. var me = function() {
  22966. }, ye = n(function(e2, t2) {
  22967. var n2;
  22968. e2.exports = (n2 = r, function(e3) {
  22969. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
  22970. !function() {
  22971. function t4(t5) {
  22972. for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
  22973. if (!(t5 % s4))
  22974. return false;
  22975. return true;
  22976. }
  22977. function n3(e4) {
  22978. return 4294967296 * (e4 - (0 | e4)) | 0;
  22979. }
  22980. for (var s3 = 2, r3 = 0; r3 < 64; )
  22981. t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
  22982. }();
  22983. var u2 = [], h2 = o2.SHA256 = i2.extend({ _doReset: function() {
  22984. this._hash = new r2.init(a2.slice(0));
  22985. }, _doProcessBlock: function(e4, t4) {
  22986. for (var n3 = this._hash.words, s3 = n3[0], r3 = n3[1], i3 = n3[2], o3 = n3[3], a3 = n3[4], h3 = n3[5], l2 = n3[6], d2 = n3[7], p2 = 0; p2 < 64; p2++) {
  22987. if (p2 < 16)
  22988. u2[p2] = 0 | e4[t4 + p2];
  22989. else {
  22990. var f2 = u2[p2 - 15], g2 = (f2 << 25 | f2 >>> 7) ^ (f2 << 14 | f2 >>> 18) ^ f2 >>> 3, m2 = u2[p2 - 2], y2 = (m2 << 15 | m2 >>> 17) ^ (m2 << 13 | m2 >>> 19) ^ m2 >>> 10;
  22991. u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
  22992. }
  22993. var _2 = s3 & r3 ^ s3 & i3 ^ r3 & i3, w2 = (s3 << 30 | s3 >>> 2) ^ (s3 << 19 | s3 >>> 13) ^ (s3 << 10 | s3 >>> 22), v2 = d2 + ((a3 << 26 | a3 >>> 6) ^ (a3 << 21 | a3 >>> 11) ^ (a3 << 7 | a3 >>> 25)) + (a3 & h3 ^ ~a3 & l2) + c2[p2] + u2[p2];
  22994. d2 = l2, l2 = h3, h3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
  22995. }
  22996. n3[0] = n3[0] + s3 | 0, n3[1] = n3[1] + r3 | 0, n3[2] = n3[2] + i3 | 0, n3[3] = n3[3] + o3 | 0, n3[4] = n3[4] + a3 | 0, n3[5] = n3[5] + h3 | 0, n3[6] = n3[6] + l2 | 0, n3[7] = n3[7] + d2 | 0;
  22997. }, _doFinalize: function() {
  22998. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  22999. return n3[r3 >>> 5] |= 128 << 24 - r3 % 32, n3[14 + (r3 + 64 >>> 9 << 4)] = e3.floor(s3 / 4294967296), n3[15 + (r3 + 64 >>> 9 << 4)] = s3, t4.sigBytes = 4 * n3.length, this._process(), this._hash;
  23000. }, clone: function() {
  23001. var e4 = i2.clone.call(this);
  23002. return e4._hash = this._hash.clone(), e4;
  23003. } });
  23004. t3.SHA256 = i2._createHelper(h2), t3.HmacSHA256 = i2._createHmacHelper(h2);
  23005. }(Math), n2.SHA256);
  23006. }), _e = ye, we = n(function(e2, t2) {
  23007. e2.exports = r.HmacSHA256;
  23008. });
  23009. const ve = () => {
  23010. let e2;
  23011. if (!Promise) {
  23012. e2 = () => {
  23013. }, e2.promise = {};
  23014. const t3 = () => {
  23015. throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  23016. };
  23017. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  23018. }
  23019. const t2 = new Promise((t3, n2) => {
  23020. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  23021. });
  23022. return e2.promise = t2, e2;
  23023. };
  23024. function Ie(e2) {
  23025. return void 0 === e2;
  23026. }
  23027. function Se(e2) {
  23028. return "[object Null]" === Object.prototype.toString.call(e2);
  23029. }
  23030. var be;
  23031. function ke(e2) {
  23032. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  23033. var n2;
  23034. for (const e3 of t2) {
  23035. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  23036. if (t3())
  23037. return { adapter: n3(), runtime: s2 };
  23038. }
  23039. }
  23040. !function(e2) {
  23041. e2.WEB = "web", e2.WX_MP = "wx_mp";
  23042. }(be || (be = {}));
  23043. const Ae = { adapter: null, runtime: void 0 }, Pe = ["anonymousUuidKey"];
  23044. class Te extends me {
  23045. constructor() {
  23046. super(), Ae.adapter.root.tcbObject || (Ae.adapter.root.tcbObject = {});
  23047. }
  23048. setItem(e2, t2) {
  23049. Ae.adapter.root.tcbObject[e2] = t2;
  23050. }
  23051. getItem(e2) {
  23052. return Ae.adapter.root.tcbObject[e2];
  23053. }
  23054. removeItem(e2) {
  23055. delete Ae.adapter.root.tcbObject[e2];
  23056. }
  23057. clear() {
  23058. delete Ae.adapter.root.tcbObject;
  23059. }
  23060. }
  23061. function Ce(e2, t2) {
  23062. switch (e2) {
  23063. case "local":
  23064. return t2.localStorage || new Te();
  23065. case "none":
  23066. return new Te();
  23067. default:
  23068. return t2.sessionStorage || new Te();
  23069. }
  23070. }
  23071. class xe {
  23072. constructor(e2) {
  23073. if (!this._storage) {
  23074. this._persistence = Ae.adapter.primaryStorage || e2.persistence, this._storage = Ce(this._persistence, Ae.adapter);
  23075. const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
  23076. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
  23077. }
  23078. }
  23079. updatePersistence(e2) {
  23080. if (e2 === this._persistence)
  23081. return;
  23082. const t2 = "local" === this._persistence;
  23083. this._persistence = e2;
  23084. const n2 = Ce(e2, Ae.adapter);
  23085. for (const e3 in this.keys) {
  23086. const s2 = this.keys[e3];
  23087. if (t2 && Pe.includes(e3))
  23088. continue;
  23089. const r2 = this._storage.getItem(s2);
  23090. Ie(r2) || Se(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  23091. }
  23092. this._storage = n2;
  23093. }
  23094. setStore(e2, t2, n2) {
  23095. if (!this._storage)
  23096. return;
  23097. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  23098. try {
  23099. this._storage.setItem(e2, r2);
  23100. } catch (e3) {
  23101. throw e3;
  23102. }
  23103. }
  23104. getStore(e2, t2) {
  23105. try {
  23106. if (!this._storage)
  23107. return;
  23108. } catch (e3) {
  23109. return "";
  23110. }
  23111. t2 = t2 || "localCachev1";
  23112. const n2 = this._storage.getItem(e2);
  23113. if (!n2)
  23114. return "";
  23115. if (n2.indexOf(t2) >= 0) {
  23116. return JSON.parse(n2).content;
  23117. }
  23118. return "";
  23119. }
  23120. removeStore(e2) {
  23121. this._storage.removeItem(e2);
  23122. }
  23123. }
  23124. const Oe = {}, Ee = {};
  23125. function Le(e2) {
  23126. return Oe[e2];
  23127. }
  23128. class Re {
  23129. constructor(e2, t2) {
  23130. this.data = t2 || null, this.name = e2;
  23131. }
  23132. }
  23133. class Ue extends Re {
  23134. constructor(e2, t2) {
  23135. super("error", { error: e2, data: t2 }), this.error = e2;
  23136. }
  23137. }
  23138. const Ne = new class {
  23139. constructor() {
  23140. this._listeners = {};
  23141. }
  23142. on(e2, t2) {
  23143. return function(e3, t3, n2) {
  23144. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  23145. }(e2, t2, this._listeners), this;
  23146. }
  23147. off(e2, t2) {
  23148. return function(e3, t3, n2) {
  23149. if (n2 && n2[e3]) {
  23150. const s2 = n2[e3].indexOf(t3);
  23151. -1 !== s2 && n2[e3].splice(s2, 1);
  23152. }
  23153. }(e2, t2, this._listeners), this;
  23154. }
  23155. fire(e2, t2) {
  23156. if (e2 instanceof Ue)
  23157. return console.error(e2.error), this;
  23158. const n2 = "string" == typeof e2 ? new Re(e2, t2 || {}) : e2;
  23159. const s2 = n2.name;
  23160. if (this._listens(s2)) {
  23161. n2.target = this;
  23162. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  23163. for (const t3 of e3)
  23164. t3.call(this, n2);
  23165. }
  23166. return this;
  23167. }
  23168. _listens(e2) {
  23169. return this._listeners[e2] && this._listeners[e2].length > 0;
  23170. }
  23171. }();
  23172. function De(e2, t2) {
  23173. Ne.on(e2, t2);
  23174. }
  23175. function Me(e2, t2 = {}) {
  23176. Ne.fire(e2, t2);
  23177. }
  23178. function qe(e2, t2) {
  23179. Ne.off(e2, t2);
  23180. }
  23181. const Fe = "loginStateChanged", Ke = "loginStateExpire", je = "loginTypeChanged", $e = "anonymousConverted", Be = "refreshAccessToken";
  23182. var We;
  23183. !function(e2) {
  23184. e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL";
  23185. }(We || (We = {}));
  23186. const He = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], ze = { "X-SDK-Version": "1.3.5" };
  23187. function Je(e2, t2, n2) {
  23188. const s2 = e2[t2];
  23189. e2[t2] = function(t3) {
  23190. const r2 = {}, i2 = {};
  23191. n2.forEach((n3) => {
  23192. const { data: s3, headers: o3 } = n3.call(e2, t3);
  23193. Object.assign(r2, s3), Object.assign(i2, o3);
  23194. });
  23195. const o2 = t3.data;
  23196. return o2 && (() => {
  23197. var e3;
  23198. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  23199. t3.data = { ...o2, ...r2 };
  23200. else
  23201. for (const e4 in r2)
  23202. o2.append(e4, r2[e4]);
  23203. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  23204. };
  23205. }
  23206. function Ge() {
  23207. const e2 = Math.random().toString(16).slice(2);
  23208. return { data: { seqId: e2 }, headers: { ...ze, "x-seqid": e2 } };
  23209. }
  23210. class Ve {
  23211. constructor(e2 = {}) {
  23212. var t2;
  23213. this.config = e2, this._reqClass = new Ae.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Le(this.config.env), this._localCache = (t2 = this.config.env, Ee[t2]), Je(this._reqClass, "post", [Ge]), Je(this._reqClass, "upload", [Ge]), Je(this._reqClass, "download", [Ge]);
  23214. }
  23215. async post(e2) {
  23216. return await this._reqClass.post(e2);
  23217. }
  23218. async upload(e2) {
  23219. return await this._reqClass.upload(e2);
  23220. }
  23221. async download(e2) {
  23222. return await this._reqClass.download(e2);
  23223. }
  23224. async refreshAccessToken() {
  23225. let e2, t2;
  23226. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  23227. try {
  23228. e2 = await this._refreshAccessTokenPromise;
  23229. } catch (e3) {
  23230. t2 = e3;
  23231. }
  23232. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  23233. throw t2;
  23234. return e2;
  23235. }
  23236. async _refreshAccessToken() {
  23237. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  23238. this._cache.removeStore(e2), this._cache.removeStore(t2);
  23239. let i2 = this._cache.getStore(n2);
  23240. if (!i2)
  23241. throw new te({ message: "未登录CloudBase" });
  23242. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  23243. if (a2.data.code) {
  23244. const { code: e3 } = a2.data;
  23245. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  23246. if (this._cache.getStore(s2) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  23247. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  23248. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  23249. }
  23250. Me(Ke), this._cache.removeStore(n2);
  23251. }
  23252. throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  23253. }
  23254. if (a2.data.access_token)
  23255. return Me(Be), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire };
  23256. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  23257. }
  23258. async getAccessToken() {
  23259. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  23260. if (!this._cache.getStore(n2))
  23261. throw new te({ message: "refresh token不存在,登录状态异常" });
  23262. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  23263. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  23264. }
  23265. async request(e2, t2, n2) {
  23266. const s2 = `x-tcb-trace_${this.config.env}`;
  23267. let r2 = "application/x-www-form-urlencoded";
  23268. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  23269. if (-1 === He.indexOf(e2)) {
  23270. const { refreshTokenKey: e3 } = this._cache.keys;
  23271. this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
  23272. }
  23273. let o2;
  23274. if ("storage.uploadFile" === e2) {
  23275. o2 = new FormData();
  23276. for (let e3 in o2)
  23277. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  23278. r2 = "multipart/form-data";
  23279. } else {
  23280. r2 = "application/json", o2 = {};
  23281. for (let e3 in i2)
  23282. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  23283. }
  23284. let a2 = { headers: { "content-type": r2 } };
  23285. n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  23286. const c2 = this._localCache.getStore(s2);
  23287. c2 && (a2.headers["X-TCB-Trace"] = c2);
  23288. const { parse: u2, inQuery: h2, search: l2 } = t2;
  23289. let d2 = { env: this.config.env };
  23290. u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
  23291. let p2 = function(e3, t3, n3 = {}) {
  23292. const s3 = /\?/.test(t3);
  23293. let r3 = "";
  23294. for (let e4 in n3)
  23295. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  23296. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  23297. }(fe, "//tcb-api.tencentcloudapi.com/web", d2);
  23298. l2 && (p2 += l2);
  23299. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  23300. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  23301. throw new te({ code: "NETWORK_ERROR", message: "network request error" });
  23302. return f2;
  23303. }
  23304. async send(e2, t2 = {}) {
  23305. const n2 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  23306. if ("ACCESS_TOKEN_EXPIRED" === n2.data.code && -1 === He.indexOf(e2)) {
  23307. await this.refreshAccessToken();
  23308. const n3 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  23309. if (n3.data.code)
  23310. throw new te({ code: n3.data.code, message: n3.data.message });
  23311. return n3.data;
  23312. }
  23313. if (n2.data.code)
  23314. throw new te({ code: n2.data.code, message: n2.data.message });
  23315. return n2.data;
  23316. }
  23317. setRefreshToken(e2) {
  23318. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  23319. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  23320. }
  23321. }
  23322. const Ye = {};
  23323. function Qe(e2) {
  23324. return Ye[e2];
  23325. }
  23326. class Xe {
  23327. constructor(e2) {
  23328. this.config = e2, this._cache = Le(e2.env), this._request = Qe(e2.env);
  23329. }
  23330. setRefreshToken(e2) {
  23331. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  23332. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  23333. }
  23334. setAccessToken(e2, t2) {
  23335. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  23336. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  23337. }
  23338. async refreshUserInfo() {
  23339. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  23340. return this.setLocalUserInfo(e2), e2;
  23341. }
  23342. setLocalUserInfo(e2) {
  23343. const { userInfoKey: t2 } = this._cache.keys;
  23344. this._cache.setStore(t2, e2);
  23345. }
  23346. }
  23347. class Ze {
  23348. constructor(e2) {
  23349. if (!e2)
  23350. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  23351. this._envId = e2, this._cache = Le(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  23352. }
  23353. linkWithTicket(e2) {
  23354. if ("string" != typeof e2)
  23355. throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
  23356. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  23357. }
  23358. linkWithRedirect(e2) {
  23359. e2.signInWithRedirect();
  23360. }
  23361. updatePassword(e2, t2) {
  23362. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  23363. }
  23364. updateEmail(e2) {
  23365. return this._request.send("auth.updateEmail", { newEmail: e2 });
  23366. }
  23367. updateUsername(e2) {
  23368. if ("string" != typeof e2)
  23369. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  23370. return this._request.send("auth.updateUsername", { username: e2 });
  23371. }
  23372. async getLinkedUidList() {
  23373. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  23374. let t2 = false;
  23375. const { users: n2 } = e2;
  23376. return n2.forEach((e3) => {
  23377. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  23378. }), { users: n2, hasPrimaryUid: t2 };
  23379. }
  23380. setPrimaryUid(e2) {
  23381. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  23382. }
  23383. unlink(e2) {
  23384. return this._request.send("auth.unlink", { platform: e2 });
  23385. }
  23386. async update(e2) {
  23387. const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 });
  23388. this.setLocalUserInfo(a2);
  23389. }
  23390. async refresh() {
  23391. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  23392. return this.setLocalUserInfo(e2), e2;
  23393. }
  23394. setUserInfo() {
  23395. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  23396. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  23397. this[e3] = t2[e3];
  23398. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  23399. }
  23400. setLocalUserInfo(e2) {
  23401. const { userInfoKey: t2 } = this._cache.keys;
  23402. this._cache.setStore(t2, e2), this.setUserInfo();
  23403. }
  23404. }
  23405. class et {
  23406. constructor(e2) {
  23407. if (!e2)
  23408. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  23409. this._cache = Le(e2);
  23410. const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2);
  23411. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new Ze(e2);
  23412. }
  23413. get isAnonymousAuth() {
  23414. return this.loginType === We.ANONYMOUS;
  23415. }
  23416. get isCustomAuth() {
  23417. return this.loginType === We.CUSTOM;
  23418. }
  23419. get isWeixinAuth() {
  23420. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  23421. }
  23422. get loginType() {
  23423. return this._cache.getStore(this._cache.keys.loginTypeKey);
  23424. }
  23425. }
  23426. let tt$1 = class tt2 extends Xe {
  23427. async signIn() {
  23428. this._cache.updatePersistence("local");
  23429. const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
  23430. if (r2.uuid && r2.refresh_token) {
  23431. this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), Me(Fe), Me(je, { env: this.config.env, loginType: We.ANONYMOUS, persistence: "local" });
  23432. const e3 = new et(this.config.env);
  23433. return await e3.user.refresh(), e3;
  23434. }
  23435. throw new te({ message: "匿名登录失败" });
  23436. }
  23437. async linkAndRetrieveDataWithTicket(e2) {
  23438. const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 });
  23439. if (i2.refresh_token)
  23440. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), Me($e, { env: this.config.env }), Me(je, { loginType: We.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  23441. throw new te({ message: "匿名转化失败" });
  23442. }
  23443. _setAnonymousUUID(e2) {
  23444. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  23445. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, We.ANONYMOUS);
  23446. }
  23447. _clearAnonymousUUID() {
  23448. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  23449. }
  23450. };
  23451. class nt extends Xe {
  23452. async signIn(e2) {
  23453. if ("string" != typeof e2)
  23454. throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
  23455. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  23456. if (n2.refresh_token)
  23457. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), Me(Fe), Me(je, { env: this.config.env, loginType: We.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new et(this.config.env);
  23458. throw new te({ message: "自定义登录失败" });
  23459. }
  23460. }
  23461. class st extends Xe {
  23462. async signIn(e2, t2) {
  23463. if ("string" != typeof e2)
  23464. throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
  23465. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2;
  23466. if (r2)
  23467. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Me(Fe), Me(je, { env: this.config.env, loginType: We.EMAIL, persistence: this.config.persistence }), new et(this.config.env);
  23468. throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
  23469. }
  23470. async activate(e2) {
  23471. return this._request.send("auth.activateEndUserMail", { token: e2 });
  23472. }
  23473. async resetPasswordWithToken(e2, t2) {
  23474. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  23475. }
  23476. }
  23477. class rt extends Xe {
  23478. async signIn(e2, t2) {
  23479. if ("string" != typeof e2)
  23480. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  23481. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  23482. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: We.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  23483. if (r2)
  23484. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Me(Fe), Me(je, { env: this.config.env, loginType: We.USERNAME, persistence: this.config.persistence }), new et(this.config.env);
  23485. throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
  23486. }
  23487. }
  23488. class it {
  23489. constructor(e2) {
  23490. this.config = e2, this._cache = Le(e2.env), this._request = Qe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  23491. }
  23492. get currentUser() {
  23493. const e2 = this.hasLoginState();
  23494. return e2 && e2.user || null;
  23495. }
  23496. get loginType() {
  23497. return this._cache.getStore(this._cache.keys.loginTypeKey);
  23498. }
  23499. anonymousAuthProvider() {
  23500. return new tt$1(this.config);
  23501. }
  23502. customAuthProvider() {
  23503. return new nt(this.config);
  23504. }
  23505. emailAuthProvider() {
  23506. return new st(this.config);
  23507. }
  23508. usernameAuthProvider() {
  23509. return new rt(this.config);
  23510. }
  23511. async signInAnonymously() {
  23512. return new tt$1(this.config).signIn();
  23513. }
  23514. async signInWithEmailAndPassword(e2, t2) {
  23515. return new st(this.config).signIn(e2, t2);
  23516. }
  23517. signInWithUsernameAndPassword(e2, t2) {
  23518. return new rt(this.config).signIn(e2, t2);
  23519. }
  23520. async linkAndRetrieveDataWithTicket(e2) {
  23521. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt$1(this.config)), De($e, this._onAnonymousConverted);
  23522. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  23523. }
  23524. async signOut() {
  23525. if (this.loginType === We.ANONYMOUS)
  23526. throw new te({ message: "匿名用户不支持登出操作" });
  23527. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  23528. if (!s2)
  23529. return;
  23530. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  23531. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), Me(Fe), Me(je, { env: this.config.env, loginType: We.NULL, persistence: this.config.persistence }), r2;
  23532. }
  23533. async signUpWithEmailAndPassword(e2, t2) {
  23534. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  23535. }
  23536. async sendPasswordResetEmail(e2) {
  23537. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  23538. }
  23539. onLoginStateChanged(e2) {
  23540. De(Fe, () => {
  23541. const t3 = this.hasLoginState();
  23542. e2.call(this, t3);
  23543. });
  23544. const t2 = this.hasLoginState();
  23545. e2.call(this, t2);
  23546. }
  23547. onLoginStateExpired(e2) {
  23548. De(Ke, e2.bind(this));
  23549. }
  23550. onAccessTokenRefreshed(e2) {
  23551. De(Be, e2.bind(this));
  23552. }
  23553. onAnonymousConverted(e2) {
  23554. De($e, e2.bind(this));
  23555. }
  23556. onLoginTypeChanged(e2) {
  23557. De(je, () => {
  23558. const t2 = this.hasLoginState();
  23559. e2.call(this, t2);
  23560. });
  23561. }
  23562. async getAccessToken() {
  23563. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  23564. }
  23565. hasLoginState() {
  23566. const { refreshTokenKey: e2 } = this._cache.keys;
  23567. return this._cache.getStore(e2) ? new et(this.config.env) : null;
  23568. }
  23569. async isUsernameRegistered(e2) {
  23570. if ("string" != typeof e2)
  23571. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  23572. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  23573. return t2 && t2.isRegistered;
  23574. }
  23575. getLoginState() {
  23576. return Promise.resolve(this.hasLoginState());
  23577. }
  23578. async signInWithTicket(e2) {
  23579. return new nt(this.config).signIn(e2);
  23580. }
  23581. shouldRefreshAccessToken(e2) {
  23582. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  23583. }
  23584. getUserInfo() {
  23585. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  23586. }
  23587. getAuthHeader() {
  23588. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  23589. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  23590. }
  23591. _onAnonymousConverted(e2) {
  23592. const { env: t2 } = e2.data;
  23593. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  23594. }
  23595. _onLoginTypeChanged(e2) {
  23596. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  23597. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  23598. }
  23599. }
  23600. const ot = function(e2, t2) {
  23601. t2 = t2 || ve();
  23602. const n2 = Qe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  23603. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  23604. const { data: { url: a2, authorization: c2, token: u2, fileId: h2, cosFileId: l2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": l2, success_action_status: "201", "x-cos-security-token": u2 };
  23605. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  23606. 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  23607. }).catch((e4) => {
  23608. t2(e4);
  23609. });
  23610. }).catch((e3) => {
  23611. t2(e3);
  23612. }), t2.promise;
  23613. }, at = function(e2, t2) {
  23614. t2 = t2 || ve();
  23615. const n2 = Qe(this.config.env), { cloudPath: s2 } = e2;
  23616. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  23617. t2(null, e3);
  23618. }).catch((e3) => {
  23619. t2(e3);
  23620. }), t2.promise;
  23621. }, ct = function({ fileList: e2 }, t2) {
  23622. if (t2 = t2 || ve(), !e2 || !Array.isArray(e2))
  23623. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  23624. for (let t3 of e2)
  23625. if (!t3 || "string" != typeof t3)
  23626. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  23627. const n2 = { fileid_list: e2 };
  23628. return Qe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  23629. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  23630. }).catch((e3) => {
  23631. t2(e3);
  23632. }), t2.promise;
  23633. }, ut = function({ fileList: e2 }, t2) {
  23634. t2 = t2 || ve(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  23635. let n2 = [];
  23636. for (let s3 of e2)
  23637. "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });
  23638. const s2 = { file_list: n2 };
  23639. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  23640. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  23641. }).catch((e3) => {
  23642. t2(e3);
  23643. }), t2.promise;
  23644. }, ht = async function({ fileID: e2 }, t2) {
  23645. const n2 = (await ut.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  23646. if ("SUCCESS" !== n2.code)
  23647. return t2 ? t2(n2) : new Promise((e3) => {
  23648. e3(n2);
  23649. });
  23650. const s2 = Qe(this.config.env);
  23651. let r2 = n2.download_url;
  23652. if (r2 = encodeURI(r2), !t2)
  23653. return s2.download({ url: r2 });
  23654. t2(await s2.download({ url: r2 }));
  23655. }, lt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2 }, i2) {
  23656. const o2 = i2 || ve();
  23657. let a2;
  23658. try {
  23659. a2 = t2 ? JSON.stringify(t2) : "";
  23660. } catch (e3) {
  23661. return Promise.reject(e3);
  23662. }
  23663. if (!e2)
  23664. return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  23665. const c2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: a2 };
  23666. return Qe(this.config.env).send("functions.invokeFunction", c2).then((e3) => {
  23667. if (e3.code)
  23668. o2(null, e3);
  23669. else {
  23670. let t3 = e3.data.response_data;
  23671. if (s2)
  23672. o2(null, { result: t3, requestId: e3.requestId });
  23673. else
  23674. try {
  23675. t3 = JSON.parse(e3.data.response_data), o2(null, { result: t3, requestId: e3.requestId });
  23676. } catch (e4) {
  23677. o2(new te({ message: "response data must be json" }));
  23678. }
  23679. }
  23680. return o2.promise;
  23681. }).catch((e3) => {
  23682. o2(e3);
  23683. }), o2.promise;
  23684. }, dt = { timeout: 15e3, persistence: "session" }, pt = {};
  23685. class ft {
  23686. constructor(e2) {
  23687. this.config = e2 || this.config, this.authObj = void 0;
  23688. }
  23689. init(e2) {
  23690. switch (Ae.adapter || (this.requestClient = new Ae.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...dt, ...e2 }, true) {
  23691. case this.config.timeout > 6e5:
  23692. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  23693. break;
  23694. case this.config.timeout < 100:
  23695. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  23696. }
  23697. return new ft(this.config);
  23698. }
  23699. auth({ persistence: e2 } = {}) {
  23700. if (this.authObj)
  23701. return this.authObj;
  23702. const t2 = e2 || Ae.adapter.primaryStorage || dt.persistence;
  23703. var n2;
  23704. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  23705. const { env: t3 } = e3;
  23706. Oe[t3] = new xe(e3), Ee[t3] = new xe({ ...e3, persistence: "local" });
  23707. }(this.config), n2 = this.config, Ye[n2.env] = new Ve(n2), this.authObj = new it(this.config), this.authObj;
  23708. }
  23709. on(e2, t2) {
  23710. return De.apply(this, [e2, t2]);
  23711. }
  23712. off(e2, t2) {
  23713. return qe.apply(this, [e2, t2]);
  23714. }
  23715. callFunction(e2, t2) {
  23716. return lt.apply(this, [e2, t2]);
  23717. }
  23718. deleteFile(e2, t2) {
  23719. return ct.apply(this, [e2, t2]);
  23720. }
  23721. getTempFileURL(e2, t2) {
  23722. return ut.apply(this, [e2, t2]);
  23723. }
  23724. downloadFile(e2, t2) {
  23725. return ht.apply(this, [e2, t2]);
  23726. }
  23727. uploadFile(e2, t2) {
  23728. return ot.apply(this, [e2, t2]);
  23729. }
  23730. getUploadMetadata(e2, t2) {
  23731. return at.apply(this, [e2, t2]);
  23732. }
  23733. registerExtension(e2) {
  23734. pt[e2.name] = e2;
  23735. }
  23736. async invokeExtension(e2, t2) {
  23737. const n2 = pt[e2];
  23738. if (!n2)
  23739. throw new te({ message: `扩展${e2} 必须先注册` });
  23740. return await n2.invoke(t2, this);
  23741. }
  23742. useAdapters(e2) {
  23743. const { adapter: t2, runtime: n2 } = ke(e2) || {};
  23744. t2 && (Ae.adapter = t2), n2 && (Ae.runtime = n2);
  23745. }
  23746. }
  23747. var gt = new ft();
  23748. function mt(e2, t2, n2) {
  23749. void 0 === n2 && (n2 = {});
  23750. var s2 = /\?/.test(t2), r2 = "";
  23751. for (var i2 in n2)
  23752. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  23753. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  23754. }
  23755. class yt {
  23756. post(e2) {
  23757. const { url: t2, data: n2, headers: s2 } = e2;
  23758. return new Promise((e3, r2) => {
  23759. ne.request({ url: mt("https:", t2), data: n2, method: "POST", header: s2, success(t3) {
  23760. e3(t3);
  23761. }, fail(e4) {
  23762. r2(e4);
  23763. } });
  23764. });
  23765. }
  23766. upload(e2) {
  23767. return new Promise((t2, n2) => {
  23768. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ne.uploadFile({ url: mt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  23769. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  23770. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  23771. }, fail(e3) {
  23772. n2(new Error(e3.errMsg || "uploadFile:fail"));
  23773. } });
  23774. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  23775. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  23776. });
  23777. });
  23778. }
  23779. }
  23780. const _t = { setItem(e2, t2) {
  23781. ne.setStorageSync(e2, t2);
  23782. }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
  23783. ne.removeStorageSync(e2);
  23784. }, clear() {
  23785. ne.clearStorageSync();
  23786. } };
  23787. var wt = { genAdapter: function() {
  23788. return { root: {}, reqClass: yt, localStorage: _t, primaryStorage: "local" };
  23789. }, isMatch: function() {
  23790. return true;
  23791. }, runtime: "uni_app" };
  23792. gt.useAdapters(wt);
  23793. const vt = gt, It = vt.init;
  23794. vt.init = function(e2) {
  23795. e2.env = e2.spaceId;
  23796. const t2 = It.call(this, e2);
  23797. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  23798. const n2 = t2.auth;
  23799. return t2.auth = function(e3) {
  23800. const t3 = n2.call(this, e3);
  23801. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  23802. var n3;
  23803. t3[e4] = (n3 = t3[e4], function(e5) {
  23804. e5 = e5 || {};
  23805. const { success: t4, fail: s2, complete: r2 } = ee(e5);
  23806. if (!(t4 || s2 || r2))
  23807. return n3.call(this, e5);
  23808. n3.call(this, e5).then((e6) => {
  23809. t4 && t4(e6), r2 && r2(e6);
  23810. }, (e6) => {
  23811. s2 && s2(e6), r2 && r2(e6);
  23812. });
  23813. }).bind(t3);
  23814. }), t3;
  23815. }, t2.customAuth = t2.auth, t2;
  23816. };
  23817. var St = vt;
  23818. var bt = class extends de {
  23819. getAccessToken() {
  23820. return new Promise((e2, t2) => {
  23821. const n2 = "Anonymous_Access_token";
  23822. this.setAccessToken(n2), e2(n2);
  23823. });
  23824. }
  23825. setupRequest(e2, t2) {
  23826. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  23827. "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = le.sign(n2, this.config.clientSecret);
  23828. const r2 = he();
  23829. s2["x-client-info"] = encodeURIComponent(JSON.stringify(r2));
  23830. const { token: i2 } = re();
  23831. return s2["x-client-token"] = i2, { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: JSON.parse(JSON.stringify(s2)) };
  23832. }
  23833. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  23834. return new Promise((o2, a2) => {
  23835. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, success(e3) {
  23836. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  23837. }, fail(e3) {
  23838. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  23839. } });
  23840. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  23841. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  23842. });
  23843. });
  23844. }
  23845. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  23846. if (!t2)
  23847. throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  23848. let r2;
  23849. return this.getOSSUploadOptionsFromPath({ cloudPath: t2 }).then((t3) => {
  23850. const { url: i2, formData: o2, name: a2 } = t3.result;
  23851. r2 = t3.result.fileUrl;
  23852. const c2 = { url: i2, formData: o2, name: a2, filePath: e2, fileType: n2 };
  23853. return this.uploadFileToOSS(Object.assign({}, c2, { onUploadProgress: s2 }));
  23854. }).then(() => this.reportOSSUpload({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  23855. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  23856. }));
  23857. }
  23858. deleteFile({ fileList: e2 }) {
  23859. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  23860. return this.request(this.setupRequest(t2)).then((e3) => {
  23861. if (e3.success)
  23862. return e3.result;
  23863. throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  23864. });
  23865. }
  23866. getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
  23867. if (!Array.isArray(e2) || 0 === e2.length)
  23868. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  23869. const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
  23870. return this.request(this.setupRequest(n2)).then((e3) => {
  23871. if (e3.success)
  23872. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  23873. throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  23874. });
  23875. }
  23876. };
  23877. var kt = { init(e2) {
  23878. const t2 = new bt(e2), n2 = { signInAnonymously: function() {
  23879. return t2.authorize();
  23880. }, getLoginState: function() {
  23881. return Promise.resolve(false);
  23882. } };
  23883. return t2.auth = function() {
  23884. return n2;
  23885. }, t2.customAuth = t2.auth, t2;
  23886. } }, At = n(function(e2, t2) {
  23887. e2.exports = r.enc.Hex;
  23888. });
  23889. function Pt(e2 = "", t2 = {}) {
  23890. const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = Date.now(), u2 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e3) {
  23891. var t3 = 16 * Math.random() | 0;
  23892. return ("x" === e3 ? t3 : 3 & t3 | 8).toString(16);
  23893. }), h2 = Object.assign({}, i2, { "x-from-app-id": a2.spaceAppId, "x-from-env-id": a2.spaceId, "x-to-env-id": a2.spaceId, "x-from-instance-id": c2, "x-from-function-name": s2, "x-client-timestamp": c2, "x-alipay-source": "client", "x-request-id": u2, "x-alipay-callid": u2, "x-trace-id": u2 }), l2 = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o2), [d2 = "", p2 = ""] = e2.split("?") || [], f2 = function(e3) {
  23894. const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
  23895. `).join(""), s3 = _e(e3.body).toString(At), r3 = `${e3.method.toUpperCase()}
  23896. ${e3.path}
  23897. ${e3.query}
  23898. ${n3}
  23899. ${t3}
  23900. ${s3}
  23901. `, i3 = _e(r3).toString(At), o3 = `HMAC-SHA256
  23902. ${e3.timestamp}
  23903. ${i3}
  23904. `, a3 = we(o3, e3.secretKey).toString(At);
  23905. return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`;
  23906. }({ path: d2, query: p2, method: r2, headers: h2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: l2.sort() });
  23907. return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, h2, { Authorization: f2 }) };
  23908. }
  23909. function Tt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {} }) {
  23910. return new Promise((r2, i2) => {
  23911. ne.request({ url: e2, method: n2, data: t2, header: s2, dataType: "json", complete: (e3 = {}) => {
  23912. const t3 = s2["x-trace-id"] || "";
  23913. if (!e3.statusCode || e3.statusCode >= 400) {
  23914. const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
  23915. return i2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
  23916. }
  23917. r2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
  23918. } });
  23919. });
  23920. }
  23921. function Ct(e2, t2) {
  23922. const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = Pt(n2, { functionName: "", data: s2, method: r2, headers: { "x-alipay-cloud-mode": "oss", "x-data-api-type": "oss", "x-expire-timestamp": Date.now() + 6e4 }, signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"], config: t2 });
  23923. return Tt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
  23924. const t3 = e3.data || {};
  23925. if (!t3.success)
  23926. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  23927. return t3.data || {};
  23928. }).catch((e3) => {
  23929. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  23930. });
  23931. }
  23932. function xt(e2 = "") {
  23933. const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
  23934. if (n2 <= 0)
  23935. throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
  23936. const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
  23937. return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
  23938. }
  23939. function Ot(e2 = "") {
  23940. return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
  23941. }
  23942. var Et = class {
  23943. constructor(e2) {
  23944. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
  23945. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  23946. throw new Error(`${t2} required`);
  23947. }), e2.endpoint) {
  23948. if ("string" != typeof e2.endpoint)
  23949. throw new Error("endpoint must be string");
  23950. if (!/^https:\/\//.test(e2.endpoint))
  23951. throw new Error("endpoint must start with https://");
  23952. e2.endpoint = e2.endpoint.replace(/\/$/, "");
  23953. }
  23954. this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn` });
  23955. }
  23956. callFunction(e2) {
  23957. return function(e3, t2) {
  23958. const { name: n2, data: s2 } = e3, r2 = "POST", { url: i2, headers: o2 } = Pt("/functions/invokeFunction", { functionName: n2, data: s2, method: r2, headers: { "x-to-function-name": n2 }, signHeaderKeys: ["x-to-function-name"], config: t2 });
  23959. return Tt({ url: i2, data: s2, method: r2, headers: o2 }).then((e4) => ({ errCode: 0, success: true, requestId: e4.requestId, result: e4.data })).catch((e4) => {
  23960. throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
  23961. });
  23962. }(e2, this.config);
  23963. }
  23964. uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
  23965. return new Promise((i2, o2) => {
  23966. const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
  23967. e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  23968. }, fail(e3) {
  23969. o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  23970. } });
  23971. "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
  23972. r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  23973. });
  23974. });
  23975. }
  23976. async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
  23977. if ("string" !== f(t2))
  23978. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  23979. if (!(t2 = t2.trim()))
  23980. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  23981. if (/:\/\//.test(t2))
  23982. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  23983. const r2 = await Ct({ path: "/".concat(t2.replace(/^\//, ""), "?post_url") }, this.config), { file_id: i2, upload_url: o2, form_data: a2 } = r2, c2 = a2 && a2.reduce((e3, t3) => (e3[t3.key] = t3.value, e3), {});
  23984. return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
  23985. }
  23986. async getTempFileURL({ fileList: e2 }) {
  23987. return new Promise((t2, n2) => {
  23988. (!e2 || e2.length < 0) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList不能为空数组" })), e2.length > 50 && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList数组长度不能超过50" }));
  23989. const s2 = [];
  23990. for (const t3 of e2) {
  23991. "string" !== f(t3) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList的元素必须是非空的字符串" }));
  23992. const e3 = xt.call(this, t3);
  23993. s2.push({ file_id: e3, expire: 600 });
  23994. }
  23995. Ct({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
  23996. const { file_list: n3 = [] } = e3;
  23997. t2({ fileList: n3.map((e4) => ({ fileID: Ot.call(this, e4.file_id), tempFileURL: e4.download_url })) });
  23998. }).catch((e3) => n2(e3));
  23999. });
  24000. }
  24001. };
  24002. var Lt = { init: (e2) => {
  24003. e2.provider = "alipay";
  24004. const t2 = new Et(e2);
  24005. return t2.auth = function() {
  24006. return { signInAnonymously: function() {
  24007. return Promise.resolve();
  24008. }, getLoginState: function() {
  24009. return Promise.resolve(true);
  24010. } };
  24011. }, t2;
  24012. } };
  24013. function Rt({ data: e2 }) {
  24014. let t2;
  24015. t2 = he();
  24016. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  24017. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  24018. const { token: e3 } = re();
  24019. e3 && (n2.uniIdToken = e3);
  24020. }
  24021. return n2;
  24022. }
  24023. async function Ut({ name: e2, data: t2 } = {}) {
  24024. await this.__dev__.initLocalNetwork();
  24025. const { localAddress: n2, localPort: s2 } = this.__dev__, r2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay" }[this.config.provider], i2 = this.config.spaceId, o2 = `http://${n2}:${s2}/system/check-function`, a2 = `http://${n2}:${s2}/cloudfunctions/${e2}`;
  24026. return new Promise((t3, n3) => {
  24027. ne.request({ method: "POST", url: o2, data: { name: e2, platform: P, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) {
  24028. t3(e3);
  24029. }, fail() {
  24030. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  24031. } });
  24032. }).then(({ data: e3 } = {}) => {
  24033. const { code: t3, message: n3 } = e3 || {};
  24034. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  24035. }).then(({ code: n3, message: s3 }) => {
  24036. if (0 !== n3) {
  24037. switch (n3) {
  24038. case "MODULE_ENCRYPTED":
  24039. console.error(`此云函数(${e2})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  24040. break;
  24041. case "FUNCTION_ENCRYPTED":
  24042. console.error(`此云函数(${e2})已加密不可本地调试,自动切换为云端已部署的云函数`);
  24043. break;
  24044. case "ACTION_ENCRYPTED":
  24045. console.error(s3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  24046. break;
  24047. case "NETWORK_ERROR": {
  24048. const e3 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  24049. throw console.error(e3), new Error(e3);
  24050. }
  24051. case "SWITCH_TO_CLOUD":
  24052. break;
  24053. default: {
  24054. const e3 = `检测本地调试服务出现错误:${s3},请检查网络环境或重启客户端再试`;
  24055. throw console.error(e3), new Error(e3);
  24056. }
  24057. }
  24058. return this._callCloudFunction({ name: e2, data: t2 });
  24059. }
  24060. return new Promise((e3, n4) => {
  24061. const s4 = Rt.call(this, { data: t2 });
  24062. ne.request({ method: "POST", url: a2, data: { provider: r2, platform: P, param: s4 }, success: ({ statusCode: t3, data: s5 } = {}) => !t3 || t3 >= 400 ? n4(new te({ code: s5.code || "SYS_ERR", message: s5.message || "request:fail" })) : e3({ result: s5 }), fail(e4) {
  24063. n4(new te({ code: e4.code || e4.errCode || "SYS_ERR", message: e4.message || e4.errMsg || "request:fail" }));
  24064. } });
  24065. });
  24066. });
  24067. }
  24068. const Nt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  24069. var Dt = /[\\^$.*+?()[\]{}|]/g, Mt = RegExp(Dt.source);
  24070. function qt(e2, t2, n2) {
  24071. return e2.replace(new RegExp((s2 = t2) && Mt.test(s2) ? s2.replace(Dt, "\\$&") : s2, "g"), n2);
  24072. var s2;
  24073. }
  24074. const Kt = "request", jt = "response", $t = "both";
  24075. const An = { code: 2e4, message: "System error" }, Pn = { code: 20101, message: "Invalid client" };
  24076. function xn(e2) {
  24077. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  24078. return new te({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || An.code, message: r2 || o2, cause: a2 });
  24079. }
  24080. let En;
  24081. function Dn({ secretType: e2 } = {}) {
  24082. return e2 === Kt || e2 === jt || e2 === $t;
  24083. }
  24084. function Mn({ name: e2, data: t2 = {} } = {}) {
  24085. return "app" === P;
  24086. }
  24087. function qn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  24088. const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
  24089. let o2 = r2;
  24090. "app" === r2 && (o2 = i2);
  24091. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  24092. const n3 = A;
  24093. if (!n3)
  24094. return {};
  24095. e3 = function(e4) {
  24096. return "tencent" === e4 ? "tcb" : e4;
  24097. }(e3);
  24098. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  24099. return s3 && s3.config;
  24100. }({ provider: e2, spaceId: t2 });
  24101. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  24102. return false;
  24103. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  24104. if (0 === u2.length)
  24105. return true;
  24106. const h2 = function(e3, t3) {
  24107. let n3, s3, r3;
  24108. for (let i3 = 0; i3 < e3.length; i3++) {
  24109. const o3 = e3[i3];
  24110. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  24111. }
  24112. return n3 || s3 || r3;
  24113. }(u2, n2);
  24114. if (!h2)
  24115. return false;
  24116. if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  24117. return true;
  24118. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), xn(Pn);
  24119. }
  24120. function Fn({ functionName: e2, result: t2, logPvd: n2 }) {
  24121. if (this.__dev__.debugLog && t2 && t2.requestId) {
  24122. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  24123. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  24124. }
  24125. }
  24126. function Kn(e2) {
  24127. const t2 = e2.callFunction, n2 = function(n3) {
  24128. const s2 = n3.name;
  24129. n3.data = Rt.call(e2, { data: n3.data });
  24130. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay" }[this.config.provider], i2 = Dn(n3), o2 = Mn(n3), a2 = i2 || o2;
  24131. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && Fn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && Fn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  24132. for (let s3 = 0; s3 < n4.length; s3++) {
  24133. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  24134. if (!a3)
  24135. continue;
  24136. let c2 = i3;
  24137. for (let e5 = 1; e5 < a3.length; e5++)
  24138. c2 = qt(c2, `{$${e5}}`, a3[e5]);
  24139. for (const e5 in t3)
  24140. c2 = qt(c2, `{${e5}}`, t3[e5]);
  24141. return "replace" === o3 ? c2 : e4 + c2;
  24142. }
  24143. return e4;
  24144. }({ message: `[${n3.name}]: ${e3.message}`, formatter: Nt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  24145. };
  24146. e2.callFunction = function(t3) {
  24147. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  24148. let o2, a2;
  24149. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && C ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Ut), o2 = Ut) : o2 = n2, o2 = o2.bind(e2), Mn(t3))
  24150. ;
  24151. else if (function({ name: e3, data: t4 = {} }) {
  24152. return "uni-id-co" === e3 && "secureNetworkHandshakeByWeixin" === t4.method;
  24153. }(t3))
  24154. a2 = o2.call(e2, t3);
  24155. else if (Dn(t3)) {
  24156. a2 = new En({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  24157. } else if (qn({ provider: s2, spaceId: r2, functionName: i2 })) {
  24158. a2 = new En({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  24159. } else
  24160. a2 = o2(t3);
  24161. return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2.then((e3) => ("undefined" != typeof UTSJSONObject && (e3.result = new UTSJSONObject(e3.result)), e3));
  24162. };
  24163. }
  24164. En = class {
  24165. constructor() {
  24166. throw xn({ message: `Platform ${P} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  24167. }
  24168. };
  24169. const jn = Symbol("CLIENT_DB_INTERNAL");
  24170. function $n(e2, t2) {
  24171. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = jn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  24172. if ("_uniClient" === n2)
  24173. return null;
  24174. if ("symbol" == typeof n2)
  24175. return e3[n2];
  24176. if (n2 in e3 || "string" != typeof n2) {
  24177. const t3 = e3[n2];
  24178. return "function" == typeof t3 ? t3.bind(e3) : t3;
  24179. }
  24180. return t2.get(e3, n2, s2);
  24181. } });
  24182. }
  24183. function Bn(e2) {
  24184. return { on: (t2, n2) => {
  24185. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  24186. }, off: (t2, n2) => {
  24187. e2[t2] = e2[t2] || [];
  24188. const s2 = e2[t2].indexOf(n2);
  24189. -1 !== s2 && e2[t2].splice(s2, 1);
  24190. } };
  24191. }
  24192. const Wn = ["db.Geo", "db.command", "command.aggregate"];
  24193. function Hn(e2, t2) {
  24194. return Wn.indexOf(`${e2}.${t2}`) > -1;
  24195. }
  24196. function zn(e2) {
  24197. switch (f(e2 = se(e2))) {
  24198. case "array":
  24199. return e2.map((e3) => zn(e3));
  24200. case "object":
  24201. return e2._internalType === jn || Object.keys(e2).forEach((t2) => {
  24202. e2[t2] = zn(e2[t2]);
  24203. }), e2;
  24204. case "regexp":
  24205. return { $regexp: { source: e2.source, flags: e2.flags } };
  24206. case "date":
  24207. return { $date: e2.toISOString() };
  24208. default:
  24209. return e2;
  24210. }
  24211. }
  24212. function Jn(e2) {
  24213. return e2 && e2.content && e2.content.$method;
  24214. }
  24215. class Gn {
  24216. constructor(e2, t2, n2) {
  24217. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  24218. }
  24219. toJSON() {
  24220. let e2 = this;
  24221. const t2 = [e2.content];
  24222. for (; e2.prevStage; )
  24223. e2 = e2.prevStage, t2.push(e2.content);
  24224. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: zn(e3.$param) })) };
  24225. }
  24226. toString() {
  24227. return JSON.stringify(this.toJSON());
  24228. }
  24229. getAction() {
  24230. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  24231. return e2 && e2.$param && e2.$param[0];
  24232. }
  24233. getCommand() {
  24234. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  24235. }
  24236. get isAggregate() {
  24237. let e2 = this;
  24238. for (; e2; ) {
  24239. const t2 = Jn(e2), n2 = Jn(e2.prevStage);
  24240. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  24241. return true;
  24242. e2 = e2.prevStage;
  24243. }
  24244. return false;
  24245. }
  24246. get isCommand() {
  24247. let e2 = this;
  24248. for (; e2; ) {
  24249. if ("command" === Jn(e2))
  24250. return true;
  24251. e2 = e2.prevStage;
  24252. }
  24253. return false;
  24254. }
  24255. get isAggregateCommand() {
  24256. let e2 = this;
  24257. for (; e2; ) {
  24258. const t2 = Jn(e2), n2 = Jn(e2.prevStage);
  24259. if ("aggregate" === t2 && "command" === n2)
  24260. return true;
  24261. e2 = e2.prevStage;
  24262. }
  24263. return false;
  24264. }
  24265. getNextStageFn(e2) {
  24266. const t2 = this;
  24267. return function() {
  24268. return Vn({ $method: e2, $param: zn(Array.from(arguments)) }, t2, t2._database);
  24269. };
  24270. }
  24271. get count() {
  24272. return this.isAggregate ? this.getNextStageFn("count") : function() {
  24273. return this._send("count", Array.from(arguments));
  24274. };
  24275. }
  24276. get remove() {
  24277. return this.isCommand ? this.getNextStageFn("remove") : function() {
  24278. return this._send("remove", Array.from(arguments));
  24279. };
  24280. }
  24281. get() {
  24282. return this._send("get", Array.from(arguments));
  24283. }
  24284. get add() {
  24285. return this.isCommand ? this.getNextStageFn("add") : function() {
  24286. return this._send("add", Array.from(arguments));
  24287. };
  24288. }
  24289. update() {
  24290. return this._send("update", Array.from(arguments));
  24291. }
  24292. end() {
  24293. return this._send("end", Array.from(arguments));
  24294. }
  24295. get set() {
  24296. return this.isCommand ? this.getNextStageFn("set") : function() {
  24297. throw new Error("JQL禁止使用set方法");
  24298. };
  24299. }
  24300. _send(e2, t2) {
  24301. const n2 = this.getAction(), s2 = this.getCommand();
  24302. if (s2.$db.push({ $method: e2, $param: zn(t2) }), S) {
  24303. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  24304. t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  24305. }
  24306. return this._database._callCloudFunction({ action: n2, command: s2 });
  24307. }
  24308. }
  24309. function Vn(e2, t2, n2) {
  24310. return $n(new Gn(e2, t2, n2), { get(e3, t3) {
  24311. let s2 = "db";
  24312. return e3 && e3.content && (s2 = e3.content.$method), Hn(s2, t3) ? Vn({ $method: t3 }, e3, n2) : function() {
  24313. return Vn({ $method: t3, $param: zn(Array.from(arguments)) }, e3, n2);
  24314. };
  24315. } });
  24316. }
  24317. function Yn({ path: e2, method: t2 }) {
  24318. return class {
  24319. constructor() {
  24320. this.param = Array.from(arguments);
  24321. }
  24322. toJSON() {
  24323. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  24324. }
  24325. toString() {
  24326. return JSON.stringify(this.toJSON());
  24327. }
  24328. };
  24329. }
  24330. function Qn(e2, t2 = {}) {
  24331. return $n(new e2(t2), { get: (e3, t3) => Hn("db", t3) ? Vn({ $method: t3 }, null, e3) : function() {
  24332. return Vn({ $method: t3, $param: zn(Array.from(arguments)) }, null, e3);
  24333. } });
  24334. }
  24335. class Xn extends class {
  24336. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  24337. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Bn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Bn(this._dbCallBacks)), this.env = $n({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = $n({}, { get: (e3, t3) => Yn({ path: ["Geo"], method: t3 }) }), this.serverDate = Yn({ path: [], method: "serverDate" }), this.RegExp = Yn({ path: [], method: "RegExp" });
  24338. }
  24339. getCloudEnv(e2) {
  24340. if ("string" != typeof e2 || !e2.trim())
  24341. throw new Error("getCloudEnv参数错误");
  24342. return { $env: e2.replace("$cloudEnv_", "") };
  24343. }
  24344. _callback(e2, t2) {
  24345. const n2 = this._dbCallBacks;
  24346. n2[e2] && n2[e2].forEach((e3) => {
  24347. e3(...t2);
  24348. });
  24349. }
  24350. _callbackAuth(e2, t2) {
  24351. const n2 = this._authCallBacks;
  24352. n2[e2] && n2[e2].forEach((e3) => {
  24353. e3(...t2);
  24354. });
  24355. }
  24356. multiSend() {
  24357. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  24358. const t3 = e3.getAction(), n2 = e3.getCommand();
  24359. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  24360. throw new Error("multiSend只支持子命令内使用getTemp");
  24361. return { action: t3, command: n2 };
  24362. });
  24363. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  24364. }
  24365. } {
  24366. _parseResult(e2) {
  24367. return this._isJQL ? e2.result : e2;
  24368. }
  24369. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  24370. function r2(e3, t3) {
  24371. if (n2 && s2)
  24372. for (let n3 = 0; n3 < s2.length; n3++) {
  24373. const r3 = s2[n3];
  24374. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  24375. }
  24376. }
  24377. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  24378. function a2(e3) {
  24379. return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Y(j, { type: W, content: e3 }), Promise.reject(e3)));
  24380. }
  24381. const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
  24382. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: h, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  24383. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  24384. if (u3)
  24385. for (let e4 = 0; e4 < u3.length; e4++) {
  24386. const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console[t4] || console.log;
  24387. let i3 = "[System Info]" + n4;
  24388. s4 && (i3 = `${i3}
  24389. 详细信息:${s4}`), r3(i3);
  24390. }
  24391. if (t3) {
  24392. return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
  24393. }
  24394. e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (ie({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Y(B, { token: s3, tokenExpired: c3 }));
  24395. const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  24396. for (let t4 = 0; t4 < h2.length; t4++) {
  24397. const { prop: n4, tips: s4 } = h2[t4];
  24398. if (n4 in e3.result) {
  24399. const t5 = e3.result[n4];
  24400. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  24401. }
  24402. }
  24403. return function(e4) {
  24404. return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
  24405. r2(e4, null);
  24406. const t4 = i2._parseResult(e4);
  24407. return Y(j, { type: W, content: t4 }), Promise.resolve(t4);
  24408. });
  24409. }(e3);
  24410. }, (e3) => {
  24411. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  24412. return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  24413. });
  24414. }
  24415. }
  24416. const Zn = "token无效,跳转登录页面", es = "token过期,跳转登录页面", ts = { TOKEN_INVALID_TOKEN_EXPIRED: es, TOKEN_INVALID_INVALID_CLIENTID: Zn, TOKEN_INVALID: Zn, TOKEN_INVALID_WRONG_TOKEN: Zn, TOKEN_INVALID_ANONYMOUS_USER: Zn }, ns = { "uni-id-token-expired": es, "uni-id-check-token-failed": Zn, "uni-id-token-not-exist": Zn, "uni-id-check-device-feature-failed": Zn };
  24417. function ss(e2, t2) {
  24418. let n2 = "";
  24419. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  24420. }
  24421. function rs(e2 = [], t2 = "") {
  24422. const n2 = [], s2 = [];
  24423. return e2.forEach((e3) => {
  24424. true === e3.needLogin ? n2.push(ss(t2, e3.path)) : false === e3.needLogin && s2.push(ss(t2, e3.path));
  24425. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  24426. }
  24427. function is(e2) {
  24428. return e2.split("?")[0].replace(/^\//, "");
  24429. }
  24430. function os() {
  24431. return function(e2) {
  24432. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  24433. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  24434. }(function() {
  24435. const e2 = getCurrentPages();
  24436. return e2[e2.length - 1];
  24437. }());
  24438. }
  24439. function as() {
  24440. return is(os());
  24441. }
  24442. function cs(e2 = "", t2 = {}) {
  24443. if (!e2)
  24444. return false;
  24445. if (!(t2 && t2.list && t2.list.length))
  24446. return false;
  24447. const n2 = t2.list, s2 = is(e2);
  24448. return n2.some((e3) => e3.pagePath === s2);
  24449. }
  24450. const us = !!e.uniIdRouter;
  24451. const { loginPage: hs, routerNeedLogin: ls, resToLogin: ds, needLoginPage: ps, notNeedLoginPage: fs, loginPageInTabBar: gs } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
  24452. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = rs(t2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e2 = []) {
  24453. const t3 = [], n3 = [];
  24454. return e2.forEach((e3) => {
  24455. const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = rs(r3, s3);
  24456. t3.push(...i3), n3.push(...o3);
  24457. }), { needLoginPage: t3, notNeedLoginPage: n3 };
  24458. }(n2);
  24459. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: cs(i2, r2) };
  24460. }();
  24461. if (ps.indexOf(hs) > -1)
  24462. throw new Error(`Login page [${hs}] should not be "needLogin", please check your pages.json`);
  24463. function ms(e2) {
  24464. const t2 = as();
  24465. if ("/" === e2.charAt(0))
  24466. return e2;
  24467. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  24468. i2.pop();
  24469. for (let e3 = 0; e3 < r2.length; e3++) {
  24470. const t3 = r2[e3];
  24471. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  24472. }
  24473. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  24474. }
  24475. function ys(e2) {
  24476. const t2 = is(ms(e2));
  24477. return !(fs.indexOf(t2) > -1) && (ps.indexOf(t2) > -1 || ls.some((t3) => function(e3, t4) {
  24478. return new RegExp(t4).test(e3);
  24479. }(e2, t3)));
  24480. }
  24481. function _s({ redirect: e2 }) {
  24482. const t2 = is(e2), n2 = is(hs);
  24483. return as() !== n2 && t2 !== n2;
  24484. }
  24485. function ws({ api: e2, redirect: t2 } = {}) {
  24486. if (!t2 || !_s({ redirect: t2 }))
  24487. return;
  24488. const n2 = function(e3, t3) {
  24489. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  24490. }(hs, t2);
  24491. gs ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  24492. const s2 = { navigateTo: index$1.navigateTo, redirectTo: index$1.redirectTo, switchTab: index$1.switchTab, reLaunch: index$1.reLaunch };
  24493. setTimeout(() => {
  24494. s2[e2]({ url: n2 });
  24495. });
  24496. }
  24497. function vs({ url: e2 } = {}) {
  24498. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  24499. const { token: e3, tokenExpired: t3 } = re();
  24500. let n3;
  24501. if (e3) {
  24502. if (t3 < Date.now()) {
  24503. const e4 = "uni-id-token-expired";
  24504. n3 = { errCode: e4, errMsg: ns[e4] };
  24505. }
  24506. } else {
  24507. const e4 = "uni-id-check-token-failed";
  24508. n3 = { errCode: e4, errMsg: ns[e4] };
  24509. }
  24510. return n3;
  24511. }();
  24512. if (ys(e2) && n2) {
  24513. n2.uniIdRedirectUrl = e2;
  24514. if (J($).length > 0)
  24515. return setTimeout(() => {
  24516. Y($, n2);
  24517. }, 0), t2.abortLoginPageJump = true, t2;
  24518. t2.autoToLoginPage = true;
  24519. }
  24520. return t2;
  24521. }
  24522. function Is() {
  24523. !function() {
  24524. const e3 = os(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = vs({ url: e3 });
  24525. t2 || n2 && ws({ api: "redirectTo", redirect: e3 });
  24526. }();
  24527. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  24528. for (let t2 = 0; t2 < e2.length; t2++) {
  24529. const n2 = e2[t2];
  24530. index$1.addInterceptor(n2, { invoke(e3) {
  24531. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = vs({ url: e3.url });
  24532. return t3 ? e3 : s2 ? (ws({ api: n2, redirect: ms(e3.url) }), false) : e3;
  24533. } });
  24534. }
  24535. }
  24536. function Ss() {
  24537. this.onResponse((e2) => {
  24538. const { type: t2, content: n2 } = e2;
  24539. let s2 = false;
  24540. switch (t2) {
  24541. case "cloudobject":
  24542. s2 = function(e3) {
  24543. if ("object" != typeof e3)
  24544. return false;
  24545. const { errCode: t3 } = e3 || {};
  24546. return t3 in ns;
  24547. }(n2);
  24548. break;
  24549. case "clientdb":
  24550. s2 = function(e3) {
  24551. if ("object" != typeof e3)
  24552. return false;
  24553. const { errCode: t3 } = e3 || {};
  24554. return t3 in ts;
  24555. }(n2);
  24556. }
  24557. s2 && function(e3 = {}) {
  24558. const t3 = J($);
  24559. Z().then(() => {
  24560. const n3 = os();
  24561. if (n3 && _s({ redirect: n3 }))
  24562. return t3.length > 0 ? Y($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (hs && ws({ api: "navigateTo", redirect: n3 }));
  24563. });
  24564. }(n2);
  24565. });
  24566. }
  24567. function bs(e2) {
  24568. !function(e3) {
  24569. e3.onResponse = function(e4) {
  24570. G(j, e4);
  24571. }, e3.offResponse = function(e4) {
  24572. V(j, e4);
  24573. };
  24574. }(e2), function(e3) {
  24575. e3.onNeedLogin = function(e4) {
  24576. G($, e4);
  24577. }, e3.offNeedLogin = function(e4) {
  24578. V($, e4);
  24579. }, us && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = true, Z().then(() => {
  24580. Is.call(e3);
  24581. }), ds && Ss.call(e3)));
  24582. }(e2), function(e3) {
  24583. e3.onRefreshToken = function(e4) {
  24584. G(B, e4);
  24585. }, e3.offRefreshToken = function(e4) {
  24586. V(B, e4);
  24587. };
  24588. }(e2);
  24589. }
  24590. let ks;
  24591. const As = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Ps = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  24592. function Ts() {
  24593. const e2 = re().token || "", t2 = e2.split(".");
  24594. if (!e2 || 3 !== t2.length)
  24595. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  24596. let n2;
  24597. try {
  24598. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(ks(s2).split("").map(function(e3) {
  24599. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  24600. }).join(""))));
  24601. } catch (e3) {
  24602. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  24603. }
  24604. var s2;
  24605. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  24606. }
  24607. ks = "function" != typeof atob ? function(e2) {
  24608. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !Ps.test(e2))
  24609. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  24610. var t2;
  24611. e2 += "==".slice(2 - (3 & e2.length));
  24612. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  24613. t2 = As.indexOf(e2.charAt(i2++)) << 18 | As.indexOf(e2.charAt(i2++)) << 12 | (n2 = As.indexOf(e2.charAt(i2++))) << 6 | (s2 = As.indexOf(e2.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2);
  24614. return r2;
  24615. } : atob;
  24616. var Cs = n(function(e2, t2) {
  24617. Object.defineProperty(t2, "__esModule", { value: true });
  24618. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  24619. function r2(e3, t3) {
  24620. return e3.tempFiles.forEach((e4, n3) => {
  24621. e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf("."));
  24622. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  24623. }
  24624. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  24625. return t3.then((e4) => {
  24626. if (s3) {
  24627. const t4 = s3(e4);
  24628. if (void 0 !== t4)
  24629. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  24630. }
  24631. return e4;
  24632. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  24633. (t5 = Object.assign({}, t5)).errMsg = n2;
  24634. const i3 = t5.tempFiles, o2 = i3.length;
  24635. let a2 = 0;
  24636. return new Promise((n3) => {
  24637. for (; a2 < s4; )
  24638. c2();
  24639. function c2() {
  24640. const s5 = a2++;
  24641. if (s5 >= o2)
  24642. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  24643. const u2 = i3[s5];
  24644. e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
  24645. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  24646. } }).then((e5) => {
  24647. u2.url = e5.fileID, s5 < o2 && c2();
  24648. }).catch((e5) => {
  24649. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  24650. });
  24651. }
  24652. });
  24653. }(e3, t4, 5, r3));
  24654. }
  24655. t2.initChooseAndUploadFile = function(e3) {
  24656. return function(t3 = { type: "all" }) {
  24657. return "image" === t3.type ? i2(e3, function(e4) {
  24658. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  24659. return new Promise((e5, a2) => {
  24660. index$1.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  24661. e5(r2(t5, "image"));
  24662. }, fail(e6) {
  24663. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  24664. } });
  24665. });
  24666. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  24667. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  24668. return new Promise((e5, c2) => {
  24669. index$1.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  24670. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  24671. e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video"));
  24672. }, fail(e6) {
  24673. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  24674. } });
  24675. });
  24676. }(t3), t3) : i2(e3, function(e4) {
  24677. const { count: t4, extension: n3 } = e4;
  24678. return new Promise((e5, i3) => {
  24679. let o2 = index$1.chooseFile;
  24680. if ("undefined" != typeof wx$1 && "function" == typeof wx$1.chooseMessageFile && (o2 = wx$1.chooseMessageFile), "function" != typeof o2)
  24681. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  24682. o2({ type: "all", count: t4, extension: n3, success(t5) {
  24683. e5(r2(t5));
  24684. }, fail(e6) {
  24685. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  24686. } });
  24687. });
  24688. }(t3), t3);
  24689. };
  24690. };
  24691. }), xs = t(Cs);
  24692. const Os = "manual";
  24693. function Es(e2) {
  24694. return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {}, mixinDatacomError: null }), created() {
  24695. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  24696. var e3 = [];
  24697. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  24698. e3.push(this[t2]);
  24699. }), e3;
  24700. }, (e3, t2) => {
  24701. if (this.loadtime === Os)
  24702. return;
  24703. let n2 = false;
  24704. const s2 = [];
  24705. for (let r2 = 2; r2 < e3.length; r2++)
  24706. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  24707. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  24708. });
  24709. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  24710. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  24711. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
  24712. this.mixinDatacomLoading = false;
  24713. const { data: s2, count: r2 } = n3.result;
  24714. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  24715. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  24716. this.mixinDatacomResData = i2, t2 && t2(i2);
  24717. }).catch((e4) => {
  24718. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
  24719. }));
  24720. }, mixinDatacomGet(t2 = {}) {
  24721. let n2;
  24722. t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
  24723. const s2 = t2.action || this.action;
  24724. s2 && (n2 = n2.action(s2));
  24725. const r2 = t2.collection || this.collection;
  24726. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  24727. const i2 = t2.where || this.where;
  24728. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  24729. const o2 = t2.field || this.field;
  24730. o2 && (n2 = n2.field(o2));
  24731. const a2 = t2.foreignKey || this.foreignKey;
  24732. a2 && (n2 = n2.foreignKey(a2));
  24733. const c2 = t2.groupby || this.groupby;
  24734. c2 && (n2 = n2.groupBy(c2));
  24735. const u2 = t2.groupField || this.groupField;
  24736. u2 && (n2 = n2.groupField(u2));
  24737. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  24738. const h2 = t2.orderby || this.orderby;
  24739. h2 && (n2 = n2.orderBy(h2));
  24740. const l2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith };
  24741. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
  24742. } } };
  24743. }
  24744. function Ls(e2) {
  24745. return function(t2, n2 = {}) {
  24746. n2 = function(e3, t3 = {}) {
  24747. return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3;
  24748. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  24749. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  24750. return new Proxy({}, { get(s3, c2) {
  24751. switch (c2) {
  24752. case "toString":
  24753. return "[object UniCloudObject]";
  24754. case "toJSON":
  24755. return {};
  24756. }
  24757. return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  24758. return async function(...s4) {
  24759. const r3 = n3 ? n3({ params: s4 }) : {};
  24760. let i3, o3;
  24761. try {
  24762. return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
  24763. } catch (e4) {
  24764. throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
  24765. } finally {
  24766. await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  24767. }
  24768. };
  24769. }({ fn: async function s4(...h2) {
  24770. let l2;
  24771. a2 && index$1.showLoading({ title: r2.title, mask: r2.mask });
  24772. const d2 = { name: t2, type: u, data: { method: c2, params: h2 } };
  24773. "object" == typeof n2.secretMethods && function(e3, t3) {
  24774. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  24775. r3 && (t3.secretType = r3);
  24776. }(n2, d2);
  24777. let p2 = false;
  24778. try {
  24779. l2 = await e2.callFunction(d2);
  24780. } catch (e3) {
  24781. p2 = true, l2 = { result: new te(e3) };
  24782. }
  24783. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = l2.result || {};
  24784. if (a2 && index$1.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(B, { ...y2 })), g2) {
  24785. let e3 = m2;
  24786. if (p2 && o2) {
  24787. e3 = (await o2({ objectName: t2, methodName: c2, params: h2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  24788. }
  24789. if (a2)
  24790. if ("toast" === i2.type)
  24791. index$1.showToast({ title: e3, icon: "none" });
  24792. else {
  24793. if ("modal" !== i2.type)
  24794. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  24795. {
  24796. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  24797. return new Promise((i3, o3) => {
  24798. index$1.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  24799. i3(e5);
  24800. }, fail() {
  24801. i3({ confirm: false, cancel: true });
  24802. } });
  24803. });
  24804. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  24805. if (i2.retry && t3)
  24806. return s4(...h2);
  24807. }
  24808. }
  24809. const n3 = new te({ subject: f2, code: g2, message: m2, requestId: l2.requestId });
  24810. throw n3.detail = l2.result, Y(j, { type: z, content: n3 }), n3;
  24811. }
  24812. return Y(j, { type: z, content: l2.result }), l2.result;
  24813. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  24814. return { objectName: t2, methodName: c2, params: e3 };
  24815. } });
  24816. } });
  24817. };
  24818. }
  24819. function Rs(e2) {
  24820. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
  24821. }
  24822. async function Us({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  24823. const n2 = Rs(this);
  24824. if (e2 && t2)
  24825. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  24826. if (e2)
  24827. return n2.mpWeixinOpenid = e2, {};
  24828. const s2 = await new Promise((e3, t3) => {
  24829. index$1.login({ success(t4) {
  24830. e3(t4.code);
  24831. }, fail(e4) {
  24832. t3(new Error(e4.errMsg));
  24833. } });
  24834. }), r2 = this.importObject("uni-id-co", { customUI: true });
  24835. return await r2.secureNetworkHandshakeByWeixin({ code: s2, callLoginByWeixin: t2 }), n2.mpWeixinCode = s2, { code: s2 };
  24836. }
  24837. async function Ns(e2) {
  24838. const t2 = Rs(this);
  24839. return t2.initPromise || (t2.initPromise = Us.call(this, e2).then((e3) => e3).catch((e3) => {
  24840. throw delete t2.initPromise, e3;
  24841. })), t2.initPromise;
  24842. }
  24843. function Ds(e2) {
  24844. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  24845. return Ns.call(e2, { openid: t2, callLoginByWeixin: n2 });
  24846. };
  24847. }
  24848. function Ms(e2) {
  24849. const t2 = { getSystemInfo: index$1.getSystemInfo, getPushClientId: index$1.getPushClientId };
  24850. return function(n2) {
  24851. return new Promise((s2, r2) => {
  24852. t2[e2]({ ...n2, success(e3) {
  24853. s2(e3);
  24854. }, fail(e3) {
  24855. r2(e3);
  24856. } });
  24857. });
  24858. };
  24859. }
  24860. class qs extends class {
  24861. constructor() {
  24862. this._callback = {};
  24863. }
  24864. addListener(e2, t2) {
  24865. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  24866. }
  24867. on(e2, t2) {
  24868. return this.addListener(e2, t2);
  24869. }
  24870. removeListener(e2, t2) {
  24871. if (!t2)
  24872. throw new Error('The "listener" argument must be of type function. Received undefined');
  24873. const n2 = this._callback[e2];
  24874. if (!n2)
  24875. return;
  24876. const s2 = function(e3, t3) {
  24877. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  24878. if (e3[n3] === t3)
  24879. return n3;
  24880. return -1;
  24881. }(n2, t2);
  24882. n2.splice(s2, 1);
  24883. }
  24884. off(e2, t2) {
  24885. return this.removeListener(e2, t2);
  24886. }
  24887. removeAllListener(e2) {
  24888. delete this._callback[e2];
  24889. }
  24890. emit(e2, ...t2) {
  24891. const n2 = this._callback[e2];
  24892. if (n2)
  24893. for (let e3 = 0; e3 < n2.length; e3++)
  24894. n2[e3](...t2);
  24895. }
  24896. } {
  24897. constructor() {
  24898. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  24899. }
  24900. init() {
  24901. return Promise.all([Ms("getSystemInfo")(), Ms("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  24902. if (!e2)
  24903. throw new Error("Invalid appId, please check the manifest.json file");
  24904. if (!t2)
  24905. throw new Error("Invalid push client id");
  24906. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  24907. }, (e2) => {
  24908. throw this.emit("error", e2), this.close(), e2;
  24909. });
  24910. }
  24911. async open() {
  24912. return this.init();
  24913. }
  24914. _isUniCloudSSE(e2) {
  24915. if ("receive" !== e2.type)
  24916. return false;
  24917. const t2 = e2 && e2.data && e2.data.payload;
  24918. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  24919. }
  24920. _receivePushMessage(e2) {
  24921. if (!this._isUniCloudSSE(e2))
  24922. return;
  24923. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  24924. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  24925. }
  24926. _consumMessage() {
  24927. for (; ; ) {
  24928. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  24929. if (!e2)
  24930. break;
  24931. this._currentMessageId++, this._parseMessagePayload(e2);
  24932. }
  24933. }
  24934. _parseMessagePayload(e2) {
  24935. const { action: t2, messageId: n2, message: s2 } = e2;
  24936. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  24937. }
  24938. _appendMessage({ messageId: e2, message: t2 } = {}) {
  24939. this.emit("message", t2);
  24940. }
  24941. _end({ messageId: e2, message: t2 } = {}) {
  24942. this.emit("end", t2), this.close();
  24943. }
  24944. _initMessageListener() {
  24945. index$1.onPushMessage(this._uniPushMessageCallback);
  24946. }
  24947. _destroy() {
  24948. index$1.offPushMessage(this._uniPushMessageCallback);
  24949. }
  24950. toJSON() {
  24951. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  24952. }
  24953. close() {
  24954. this._destroy(), this.emit("close");
  24955. }
  24956. }
  24957. async function Fs(e2, t2) {
  24958. const n2 = `http://${e2}:${t2}/system/ping`;
  24959. try {
  24960. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  24961. ne.request({ ...s2, success(t4) {
  24962. e4(t4);
  24963. }, fail(e5) {
  24964. t3(e5);
  24965. } });
  24966. }));
  24967. return !(!e3.data || 0 !== e3.data.code);
  24968. } catch (e3) {
  24969. return false;
  24970. }
  24971. var s2;
  24972. }
  24973. async function Ks(e2) {
  24974. const t2 = e2.__dev__;
  24975. if (!t2.debugInfo)
  24976. return;
  24977. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await async function(e3, t3) {
  24978. let n3;
  24979. for (let s3 = 0; s3 < e3.length; s3++) {
  24980. const r3 = e3[s3];
  24981. if (await Fs(r3, t3)) {
  24982. n3 = r3;
  24983. break;
  24984. }
  24985. }
  24986. return { address: n3, port: t3 };
  24987. }(n2, s2);
  24988. if (r2)
  24989. return t2.localAddress = r2, void (t2.localPort = s2);
  24990. const i2 = console["warn"];
  24991. let o2 = "";
  24992. if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === P.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
  24993. throw new Error(o2);
  24994. i2(o2);
  24995. }
  24996. function js(e2) {
  24997. e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() {
  24998. let t2 = Promise.resolve();
  24999. var n2;
  25000. n2 = 1, t2 = new Promise((e3) => {
  25001. setTimeout(() => {
  25002. e3();
  25003. }, n2);
  25004. });
  25005. const s2 = e2.auth();
  25006. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  25007. } }));
  25008. }
  25009. const $s = { tcb: St, tencent: St, aliyun: pe, private: kt, alipay: Lt };
  25010. let Bs = new class {
  25011. init(e2) {
  25012. let t2 = {};
  25013. const n2 = $s[e2.provider];
  25014. if (!n2)
  25015. throw new Error("未提供正确的provider参数");
  25016. t2 = n2.init(e2), function(e3) {
  25017. const t3 = {};
  25018. e3.__dev__ = t3, t3.debugLog = "app" === P;
  25019. const n3 = T;
  25020. n3 && !n3.code && (t3.debugInfo = n3);
  25021. const s2 = new v({ createPromise: function() {
  25022. return Ks(e3);
  25023. } });
  25024. t3.initLocalNetwork = function() {
  25025. return s2.exec();
  25026. };
  25027. }(t2), js(t2), Kn(t2), function(e3) {
  25028. const t3 = e3.uploadFile;
  25029. e3.uploadFile = function(e4) {
  25030. return t3.call(this, e4);
  25031. };
  25032. }(t2), function(e3) {
  25033. e3.database = function(t3) {
  25034. if (t3 && Object.keys(t3).length > 0)
  25035. return e3.init(t3).database();
  25036. if (this._database)
  25037. return this._database;
  25038. const n3 = Qn(Xn, { uniClient: e3 });
  25039. return this._database = n3, n3;
  25040. }, e3.databaseForJQL = function(t3) {
  25041. if (t3 && Object.keys(t3).length > 0)
  25042. return e3.init(t3).databaseForJQL();
  25043. if (this._databaseForJQL)
  25044. return this._databaseForJQL;
  25045. const n3 = Qn(Xn, { uniClient: e3, isJQL: true });
  25046. return this._databaseForJQL = n3, n3;
  25047. };
  25048. }(t2), function(e3) {
  25049. e3.getCurrentUserInfo = Ts, e3.chooseAndUploadFile = xs.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  25050. return Es(e3);
  25051. } }), e3.SSEChannel = qs, e3.initSecureNetworkByWeixin = Ds(e3), e3.importObject = Ls(e3);
  25052. }(t2);
  25053. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  25054. if (!t2[e3])
  25055. return;
  25056. const n3 = t2[e3];
  25057. t2[e3] = function() {
  25058. return n3.apply(t2, Array.from(arguments));
  25059. }, t2[e3] = function(e4, t3) {
  25060. return function(n4) {
  25061. let s2 = false;
  25062. if ("callFunction" === t3) {
  25063. const e5 = n4 && n4.type || c;
  25064. s2 = e5 !== c;
  25065. }
  25066. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  25067. n4 = n4 || {};
  25068. const { success: o2, fail: a2, complete: u2 } = ee(n4), h2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Y(j, { type: H, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Y(j, { type: H, content: e5 }), Promise.reject(e5))));
  25069. if (!(o2 || a2 || u2))
  25070. return h2;
  25071. h2.then((e5) => {
  25072. o2 && o2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  25073. }, (e5) => {
  25074. a2 && a2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  25075. });
  25076. };
  25077. }(t2[e3], e3).bind(t2);
  25078. }), t2.init = this.init, t2;
  25079. }
  25080. }();
  25081. (() => {
  25082. const e2 = C;
  25083. let t2 = {};
  25084. if (e2 && 1 === e2.length)
  25085. t2 = e2[0], Bs = Bs.init(t2), Bs._isDefault = true;
  25086. else {
  25087. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  25088. let n2;
  25089. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
  25090. Bs[e3] = function() {
  25091. return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
  25092. };
  25093. });
  25094. }
  25095. Object.assign(Bs, { get mixinDatacom() {
  25096. return Es(Bs);
  25097. } }), bs(Bs), Bs.addInterceptor = N, Bs.removeInterceptor = D, Bs.interceptObject = F;
  25098. })();
  25099. var Ws = Bs;
  25100. exports.QSCanvas = QSCanvas;
  25101. exports.Request = Request;
  25102. exports.Ws = Ws;
  25103. exports._ = _$1;
  25104. exports._export_sfc = _export_sfc;
  25105. exports.computed = computed;
  25106. exports.createPinia = createPinia;
  25107. exports.createSSRApp = createSSRApp;
  25108. exports.dayjs = dayjs;
  25109. exports.defineStore = defineStore;
  25110. exports.duration = duration;
  25111. exports.e = e$1;
  25112. exports.f = f$1;
  25113. exports.getCurrentInstance = getCurrentInstance;
  25114. exports.index = index$1;
  25115. exports.index$1 = index;
  25116. exports.initVueI18n = initVueI18n;
  25117. exports.io = io;
  25118. exports.lodashExports = lodashExports;
  25119. exports.m = m$1;
  25120. exports.n = n$1;
  25121. exports.nextTick$1 = nextTick$1;
  25122. exports.o = o$1;
  25123. exports.onBackPress = onBackPress;
  25124. exports.onBeforeMount = onBeforeMount;
  25125. exports.onError = onError;
  25126. exports.onHide = onHide;
  25127. exports.onLaunch = onLaunch;
  25128. exports.onLoad = onLoad;
  25129. exports.onMounted = onMounted;
  25130. exports.onPageScroll = onPageScroll;
  25131. exports.onPullDownRefresh = onPullDownRefresh;
  25132. exports.onReachBottom = onReachBottom;
  25133. exports.onReady = onReady;
  25134. exports.onShareAppMessage = onShareAppMessage;
  25135. exports.onShow = onShow;
  25136. exports.p = p$1;
  25137. exports.parsePhoneNumber = parsePhoneNumber;
  25138. exports.reactive = reactive;
  25139. exports.ref = ref;
  25140. exports.relativeTime = relativeTime;
  25141. exports.resolveComponent = resolveComponent;
  25142. exports.s = s$1;
  25143. exports.sr = sr;
  25144. exports.t = t$1;
  25145. exports.toRefs = toRefs;
  25146. exports.unref = unref;
  25147. exports.useCssVars = useCssVars;
  25148. exports.watch = watch;
  25149. exports.watchEffect = watchEffect;
  25150. exports.watchPostEffect = watchPostEffect;
  25151. exports.wx$1 = wx$1;