1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151 |
- "use strict";
- var __accessCheck = (obj, member, msg) => {
- if (!member.has(obj))
- throw TypeError("Cannot " + msg);
- };
- var __privateGet = (obj, member, getter) => {
- __accessCheck(obj, member, "read from private field");
- return getter ? getter.call(obj) : member.get(obj);
- };
- var __privateAdd = (obj, member, value) => {
- if (member.has(obj))
- throw TypeError("Cannot add the same private member more than once");
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
- };
- var __privateSet = (obj, member, value, setter) => {
- __accessCheck(obj, member, "write to private field");
- setter ? setter.call(obj, value) : member.set(obj, value);
- return value;
- };
- function makeMap(str, expectsLowerCase) {
- const map = /* @__PURE__ */ Object.create(null);
- const list = str.split(",");
- for (let i2 = 0; i2 < list.length; i2++) {
- map[list[i2]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- const EMPTY_OBJ = Object.freeze({});
- const EMPTY_ARR = Object.freeze([]);
- const NOOP = () => {
- };
- const NO = () => false;
- const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
- (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
- const isModelListener = (key) => key.startsWith("onUpdate:");
- const extend = Object.assign;
- const remove = (arr, el) => {
- const i2 = arr.indexOf(el);
- if (i2 > -1) {
- arr.splice(i2, 1);
- }
- };
- const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key);
- const isArray$1 = Array.isArray;
- const isMap = (val) => toTypeString(val) === "[object Map]";
- const isSet = (val) => toTypeString(val) === "[object Set]";
- const isFunction = (val) => typeof val === "function";
- const isString = (val) => typeof val === "string";
- const isSymbol = (val) => typeof val === "symbol";
- const isObject$3 = (val) => val !== null && typeof val === "object";
- const isPromise = (val) => {
- return (isObject$3(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
- };
- const objectToString = Object.prototype.toString;
- const toTypeString = (value) => objectToString.call(value);
- const toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- const isPlainObject$2 = (val) => toTypeString(val) === "[object Object]";
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- const isReservedProp = /* @__PURE__ */ makeMap(
- // the leading comma is intentional so empty string "" is also included
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
- );
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
- );
- const cacheStringFunction = (fn) => {
- const cache = /* @__PURE__ */ Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- const camelizeRE = /-(\w)/g;
- const camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
- });
- const hyphenateRE = /\B([A-Z])/g;
- const hyphenate = cacheStringFunction(
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
- );
- const capitalize = cacheStringFunction((str) => {
- return str.charAt(0).toUpperCase() + str.slice(1);
- });
- const toHandlerKey = cacheStringFunction((str) => {
- const s2 = str ? `on${capitalize(str)}` : ``;
- return s2;
- });
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
- const invokeArrayFns$1 = (fns, arg) => {
- for (let i2 = 0; i2 < fns.length; i2++) {
- fns[i2](arg);
- }
- };
- const def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- const looseToNumber = (val) => {
- const n2 = parseFloat(val);
- return isNaN(n2) ? val : n2;
- };
- const toNumber = (val) => {
- const n2 = isString(val) ? Number(val) : NaN;
- return isNaN(n2) ? val : n2;
- };
- function normalizeStyle(value) {
- if (isArray$1(value)) {
- const res = {};
- for (let i2 = 0; i2 < value.length; i2++) {
- const item = value[i2];
- const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isString(value) || isObject$3(value)) {
- return value;
- }
- }
- const listDelimiterRE = /;(?![^(]*\))/g;
- const propertyDelimiterRE = /:([^]+)/;
- const styleCommentRE = /\/\*[^]*?\*\//g;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray$1(value)) {
- for (let i2 = 0; i2 < value.length; i2++) {
- const normalized = normalizeClass(value[i2]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject$3(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- const toDisplayString = (val) => {
- 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);
- };
- const replacer = (_key, val) => {
- if (val && val.__v_isRef) {
- return replacer(_key, val.value);
- } else if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce(
- (entries, [key, val2], i2) => {
- entries[stringifySymbol(key, i2) + " =>"] = val2;
- return entries;
- },
- {}
- )
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2))
- };
- } else if (isSymbol(val)) {
- return stringifySymbol(val);
- } else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$2(val)) {
- return String(val);
- }
- return val;
- };
- const stringifySymbol = (v2, i2 = "") => {
- var _a2;
- return isSymbol(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2;
- };
- const isObject$2 = (val) => val !== null && typeof val === "object";
- const defaultDelimiters = ["{", "}"];
- class BaseFormatter {
- constructor() {
- this._caches = /* @__PURE__ */ Object.create(null);
- }
- interpolate(message, values, delimiters = defaultDelimiters) {
- if (!values) {
- return [message];
- }
- let tokens = this._caches[message];
- if (!tokens) {
- tokens = parse$1(message, delimiters);
- this._caches[message] = tokens;
- }
- return compile$1(tokens, values);
- }
- }
- const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
- const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
- function parse$1(format, [startDelimiter, endDelimiter]) {
- const tokens = [];
- let position = 0;
- let text = "";
- while (position < format.length) {
- let char = format[position++];
- if (char === startDelimiter) {
- if (text) {
- tokens.push({ type: "text", value: text });
- }
- text = "";
- let sub = "";
- char = format[position++];
- while (char !== void 0 && char !== endDelimiter) {
- sub += char;
- char = format[position++];
- }
- const isClosed = char === endDelimiter;
- const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
- tokens.push({ value: sub, type });
- } else {
- text += char;
- }
- }
- text && tokens.push({ type: "text", value: text });
- return tokens;
- }
- function compile$1(tokens, values) {
- const compiled = [];
- let index2 = 0;
- const mode = Array.isArray(values) ? "list" : isObject$2(values) ? "named" : "unknown";
- if (mode === "unknown") {
- return compiled;
- }
- while (index2 < tokens.length) {
- const token = tokens[index2];
- switch (token.type) {
- case "text":
- compiled.push(token.value);
- break;
- case "list":
- compiled.push(values[parseInt(token.value, 10)]);
- break;
- case "named":
- if (mode === "named") {
- compiled.push(values[token.value]);
- } else {
- {
- console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
- }
- }
- break;
- case "unknown":
- {
- console.warn(`Detect 'unknown' type of token!`);
- }
- break;
- }
- index2++;
- }
- return compiled;
- }
- const LOCALE_ZH_HANS = "zh-Hans";
- const LOCALE_ZH_HANT = "zh-Hant";
- const LOCALE_EN = "en";
- const LOCALE_FR = "fr";
- const LOCALE_ES = "es";
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
- const defaultFormatter = new BaseFormatter();
- function include(str, parts) {
- return !!parts.find((part) => str.indexOf(part) !== -1);
- }
- function startsWith(str, parts) {
- return parts.find((part) => str.indexOf(part) === 0);
- }
- function normalizeLocale(locale, messages) {
- if (!locale) {
- return;
- }
- locale = locale.trim().replace(/_/g, "-");
- if (messages && messages[locale]) {
- return locale;
- }
- locale = locale.toLowerCase();
- if (locale === "chinese") {
- return LOCALE_ZH_HANS;
- }
- if (locale.indexOf("zh") === 0) {
- if (locale.indexOf("-hans") > -1) {
- return LOCALE_ZH_HANS;
- }
- if (locale.indexOf("-hant") > -1) {
- return LOCALE_ZH_HANT;
- }
- if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
- return LOCALE_ZH_HANT;
- }
- return LOCALE_ZH_HANS;
- }
- let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
- if (messages && Object.keys(messages).length > 0) {
- locales = Object.keys(messages);
- }
- const lang = startsWith(locale, locales);
- if (lang) {
- return lang;
- }
- }
- class I18n {
- constructor({ locale, fallbackLocale, messages, watcher, formater }) {
- this.locale = LOCALE_EN;
- this.fallbackLocale = LOCALE_EN;
- this.message = {};
- this.messages = {};
- this.watchers = [];
- if (fallbackLocale) {
- this.fallbackLocale = fallbackLocale;
- }
- this.formater = formater || defaultFormatter;
- this.messages = messages || {};
- this.setLocale(locale || LOCALE_EN);
- if (watcher) {
- this.watchLocale(watcher);
- }
- }
- setLocale(locale) {
- const oldLocale = this.locale;
- this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
- if (!this.messages[this.locale]) {
- this.messages[this.locale] = {};
- }
- this.message = this.messages[this.locale];
- if (oldLocale !== this.locale) {
- this.watchers.forEach((watcher) => {
- watcher(this.locale, oldLocale);
- });
- }
- }
- getLocale() {
- return this.locale;
- }
- watchLocale(fn) {
- const index2 = this.watchers.push(fn) - 1;
- return () => {
- this.watchers.splice(index2, 1);
- };
- }
- add(locale, message, override = true) {
- const curMessages = this.messages[locale];
- if (curMessages) {
- if (override) {
- Object.assign(curMessages, message);
- } else {
- Object.keys(message).forEach((key) => {
- if (!hasOwn(curMessages, key)) {
- curMessages[key] = message[key];
- }
- });
- }
- } else {
- this.messages[locale] = message;
- }
- }
- f(message, values, delimiters) {
- return this.formater.interpolate(message, values, delimiters).join("");
- }
- t(key, locale, values) {
- let message = this.message;
- if (typeof locale === "string") {
- locale = normalizeLocale(locale, this.messages);
- locale && (message = this.messages[locale]);
- } else {
- values = locale;
- }
- if (!hasOwn(message, key)) {
- console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
- return key;
- }
- return this.formater.interpolate(message[key], values).join("");
- }
- }
- function watchAppLocale(appVm, i18n) {
- if (appVm.$watchLocale) {
- appVm.$watchLocale((newLocale) => {
- i18n.setLocale(newLocale);
- });
- } else {
- appVm.$watch(() => appVm.$locale, (newLocale) => {
- i18n.setLocale(newLocale);
- });
- }
- }
- function getDefaultLocale() {
- if (typeof index$1 !== "undefined" && index$1.getLocale) {
- return index$1.getLocale();
- }
- if (typeof global !== "undefined" && global.getLocale) {
- return global.getLocale();
- }
- return LOCALE_EN;
- }
- function initVueI18n(locale, messages = {}, fallbackLocale, watcher) {
- if (typeof locale !== "string") {
- [locale, messages] = [
- messages,
- locale
- ];
- }
- if (typeof locale !== "string") {
- locale = getDefaultLocale();
- }
- if (typeof fallbackLocale !== "string") {
- fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
- }
- const i18n = new I18n({
- locale,
- fallbackLocale,
- messages,
- watcher
- });
- let t2 = (key, values) => {
- if (typeof getApp !== "function") {
- t2 = function(key2, values2) {
- return i18n.t(key2, values2);
- };
- } else {
- let isWatchedAppLocale = false;
- t2 = function(key2, values2) {
- const appVm = getApp().$vm;
- if (appVm) {
- appVm.$locale;
- if (!isWatchedAppLocale) {
- isWatchedAppLocale = true;
- watchAppLocale(appVm, i18n);
- }
- }
- return i18n.t(key2, values2);
- };
- }
- return t2(key, values);
- };
- return {
- i18n,
- f(message, values, delimiters) {
- return i18n.f(message, values, delimiters);
- },
- t(key, values) {
- return t2(key, values);
- },
- add(locale2, message, override = true) {
- return i18n.add(locale2, message, override);
- },
- watch(fn) {
- return i18n.watchLocale(fn);
- },
- getLocale() {
- return i18n.getLocale();
- },
- setLocale(newLocale) {
- return i18n.setLocale(newLocale);
- }
- };
- }
- const LINEFEED = "\n";
- const SLOT_DEFAULT_NAME = "d";
- const ON_SHOW = "onShow";
- const ON_HIDE = "onHide";
- const ON_LAUNCH = "onLaunch";
- const ON_ERROR = "onError";
- const ON_THEME_CHANGE = "onThemeChange";
- const ON_PAGE_NOT_FOUND = "onPageNotFound";
- const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
- const ON_EXIT = "onExit";
- const ON_LOAD = "onLoad";
- const ON_READY = "onReady";
- const ON_UNLOAD = "onUnload";
- const ON_INIT = "onInit";
- const ON_SAVE_EXIT_STATE = "onSaveExitState";
- const ON_RESIZE = "onResize";
- const ON_BACK_PRESS = "onBackPress";
- const ON_PAGE_SCROLL = "onPageScroll";
- const ON_TAB_ITEM_TAP = "onTabItemTap";
- const ON_REACH_BOTTOM = "onReachBottom";
- const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
- const ON_SHARE_TIMELINE = "onShareTimeline";
- const ON_ADD_TO_FAVORITES = "onAddToFavorites";
- const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
- const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
- const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
- const customizeRE = /:/g;
- function customizeEvent(str) {
- return camelize(str.replace(customizeRE, "-"));
- }
- function hasLeadingSlash(str) {
- return str.indexOf("/") === 0;
- }
- function addLeadingSlash(str) {
- return hasLeadingSlash(str) ? str : "/" + str;
- }
- const invokeArrayFns = (fns, arg) => {
- let ret;
- for (let i2 = 0; i2 < fns.length; i2++) {
- ret = fns[i2](arg);
- }
- return ret;
- };
- function once(fn, ctx = null) {
- let res;
- return (...args) => {
- if (fn) {
- res = fn.apply(ctx, args);
- fn = null;
- }
- return res;
- };
- }
- function getValueByDataPath(obj, path) {
- if (!isString(path)) {
- return;
- }
- path = path.replace(/\[(\d+)\]/g, ".$1");
- const parts = path.split(".");
- let key = parts[0];
- if (!obj) {
- obj = {};
- }
- if (parts.length === 1) {
- return obj[key];
- }
- return getValueByDataPath(obj[key], parts.slice(1).join("."));
- }
- function sortObject(obj) {
- let sortObj = {};
- if (isPlainObject$2(obj)) {
- Object.keys(obj).sort().forEach((key) => {
- const _key = key;
- sortObj[_key] = obj[_key];
- });
- }
- return !Object.keys(sortObj) ? obj : sortObj;
- }
- const encode$1 = encodeURIComponent;
- function stringifyQuery(obj, encodeStr = encode$1) {
- const res = obj ? Object.keys(obj).map((key) => {
- let val = obj[key];
- if (typeof val === void 0 || val === null) {
- val = "";
- } else if (isPlainObject$2(val)) {
- val = JSON.stringify(val);
- }
- return encodeStr(key) + "=" + encodeStr(val);
- }).filter((x) => x.length > 0).join("&") : null;
- return res ? `?${res}` : "";
- }
- const PAGE_HOOKS = [
- ON_INIT,
- ON_LOAD,
- ON_SHOW,
- ON_HIDE,
- ON_UNLOAD,
- ON_BACK_PRESS,
- ON_PAGE_SCROLL,
- ON_TAB_ITEM_TAP,
- ON_REACH_BOTTOM,
- ON_PULL_DOWN_REFRESH,
- ON_SHARE_TIMELINE,
- ON_SHARE_APP_MESSAGE,
- ON_ADD_TO_FAVORITES,
- ON_SAVE_EXIT_STATE,
- ON_NAVIGATION_BAR_BUTTON_TAP,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
- ];
- function isRootHook(name) {
- return PAGE_HOOKS.indexOf(name) > -1;
- }
- const UniLifecycleHooks = [
- ON_SHOW,
- ON_HIDE,
- ON_LAUNCH,
- ON_ERROR,
- ON_THEME_CHANGE,
- ON_PAGE_NOT_FOUND,
- ON_UNHANDLE_REJECTION,
- ON_EXIT,
- ON_INIT,
- ON_LOAD,
- ON_READY,
- ON_UNLOAD,
- ON_RESIZE,
- ON_BACK_PRESS,
- ON_PAGE_SCROLL,
- ON_TAB_ITEM_TAP,
- ON_REACH_BOTTOM,
- ON_PULL_DOWN_REFRESH,
- ON_SHARE_TIMELINE,
- ON_ADD_TO_FAVORITES,
- ON_SHARE_APP_MESSAGE,
- ON_SAVE_EXIT_STATE,
- ON_NAVIGATION_BAR_BUTTON_TAP,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
- ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
- ];
- const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
- return {
- onPageScroll: 1,
- onShareAppMessage: 1 << 1,
- onShareTimeline: 1 << 2
- };
- })();
- function isUniLifecycleHook(name, value, checkType = true) {
- if (checkType && !isFunction(value)) {
- return false;
- }
- if (UniLifecycleHooks.indexOf(name) > -1) {
- return true;
- } else if (name.indexOf("on") === 0) {
- return true;
- }
- return false;
- }
- let vueApp;
- const createVueAppHooks = [];
- function onCreateVueApp(hook) {
- if (vueApp) {
- return hook(vueApp);
- }
- createVueAppHooks.push(hook);
- }
- function invokeCreateVueAppHook(app) {
- vueApp = app;
- createVueAppHooks.forEach((hook) => hook(app));
- }
- const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
- if (isFunction(app._component.onError)) {
- return createErrorHandler2(app);
- }
- });
- const E$1 = function() {
- };
- E$1.prototype = {
- on: function(name, callback, ctx) {
- var e2 = this.e || (this.e = {});
- (e2[name] || (e2[name] = [])).push({
- fn: callback,
- ctx
- });
- return this;
- },
- once: function(name, callback, ctx) {
- var self2 = this;
- function listener() {
- self2.off(name, listener);
- callback.apply(ctx, arguments);
- }
- listener._ = callback;
- return this.on(name, listener, ctx);
- },
- emit: function(name) {
- var data = [].slice.call(arguments, 1);
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
- var i2 = 0;
- var len = evtArr.length;
- for (i2; i2 < len; i2++) {
- evtArr[i2].fn.apply(evtArr[i2].ctx, data);
- }
- return this;
- },
- off: function(name, callback) {
- var e2 = this.e || (this.e = {});
- var evts = e2[name];
- var liveEvents = [];
- if (evts && callback) {
- for (var i2 = evts.length - 1; i2 >= 0; i2--) {
- if (evts[i2].fn === callback || evts[i2].fn._ === callback) {
- evts.splice(i2, 1);
- break;
- }
- }
- liveEvents = evts;
- }
- liveEvents.length ? e2[name] = liveEvents : delete e2[name];
- return this;
- }
- };
- var E$1$1 = E$1;
- function getBaseSystemInfo() {
- return wx.getSystemInfoSync();
- }
- function validateProtocolFail(name, msg) {
- console.warn(`${name}: ${msg}`);
- }
- function validateProtocol(name, data, protocol, onFail) {
- if (!onFail) {
- onFail = validateProtocolFail;
- }
- for (const key in protocol) {
- const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn$1(data, key));
- if (isString(errMsg)) {
- onFail(name, errMsg);
- }
- }
- }
- function validateProtocols(name, args, protocol, onFail) {
- if (!protocol) {
- return;
- }
- if (!isArray$1(protocol)) {
- return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
- }
- const len = protocol.length;
- const argsLen = args.length;
- for (let i2 = 0; i2 < len; i2++) {
- const opts = protocol[i2];
- const data = /* @__PURE__ */ Object.create(null);
- if (argsLen > i2) {
- data[opts.name] = args[i2];
- }
- validateProtocol(name, data, { [opts.name]: opts }, onFail);
- }
- }
- function validateProp$1(name, value, prop, isAbsent) {
- if (!isPlainObject$2(prop)) {
- prop = { type: prop };
- }
- const { type, required, validator } = prop;
- if (required && isAbsent) {
- return 'Missing required args: "' + name + '"';
- }
- if (value == null && !required) {
- return;
- }
- if (type != null) {
- let isValid = false;
- const types = isArray$1(type) ? type : [type];
- const expectedTypes = [];
- for (let i2 = 0; i2 < types.length && !isValid; i2++) {
- const { valid, expectedType } = assertType$1(value, types[i2]);
- expectedTypes.push(expectedType || "");
- isValid = valid;
- }
- if (!isValid) {
- return getInvalidTypeMessage$1(name, value, expectedTypes);
- }
- }
- if (validator) {
- return validator(value);
- }
- }
- const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
- function assertType$1(value, type) {
- let valid;
- const expectedType = getType$2(type);
- if (isSimpleType$1(expectedType)) {
- const t2 = typeof value;
- valid = t2 === expectedType.toLowerCase();
- if (!valid && t2 === "object") {
- valid = value instanceof type;
- }
- } else if (expectedType === "Object") {
- valid = isObject$3(value);
- } else if (expectedType === "Array") {
- valid = isArray$1(value);
- } else {
- {
- valid = value instanceof type;
- }
- }
- return {
- valid,
- expectedType
- };
- }
- function getInvalidTypeMessage$1(name, value, expectedTypes) {
- let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
- const expectedType = expectedTypes[0];
- const receivedType = toRawType(value);
- const expectedValue = styleValue$1(value, expectedType);
- const receivedValue = styleValue$1(value, receivedType);
- if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
- message += ` with value ${expectedValue}`;
- }
- message += `, got ${receivedType} `;
- if (isExplicable$1(receivedType)) {
- message += `with value ${receivedValue}.`;
- }
- return message;
- }
- function getType$2(ctor) {
- const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
- return match ? match[1] : "";
- }
- function styleValue$1(value, type) {
- if (type === "String") {
- return `"${value}"`;
- } else if (type === "Number") {
- return `${Number(value)}`;
- } else {
- return `${value}`;
- }
- }
- function isExplicable$1(type) {
- const explicitTypes = ["string", "number", "boolean"];
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
- }
- function isBoolean$1(...args) {
- return args.some((elem) => elem.toLowerCase() === "boolean");
- }
- function tryCatch(fn) {
- return function() {
- try {
- return fn.apply(fn, arguments);
- } catch (e2) {
- console.error(e2);
- }
- };
- }
- let invokeCallbackId = 1;
- const invokeCallbacks = {};
- function addInvokeCallback(id, name, callback, keepAlive = false) {
- invokeCallbacks[id] = {
- name,
- keepAlive,
- callback
- };
- return id;
- }
- function invokeCallback(id, res, extras) {
- if (typeof id === "number") {
- const opts = invokeCallbacks[id];
- if (opts) {
- if (!opts.keepAlive) {
- delete invokeCallbacks[id];
- }
- return opts.callback(res, extras);
- }
- }
- return res;
- }
- const API_SUCCESS = "success";
- const API_FAIL = "fail";
- const API_COMPLETE = "complete";
- function getApiCallbacks(args) {
- const apiCallbacks = {};
- for (const name in args) {
- const fn = args[name];
- if (isFunction(fn)) {
- apiCallbacks[name] = tryCatch(fn);
- delete args[name];
- }
- }
- return apiCallbacks;
- }
- function normalizeErrMsg$1(errMsg, name) {
- if (!errMsg || errMsg.indexOf(":fail") === -1) {
- return name + ":ok";
- }
- return name + errMsg.substring(errMsg.indexOf(":fail"));
- }
- function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
- if (!isPlainObject$2(args)) {
- args = {};
- }
- const { success, fail, complete } = getApiCallbacks(args);
- const hasSuccess = isFunction(success);
- const hasFail = isFunction(fail);
- const hasComplete = isFunction(complete);
- const callbackId = invokeCallbackId++;
- addInvokeCallback(callbackId, name, (res) => {
- res = res || {};
- res.errMsg = normalizeErrMsg$1(res.errMsg, name);
- isFunction(beforeAll) && beforeAll(res);
- if (res.errMsg === name + ":ok") {
- isFunction(beforeSuccess) && beforeSuccess(res, args);
- hasSuccess && success(res);
- } else {
- hasFail && fail(res);
- }
- hasComplete && complete(res);
- });
- return callbackId;
- }
- const HOOK_SUCCESS = "success";
- const HOOK_FAIL = "fail";
- const HOOK_COMPLETE = "complete";
- const globalInterceptors = {};
- const scopedInterceptors = {};
- function wrapperHook(hook, params) {
- return function(data) {
- return hook(data, params) || data;
- };
- }
- function queue$1(hooks, data, params) {
- let promise = false;
- for (let i2 = 0; i2 < hooks.length; i2++) {
- const hook = hooks[i2];
- if (promise) {
- promise = Promise.resolve(wrapperHook(hook, params));
- } else {
- const res = hook(data, params);
- if (isPromise(res)) {
- promise = Promise.resolve(res);
- }
- if (res === false) {
- return {
- then() {
- },
- catch() {
- }
- };
- }
- }
- }
- return promise || {
- then(callback) {
- return callback(data);
- },
- catch() {
- }
- };
- }
- function wrapperOptions(interceptors2, options = {}) {
- [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
- const hooks = interceptors2[name];
- if (!isArray$1(hooks)) {
- return;
- }
- const oldCallback = options[name];
- options[name] = function callbackInterceptor(res) {
- queue$1(hooks, res, options).then((res2) => {
- return isFunction(oldCallback) && oldCallback(res2) || res2;
- });
- };
- });
- return options;
- }
- function wrapperReturnValue(method, returnValue) {
- const returnValueHooks = [];
- if (isArray$1(globalInterceptors.returnValue)) {
- returnValueHooks.push(...globalInterceptors.returnValue);
- }
- const interceptor = scopedInterceptors[method];
- if (interceptor && isArray$1(interceptor.returnValue)) {
- returnValueHooks.push(...interceptor.returnValue);
- }
- returnValueHooks.forEach((hook) => {
- returnValue = hook(returnValue) || returnValue;
- });
- return returnValue;
- }
- function getApiInterceptorHooks(method) {
- const interceptor = /* @__PURE__ */ Object.create(null);
- Object.keys(globalInterceptors).forEach((hook) => {
- if (hook !== "returnValue") {
- interceptor[hook] = globalInterceptors[hook].slice();
- }
- });
- const scopedInterceptor = scopedInterceptors[method];
- if (scopedInterceptor) {
- Object.keys(scopedInterceptor).forEach((hook) => {
- if (hook !== "returnValue") {
- interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
- }
- });
- }
- return interceptor;
- }
- function invokeApi(method, api, options, params) {
- const interceptor = getApiInterceptorHooks(method);
- if (interceptor && Object.keys(interceptor).length) {
- if (isArray$1(interceptor.invoke)) {
- const res = queue$1(interceptor.invoke, options);
- return res.then((options2) => {
- return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
- });
- } else {
- return api(wrapperOptions(interceptor, options), ...params);
- }
- }
- return api(options, ...params);
- }
- function hasCallback(args) {
- if (isPlainObject$2(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
- return true;
- }
- return false;
- }
- function handlePromise(promise) {
- return promise;
- }
- function promisify$1(name, fn) {
- return (args = {}, ...rest) => {
- if (hasCallback(args)) {
- return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
- }
- return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
- invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
- })));
- };
- }
- function formatApiArgs(args, options) {
- const params = args[0];
- if (!options || !isPlainObject$2(options.formatArgs) && isPlainObject$2(params)) {
- return;
- }
- const formatArgs = options.formatArgs;
- const keys = Object.keys(formatArgs);
- for (let i2 = 0; i2 < keys.length; i2++) {
- const name = keys[i2];
- const formatterOrDefaultValue = formatArgs[name];
- if (isFunction(formatterOrDefaultValue)) {
- const errMsg = formatterOrDefaultValue(args[0][name], params);
- if (isString(errMsg)) {
- return errMsg;
- }
- } else {
- if (!hasOwn$1(params, name)) {
- params[name] = formatterOrDefaultValue;
- }
- }
- }
- }
- function invokeSuccess(id, name, res) {
- const result2 = {
- errMsg: name + ":ok"
- };
- return invokeCallback(id, extend(res || {}, result2));
- }
- function invokeFail(id, name, errMsg, errRes = {}) {
- const apiErrMsg = name + ":fail" + (errMsg ? " " + errMsg : "");
- delete errRes.errCode;
- return invokeCallback(id, typeof UniError !== "undefined" ? typeof errRes.errCode !== "undefined" ? new UniError(name, errRes.errCode, apiErrMsg) : new UniError(apiErrMsg, errRes) : extend({ errMsg: apiErrMsg }, errRes));
- }
- function beforeInvokeApi(name, args, protocol, options) {
- {
- validateProtocols(name, args, protocol);
- }
- if (options && options.beforeInvoke) {
- const errMsg2 = options.beforeInvoke(args);
- if (isString(errMsg2)) {
- return errMsg2;
- }
- }
- const errMsg = formatApiArgs(args, options);
- if (errMsg) {
- return errMsg;
- }
- }
- function normalizeErrMsg(errMsg) {
- if (!errMsg || isString(errMsg)) {
- return errMsg;
- }
- if (errMsg.stack) {
- console.error(errMsg.message + LINEFEED + errMsg.stack);
- return errMsg.message;
- }
- return errMsg;
- }
- function wrapperTaskApi(name, fn, protocol, options) {
- return (args) => {
- const id = createAsyncApiCallback(name, args, options);
- const errMsg = beforeInvokeApi(name, [args], protocol, options);
- if (errMsg) {
- return invokeFail(id, name, errMsg);
- }
- return fn(args, {
- resolve: (res) => invokeSuccess(id, name, res),
- reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
- });
- };
- }
- function wrapperSyncApi(name, fn, protocol, options) {
- return (...args) => {
- const errMsg = beforeInvokeApi(name, args, protocol, options);
- if (errMsg) {
- throw new Error(errMsg);
- }
- return fn.apply(null, args);
- };
- }
- function wrapperAsyncApi(name, fn, protocol, options) {
- return wrapperTaskApi(name, fn, protocol, options);
- }
- function defineSyncApi(name, fn, protocol, options) {
- return wrapperSyncApi(name, fn, protocol, options);
- }
- function defineAsyncApi(name, fn, protocol, options) {
- return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
- }
- const API_UPX2PX = "upx2px";
- const Upx2pxProtocol = [
- {
- name: "upx",
- type: [Number, String],
- required: true
- }
- ];
- const EPS = 1e-4;
- const BASE_DEVICE_WIDTH = 750;
- let isIOS = false;
- let deviceWidth = 0;
- let deviceDPR = 0;
- function checkDeviceWidth() {
- const { platform, pixelRatio, windowWidth } = getBaseSystemInfo();
- deviceWidth = windowWidth;
- deviceDPR = pixelRatio;
- isIOS = platform === "ios";
- }
- const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
- if (deviceWidth === 0) {
- checkDeviceWidth();
- }
- number = Number(number);
- if (number === 0) {
- return 0;
- }
- let width = newDeviceWidth || deviceWidth;
- let result2 = number / BASE_DEVICE_WIDTH * width;
- if (result2 < 0) {
- result2 = -result2;
- }
- result2 = Math.floor(result2 + EPS);
- if (result2 === 0) {
- if (deviceDPR === 1 || !isIOS) {
- result2 = 1;
- } else {
- result2 = 0.5;
- }
- }
- return number < 0 ? -result2 : result2;
- }, Upx2pxProtocol);
- const API_ADD_INTERCEPTOR = "addInterceptor";
- const API_REMOVE_INTERCEPTOR = "removeInterceptor";
- const AddInterceptorProtocol = [
- {
- name: "method",
- type: [String, Object],
- required: true
- }
- ];
- const RemoveInterceptorProtocol = AddInterceptorProtocol;
- function mergeInterceptorHook(interceptors2, interceptor) {
- Object.keys(interceptor).forEach((hook) => {
- if (isFunction(interceptor[hook])) {
- interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
- }
- });
- }
- function removeInterceptorHook(interceptors2, interceptor) {
- if (!interceptors2 || !interceptor) {
- return;
- }
- Object.keys(interceptor).forEach((name) => {
- const hooks = interceptors2[name];
- const hook = interceptor[name];
- if (isArray$1(hooks) && isFunction(hook)) {
- remove(hooks, hook);
- }
- });
- }
- function mergeHook(parentVal, childVal) {
- const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray$1(childVal) ? childVal : [childVal] : parentVal;
- return res ? dedupeHooks(res) : res;
- }
- function dedupeHooks(hooks) {
- const res = [];
- for (let i2 = 0; i2 < hooks.length; i2++) {
- if (res.indexOf(hooks[i2]) === -1) {
- res.push(hooks[i2]);
- }
- }
- return res;
- }
- const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
- if (isString(method) && isPlainObject$2(interceptor)) {
- mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
- } else if (isPlainObject$2(method)) {
- mergeInterceptorHook(globalInterceptors, method);
- }
- }, AddInterceptorProtocol);
- const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
- if (isString(method)) {
- if (isPlainObject$2(interceptor)) {
- removeInterceptorHook(scopedInterceptors[method], interceptor);
- } else {
- delete scopedInterceptors[method];
- }
- } else if (isPlainObject$2(method)) {
- removeInterceptorHook(globalInterceptors, method);
- }
- }, RemoveInterceptorProtocol);
- const interceptors = {};
- const API_ON = "$on";
- const OnProtocol = [
- {
- name: "event",
- type: String,
- required: true
- },
- {
- name: "callback",
- type: Function,
- required: true
- }
- ];
- const API_ONCE = "$once";
- const OnceProtocol = OnProtocol;
- const API_OFF = "$off";
- const OffProtocol = [
- {
- name: "event",
- type: [String, Array]
- },
- {
- name: "callback",
- type: Function
- }
- ];
- const API_EMIT = "$emit";
- const EmitProtocol = [
- {
- name: "event",
- type: String,
- required: true
- }
- ];
- const emitter = new E$1$1();
- const $on = defineSyncApi(API_ON, (name, callback) => {
- emitter.on(name, callback);
- return () => emitter.off(name, callback);
- }, OnProtocol);
- const $once = defineSyncApi(API_ONCE, (name, callback) => {
- emitter.once(name, callback);
- return () => emitter.off(name, callback);
- }, OnceProtocol);
- const $off = defineSyncApi(API_OFF, (name, callback) => {
- if (!name) {
- emitter.e = {};
- return;
- }
- if (!isArray$1(name))
- name = [name];
- name.forEach((n2) => emitter.off(n2, callback));
- }, OffProtocol);
- const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
- emitter.emit(name, ...args);
- }, EmitProtocol);
- let cid;
- let cidErrMsg;
- let enabled;
- function normalizePushMessage(message) {
- try {
- return JSON.parse(message);
- } catch (e2) {
- }
- return message;
- }
- function invokePushCallback(args) {
- if (args.type === "enabled") {
- enabled = true;
- } else if (args.type === "clientId") {
- cid = args.cid;
- cidErrMsg = args.errMsg;
- invokeGetPushCidCallbacks(cid, args.errMsg);
- } else if (args.type === "pushMsg") {
- const message = {
- type: "receive",
- data: normalizePushMessage(args.message)
- };
- for (let i2 = 0; i2 < onPushMessageCallbacks.length; i2++) {
- const callback = onPushMessageCallbacks[i2];
- callback(message);
- if (message.stopped) {
- break;
- }
- }
- } else if (args.type === "click") {
- onPushMessageCallbacks.forEach((callback) => {
- callback({
- type: "click",
- data: normalizePushMessage(args.message)
- });
- });
- }
- }
- const getPushCidCallbacks = [];
- function invokeGetPushCidCallbacks(cid2, errMsg) {
- getPushCidCallbacks.forEach((callback) => {
- callback(cid2, errMsg);
- });
- getPushCidCallbacks.length = 0;
- }
- const API_GET_PUSH_CLIENT_ID = "getPushClientId";
- const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_2, { resolve: resolve2, reject }) => {
- Promise.resolve().then(() => {
- if (typeof enabled === "undefined") {
- enabled = false;
- cid = "";
- cidErrMsg = "uniPush is not enabled";
- }
- getPushCidCallbacks.push((cid2, errMsg) => {
- if (cid2) {
- resolve2({ cid: cid2 });
- } else {
- reject(errMsg);
- }
- });
- if (typeof cid !== "undefined") {
- invokeGetPushCidCallbacks(cid, cidErrMsg);
- }
- });
- });
- const onPushMessageCallbacks = [];
- const onPushMessage = (fn) => {
- if (onPushMessageCallbacks.indexOf(fn) === -1) {
- onPushMessageCallbacks.push(fn);
- }
- };
- const offPushMessage = (fn) => {
- if (!fn) {
- onPushMessageCallbacks.length = 0;
- } else {
- const index2 = onPushMessageCallbacks.indexOf(fn);
- if (index2 > -1) {
- onPushMessageCallbacks.splice(index2, 1);
- }
- }
- };
- 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/;
- const CONTEXT_API_RE = /^create|Manager$/;
- const CONTEXT_API_RE_EXC = ["createBLEConnection"];
- const ASYNC_API = ["createBLEConnection"];
- const CALLBACK_API_RE = /^on|^off/;
- function isContextApi(name) {
- return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
- }
- function isSyncApi(name) {
- return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
- }
- function isCallbackApi(name) {
- return CALLBACK_API_RE.test(name) && name !== "onPush";
- }
- function shouldPromise(name) {
- if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
- return false;
- }
- return true;
- }
- if (!Promise.prototype.finally) {
- Promise.prototype.finally = function(onfinally) {
- const promise = this.constructor;
- return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
- throw reason;
- }));
- };
- }
- function promisify(name, api) {
- if (!shouldPromise(name)) {
- return api;
- }
- if (!isFunction(api)) {
- return api;
- }
- return function promiseApi(options = {}, ...rest) {
- if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
- return wrapperReturnValue(name, invokeApi(name, api, options, rest));
- }
- return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
- invokeApi(name, api, extend({}, options, {
- success: resolve2,
- fail: reject
- }), rest);
- })));
- };
- }
- const CALLBACKS = ["success", "fail", "cancel", "complete"];
- function initWrapper(protocols2) {
- function processCallback(methodName, method, returnValue) {
- return function(res) {
- return method(processReturnValue(methodName, res, returnValue));
- };
- }
- function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
- if (isPlainObject$2(fromArgs)) {
- const toArgs = keepFromArgs === true ? fromArgs : {};
- if (isFunction(argsOption)) {
- argsOption = argsOption(fromArgs, toArgs) || {};
- }
- for (const key in fromArgs) {
- if (hasOwn$1(argsOption, key)) {
- let keyOption = argsOption[key];
- if (isFunction(keyOption)) {
- keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
- }
- if (!keyOption) {
- console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
- } else if (isString(keyOption)) {
- toArgs[keyOption] = fromArgs[key];
- } else if (isPlainObject$2(keyOption)) {
- toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
- }
- } else if (CALLBACKS.indexOf(key) !== -1) {
- const callback = fromArgs[key];
- if (isFunction(callback)) {
- toArgs[key] = processCallback(methodName, callback, returnValue);
- }
- } else {
- if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
- toArgs[key] = fromArgs[key];
- }
- }
- }
- return toArgs;
- } else if (isFunction(fromArgs)) {
- fromArgs = processCallback(methodName, fromArgs, returnValue);
- }
- return fromArgs;
- }
- function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
- if (isFunction(protocols2.returnValue)) {
- res = protocols2.returnValue(methodName, res);
- }
- return processArgs(methodName, res, returnValue, {}, keepReturnValue);
- }
- return function wrapper(methodName, method) {
- if (!hasOwn$1(protocols2, methodName)) {
- return method;
- }
- const protocol = protocols2[methodName];
- if (!protocol) {
- return function() {
- console.error(`微信小程序 暂不支持${methodName}`);
- };
- }
- return function(arg1, arg2) {
- let options = protocol;
- if (isFunction(protocol)) {
- options = protocol(arg1);
- }
- arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
- const args = [arg1];
- if (typeof arg2 !== "undefined") {
- args.push(arg2);
- }
- const returnValue = wx[options.name || methodName].apply(wx, args);
- if (isSyncApi(methodName)) {
- return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
- }
- return returnValue;
- };
- };
- }
- const getLocale = () => {
- const app = isFunction(getApp) && getApp({ allowDefault: true });
- if (app && app.$vm) {
- return app.$vm.$locale;
- }
- return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
- };
- const setLocale = (locale) => {
- const app = isFunction(getApp) && getApp();
- if (!app) {
- return false;
- }
- const oldLocale = app.$vm.$locale;
- if (oldLocale !== locale) {
- app.$vm.$locale = locale;
- onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
- return true;
- }
- return false;
- };
- const onLocaleChangeCallbacks = [];
- const onLocaleChange = (fn) => {
- if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
- onLocaleChangeCallbacks.push(fn);
- }
- };
- if (typeof global !== "undefined") {
- global.getLocale = getLocale;
- }
- const UUID_KEY = "__DC_STAT_UUID";
- let deviceId;
- function useDeviceId(global2 = wx) {
- return function addDeviceId(_2, toRes) {
- deviceId = deviceId || global2.getStorageSync(UUID_KEY);
- if (!deviceId) {
- deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
- wx.setStorage({
- key: UUID_KEY,
- data: deviceId
- });
- }
- toRes.deviceId = deviceId;
- };
- }
- function addSafeAreaInsets(fromRes, toRes) {
- if (fromRes.safeArea) {
- const safeArea = fromRes.safeArea;
- toRes.safeAreaInsets = {
- top: safeArea.top,
- left: safeArea.left,
- right: fromRes.windowWidth - safeArea.right,
- bottom: fromRes.screenHeight - safeArea.bottom
- };
- }
- }
- function populateParameters(fromRes, toRes) {
- const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
- let osName = "";
- let osVersion = "";
- {
- osName = system.split(" ")[0] || "";
- osVersion = system.split(" ")[1] || "";
- }
- let hostVersion = version2;
- let deviceType = getGetDeviceType(fromRes, model);
- let deviceBrand = getDeviceBrand(brand);
- let _hostName = getHostName(fromRes);
- let _deviceOrientation = deviceOrientation;
- let _devicePixelRatio = pixelRatio;
- let _SDKVersion = SDKVersion;
- const hostLanguage = language.replace(/_/g, "-");
- const parameters = {
- appId: "__UNI__7806143",
- appName: "常来此购",
- appVersion: "1.8.3",
- appVersionCode: 183,
- appLanguage: getAppLanguage(hostLanguage),
- uniCompileVersion: "4.08",
- uniRuntimeVersion: "4.08",
- uniPlatform: "mp-weixin",
- deviceBrand,
- deviceModel: model,
- deviceType,
- devicePixelRatio: _devicePixelRatio,
- deviceOrientation: _deviceOrientation,
- osName: osName.toLocaleLowerCase(),
- osVersion,
- hostTheme: theme,
- hostVersion,
- hostLanguage,
- hostName: _hostName,
- hostSDKVersion: _SDKVersion,
- hostFontSizeSetting: fontSizeSetting,
- windowTop: 0,
- windowBottom: 0,
- // TODO
- osLanguage: void 0,
- osTheme: void 0,
- ua: void 0,
- hostPackageName: void 0,
- browserName: void 0,
- browserVersion: void 0
- };
- extend(toRes, parameters);
- }
- function getGetDeviceType(fromRes, model) {
- let deviceType = fromRes.deviceType || "phone";
- {
- const deviceTypeMaps = {
- ipad: "pad",
- windows: "pc",
- mac: "pc"
- };
- const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
- const _model = model.toLocaleLowerCase();
- for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
- const _m = deviceTypeMapsKeys[index2];
- if (_model.indexOf(_m) !== -1) {
- deviceType = deviceTypeMaps[_m];
- break;
- }
- }
- }
- return deviceType;
- }
- function getDeviceBrand(brand) {
- let deviceBrand = brand;
- if (deviceBrand) {
- deviceBrand = deviceBrand.toLocaleLowerCase();
- }
- return deviceBrand;
- }
- function getAppLanguage(defaultLanguage) {
- return getLocale ? getLocale() : defaultLanguage;
- }
- function getHostName(fromRes) {
- const _platform = "WeChat";
- let _hostName = fromRes.hostName || _platform;
- {
- if (fromRes.environment) {
- _hostName = fromRes.environment;
- } else if (fromRes.host && fromRes.host.env) {
- _hostName = fromRes.host.env;
- }
- }
- return _hostName;
- }
- const getSystemInfo = {
- returnValue: (fromRes, toRes) => {
- addSafeAreaInsets(fromRes, toRes);
- useDeviceId()(fromRes, toRes);
- populateParameters(fromRes, toRes);
- }
- };
- const getSystemInfoSync = getSystemInfo;
- const redirectTo = {};
- const previewImage = {
- args(fromArgs, toArgs) {
- let currentIndex = parseInt(fromArgs.current);
- if (isNaN(currentIndex)) {
- return;
- }
- const urls = fromArgs.urls;
- if (!isArray$1(urls)) {
- return;
- }
- const len = urls.length;
- if (!len) {
- return;
- }
- if (currentIndex < 0) {
- currentIndex = 0;
- } else if (currentIndex >= len) {
- currentIndex = len - 1;
- }
- if (currentIndex > 0) {
- toArgs.current = urls[currentIndex];
- toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
- } else {
- toArgs.current = urls[0];
- }
- return {
- indicator: false,
- loop: false
- };
- }
- };
- const showActionSheet = {
- args(fromArgs, toArgs) {
- toArgs.alertText = fromArgs.title;
- }
- };
- const getDeviceInfo = {
- returnValue: (fromRes, toRes) => {
- const { brand, model } = fromRes;
- let deviceType = getGetDeviceType(fromRes, model);
- let deviceBrand = getDeviceBrand(brand);
- useDeviceId()(fromRes, toRes);
- toRes = sortObject(extend(toRes, {
- deviceType,
- deviceBrand,
- deviceModel: model
- }));
- }
- };
- const getAppBaseInfo = {
- returnValue: (fromRes, toRes) => {
- const { version: version2, language, SDKVersion, theme } = fromRes;
- let _hostName = getHostName(fromRes);
- let hostLanguage = language.replace(/_/g, "-");
- toRes = sortObject(extend(toRes, {
- hostVersion: version2,
- hostLanguage,
- hostName: _hostName,
- hostSDKVersion: SDKVersion,
- hostTheme: theme,
- appId: "__UNI__7806143",
- appName: "常来此购",
- appVersion: "1.8.3",
- appVersionCode: 183,
- appLanguage: getAppLanguage(hostLanguage)
- }));
- }
- };
- const getWindowInfo = {
- returnValue: (fromRes, toRes) => {
- addSafeAreaInsets(fromRes, toRes);
- toRes = sortObject(extend(toRes, {
- windowTop: 0,
- windowBottom: 0
- }));
- }
- };
- const getAppAuthorizeSetting = {
- returnValue: function(fromRes, toRes) {
- const { locationReducedAccuracy } = fromRes;
- toRes.locationAccuracy = "unsupported";
- if (locationReducedAccuracy === true) {
- toRes.locationAccuracy = "reduced";
- } else if (locationReducedAccuracy === false) {
- toRes.locationAccuracy = "full";
- }
- }
- };
- const baseApis = {
- $on,
- $off,
- $once,
- $emit,
- upx2px,
- interceptors,
- addInterceptor,
- removeInterceptor,
- onCreateVueApp,
- invokeCreateVueAppHook,
- getLocale,
- setLocale,
- onLocaleChange,
- getPushClientId,
- onPushMessage,
- offPushMessage,
- invokePushCallback
- };
- function initUni(api, protocols2, platform = wx) {
- const wrapper = initWrapper(protocols2);
- const UniProxyHandlers = {
- get(target, key) {
- if (hasOwn$1(target, key)) {
- return target[key];
- }
- if (hasOwn$1(api, key)) {
- return promisify(key, api[key]);
- }
- if (hasOwn$1(baseApis, key)) {
- return promisify(key, baseApis[key]);
- }
- return promisify(key, wrapper(key, platform[key]));
- }
- };
- return new Proxy({}, UniProxyHandlers);
- }
- function initGetProvider(providers) {
- return function getProvider2({ service, success, fail, complete }) {
- let res;
- if (providers[service]) {
- res = {
- errMsg: "getProvider:ok",
- service,
- provider: providers[service]
- };
- isFunction(success) && success(res);
- } else {
- res = {
- errMsg: "getProvider:fail:服务[" + service + "]不存在"
- };
- isFunction(fail) && fail(res);
- }
- isFunction(complete) && complete(res);
- };
- }
- const objectKeys = [
- "qy",
- "env",
- "error",
- "version",
- "lanDebug",
- "cloud",
- "serviceMarket",
- "router",
- "worklet",
- "__webpack_require_UNI_MP_PLUGIN__"
- ];
- const singlePageDisableKey = ["lanDebug", "router", "worklet"];
- const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
- function isWxKey(key) {
- if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
- return false;
- }
- return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
- }
- function initWx() {
- const newWx = {};
- for (const key in wx) {
- if (isWxKey(key)) {
- newWx[key] = wx[key];
- }
- }
- if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
- globalThis.wx = newWx;
- }
- return newWx;
- }
- const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
- const getProvider = initGetProvider({
- oauth: ["weixin"],
- share: ["weixin"],
- payment: ["wxpay"],
- push: ["weixin"]
- });
- function initComponentMocks(component) {
- const res = /* @__PURE__ */ Object.create(null);
- mocks$1.forEach((name) => {
- res[name] = component[name];
- });
- return res;
- }
- function createSelectorQuery() {
- const query = wx$2.createSelectorQuery();
- const oldIn = query.in;
- query.in = function newIn(component) {
- return oldIn.call(this, initComponentMocks(component));
- };
- return query;
- }
- const wx$2 = initWx();
- let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
- if (!baseInfo) {
- baseInfo = wx$2.getSystemInfoSync();
- }
- const host = baseInfo ? baseInfo.host : null;
- const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
- var shims = /* @__PURE__ */ Object.freeze({
- __proto__: null,
- createSelectorQuery,
- getProvider,
- shareVideoMessage
- });
- const compressImage = {
- args(fromArgs, toArgs) {
- if (fromArgs.compressedHeight && !toArgs.compressHeight) {
- toArgs.compressHeight = fromArgs.compressedHeight;
- }
- if (fromArgs.compressedWidth && !toArgs.compressWidth) {
- toArgs.compressWidth = fromArgs.compressedWidth;
- }
- }
- };
- var protocols = /* @__PURE__ */ Object.freeze({
- __proto__: null,
- compressImage,
- getAppAuthorizeSetting,
- getAppBaseInfo,
- getDeviceInfo,
- getSystemInfo,
- getSystemInfoSync,
- getWindowInfo,
- previewImage,
- redirectTo,
- showActionSheet
- });
- const wx$1 = initWx();
- var index$1 = initUni(shims, protocols, wx$1);
- const _export_sfc = (sfc, props) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props) {
- target[key] = val;
- }
- return target;
- };
- function warn$1(msg, ...args) {
- console.warn(`[Vue warn] ${msg}`, ...args);
- }
- let activeEffectScope;
- class EffectScope {
- constructor(detached = false) {
- this.detached = detached;
- this._active = true;
- this.effects = [];
- this.cleanups = [];
- this.parent = activeEffectScope;
- if (!detached && activeEffectScope) {
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
- }
- }
- get active() {
- return this._active;
- }
- run(fn) {
- if (this._active) {
- const currentEffectScope = activeEffectScope;
- try {
- activeEffectScope = this;
- return fn();
- } finally {
- activeEffectScope = currentEffectScope;
- }
- } else {
- warn$1(`cannot run an inactive effect scope.`);
- }
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- on() {
- activeEffectScope = this;
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- off() {
- activeEffectScope = this.parent;
- }
- stop(fromParent) {
- if (this._active) {
- let i2, l2;
- for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
- this.effects[i2].stop();
- }
- for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
- this.cleanups[i2]();
- }
- if (this.scopes) {
- for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
- this.scopes[i2].stop(true);
- }
- }
- if (!this.detached && this.parent && !fromParent) {
- const last = this.parent.scopes.pop();
- if (last && last !== this) {
- this.parent.scopes[this.index] = last;
- last.index = this.index;
- }
- }
- this.parent = void 0;
- this._active = false;
- }
- }
- }
- function effectScope(detached) {
- return new EffectScope(detached);
- }
- function recordEffectScope(effect, scope = activeEffectScope) {
- if (scope && scope.active) {
- scope.effects.push(effect);
- }
- }
- function getCurrentScope() {
- return activeEffectScope;
- }
- function onScopeDispose(fn) {
- if (activeEffectScope) {
- activeEffectScope.cleanups.push(fn);
- } else {
- warn$1(`onScopeDispose() is called when there is no active effect scope to be associated with.`);
- }
- }
- const createDep = (effects) => {
- const dep = new Set(effects);
- dep.w = 0;
- dep.n = 0;
- return dep;
- };
- const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
- const newTracked = (dep) => (dep.n & trackOpBit) > 0;
- const initDepMarkers = ({ deps }) => {
- if (deps.length) {
- for (let i2 = 0; i2 < deps.length; i2++) {
- deps[i2].w |= trackOpBit;
- }
- }
- };
- const finalizeDepMarkers = (effect) => {
- const { deps } = effect;
- if (deps.length) {
- let ptr = 0;
- for (let i2 = 0; i2 < deps.length; i2++) {
- const dep = deps[i2];
- if (wasTracked(dep) && !newTracked(dep)) {
- dep.delete(effect);
- } else {
- deps[ptr++] = dep;
- }
- dep.w &= ~trackOpBit;
- dep.n &= ~trackOpBit;
- }
- deps.length = ptr;
- }
- };
- const targetMap = /* @__PURE__ */ new WeakMap();
- let effectTrackDepth = 0;
- let trackOpBit = 1;
- const maxMarkerBits = 30;
- let activeEffect;
- const ITERATE_KEY = Symbol("iterate");
- const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
- class ReactiveEffect {
- constructor(fn, scheduler = null, scope) {
- this.fn = fn;
- this.scheduler = scheduler;
- this.active = true;
- this.deps = [];
- this.parent = void 0;
- recordEffectScope(this, scope);
- }
- run() {
- if (!this.active) {
- return this.fn();
- }
- let parent = activeEffect;
- let lastShouldTrack = shouldTrack;
- while (parent) {
- if (parent === this) {
- return;
- }
- parent = parent.parent;
- }
- try {
- this.parent = activeEffect;
- activeEffect = this;
- shouldTrack = true;
- trackOpBit = 1 << ++effectTrackDepth;
- if (effectTrackDepth <= maxMarkerBits) {
- initDepMarkers(this);
- } else {
- cleanupEffect(this);
- }
- return this.fn();
- } finally {
- if (effectTrackDepth <= maxMarkerBits) {
- finalizeDepMarkers(this);
- }
- trackOpBit = 1 << --effectTrackDepth;
- activeEffect = this.parent;
- shouldTrack = lastShouldTrack;
- this.parent = void 0;
- if (this.deferStop) {
- this.stop();
- }
- }
- }
- stop() {
- if (activeEffect === this) {
- this.deferStop = true;
- } else if (this.active) {
- cleanupEffect(this);
- if (this.onStop) {
- this.onStop();
- }
- this.active = false;
- }
- }
- }
- function cleanupEffect(effect) {
- const { deps } = effect;
- if (deps.length) {
- for (let i2 = 0; i2 < deps.length; i2++) {
- deps[i2].delete(effect);
- }
- deps.length = 0;
- }
- }
- let shouldTrack = true;
- const trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (shouldTrack && activeEffect) {
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = createDep());
- }
- const eventInfo = { effect: activeEffect, target, type, key };
- trackEffects(dep, eventInfo);
- }
- }
- function trackEffects(dep, debuggerEventExtraInfo) {
- let shouldTrack2 = false;
- if (effectTrackDepth <= maxMarkerBits) {
- if (!newTracked(dep)) {
- dep.n |= trackOpBit;
- shouldTrack2 = !wasTracked(dep);
- }
- } else {
- shouldTrack2 = !dep.has(activeEffect);
- }
- if (shouldTrack2) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.onTrack) {
- activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- let deps = [];
- if (type === "clear") {
- deps = [...depsMap.values()];
- } else if (key === "length" && isArray$1(target)) {
- const newLength = Number(newValue);
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newLength) {
- deps.push(dep);
- }
- });
- } else {
- if (key !== void 0) {
- deps.push(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!isArray$1(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (isIntegerKey(key)) {
- deps.push(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!isArray$1(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (isMap(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const eventInfo = { target, type, key, newValue, oldValue, oldTarget };
- if (deps.length === 1) {
- if (deps[0]) {
- {
- triggerEffects(deps[0], eventInfo);
- }
- }
- } else {
- const effects = [];
- for (const dep of deps) {
- if (dep) {
- effects.push(...dep);
- }
- }
- {
- triggerEffects(createDep(effects), eventInfo);
- }
- }
- }
- function triggerEffects(dep, debuggerEventExtraInfo) {
- const effects = isArray$1(dep) ? dep : [...dep];
- for (const effect of effects) {
- if (effect.computed) {
- triggerEffect(effect, debuggerEventExtraInfo);
- }
- }
- for (const effect of effects) {
- if (!effect.computed) {
- triggerEffect(effect, debuggerEventExtraInfo);
- }
- }
- }
- function triggerEffect(effect, debuggerEventExtraInfo) {
- if (effect !== activeEffect || effect.allowRecurse) {
- if (effect.onTrigger) {
- effect.onTrigger(extend({ effect }, debuggerEventExtraInfo));
- }
- if (effect.scheduler) {
- effect.scheduler();
- } else {
- effect.run();
- }
- }
- }
- function getDepFromReactive(object, key) {
- var _a2;
- return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key);
- }
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
- const builtInSymbols = new Set(
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
- );
- const get$1 = /* @__PURE__ */ createGetter();
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
- const readonlyGet = /* @__PURE__ */ createGetter(true);
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
- function createArrayInstrumentations() {
- const instrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- instrumentations[key] = function(...args) {
- const arr = toRaw(this);
- for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
- track(arr, "get", i2 + "");
- }
- const res = arr[key](...args);
- if (res === -1 || res === false) {
- return arr[key](...args.map(toRaw));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- instrumentations[key] = function(...args) {
- pauseTracking();
- const res = toRaw(this)[key].apply(this, args);
- resetTracking();
- return res;
- };
- });
- return instrumentations;
- }
- function hasOwnProperty(key) {
- const obj = toRaw(this);
- track(obj, "has", key);
- return obj.hasOwnProperty(key);
- }
- function createGetter(isReadonly2 = false, shallow = false) {
- return function get2(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_isShallow") {
- return shallow;
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = isArray$1(target);
- if (!isReadonly2) {
- if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- if (key === "hasOwnProperty") {
- return hasOwnProperty;
- }
- }
- const res = Reflect.get(target, key, receiver);
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- return targetIsArray && isIntegerKey(key) ? res : res.value;
- }
- if (isObject$3(res)) {
- return isReadonly2 ? readonly(res) : reactive(res);
- }
- return res;
- };
- }
- const set$1 = /* @__PURE__ */ createSetter();
- const shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set2(target, key, value, receiver) {
- let oldValue = target[key];
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
- return false;
- }
- if (!shallow) {
- if (!isShallow(value) && !isReadonly(value)) {
- oldValue = toRaw(oldValue);
- value = toRaw(value);
- }
- if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
- const result2 = Reflect.set(target, key, value, receiver);
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result2;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = hasOwn$1(target, key);
- const oldValue = target[key];
- const result2 = Reflect.deleteProperty(target, key);
- if (result2 && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result2;
- }
- function has$1(target, key) {
- const result2 = Reflect.has(target, key);
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result2;
- }
- function ownKeys$5(target) {
- track(target, "iterate", isArray$1(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- const mutableHandlers = {
- get: get$1,
- set: set$1,
- deleteProperty,
- has: has$1,
- ownKeys: ownKeys$5
- };
- const readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- {
- warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- {
- warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- const shallowReadonlyHandlers = /* @__PURE__ */ extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- const toShallow = (value) => value;
- const getProto = (v2) => Reflect.getPrototypeOf(v2);
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
- target = target[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (key !== rawKey) {
- track(rawTarget, "get", key);
- }
- track(rawTarget, "get", rawKey);
- }
- const { has: has2 } = getProto(rawTarget);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has(key, isReadonly2 = false) {
- const target = this[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (key !== rawKey) {
- track(rawTarget, "has", key);
- }
- track(rawTarget, "has", rawKey);
- }
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw(value);
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$2(key, value) {
- value = toRaw(value);
- const target = toRaw(this);
- const { has: has2, get: get2 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get2.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw(this);
- const { has: has2, get: get2 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get2 ? get2.call(target, key) : void 0;
- const result2 = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result2;
- }
- function clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const oldTarget = isMap(target) ? new Map(target) : new Set(target);
- const result2 = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result2;
- }
- function createForEach(isReadonly2, isShallow2) {
- return function forEach3(callback, thisArg) {
- const observed = this;
- const target = observed[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- const rawTarget = toRaw(target);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow2) {
- return function(...args) {
- const target = this[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- // iterator protocol
- next() {
- const { value, done } = innerIterator.next();
- return done ? { value, done } : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- // iterable protocol
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
- }
- return type === "delete" ? false : this;
- };
- }
- function createInstrumentations() {
- const mutableInstrumentations2 = {
- get(key) {
- return get(this, key);
- },
- get size() {
- return size(this);
- },
- has,
- add,
- set: set$2,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- const shallowInstrumentations2 = {
- get(key) {
- return get(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has,
- add,
- set: set$2,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- const readonlyInstrumentations2 = {
- get(key) {
- return get(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has.call(this, key, true);
- },
- add: createReadonlyMethod(
- "add"
- /* TriggerOpTypes.ADD */
- ),
- set: createReadonlyMethod(
- "set"
- /* TriggerOpTypes.SET */
- ),
- delete: createReadonlyMethod(
- "delete"
- /* TriggerOpTypes.DELETE */
- ),
- clear: createReadonlyMethod(
- "clear"
- /* TriggerOpTypes.CLEAR */
- ),
- forEach: createForEach(true, false)
- };
- const shallowReadonlyInstrumentations2 = {
- get(key) {
- return get(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has.call(this, key, true);
- },
- add: createReadonlyMethod(
- "add"
- /* TriggerOpTypes.ADD */
- ),
- set: createReadonlyMethod(
- "set"
- /* TriggerOpTypes.SET */
- ),
- delete: createReadonlyMethod(
- "delete"
- /* TriggerOpTypes.DELETE */
- ),
- clear: createReadonlyMethod(
- "clear"
- /* TriggerOpTypes.CLEAR */
- ),
- forEach: createForEach(true, true)
- };
- const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
- });
- return [
- mutableInstrumentations2,
- readonlyInstrumentations2,
- shallowInstrumentations2,
- shallowReadonlyInstrumentations2
- ];
- }
- const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- const mutableCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, false)
- };
- const shallowCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, true)
- };
- const readonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, false)
- };
- const shallowReadonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = toRawType(target);
- 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.`);
- }
- }
- const reactiveMap = /* @__PURE__ */ new WeakMap();
- const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
- const readonlyMap = /* @__PURE__ */ new WeakMap();
- const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value[
- "__v_skip"
- /* ReactiveFlags.SKIP */
- ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
- }
- function reactive(target) {
- if (isReadonly(target)) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function shallowReactive(target) {
- return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function shallowReadonly(target) {
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject$3(target)) {
- {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ] && !(isReadonly2 && target[
- "__v_isReactive"
- /* ReactiveFlags.IS_REACTIVE */
- ])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive(value) {
- if (isReadonly(value)) {
- return isReactive(value[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ]);
- }
- return !!(value && value[
- "__v_isReactive"
- /* ReactiveFlags.IS_REACTIVE */
- ]);
- }
- function isReadonly(value) {
- return !!(value && value[
- "__v_isReadonly"
- /* ReactiveFlags.IS_READONLY */
- ]);
- }
- function isShallow(value) {
- return !!(value && value[
- "__v_isShallow"
- /* ReactiveFlags.IS_SHALLOW */
- ]);
- }
- function isProxy(value) {
- return isReactive(value) || isReadonly(value);
- }
- function toRaw(observed) {
- const raw = observed && observed[
- "__v_raw"
- /* ReactiveFlags.RAW */
- ];
- return raw ? toRaw(raw) : observed;
- }
- function markRaw(value) {
- def(value, "__v_skip", true);
- return value;
- }
- const toReactive = (value) => isObject$3(value) ? reactive(value) : value;
- const toReadonly = (value) => isObject$3(value) ? readonly(value) : value;
- function trackRefValue(ref2) {
- if (shouldTrack && activeEffect) {
- ref2 = toRaw(ref2);
- {
- trackEffects(ref2.dep || (ref2.dep = createDep()), {
- target: ref2,
- type: "get",
- key: "value"
- });
- }
- }
- }
- function triggerRefValue(ref2, newVal) {
- ref2 = toRaw(ref2);
- const dep = ref2.dep;
- if (dep) {
- {
- triggerEffects(dep, {
- target: ref2,
- type: "set",
- key: "value",
- newValue: newVal
- });
- }
- }
- }
- function isRef(r2) {
- return !!(r2 && r2.__v_isRef === true);
- }
- function ref(value) {
- return createRef(value, false);
- }
- function createRef(rawValue, shallow) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- class RefImpl {
- constructor(value, __v_isShallow) {
- this.__v_isShallow = __v_isShallow;
- this.dep = void 0;
- this.__v_isRef = true;
- this._rawValue = __v_isShallow ? value : toRaw(value);
- this._value = __v_isShallow ? value : toReactive(value);
- }
- get value() {
- trackRefValue(this);
- return this._value;
- }
- set value(newVal) {
- const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
- newVal = useDirectValue ? newVal : toRaw(newVal);
- if (hasChanged(newVal, this._rawValue)) {
- this._rawValue = newVal;
- this._value = useDirectValue ? newVal : toReactive(newVal);
- triggerRefValue(this, newVal);
- }
- }
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- const shallowUnwrapHandlers = {
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = isArray$1(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = toRef(object, key);
- }
- return ret;
- }
- class ObjectRefImpl {
- constructor(_object, _key, _defaultValue) {
- this._object = _object;
- this._key = _key;
- this._defaultValue = _defaultValue;
- this.__v_isRef = true;
- }
- get value() {
- const val = this._object[this._key];
- return val === void 0 ? this._defaultValue : val;
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- get dep() {
- return getDepFromReactive(toRaw(this._object), this._key);
- }
- }
- function toRef(object, key, defaultValue) {
- const val = object[key];
- return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
- }
- var _a$1;
- class ComputedRefImpl {
- constructor(getter, _setter, isReadonly2, isSSR) {
- this._setter = _setter;
- this.dep = void 0;
- this.__v_isRef = true;
- this[_a$1] = false;
- this._dirty = true;
- this.effect = new ReactiveEffect(getter, () => {
- if (!this._dirty) {
- this._dirty = true;
- triggerRefValue(this);
- }
- });
- this.effect.computed = this;
- this.effect.active = this._cacheable = !isSSR;
- this[
- "__v_isReadonly"
- /* ReactiveFlags.IS_READONLY */
- ] = isReadonly2;
- }
- get value() {
- const self2 = toRaw(this);
- trackRefValue(self2);
- if (self2._dirty || !self2._cacheable) {
- self2._dirty = false;
- self2._value = self2.effect.run();
- }
- return self2._value;
- }
- set value(newValue) {
- this._setter(newValue);
- }
- }
- _a$1 = "__v_isReadonly";
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
- let getter;
- let setter;
- const onlyGetter = isFunction(getterOrOptions);
- if (onlyGetter) {
- getter = getterOrOptions;
- setter = () => {
- console.warn("Write operation failed: computed value is readonly");
- };
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
- if (debugOptions && !isSSR) {
- cRef.effect.onTrack = debugOptions.onTrack;
- cRef.effect.onTrigger = debugOptions.onTrigger;
- }
- return cRef;
- }
- const stack = [];
- function pushWarningContext(vnode) {
- stack.push(vnode);
- }
- function popWarningContext() {
- stack.pop();
- }
- function warn(msg, ...args) {
- pauseTracking();
- const instance = stack.length ? stack[stack.length - 1].component : null;
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
- const trace = getComponentTrace();
- if (appWarnHandler) {
- callWithErrorHandling(appWarnHandler, instance, 11, [
- msg + args.join(""),
- instance && instance.proxy,
- trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
- trace
- ]);
- } else {
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
- if (trace.length && // avoid spamming console during tests
- true) {
- warnArgs.push(`
- `, ...formatTrace(trace));
- }
- console.warn(...warnArgs);
- }
- resetTracking();
- }
- function getComponentTrace() {
- let currentVNode = stack[stack.length - 1];
- if (!currentVNode) {
- return [];
- }
- const normalizedStack = [];
- while (currentVNode) {
- const last = normalizedStack[0];
- if (last && last.vnode === currentVNode) {
- last.recurseCount++;
- } else {
- normalizedStack.push({
- vnode: currentVNode,
- recurseCount: 0
- });
- }
- const parentInstance = currentVNode.component && currentVNode.component.parent;
- currentVNode = parentInstance && parentInstance.vnode;
- }
- return normalizedStack;
- }
- function formatTrace(trace) {
- const logs = [];
- trace.forEach((entry, i2) => {
- logs.push(...i2 === 0 ? [] : [`
- `], ...formatTraceEntry(entry));
- });
- return logs;
- }
- function formatTraceEntry({ vnode, recurseCount }) {
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
- const isRoot = vnode.component ? vnode.component.parent == null : false;
- const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
- const close = `>` + postfix;
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
- }
- function formatProps(props) {
- const res = [];
- const keys = Object.keys(props);
- keys.slice(0, 3).forEach((key) => {
- res.push(...formatProp(key, props[key]));
- });
- if (keys.length > 3) {
- res.push(` ...`);
- }
- return res;
- }
- function formatProp(key, value, raw) {
- if (isString(value)) {
- value = JSON.stringify(value);
- return raw ? value : [`${key}=${value}`];
- } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
- return raw ? value : [`${key}=${value}`];
- } else if (isRef(value)) {
- value = formatProp(key, toRaw(value.value), true);
- return raw ? value : [`${key}=Ref<`, value, `>`];
- } else if (isFunction(value)) {
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
- } else {
- value = toRaw(value);
- return raw ? value : [`${key}=`, value];
- }
- }
- const ErrorTypeStrings = {
- [
- "sp"
- /* LifecycleHooks.SERVER_PREFETCH */
- ]: "serverPrefetch hook",
- [
- "bc"
- /* LifecycleHooks.BEFORE_CREATE */
- ]: "beforeCreate hook",
- [
- "c"
- /* LifecycleHooks.CREATED */
- ]: "created hook",
- [
- "bm"
- /* LifecycleHooks.BEFORE_MOUNT */
- ]: "beforeMount hook",
- [
- "m"
- /* LifecycleHooks.MOUNTED */
- ]: "mounted hook",
- [
- "bu"
- /* LifecycleHooks.BEFORE_UPDATE */
- ]: "beforeUpdate hook",
- [
- "u"
- /* LifecycleHooks.UPDATED */
- ]: "updated",
- [
- "bum"
- /* LifecycleHooks.BEFORE_UNMOUNT */
- ]: "beforeUnmount hook",
- [
- "um"
- /* LifecycleHooks.UNMOUNTED */
- ]: "unmounted hook",
- [
- "a"
- /* LifecycleHooks.ACTIVATED */
- ]: "activated hook",
- [
- "da"
- /* LifecycleHooks.DEACTIVATED */
- ]: "deactivated hook",
- [
- "ec"
- /* LifecycleHooks.ERROR_CAPTURED */
- ]: "errorCaptured hook",
- [
- "rtc"
- /* LifecycleHooks.RENDER_TRACKED */
- ]: "renderTracked hook",
- [
- "rtg"
- /* LifecycleHooks.RENDER_TRIGGERED */
- ]: "renderTriggered hook",
- [
- 0
- /* ErrorCodes.SETUP_FUNCTION */
- ]: "setup function",
- [
- 1
- /* ErrorCodes.RENDER_FUNCTION */
- ]: "render function",
- [
- 2
- /* ErrorCodes.WATCH_GETTER */
- ]: "watcher getter",
- [
- 3
- /* ErrorCodes.WATCH_CALLBACK */
- ]: "watcher callback",
- [
- 4
- /* ErrorCodes.WATCH_CLEANUP */
- ]: "watcher cleanup function",
- [
- 5
- /* ErrorCodes.NATIVE_EVENT_HANDLER */
- ]: "native event handler",
- [
- 6
- /* ErrorCodes.COMPONENT_EVENT_HANDLER */
- ]: "component event handler",
- [
- 7
- /* ErrorCodes.VNODE_HOOK */
- ]: "vnode hook",
- [
- 8
- /* ErrorCodes.DIRECTIVE_HOOK */
- ]: "directive hook",
- [
- 9
- /* ErrorCodes.TRANSITION_HOOK */
- ]: "transition hook",
- [
- 10
- /* ErrorCodes.APP_ERROR_HANDLER */
- ]: "app errorHandler",
- [
- 11
- /* ErrorCodes.APP_WARN_HANDLER */
- ]: "app warnHandler",
- [
- 12
- /* ErrorCodes.FUNCTION_REF */
- ]: "ref function",
- [
- 13
- /* ErrorCodes.ASYNC_COMPONENT_LOADER */
- ]: "async component loader",
- [
- 14
- /* ErrorCodes.SCHEDULER */
- ]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
- };
- function callWithErrorHandling(fn, instance, type, args) {
- let res;
- try {
- res = args ? fn(...args) : fn();
- } catch (err) {
- handleError(err, instance, type);
- }
- return res;
- }
- function callWithAsyncErrorHandling(fn, instance, type, args) {
- if (isFunction(fn)) {
- const res = callWithErrorHandling(fn, instance, type, args);
- if (res && isPromise(res)) {
- res.catch((err) => {
- handleError(err, instance, type);
- });
- }
- return res;
- }
- const values = [];
- for (let i2 = 0; i2 < fn.length; i2++) {
- values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
- }
- return values;
- }
- function handleError(err, instance, type, throwInDev = true) {
- const contextVNode = instance ? instance.vnode : null;
- if (instance) {
- let cur = instance.parent;
- const exposedInstance = instance.proxy;
- const errorInfo = ErrorTypeStrings[type] || type;
- while (cur) {
- const errorCapturedHooks = cur.ec;
- if (errorCapturedHooks) {
- for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
- if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
- return;
- }
- }
- }
- cur = cur.parent;
- }
- const appErrorHandler = instance.appContext.config.errorHandler;
- if (appErrorHandler) {
- callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
- return;
- }
- }
- logError(err, type, contextVNode, throwInDev);
- }
- function logError(err, type, contextVNode, throwInDev = true) {
- {
- const info = ErrorTypeStrings[type] || type;
- if (contextVNode) {
- pushWarningContext(contextVNode);
- }
- warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
- if (contextVNode) {
- popWarningContext();
- }
- if (throwInDev) {
- console.error(err);
- } else {
- console.error(err);
- }
- }
- }
- let isFlushing = false;
- let isFlushPending = false;
- const queue = [];
- let flushIndex = 0;
- const pendingPostFlushCbs = [];
- let activePostFlushCbs = null;
- let postFlushIndex = 0;
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
- let currentFlushPromise = null;
- const RECURSION_LIMIT = 100;
- function nextTick$1(fn) {
- const p2 = currentFlushPromise || resolvedPromise;
- return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
- }
- function findInsertionIndex(id) {
- let start = flushIndex + 1;
- let end = queue.length;
- while (start < end) {
- const middle = start + end >>> 1;
- const middleJobId = getId(queue[middle]);
- middleJobId < id ? start = middle + 1 : end = middle;
- }
- return start;
- }
- function queueJob(job) {
- if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
- if (job.id == null) {
- queue.push(job);
- } else {
- queue.splice(findInsertionIndex(job.id), 0, job);
- }
- queueFlush();
- }
- }
- function queueFlush() {
- if (!isFlushing && !isFlushPending) {
- isFlushPending = true;
- currentFlushPromise = resolvedPromise.then(flushJobs);
- }
- }
- function hasQueueJob(job) {
- return queue.indexOf(job) > -1;
- }
- function invalidateJob(job) {
- const i2 = queue.indexOf(job);
- if (i2 > flushIndex) {
- queue.splice(i2, 1);
- }
- }
- function queuePostFlushCb(cb) {
- if (!isArray$1(cb)) {
- if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
- pendingPostFlushCbs.push(cb);
- }
- } else {
- pendingPostFlushCbs.push(...cb);
- }
- queueFlush();
- }
- function flushPreFlushCbs(seen, i2 = isFlushing ? flushIndex + 1 : 0) {
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- for (; i2 < queue.length; i2++) {
- const cb = queue[i2];
- if (cb && cb.pre) {
- if (checkRecursiveUpdates(seen, cb)) {
- continue;
- }
- queue.splice(i2, 1);
- i2--;
- cb();
- }
- }
- }
- function flushPostFlushCbs(seen) {
- if (pendingPostFlushCbs.length) {
- const deduped = [...new Set(pendingPostFlushCbs)];
- pendingPostFlushCbs.length = 0;
- if (activePostFlushCbs) {
- activePostFlushCbs.push(...deduped);
- return;
- }
- activePostFlushCbs = deduped;
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- activePostFlushCbs.sort((a2, b2) => getId(a2) - getId(b2));
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
- if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
- continue;
- }
- activePostFlushCbs[postFlushIndex]();
- }
- activePostFlushCbs = null;
- postFlushIndex = 0;
- }
- }
- const getId = (job) => job.id == null ? Infinity : job.id;
- const comparator = (a2, b2) => {
- const diff2 = getId(a2) - getId(b2);
- if (diff2 === 0) {
- if (a2.pre && !b2.pre)
- return -1;
- if (b2.pre && !a2.pre)
- return 1;
- }
- return diff2;
- };
- function flushJobs(seen) {
- isFlushPending = false;
- isFlushing = true;
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- queue.sort(comparator);
- const check = (job) => checkRecursiveUpdates(seen, job);
- try {
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job && job.active !== false) {
- if (check(job)) {
- continue;
- }
- callWithErrorHandling(
- job,
- null,
- 14
- /* ErrorCodes.SCHEDULER */
- );
- }
- }
- } finally {
- flushIndex = 0;
- queue.length = 0;
- flushPostFlushCbs(seen);
- isFlushing = false;
- currentFlushPromise = null;
- if (queue.length || pendingPostFlushCbs.length) {
- flushJobs(seen);
- }
- }
- }
- function checkRecursiveUpdates(seen, fn) {
- if (!seen.has(fn)) {
- seen.set(fn, 1);
- } else {
- const count = seen.get(fn);
- if (count > RECURSION_LIMIT) {
- const instance = fn.ownerInstance;
- const componentName = instance && getComponentName(instance.type);
- 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.`);
- return true;
- } else {
- seen.set(fn, count + 1);
- }
- }
- }
- let devtools;
- let buffer = [];
- let devtoolsNotInstalled = false;
- function emit$1(event, ...args) {
- if (devtools) {
- devtools.emit(event, ...args);
- } else if (!devtoolsNotInstalled) {
- buffer.push({ event, args });
- }
- }
- function setDevtoolsHook(hook, target) {
- var _a2, _b2;
- devtools = hook;
- if (devtools) {
- devtools.enabled = true;
- buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
- buffer = [];
- } else if (
- // handle late devtools injection - only do this if we are in an actual
- // browser environment to avoid the timer handle stalling test runner exit
- // (#4815)
- typeof window !== "undefined" && // some envs mock window but not fully
- // eslint-disable-next-line no-restricted-globals
- window.HTMLElement && // also exclude jsdom
- // eslint-disable-next-line no-restricted-globals
- !((_b2 = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b2 === void 0 ? void 0 : _b2.includes("jsdom"))
- ) {
- const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
- replay.push((newHook) => {
- setDevtoolsHook(newHook, target);
- });
- setTimeout(() => {
- if (!devtools) {
- target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
- devtoolsNotInstalled = true;
- buffer = [];
- }
- }, 3e3);
- } else {
- devtoolsNotInstalled = true;
- buffer = [];
- }
- }
- function devtoolsInitApp(app, version2) {
- emit$1("app:init", app, version2, {
- Fragment,
- Text,
- Comment,
- Static
- });
- }
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:added"
- /* DevtoolsHooks.COMPONENT_ADDED */
- );
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:updated"
- /* DevtoolsHooks.COMPONENT_UPDATED */
- );
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:removed"
- /* DevtoolsHooks.COMPONENT_REMOVED */
- );
- const devtoolsComponentRemoved = (component) => {
- if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
- !devtools.cleanupBuffer(component)) {
- _devtoolsComponentRemoved(component);
- }
- };
- function createDevtoolsComponentHook(hook) {
- return (component) => {
- emit$1(
- hook,
- component.appContext.app,
- component.uid,
- // fixed by xxxxxx
- // 为 0 是 App,无 parent 是 Page 指向 App
- component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
- component
- );
- };
- }
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
- "perf:start"
- /* DevtoolsHooks.PERFORMANCE_START */
- );
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
- "perf:end"
- /* DevtoolsHooks.PERFORMANCE_END */
- );
- function createDevtoolsPerformanceHook(hook) {
- return (component, type, time) => {
- emit$1(hook, component.appContext.app, component.uid, component, type, time);
- };
- }
- function devtoolsComponentEmit(component, event, params) {
- emit$1("component:emit", component.appContext.app, component, event, params);
- }
- function emit(instance, event, ...rawArgs) {
- if (instance.isUnmounted)
- return;
- const props = instance.vnode.props || EMPTY_OBJ;
- {
- const { emitsOptions, propsOptions: [propsOptions] } = instance;
- if (emitsOptions) {
- if (!(event in emitsOptions) && true) {
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
- warn(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`);
- }
- } else {
- const validator = emitsOptions[event];
- if (isFunction(validator)) {
- const isValid = validator(...rawArgs);
- if (!isValid) {
- warn(`Invalid event arguments: event validation failed for event "${event}".`);
- }
- }
- }
- }
- }
- let args = rawArgs;
- const isModelListener2 = event.startsWith("update:");
- const modelArg = isModelListener2 && event.slice(7);
- if (modelArg && modelArg in props) {
- const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
- const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
- if (trim) {
- args = rawArgs.map((a2) => isString(a2) ? a2.trim() : a2);
- }
- if (number) {
- args = rawArgs.map(looseToNumber);
- }
- }
- {
- devtoolsComponentEmit(instance, event, args);
- }
- {
- const lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
- 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}".`);
- }
- }
- let handlerName;
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
- props[handlerName = toHandlerKey(camelize(event))];
- if (!handler && isModelListener2) {
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
- }
- if (handler) {
- callWithAsyncErrorHandling(handler, instance, 6, args);
- }
- const onceHandler = props[handlerName + `Once`];
- if (onceHandler) {
- if (!instance.emitted) {
- instance.emitted = {};
- } else if (instance.emitted[handlerName]) {
- return;
- }
- instance.emitted[handlerName] = true;
- callWithAsyncErrorHandling(onceHandler, instance, 6, args);
- }
- }
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
- const cache = appContext.emitsCache;
- const cached = cache.get(comp);
- if (cached !== void 0) {
- return cached;
- }
- const raw = comp.emits;
- let normalized = {};
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendEmits = (raw2) => {
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
- if (normalizedFromExtend) {
- hasExtends = true;
- extend(normalized, normalizedFromExtend);
- }
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendEmits);
- }
- if (comp.extends) {
- extendEmits(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendEmits);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject$3(comp)) {
- cache.set(comp, null);
- }
- return null;
- }
- if (isArray$1(raw)) {
- raw.forEach((key) => normalized[key] = null);
- } else {
- extend(normalized, raw);
- }
- if (isObject$3(comp)) {
- cache.set(comp, normalized);
- }
- return normalized;
- }
- function isEmitListener(options, key) {
- if (!options || !isOn(key)) {
- return false;
- }
- key = key.slice(2).replace(/Once$/, "");
- return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
- }
- let currentRenderingInstance = null;
- function setCurrentRenderingInstance(instance) {
- const prev = currentRenderingInstance;
- currentRenderingInstance = instance;
- instance && instance.type.__scopeId || null;
- return prev;
- }
- function provide(key, value) {
- if (!currentInstance) {
- {
- warn(`provide() can only be used inside setup().`);
- }
- } else {
- let provides = currentInstance.provides;
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
- if (parentProvides === provides) {
- provides = currentInstance.provides = Object.create(parentProvides);
- }
- provides[key] = value;
- if (currentInstance.type.mpType === "app") {
- currentInstance.appContext.app.provide(key, value);
- }
- }
- }
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
- const instance = currentInstance || currentRenderingInstance;
- if (instance) {
- const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
- if (provides && key in provides) {
- return provides[key];
- } else if (arguments.length > 1) {
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
- } else {
- warn(`injection "${String(key)}" not found.`);
- }
- } else {
- warn(`inject() can only be used inside setup() or functional components.`);
- }
- }
- function watchEffect(effect, options) {
- return doWatch(effect, null, options);
- }
- function watchPostEffect(effect, options) {
- return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: "post" }));
- }
- const INITIAL_WATCHER_VALUE = {};
- function watch(source, cb, options) {
- if (!isFunction(cb)) {
- 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.`);
- }
- return doWatch(source, cb, options);
- }
- function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
- if (!cb) {
- if (immediate !== void 0) {
- warn(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
- }
- if (deep !== void 0) {
- warn(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
- }
- }
- const warnInvalidSource = (s2) => {
- 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.`);
- };
- const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
- let getter;
- let forceTrigger = false;
- let isMultiSource = false;
- if (isRef(source)) {
- getter = () => source.value;
- forceTrigger = isShallow(source);
- } else if (isReactive(source)) {
- getter = () => source;
- deep = true;
- } else if (isArray$1(source)) {
- isMultiSource = true;
- forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
- getter = () => source.map((s2) => {
- if (isRef(s2)) {
- return s2.value;
- } else if (isReactive(s2)) {
- return traverse(s2);
- } else if (isFunction(s2)) {
- return callWithErrorHandling(
- s2,
- instance,
- 2
- /* ErrorCodes.WATCH_GETTER */
- );
- } else {
- warnInvalidSource(s2);
- }
- });
- } else if (isFunction(source)) {
- if (cb) {
- getter = () => callWithErrorHandling(
- source,
- instance,
- 2
- /* ErrorCodes.WATCH_GETTER */
- );
- } else {
- getter = () => {
- if (instance && instance.isUnmounted) {
- return;
- }
- if (cleanup) {
- cleanup();
- }
- return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
- };
- }
- } else {
- getter = NOOP;
- warnInvalidSource(source);
- }
- if (cb && deep) {
- const baseGetter = getter;
- getter = () => traverse(baseGetter());
- }
- let cleanup;
- let onCleanup = (fn) => {
- cleanup = effect.onStop = () => {
- callWithErrorHandling(
- fn,
- instance,
- 4
- /* ErrorCodes.WATCH_CLEANUP */
- );
- };
- };
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
- const job = () => {
- if (!effect.active) {
- return;
- }
- if (cb) {
- const newValue = effect.run();
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue, oldValue)) || false) {
- if (cleanup) {
- cleanup();
- }
- callWithAsyncErrorHandling(cb, instance, 3, [
- newValue,
- // pass undefined as the old value when it's changed for the first time
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
- onCleanup
- ]);
- oldValue = newValue;
- }
- } else {
- effect.run();
- }
- };
- job.allowRecurse = !!cb;
- let scheduler;
- if (flush === "sync") {
- scheduler = job;
- } else if (flush === "post") {
- scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
- } else {
- job.pre = true;
- if (instance)
- job.id = instance.uid;
- scheduler = () => queueJob(job);
- }
- const effect = new ReactiveEffect(getter, scheduler);
- {
- effect.onTrack = onTrack;
- effect.onTrigger = onTrigger;
- }
- if (cb) {
- if (immediate) {
- job();
- } else {
- oldValue = effect.run();
- }
- } else if (flush === "post") {
- queuePostRenderEffect$1(effect.run.bind(effect), instance && instance.suspense);
- } else {
- effect.run();
- }
- const unwatch = () => {
- effect.stop();
- if (instance && instance.scope) {
- remove(instance.scope.effects, effect);
- }
- };
- return unwatch;
- }
- function instanceWatch(source, value, options) {
- const publicThis = this.proxy;
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
- let cb;
- if (isFunction(value)) {
- cb = value;
- } else {
- cb = value.handler;
- options = value;
- }
- const cur = currentInstance;
- setCurrentInstance(this);
- const res = doWatch(getter, cb.bind(publicThis), options);
- if (cur) {
- setCurrentInstance(cur);
- } else {
- unsetCurrentInstance();
- }
- return res;
- }
- function createPathGetter(ctx, path) {
- const segments = path.split(".");
- return () => {
- let cur = ctx;
- for (let i2 = 0; i2 < segments.length && cur; i2++) {
- cur = cur[segments[i2]];
- }
- return cur;
- };
- }
- function traverse(value, seen) {
- if (!isObject$3(value) || value[
- "__v_skip"
- /* ReactiveFlags.SKIP */
- ]) {
- return value;
- }
- seen = seen || /* @__PURE__ */ new Set();
- if (seen.has(value)) {
- return value;
- }
- seen.add(value);
- if (isRef(value)) {
- traverse(value.value, seen);
- } else if (isArray$1(value)) {
- for (let i2 = 0; i2 < value.length; i2++) {
- traverse(value[i2], seen);
- }
- } else if (isSet(value) || isMap(value)) {
- value.forEach((v2) => {
- traverse(v2, seen);
- });
- } else if (isPlainObject$2(value)) {
- for (const key in value) {
- traverse(value[key], seen);
- }
- }
- return value;
- }
- const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
- function onActivated(hook, target) {
- registerKeepAliveHook(hook, "a", target);
- }
- function onDeactivated(hook, target) {
- registerKeepAliveHook(hook, "da", target);
- }
- function registerKeepAliveHook(hook, type, target = currentInstance) {
- const wrappedHook = hook.__wdc || (hook.__wdc = () => {
- let current = target;
- while (current) {
- if (current.isDeactivated) {
- return;
- }
- current = current.parent;
- }
- return hook();
- });
- injectHook(type, wrappedHook, target);
- if (target) {
- let current = target.parent;
- while (current && current.parent) {
- if (isKeepAlive(current.parent.vnode)) {
- injectToKeepAliveRoot(wrappedHook, type, target, current);
- }
- current = current.parent;
- }
- }
- }
- function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
- const injected = injectHook(
- type,
- hook,
- keepAliveRoot,
- true
- /* prepend */
- );
- onUnmounted(() => {
- remove(keepAliveRoot[type], injected);
- }, target);
- }
- function injectHook(type, hook, target = currentInstance, prepend = false) {
- if (target) {
- if (isRootHook(type)) {
- target = target.root;
- }
- const hooks = target[type] || (target[type] = []);
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
- if (target.isUnmounted) {
- return;
- }
- pauseTracking();
- setCurrentInstance(target);
- const res = callWithAsyncErrorHandling(hook, target, type, args);
- unsetCurrentInstance();
- resetTracking();
- return res;
- });
- if (prepend) {
- hooks.unshift(wrappedHook);
- } else {
- hooks.push(wrappedHook);
- }
- return wrappedHook;
- } else {
- const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, ""));
- 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().`);
- }
- }
- const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (
- // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
- (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
- );
- const onBeforeMount = createHook$1(
- "bm"
- /* LifecycleHooks.BEFORE_MOUNT */
- );
- const onMounted = createHook$1(
- "m"
- /* LifecycleHooks.MOUNTED */
- );
- const onBeforeUpdate = createHook$1(
- "bu"
- /* LifecycleHooks.BEFORE_UPDATE */
- );
- const onUpdated = createHook$1(
- "u"
- /* LifecycleHooks.UPDATED */
- );
- const onBeforeUnmount = createHook$1(
- "bum"
- /* LifecycleHooks.BEFORE_UNMOUNT */
- );
- const onUnmounted = createHook$1(
- "um"
- /* LifecycleHooks.UNMOUNTED */
- );
- const onServerPrefetch = createHook$1(
- "sp"
- /* LifecycleHooks.SERVER_PREFETCH */
- );
- const onRenderTriggered = createHook$1(
- "rtg"
- /* LifecycleHooks.RENDER_TRIGGERED */
- );
- const onRenderTracked = createHook$1(
- "rtc"
- /* LifecycleHooks.RENDER_TRACKED */
- );
- function onErrorCaptured(hook, target = currentInstance) {
- injectHook("ec", hook, target);
- }
- function validateDirectiveName(name) {
- if (isBuiltInDirective(name)) {
- warn("Do not use built-in directive ids as custom directive id: " + name);
- }
- }
- const COMPONENTS = "components";
- function resolveComponent(name, maybeSelfReference) {
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
- }
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
- const instance = currentRenderingInstance || currentInstance;
- if (instance) {
- const Component2 = instance.type;
- if (type === COMPONENTS) {
- const selfName = getComponentName(
- Component2,
- false
- /* do not include inferred name to avoid breaking existing code */
- );
- if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
- return Component2;
- }
- }
- const res = (
- // local registration
- // check instance[type] first which is resolved for options API
- resolve(instance[type] || Component2[type], name) || // global registration
- resolve(instance.appContext[type], name)
- );
- if (!res && maybeSelfReference) {
- return Component2;
- }
- if (warnMissing && !res) {
- const extra = type === COMPONENTS ? `
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
- warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
- }
- return res;
- } else {
- warn(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
- }
- }
- function resolve(registry, name) {
- return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
- }
- const getPublicInstance = (i2) => {
- if (!i2)
- return null;
- if (isStatefulComponent(i2))
- return getExposeProxy(i2) || i2.proxy;
- return getPublicInstance(i2.parent);
- };
- const publicPropertiesMap = (
- // Move PURE marker to new line to workaround compiler discarding it
- // due to type annotation
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
- $: (i2) => i2,
- // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
- // $el: i => i.vnode.el,
- $el: (i2) => i2.__$el || (i2.__$el = {}),
- $data: (i2) => i2.data,
- $props: (i2) => shallowReadonly(i2.props),
- $attrs: (i2) => shallowReadonly(i2.attrs),
- $slots: (i2) => shallowReadonly(i2.slots),
- $refs: (i2) => shallowReadonly(i2.refs),
- $parent: (i2) => getPublicInstance(i2.parent),
- $root: (i2) => getPublicInstance(i2.root),
- $emit: (i2) => i2.emit,
- $options: (i2) => resolveMergedOptions(i2),
- $forceUpdate: (i2) => i2.f || (i2.f = () => queueJob(i2.update)),
- // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
- $watch: (i2) => instanceWatch.bind(i2)
- })
- );
- const isReservedPrefix = (key) => key === "_" || key === "$";
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
- const PublicInstanceProxyHandlers = {
- get({ _: instance }, key) {
- const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
- if (key === "__isVue") {
- return true;
- }
- let normalizedProps;
- if (key[0] !== "$") {
- const n2 = accessCache[key];
- if (n2 !== void 0) {
- switch (n2) {
- case 1:
- return setupState[key];
- case 2:
- return data[key];
- case 4:
- return ctx[key];
- case 3:
- return props[key];
- }
- } else if (hasSetupBinding(setupState, key)) {
- accessCache[key] = 1;
- return setupState[key];
- } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
- accessCache[key] = 2;
- return data[key];
- } else if (
- // only cache other properties when instance has declared (thus stable)
- // props
- (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
- ) {
- accessCache[key] = 3;
- return props[key];
- } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (shouldCacheAccess) {
- accessCache[key] = 0;
- }
- }
- const publicGetter = publicPropertiesMap[key];
- let cssModule, globalProperties;
- if (publicGetter) {
- if (key === "$attrs") {
- track(instance, "get", key);
- }
- return publicGetter(instance);
- } else if (
- // css module (injected by vue-loader)
- (cssModule = type.__cssModules) && (cssModule = cssModule[key])
- ) {
- return cssModule;
- } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (
- // global properties
- globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
- ) {
- {
- return globalProperties[key];
- }
- } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
- // to infinite warning loop
- key.indexOf("__v") !== 0)) {
- if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
- 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.`);
- } else if (instance === currentRenderingInstance) {
- warn(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
- }
- }
- },
- set({ _: instance }, key, value) {
- const { data, setupState, ctx } = instance;
- if (hasSetupBinding(setupState, key)) {
- setupState[key] = value;
- return true;
- } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
- warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
- return false;
- } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
- data[key] = value;
- return true;
- } else if (hasOwn$1(instance.props, key)) {
- warn(`Attempting to mutate prop "${key}". Props are readonly.`);
- return false;
- }
- if (key[0] === "$" && key.slice(1) in instance) {
- warn(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
- return false;
- } else {
- if (key in instance.appContext.config.globalProperties) {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- value
- });
- } else {
- ctx[key] = value;
- }
- }
- return true;
- },
- has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
- let normalizedProps;
- 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);
- },
- defineProperty(target, key, descriptor) {
- if (descriptor.get != null) {
- target._.accessCache[key] = 0;
- } else if (hasOwn$1(descriptor, "value")) {
- this.set(target, key, descriptor.value, null);
- }
- return Reflect.defineProperty(target, key, descriptor);
- }
- };
- {
- PublicInstanceProxyHandlers.ownKeys = (target) => {
- 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.`);
- return Reflect.ownKeys(target);
- };
- }
- function createDevRenderContext(instance) {
- const target = {};
- Object.defineProperty(target, `_`, {
- configurable: true,
- enumerable: false,
- get: () => instance
- });
- Object.keys(publicPropertiesMap).forEach((key) => {
- Object.defineProperty(target, key, {
- configurable: true,
- enumerable: false,
- get: () => publicPropertiesMap[key](instance),
- // intercepted by the proxy so no need for implementation,
- // but needed to prevent set errors
- set: NOOP
- });
- });
- return target;
- }
- function exposePropsOnRenderContext(instance) {
- const { ctx, propsOptions: [propsOptions] } = instance;
- if (propsOptions) {
- Object.keys(propsOptions).forEach((key) => {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => instance.props[key],
- set: NOOP
- });
- });
- }
- }
- function exposeSetupStateOnRenderContext(instance) {
- const { ctx, setupState } = instance;
- Object.keys(toRaw(setupState)).forEach((key) => {
- if (!setupState.__isScriptSetup) {
- if (isReservedPrefix(key[0])) {
- warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
- return;
- }
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => setupState[key],
- set: NOOP
- });
- }
- });
- }
- function createDuplicateChecker() {
- const cache = /* @__PURE__ */ Object.create(null);
- return (type, key) => {
- if (cache[key]) {
- warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
- } else {
- cache[key] = type;
- }
- };
- }
- let shouldCacheAccess = true;
- function applyOptions$1(instance) {
- const options = resolveMergedOptions(instance);
- const publicThis = instance.proxy;
- const ctx = instance.ctx;
- shouldCacheAccess = false;
- if (options.beforeCreate) {
- callHook$1(
- options.beforeCreate,
- instance,
- "bc"
- /* LifecycleHooks.BEFORE_CREATE */
- );
- }
- const {
- // state
- data: dataOptions,
- computed: computedOptions,
- methods,
- watch: watchOptions,
- provide: provideOptions,
- inject: injectOptions,
- // lifecycle
- created,
- beforeMount,
- mounted,
- beforeUpdate,
- updated,
- activated,
- deactivated,
- beforeDestroy,
- beforeUnmount,
- destroyed,
- unmounted,
- render,
- renderTracked,
- renderTriggered,
- errorCaptured,
- serverPrefetch,
- // public API
- expose,
- inheritAttrs,
- // assets
- components,
- directives,
- filters
- } = options;
- const checkDuplicateProperties = createDuplicateChecker();
- {
- const [propsOptions] = instance.propsOptions;
- if (propsOptions) {
- for (const key in propsOptions) {
- checkDuplicateProperties("Props", key);
- }
- }
- }
- if (injectOptions) {
- resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
- }
- if (methods) {
- for (const key in methods) {
- const methodHandler = methods[key];
- if (isFunction(methodHandler)) {
- {
- Object.defineProperty(ctx, key, {
- value: methodHandler.bind(publicThis),
- configurable: true,
- enumerable: true,
- writable: true
- });
- }
- {
- checkDuplicateProperties("Methods", key);
- }
- } else {
- warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`);
- }
- }
- }
- if (dataOptions) {
- if (!isFunction(dataOptions)) {
- warn(`The data option must be a function. Plain object usage is no longer supported.`);
- }
- const data = dataOptions.call(publicThis, publicThis);
- if (isPromise(data)) {
- warn(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
- }
- if (!isObject$3(data)) {
- warn(`data() should return an object.`);
- } else {
- instance.data = reactive(data);
- {
- for (const key in data) {
- checkDuplicateProperties("Data", key);
- if (!isReservedPrefix(key[0])) {
- Object.defineProperty(ctx, key, {
- configurable: true,
- enumerable: true,
- get: () => data[key],
- set: NOOP
- });
- }
- }
- }
- }
- }
- shouldCacheAccess = true;
- if (computedOptions) {
- for (const key in computedOptions) {
- const opt = computedOptions[key];
- const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
- if (get2 === NOOP) {
- warn(`Computed property "${key}" has no getter.`);
- }
- const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
- warn(`Write operation failed: computed property "${key}" is readonly.`);
- };
- const c2 = computed({
- get: get2,
- set: set2
- });
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => c2.value,
- set: (v2) => c2.value = v2
- });
- {
- checkDuplicateProperties("Computed", key);
- }
- }
- }
- if (watchOptions) {
- for (const key in watchOptions) {
- createWatcher(watchOptions[key], ctx, publicThis, key);
- }
- }
- {
- if (provideOptions) {
- const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
- Reflect.ownKeys(provides).forEach((key) => {
- provide(key, provides[key]);
- });
- }
- }
- {
- if (created) {
- callHook$1(
- created,
- instance,
- "c"
- /* LifecycleHooks.CREATED */
- );
- }
- }
- function registerLifecycleHook(register, hook) {
- if (isArray$1(hook)) {
- hook.forEach((_hook) => register(_hook.bind(publicThis)));
- } else if (hook) {
- register(hook.bind(publicThis));
- }
- }
- registerLifecycleHook(onBeforeMount, beforeMount);
- registerLifecycleHook(onMounted, mounted);
- registerLifecycleHook(onBeforeUpdate, beforeUpdate);
- registerLifecycleHook(onUpdated, updated);
- registerLifecycleHook(onActivated, activated);
- registerLifecycleHook(onDeactivated, deactivated);
- registerLifecycleHook(onErrorCaptured, errorCaptured);
- registerLifecycleHook(onRenderTracked, renderTracked);
- registerLifecycleHook(onRenderTriggered, renderTriggered);
- registerLifecycleHook(onBeforeUnmount, beforeUnmount);
- registerLifecycleHook(onUnmounted, unmounted);
- registerLifecycleHook(onServerPrefetch, serverPrefetch);
- if (isArray$1(expose)) {
- if (expose.length) {
- const exposed = instance.exposed || (instance.exposed = {});
- expose.forEach((key) => {
- Object.defineProperty(exposed, key, {
- get: () => publicThis[key],
- set: (val) => publicThis[key] = val
- });
- });
- } else if (!instance.exposed) {
- instance.exposed = {};
- }
- }
- if (render && instance.render === NOOP) {
- instance.render = render;
- }
- if (inheritAttrs != null) {
- instance.inheritAttrs = inheritAttrs;
- }
- if (components)
- instance.components = components;
- if (directives)
- instance.directives = directives;
- if (instance.ctx.$onApplyOptions) {
- instance.ctx.$onApplyOptions(options, instance, publicThis);
- }
- }
- function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
- if (isArray$1(injectOptions)) {
- injectOptions = normalizeInject(injectOptions);
- }
- for (const key in injectOptions) {
- const opt = injectOptions[key];
- let injected;
- if (isObject$3(opt)) {
- if ("default" in opt) {
- injected = inject(
- opt.from || key,
- opt.default,
- true
- /* treat default function as factory */
- );
- } else {
- injected = inject(opt.from || key);
- }
- } else {
- injected = inject(opt);
- }
- if (isRef(injected)) {
- if (unwrapRef) {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => injected.value,
- set: (v2) => injected.value = v2
- });
- } else {
- {
- 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.)`);
- }
- ctx[key] = injected;
- }
- } else {
- ctx[key] = injected;
- }
- {
- checkDuplicateProperties("Inject", key);
- }
- }
- }
- function callHook$1(hook, instance, type) {
- callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
- }
- function createWatcher(raw, ctx, publicThis, key) {
- const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
- if (isString(raw)) {
- const handler = ctx[raw];
- if (isFunction(handler)) {
- watch(getter, handler);
- } else {
- warn(`Invalid watch handler specified by key "${raw}"`, handler);
- }
- } else if (isFunction(raw)) {
- watch(getter, raw.bind(publicThis));
- } else if (isObject$3(raw)) {
- if (isArray$1(raw)) {
- raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
- } else {
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
- if (isFunction(handler)) {
- watch(getter, handler, raw);
- } else {
- warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
- }
- }
- } else {
- warn(`Invalid watch option: "${key}"`, raw);
- }
- }
- function resolveMergedOptions(instance) {
- const base = instance.type;
- const { mixins, extends: extendsOptions } = base;
- const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
- const cached = cache.get(base);
- let resolved;
- if (cached) {
- resolved = cached;
- } else if (!globalMixins.length && !mixins && !extendsOptions) {
- {
- resolved = base;
- }
- } else {
- resolved = {};
- if (globalMixins.length) {
- globalMixins.forEach((m2) => mergeOptions(resolved, m2, optionMergeStrategies, true));
- }
- mergeOptions(resolved, base, optionMergeStrategies);
- }
- if (isObject$3(base)) {
- cache.set(base, resolved);
- }
- return resolved;
- }
- function mergeOptions(to, from, strats, asMixin = false) {
- const { mixins, extends: extendsOptions } = from;
- if (extendsOptions) {
- mergeOptions(to, extendsOptions, strats, true);
- }
- if (mixins) {
- mixins.forEach((m2) => mergeOptions(to, m2, strats, true));
- }
- for (const key in from) {
- if (asMixin && key === "expose") {
- warn(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
- } else {
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
- to[key] = strat ? strat(to[key], from[key]) : from[key];
- }
- }
- return to;
- }
- const internalOptionMergeStrats = {
- data: mergeDataFn,
- props: mergeObjectOptions,
- emits: mergeObjectOptions,
- // objects
- methods: mergeObjectOptions,
- computed: mergeObjectOptions,
- // lifecycle
- beforeCreate: mergeAsArray$1,
- created: mergeAsArray$1,
- beforeMount: mergeAsArray$1,
- mounted: mergeAsArray$1,
- beforeUpdate: mergeAsArray$1,
- updated: mergeAsArray$1,
- beforeDestroy: mergeAsArray$1,
- beforeUnmount: mergeAsArray$1,
- destroyed: mergeAsArray$1,
- unmounted: mergeAsArray$1,
- activated: mergeAsArray$1,
- deactivated: mergeAsArray$1,
- errorCaptured: mergeAsArray$1,
- serverPrefetch: mergeAsArray$1,
- // assets
- components: mergeObjectOptions,
- directives: mergeObjectOptions,
- // watch
- watch: mergeWatchOptions,
- // provide / inject
- provide: mergeDataFn,
- inject: mergeInject
- };
- function mergeDataFn(to, from) {
- if (!from) {
- return to;
- }
- if (!to) {
- return from;
- }
- return function mergedDataFn() {
- return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
- };
- }
- function mergeInject(to, from) {
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
- }
- function normalizeInject(raw) {
- if (isArray$1(raw)) {
- const res = {};
- for (let i2 = 0; i2 < raw.length; i2++) {
- res[raw[i2]] = raw[i2];
- }
- return res;
- }
- return raw;
- }
- function mergeAsArray$1(to, from) {
- return to ? [...new Set([].concat(to, from))] : from;
- }
- function mergeObjectOptions(to, from) {
- return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
- }
- function mergeWatchOptions(to, from) {
- if (!to)
- return from;
- if (!from)
- return to;
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
- for (const key in from) {
- merged[key] = mergeAsArray$1(to[key], from[key]);
- }
- return merged;
- }
- function initProps$1(instance, rawProps, isStateful, isSSR = false) {
- const props = {};
- const attrs = {};
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
- setFullProps(instance, rawProps, props, attrs);
- for (const key in instance.propsOptions[0]) {
- if (!(key in props)) {
- props[key] = void 0;
- }
- }
- {
- validateProps(rawProps || {}, props, instance);
- }
- if (isStateful) {
- instance.props = isSSR ? props : shallowReactive(props);
- } else {
- if (!instance.type.props) {
- instance.props = attrs;
- } else {
- instance.props = props;
- }
- }
- instance.attrs = attrs;
- }
- function isInHmrContext(instance) {
- while (instance) {
- if (instance.type.__hmrId)
- return true;
- instance = instance.parent;
- }
- }
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
- const { props, attrs, vnode: { patchFlag } } = instance;
- const rawCurrentProps = toRaw(props);
- const [options] = instance.propsOptions;
- let hasAttrsChanged = false;
- if (
- // always force full diff in dev
- // - #1942 if hmr is enabled with sfc component
- // - vite#872 non-sfc component used by sfc component
- !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
- ) {
- if (patchFlag & 8) {
- const propsToUpdate = instance.vnode.dynamicProps;
- for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
- let key = propsToUpdate[i2];
- if (isEmitListener(instance.emitsOptions, key)) {
- continue;
- }
- const value = rawProps[key];
- if (options) {
- if (hasOwn$1(attrs, key)) {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- } else {
- const camelizedKey = camelize(key);
- props[camelizedKey] = resolvePropValue(
- options,
- rawCurrentProps,
- camelizedKey,
- value,
- instance,
- false
- /* isAbsent */
- );
- }
- } else {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- } else {
- if (setFullProps(instance, rawProps, props, attrs)) {
- hasAttrsChanged = true;
- }
- let kebabKey;
- for (const key in rawCurrentProps) {
- if (!rawProps || // for camelCase
- !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
- // and converted to camelCase (#955)
- ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
- if (options) {
- if (rawPrevProps && // for camelCase
- (rawPrevProps[key] !== void 0 || // for kebab-case
- rawPrevProps[kebabKey] !== void 0)) {
- props[key] = resolvePropValue(
- options,
- rawCurrentProps,
- key,
- void 0,
- instance,
- true
- /* isAbsent */
- );
- }
- } else {
- delete props[key];
- }
- }
- }
- if (attrs !== rawCurrentProps) {
- for (const key in attrs) {
- if (!rawProps || !hasOwn$1(rawProps, key) && true) {
- delete attrs[key];
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (hasAttrsChanged) {
- trigger(instance, "set", "$attrs");
- }
- {
- validateProps(rawProps || {}, props, instance);
- }
- }
- function setFullProps(instance, rawProps, props, attrs) {
- const [options, needCastKeys] = instance.propsOptions;
- let hasAttrsChanged = false;
- let rawCastValues;
- if (rawProps) {
- for (let key in rawProps) {
- if (isReservedProp(key)) {
- continue;
- }
- const value = rawProps[key];
- let camelKey;
- if (options && hasOwn$1(options, camelKey = camelize(key))) {
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
- props[camelKey] = value;
- } else {
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
- }
- } else if (!isEmitListener(instance.emitsOptions, key)) {
- if (!(key in attrs) || value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (needCastKeys) {
- const rawCurrentProps = toRaw(props);
- const castValues = rawCastValues || EMPTY_OBJ;
- for (let i2 = 0; i2 < needCastKeys.length; i2++) {
- const key = needCastKeys[i2];
- props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key));
- }
- }
- return hasAttrsChanged;
- }
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
- const opt = options[key];
- if (opt != null) {
- const hasDefault = hasOwn$1(opt, "default");
- if (hasDefault && value === void 0) {
- const defaultValue = opt.default;
- if (opt.type !== Function && isFunction(defaultValue)) {
- const { propsDefaults } = instance;
- if (key in propsDefaults) {
- value = propsDefaults[key];
- } else {
- setCurrentInstance(instance);
- value = propsDefaults[key] = defaultValue.call(null, props);
- unsetCurrentInstance();
- }
- } else {
- value = defaultValue;
- }
- }
- if (opt[
- 0
- /* BooleanFlags.shouldCast */
- ]) {
- if (isAbsent && !hasDefault) {
- value = false;
- } else if (opt[
- 1
- /* BooleanFlags.shouldCastTrue */
- ] && (value === "" || value === hyphenate(key))) {
- value = true;
- }
- }
- }
- return value;
- }
- function normalizePropsOptions(comp, appContext, asMixin = false) {
- const cache = appContext.propsCache;
- const cached = cache.get(comp);
- if (cached) {
- return cached;
- }
- const raw = comp.props;
- const normalized = {};
- const needCastKeys = [];
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendProps = (raw2) => {
- hasExtends = true;
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
- extend(normalized, props);
- if (keys)
- needCastKeys.push(...keys);
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendProps);
- }
- if (comp.extends) {
- extendProps(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendProps);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject$3(comp)) {
- cache.set(comp, EMPTY_ARR);
- }
- return EMPTY_ARR;
- }
- if (isArray$1(raw)) {
- for (let i2 = 0; i2 < raw.length; i2++) {
- if (!isString(raw[i2])) {
- warn(`props must be strings when using array syntax.`, raw[i2]);
- }
- const normalizedKey = camelize(raw[i2]);
- if (validatePropName(normalizedKey)) {
- normalized[normalizedKey] = EMPTY_OBJ;
- }
- }
- } else if (raw) {
- if (!isObject$3(raw)) {
- warn(`invalid props options`, raw);
- }
- for (const key in raw) {
- const normalizedKey = camelize(key);
- if (validatePropName(normalizedKey)) {
- const opt = raw[key];
- const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt);
- if (prop) {
- const booleanIndex = getTypeIndex(Boolean, prop.type);
- const stringIndex = getTypeIndex(String, prop.type);
- prop[
- 0
- /* BooleanFlags.shouldCast */
- ] = booleanIndex > -1;
- prop[
- 1
- /* BooleanFlags.shouldCastTrue */
- ] = stringIndex < 0 || booleanIndex < stringIndex;
- if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
- needCastKeys.push(normalizedKey);
- }
- }
- }
- }
- }
- const res = [normalized, needCastKeys];
- if (isObject$3(comp)) {
- cache.set(comp, res);
- }
- return res;
- }
- function validatePropName(key) {
- if (key[0] !== "$") {
- return true;
- } else {
- warn(`Invalid prop name: "${key}" is a reserved property.`);
- }
- return false;
- }
- function getType$1(ctor) {
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
- return match ? match[2] : ctor === null ? "null" : "";
- }
- function isSameType(a2, b2) {
- return getType$1(a2) === getType$1(b2);
- }
- function getTypeIndex(type, expectedTypes) {
- if (isArray$1(expectedTypes)) {
- return expectedTypes.findIndex((t2) => isSameType(t2, type));
- } else if (isFunction(expectedTypes)) {
- return isSameType(expectedTypes, type) ? 0 : -1;
- }
- return -1;
- }
- function validateProps(rawProps, props, instance) {
- const resolvedValues = toRaw(props);
- const options = instance.propsOptions[0];
- for (const key in options) {
- let opt = options[key];
- if (opt == null)
- continue;
- validateProp(key, resolvedValues[key], opt, !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key)));
- }
- }
- function validateProp(name, value, prop, isAbsent) {
- const { type, required, validator } = prop;
- if (required && isAbsent) {
- warn('Missing required prop: "' + name + '"');
- return;
- }
- if (value == null && !prop.required) {
- return;
- }
- if (type != null && type !== true) {
- let isValid = false;
- const types = isArray$1(type) ? type : [type];
- const expectedTypes = [];
- for (let i2 = 0; i2 < types.length && !isValid; i2++) {
- const { valid, expectedType } = assertType(value, types[i2]);
- expectedTypes.push(expectedType || "");
- isValid = valid;
- }
- if (!isValid) {
- warn(getInvalidTypeMessage(name, value, expectedTypes));
- return;
- }
- }
- if (validator && !validator(value)) {
- warn('Invalid prop: custom validator check failed for prop "' + name + '".');
- }
- }
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
- function assertType(value, type) {
- let valid;
- const expectedType = getType$1(type);
- if (isSimpleType(expectedType)) {
- const t2 = typeof value;
- valid = t2 === expectedType.toLowerCase();
- if (!valid && t2 === "object") {
- valid = value instanceof type;
- }
- } else if (expectedType === "Object") {
- valid = isObject$3(value);
- } else if (expectedType === "Array") {
- valid = isArray$1(value);
- } else if (expectedType === "null") {
- valid = value === null;
- } else {
- valid = value instanceof type;
- }
- return {
- valid,
- expectedType
- };
- }
- function getInvalidTypeMessage(name, value, expectedTypes) {
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
- const expectedType = expectedTypes[0];
- const receivedType = toRawType(value);
- const expectedValue = styleValue(value, expectedType);
- const receivedValue = styleValue(value, receivedType);
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
- message += ` with value ${expectedValue}`;
- }
- message += `, got ${receivedType} `;
- if (isExplicable(receivedType)) {
- message += `with value ${receivedValue}.`;
- }
- return message;
- }
- function styleValue(value, type) {
- if (type === "String") {
- return `"${value}"`;
- } else if (type === "Number") {
- return `${Number(value)}`;
- } else {
- return `${value}`;
- }
- }
- function isExplicable(type) {
- const explicitTypes = ["string", "number", "boolean"];
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
- }
- function isBoolean(...args) {
- return args.some((elem) => elem.toLowerCase() === "boolean");
- }
- function createAppContext() {
- return {
- app: null,
- config: {
- isNativeTag: NO,
- performance: false,
- globalProperties: {},
- optionMergeStrategies: {},
- errorHandler: void 0,
- warnHandler: void 0,
- compilerOptions: {}
- },
- mixins: [],
- components: {},
- directives: {},
- provides: /* @__PURE__ */ Object.create(null),
- optionsCache: /* @__PURE__ */ new WeakMap(),
- propsCache: /* @__PURE__ */ new WeakMap(),
- emitsCache: /* @__PURE__ */ new WeakMap()
- };
- }
- let uid$1 = 0;
- function createAppAPI(render, hydrate) {
- return function createApp2(rootComponent, rootProps = null) {
- if (!isFunction(rootComponent)) {
- rootComponent = Object.assign({}, rootComponent);
- }
- if (rootProps != null && !isObject$3(rootProps)) {
- warn(`root props passed to app.mount() must be an object.`);
- rootProps = null;
- }
- const context = createAppContext();
- const installedPlugins = /* @__PURE__ */ new Set();
- const app = context.app = {
- _uid: uid$1++,
- _component: rootComponent,
- _props: rootProps,
- _container: null,
- _context: context,
- _instance: null,
- version,
- get config() {
- return context.config;
- },
- set config(v2) {
- {
- warn(`app.config cannot be replaced. Modify individual options instead.`);
- }
- },
- use(plugin2, ...options) {
- if (installedPlugins.has(plugin2)) {
- warn(`Plugin has already been applied to target app.`);
- } else if (plugin2 && isFunction(plugin2.install)) {
- installedPlugins.add(plugin2);
- plugin2.install(app, ...options);
- } else if (isFunction(plugin2)) {
- installedPlugins.add(plugin2);
- plugin2(app, ...options);
- } else {
- warn(`A plugin must either be a function or an object with an "install" function.`);
- }
- return app;
- },
- mixin(mixin) {
- {
- if (!context.mixins.includes(mixin)) {
- context.mixins.push(mixin);
- } else {
- warn("Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : ""));
- }
- }
- return app;
- },
- component(name, component) {
- {
- validateComponentName(name, context.config);
- }
- if (!component) {
- return context.components[name];
- }
- if (context.components[name]) {
- warn(`Component "${name}" has already been registered in target app.`);
- }
- context.components[name] = component;
- return app;
- },
- directive(name, directive) {
- {
- validateDirectiveName(name);
- }
- if (!directive) {
- return context.directives[name];
- }
- if (context.directives[name]) {
- warn(`Directive "${name}" has already been registered in target app.`);
- }
- context.directives[name] = directive;
- return app;
- },
- // fixed by xxxxxx
- mount() {
- },
- // fixed by xxxxxx
- unmount() {
- },
- provide(key, value) {
- if (key in context.provides) {
- warn(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
- }
- context.provides[key] = value;
- return app;
- }
- };
- return app;
- };
- }
- let supported;
- let perf;
- function startMeasure(instance, type) {
- if (instance.appContext.config.performance && isSupported()) {
- perf.mark(`vue-${type}-${instance.uid}`);
- }
- {
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
- }
- }
- function endMeasure(instance, type) {
- if (instance.appContext.config.performance && isSupported()) {
- const startTag = `vue-${type}-${instance.uid}`;
- const endTag = startTag + `:end`;
- perf.mark(endTag);
- perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- }
- {
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
- }
- }
- function isSupported() {
- if (supported !== void 0) {
- return supported;
- }
- if (typeof window !== "undefined" && window.performance) {
- supported = true;
- perf = window.performance;
- } else {
- supported = false;
- }
- return supported;
- }
- const queuePostRenderEffect$1 = queuePostFlushCb;
- const Fragment = Symbol("Fragment");
- const Text = Symbol("Text");
- const Comment = Symbol("Comment");
- const Static = Symbol("Static");
- function isVNode(value) {
- return value ? value.__v_isVNode === true : false;
- }
- const InternalObjectKey = `__vInternal`;
- function guardReactiveProps(props) {
- if (!props)
- return null;
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
- }
- const emptyAppContext = createAppContext();
- let uid = 0;
- function createComponentInstance(vnode, parent, suspense) {
- const type = vnode.type;
- const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
- const instance = {
- uid: uid++,
- vnode,
- type,
- parent,
- appContext,
- root: null,
- next: null,
- subTree: null,
- effect: null,
- update: null,
- scope: new EffectScope(
- true
- /* detached */
- ),
- render: null,
- proxy: null,
- exposed: null,
- exposeProxy: null,
- withProxy: null,
- provides: parent ? parent.provides : Object.create(appContext.provides),
- accessCache: null,
- renderCache: [],
- // local resolved assets
- components: null,
- directives: null,
- // resolved props and emits options
- propsOptions: normalizePropsOptions(type, appContext),
- emitsOptions: normalizeEmitsOptions(type, appContext),
- // emit
- emit: null,
- emitted: null,
- // props default value
- propsDefaults: EMPTY_OBJ,
- // inheritAttrs
- inheritAttrs: type.inheritAttrs,
- // state
- ctx: EMPTY_OBJ,
- data: EMPTY_OBJ,
- props: EMPTY_OBJ,
- attrs: EMPTY_OBJ,
- slots: EMPTY_OBJ,
- refs: EMPTY_OBJ,
- setupState: EMPTY_OBJ,
- setupContext: null,
- // suspense related
- suspense,
- suspenseId: suspense ? suspense.pendingId : 0,
- asyncDep: null,
- asyncResolved: false,
- // lifecycle hooks
- // not using enums here because it results in computed properties
- isMounted: false,
- isUnmounted: false,
- isDeactivated: false,
- bc: null,
- c: null,
- bm: null,
- m: null,
- bu: null,
- u: null,
- um: null,
- bum: null,
- da: null,
- a: null,
- rtg: null,
- rtc: null,
- ec: null,
- sp: null
- };
- {
- instance.ctx = createDevRenderContext(instance);
- }
- instance.root = parent ? parent.root : instance;
- instance.emit = emit.bind(null, instance);
- if (vnode.ce) {
- vnode.ce(instance);
- }
- return instance;
- }
- let currentInstance = null;
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
- const setCurrentInstance = (instance) => {
- currentInstance = instance;
- instance.scope.on();
- };
- const unsetCurrentInstance = () => {
- currentInstance && currentInstance.scope.off();
- currentInstance = null;
- };
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
- function validateComponentName(name, config) {
- const appIsNativeTag = config.isNativeTag || NO;
- if (isBuiltInTag(name) || appIsNativeTag(name)) {
- warn("Do not use built-in or reserved HTML elements as component id: " + name);
- }
- }
- function isStatefulComponent(instance) {
- return instance.vnode.shapeFlag & 4;
- }
- let isInSSRComponentSetup = false;
- function setupComponent(instance, isSSR = false) {
- isInSSRComponentSetup = isSSR;
- const {
- props
- /*, children*/
- } = instance.vnode;
- const isStateful = isStatefulComponent(instance);
- initProps$1(instance, props, isStateful, isSSR);
- const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
- isInSSRComponentSetup = false;
- return setupResult;
- }
- function setupStatefulComponent(instance, isSSR) {
- const Component2 = instance.type;
- {
- if (Component2.name) {
- validateComponentName(Component2.name, instance.appContext.config);
- }
- if (Component2.components) {
- const names = Object.keys(Component2.components);
- for (let i2 = 0; i2 < names.length; i2++) {
- validateComponentName(names[i2], instance.appContext.config);
- }
- }
- if (Component2.directives) {
- const names = Object.keys(Component2.directives);
- for (let i2 = 0; i2 < names.length; i2++) {
- validateDirectiveName(names[i2]);
- }
- }
- if (Component2.compilerOptions && isRuntimeOnly()) {
- 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.`);
- }
- }
- instance.accessCache = /* @__PURE__ */ Object.create(null);
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
- {
- exposePropsOnRenderContext(instance);
- }
- const { setup } = Component2;
- if (setup) {
- const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
- setCurrentInstance(instance);
- pauseTracking();
- const setupResult = callWithErrorHandling(setup, instance, 0, [shallowReadonly(instance.props), setupContext]);
- resetTracking();
- unsetCurrentInstance();
- if (isPromise(setupResult)) {
- setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
- {
- warn(`setup() returned a Promise, but the version of Vue you are using does not support it yet.`);
- }
- } else {
- handleSetupResult(instance, setupResult, isSSR);
- }
- } else {
- finishComponentSetup(instance, isSSR);
- }
- }
- function handleSetupResult(instance, setupResult, isSSR) {
- if (isFunction(setupResult)) {
- {
- instance.render = setupResult;
- }
- } else if (isObject$3(setupResult)) {
- if (isVNode(setupResult)) {
- warn(`setup() should not return VNodes directly - return a render function instead.`);
- }
- {
- instance.devtoolsRawSetupState = setupResult;
- }
- instance.setupState = proxyRefs(setupResult);
- {
- exposeSetupStateOnRenderContext(instance);
- }
- } else if (setupResult !== void 0) {
- warn(`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`);
- }
- finishComponentSetup(instance, isSSR);
- }
- let compile;
- const isRuntimeOnly = () => !compile;
- function finishComponentSetup(instance, isSSR, skipOptions) {
- const Component2 = instance.type;
- if (!instance.render) {
- instance.render = Component2.render || NOOP;
- }
- {
- setCurrentInstance(instance);
- pauseTracking();
- applyOptions$1(instance);
- resetTracking();
- unsetCurrentInstance();
- }
- if (!Component2.render && instance.render === NOOP && !isSSR) {
- if (Component2.template) {
- warn(
- `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".`
- /* should not happen */
- );
- } else {
- warn(`Component is missing template or render function.`);
- }
- }
- }
- function createAttrsProxy(instance) {
- return new Proxy(
- instance.attrs,
- {
- get(target, key) {
- track(instance, "get", "$attrs");
- return target[key];
- },
- set() {
- warn(`setupContext.attrs is readonly.`);
- return false;
- },
- deleteProperty() {
- warn(`setupContext.attrs is readonly.`);
- return false;
- }
- }
- );
- }
- function createSetupContext(instance) {
- const expose = (exposed) => {
- {
- if (instance.exposed) {
- warn(`expose() should be called only once per setup().`);
- }
- if (exposed != null) {
- let exposedType = typeof exposed;
- if (exposedType === "object") {
- if (isArray$1(exposed)) {
- exposedType = "array";
- } else if (isRef(exposed)) {
- exposedType = "ref";
- }
- }
- if (exposedType !== "object") {
- warn(`expose() should be passed a plain object, received ${exposedType}.`);
- }
- }
- }
- instance.exposed = exposed || {};
- };
- let attrs;
- {
- return Object.freeze({
- get attrs() {
- return attrs || (attrs = createAttrsProxy(instance));
- },
- get slots() {
- return shallowReadonly(instance.slots);
- },
- get emit() {
- return (event, ...args) => instance.emit(event, ...args);
- },
- expose
- });
- }
- }
- function getExposeProxy(instance) {
- if (instance.exposed) {
- return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
- get(target, key) {
- if (key in target) {
- return target[key];
- }
- return instance.proxy[key];
- },
- has(target, key) {
- return key in target || key in publicPropertiesMap;
- }
- }));
- }
- }
- const classifyRE = /(?:^|[-_])(\w)/g;
- const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
- function getComponentName(Component2, includeInferred = true) {
- return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
- }
- function formatComponentName(instance, Component2, isRoot = false) {
- let name = getComponentName(Component2);
- if (!name && Component2.__file) {
- const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
- if (match) {
- name = match[1];
- }
- }
- if (!name && instance && instance.parent) {
- const inferFromRegistry = (registry) => {
- for (const key in registry) {
- if (registry[key] === Component2) {
- return key;
- }
- }
- };
- name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
- }
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
- }
- const computed = (getterOrOptions, debugOptions) => {
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
- };
- const version = "3.2.47";
- function unwrapper(target) {
- return unref(target);
- }
- const ARRAYTYPE = "[object Array]";
- const OBJECTTYPE = "[object Object]";
- function diff(current, pre) {
- const result2 = {};
- syncKeys(current, pre);
- _diff(current, pre, "", result2);
- return result2;
- }
- function syncKeys(current, pre) {
- current = unwrapper(current);
- if (current === pre)
- return;
- const rootCurrentType = toTypeString(current);
- const rootPreType = toTypeString(pre);
- if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
- for (let key in pre) {
- const currentValue = current[key];
- if (currentValue === void 0) {
- current[key] = null;
- } else {
- syncKeys(currentValue, pre[key]);
- }
- }
- } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
- if (current.length >= pre.length) {
- pre.forEach((item, index2) => {
- syncKeys(current[index2], item);
- });
- }
- }
- }
- function _diff(current, pre, path, result2) {
- current = unwrapper(current);
- if (current === pre)
- return;
- const rootCurrentType = toTypeString(current);
- const rootPreType = toTypeString(pre);
- if (rootCurrentType == OBJECTTYPE) {
- if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
- setResult(result2, path, current);
- } else {
- for (let key in current) {
- const currentValue = unwrapper(current[key]);
- const preValue = pre[key];
- const currentType = toTypeString(currentValue);
- const preType = toTypeString(preValue);
- if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
- if (currentValue != preValue) {
- setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
- }
- } else if (currentType == ARRAYTYPE) {
- if (preType != ARRAYTYPE) {
- setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
- } else {
- if (currentValue.length < preValue.length) {
- setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
- } else {
- currentValue.forEach((item, index2) => {
- _diff(item, preValue[index2], (path == "" ? "" : path + ".") + key + "[" + index2 + "]", result2);
- });
- }
- }
- } else if (currentType == OBJECTTYPE) {
- if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
- setResult(result2, (path == "" ? "" : path + ".") + key, currentValue);
- } else {
- for (let subKey in currentValue) {
- _diff(currentValue[subKey], preValue[subKey], (path == "" ? "" : path + ".") + key + "." + subKey, result2);
- }
- }
- }
- }
- }
- } else if (rootCurrentType == ARRAYTYPE) {
- if (rootPreType != ARRAYTYPE) {
- setResult(result2, path, current);
- } else {
- if (current.length < pre.length) {
- setResult(result2, path, current);
- } else {
- current.forEach((item, index2) => {
- _diff(item, pre[index2], path + "[" + index2 + "]", result2);
- });
- }
- }
- } else {
- setResult(result2, path, current);
- }
- }
- function setResult(result2, k, v2) {
- result2[k] = v2;
- }
- function hasComponentEffect(instance) {
- return queue.includes(instance.update);
- }
- function flushCallbacks(instance) {
- const ctx = instance.ctx;
- const callbacks = ctx.__next_tick_callbacks;
- if (callbacks && callbacks.length) {
- const copies = callbacks.slice(0);
- callbacks.length = 0;
- for (let i2 = 0; i2 < copies.length; i2++) {
- copies[i2]();
- }
- }
- }
- function nextTick(instance, fn) {
- const ctx = instance.ctx;
- if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
- return nextTick$1(fn && fn.bind(instance.proxy));
- }
- let _resolve;
- if (!ctx.__next_tick_callbacks) {
- ctx.__next_tick_callbacks = [];
- }
- ctx.__next_tick_callbacks.push(() => {
- if (fn) {
- callWithErrorHandling(
- fn.bind(instance.proxy),
- instance,
- 14
- /* ErrorCodes.SCHEDULER */
- );
- } else if (_resolve) {
- _resolve(instance.proxy);
- }
- });
- return new Promise((resolve2) => {
- _resolve = resolve2;
- });
- }
- function clone$1(src, seen) {
- src = unwrapper(src);
- const type = typeof src;
- if (type === "object" && src !== null) {
- let copy = seen.get(src);
- if (typeof copy !== "undefined") {
- return copy;
- }
- if (isArray$1(src)) {
- const len = src.length;
- copy = new Array(len);
- seen.set(src, copy);
- for (let i2 = 0; i2 < len; i2++) {
- copy[i2] = clone$1(src[i2], seen);
- }
- } else {
- copy = {};
- seen.set(src, copy);
- for (const name in src) {
- if (hasOwn$1(src, name)) {
- copy[name] = clone$1(src[name], seen);
- }
- }
- }
- return copy;
- }
- if (type !== "symbol") {
- return src;
- }
- }
- function deepCopy(src) {
- return clone$1(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
- }
- function getMPInstanceData(instance, keys) {
- const data = instance.data;
- const ret = /* @__PURE__ */ Object.create(null);
- keys.forEach((key) => {
- ret[key] = data[key];
- });
- return ret;
- }
- function patch(instance, data, oldData) {
- if (!data) {
- return;
- }
- data = deepCopy(data);
- const ctx = instance.ctx;
- const mpType = ctx.mpType;
- if (mpType === "page" || mpType === "component") {
- data.r0 = 1;
- const mpInstance = ctx.$scope;
- const keys = Object.keys(data);
- const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
- if (Object.keys(diffData).length) {
- ctx.__next_tick_pending = true;
- mpInstance.setData(diffData, () => {
- ctx.__next_tick_pending = false;
- flushCallbacks(instance);
- });
- flushPreFlushCbs();
- } else {
- flushCallbacks(instance);
- }
- }
- }
- function initAppConfig(appConfig) {
- appConfig.globalProperties.$nextTick = function $nextTick(fn) {
- return nextTick(this.$, fn);
- };
- }
- function onApplyOptions(options, instance, publicThis) {
- instance.appContext.config.globalProperties.$applyOptions(options, instance, publicThis);
- const computedOptions = options.computed;
- if (computedOptions) {
- const keys = Object.keys(computedOptions);
- if (keys.length) {
- const ctx = instance.ctx;
- if (!ctx.$computedKeys) {
- ctx.$computedKeys = [];
- }
- ctx.$computedKeys.push(...keys);
- }
- }
- delete instance.ctx.$onApplyOptions;
- }
- function setRef$1(instance, isUnmount = false) {
- const { setupState, $templateRefs, ctx: { $scope, $mpPlatform } } = instance;
- if ($mpPlatform === "mp-alipay") {
- return;
- }
- if (!$templateRefs || !$scope) {
- return;
- }
- if (isUnmount) {
- return $templateRefs.forEach((templateRef) => setTemplateRef(templateRef, null, setupState));
- }
- const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
- const doSetByRefs = (refs) => {
- const mpComponents = (
- // 字节小程序 selectAllComponents 可能返回 null
- // https://github.com/dcloudio/uni-app/issues/3954
- ($scope.selectAllComponents(".r") || []).concat($scope.selectAllComponents(".r-i-f") || [])
- );
- return refs.filter((templateRef) => {
- const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
- if (check && refValue === null) {
- return true;
- }
- setTemplateRef(templateRef, refValue, setupState);
- return false;
- });
- };
- const doSet = () => {
- const refs = doSetByRefs($templateRefs);
- if (refs.length && instance.proxy && instance.proxy.$scope) {
- instance.proxy.$scope.setData({ r1: 1 }, () => {
- doSetByRefs(refs);
- });
- }
- };
- if ($scope._$setRef) {
- $scope._$setRef(doSet);
- } else {
- nextTick(instance, doSet);
- }
- }
- function toSkip(value) {
- if (isObject$3(value)) {
- markRaw(value);
- }
- return value;
- }
- function findComponentPublicInstance(mpComponents, id) {
- const mpInstance = mpComponents.find((com) => com && (com.properties || com.props).uI === id);
- if (mpInstance) {
- const vm = mpInstance.$vm;
- if (vm) {
- return getExposeProxy(vm.$) || vm;
- }
- return toSkip(mpInstance);
- }
- return null;
- }
- function setTemplateRef({ r: r2, f: f2 }, refValue, setupState) {
- if (isFunction(r2)) {
- r2(refValue, {});
- } else {
- const _isString = isString(r2);
- const _isRef = isRef(r2);
- if (_isString || _isRef) {
- if (f2) {
- if (!_isRef) {
- return;
- }
- if (!isArray$1(r2.value)) {
- r2.value = [];
- }
- const existing = r2.value;
- if (existing.indexOf(refValue) === -1) {
- existing.push(refValue);
- if (!refValue) {
- return;
- }
- onBeforeUnmount(() => remove(existing, refValue), refValue.$);
- }
- } else if (_isString) {
- if (hasOwn$1(setupState, r2)) {
- setupState[r2] = refValue;
- }
- } else if (isRef(r2)) {
- r2.value = refValue;
- } else {
- warnRef(r2);
- }
- } else {
- warnRef(r2);
- }
- }
- }
- function warnRef(ref2) {
- warn("Invalid template ref type:", ref2, `(${typeof ref2})`);
- }
- var MPType;
- (function(MPType2) {
- MPType2["APP"] = "app";
- MPType2["PAGE"] = "page";
- MPType2["COMPONENT"] = "component";
- })(MPType || (MPType = {}));
- const queuePostRenderEffect = queuePostFlushCb;
- function mountComponent(initialVNode, options) {
- const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
- {
- instance.ctx.$onApplyOptions = onApplyOptions;
- instance.ctx.$children = [];
- }
- if (options.mpType === "app") {
- instance.render = NOOP;
- }
- if (options.onBeforeSetup) {
- options.onBeforeSetup(instance, options);
- }
- {
- pushWarningContext(initialVNode);
- startMeasure(instance, `mount`);
- }
- {
- startMeasure(instance, `init`);
- }
- setupComponent(instance);
- {
- endMeasure(instance, `init`);
- }
- {
- if (options.parentComponent && instance.proxy) {
- options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
- }
- }
- setupRenderEffect(instance);
- {
- popWarningContext();
- endMeasure(instance, `mount`);
- }
- return instance.proxy;
- }
- const getFunctionalFallthrough = (attrs) => {
- let res;
- for (const key in attrs) {
- if (key === "class" || key === "style" || isOn(key)) {
- (res || (res = {}))[key] = attrs[key];
- }
- }
- return res;
- };
- function renderComponentRoot(instance) {
- 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;
- instance.$templateRefs = [];
- instance.$ei = 0;
- pruneComponentPropsCache2(uid2);
- instance.__counter = instance.__counter === 0 ? 1 : 0;
- let result2;
- const prev = setCurrentRenderingInstance(instance);
- try {
- if (vnode.shapeFlag & 4) {
- fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
- const proxyToUse = withProxy || proxy;
- result2 = render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx);
- } else {
- fallthroughAttrs(inheritAttrs, props, propsOptions, Component2.props ? attrs : getFunctionalFallthrough(attrs));
- const render2 = Component2;
- result2 = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
- props,
- null
- /* we know it doesn't need it */
- );
- }
- } catch (err) {
- handleError(
- err,
- instance,
- 1
- /* ErrorCodes.RENDER_FUNCTION */
- );
- result2 = false;
- }
- setRef$1(instance);
- setCurrentRenderingInstance(prev);
- return result2;
- }
- function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
- if (props && fallthroughAttrs2 && inheritAttrs !== false) {
- const keys = Object.keys(fallthroughAttrs2).filter((key) => key !== "class" && key !== "style");
- if (!keys.length) {
- return;
- }
- if (propsOptions && keys.some(isModelListener)) {
- keys.forEach((key) => {
- if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
- props[key] = fallthroughAttrs2[key];
- }
- });
- } else {
- keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
- }
- }
- }
- const updateComponentPreRender = (instance) => {
- pauseTracking();
- flushPreFlushCbs();
- resetTracking();
- };
- function componentUpdateScopedSlotsFn() {
- const scopedSlotsData = this.$scopedSlotsData;
- if (!scopedSlotsData || scopedSlotsData.length === 0) {
- return;
- }
- const mpInstance = this.ctx.$scope;
- const oldData = mpInstance.data;
- const diffData = /* @__PURE__ */ Object.create(null);
- scopedSlotsData.forEach(({ path, index: index2, data }) => {
- const oldScopedSlotData = getValueByDataPath(oldData, path);
- const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
- if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
- diffData[diffPath] = data;
- } else {
- const diffScopedSlotData = diff(data, oldScopedSlotData[index2]);
- Object.keys(diffScopedSlotData).forEach((name) => {
- diffData[diffPath + "." + name] = diffScopedSlotData[name];
- });
- }
- });
- scopedSlotsData.length = 0;
- if (Object.keys(diffData).length) {
- mpInstance.setData(diffData);
- }
- }
- function toggleRecurse({ effect, update }, allowed) {
- effect.allowRecurse = update.allowRecurse = allowed;
- }
- function setupRenderEffect(instance) {
- const updateScopedSlots = componentUpdateScopedSlotsFn.bind(instance);
- instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
- const componentUpdateFn = () => {
- if (!instance.isMounted) {
- onBeforeUnmount(() => {
- setRef$1(instance, true);
- }, instance);
- {
- startMeasure(instance, `patch`);
- }
- patch(instance, renderComponentRoot(instance));
- {
- endMeasure(instance, `patch`);
- }
- {
- devtoolsComponentAdded(instance);
- }
- } else {
- const { next, bu, u: u2 } = instance;
- {
- pushWarningContext(next || instance.vnode);
- }
- toggleRecurse(instance, false);
- updateComponentPreRender();
- if (bu) {
- invokeArrayFns$1(bu);
- }
- toggleRecurse(instance, true);
- {
- startMeasure(instance, `patch`);
- }
- patch(instance, renderComponentRoot(instance));
- {
- endMeasure(instance, `patch`);
- }
- if (u2) {
- queuePostRenderEffect(u2);
- }
- {
- devtoolsComponentUpdated(instance);
- }
- {
- popWarningContext();
- }
- }
- };
- const effect = instance.effect = new ReactiveEffect(
- componentUpdateFn,
- () => queueJob(instance.update),
- instance.scope
- // track it in component's effect scope
- );
- const update = instance.update = effect.run.bind(effect);
- update.id = instance.uid;
- toggleRecurse(instance, true);
- {
- effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
- effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
- update.ownerInstance = instance;
- }
- update();
- }
- function unmountComponent(instance) {
- const { bum, scope, update, um } = instance;
- if (bum) {
- invokeArrayFns$1(bum);
- }
- scope.stop();
- if (update) {
- update.active = false;
- }
- if (um) {
- queuePostRenderEffect(um);
- }
- queuePostRenderEffect(() => {
- instance.isUnmounted = true;
- });
- {
- devtoolsComponentRemoved(instance);
- }
- }
- const oldCreateApp = createAppAPI();
- function getTarget() {
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- if (typeof my !== "undefined") {
- return my;
- }
- }
- function createVueApp(rootComponent, rootProps = null) {
- const target = getTarget();
- target.__VUE__ = true;
- {
- setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
- }
- const app = oldCreateApp(rootComponent, rootProps);
- const appContext = app._context;
- initAppConfig(appContext.config);
- const createVNode = (initialVNode) => {
- initialVNode.appContext = appContext;
- initialVNode.shapeFlag = 6;
- return initialVNode;
- };
- const createComponent2 = function createComponent3(initialVNode, options) {
- return mountComponent(createVNode(initialVNode), options);
- };
- const destroyComponent = function destroyComponent2(component) {
- return component && unmountComponent(component.$);
- };
- app.mount = function mount() {
- rootComponent.render = NOOP;
- const instance = mountComponent(createVNode({ type: rootComponent }), {
- mpType: MPType.APP,
- mpInstance: null,
- parentComponent: null,
- slots: [],
- props: null
- });
- app._instance = instance.$;
- {
- devtoolsInitApp(app, version);
- }
- instance.$app = app;
- instance.$createComponent = createComponent2;
- instance.$destroyComponent = destroyComponent;
- appContext.$appInstance = instance;
- return instance;
- };
- app.unmount = function unmount() {
- warn(`Cannot unmount an app.`);
- };
- return app;
- }
- function useCssVars(getter) {
- const instance = getCurrentInstance();
- if (!instance) {
- warn(`useCssVars is called without current active component instance.`);
- return;
- }
- initCssVarsRender(instance, getter);
- }
- function initCssVarsRender(instance, getter) {
- instance.ctx.__cssVars = () => {
- const vars = getter(instance.proxy);
- const cssVars = {};
- for (const key in vars) {
- cssVars[`--${key}`] = vars[key];
- }
- return cssVars;
- };
- }
- function injectLifecycleHook(name, hook, publicThis, instance) {
- if (isFunction(hook)) {
- injectHook(name, hook.bind(publicThis), instance);
- }
- }
- function initHooks$1(options, instance, publicThis) {
- const mpType = options.mpType || publicThis.$mpType;
- if (!mpType || mpType === "component") {
- return;
- }
- Object.keys(options).forEach((name) => {
- if (isUniLifecycleHook(name, options[name], false)) {
- const hooks = options[name];
- if (isArray$1(hooks)) {
- hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
- } else {
- injectLifecycleHook(name, hooks, publicThis, instance);
- }
- }
- });
- }
- function applyOptions$2(options, instance, publicThis) {
- initHooks$1(options, instance, publicThis);
- }
- function set$3(target, key, val) {
- return target[key] = val;
- }
- function $callMethod(method, ...args) {
- const fn = this[method];
- if (fn) {
- return fn(...args);
- }
- console.error(`method ${method} not found`);
- return null;
- }
- function createErrorHandler(app) {
- return function errorHandler(err, instance, _info) {
- if (!instance) {
- throw err;
- }
- const appInstance = app._instance;
- if (!appInstance || !appInstance.proxy) {
- throw err;
- }
- {
- appInstance.proxy.$callHook(ON_ERROR, err);
- }
- };
- }
- function mergeAsArray(to, from) {
- return to ? [...new Set([].concat(to, from))] : from;
- }
- function initOptionMergeStrategies(optionMergeStrategies) {
- UniLifecycleHooks.forEach((name) => {
- optionMergeStrategies[name] = mergeAsArray;
- });
- }
- let realAtob;
- const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
- if (typeof atob !== "function") {
- realAtob = function(str) {
- str = String(str).replace(/[\t\n\f\r ]+/g, "");
- if (!b64re.test(str)) {
- throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
- }
- str += "==".slice(2 - (str.length & 3));
- var bitmap;
- var result2 = "";
- var r1;
- var r2;
- var i2 = 0;
- for (; i2 < str.length; ) {
- 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++)));
- 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);
- }
- return result2;
- };
- } else {
- realAtob = atob;
- }
- function b64DecodeUnicode(str) {
- return decodeURIComponent(realAtob(str).split("").map(function(c2) {
- return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
- }).join(""));
- }
- function getCurrentUserInfo() {
- const token = index$1.getStorageSync("uni_id_token") || "";
- const tokenArr = token.split(".");
- if (!token || tokenArr.length !== 3) {
- return {
- uid: null,
- role: [],
- permission: [],
- tokenExpired: 0
- };
- }
- let userInfo;
- try {
- userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
- } catch (error) {
- throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
- }
- userInfo.tokenExpired = userInfo.exp * 1e3;
- delete userInfo.exp;
- delete userInfo.iat;
- return userInfo;
- }
- function uniIdMixin(globalProperties) {
- globalProperties.uniIDHasRole = function(roleId) {
- const { role } = getCurrentUserInfo();
- return role.indexOf(roleId) > -1;
- };
- globalProperties.uniIDHasPermission = function(permissionId) {
- const { permission } = getCurrentUserInfo();
- return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
- };
- globalProperties.uniIDTokenValid = function() {
- const { tokenExpired } = getCurrentUserInfo();
- return tokenExpired > Date.now();
- };
- }
- function initApp(app) {
- const appConfig = app._context.config;
- appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
- initOptionMergeStrategies(appConfig.optionMergeStrategies);
- const globalProperties = appConfig.globalProperties;
- {
- uniIdMixin(globalProperties);
- }
- {
- globalProperties.$set = set$3;
- globalProperties.$applyOptions = applyOptions$2;
- globalProperties.$callMethod = $callMethod;
- }
- {
- index$1.invokeCreateVueAppHook(app);
- }
- }
- const propsCaches = /* @__PURE__ */ Object.create(null);
- function renderProps(props) {
- const { uid: uid2, __counter } = getCurrentInstance();
- const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
- return uid2 + "," + propsId + "," + __counter;
- }
- function pruneComponentPropsCache(uid2) {
- delete propsCaches[uid2];
- }
- function findComponentPropsData(up) {
- if (!up) {
- return;
- }
- const [uid2, propsId] = up.split(",");
- if (!propsCaches[uid2]) {
- return;
- }
- return propsCaches[uid2][parseInt(propsId)];
- }
- var plugin = {
- install(app) {
- initApp(app);
- app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
- const oldMount = app.mount;
- app.mount = function mount(rootContainer) {
- const instance = oldMount.call(app, rootContainer);
- const createApp2 = getCreateApp();
- if (createApp2) {
- createApp2(instance);
- } else {
- if (typeof createMiniProgramApp !== "undefined") {
- createMiniProgramApp(instance);
- }
- }
- return instance;
- };
- }
- };
- function getCreateApp() {
- const method = "createApp";
- if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
- return global[method];
- } else if (typeof my !== "undefined") {
- return my[method];
- }
- }
- function vOn(value, key) {
- const instance = getCurrentInstance();
- const ctx = instance.ctx;
- const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString(key) || typeof key === "number") ? "_" + key : "";
- const name = "e" + instance.$ei++ + extraKey;
- const mpInstance = ctx.$scope;
- if (!value) {
- delete mpInstance[name];
- return name;
- }
- const existingInvoker = mpInstance[name];
- if (existingInvoker) {
- existingInvoker.value = value;
- } else {
- mpInstance[name] = createInvoker(value, instance);
- }
- return name;
- }
- function createInvoker(initialValue, instance) {
- const invoker = (e2) => {
- patchMPEvent(e2);
- let args = [e2];
- if (e2.detail && e2.detail.__args__) {
- args = e2.detail.__args__;
- }
- const eventValue = invoker.value;
- const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
- const eventTarget = e2.target;
- const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
- if (bubbles.includes(e2.type) && !eventSync) {
- setTimeout(invoke);
- } else {
- const res = invoke();
- if (e2.type === "input" && (isArray$1(res) || isPromise(res))) {
- return;
- }
- return res;
- }
- };
- invoker.value = initialValue;
- return invoker;
- }
- const bubbles = [
- // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
- // 'touchstart',
- // 'touchmove',
- // 'touchcancel',
- // 'touchend',
- "tap",
- "longpress",
- "longtap",
- "transitionend",
- "animationstart",
- "animationiteration",
- "animationend",
- "touchforcechange"
- ];
- function patchMPEvent(event) {
- if (event.type && event.target) {
- event.preventDefault = NOOP;
- event.stopPropagation = NOOP;
- event.stopImmediatePropagation = NOOP;
- if (!hasOwn$1(event, "detail")) {
- event.detail = {};
- }
- if (hasOwn$1(event, "markerId")) {
- event.detail = typeof event.detail === "object" ? event.detail : {};
- event.detail.markerId = event.markerId;
- }
- if (isPlainObject$2(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
- event.detail.value = event.detail.checked;
- }
- if (isPlainObject$2(event.detail)) {
- event.target = extend({}, event.target, event.detail);
- }
- }
- }
- function patchStopImmediatePropagation(e2, value) {
- if (isArray$1(value)) {
- const originalStop = e2.stopImmediatePropagation;
- e2.stopImmediatePropagation = () => {
- originalStop && originalStop.call(e2);
- e2._stopped = true;
- };
- return value.map((fn) => (e3) => !e3._stopped && fn(e3));
- } else {
- return value;
- }
- }
- function vFor(source, renderItem) {
- let ret;
- if (isArray$1(source) || isString(source)) {
- ret = new Array(source.length);
- for (let i2 = 0, l2 = source.length; i2 < l2; i2++) {
- ret[i2] = renderItem(source[i2], i2, i2);
- }
- } else if (typeof source === "number") {
- if (!Number.isInteger(source)) {
- warn(`The v-for range expect an integer value but got ${source}.`);
- return [];
- }
- ret = new Array(source);
- for (let i2 = 0; i2 < source; i2++) {
- ret[i2] = renderItem(i2 + 1, i2, i2);
- }
- } else if (isObject$3(source)) {
- if (source[Symbol.iterator]) {
- ret = Array.from(source, (item, i2) => renderItem(item, i2, i2));
- } else {
- const keys = Object.keys(source);
- ret = new Array(keys.length);
- for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) {
- const key = keys[i2];
- ret[i2] = renderItem(source[key], key, i2);
- }
- }
- } else {
- ret = [];
- }
- return ret;
- }
- function stringifyStyle(value) {
- if (isString(value)) {
- return value;
- }
- return stringify(normalizeStyle(value));
- }
- function stringify(styles) {
- let ret = "";
- if (!styles || isString(styles)) {
- return ret;
- }
- for (const key in styles) {
- ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
- }
- return ret;
- }
- function setRef(ref2, id, opts = {}) {
- const { $templateRefs } = getCurrentInstance();
- $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
- }
- function withModelModifiers(fn, { number, trim }, isComponent = false) {
- if (isComponent) {
- return (...args) => {
- if (trim) {
- args = args.map((a2) => a2.trim());
- } else if (number) {
- args = args.map(toNumber);
- }
- return fn(...args);
- };
- }
- return (event) => {
- const value = event.detail.value;
- if (trim) {
- event.detail.value = value.trim();
- } else if (number) {
- event.detail.value = toNumber(value);
- }
- return fn(event);
- };
- }
- const o$1 = (value, key) => vOn(value, key);
- const f$1 = (source, renderItem) => vFor(source, renderItem);
- const s$1 = (value) => stringifyStyle(value);
- const e$1 = (target, ...sources) => extend(target, ...sources);
- const n$1 = (value) => normalizeClass(value);
- const t$1 = (val) => toDisplayString(val);
- const p$1 = (props) => renderProps(props);
- const sr = (ref2, id, opts) => setRef(ref2, id, opts);
- const m$1 = (fn, modifiers, isComponent = false) => withModelModifiers(fn, modifiers, isComponent);
- function createApp$1(rootComponent, rootProps = null) {
- rootComponent && (rootComponent.mpType = "app");
- return createVueApp(rootComponent, rootProps).use(plugin);
- }
- const createSSRApp = createApp$1;
- const MP_METHODS = [
- "createSelectorQuery",
- "createIntersectionObserver",
- "selectAllComponents",
- "selectComponent"
- ];
- function createEmitFn(oldEmit, ctx) {
- return function emit2(event, ...args) {
- const scope = ctx.$scope;
- if (scope && event) {
- const detail = { __args__: args };
- {
- scope.triggerEvent(event, detail);
- }
- }
- return oldEmit.apply(this, [event, ...args]);
- };
- }
- function initBaseInstance(instance, options) {
- const ctx = instance.ctx;
- ctx.mpType = options.mpType;
- ctx.$mpType = options.mpType;
- ctx.$mpPlatform = "mp-weixin";
- ctx.$scope = options.mpInstance;
- ctx.$mp = {};
- {
- ctx._self = {};
- }
- instance.slots = {};
- if (isArray$1(options.slots) && options.slots.length) {
- options.slots.forEach((name) => {
- instance.slots[name] = true;
- });
- if (instance.slots[SLOT_DEFAULT_NAME]) {
- instance.slots.default = true;
- }
- }
- ctx.getOpenerEventChannel = function() {
- {
- return options.mpInstance.getOpenerEventChannel();
- }
- };
- ctx.$hasHook = hasHook;
- ctx.$callHook = callHook;
- instance.emit = createEmitFn(instance.emit, ctx);
- }
- function initComponentInstance(instance, options) {
- initBaseInstance(instance, options);
- const ctx = instance.ctx;
- MP_METHODS.forEach((method) => {
- ctx[method] = function(...args) {
- const mpInstance = ctx.$scope;
- if (mpInstance && mpInstance[method]) {
- return mpInstance[method].apply(mpInstance, args);
- }
- };
- });
- }
- function initMocks(instance, mpInstance, mocks2) {
- const ctx = instance.ctx;
- mocks2.forEach((mock) => {
- if (hasOwn$1(mpInstance, mock)) {
- instance[mock] = ctx[mock] = mpInstance[mock];
- }
- });
- }
- function hasHook(name) {
- const hooks = this.$[name];
- if (hooks && hooks.length) {
- return true;
- }
- return false;
- }
- function callHook(name, args) {
- if (name === "mounted") {
- callHook.call(this, "bm");
- this.$.isMounted = true;
- name = "m";
- }
- const hooks = this.$[name];
- return hooks && invokeArrayFns(hooks, args);
- }
- const PAGE_INIT_HOOKS = [
- ON_LOAD,
- ON_SHOW,
- ON_HIDE,
- ON_UNLOAD,
- ON_RESIZE,
- ON_TAB_ITEM_TAP,
- ON_REACH_BOTTOM,
- ON_PULL_DOWN_REFRESH,
- ON_ADD_TO_FAVORITES
- // 'onReady', // lifetimes.ready
- // 'onPageScroll', // 影响性能,开发者手动注册
- // 'onShareTimeline', // 右上角菜单,开发者手动注册
- // 'onShareAppMessage' // 右上角菜单,开发者手动注册
- ];
- function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
- if (vueOptions) {
- Object.keys(vueOptions).forEach((name) => {
- if (isUniLifecycleHook(name, vueOptions[name])) {
- hooks.add(name);
- }
- });
- {
- const { extends: extendsOptions, mixins } = vueOptions;
- if (mixins) {
- mixins.forEach((mixin) => findHooks(mixin, hooks));
- }
- if (extendsOptions) {
- findHooks(extendsOptions, hooks);
- }
- }
- }
- return hooks;
- }
- function initHook(mpOptions, hook, excludes) {
- if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
- mpOptions[hook] = function(args) {
- return this.$vm && this.$vm.$callHook(hook, args);
- };
- }
- }
- const EXCLUDE_HOOKS = [ON_READY];
- function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
- hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
- }
- function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
- findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
- }
- function initRuntimeHooks(mpOptions, runtimeHooks) {
- if (!runtimeHooks) {
- return;
- }
- const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
- hooks.forEach((hook) => {
- if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
- initHook(mpOptions, hook, []);
- }
- });
- }
- const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
- const runtimeHooks = [];
- const app = isFunction(getApp) && getApp({ allowDefault: true });
- if (app && app.$vm && app.$vm.$) {
- const mixins = app.$vm.$.appContext.mixins;
- if (isArray$1(mixins)) {
- const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
- mixins.forEach((mixin) => {
- hooks.forEach((hook) => {
- if (hasOwn$1(mixin, hook) && !runtimeHooks.includes(hook)) {
- runtimeHooks.push(hook);
- }
- });
- });
- }
- }
- return runtimeHooks;
- });
- function initMixinRuntimeHooks(mpOptions) {
- initHooks(mpOptions, findMixinRuntimeHooks());
- }
- const HOOKS = [
- ON_SHOW,
- ON_HIDE,
- ON_ERROR,
- ON_THEME_CHANGE,
- ON_PAGE_NOT_FOUND,
- ON_UNHANDLE_REJECTION
- ];
- function parseApp(instance, parseAppOptions) {
- const internalInstance = instance.$;
- const appOptions = {
- globalData: instance.$options && instance.$options.globalData || {},
- $vm: instance,
- onLaunch(options) {
- this.$vm = instance;
- const ctx = internalInstance.ctx;
- if (this.$vm && ctx.$scope) {
- return;
- }
- initBaseInstance(internalInstance, {
- mpType: "app",
- mpInstance: this,
- slots: []
- });
- ctx.globalData = this.globalData;
- instance.$callHook(ON_LAUNCH, options);
- }
- };
- const { onError: onError2 } = internalInstance;
- if (onError2) {
- internalInstance.appContext.config.errorHandler = (err) => {
- instance.$callHook(ON_ERROR, err);
- };
- }
- initLocale(instance);
- const vueOptions = instance.$.type;
- initHooks(appOptions, HOOKS);
- initUnknownHooks(appOptions, vueOptions);
- {
- const methods = vueOptions.methods;
- methods && extend(appOptions, methods);
- }
- if (parseAppOptions) {
- parseAppOptions.parse(appOptions);
- }
- return appOptions;
- }
- function initCreateApp(parseAppOptions) {
- return function createApp2(vm) {
- return App(parseApp(vm, parseAppOptions));
- };
- }
- function initCreateSubpackageApp(parseAppOptions) {
- return function createApp2(vm) {
- const appOptions = parseApp(vm, parseAppOptions);
- const app = isFunction(getApp) && getApp({
- allowDefault: true
- });
- if (!app)
- return;
- vm.$.ctx.$scope = app;
- const globalData = app.globalData;
- if (globalData) {
- Object.keys(appOptions.globalData).forEach((name) => {
- if (!hasOwn$1(globalData, name)) {
- globalData[name] = appOptions.globalData[name];
- }
- });
- }
- Object.keys(appOptions).forEach((name) => {
- if (!hasOwn$1(app, name)) {
- app[name] = appOptions[name];
- }
- });
- initAppLifecycle(appOptions, vm);
- };
- }
- function initAppLifecycle(appOptions, vm) {
- if (isFunction(appOptions.onLaunch)) {
- const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
- appOptions.onLaunch(args);
- }
- if (isFunction(appOptions.onShow) && wx.onAppShow) {
- wx.onAppShow((args) => {
- vm.$callHook("onShow", args);
- });
- }
- if (isFunction(appOptions.onHide) && wx.onAppHide) {
- wx.onAppHide((args) => {
- vm.$callHook("onHide", args);
- });
- }
- }
- function initLocale(appVm) {
- const locale = ref(normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
- Object.defineProperty(appVm, "$locale", {
- get() {
- return locale.value;
- },
- set(v2) {
- locale.value = v2;
- }
- });
- }
- function initVueIds(vueIds, mpInstance) {
- if (!vueIds) {
- return;
- }
- const ids = vueIds.split(",");
- const len = ids.length;
- if (len === 1) {
- mpInstance._$vueId = ids[0];
- } else if (len === 2) {
- mpInstance._$vueId = ids[0];
- mpInstance._$vuePid = ids[1];
- }
- }
- const EXTRAS = ["externalClasses"];
- function initExtraOptions(miniProgramComponentOptions, vueOptions) {
- EXTRAS.forEach((name) => {
- if (hasOwn$1(vueOptions, name)) {
- miniProgramComponentOptions[name] = vueOptions[name];
- }
- });
- }
- const WORKLET_RE = /_(.*)_worklet_factory_/;
- function initWorkletMethods(mpMethods, vueMethods) {
- if (vueMethods) {
- Object.keys(vueMethods).forEach((name) => {
- const matches = name.match(WORKLET_RE);
- if (matches) {
- const workletName = matches[1];
- mpMethods[name] = vueMethods[name];
- mpMethods[workletName] = vueMethods[workletName];
- }
- });
- }
- }
- function initWxsCallMethods(methods, wxsCallMethods) {
- if (!isArray$1(wxsCallMethods)) {
- return;
- }
- wxsCallMethods.forEach((callMethod) => {
- methods[callMethod] = function(args) {
- return this.$vm[callMethod](args);
- };
- });
- }
- function selectAllComponents(mpInstance, selector, $refs) {
- const components = mpInstance.selectAllComponents(selector);
- components.forEach((component) => {
- const ref2 = component.properties.uR;
- $refs[ref2] = component.$vm || component;
- });
- }
- function initRefs(instance, mpInstance) {
- Object.defineProperty(instance, "refs", {
- get() {
- const $refs = {};
- selectAllComponents(mpInstance, ".r", $refs);
- const forComponents = mpInstance.selectAllComponents(".r-i-f");
- forComponents.forEach((component) => {
- const ref2 = component.properties.uR;
- if (!ref2) {
- return;
- }
- if (!$refs[ref2]) {
- $refs[ref2] = [];
- }
- $refs[ref2].push(component.$vm || component);
- });
- return $refs;
- }
- });
- }
- function findVmByVueId(instance, vuePid) {
- const $children = instance.$children;
- for (let i2 = $children.length - 1; i2 >= 0; i2--) {
- const childVm = $children[i2];
- if (childVm.$scope._$vueId === vuePid) {
- return childVm;
- }
- }
- let parentVm;
- for (let i2 = $children.length - 1; i2 >= 0; i2--) {
- parentVm = findVmByVueId($children[i2], vuePid);
- if (parentVm) {
- return parentVm;
- }
- }
- }
- const builtInProps = [
- // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
- // event-opts
- "eO",
- // 组件 ref
- "uR",
- // 组件 ref-in-for
- "uRIF",
- // 组件 id
- "uI",
- // 组件类型 m: 小程序组件
- "uT",
- // 组件 props
- "uP",
- // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
- "uS"
- ];
- function initDefaultProps(options, isBehavior = false) {
- const properties = {};
- if (!isBehavior) {
- builtInProps.forEach((name) => {
- properties[name] = {
- type: null,
- value: ""
- };
- });
- properties.uS = {
- type: null,
- value: [],
- observer: function(newVal) {
- const $slots = /* @__PURE__ */ Object.create(null);
- newVal && newVal.forEach((slotName) => {
- $slots[slotName] = true;
- });
- this.setData({
- $slots
- });
- }
- };
- }
- if (options.behaviors) {
- if (options.behaviors.includes("wx://form-field")) {
- if (!options.properties || !options.properties.name) {
- properties.name = {
- type: null,
- value: ""
- };
- }
- if (!options.properties || !options.properties.value) {
- properties.value = {
- type: null,
- value: ""
- };
- }
- }
- }
- return properties;
- }
- function initVirtualHostProps(options) {
- const properties = {};
- {
- if (options && options.virtualHost) {
- properties.virtualHostStyle = {
- type: null,
- value: ""
- };
- properties.virtualHostClass = {
- type: null,
- value: ""
- };
- }
- }
- return properties;
- }
- function initProps(mpComponentOptions) {
- if (!mpComponentOptions.properties) {
- mpComponentOptions.properties = {};
- }
- extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
- }
- const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
- function parsePropType(type, defaultValue) {
- if (isArray$1(type) && type.length === 1) {
- return type[0];
- }
- return type;
- }
- function normalizePropType(type, defaultValue) {
- const res = parsePropType(type);
- return PROP_TYPES.indexOf(res) !== -1 ? res : null;
- }
- function initPageProps({ properties }, rawProps) {
- if (isArray$1(rawProps)) {
- rawProps.forEach((key) => {
- properties[key] = {
- type: String,
- value: ""
- };
- });
- } else if (isPlainObject$2(rawProps)) {
- Object.keys(rawProps).forEach((key) => {
- const opts = rawProps[key];
- if (isPlainObject$2(opts)) {
- let value = opts.default;
- if (isFunction(value)) {
- value = value();
- }
- const type = opts.type;
- opts.type = normalizePropType(type);
- properties[key] = {
- type: opts.type,
- value
- };
- } else {
- properties[key] = {
- type: normalizePropType(opts)
- };
- }
- });
- }
- }
- function findPropsData(properties, isPage2) {
- return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(properties.uP)) || {};
- }
- function findPagePropsData(properties) {
- const propsData = {};
- if (isPlainObject$2(properties)) {
- Object.keys(properties).forEach((name) => {
- if (builtInProps.indexOf(name) === -1) {
- propsData[name] = properties[name];
- }
- });
- }
- return propsData;
- }
- function initFormField(vm) {
- const vueOptions = vm.$options;
- if (isArray$1(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
- vm.$watch("modelValue", () => {
- vm.$scope && vm.$scope.setData({
- name: vm.name,
- value: vm.modelValue
- });
- }, {
- immediate: true
- });
- }
- }
- function initData(_2) {
- return {};
- }
- function initPropsObserver(componentOptions) {
- const observe = function observe2() {
- const up = this.properties.uP;
- if (!up) {
- return;
- }
- if (this.$vm) {
- updateComponentProps(up, this.$vm.$);
- } else if (this.properties.uT === "m") {
- updateMiniProgramComponentProperties(up, this);
- }
- };
- {
- if (!componentOptions.observers) {
- componentOptions.observers = {};
- }
- componentOptions.observers.uP = observe;
- }
- }
- function updateMiniProgramComponentProperties(up, mpInstance) {
- const prevProps = mpInstance.properties;
- const nextProps = findComponentPropsData(up) || {};
- if (hasPropsChanged(prevProps, nextProps, false)) {
- mpInstance.setData(nextProps);
- }
- }
- function updateComponentProps(up, instance) {
- const prevProps = toRaw(instance.props);
- const nextProps = findComponentPropsData(up) || {};
- if (hasPropsChanged(prevProps, nextProps)) {
- updateProps(instance, nextProps, prevProps, false);
- if (hasQueueJob(instance.update)) {
- invalidateJob(instance.update);
- }
- {
- instance.update();
- }
- }
- }
- function hasPropsChanged(prevProps, nextProps, checkLen = true) {
- const nextKeys = Object.keys(nextProps);
- if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
- return true;
- }
- for (let i2 = 0; i2 < nextKeys.length; i2++) {
- const key = nextKeys[i2];
- if (nextProps[key] !== prevProps[key]) {
- return true;
- }
- }
- return false;
- }
- function initBehaviors(vueOptions) {
- const vueBehaviors = vueOptions.behaviors;
- let vueProps = vueOptions.props;
- if (!vueProps) {
- vueOptions.props = vueProps = [];
- }
- const behaviors = [];
- if (isArray$1(vueBehaviors)) {
- vueBehaviors.forEach((behavior) => {
- behaviors.push(behavior.replace("uni://", "wx://"));
- if (behavior === "uni://form-field") {
- if (isArray$1(vueProps)) {
- vueProps.push("name");
- vueProps.push("modelValue");
- } else {
- vueProps.name = {
- type: String,
- default: ""
- };
- vueProps.modelValue = {
- type: [String, Number, Boolean, Array, Object, Date],
- default: ""
- };
- }
- }
- });
- }
- return behaviors;
- }
- function applyOptions(componentOptions, vueOptions) {
- componentOptions.data = initData();
- componentOptions.behaviors = initBehaviors(vueOptions);
- }
- function parseComponent(vueOptions, { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
- vueOptions = vueOptions.default || vueOptions;
- const options = {
- multipleSlots: true,
- // styleIsolation: 'apply-shared',
- addGlobalClass: true,
- pureDataPattern: /^uP$/
- };
- if (isArray$1(vueOptions.mixins)) {
- vueOptions.mixins.forEach((item) => {
- if (isObject$3(item.options)) {
- extend(options, item.options);
- }
- });
- }
- if (vueOptions.options) {
- extend(options, vueOptions.options);
- }
- const mpComponentOptions = {
- options,
- lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
- pageLifetimes: {
- show() {
- this.$vm && this.$vm.$callHook("onPageShow");
- },
- hide() {
- this.$vm && this.$vm.$callHook("onPageHide");
- },
- resize(size2) {
- this.$vm && this.$vm.$callHook("onPageResize", size2);
- }
- },
- methods: {
- __l: handleLink2
- }
- };
- {
- applyOptions(mpComponentOptions, vueOptions);
- }
- initProps(mpComponentOptions);
- initPropsObserver(mpComponentOptions);
- initExtraOptions(mpComponentOptions, vueOptions);
- initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
- {
- initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
- }
- if (parse2) {
- parse2(mpComponentOptions, { handleLink: handleLink2 });
- }
- return mpComponentOptions;
- }
- function initCreateComponent(parseOptions2) {
- return function createComponent2(vueComponentOptions) {
- return Component(parseComponent(vueComponentOptions, parseOptions2));
- };
- }
- let $createComponentFn;
- let $destroyComponentFn;
- function getAppVm() {
- return getApp().$vm;
- }
- function $createComponent(initialVNode, options) {
- if (!$createComponentFn) {
- $createComponentFn = getAppVm().$createComponent;
- }
- const proxy = $createComponentFn(initialVNode, options);
- return getExposeProxy(proxy.$) || proxy;
- }
- function $destroyComponent(instance) {
- if (!$destroyComponentFn) {
- $destroyComponentFn = getAppVm().$destroyComponent;
- }
- return $destroyComponentFn(instance);
- }
- function parsePage(vueOptions, parseOptions2) {
- const { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
- const miniProgramPageOptions = parseComponent(vueOptions, {
- mocks: mocks2,
- isPage: isPage2,
- initRelation: initRelation2,
- handleLink: handleLink2,
- initLifetimes: initLifetimes2
- });
- initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
- const methods = miniProgramPageOptions.methods;
- methods.onLoad = function(query) {
- this.options = query;
- this.$page = {
- fullPath: addLeadingSlash(this.route + stringifyQuery(query))
- };
- return this.$vm && this.$vm.$callHook(ON_LOAD, query);
- };
- initHooks(methods, PAGE_INIT_HOOKS);
- {
- initUnknownHooks(methods, vueOptions);
- }
- initRuntimeHooks(methods, vueOptions.__runtimeHooks);
- initMixinRuntimeHooks(methods);
- parse2 && parse2(miniProgramPageOptions, { handleLink: handleLink2 });
- return miniProgramPageOptions;
- }
- function initCreatePage(parseOptions2) {
- return function createPage2(vuePageOptions) {
- return Component(parsePage(vuePageOptions, parseOptions2));
- };
- }
- function initCreatePluginApp(parseAppOptions) {
- return function createApp2(vm) {
- initAppLifecycle(parseApp(vm, parseAppOptions), vm);
- };
- }
- const MPPage = Page;
- const MPComponent = Component;
- function initTriggerEvent(mpInstance) {
- const oldTriggerEvent = mpInstance.triggerEvent;
- const newTriggerEvent = function(event, ...args) {
- return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
- };
- try {
- mpInstance.triggerEvent = newTriggerEvent;
- } catch (error) {
- mpInstance._triggerEvent = newTriggerEvent;
- }
- }
- function initMiniProgramHook(name, options, isComponent) {
- const oldHook = options[name];
- if (!oldHook) {
- options[name] = function() {
- initTriggerEvent(this);
- };
- } else {
- options[name] = function(...args) {
- initTriggerEvent(this);
- return oldHook.apply(this, args);
- };
- }
- }
- Page = function(options) {
- initMiniProgramHook(ON_LOAD, options);
- return MPPage(options);
- };
- Component = function(options) {
- initMiniProgramHook("created", options);
- const isVueComponent = options.properties && options.properties.uP;
- if (!isVueComponent) {
- initProps(options);
- initPropsObserver(options);
- }
- return MPComponent(options);
- };
- function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
- return {
- attached() {
- let properties = this.properties;
- initVueIds(properties.uI, this);
- const relationOptions = {
- vuePid: this._$vuePid
- };
- initRelation2(this, relationOptions);
- const mpInstance = this;
- const isMiniProgramPage = isPage2(mpInstance);
- let propsData = properties;
- this.$vm = $createComponent({
- type: vueOptions,
- props: findPropsData(propsData, isMiniProgramPage)
- }, {
- mpType: isMiniProgramPage ? "page" : "component",
- mpInstance,
- slots: properties.uS || {},
- parentComponent: relationOptions.parent && relationOptions.parent.$,
- onBeforeSetup(instance, options) {
- initRefs(instance, mpInstance);
- initMocks(instance, mpInstance, mocks2);
- initComponentInstance(instance, options);
- }
- });
- if (!isMiniProgramPage) {
- initFormField(this.$vm);
- }
- },
- ready() {
- if (this.$vm) {
- {
- this.$vm.$callHook("mounted");
- this.$vm.$callHook(ON_READY);
- }
- }
- },
- detached() {
- if (this.$vm) {
- pruneComponentPropsCache(this.$vm.$.uid);
- $destroyComponent(this.$vm);
- }
- }
- };
- }
- const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
- function isPage(mpInstance) {
- return !!mpInstance.route;
- }
- function initRelation(mpInstance, detail) {
- mpInstance.triggerEvent("__l", detail);
- }
- function handleLink(event) {
- const detail = event.detail || event.value;
- const vuePid = detail.vuePid;
- let parentVm;
- if (vuePid) {
- parentVm = findVmByVueId(this.$vm, vuePid);
- }
- if (!parentVm) {
- parentVm = this.$vm;
- }
- detail.parent = parentVm;
- }
- var parseOptions = /* @__PURE__ */ Object.freeze({
- __proto__: null,
- handleLink,
- initLifetimes,
- initRelation,
- isPage,
- mocks
- });
- const createApp = initCreateApp();
- const createPage = initCreatePage(parseOptions);
- const createComponent = initCreateComponent(parseOptions);
- const createPluginApp = initCreatePluginApp();
- const createSubpackageApp = initCreateSubpackageApp();
- {
- wx.createApp = global.createApp = createApp;
- wx.createPage = createPage;
- wx.createComponent = createComponent;
- wx.createPluginApp = global.createPluginApp = createPluginApp;
- wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
- }
- const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
- !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
- };
- const onShow = /* @__PURE__ */ createHook(ON_SHOW);
- const onHide = /* @__PURE__ */ createHook(ON_HIDE);
- const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
- const onError = /* @__PURE__ */ createHook(ON_ERROR);
- const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
- const onReady = /* @__PURE__ */ createHook(ON_READY);
- const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
- const onPageScroll = /* @__PURE__ */ createHook(ON_PAGE_SCROLL);
- const onReachBottom = /* @__PURE__ */ createHook(ON_REACH_BOTTOM);
- const onPullDownRefresh = /* @__PURE__ */ createHook(ON_PULL_DOWN_REFRESH);
- const onShareAppMessage = /* @__PURE__ */ createHook(ON_SHARE_APP_MESSAGE);
- var toString = Object.prototype.toString;
- function isArray(val) {
- return toString.call(val) === "[object Array]";
- }
- function isObject$1(val) {
- return val !== null && typeof val === "object";
- }
- function isDate(val) {
- return toString.call(val) === "[object Date]";
- }
- function isURLSearchParams(val) {
- return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
- }
- function forEach(obj, fn) {
- if (obj === null || typeof obj === "undefined") {
- return;
- }
- if (typeof obj !== "object") {
- obj = [obj];
- }
- if (isArray(obj)) {
- for (var i2 = 0, l2 = obj.length; i2 < l2; i2++) {
- fn.call(null, obj[i2], i2, obj);
- }
- } else {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn.call(null, obj[key], key, obj);
- }
- }
- }
- }
- function isPlainObject$1(obj) {
- return Object.prototype.toString.call(obj) === "[object Object]";
- }
- function deepMerge() {
- let result2 = {};
- function assignValue(val, key) {
- if (typeof result2[key] === "object" && typeof val === "object") {
- result2[key] = deepMerge(result2[key], val);
- } else if (typeof val === "object") {
- result2[key] = deepMerge({}, val);
- } else {
- result2[key] = val;
- }
- }
- for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
- forEach(arguments[i2], assignValue);
- }
- return result2;
- }
- function isUndefined(val) {
- return typeof val === "undefined";
- }
- function encode(val) {
- return encodeURIComponent(val).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
- }
- function buildURL(url, params, paramsSerializer) {
- if (!params) {
- return url;
- }
- var serializedParams;
- if (paramsSerializer) {
- serializedParams = paramsSerializer(params);
- } else if (isURLSearchParams(params)) {
- serializedParams = params.toString();
- } else {
- var parts = [];
- forEach(params, function serialize(val, key) {
- if (val === null || typeof val === "undefined") {
- return;
- }
- if (isArray(val)) {
- key = key + "[]";
- } else {
- val = [val];
- }
- forEach(val, function parseValue(v2) {
- if (isDate(v2)) {
- v2 = v2.toISOString();
- } else if (isObject$1(v2)) {
- v2 = JSON.stringify(v2);
- }
- parts.push(encode(key) + "=" + encode(v2));
- });
- });
- serializedParams = parts.join("&");
- }
- if (serializedParams) {
- var hashmarkIndex = url.indexOf("#");
- if (hashmarkIndex !== -1) {
- url = url.slice(0, hashmarkIndex);
- }
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
- }
- return url;
- }
- function isAbsoluteURL(url) {
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
- }
- function combineURLs(baseURL, relativeURL) {
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
- }
- function buildFullPath(baseURL, requestedURL) {
- if (baseURL && !isAbsoluteURL(requestedURL)) {
- return combineURLs(baseURL, requestedURL);
- }
- return requestedURL;
- }
- function settle(resolve2, reject, response) {
- const validateStatus2 = response.config.validateStatus;
- const status = response.statusCode;
- if (status && (!validateStatus2 || validateStatus2(status))) {
- resolve2(response);
- } else {
- reject(response);
- }
- }
- const mergeKeys$1 = (keys, config2) => {
- let config = {};
- keys.forEach((prop) => {
- if (!isUndefined(config2[prop])) {
- config[prop] = config2[prop];
- }
- });
- return config;
- };
- const adapter = (config) => {
- return new Promise((resolve2, reject) => {
- let fullPath = buildURL(buildFullPath(config.baseURL, config.url), config.params, config.paramsSerializer);
- const _config = {
- url: fullPath,
- header: config.header,
- complete: (response) => {
- config.fullPath = fullPath;
- response.config = config;
- response.rawData = response.data;
- try {
- let jsonParseHandle = false;
- const forcedJSONParsingType = typeof config.forcedJSONParsing;
- if (forcedJSONParsingType === "boolean") {
- jsonParseHandle = config.forcedJSONParsing;
- } else if (forcedJSONParsingType === "object") {
- const includesMethod = config.forcedJSONParsing.include || [];
- jsonParseHandle = includesMethod.includes(config.method);
- }
- if (jsonParseHandle && typeof response.data === "string") {
- response.data = JSON.parse(response.data);
- }
- } catch (e2) {
- }
- settle(resolve2, reject, response);
- }
- };
- let requestTask;
- if (config.method === "UPLOAD") {
- delete _config.header["content-type"];
- delete _config.header["Content-Type"];
- let otherConfig = {
- filePath: config.filePath,
- name: config.name
- };
- const optionalKeys = [
- "timeout",
- "formData"
- ];
- requestTask = index$1.uploadFile({ ..._config, ...otherConfig, ...mergeKeys$1(optionalKeys, config) });
- } else if (config.method === "DOWNLOAD") {
- const optionalKeys = [
- "timeout",
- "filePath"
- ];
- requestTask = index$1.downloadFile({ ..._config, ...mergeKeys$1(optionalKeys, config) });
- } else {
- const optionalKeys = [
- "data",
- "method",
- "timeout",
- "dataType",
- "responseType",
- "enableHttp2",
- "enableQuic",
- "enableCache",
- "enableHttpDNS",
- "httpDNSServiceId",
- "enableChunked",
- "forceCellularNetwork"
- ];
- requestTask = index$1.request({ ..._config, ...mergeKeys$1(optionalKeys, config) });
- }
- if (config.getTask) {
- config.getTask(requestTask, config);
- }
- });
- };
- const dispatchRequest = (config) => {
- return adapter(config);
- };
- function InterceptorManager() {
- this.handlers = [];
- }
- InterceptorManager.prototype.use = function use(fulfilled, rejected) {
- this.handlers.push({
- fulfilled,
- rejected
- });
- return this.handlers.length - 1;
- };
- InterceptorManager.prototype.eject = function eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
- };
- InterceptorManager.prototype.forEach = function forEach2(fn) {
- this.handlers.forEach((h2) => {
- if (h2 !== null) {
- fn(h2);
- }
- });
- };
- const mergeKeys = (keys, globalsConfig, config2) => {
- let config = {};
- keys.forEach((prop) => {
- if (!isUndefined(config2[prop])) {
- config[prop] = config2[prop];
- } else if (!isUndefined(globalsConfig[prop])) {
- config[prop] = globalsConfig[prop];
- }
- });
- return config;
- };
- const mergeConfig = (globalsConfig, config2 = {}) => {
- const method = config2.method || globalsConfig.method || "GET";
- let config = {
- baseURL: config2.baseURL || globalsConfig.baseURL || "",
- method,
- url: config2.url || "",
- params: config2.params || {},
- custom: { ...globalsConfig.custom || {}, ...config2.custom || {} },
- header: deepMerge(globalsConfig.header || {}, config2.header || {})
- };
- const defaultToConfig2Keys = ["getTask", "validateStatus", "paramsSerializer", "forcedJSONParsing"];
- config = { ...config, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2) };
- if (method === "DOWNLOAD") {
- const downloadKeys = [
- "timeout",
- "filePath"
- ];
- config = { ...config, ...mergeKeys(downloadKeys, globalsConfig, config2) };
- } else if (method === "UPLOAD") {
- delete config.header["content-type"];
- delete config.header["Content-Type"];
- const uploadKeys = [
- "filePath",
- "name",
- "timeout",
- "formData"
- ];
- uploadKeys.forEach((prop) => {
- if (!isUndefined(config2[prop])) {
- config[prop] = config2[prop];
- }
- });
- if (isUndefined(config.timeout) && !isUndefined(globalsConfig.timeout)) {
- config["timeout"] = globalsConfig["timeout"];
- }
- } else {
- const defaultsKeys = [
- "data",
- "timeout",
- "dataType",
- "responseType",
- "enableHttp2",
- "enableQuic",
- "enableCache",
- "enableHttpDNS",
- "httpDNSServiceId",
- "enableChunked",
- "forceCellularNetwork"
- ];
- config = { ...config, ...mergeKeys(defaultsKeys, globalsConfig, config2) };
- }
- return config;
- };
- const defaults = {
- baseURL: "",
- header: {},
- method: "GET",
- dataType: "json",
- paramsSerializer: null,
- responseType: "text",
- custom: {},
- timeout: 6e4,
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- },
- // 是否尝试将响应数据json化
- forcedJSONParsing: true
- };
- var clone = function() {
- function _instanceof(obj, type) {
- return type != null && obj instanceof type;
- }
- var nativeMap;
- try {
- nativeMap = Map;
- } catch (_2) {
- nativeMap = function() {
- };
- }
- var nativeSet;
- try {
- nativeSet = Set;
- } catch (_2) {
- nativeSet = function() {
- };
- }
- var nativePromise;
- try {
- nativePromise = Promise;
- } catch (_2) {
- nativePromise = function() {
- };
- }
- function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
- if (typeof circular === "object") {
- depth = circular.depth;
- prototype = circular.prototype;
- includeNonEnumerable = circular.includeNonEnumerable;
- circular = circular.circular;
- }
- var allParents = [];
- var allChildren = [];
- var useBuffer = typeof Buffer != "undefined";
- if (typeof circular == "undefined")
- circular = true;
- if (typeof depth == "undefined")
- depth = Infinity;
- function _clone(parent2, depth2) {
- if (parent2 === null)
- return null;
- if (depth2 === 0)
- return parent2;
- var child;
- var proto;
- if (typeof parent2 != "object") {
- return parent2;
- }
- if (_instanceof(parent2, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent2, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent2, nativePromise)) {
- child = new nativePromise(function(resolve2, reject) {
- parent2.then(function(value) {
- resolve2(_clone(value, depth2 - 1));
- }, function(err) {
- reject(_clone(err, depth2 - 1));
- });
- });
- } else if (clone2.__isArray(parent2)) {
- child = [];
- } else if (clone2.__isRegExp(parent2)) {
- child = new RegExp(parent2.source, __getRegExpFlags(parent2));
- if (parent2.lastIndex)
- child.lastIndex = parent2.lastIndex;
- } else if (clone2.__isDate(parent2)) {
- child = new Date(parent2.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent2)) {
- if (Buffer.from) {
- child = Buffer.from(parent2);
- } else {
- child = new Buffer(parent2.length);
- parent2.copy(child);
- }
- return child;
- } else if (_instanceof(parent2, Error)) {
- child = Object.create(parent2);
- } else {
- if (typeof prototype == "undefined") {
- proto = Object.getPrototypeOf(parent2);
- child = Object.create(proto);
- } else {
- child = Object.create(prototype);
- proto = prototype;
- }
- }
- if (circular) {
- var index2 = allParents.indexOf(parent2);
- if (index2 != -1) {
- return allChildren[index2];
- }
- allParents.push(parent2);
- allChildren.push(child);
- }
- if (_instanceof(parent2, nativeMap)) {
- parent2.forEach(function(value, key) {
- var keyChild = _clone(key, depth2 - 1);
- var valueChild = _clone(value, depth2 - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent2, nativeSet)) {
- parent2.forEach(function(value) {
- var entryChild = _clone(value, depth2 - 1);
- child.add(entryChild);
- });
- }
- for (var i2 in parent2) {
- var attrs = Object.getOwnPropertyDescriptor(parent2, i2);
- if (attrs) {
- child[i2] = _clone(parent2[i2], depth2 - 1);
- }
- try {
- var objProperty = Object.getOwnPropertyDescriptor(parent2, i2);
- if (objProperty.set === "undefined") {
- continue;
- }
- child[i2] = _clone(parent2[i2], depth2 - 1);
- } catch (e2) {
- if (e2 instanceof TypeError) {
- continue;
- } else if (e2 instanceof ReferenceError) {
- continue;
- }
- }
- }
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent2);
- for (var i2 = 0; i2 < symbols.length; i2++) {
- var symbol = symbols[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent2[symbol], depth2 - 1);
- Object.defineProperty(child, symbol, descriptor);
- }
- }
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent2);
- for (var i2 = 0; i2 < allPropertyNames.length; i2++) {
- var propertyName = allPropertyNames[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
- Object.defineProperty(child, propertyName, descriptor);
- }
- }
- return child;
- }
- return _clone(parent, depth);
- }
- clone2.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
- var c2 = function() {
- };
- c2.prototype = parent;
- return new c2();
- };
- function __objToStr(o2) {
- return Object.prototype.toString.call(o2);
- }
- clone2.__objToStr = __objToStr;
- function __isDate(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object Date]";
- }
- clone2.__isDate = __isDate;
- function __isArray(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object Array]";
- }
- clone2.__isArray = __isArray;
- function __isRegExp(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object RegExp]";
- }
- clone2.__isRegExp = __isRegExp;
- function __getRegExpFlags(re2) {
- var flags = "";
- if (re2.global)
- flags += "g";
- if (re2.ignoreCase)
- flags += "i";
- if (re2.multiline)
- flags += "m";
- return flags;
- }
- clone2.__getRegExpFlags = __getRegExpFlags;
- return clone2;
- }();
- class Request {
- /**
- * @param {Object} arg - 全局配置
- * @param {String} arg.baseURL - 全局根路径
- * @param {Object} arg.header - 全局header
- * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
- * @param {String} arg.dataType = [json] - 全局默认的dataType
- * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持
- * @param {Object} arg.custom - 全局默认的自定义参数
- * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序
- * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
- * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
- * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
- * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
- */
- constructor(arg = {}) {
- if (!isPlainObject$1(arg)) {
- arg = {};
- console.warn("设置全局参数必须接收一个Object");
- }
- this.config = clone({ ...defaults, ...arg });
- this.interceptors = {
- request: new InterceptorManager(),
- response: new InterceptorManager()
- };
- }
- /**
- * @Function
- * @param {Request~setConfigCallback} f - 设置全局默认配置
- */
- setConfig(f2) {
- this.config = f2(this.config);
- }
- middleware(config) {
- config = mergeConfig(this.config, config);
- let chain = [dispatchRequest, void 0];
- let promise = Promise.resolve(config);
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- chain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- chain.push(interceptor.fulfilled, interceptor.rejected);
- });
- while (chain.length) {
- promise = promise.then(chain.shift(), chain.shift());
- }
- return promise;
- }
- /**
- * @Function
- * @param {Object} config - 请求配置项
- * @prop {String} options.url - 请求路径
- * @prop {Object} options.data - 请求参数
- * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
- * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
- * @prop {Object} [options.header = config.header] - 请求header
- * @prop {Object} [options.method = config.method] - 请求方法
- * @returns {Promise<unknown>}
- */
- request(config = {}) {
- return this.middleware(config);
- }
- get(url, options = {}) {
- return this.middleware({
- url,
- method: "GET",
- ...options
- });
- }
- post(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "POST",
- ...options
- });
- }
- put(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "PUT",
- ...options
- });
- }
- delete(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "DELETE",
- ...options
- });
- }
- connect(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "CONNECT",
- ...options
- });
- }
- head(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "HEAD",
- ...options
- });
- }
- options(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "OPTIONS",
- ...options
- });
- }
- trace(url, data, options = {}) {
- return this.middleware({
- url,
- data,
- method: "TRACE",
- ...options
- });
- }
- upload(url, config = {}) {
- config.url = url;
- config.method = "UPLOAD";
- return this.middleware(config);
- }
- download(url, config = {}) {
- config.url = url;
- config.method = "DOWNLOAD";
- return this.middleware(config);
- }
- get version() {
- return "3.1.0";
- }
- }
- var isVue2 = false;
- function set(target, key, val) {
- if (Array.isArray(target)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val;
- }
- target[key] = val;
- return val;
- }
- function del(target, key) {
- if (Array.isArray(target)) {
- target.splice(key, 1);
- return;
- }
- delete target[key];
- }
- /*!
- * pinia v2.0.33
- * (c) 2023 Eduardo San Martin Morote
- * @license MIT
- */
- let activePinia;
- const setActivePinia = (pinia) => activePinia = pinia;
- const piniaSymbol = Symbol("pinia");
- function isPlainObject(o2) {
- return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
- }
- var MutationType;
- (function(MutationType2) {
- MutationType2["direct"] = "direct";
- MutationType2["patchObject"] = "patch object";
- MutationType2["patchFunction"] = "patch function";
- })(MutationType || (MutationType = {}));
- const IS_CLIENT = typeof window !== "undefined";
- const USE_DEVTOOLS = IS_CLIENT;
- const componentStateTypes = [];
- const getStoreType = (id) => "🍍 " + id;
- function addStoreToDevtools(app, store) {
- if (!componentStateTypes.includes(getStoreType(store.$id))) {
- componentStateTypes.push(getStoreType(store.$id));
- }
- }
- function patchActionForGrouping(store, actionNames) {
- const actions = actionNames.reduce((storeActions, actionName) => {
- storeActions[actionName] = toRaw(store)[actionName];
- return storeActions;
- }, {});
- for (const actionName in actions) {
- store[actionName] = function() {
- const trackedStore = new Proxy(store, {
- get(...args) {
- return Reflect.get(...args);
- },
- set(...args) {
- return Reflect.set(...args);
- }
- });
- return actions[actionName].apply(trackedStore, arguments);
- };
- }
- }
- function devtoolsPlugin({ app, store, options }) {
- if (store.$id.startsWith("__hot:")) {
- return;
- }
- if (options.state) {
- store._isOptionsAPI = true;
- }
- if (typeof options.state === "function") {
- patchActionForGrouping(
- // @ts-expect-error: can cast the store...
- store,
- Object.keys(options.actions)
- );
- const originalHotUpdate = store._hotUpdate;
- toRaw(store)._hotUpdate = function(newStore) {
- originalHotUpdate.apply(this, arguments);
- patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions));
- };
- }
- addStoreToDevtools(
- app,
- // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
- store
- );
- }
- function createPinia() {
- const scope = effectScope(true);
- const state = scope.run(() => ref({}));
- let _p = [];
- let toBeInstalled = [];
- const pinia = markRaw({
- install(app) {
- setActivePinia(pinia);
- {
- pinia._a = app;
- app.provide(piniaSymbol, pinia);
- app.config.globalProperties.$pinia = pinia;
- toBeInstalled.forEach((plugin2) => _p.push(plugin2));
- toBeInstalled = [];
- }
- },
- use(plugin2) {
- if (!this._a && !isVue2) {
- toBeInstalled.push(plugin2);
- } else {
- _p.push(plugin2);
- }
- return this;
- },
- _p,
- // it's actually undefined here
- // @ts-expect-error
- _a: null,
- _e: scope,
- _s: /* @__PURE__ */ new Map(),
- state
- });
- if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
- pinia.use(devtoolsPlugin);
- }
- return pinia;
- }
- function patchObject(newState, oldState) {
- for (const key in oldState) {
- const subPatch = oldState[key];
- if (!(key in newState)) {
- continue;
- }
- const targetValue = newState[key];
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
- newState[key] = patchObject(targetValue, subPatch);
- } else {
- {
- newState[key] = subPatch;
- }
- }
- }
- return newState;
- }
- const noop = () => {
- };
- function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
- subscriptions.push(callback);
- const removeSubscription = () => {
- const idx = subscriptions.indexOf(callback);
- if (idx > -1) {
- subscriptions.splice(idx, 1);
- onCleanup();
- }
- };
- if (!detached && getCurrentScope()) {
- onScopeDispose(removeSubscription);
- }
- return removeSubscription;
- }
- function triggerSubscriptions(subscriptions, ...args) {
- subscriptions.slice().forEach((callback) => {
- callback(...args);
- });
- }
- function mergeReactiveObjects(target, patchToApply) {
- if (target instanceof Map && patchToApply instanceof Map) {
- patchToApply.forEach((value, key) => target.set(key, value));
- }
- if (target instanceof Set && patchToApply instanceof Set) {
- patchToApply.forEach(target.add, target);
- }
- for (const key in patchToApply) {
- if (!patchToApply.hasOwnProperty(key))
- continue;
- const subPatch = patchToApply[key];
- const targetValue = target[key];
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
- target[key] = mergeReactiveObjects(targetValue, subPatch);
- } else {
- target[key] = subPatch;
- }
- }
- return target;
- }
- const skipHydrateSymbol = Symbol("pinia:skipHydration");
- function shouldHydrate(obj) {
- return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
- }
- const { assign } = Object;
- function isComputed(o2) {
- return !!(isRef(o2) && o2.effect);
- }
- function createOptionsStore(id, options, pinia, hot) {
- const { state, actions, getters } = options;
- const initialState = pinia.state.value[id];
- let store;
- function setup() {
- if (!initialState && !hot) {
- {
- pinia.state.value[id] = state ? state() : {};
- }
- }
- const localState = hot ? (
- // use ref() to unwrap refs inside state TODO: check if this is still necessary
- toRefs(ref(state ? state() : {}).value)
- ) : toRefs(pinia.state.value[id]);
- return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
- if (name in localState) {
- console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
- }
- computedGetters[name] = markRaw(computed(() => {
- setActivePinia(pinia);
- const store2 = pinia._s.get(id);
- return getters[name].call(store2, store2);
- }));
- return computedGetters;
- }, {}));
- }
- store = createSetupStore(id, setup, options, pinia, hot, true);
- return store;
- }
- function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
- let scope;
- const optionsForPlugin = assign({ actions: {} }, options);
- if (!pinia._e.active) {
- throw new Error("Pinia destroyed");
- }
- const $subscribeOptions = {
- deep: true
- // flush: 'post',
- };
- {
- $subscribeOptions.onTrigger = (event) => {
- if (isListening) {
- debuggerEvents = event;
- } else if (isListening == false && !store._hotUpdating) {
- if (Array.isArray(debuggerEvents)) {
- debuggerEvents.push(event);
- } else {
- console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
- }
- }
- };
- }
- let isListening;
- let isSyncListening;
- let subscriptions = markRaw([]);
- let actionSubscriptions = markRaw([]);
- let debuggerEvents;
- const initialState = pinia.state.value[$id];
- if (!isOptionsStore && !initialState && !hot) {
- {
- pinia.state.value[$id] = {};
- }
- }
- const hotState = ref({});
- let activeListener;
- function $patch(partialStateOrMutator) {
- let subscriptionMutation;
- isListening = isSyncListening = false;
- {
- debuggerEvents = [];
- }
- if (typeof partialStateOrMutator === "function") {
- partialStateOrMutator(pinia.state.value[$id]);
- subscriptionMutation = {
- type: MutationType.patchFunction,
- storeId: $id,
- events: debuggerEvents
- };
- } else {
- mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
- subscriptionMutation = {
- type: MutationType.patchObject,
- payload: partialStateOrMutator,
- storeId: $id,
- events: debuggerEvents
- };
- }
- const myListenerId = activeListener = Symbol();
- nextTick$1().then(() => {
- if (activeListener === myListenerId) {
- isListening = true;
- }
- });
- isSyncListening = true;
- triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
- }
- const $reset = isOptionsStore ? function $reset2() {
- const { state } = options;
- const newState = state ? state() : {};
- this.$patch(($state) => {
- assign($state, newState);
- });
- } : (
- /* istanbul ignore next */
- () => {
- throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
- }
- );
- function $dispose() {
- scope.stop();
- subscriptions = [];
- actionSubscriptions = [];
- pinia._s.delete($id);
- }
- function wrapAction(name, action) {
- return function() {
- setActivePinia(pinia);
- const args = Array.from(arguments);
- const afterCallbackList = [];
- const onErrorCallbackList = [];
- function after(callback) {
- afterCallbackList.push(callback);
- }
- function onError2(callback) {
- onErrorCallbackList.push(callback);
- }
- triggerSubscriptions(actionSubscriptions, {
- args,
- name,
- store,
- after,
- onError: onError2
- });
- let ret;
- try {
- ret = action.apply(this && this.$id === $id ? this : store, args);
- } catch (error) {
- triggerSubscriptions(onErrorCallbackList, error);
- throw error;
- }
- if (ret instanceof Promise) {
- return ret.then((value) => {
- triggerSubscriptions(afterCallbackList, value);
- return value;
- }).catch((error) => {
- triggerSubscriptions(onErrorCallbackList, error);
- return Promise.reject(error);
- });
- }
- triggerSubscriptions(afterCallbackList, ret);
- return ret;
- };
- }
- const _hmrPayload = /* @__PURE__ */ markRaw({
- actions: {},
- getters: {},
- state: [],
- hotState
- });
- const partialStore = {
- _p: pinia,
- // _s: scope,
- $id,
- $onAction: addSubscription.bind(null, actionSubscriptions),
- $patch,
- $reset,
- $subscribe(callback, options2 = {}) {
- const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
- const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
- if (options2.flush === "sync" ? isSyncListening : isListening) {
- callback({
- storeId: $id,
- type: MutationType.direct,
- events: debuggerEvents
- }, state);
- }
- }, assign({}, $subscribeOptions, options2)));
- return removeSubscription;
- },
- $dispose
- };
- const store = reactive(
- assign(
- {
- _hmrPayload,
- _customProperties: markRaw(/* @__PURE__ */ new Set())
- // devtools custom properties
- },
- partialStore
- // must be added later
- // setupStore
- )
- );
- pinia._s.set($id, store);
- const setupStore = pinia._e.run(() => {
- scope = effectScope();
- return scope.run(() => setup());
- });
- for (const key in setupStore) {
- const prop = setupStore[key];
- if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
- if (hot) {
- set(hotState.value, key, toRef(setupStore, key));
- } else if (!isOptionsStore) {
- if (initialState && shouldHydrate(prop)) {
- if (isRef(prop)) {
- prop.value = initialState[key];
- } else {
- mergeReactiveObjects(prop, initialState[key]);
- }
- }
- {
- pinia.state.value[$id][key] = prop;
- }
- }
- {
- _hmrPayload.state.push(key);
- }
- } else if (typeof prop === "function") {
- const actionValue = hot ? prop : wrapAction(key, prop);
- {
- setupStore[key] = actionValue;
- }
- {
- _hmrPayload.actions[key] = prop;
- }
- optionsForPlugin.actions[key] = prop;
- } else {
- if (isComputed(prop)) {
- _hmrPayload.getters[key] = isOptionsStore ? (
- // @ts-expect-error
- options.getters[key]
- ) : prop;
- if (IS_CLIENT) {
- const getters = setupStore._getters || // @ts-expect-error: same
- (setupStore._getters = markRaw([]));
- getters.push(key);
- }
- }
- }
- }
- {
- assign(store, setupStore);
- assign(toRaw(store), setupStore);
- }
- Object.defineProperty(store, "$state", {
- get: () => hot ? hotState.value : pinia.state.value[$id],
- set: (state) => {
- if (hot) {
- throw new Error("cannot set hotState");
- }
- $patch(($state) => {
- assign($state, state);
- });
- }
- });
- {
- store._hotUpdate = markRaw((newStore) => {
- store._hotUpdating = true;
- newStore._hmrPayload.state.forEach((stateKey) => {
- if (stateKey in store.$state) {
- const newStateTarget = newStore.$state[stateKey];
- const oldStateSource = store.$state[stateKey];
- if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
- patchObject(newStateTarget, oldStateSource);
- } else {
- newStore.$state[stateKey] = oldStateSource;
- }
- }
- set(store, stateKey, toRef(newStore.$state, stateKey));
- });
- Object.keys(store.$state).forEach((stateKey) => {
- if (!(stateKey in newStore.$state)) {
- del(store, stateKey);
- }
- });
- isListening = false;
- isSyncListening = false;
- pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState");
- isSyncListening = true;
- nextTick$1().then(() => {
- isListening = true;
- });
- for (const actionName in newStore._hmrPayload.actions) {
- const action = newStore[actionName];
- set(store, actionName, wrapAction(actionName, action));
- }
- for (const getterName in newStore._hmrPayload.getters) {
- const getter = newStore._hmrPayload.getters[getterName];
- const getterValue = isOptionsStore ? (
- // special handling of options api
- computed(() => {
- setActivePinia(pinia);
- return getter.call(store, store);
- })
- ) : getter;
- set(store, getterName, getterValue);
- }
- Object.keys(store._hmrPayload.getters).forEach((key) => {
- if (!(key in newStore._hmrPayload.getters)) {
- del(store, key);
- }
- });
- Object.keys(store._hmrPayload.actions).forEach((key) => {
- if (!(key in newStore._hmrPayload.actions)) {
- del(store, key);
- }
- });
- store._hmrPayload = newStore._hmrPayload;
- store._getters = newStore._getters;
- store._hotUpdating = false;
- });
- }
- if (USE_DEVTOOLS) {
- const nonEnumerable = {
- writable: true,
- configurable: true,
- // avoid warning on devtools trying to display this property
- enumerable: false
- };
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
- Object.defineProperty(store, p2, assign({ value: store[p2] }, nonEnumerable));
- });
- }
- pinia._p.forEach((extender) => {
- if (USE_DEVTOOLS) {
- const extensions = scope.run(() => extender({
- store,
- app: pinia._a,
- pinia,
- options: optionsForPlugin
- }));
- Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
- assign(store, extensions);
- } else {
- assign(store, scope.run(() => extender({
- store,
- app: pinia._a,
- pinia,
- options: optionsForPlugin
- })));
- }
- });
- if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
- console.warn(`[🍍]: The "state" must be a plain object. It cannot be
- state: () => new MyClass()
- Found in store "${store.$id}".`);
- }
- if (initialState && isOptionsStore && options.hydrate) {
- options.hydrate(store.$state, initialState);
- }
- isListening = true;
- isSyncListening = true;
- return store;
- }
- function defineStore(idOrOptions, setup, setupOptions) {
- let id;
- let options;
- const isSetupStore = typeof setup === "function";
- if (typeof idOrOptions === "string") {
- id = idOrOptions;
- options = isSetupStore ? setupOptions : setup;
- } else {
- options = idOrOptions;
- id = idOrOptions.id;
- }
- function useStore(pinia, hot) {
- const currentInstance2 = getCurrentInstance();
- pinia = // in test mode, ignore the argument provided as we can always retrieve a
- // pinia instance with getActivePinia()
- pinia || currentInstance2 && inject(piniaSymbol, null);
- if (pinia)
- setActivePinia(pinia);
- if (!activePinia) {
- throw new Error(`[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
- const pinia = createPinia()
- app.use(pinia)
- This will fail in production.`);
- }
- pinia = activePinia;
- if (!pinia._s.has(id)) {
- if (isSetupStore) {
- createSetupStore(id, setup, options, pinia);
- } else {
- createOptionsStore(id, options, pinia);
- }
- {
- useStore._pinia = pinia;
- }
- }
- const store = pinia._s.get(id);
- if (hot) {
- const hotId = "__hot:" + id;
- const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
- hot._hotUpdate(newStore);
- delete pinia.state.value[hotId];
- pinia._s.delete(hotId);
- }
- if (IS_CLIENT && currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement
- !hot) {
- const vm = currentInstance2.proxy;
- const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
- cache[id] = store;
- }
- return store;
- }
- useStore.$id = id;
- return useStore;
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- function getDefaultExportFromCjs(x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
- }
- var lodash = { exports: {} };
- /**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- lodash.exports;
- (function(module2, exports2) {
- (function() {
- var undefined$1;
- var VERSION = "4.17.21";
- var LARGE_ARRAY_SIZE = 200;
- 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`";
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var MAX_MEMOIZE_SIZE = 500;
- var PLACEHOLDER = "__lodash_placeholder__";
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
- 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;
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
- var HOT_COUNT = 800, HOT_SPAN = 16;
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
- var wrapFlags = [
- ["ary", WRAP_ARY_FLAG],
- ["bind", WRAP_BIND_FLAG],
- ["bindKey", WRAP_BIND_KEY_FLAG],
- ["curry", WRAP_CURRY_FLAG],
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
- ["flip", WRAP_FLIP_FLAG],
- ["partial", WRAP_PARTIAL_FLAG],
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
- ["rearg", WRAP_REARG_FLAG]
- ];
- 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]";
- 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]";
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
- var reTrimStart = /^\s+/;
- var reWhitespace = /\s/;
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
- var reEscapeChar = /\\(\\)?/g;
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
- var reFlags = /\w*$/;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsOctal = /^0o[0-7]+$/i;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
- var reNoMatch = /($^)/;
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
- 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;
- 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";
- 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("|") + ")";
- var reApos = RegExp(rsApos, "g");
- var reComboMark = RegExp(rsCombo, "g");
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
- var reUnicodeWord = RegExp([
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
- rsUpper + "+" + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join("|"), "g");
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
- 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 ]/;
- var contextProps = [
- "Array",
- "Buffer",
- "DataView",
- "Date",
- "Error",
- "Float32Array",
- "Float64Array",
- "Function",
- "Int8Array",
- "Int16Array",
- "Int32Array",
- "Map",
- "Math",
- "Object",
- "Promise",
- "RegExp",
- "Set",
- "String",
- "Symbol",
- "TypeError",
- "Uint8Array",
- "Uint8ClampedArray",
- "Uint16Array",
- "Uint32Array",
- "WeakMap",
- "_",
- "clearTimeout",
- "isFinite",
- "parseInt",
- "setTimeout"
- ];
- var templateCounter = -1;
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- 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;
- var cloneableTags = {};
- 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;
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
- var deburredLetters = {
- // Latin-1 Supplement block.
- "À": "A",
- "Á": "A",
- "Â": "A",
- "Ã": "A",
- "Ä": "A",
- "Å": "A",
- "à": "a",
- "á": "a",
- "â": "a",
- "ã": "a",
- "ä": "a",
- "å": "a",
- "Ç": "C",
- "ç": "c",
- "Ð": "D",
- "ð": "d",
- "È": "E",
- "É": "E",
- "Ê": "E",
- "Ë": "E",
- "è": "e",
- "é": "e",
- "ê": "e",
- "ë": "e",
- "Ì": "I",
- "Í": "I",
- "Î": "I",
- "Ï": "I",
- "ì": "i",
- "í": "i",
- "î": "i",
- "ï": "i",
- "Ñ": "N",
- "ñ": "n",
- "Ò": "O",
- "Ó": "O",
- "Ô": "O",
- "Õ": "O",
- "Ö": "O",
- "Ø": "O",
- "ò": "o",
- "ó": "o",
- "ô": "o",
- "õ": "o",
- "ö": "o",
- "ø": "o",
- "Ù": "U",
- "Ú": "U",
- "Û": "U",
- "Ü": "U",
- "ù": "u",
- "ú": "u",
- "û": "u",
- "ü": "u",
- "Ý": "Y",
- "ý": "y",
- "ÿ": "y",
- "Æ": "Ae",
- "æ": "ae",
- "Þ": "Th",
- "þ": "th",
- "ß": "ss",
- // Latin Extended-A block.
- "Ā": "A",
- "Ă": "A",
- "Ą": "A",
- "ā": "a",
- "ă": "a",
- "ą": "a",
- "Ć": "C",
- "Ĉ": "C",
- "Ċ": "C",
- "Č": "C",
- "ć": "c",
- "ĉ": "c",
- "ċ": "c",
- "č": "c",
- "Ď": "D",
- "Đ": "D",
- "ď": "d",
- "đ": "d",
- "Ē": "E",
- "Ĕ": "E",
- "Ė": "E",
- "Ę": "E",
- "Ě": "E",
- "ē": "e",
- "ĕ": "e",
- "ė": "e",
- "ę": "e",
- "ě": "e",
- "Ĝ": "G",
- "Ğ": "G",
- "Ġ": "G",
- "Ģ": "G",
- "ĝ": "g",
- "ğ": "g",
- "ġ": "g",
- "ģ": "g",
- "Ĥ": "H",
- "Ħ": "H",
- "ĥ": "h",
- "ħ": "h",
- "Ĩ": "I",
- "Ī": "I",
- "Ĭ": "I",
- "Į": "I",
- "İ": "I",
- "ĩ": "i",
- "ī": "i",
- "ĭ": "i",
- "į": "i",
- "ı": "i",
- "Ĵ": "J",
- "ĵ": "j",
- "Ķ": "K",
- "ķ": "k",
- "ĸ": "k",
- "Ĺ": "L",
- "Ļ": "L",
- "Ľ": "L",
- "Ŀ": "L",
- "Ł": "L",
- "ĺ": "l",
- "ļ": "l",
- "ľ": "l",
- "ŀ": "l",
- "ł": "l",
- "Ń": "N",
- "Ņ": "N",
- "Ň": "N",
- "Ŋ": "N",
- "ń": "n",
- "ņ": "n",
- "ň": "n",
- "ŋ": "n",
- "Ō": "O",
- "Ŏ": "O",
- "Ő": "O",
- "ō": "o",
- "ŏ": "o",
- "ő": "o",
- "Ŕ": "R",
- "Ŗ": "R",
- "Ř": "R",
- "ŕ": "r",
- "ŗ": "r",
- "ř": "r",
- "Ś": "S",
- "Ŝ": "S",
- "Ş": "S",
- "Š": "S",
- "ś": "s",
- "ŝ": "s",
- "ş": "s",
- "š": "s",
- "Ţ": "T",
- "Ť": "T",
- "Ŧ": "T",
- "ţ": "t",
- "ť": "t",
- "ŧ": "t",
- "Ũ": "U",
- "Ū": "U",
- "Ŭ": "U",
- "Ů": "U",
- "Ű": "U",
- "Ų": "U",
- "ũ": "u",
- "ū": "u",
- "ŭ": "u",
- "ů": "u",
- "ű": "u",
- "ų": "u",
- "Ŵ": "W",
- "ŵ": "w",
- "Ŷ": "Y",
- "ŷ": "y",
- "Ÿ": "Y",
- "Ź": "Z",
- "Ż": "Z",
- "Ž": "Z",
- "ź": "z",
- "ż": "z",
- "ž": "z",
- "IJ": "IJ",
- "ij": "ij",
- "Œ": "Oe",
- "œ": "oe",
- "ʼn": "'n",
- "ſ": "s"
- };
- var htmlEscapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- };
- var htmlUnescapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- """: '"',
- "'": "'"
- };
- var stringEscapes = {
- "\\": "\\",
- "'": "'",
- "\n": "n",
- "\r": "r",
- "\u2028": "u2028",
- "\u2029": "u2029"
- };
- var freeParseFloat = parseFloat, freeParseInt = parseInt;
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = exports2 && !exports2.nodeType && exports2;
- var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && freeGlobal.process;
- var nodeUtil = function() {
- try {
- var types = freeModule && freeModule.require && freeModule.require("util").types;
- if (types) {
- return types;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e2) {
- }
- }();
- 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;
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index2 = -1, length = array == null ? 0 : array.length;
- while (++index2 < length) {
- var value = array[index2];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
- function arrayEach(array, iteratee) {
- var index2 = -1, length = array == null ? 0 : array.length;
- while (++index2 < length) {
- if (iteratee(array[index2], index2, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEvery(array, predicate) {
- var index2 = -1, length = array == null ? 0 : array.length;
- while (++index2 < length) {
- if (!predicate(array[index2], index2, array)) {
- return false;
- }
- }
- return true;
- }
- function arrayFilter(array, predicate) {
- var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
- while (++index2 < length) {
- var value = array[index2];
- if (predicate(value, index2, array)) {
- result2[resIndex++] = value;
- }
- }
- return result2;
- }
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
- function arrayIncludesWith(array, value, comparator2) {
- var index2 = -1, length = array == null ? 0 : array.length;
- while (++index2 < length) {
- if (comparator2(value, array[index2])) {
- return true;
- }
- }
- return false;
- }
- function arrayMap(array, iteratee) {
- var index2 = -1, length = array == null ? 0 : array.length, result2 = Array(length);
- while (++index2 < length) {
- result2[index2] = iteratee(array[index2], index2, array);
- }
- return result2;
- }
- function arrayPush(array, values) {
- var index2 = -1, length = values.length, offset = array.length;
- while (++index2 < length) {
- array[offset + index2] = values[index2];
- }
- return array;
- }
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index2 = -1, length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[++index2];
- }
- while (++index2 < length) {
- accumulator = iteratee(accumulator, array[index2], index2, array);
- }
- return accumulator;
- }
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
- function arraySome(array, predicate) {
- var index2 = -1, length = array == null ? 0 : array.length;
- while (++index2 < length) {
- if (predicate(array[index2], index2, array)) {
- return true;
- }
- }
- return false;
- }
- var asciiSize = baseProperty("length");
- function asciiToArray(string) {
- return string.split("");
- }
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
- function baseFindKey(collection, predicate, eachFunc) {
- var result2;
- eachFunc(collection, function(value, key, collection2) {
- if (predicate(value, key, collection2)) {
- result2 = key;
- return false;
- }
- });
- return result2;
- }
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index2-- : ++index2 < length) {
- if (predicate(array[index2], index2, array)) {
- return index2;
- }
- }
- return -1;
- }
- function baseIndexOf(array, value, fromIndex) {
- return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
- }
- function baseIndexOfWith(array, value, fromIndex, comparator2) {
- var index2 = fromIndex - 1, length = array.length;
- while (++index2 < length) {
- if (comparator2(array[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function baseIsNaN(value) {
- return value !== value;
- }
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? baseSum(array, iteratee) / length : NAN;
- }
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index2, collection2) {
- accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2);
- });
- return accumulator;
- }
- function baseSortBy(array, comparer) {
- var length = array.length;
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
- function baseSum(array, iteratee) {
- var result2, index2 = -1, length = array.length;
- while (++index2 < length) {
- var current = iteratee(array[index2]);
- if (current !== undefined$1) {
- result2 = result2 === undefined$1 ? current : result2 + current;
- }
- }
- return result2;
- }
- function baseTimes(n2, iteratee) {
- var index2 = -1, result2 = Array(n2);
- while (++index2 < n2) {
- result2[index2] = iteratee(index2);
- }
- return result2;
- }
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
- function baseTrim(string) {
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
- }
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- function charsStartIndex(strSymbols, chrSymbols) {
- var index2 = -1, length = strSymbols.length;
- while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
- }
- return index2;
- }
- function charsEndIndex(strSymbols, chrSymbols) {
- var index2 = strSymbols.length;
- while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
- }
- return index2;
- }
- function countHolders(array, placeholder) {
- var length = array.length, result2 = 0;
- while (length--) {
- if (array[length] === placeholder) {
- ++result2;
- }
- }
- return result2;
- }
- var deburrLetter = basePropertyOf(deburredLetters);
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
- function escapeStringChar(chr) {
- return "\\" + stringEscapes[chr];
- }
- function getValue(object, key) {
- return object == null ? undefined$1 : object[key];
- }
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
- function iteratorToArray(iterator) {
- var data, result2 = [];
- while (!(data = iterator.next()).done) {
- result2.push(data.value);
- }
- return result2;
- }
- function mapToArray(map) {
- var index2 = -1, result2 = Array(map.size);
- map.forEach(function(value, key) {
- result2[++index2] = [key, value];
- });
- return result2;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function replaceHolders(array, placeholder) {
- var index2 = -1, length = array.length, resIndex = 0, result2 = [];
- while (++index2 < length) {
- var value = array[index2];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index2] = PLACEHOLDER;
- result2[resIndex++] = index2;
- }
- }
- return result2;
- }
- function setToArray(set2) {
- var index2 = -1, result2 = Array(set2.size);
- set2.forEach(function(value) {
- result2[++index2] = value;
- });
- return result2;
- }
- function setToPairs(set2) {
- var index2 = -1, result2 = Array(set2.size);
- set2.forEach(function(value) {
- result2[++index2] = [value, value];
- });
- return result2;
- }
- function strictIndexOf(array, value, fromIndex) {
- var index2 = fromIndex - 1, length = array.length;
- while (++index2 < length) {
- if (array[index2] === value) {
- return index2;
- }
- }
- return -1;
- }
- function strictLastIndexOf(array, value, fromIndex) {
- var index2 = fromIndex + 1;
- while (index2--) {
- if (array[index2] === value) {
- return index2;
- }
- }
- return index2;
- }
- function stringSize(string) {
- return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
- }
- function stringToArray(string) {
- return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
- }
- function trimmedEndIndex(string) {
- var index2 = string.length;
- while (index2-- && reWhitespace.test(string.charAt(index2))) {
- }
- return index2;
- }
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
- function unicodeSize(string) {
- var result2 = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result2;
- }
- return result2;
- }
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
- var runInContext = function runInContext2(context) {
- context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps));
- 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;
- var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
- var coreJsData = context["__core-js_shared__"];
- var funcToString = funcProto.toString;
- var hasOwnProperty2 = objectProto.hasOwnProperty;
- var idCounter = 0;
- var maskSrcKey = function() {
- var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid2 ? "Symbol(src)_1." + uid2 : "";
- }();
- var nativeObjectToString = objectProto.toString;
- var objectCtorString = funcToString.call(Object2);
- var oldDash = root._;
- var reIsNative = RegExp2(
- "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- 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;
- var defineProperty = function() {
- try {
- var func = getNative(Object2, "defineProperty");
- func({}, "", {});
- return func;
- } catch (e2) {
- }
- }();
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
- 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;
- 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");
- var metaMap = WeakMap2 && new WeakMap2();
- var realNames = {};
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
- function lodash2(value) {
- if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty2.call(value, "__wrapped__")) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
- var baseCreate = function() {
- function object() {
- }
- return function(proto) {
- if (!isObject2(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result3 = new object();
- object.prototype = undefined$1;
- return result3;
- };
- }();
- function baseLodash() {
- }
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined$1;
- }
- lodash2.templateSettings = {
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "escape": reEscape,
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "evaluate": reEvaluate,
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "interpolate": reInterpolate,
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- "variable": "",
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- "imports": {
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- "_": lodash2
- }
- };
- lodash2.prototype = baseLodash.prototype;
- lodash2.prototype.constructor = lodash2;
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- function lazyClone() {
- var result3 = new LazyWrapper(this.__wrapped__);
- result3.__actions__ = copyArray(this.__actions__);
- result3.__dir__ = this.__dir__;
- result3.__filtered__ = this.__filtered__;
- result3.__iteratees__ = copyArray(this.__iteratees__);
- result3.__takeCount__ = this.__takeCount__;
- result3.__views__ = copyArray(this.__views__);
- return result3;
- }
- function lazyReverse() {
- if (this.__filtered__) {
- var result3 = new LazyWrapper(this);
- result3.__dir__ = -1;
- result3.__filtered__ = true;
- } else {
- result3 = this.clone();
- result3.__dir__ *= -1;
- }
- return result3;
- }
- function lazyValue() {
- 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__);
- if (!isArr || !isRight && arrLength == length && takeCount == length) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result3 = [];
- outer:
- while (length-- && resIndex < takeCount) {
- index2 += dir;
- var iterIndex = -1, value = array[index2];
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed2 = iteratee2(value);
- if (type == LAZY_MAP_FLAG) {
- value = computed2;
- } else if (!computed2) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result3[resIndex++] = value;
- }
- return result3;
- }
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- function Hash(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- function hashDelete(key) {
- var result3 = this.has(key) && delete this.__data__[key];
- this.size -= result3 ? 1 : 0;
- return result3;
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result3 = data[key];
- return result3 === HASH_UNDEFINED ? undefined$1 : result3;
- }
- return hasOwnProperty2.call(data, key) ? data[key] : undefined$1;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty2.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- function listCacheDelete(key) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- if (index2 < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index2 == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index2, 1);
- }
- --this.size;
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- return index2 < 0 ? undefined$1 : data[index2][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- if (index2 < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index2][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map2 || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- var result3 = getMapData(this, key)["delete"](key);
- this.size -= result3 ? 1 : 0;
- return result3;
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- var data = getMapData(this, key), size3 = data.size;
- data.set(key, value);
- this.size += data.size == size3 ? 0 : 1;
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function SetCache(values2) {
- var index2 = -1, length = values2 == null ? 0 : values2.length;
- this.__data__ = new MapCache();
- while (++index2 < length) {
- this.add(values2[index2]);
- }
- }
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- function stackClear() {
- this.__data__ = new ListCache();
- this.size = 0;
- }
- function stackDelete(key) {
- var data = this.__data__, result3 = data["delete"](key);
- this.size = data.size;
- return result3;
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- 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;
- for (var key in value) {
- if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
- isIndex(key, length)))) {
- result3.push(key);
- }
- }
- return result3;
- }
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined$1;
- }
- function arraySampleSize(array, n2) {
- return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length));
- }
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
- function assignMergeValue(object, key, value) {
- if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty2.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseAggregator(collection, setter, iteratee2, accumulator) {
- baseEach(collection, function(value, key, collection2) {
- setter(accumulator, value, iteratee2(value), collection2);
- });
- return accumulator;
- }
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
- function baseAssignValue(object, key, value) {
- if (key == "__proto__" && defineProperty) {
- defineProperty(object, key, {
- "configurable": true,
- "enumerable": true,
- "value": value,
- "writable": true
- });
- } else {
- object[key] = value;
- }
- }
- function baseAt(object, paths) {
- var index2 = -1, length = paths.length, result3 = Array2(length), skip = object == null;
- while (++index2 < length) {
- result3[index2] = skip ? undefined$1 : get2(object, paths[index2]);
- }
- return result3;
- }
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined$1) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined$1) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
- function baseClone(value, bitmask, customizer, key, object, stack2) {
- var result3, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result3 = object ? customizer(value, key, object, stack2) : customizer(value);
- }
- if (result3 !== undefined$1) {
- return result3;
- }
- if (!isObject2(value)) {
- return value;
- }
- var isArr = isArray2(value);
- if (isArr) {
- result3 = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result3);
- }
- } else {
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
- result3 = isFlat || isFunc ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat ? copySymbolsIn(value, baseAssignIn(result3, value)) : copySymbols(value, baseAssign(result3, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result3 = initCloneByTag(value, tag, isDeep);
- }
- }
- stack2 || (stack2 = new Stack());
- var stacked = stack2.get(value);
- if (stacked) {
- return stacked;
- }
- stack2.set(value, result3);
- if (isSet2(value)) {
- value.forEach(function(subValue) {
- result3.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2));
- });
- } else if (isMap2(value)) {
- value.forEach(function(subValue, key2) {
- result3.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
- });
- }
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
- var props = isArr ? undefined$1 : keysFunc(value);
- arrayEach(props || value, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value[key2];
- }
- assignValue(result3, key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
- });
- return result3;
- }
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (length--) {
- var key = props[length], predicate = source[key], value = object[key];
- if (value === undefined$1 && !(key in object) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
- function baseDelay(func, wait, args) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return setTimeout2(function() {
- func.apply(undefined$1, args);
- }, wait);
- }
- function baseDifference(array, values2, iteratee2, comparator2) {
- var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result3 = [], valuesLength = values2.length;
- if (!length) {
- return result3;
- }
- if (iteratee2) {
- values2 = arrayMap(values2, baseUnary(iteratee2));
- }
- if (comparator2) {
- includes2 = arrayIncludesWith;
- isCommon = false;
- } else if (values2.length >= LARGE_ARRAY_SIZE) {
- includes2 = cacheHas;
- isCommon = false;
- values2 = new SetCache(values2);
- }
- outer:
- while (++index2 < length) {
- var value = array[index2], computed2 = iteratee2 == null ? value : iteratee2(value);
- value = comparator2 || value !== 0 ? value : 0;
- if (isCommon && computed2 === computed2) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values2[valuesIndex] === computed2) {
- continue outer;
- }
- }
- result3.push(value);
- } else if (!includes2(values2, computed2, comparator2)) {
- result3.push(value);
- }
- }
- return result3;
- }
- var baseEach = createBaseEach(baseForOwn);
- var baseEachRight = createBaseEach(baseForOwnRight, true);
- function baseEvery(collection, predicate) {
- var result3 = true;
- baseEach(collection, function(value, index2, collection2) {
- result3 = !!predicate(value, index2, collection2);
- return result3;
- });
- return result3;
- }
- function baseExtremum(array, iteratee2, comparator2) {
- var index2 = -1, length = array.length;
- while (++index2 < length) {
- var value = array[index2], current = iteratee2(value);
- if (current != null && (computed2 === undefined$1 ? current === current && !isSymbol2(current) : comparator2(current, computed2))) {
- var computed2 = current, result3 = value;
- }
- }
- return result3;
- }
- function baseFill(array, value, start, end) {
- var length = array.length;
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end === undefined$1 || end > length ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
- function baseFilter(collection, predicate) {
- var result3 = [];
- baseEach(collection, function(value, index2, collection2) {
- if (predicate(value, index2, collection2)) {
- result3.push(value);
- }
- });
- return result3;
- }
- function baseFlatten(array, depth, predicate, isStrict, result3) {
- var index2 = -1, length = array.length;
- predicate || (predicate = isFlattenable);
- result3 || (result3 = []);
- while (++index2 < length) {
- var value = array[index2];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result3);
- } else {
- arrayPush(result3, value);
- }
- } else if (!isStrict) {
- result3[result3.length] = value;
- }
- }
- return result3;
- }
- var baseFor = createBaseFor();
- var baseForRight = createBaseFor(true);
- function baseForOwn(object, iteratee2) {
- return object && baseFor(object, iteratee2, keys);
- }
- function baseForOwnRight(object, iteratee2) {
- return object && baseForRight(object, iteratee2, keys);
- }
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction2(object[key]);
- });
- }
- function baseGet(object, path) {
- path = castPath(path, object);
- var index2 = 0, length = path.length;
- while (object != null && index2 < length) {
- object = object[toKey(path[index2++])];
- }
- return index2 && index2 == length ? object : undefined$1;
- }
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result3 = keysFunc(object);
- return isArray2(object) ? result3 : arrayPush(result3, symbolsFunc(object));
- }
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined$1 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString2(value);
- }
- function baseGt(value, other) {
- return value > other;
- }
- function baseHas(object, key) {
- return object != null && hasOwnProperty2.call(object, key);
- }
- function baseHasIn(object, key) {
- return object != null && key in Object2(object);
- }
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
- function baseIntersection(arrays, iteratee2, comparator2) {
- var includes2 = comparator2 ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result3 = [];
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee2) {
- array = arrayMap(array, baseUnary(iteratee2));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator2 && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
- }
- array = arrays[0];
- var index2 = -1, seen = caches[0];
- outer:
- while (++index2 < length && result3.length < maxLength) {
- var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
- value = comparator2 || value !== 0 ? value : 0;
- if (!(seen ? cacheHas(seen, computed2) : includes2(result3, computed2, comparator2))) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache ? cacheHas(cache, computed2) : includes2(arrays[othIndex], computed2, comparator2))) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed2);
- }
- result3.push(value);
- }
- }
- return result3;
- }
- function baseInverter(object, setter, iteratee2, accumulator) {
- baseForOwn(object, function(value, key, object2) {
- setter(accumulator, iteratee2(value), key, object2);
- });
- return accumulator;
- }
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined$1 : apply(func, object, args);
- }
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
- function baseIsEqual(value, other, bitmask, customizer, stack2) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2);
- }
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
- var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack2 || (stack2 = new Stack());
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
- stack2 || (stack2 = new Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack2 || (stack2 = new Stack());
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack2);
- }
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
- function baseIsMatch(object, source, matchData, customizer) {
- var index2 = matchData.length, length = index2, noCustomizer = !customizer;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (index2--) {
- var data = matchData[index2];
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
- return false;
- }
- }
- while (++index2 < length) {
- data = matchData[index2];
- var key = data[0], objValue = object[key], srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined$1 && !(key in object)) {
- return false;
- }
- } else {
- var stack2 = new Stack();
- if (customizer) {
- var result3 = customizer(objValue, srcValue, key, object, source, stack2);
- }
- if (!(result3 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack2) : result3)) {
- return false;
- }
- }
- }
- return true;
- }
- function baseIsNative(value) {
- if (!isObject2(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
- function baseIsTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- function baseIteratee(value) {
- if (typeof value == "function") {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == "object") {
- return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
- }
- return property(value);
- }
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result3 = [];
- for (var key in Object2(object)) {
- if (hasOwnProperty2.call(object, key) && key != "constructor") {
- result3.push(key);
- }
- }
- return result3;
- }
- function baseKeysIn(object) {
- if (!isObject2(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object), result3 = [];
- for (var key in object) {
- if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) {
- result3.push(key);
- }
- }
- return result3;
- }
- function baseLt(value, other) {
- return value < other;
- }
- function baseMap(collection, iteratee2) {
- var index2 = -1, result3 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value, key, collection2) {
- result3[++index2] = iteratee2(value, key, collection2);
- });
- return result3;
- }
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get2(object, path);
- return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
- function baseMerge(object, source, srcIndex, customizer, stack2) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- stack2 || (stack2 = new Stack());
- if (isObject2(srcValue)) {
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
- } else {
- var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : undefined$1;
- if (newValue === undefined$1) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) {
- var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue);
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : undefined$1;
- var isCommon = newValue === undefined$1;
- if (isCommon) {
- var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray2(objValue)) {
- newValue = objValue;
- } else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- } else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- } else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- } else {
- newValue = [];
- }
- } else if (isPlainObject2(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- } else if (!isObject2(objValue) || isFunction2(objValue)) {
- newValue = initCloneObject(srcValue);
- }
- } else {
- isCommon = false;
- }
- }
- if (isCommon) {
- stack2.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
- stack2["delete"](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
- function baseNth(array, n2) {
- var length = array.length;
- if (!length) {
- return;
- }
- n2 += n2 < 0 ? length : 0;
- return isIndex(n2, length) ? array[n2] : undefined$1;
- }
- function baseOrderBy(collection, iteratees, orders) {
- if (iteratees.length) {
- iteratees = arrayMap(iteratees, function(iteratee2) {
- if (isArray2(iteratee2)) {
- return function(value) {
- return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
- };
- }
- return iteratee2;
- });
- } else {
- iteratees = [identity];
- }
- var index2 = -1;
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- var result3 = baseMap(collection, function(value, key, collection2) {
- var criteria = arrayMap(iteratees, function(iteratee2) {
- return iteratee2(value);
- });
- return { "criteria": criteria, "index": ++index2, "value": value };
- });
- return baseSortBy(result3, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
- function basePickBy(object, paths, predicate) {
- var index2 = -1, length = paths.length, result3 = {};
- while (++index2 < length) {
- var path = paths[index2], value = baseGet(object, path);
- if (predicate(value, path)) {
- baseSet(result3, castPath(path, object), value);
- }
- }
- return result3;
- }
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
- function basePullAll(array, values2, iteratee2, comparator2) {
- var indexOf2 = comparator2 ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array;
- if (array === values2) {
- values2 = copyArray(values2);
- }
- if (iteratee2) {
- seen = arrayMap(array, baseUnary(iteratee2));
- }
- while (++index2 < length) {
- var fromIndex = 0, value = values2[index2], computed2 = iteratee2 ? iteratee2(value) : value;
- while ((fromIndex = indexOf2(seen, computed2, fromIndex, comparator2)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0, lastIndex = length - 1;
- while (length--) {
- var index2 = indexes[length];
- if (length == lastIndex || index2 !== previous) {
- var previous = index2;
- if (isIndex(index2)) {
- splice.call(array, index2, 1);
- } else {
- baseUnset(array, index2);
- }
- }
- }
- return array;
- }
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
- function baseRange(start, end, step, fromRight) {
- var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result3 = Array2(length);
- while (length--) {
- result3[fromRight ? length : ++index2] = start;
- start += step;
- }
- return result3;
- }
- function baseRepeat(string, n2) {
- var result3 = "";
- if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) {
- return result3;
- }
- do {
- if (n2 % 2) {
- result3 += string;
- }
- n2 = nativeFloor(n2 / 2);
- if (n2) {
- string += string;
- }
- } while (n2);
- return result3;
- }
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + "");
- }
- function baseSample(collection) {
- return arraySample(values(collection));
- }
- function baseSampleSize(collection, n2) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n2, 0, array.length));
- }
- function baseSet(object, path, value, customizer) {
- if (!isObject2(object)) {
- return object;
- }
- path = castPath(path, object);
- var index2 = -1, length = path.length, lastIndex = length - 1, nested = object;
- while (nested != null && ++index2 < length) {
- var key = toKey(path[index2]), newValue = value;
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
- return object;
- }
- if (index2 != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
- if (newValue === undefined$1) {
- newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, "toString", {
- "configurable": true,
- "enumerable": false,
- "value": constant(string),
- "writable": true
- });
- };
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
- function baseSlice(array, start, end) {
- var index2 = -1, length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result3 = Array2(length);
- while (++index2 < length) {
- result3[index2] = array[index2 + start];
- }
- return result3;
- }
- function baseSome(collection, predicate) {
- var result3;
- baseEach(collection, function(value, index2, collection2) {
- result3 = predicate(value, index2, collection2);
- return !result3;
- });
- return !!result3;
- }
- function baseSortedIndex(array, value, retHighest) {
- var low = 0, high = array == null ? low : array.length;
- if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = low + high >>> 1, computed2 = array[mid];
- if (computed2 !== null && !isSymbol2(computed2) && (retHighest ? computed2 <= value : computed2 < value)) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
- function baseSortedIndexBy(array, value, iteratee2, retHighest) {
- var low = 0, high = array == null ? 0 : array.length;
- if (high === 0) {
- return 0;
- }
- value = iteratee2(value);
- var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol2(value), valIsUndefined = value === undefined$1;
- while (low < high) {
- var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol = isSymbol2(computed2);
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? computed2 <= value : computed2 < value;
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
- function baseSortedUniq(array, iteratee2) {
- var index2 = -1, length = array.length, resIndex = 0, result3 = [];
- while (++index2 < length) {
- var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
- if (!index2 || !eq(computed2, seen)) {
- var seen = computed2;
- result3[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result3;
- }
- function baseToNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol2(value)) {
- return NAN;
- }
- return +value;
- }
- function baseToString(value) {
- if (typeof value == "string") {
- return value;
- }
- if (isArray2(value)) {
- return arrayMap(value, baseToString) + "";
- }
- if (isSymbol2(value)) {
- return symbolToString ? symbolToString.call(value) : "";
- }
- var result3 = value + "";
- return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
- }
- function baseUniq(array, iteratee2, comparator2) {
- var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result3 = [], seen = result3;
- if (comparator2) {
- isCommon = false;
- includes2 = arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE) {
- var set3 = iteratee2 ? null : createSet(array);
- if (set3) {
- return setToArray(set3);
- }
- isCommon = false;
- includes2 = cacheHas;
- seen = new SetCache();
- } else {
- seen = iteratee2 ? [] : result3;
- }
- outer:
- while (++index2 < length) {
- var value = array[index2], computed2 = iteratee2 ? iteratee2(value) : value;
- value = comparator2 || value !== 0 ? value : 0;
- if (isCommon && computed2 === computed2) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed2) {
- continue outer;
- }
- }
- if (iteratee2) {
- seen.push(computed2);
- }
- result3.push(value);
- } else if (!includes2(seen, computed2, comparator2)) {
- if (seen !== result3) {
- seen.push(computed2);
- }
- result3.push(value);
- }
- }
- return result3;
- }
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length, index2 = fromRight ? length : -1;
- while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) {
- }
- return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
- }
- function baseWrapperValue(value, actions) {
- var result3 = value;
- if (result3 instanceof LazyWrapper) {
- result3 = result3.value();
- }
- return arrayReduce(actions, function(result4, action) {
- return action.func.apply(action.thisArg, arrayPush([result4], action.args));
- }, result3);
- }
- function baseXor(arrays, iteratee2, comparator2) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index2 = -1, result3 = Array2(length);
- while (++index2 < length) {
- var array = arrays[index2], othIndex = -1;
- while (++othIndex < length) {
- if (othIndex != index2) {
- result3[index2] = baseDifference(result3[index2] || array, arrays[othIndex], iteratee2, comparator2);
- }
- }
- }
- return baseUniq(baseFlatten(result3, 1), iteratee2, comparator2);
- }
- function baseZipObject(props, values2, assignFunc) {
- var index2 = -1, length = props.length, valsLength = values2.length, result3 = {};
- while (++index2 < length) {
- var value = index2 < valsLength ? values2[index2] : undefined$1;
- assignFunc(result3, props[index2], value);
- }
- return result3;
- }
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
- function castFunction(value) {
- return typeof value == "function" ? value : identity;
- }
- function castPath(value, object) {
- if (isArray2(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString2(value));
- }
- var castRest = baseRest;
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined$1 ? length : end;
- return !start && end >= length ? array : baseSlice(array, start, end);
- }
- var clearTimeout2 = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
- function cloneBuffer(buffer2, isDeep) {
- if (isDeep) {
- return buffer2.slice();
- }
- var length = buffer2.length, result3 = allocUnsafe ? allocUnsafe(length) : new buffer2.constructor(length);
- buffer2.copy(result3);
- return result3;
- }
- function cloneArrayBuffer(arrayBuffer) {
- var result3 = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array2(result3).set(new Uint8Array2(arrayBuffer));
- return result3;
- }
- function cloneDataView(dataView, isDeep) {
- var buffer2 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength);
- }
- function cloneRegExp(regexp) {
- var result3 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result3.lastIndex = regexp.lastIndex;
- return result3;
- }
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
- }
- function cloneTypedArray(typedArray, isDeep) {
- var buffer2 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length);
- }
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol2(value);
- var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
- return 1;
- }
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- function compareMultiple(object, other, orders) {
- var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
- while (++index2 < length) {
- var result3 = compareAscending(objCriteria[index2], othCriteria[index2]);
- if (result3) {
- if (index2 >= ordersLength) {
- return result3;
- }
- var order = orders[index2];
- return result3 * (order == "desc" ? -1 : 1);
- }
- }
- return object.index - other.index;
- }
- function composeArgs(args, partials, holders, isCurried) {
- 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;
- while (++leftIndex < leftLength) {
- result3[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result3[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result3[leftIndex++] = args[argsIndex++];
- }
- return result3;
- }
- function composeArgsRight(args, partials, holders, isCurried) {
- 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;
- while (++argsIndex < rangeLength) {
- result3[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result3[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result3[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result3;
- }
- function copyArray(source, array) {
- var index2 = -1, length = source.length;
- array || (array = Array2(length));
- while (++index2 < length) {
- array[index2] = source[index2];
- }
- return array;
- }
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index2 = -1, length = props.length;
- while (++index2 < length) {
- var key = props[index2];
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
- if (newValue === undefined$1) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
- function createAggregator(setter, initializer) {
- return function(collection, iteratee2) {
- var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
- return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
- };
- }
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined$1 : customizer;
- length = 1;
- }
- object = Object2(object);
- while (++index2 < length) {
- var source = sources[index2];
- if (source) {
- assigner(object, source, index2, customizer);
- }
- }
- return object;
- });
- }
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee2) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee2);
- }
- var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection);
- while (fromRight ? index2-- : ++index2 < length) {
- if (iteratee2(iterable[index2], index2, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- function createBaseFor(fromRight) {
- return function(object, iteratee2, keysFunc) {
- var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index2];
- if (iteratee2(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString2(string);
- var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
- var chr = strSymbols ? strSymbols[0] : string.charAt(0);
- var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
- return chr[methodName]() + trailing;
- };
- }
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
- };
- }
- function createCtor(Ctor) {
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return new Ctor();
- case 1:
- return new Ctor(args[0]);
- case 2:
- return new Ctor(args[0], args[1]);
- case 3:
- return new Ctor(args[0], args[1], args[2]);
- case 4:
- return new Ctor(args[0], args[1], args[2], args[3]);
- case 5:
- return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype), result3 = Ctor.apply(thisBinding, args);
- return isObject2(result3) ? result3 : thisBinding;
- };
- }
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper);
- while (index2--) {
- args[index2] = arguments[index2];
- }
- var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- undefined$1,
- args,
- holders,
- undefined$1,
- undefined$1,
- arity - length
- );
- }
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object2(collection);
- if (!isArrayLike(collection)) {
- var iteratee2 = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) {
- return iteratee2(iterable[key], key, iterable);
- };
- }
- var index2 = findIndexFunc(collection, predicate, fromIndex);
- return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined$1;
- };
- }
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while (index2--) {
- var func = funcs[index2];
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == "wrapper") {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index2 = wrapper ? index2 : length;
- while (++index2 < length) {
- func = funcs[index2];
- var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
- 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) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments, value = args[0];
- if (wrapper && args.length == 1 && isArray2(value)) {
- return wrapper.plant(value).value();
- }
- var index3 = 0, result3 = length ? funcs[index3].apply(this, args) : value;
- while (++index3 < length) {
- result3 = funcs[index3].call(this, result3);
- }
- return result3;
- };
- });
- }
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
- 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);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index2 = length;
- while (index2--) {
- args[index2] = arguments[index2];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- thisArg,
- args,
- newHolders,
- argPos,
- ary2,
- arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary2 < length) {
- args.length = ary2;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
- function createInverter(setter, toIteratee) {
- return function(object, iteratee2) {
- return baseInverter(object, setter, toIteratee(iteratee2), {});
- };
- }
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result3;
- if (value === undefined$1 && other === undefined$1) {
- return defaultValue;
- }
- if (value !== undefined$1) {
- result3 = value;
- }
- if (other !== undefined$1) {
- if (result3 === undefined$1) {
- return other;
- }
- if (typeof value == "string" || typeof other == "string") {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result3 = operator(value, other);
- }
- return result3;
- };
- }
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee2) {
- return apply(iteratee2, thisArg, args);
- });
- });
- });
- }
- function createPadding(length, chars) {
- chars = chars === undefined$1 ? " " : baseToString(chars);
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result3 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars) ? castSlice(stringToArray(result3), 0, length).join("") : result3.slice(0, length);
- }
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
- end = step = undefined$1;
- }
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == "string" && typeof other == "string")) {
- value = toNumber2(value);
- other = toNumber2(other);
- }
- return operator(value, other);
- };
- }
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
- 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;
- bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func,
- bitmask,
- thisArg,
- newPartials,
- newHolders,
- newPartialsRight,
- newHoldersRight,
- argPos,
- ary2,
- arity
- ];
- var result3 = wrapFunc.apply(undefined$1, newData);
- if (isLaziable(func)) {
- setData(result3, newData);
- }
- result3.placeholder = placeholder;
- return setWrapToString(result3, func, bitmask);
- }
- function createRound(methodName) {
- var func = Math2[methodName];
- return function(number, precision) {
- number = toNumber2(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision && nativeIsFinite(number)) {
- var pair = (toString2(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
- pair = (toString2(value) + "e").split("e");
- return +(pair[0] + "e" + (+pair[1] - precision));
- }
- return func(number);
- };
- }
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) {
- return new Set2(values2);
- };
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined$1;
- }
- ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
- arity = arity === undefined$1 ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials, holdersRight = holders;
- partials = holders = undefined$1;
- }
- var data = isBindKey ? undefined$1 : getData(func);
- var newData = [
- func,
- bitmask,
- thisArg,
- partials,
- holders,
- partialsRight,
- holdersRight,
- argPos,
- ary2,
- arity
- ];
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result3 = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result3 = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result3 = createPartial(func, bitmask, thisArg, partials);
- } else {
- result3 = createHybrid.apply(undefined$1, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result3, newData), func, bitmask);
- }
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
- return srcValue;
- }
- return objValue;
- }
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack2) {
- if (isObject2(objValue) && isObject2(srcValue)) {
- stack2.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack2);
- stack2["delete"](srcValue);
- }
- return objValue;
- }
- function customOmitClone(value) {
- return isPlainObject2(value) ? undefined$1 : value;
- }
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var arrStacked = stack2.get(array);
- var othStacked = stack2.get(other);
- if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array;
- }
- var index2 = -1, result3 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
- stack2.set(array, other);
- stack2.set(other, array);
- while (++index2 < arrLength) {
- var arrValue = array[index2], othValue = other[index2];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack2) : customizer(arrValue, othValue, index2, array, other, stack2);
- }
- if (compared !== undefined$1) {
- if (compared) {
- continue;
- }
- result3 = false;
- break;
- }
- if (seen) {
- if (!arraySome(other, function(othValue2, othIndex) {
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
- return seen.push(othIndex);
- }
- })) {
- result3 = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
- result3 = false;
- break;
- }
- }
- stack2["delete"](array);
- stack2["delete"](other);
- return result3;
- }
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) {
- switch (tag) {
- case dataViewTag:
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+object, +other);
- case errorTag:
- return object.name == other.name && object.message == other.message;
- case regexpTag:
- case stringTag:
- return object == other + "";
- case mapTag:
- var convert = mapToArray;
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack2.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- stack2.set(object, other);
- var result3 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
- stack2["delete"](object);
- return result3;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index2 = objLength;
- while (index2--) {
- var key = objProps[index2];
- if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
- return false;
- }
- }
- var objStacked = stack2.get(object);
- var othStacked = stack2.get(other);
- if (objStacked && othStacked) {
- return objStacked == other && othStacked == object;
- }
- var result3 = true;
- stack2.set(object, other);
- stack2.set(other, object);
- var skipCtor = isPartial;
- while (++index2 < objLength) {
- key = objProps[index2];
- var objValue = object[key], othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2);
- }
- if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
- result3 = false;
- break;
- }
- skipCtor || (skipCtor = key == "constructor");
- }
- if (result3 && !skipCtor) {
- var objCtor = object.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
- result3 = false;
- }
- }
- stack2["delete"](object);
- stack2["delete"](other);
- return result3;
- }
- function flatRest(func) {
- return setToString(overRest(func, undefined$1, flatten), func + "");
- }
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
- var getData = !metaMap ? noop2 : function(func) {
- return metaMap.get(func);
- };
- function getFuncName(func) {
- var result3 = func.name + "", array = realNames[result3], length = hasOwnProperty2.call(realNames, result3) ? array.length : 0;
- while (length--) {
- var data = array[length], otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result3;
- }
- function getHolder(func) {
- var object = hasOwnProperty2.call(lodash2, "placeholder") ? lodash2 : func;
- return object.placeholder;
- }
- function getIteratee() {
- var result3 = lodash2.iteratee || iteratee;
- result3 = result3 === iteratee ? baseIteratee : result3;
- return arguments.length ? result3(arguments[0], arguments[1]) : result3;
- }
- function getMapData(map2, key) {
- var data = map2.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getMatchData(object) {
- var result3 = keys(object), length = result3.length;
- while (length--) {
- var key = result3[length], value = object[key];
- result3[length] = [key, value, isStrictComparable(value)];
- }
- return result3;
- }
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined$1;
- }
- function getRawTag(value) {
- var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined$1;
- var unmasked = true;
- } catch (e2) {
- }
- var result3 = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result3;
- }
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object2(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result3 = [];
- while (object) {
- arrayPush(result3, getSymbols(object));
- object = getPrototype(object);
- }
- return result3;
- };
- var getTag = baseGetTag;
- 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) {
- getTag = function(value) {
- var result3 = baseGetTag(value), Ctor = result3 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result3;
- };
- }
- function getView(start, end, transforms) {
- var index2 = -1, length = transforms.length;
- while (++index2 < length) {
- var data = transforms[index2], size3 = data.size;
- switch (data.type) {
- case "drop":
- start += size3;
- break;
- case "dropRight":
- end -= size3;
- break;
- case "take":
- end = nativeMin(end, start + size3);
- break;
- case "takeRight":
- start = nativeMax(start, end - size3);
- break;
- }
- }
- return { "start": start, "end": end };
- }
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
- var index2 = -1, length = path.length, result3 = false;
- while (++index2 < length) {
- var key = toKey(path[index2]);
- if (!(result3 = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result3 || ++index2 != length) {
- return result3;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
- }
- function initCloneArray(array) {
- var length = array.length, result3 = new array.constructor(length);
- if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) {
- result3.index = array.index;
- result3.input = array.input;
- }
- return result3;
- }
- function initCloneObject(object) {
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
- }
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return cloneDataView(object, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
- return cloneTypedArray(object, isDeep);
- case mapTag:
- return new Ctor();
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return cloneRegExp(object);
- case setTag:
- return new Ctor();
- case symbolTag:
- return cloneSymbol(object);
- }
- }
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
- details = details.join(length > 2 ? ", " : " ");
- return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
- }
- function isFlattenable(value) {
- return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isIterateeCall(value, index2, object) {
- if (!isObject2(object)) {
- return false;
- }
- var type = typeof index2;
- if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
- return eq(object[index2], value);
- }
- return false;
- }
- function isKey(value, object) {
- if (isArray2(value)) {
- return false;
- }
- var type = typeof value;
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isLaziable(func) {
- var funcName = getFuncName(func), other = lodash2[funcName];
- if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var isMaskable = coreJsData ? isFunction2 : stubFalse;
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function isStrictComparable(value) {
- return value === value && !isObject2(value);
- }
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
- };
- }
- function memoizeCapped(func) {
- var result3 = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
- var cache = result3.cache;
- return result3;
- }
- function mergeData(data, source) {
- var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
- 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;
- if (!(isCommon || isCombo)) {
- return data;
- }
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- value = source[7];
- if (value) {
- data[7] = value;
- }
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- if (data[9] == null) {
- data[9] = source[9];
- }
- data[0] = source[0];
- data[1] = newBitmask;
- return data;
- }
- function nativeKeysIn(object) {
- var result3 = [];
- if (object != null) {
- for (var key in Object2(object)) {
- result3.push(key);
- }
- }
- return result3;
- }
- function objectToString2(value) {
- return nativeObjectToString.call(value);
- }
- function overRest(func, start, transform2) {
- start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
- return function() {
- var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
- while (++index2 < length) {
- array[index2] = args[start + index2];
- }
- index2 = -1;
- var otherArgs = Array2(start + 1);
- while (++index2 < start) {
- otherArgs[index2] = args[index2];
- }
- otherArgs[start] = transform2(array);
- return apply(func, this, otherArgs);
- };
- }
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
- function reorder(array, indexes) {
- var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
- while (length--) {
- var index2 = indexes[length];
- array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined$1;
- }
- return array;
- }
- function safeGet(object, key) {
- if (key === "constructor" && typeof object[key] === "function") {
- return;
- }
- if (key == "__proto__") {
- return;
- }
- return object[key];
- }
- var setData = shortOut(baseSetData);
- var setTimeout2 = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
- var setToString = shortOut(baseSetToString);
- function setWrapToString(wrapper, reference, bitmask) {
- var source = reference + "";
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
- function shortOut(func) {
- var count = 0, lastCalled = 0;
- return function() {
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined$1, arguments);
- };
- }
- function shuffleSelf(array, size3) {
- var index2 = -1, length = array.length, lastIndex = length - 1;
- size3 = size3 === undefined$1 ? length : size3;
- while (++index2 < size3) {
- var rand = baseRandom(index2, lastIndex), value = array[rand];
- array[rand] = array[index2];
- array[index2] = value;
- }
- array.length = size3;
- return array;
- }
- var stringToPath = memoizeCapped(function(string) {
- var result3 = [];
- if (string.charCodeAt(0) === 46) {
- result3.push("");
- }
- string.replace(rePropName, function(match, number, quote, subString) {
- result3.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
- });
- return result3;
- });
- function toKey(value) {
- if (typeof value == "string" || isSymbol2(value)) {
- return value;
- }
- var result3 = value + "";
- return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e2) {
- }
- try {
- return func + "";
- } catch (e2) {
- }
- }
- return "";
- }
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = "_." + pair[0];
- if (bitmask & pair[1] && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result3 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result3.__actions__ = copyArray(wrapper.__actions__);
- result3.__index__ = wrapper.__index__;
- result3.__values__ = wrapper.__values__;
- return result3;
- }
- function chunk(array, size3, guard) {
- if (guard ? isIterateeCall(array, size3, guard) : size3 === undefined$1) {
- size3 = 1;
- } else {
- size3 = nativeMax(toInteger(size3), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size3 < 1) {
- return [];
- }
- var index2 = 0, resIndex = 0, result3 = Array2(nativeCeil(length / size3));
- while (index2 < length) {
- result3[resIndex++] = baseSlice(array, index2, index2 += size3);
- }
- return result3;
- }
- function compact(array) {
- var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result3 = [];
- while (++index2 < length) {
- var value = array[index2];
- if (value) {
- result3[resIndex++] = value;
- }
- }
- return result3;
- }
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array2(length - 1), array = arguments[0], index2 = length;
- while (index2--) {
- args[index2 - 1] = arguments[index2];
- }
- return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
- var difference = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
- });
- var differenceBy = baseRest(function(array, values2) {
- var iteratee2 = last(values2);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
- });
- var differenceWith = baseRest(function(array, values2) {
- var comparator2 = last(values2);
- if (isArrayLikeObject(comparator2)) {
- comparator2 = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator2) : [];
- });
- function drop(array, n2, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- return baseSlice(array, n2 < 0 ? 0 : n2, length);
- }
- function dropRight(array, n2, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- n2 = length - n2;
- return baseSlice(array, 0, n2 < 0 ? 0 : n2);
- }
- function dropRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
- }
- function dropWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
- }
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index2 < 0) {
- index2 = nativeMax(length + index2, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index2);
- }
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index2 = length - 1;
- if (fromIndex !== undefined$1) {
- index2 = toInteger(fromIndex);
- index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index2, true);
- }
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
- function fromPairs(pairs) {
- var index2 = -1, length = pairs == null ? 0 : pairs.length, result3 = {};
- while (++index2 < length) {
- var pair = pairs[index2];
- result3[pair[0]] = pair[1];
- }
- return result3;
- }
- function head(array) {
- return array && array.length ? array[0] : undefined$1;
- }
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index2 < 0) {
- index2 = nativeMax(length + index2, 0);
- }
- return baseIndexOf(array, value, index2);
- }
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
- });
- var intersectionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- if (iteratee2 === last(mapped)) {
- iteratee2 = undefined$1;
- } else {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
- });
- var intersectionWith = baseRest(function(arrays) {
- var comparator2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
- if (comparator2) {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator2) : [];
- });
- function join(array, separator) {
- return array == null ? "" : nativeJoin.call(array, separator);
- }
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined$1;
- }
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index2 = length;
- if (fromIndex !== undefined$1) {
- index2 = toInteger(fromIndex);
- index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
- }
- return value === value ? strictLastIndexOf(array, value, index2) : baseFindIndex(array, baseIsNaN, index2, true);
- }
- function nth(array, n2) {
- return array && array.length ? baseNth(array, toInteger(n2)) : undefined$1;
- }
- var pull = baseRest(pullAll);
- function pullAll(array, values2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
- }
- function pullAllBy(array, values2, iteratee2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
- }
- function pullAllWith(array, values2, comparator2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator2) : array;
- }
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length, result3 = baseAt(array, indexes);
- basePullAt(array, arrayMap(indexes, function(index2) {
- return isIndex(index2, length) ? +index2 : index2;
- }).sort(compareAscending));
- return result3;
- });
- function remove2(array, predicate) {
- var result3 = [];
- if (!(array && array.length)) {
- return result3;
- }
- var index2 = -1, indexes = [], length = array.length;
- predicate = getIteratee(predicate, 3);
- while (++index2 < length) {
- var value = array[index2];
- if (predicate(value, index2, array)) {
- result3.push(value);
- indexes.push(index2);
- }
- }
- basePullAt(array, indexes);
- return result3;
- }
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- } else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined$1 ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
- function sortedIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
- }
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index2 = baseSortedIndex(array, value);
- if (index2 < length && eq(array[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
- function sortedLastIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
- }
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index2 = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function sortedUniq(array) {
- return array && array.length ? baseSortedUniq(array) : [];
- }
- function sortedUniqBy(array, iteratee2) {
- return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
- function take(array, n2, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- return baseSlice(array, 0, n2 < 0 ? 0 : n2);
- }
- function takeRight(array, n2, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- n2 = length - n2;
- return baseSlice(array, n2 < 0 ? 0 : n2, length);
- }
- function takeRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
- }
- function takeWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
- }
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
- var unionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
- });
- var unionWith = baseRest(function(arrays) {
- var comparator2 = last(arrays);
- comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator2);
- });
- function uniq(array) {
- return array && array.length ? baseUniq(array) : [];
- }
- function uniqBy(array, iteratee2) {
- return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function uniqWith(array, comparator2) {
- comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
- return array && array.length ? baseUniq(array, undefined$1, comparator2) : [];
- }
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index2) {
- return arrayMap(array, baseProperty(index2));
- });
- }
- function unzipWith(array, iteratee2) {
- if (!(array && array.length)) {
- return [];
- }
- var result3 = unzip(array);
- if (iteratee2 == null) {
- return result3;
- }
- return arrayMap(result3, function(group) {
- return apply(iteratee2, undefined$1, group);
- });
- }
- var without = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
- });
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
- var xorBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
- });
- var xorWith = baseRest(function(arrays) {
- var comparator2 = last(arrays);
- comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator2);
- });
- var zip = baseRest(unzip);
- function zipObject(props, values2) {
- return baseZipObject(props || [], values2 || [], assignValue);
- }
- function zipObjectDeep(props, values2) {
- return baseZipObject(props || [], values2 || [], baseSet);
- }
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
- iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
- return unzipWith(arrays, iteratee2);
- });
- function chain(value) {
- var result3 = lodash2(value);
- result3.__chain__ = true;
- return result3;
- }
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
- function thru(value, interceptor) {
- return interceptor(value);
- }
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
- return baseAt(object, paths);
- };
- if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- "func": thru,
- "args": [interceptor],
- "thisArg": undefined$1
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined$1);
- }
- return array;
- });
- });
- function wrapperChain() {
- return chain(this);
- }
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
- function wrapperNext() {
- if (this.__values__ === undefined$1) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
- return { "done": done, "value": value };
- }
- function wrapperToIterator() {
- return this;
- }
- function wrapperPlant(value) {
- var result3, parent2 = this;
- while (parent2 instanceof baseLodash) {
- var clone3 = wrapperClone(parent2);
- clone3.__index__ = 0;
- clone3.__values__ = undefined$1;
- if (result3) {
- previous.__wrapped__ = clone3;
- } else {
- result3 = clone3;
- }
- var previous = clone3;
- parent2 = parent2.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result3;
- }
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- "func": thru,
- "args": [reverse],
- "thisArg": undefined$1
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
- var countBy = createAggregator(function(result3, value, key) {
- if (hasOwnProperty2.call(result3, key)) {
- ++result3[key];
- } else {
- baseAssignValue(result3, key, 1);
- }
- });
- function every(collection, predicate, guard) {
- var func = isArray2(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- function filter(collection, predicate) {
- var func = isArray2(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
- var find = createFind(findIndex);
- var findLast = createFind(findLastIndex);
- function flatMap(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), 1);
- }
- function flatMapDeep(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), INFINITY);
- }
- function flatMapDepth(collection, iteratee2, depth) {
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee2), depth);
- }
- function forEach3(collection, iteratee2) {
- var func = isArray2(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function forEachRight(collection, iteratee2) {
- var func = isArray2(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee2, 3));
- }
- var groupBy = createAggregator(function(result3, value, key) {
- if (hasOwnProperty2.call(result3, key)) {
- result3[key].push(value);
- } else {
- baseAssignValue(result3, key, [value]);
- }
- });
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
- }
- var invokeMap = baseRest(function(collection, path, args) {
- var index2 = -1, isFunc = typeof path == "function", result3 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value) {
- result3[++index2] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result3;
- });
- var keyBy = createAggregator(function(result3, value, key) {
- baseAssignValue(result3, key, value);
- });
- function map(collection, iteratee2) {
- var func = isArray2(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray2(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined$1 : orders;
- if (!isArray2(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
- var partition = createAggregator(function(result3, value, key) {
- result3[key ? 0 : 1].push(value);
- }, function() {
- return [[], []];
- });
- function reduce(collection, iteratee2, accumulator) {
- var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
- }
- function reduceRight(collection, iteratee2, accumulator) {
- var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
- }
- function reject(collection, predicate) {
- var func = isArray2(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
- function sample(collection) {
- var func = isArray2(collection) ? arraySample : baseSample;
- return func(collection);
- }
- function sampleSize(collection, n2, guard) {
- if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined$1) {
- n2 = 1;
- } else {
- n2 = toInteger(n2);
- }
- var func = isArray2(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n2);
- }
- function shuffle(collection) {
- var func = isArray2(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
- function size2(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString2(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
- function some(collection, predicate, guard) {
- var func = isArray2(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
- var now = ctxNow || function() {
- return root.Date.now();
- };
- function after(n2, func) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n2 = toInteger(n2);
- return function() {
- if (--n2 < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- function ary(func, n2, guard) {
- n2 = guard ? undefined$1 : n2;
- n2 = func && n2 == null ? func.length : n2;
- return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n2);
- }
- function before(n2, func) {
- var result3;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n2 = toInteger(n2);
- return function() {
- if (--n2 > 0) {
- result3 = func.apply(this, arguments);
- }
- if (n2 <= 1) {
- func = undefined$1;
- }
- return result3;
- };
- }
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
- function curry(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result3 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result3.placeholder = curry.placeholder;
- return result3;
- }
- function curryRight(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result3 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result3.placeholder = curryRight.placeholder;
- return result3;
- }
- function debounce(func, wait, options) {
- var lastArgs, lastThis, maxWait, result3, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- wait = toNumber2(wait) || 0;
- if (isObject2(options)) {
- leading = !!options.leading;
- maxing = "maxWait" in options;
- maxWait = maxing ? nativeMax(toNumber2(options.maxWait) || 0, wait) : maxWait;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- function invokeFunc(time) {
- var args = lastArgs, thisArg = lastThis;
- lastArgs = lastThis = undefined$1;
- lastInvokeTime = time;
- result3 = func.apply(thisArg, args);
- return result3;
- }
- function leadingEdge(time) {
- lastInvokeTime = time;
- timerId = setTimeout2(timerExpired, wait);
- return leading ? invokeFunc(time) : result3;
- }
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
- }
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
- return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
- }
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- timerId = setTimeout2(timerExpired, remainingWait(time));
- }
- function trailingEdge(time) {
- timerId = undefined$1;
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined$1;
- return result3;
- }
- function cancel() {
- if (timerId !== undefined$1) {
- clearTimeout2(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined$1;
- }
- function flush() {
- return timerId === undefined$1 ? result3 : trailingEdge(now());
- }
- function debounced() {
- var time = now(), isInvoking = shouldInvoke(time);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
- if (isInvoking) {
- if (timerId === undefined$1) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- clearTimeout2(timerId);
- timerId = setTimeout2(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined$1) {
- timerId = setTimeout2(timerExpired, wait);
- }
- return result3;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber2(wait) || 0, args);
- });
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
- function memoize(func, resolver) {
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result3 = func.apply(this, args);
- memoized.cache = cache.set(key, result3) || cache;
- return result3;
- };
- memoized.cache = new (memoize.Cache || MapCache)();
- return memoized;
- }
- memoize.Cache = MapCache;
- function negate(predicate) {
- if (typeof predicate != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return !predicate.call(this);
- case 1:
- return !predicate.call(this, args[0]);
- case 2:
- return !predicate.call(this, args[0], args[1]);
- case 3:
- return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
- function once2(func) {
- return before(2, func);
- }
- var overArgs = castRest(function(func, transforms) {
- transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index2 = -1, length = nativeMin(args.length, funcsLength);
- while (++index2 < length) {
- args[index2] = transforms[index2].call(this, args[index2]);
- }
- return apply(func, this, args);
- });
- });
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
- });
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
- });
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
- });
- function rest(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start === undefined$1 ? start : toInteger(start);
- return baseRest(func, start);
- }
- function spread(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start], otherArgs = castSlice(args, 0, start);
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
- function throttle(func, wait, options) {
- var leading = true, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (isObject2(options)) {
- leading = "leading" in options ? !!options.leading : leading;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- "leading": leading,
- "maxWait": wait,
- "trailing": trailing
- });
- }
- function unary(func) {
- return ary(func, 1);
- }
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray2(value) ? value : [value];
- }
- function clone2(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
- function cloneWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var gt2 = createRelationalOperation(baseGt);
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
- var isArguments = baseIsArguments(function() {
- return arguments;
- }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArray2 = Array2.isArray;
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction2(value);
- }
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- function isBoolean2(value) {
- return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
- }
- var isBuffer = nativeIsBuffer || stubFalse;
- var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value);
- }
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty2.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- var result3 = customizer ? customizer(value, other) : undefined$1;
- return result3 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result3;
- }
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value);
- }
- function isFinite2(value) {
- return typeof value == "number" && nativeIsFinite(value);
- }
- function isFunction2(value) {
- if (!isObject2(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- function isInteger(value) {
- return typeof value == "number" && value == toInteger(value);
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject2(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
- function isNaN2(value) {
- return isNumber(value) && value != +value;
- }
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error2(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
- function isNull(value) {
- return value === null;
- }
- function isNil(value) {
- return value == null;
- }
- function isNumber(value) {
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
- }
- function isPlainObject2(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
- }
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
- var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
- function isString2(value) {
- return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
- }
- function isSymbol2(value) {
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
- }
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- function isUndefined2(value) {
- return value === undefined$1;
- }
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
- var lt2 = createRelationalOperation(baseLt);
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString2(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
- return func(value);
- }
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber2(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = value < 0 ? -1 : 1;
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- function toInteger(value) {
- var result3 = toFinite(value), remainder = result3 % 1;
- return result3 === result3 ? remainder ? result3 - remainder : result3 : 0;
- }
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
- function toNumber2(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol2(value)) {
- return NAN;
- }
- if (isObject2(value)) {
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
- value = isObject2(other) ? other + "" : other;
- }
- if (typeof value != "string") {
- return value === 0 ? value : +value;
- }
- value = baseTrim(value);
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
- function toSafeInteger(value) {
- return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
- }
- function toString2(value) {
- return value == null ? "" : baseToString(value);
- }
- var assign2 = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty2.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
- var at2 = flatRest(baseAt);
- function create(prototype, properties) {
- var result3 = baseCreate(prototype);
- return properties == null ? result3 : baseAssign(result3, properties);
- }
- var defaults2 = baseRest(function(object, sources) {
- object = Object2(object);
- var index2 = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index2 < length) {
- var source = sources[index2];
- var props = keysIn(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
- if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
- object[key] = source[key];
- }
- }
- }
- return object;
- });
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined$1, customDefaultsMerge);
- return apply(mergeWith, undefined$1, args);
- });
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
- function forIn(object, iteratee2) {
- return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forInRight(object, iteratee2) {
- return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forOwn(object, iteratee2) {
- return object && baseForOwn(object, getIteratee(iteratee2, 3));
- }
- function forOwnRight(object, iteratee2) {
- return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
- }
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
- function get2(object, path, defaultValue) {
- var result3 = object == null ? undefined$1 : baseGet(object, path);
- return result3 === undefined$1 ? defaultValue : result3;
- }
- function has2(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
- var invert = createInverter(function(result3, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- result3[value] = key;
- }, constant(identity));
- var invertBy = createInverter(function(result3, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty2.call(result3, value)) {
- result3[value].push(key);
- } else {
- result3[value] = [key];
- }
- }, getIteratee);
- var invoke = baseRest(baseInvoke);
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
- function mapKeys(object, iteratee2) {
- var result3 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result3, iteratee2(value, key, object2), value);
- });
- return result3;
- }
- function mapValues(object, iteratee2) {
- var result3 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result3, key, iteratee2(value, key, object2));
- });
- return result3;
- }
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
- var omit = flatRest(function(object, paths) {
- var result3 = {};
- if (object == null) {
- return result3;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result3);
- if (isDeep) {
- result3 = baseClone(result3, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result3, paths[length]);
- }
- return result3;
- });
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
- function result2(object, path, defaultValue) {
- path = castPath(path, object);
- var index2 = -1, length = path.length;
- if (!length) {
- length = 1;
- object = undefined$1;
- }
- while (++index2 < length) {
- var value = object == null ? undefined$1 : object[toKey(path[index2])];
- if (value === undefined$1) {
- index2 = length;
- value = defaultValue;
- }
- object = isFunction2(value) ? value.call(object) : value;
- }
- return object;
- }
- function set2(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
- var toPairs = createToPairs(keys);
- var toPairsIn = createToPairs(keysIn);
- function transform(object, iteratee2, accumulator) {
- var isArr = isArray2(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
- iteratee2 = getIteratee(iteratee2, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor() : [];
- } else if (isObject2(object)) {
- accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
- } else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index2, object2) {
- return iteratee2(accumulator, value, index2, object2);
- });
- return accumulator;
- }
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
- function clamp(number, lower, upper) {
- if (upper === undefined$1) {
- upper = lower;
- lower = undefined$1;
- }
- if (upper !== undefined$1) {
- upper = toNumber2(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined$1) {
- lower = toNumber2(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber2(number), lower, upper);
- }
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber2(number);
- return baseInRange(number, start, end);
- }
- function random(lower, upper, floating) {
- if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined$1;
- }
- if (floating === undefined$1) {
- if (typeof upper == "boolean") {
- floating = upper;
- upper = undefined$1;
- } else if (typeof lower == "boolean") {
- floating = lower;
- lower = undefined$1;
- }
- }
- if (lower === undefined$1 && upper === undefined$1) {
- lower = 0;
- upper = 1;
- } else {
- lower = toFinite(lower);
- if (upper === undefined$1) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
- }
- return baseRandom(lower, upper);
- }
- var camelCase = createCompounder(function(result3, word, index2) {
- word = word.toLowerCase();
- return result3 + (index2 ? capitalize2(word) : word);
- });
- function capitalize2(string) {
- return upperFirst(toString2(string).toLowerCase());
- }
- function deburr(string) {
- string = toString2(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
- }
- function endsWith(string, target, position) {
- string = toString2(string);
- target = baseToString(target);
- var length = string.length;
- position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
- function escape2(string) {
- string = toString2(string);
- return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
- }
- function escapeRegExp(string) {
- string = toString2(string);
- return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
- }
- var kebabCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? "-" : "") + word.toLowerCase();
- });
- var lowerCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + word.toLowerCase();
- });
- var lowerFirst = createCaseFirst("toLowerCase");
- function pad(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
- }
- function padEnd(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
- }
- function padStart(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
- }
- function parseInt2(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString2(string).replace(reTrimStart, ""), radix || 0);
- }
- function repeat(string, n2, guard) {
- if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined$1) {
- n2 = 1;
- } else {
- n2 = toInteger(n2);
- }
- return baseRepeat(toString2(string), n2);
- }
- function replace() {
- var args = arguments, string = toString2(args[0]);
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
- var snakeCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? "_" : "") + word.toLowerCase();
- });
- function split(string, separator, limit) {
- if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined$1;
- }
- limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString2(string);
- if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
- var startCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + upperFirst(word);
- });
- function startsWith2(string, target, position) {
- string = toString2(string);
- position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
- function template(string, options, guard) {
- var settings = lodash2.templateSettings;
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined$1;
- }
- string = toString2(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
- var isEscaping, isEvaluating, index2 = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
- var reDelimiters = RegExp2(
- (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
- "g"
- );
- var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
- source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar);
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index2 = offset + match.length;
- return match;
- });
- source += "';\n";
- var variable = hasOwnProperty2.call(options, "variable") && options.variable;
- if (!variable) {
- source = "with (obj) {\n" + source + "\n}\n";
- } else if (reForbiddenIdentifierChars.test(variable)) {
- throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
- }
- source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
- 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}";
- var result3 = attempt(function() {
- return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
- });
- result3.source = source;
- if (isError(result3)) {
- throw result3;
- }
- return result3;
- }
- function toLower(value) {
- return toString2(value).toLowerCase();
- }
- function toUpper(value) {
- return toString2(value).toUpperCase();
- }
- function trim(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return baseTrim(string);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
- return castSlice(strSymbols, start, end).join("");
- }
- function trimEnd(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return string.slice(0, trimmedEndIndex(string) + 1);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
- return castSlice(strSymbols, 0, end).join("");
- }
- function trimStart(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return string.replace(reTrimStart, "");
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
- return castSlice(strSymbols, start).join("");
- }
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
- if (isObject2(options)) {
- var separator = "separator" in options ? options.separator : separator;
- length = "length" in options ? toInteger(options.length) : length;
- omission = "omission" in options ? baseToString(options.omission) : omission;
- }
- string = toString2(string);
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result3 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
- if (separator === undefined$1) {
- return result3 + omission;
- }
- if (strSymbols) {
- end += result3.length - end;
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match, substring = result3;
- if (!separator.global) {
- separator = RegExp2(separator.source, toString2(reFlags.exec(separator)) + "g");
- }
- separator.lastIndex = 0;
- while (match = separator.exec(substring)) {
- var newEnd = match.index;
- }
- result3 = result3.slice(0, newEnd === undefined$1 ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index2 = result3.lastIndexOf(separator);
- if (index2 > -1) {
- result3 = result3.slice(0, index2);
- }
- }
- return result3 + omission;
- }
- function unescape2(string) {
- string = toString2(string);
- return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
- }
- var upperCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + word.toUpperCase();
- });
- var upperFirst = createCaseFirst("toUpperCase");
- function words(string, pattern, guard) {
- string = toString2(string);
- pattern = guard ? undefined$1 : pattern;
- if (pattern === undefined$1) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined$1, args);
- } catch (e2) {
- return isError(e2) ? e2 : new Error2(e2);
- }
- });
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
- return baseRest(function(args) {
- var index2 = -1;
- while (++index2 < length) {
- var pair = pairs[index2];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
- function constant(value) {
- return function() {
- return value;
- };
- }
- function defaultTo(value, defaultValue) {
- return value == null || value !== value ? defaultValue : value;
- }
- var flow = createFlow();
- var flowRight = createFlow(true);
- function identity(value) {
- return value;
- }
- function iteratee(func) {
- return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
- function mixin(object, source, options) {
- var props = keys(source), methodNames = baseFunctions(source, props);
- if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain2 || chainAll) {
- var result3 = object(this.__wrapped__), actions = result3.__actions__ = copyArray(this.__actions__);
- actions.push({ "func": func, "args": arguments, "thisArg": object });
- result3.__chain__ = chainAll;
- return result3;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
- return object;
- }
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
- function noop2() {
- }
- function nthArg(n2) {
- n2 = toInteger(n2);
- return baseRest(function(args) {
- return baseNth(args, n2);
- });
- }
- var over = createOver(arrayMap);
- var overEvery = createOver(arrayEvery);
- var overSome = createOver(arraySome);
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined$1 : baseGet(object, path);
- };
- }
- var range = createRange();
- var rangeRight = createRange(true);
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- function stubObject() {
- return {};
- }
- function stubString() {
- return "";
- }
- function stubTrue() {
- return true;
- }
- function times(n2, iteratee2) {
- n2 = toInteger(n2);
- if (n2 < 1 || n2 > MAX_SAFE_INTEGER) {
- return [];
- }
- var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH);
- iteratee2 = getIteratee(iteratee2);
- n2 -= MAX_ARRAY_LENGTH;
- var result3 = baseTimes(length, iteratee2);
- while (++index2 < n2) {
- iteratee2(index2);
- }
- return result3;
- }
- function toPath(value) {
- if (isArray2(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol2(value) ? [value] : copyArray(stringToPath(toString2(value)));
- }
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString2(prefix) + id;
- }
- var add2 = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
- var ceil = createRound("ceil");
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
- var floor = createRound("floor");
- function max(array) {
- return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1;
- }
- function maxBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
- }
- function mean(array) {
- return baseMean(array, identity);
- }
- function meanBy(array, iteratee2) {
- return baseMean(array, getIteratee(iteratee2, 2));
- }
- function min(array) {
- return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1;
- }
- function minBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
- }
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
- var round = createRound("round");
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
- function sum(array) {
- return array && array.length ? baseSum(array, identity) : 0;
- }
- function sumBy(array, iteratee2) {
- return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
- }
- lodash2.after = after;
- lodash2.ary = ary;
- lodash2.assign = assign2;
- lodash2.assignIn = assignIn;
- lodash2.assignInWith = assignInWith;
- lodash2.assignWith = assignWith;
- lodash2.at = at2;
- lodash2.before = before;
- lodash2.bind = bind;
- lodash2.bindAll = bindAll;
- lodash2.bindKey = bindKey;
- lodash2.castArray = castArray;
- lodash2.chain = chain;
- lodash2.chunk = chunk;
- lodash2.compact = compact;
- lodash2.concat = concat;
- lodash2.cond = cond;
- lodash2.conforms = conforms;
- lodash2.constant = constant;
- lodash2.countBy = countBy;
- lodash2.create = create;
- lodash2.curry = curry;
- lodash2.curryRight = curryRight;
- lodash2.debounce = debounce;
- lodash2.defaults = defaults2;
- lodash2.defaultsDeep = defaultsDeep;
- lodash2.defer = defer;
- lodash2.delay = delay;
- lodash2.difference = difference;
- lodash2.differenceBy = differenceBy;
- lodash2.differenceWith = differenceWith;
- lodash2.drop = drop;
- lodash2.dropRight = dropRight;
- lodash2.dropRightWhile = dropRightWhile;
- lodash2.dropWhile = dropWhile;
- lodash2.fill = fill;
- lodash2.filter = filter;
- lodash2.flatMap = flatMap;
- lodash2.flatMapDeep = flatMapDeep;
- lodash2.flatMapDepth = flatMapDepth;
- lodash2.flatten = flatten;
- lodash2.flattenDeep = flattenDeep;
- lodash2.flattenDepth = flattenDepth;
- lodash2.flip = flip;
- lodash2.flow = flow;
- lodash2.flowRight = flowRight;
- lodash2.fromPairs = fromPairs;
- lodash2.functions = functions;
- lodash2.functionsIn = functionsIn;
- lodash2.groupBy = groupBy;
- lodash2.initial = initial;
- lodash2.intersection = intersection;
- lodash2.intersectionBy = intersectionBy;
- lodash2.intersectionWith = intersectionWith;
- lodash2.invert = invert;
- lodash2.invertBy = invertBy;
- lodash2.invokeMap = invokeMap;
- lodash2.iteratee = iteratee;
- lodash2.keyBy = keyBy;
- lodash2.keys = keys;
- lodash2.keysIn = keysIn;
- lodash2.map = map;
- lodash2.mapKeys = mapKeys;
- lodash2.mapValues = mapValues;
- lodash2.matches = matches;
- lodash2.matchesProperty = matchesProperty;
- lodash2.memoize = memoize;
- lodash2.merge = merge;
- lodash2.mergeWith = mergeWith;
- lodash2.method = method;
- lodash2.methodOf = methodOf;
- lodash2.mixin = mixin;
- lodash2.negate = negate;
- lodash2.nthArg = nthArg;
- lodash2.omit = omit;
- lodash2.omitBy = omitBy;
- lodash2.once = once2;
- lodash2.orderBy = orderBy;
- lodash2.over = over;
- lodash2.overArgs = overArgs;
- lodash2.overEvery = overEvery;
- lodash2.overSome = overSome;
- lodash2.partial = partial;
- lodash2.partialRight = partialRight;
- lodash2.partition = partition;
- lodash2.pick = pick;
- lodash2.pickBy = pickBy;
- lodash2.property = property;
- lodash2.propertyOf = propertyOf;
- lodash2.pull = pull;
- lodash2.pullAll = pullAll;
- lodash2.pullAllBy = pullAllBy;
- lodash2.pullAllWith = pullAllWith;
- lodash2.pullAt = pullAt;
- lodash2.range = range;
- lodash2.rangeRight = rangeRight;
- lodash2.rearg = rearg;
- lodash2.reject = reject;
- lodash2.remove = remove2;
- lodash2.rest = rest;
- lodash2.reverse = reverse;
- lodash2.sampleSize = sampleSize;
- lodash2.set = set2;
- lodash2.setWith = setWith;
- lodash2.shuffle = shuffle;
- lodash2.slice = slice;
- lodash2.sortBy = sortBy;
- lodash2.sortedUniq = sortedUniq;
- lodash2.sortedUniqBy = sortedUniqBy;
- lodash2.split = split;
- lodash2.spread = spread;
- lodash2.tail = tail;
- lodash2.take = take;
- lodash2.takeRight = takeRight;
- lodash2.takeRightWhile = takeRightWhile;
- lodash2.takeWhile = takeWhile;
- lodash2.tap = tap;
- lodash2.throttle = throttle;
- lodash2.thru = thru;
- lodash2.toArray = toArray;
- lodash2.toPairs = toPairs;
- lodash2.toPairsIn = toPairsIn;
- lodash2.toPath = toPath;
- lodash2.toPlainObject = toPlainObject;
- lodash2.transform = transform;
- lodash2.unary = unary;
- lodash2.union = union;
- lodash2.unionBy = unionBy;
- lodash2.unionWith = unionWith;
- lodash2.uniq = uniq;
- lodash2.uniqBy = uniqBy;
- lodash2.uniqWith = uniqWith;
- lodash2.unset = unset;
- lodash2.unzip = unzip;
- lodash2.unzipWith = unzipWith;
- lodash2.update = update;
- lodash2.updateWith = updateWith;
- lodash2.values = values;
- lodash2.valuesIn = valuesIn;
- lodash2.without = without;
- lodash2.words = words;
- lodash2.wrap = wrap;
- lodash2.xor = xor;
- lodash2.xorBy = xorBy;
- lodash2.xorWith = xorWith;
- lodash2.zip = zip;
- lodash2.zipObject = zipObject;
- lodash2.zipObjectDeep = zipObjectDeep;
- lodash2.zipWith = zipWith;
- lodash2.entries = toPairs;
- lodash2.entriesIn = toPairsIn;
- lodash2.extend = assignIn;
- lodash2.extendWith = assignInWith;
- mixin(lodash2, lodash2);
- lodash2.add = add2;
- lodash2.attempt = attempt;
- lodash2.camelCase = camelCase;
- lodash2.capitalize = capitalize2;
- lodash2.ceil = ceil;
- lodash2.clamp = clamp;
- lodash2.clone = clone2;
- lodash2.cloneDeep = cloneDeep;
- lodash2.cloneDeepWith = cloneDeepWith;
- lodash2.cloneWith = cloneWith;
- lodash2.conformsTo = conformsTo;
- lodash2.deburr = deburr;
- lodash2.defaultTo = defaultTo;
- lodash2.divide = divide;
- lodash2.endsWith = endsWith;
- lodash2.eq = eq;
- lodash2.escape = escape2;
- lodash2.escapeRegExp = escapeRegExp;
- lodash2.every = every;
- lodash2.find = find;
- lodash2.findIndex = findIndex;
- lodash2.findKey = findKey;
- lodash2.findLast = findLast;
- lodash2.findLastIndex = findLastIndex;
- lodash2.findLastKey = findLastKey;
- lodash2.floor = floor;
- lodash2.forEach = forEach3;
- lodash2.forEachRight = forEachRight;
- lodash2.forIn = forIn;
- lodash2.forInRight = forInRight;
- lodash2.forOwn = forOwn;
- lodash2.forOwnRight = forOwnRight;
- lodash2.get = get2;
- lodash2.gt = gt2;
- lodash2.gte = gte;
- lodash2.has = has2;
- lodash2.hasIn = hasIn;
- lodash2.head = head;
- lodash2.identity = identity;
- lodash2.includes = includes;
- lodash2.indexOf = indexOf;
- lodash2.inRange = inRange;
- lodash2.invoke = invoke;
- lodash2.isArguments = isArguments;
- lodash2.isArray = isArray2;
- lodash2.isArrayBuffer = isArrayBuffer;
- lodash2.isArrayLike = isArrayLike;
- lodash2.isArrayLikeObject = isArrayLikeObject;
- lodash2.isBoolean = isBoolean2;
- lodash2.isBuffer = isBuffer;
- lodash2.isDate = isDate2;
- lodash2.isElement = isElement;
- lodash2.isEmpty = isEmpty;
- lodash2.isEqual = isEqual;
- lodash2.isEqualWith = isEqualWith;
- lodash2.isError = isError;
- lodash2.isFinite = isFinite2;
- lodash2.isFunction = isFunction2;
- lodash2.isInteger = isInteger;
- lodash2.isLength = isLength;
- lodash2.isMap = isMap2;
- lodash2.isMatch = isMatch;
- lodash2.isMatchWith = isMatchWith;
- lodash2.isNaN = isNaN2;
- lodash2.isNative = isNative;
- lodash2.isNil = isNil;
- lodash2.isNull = isNull;
- lodash2.isNumber = isNumber;
- lodash2.isObject = isObject2;
- lodash2.isObjectLike = isObjectLike;
- lodash2.isPlainObject = isPlainObject2;
- lodash2.isRegExp = isRegExp;
- lodash2.isSafeInteger = isSafeInteger;
- lodash2.isSet = isSet2;
- lodash2.isString = isString2;
- lodash2.isSymbol = isSymbol2;
- lodash2.isTypedArray = isTypedArray;
- lodash2.isUndefined = isUndefined2;
- lodash2.isWeakMap = isWeakMap;
- lodash2.isWeakSet = isWeakSet;
- lodash2.join = join;
- lodash2.kebabCase = kebabCase;
- lodash2.last = last;
- lodash2.lastIndexOf = lastIndexOf;
- lodash2.lowerCase = lowerCase;
- lodash2.lowerFirst = lowerFirst;
- lodash2.lt = lt2;
- lodash2.lte = lte;
- lodash2.max = max;
- lodash2.maxBy = maxBy;
- lodash2.mean = mean;
- lodash2.meanBy = meanBy;
- lodash2.min = min;
- lodash2.minBy = minBy;
- lodash2.stubArray = stubArray;
- lodash2.stubFalse = stubFalse;
- lodash2.stubObject = stubObject;
- lodash2.stubString = stubString;
- lodash2.stubTrue = stubTrue;
- lodash2.multiply = multiply;
- lodash2.nth = nth;
- lodash2.noConflict = noConflict;
- lodash2.noop = noop2;
- lodash2.now = now;
- lodash2.pad = pad;
- lodash2.padEnd = padEnd;
- lodash2.padStart = padStart;
- lodash2.parseInt = parseInt2;
- lodash2.random = random;
- lodash2.reduce = reduce;
- lodash2.reduceRight = reduceRight;
- lodash2.repeat = repeat;
- lodash2.replace = replace;
- lodash2.result = result2;
- lodash2.round = round;
- lodash2.runInContext = runInContext2;
- lodash2.sample = sample;
- lodash2.size = size2;
- lodash2.snakeCase = snakeCase;
- lodash2.some = some;
- lodash2.sortedIndex = sortedIndex;
- lodash2.sortedIndexBy = sortedIndexBy;
- lodash2.sortedIndexOf = sortedIndexOf;
- lodash2.sortedLastIndex = sortedLastIndex;
- lodash2.sortedLastIndexBy = sortedLastIndexBy;
- lodash2.sortedLastIndexOf = sortedLastIndexOf;
- lodash2.startCase = startCase;
- lodash2.startsWith = startsWith2;
- lodash2.subtract = subtract;
- lodash2.sum = sum;
- lodash2.sumBy = sumBy;
- lodash2.template = template;
- lodash2.times = times;
- lodash2.toFinite = toFinite;
- lodash2.toInteger = toInteger;
- lodash2.toLength = toLength;
- lodash2.toLower = toLower;
- lodash2.toNumber = toNumber2;
- lodash2.toSafeInteger = toSafeInteger;
- lodash2.toString = toString2;
- lodash2.toUpper = toUpper;
- lodash2.trim = trim;
- lodash2.trimEnd = trimEnd;
- lodash2.trimStart = trimStart;
- lodash2.truncate = truncate;
- lodash2.unescape = unescape2;
- lodash2.uniqueId = uniqueId;
- lodash2.upperCase = upperCase;
- lodash2.upperFirst = upperFirst;
- lodash2.each = forEach3;
- lodash2.eachRight = forEachRight;
- lodash2.first = head;
- mixin(lodash2, function() {
- var source = {};
- baseForOwn(lodash2, function(func, methodName) {
- if (!hasOwnProperty2.call(lodash2.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }(), { "chain": false });
- lodash2.VERSION = VERSION;
- arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
- lodash2[methodName].placeholder = lodash2;
- });
- arrayEach(["drop", "take"], function(methodName, index2) {
- LazyWrapper.prototype[methodName] = function(n2) {
- n2 = n2 === undefined$1 ? 1 : nativeMax(toInteger(n2), 0);
- var result3 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone();
- if (result3.__filtered__) {
- result3.__takeCount__ = nativeMin(n2, result3.__takeCount__);
- } else {
- result3.__views__.push({
- "size": nativeMin(n2, MAX_ARRAY_LENGTH),
- "type": methodName + (result3.__dir__ < 0 ? "Right" : "")
- });
- }
- return result3;
- };
- LazyWrapper.prototype[methodName + "Right"] = function(n2) {
- return this.reverse()[methodName](n2).reverse();
- };
- });
- arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) {
- var type = index2 + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- LazyWrapper.prototype[methodName] = function(iteratee2) {
- var result3 = this.clone();
- result3.__iteratees__.push({
- "iteratee": getIteratee(iteratee2, 3),
- "type": type
- });
- result3.__filtered__ = result3.__filtered__ || isFilter;
- return result3;
- };
- });
- arrayEach(["head", "last"], function(methodName, index2) {
- var takeName = "take" + (index2 ? "Right" : "");
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
- arrayEach(["initial", "tail"], function(methodName, index2) {
- var dropName = "drop" + (index2 ? "" : "Right");
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == "function") {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
- var result3 = this;
- if (result3.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result3);
- }
- if (start < 0) {
- result3 = result3.takeRight(-start);
- } else if (start) {
- result3 = result3.drop(start);
- }
- if (end !== undefined$1) {
- end = toInteger(end);
- result3 = end < 0 ? result3.dropRight(-end) : result3.take(end - start);
- }
- return result3;
- };
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- 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);
- if (!lodashFunc) {
- return;
- }
- lodash2.prototype[methodName] = function() {
- var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value);
- var interceptor = function(value2) {
- var result4 = lodashFunc.apply(lodash2, arrayPush([value2], args));
- return isTaker && chainAll ? result4[0] : result4;
- };
- if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result3 = func.apply(value, args);
- result3.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
- return new LodashWrapper(result3, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result3 = this.thru(interceptor);
- return isUnwrapped ? isTaker ? result3.value()[0] : result3.value() : result3;
- };
- });
- arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
- var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- lodash2.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray2(value) ? value : [], args);
- }
- return this[chainName](function(value2) {
- return func.apply(isArray2(value2) ? value2 : [], args);
- });
- };
- });
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash2[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + "";
- if (!hasOwnProperty2.call(realNames, key)) {
- realNames[key] = [];
- }
- realNames[key].push({ "name": methodName, "func": lodashFunc });
- }
- });
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
- "name": "wrapper",
- "func": undefined$1
- }];
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
- lodash2.prototype.at = wrapperAt;
- lodash2.prototype.chain = wrapperChain;
- lodash2.prototype.commit = wrapperCommit;
- lodash2.prototype.next = wrapperNext;
- lodash2.prototype.plant = wrapperPlant;
- lodash2.prototype.reverse = wrapperReverse;
- lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
- lodash2.prototype.first = lodash2.prototype.head;
- if (symIterator) {
- lodash2.prototype[symIterator] = wrapperToIterator;
- }
- return lodash2;
- };
- var _2 = runInContext();
- if (freeModule) {
- (freeModule.exports = _2)._ = _2;
- freeExports._ = _2;
- } else {
- root._ = _2;
- }
- }).call(commonjsGlobal);
- })(lodash, lodash.exports);
- var lodashExports = lodash.exports;
- const _$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
- var dayjs_min = { exports: {} };
- (function(module2, exports2) {
- !function(t2, e2) {
- module2.exports = e2();
- }(commonjsGlobal, function() {
- 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) {
- var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
- return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
- } }, m2 = function(t3, e3, n3) {
- var r3 = String(t3);
- return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
- }, v2 = { s: m2, z: function(t3) {
- var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
- return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
- }, m: function t3(e3, n3) {
- if (e3.date() < n3.date())
- return -t3(n3, e3);
- 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);
- return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
- }, a: function(t3) {
- return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
- }, p: function(t3) {
- 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$/, "");
- }, u: function(t3) {
- return void 0 === t3;
- } }, g2 = "en", D2 = {};
- D2[g2] = M2;
- var p2 = "$isDayjsObject", S2 = function(t3) {
- return t3 instanceof _2 || !(!t3 || !t3[p2]);
- }, w2 = function t3(e3, n3, r3) {
- var i3;
- if (!e3)
- return g2;
- if ("string" == typeof e3) {
- var s3 = e3.toLowerCase();
- D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
- var u3 = e3.split("-");
- if (!i3 && u3.length > 1)
- return t3(u3[0]);
- } else {
- var a3 = e3.name;
- D2[a3] = e3, i3 = a3;
- }
- return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
- }, O2 = function(t3, e3) {
- if (S2(t3))
- return t3.clone();
- var n3 = "object" == typeof e3 ? e3 : {};
- return n3.date = t3, n3.args = arguments, new _2(n3);
- }, b2 = v2;
- b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
- return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
- };
- var _2 = function() {
- function M3(t3) {
- this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
- }
- var m3 = M3.prototype;
- return m3.parse = function(t3) {
- this.$d = function(t4) {
- var e3 = t4.date, n3 = t4.utc;
- if (null === e3)
- return /* @__PURE__ */ new Date(NaN);
- if (b2.u(e3))
- return /* @__PURE__ */ new Date();
- if (e3 instanceof Date)
- return new Date(e3);
- if ("string" == typeof e3 && !/Z$/i.test(e3)) {
- var r3 = e3.match($2);
- if (r3) {
- var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
- 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);
- }
- }
- return new Date(e3);
- }(t3), this.init();
- }, m3.init = function() {
- var t3 = this.$d;
- 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();
- }, m3.$utils = function() {
- return b2;
- }, m3.isValid = function() {
- return !(this.$d.toString() === l2);
- }, m3.isSame = function(t3, e3) {
- var n3 = O2(t3);
- return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
- }, m3.isAfter = function(t3, e3) {
- return O2(t3) < this.startOf(e3);
- }, m3.isBefore = function(t3, e3) {
- return this.endOf(e3) < O2(t3);
- }, m3.$g = function(t3, e3, n3) {
- return b2.u(t3) ? this[e3] : this.set(n3, t3);
- }, m3.unix = function() {
- return Math.floor(this.valueOf() / 1e3);
- }, m3.valueOf = function() {
- return this.$d.getTime();
- }, m3.startOf = function(t3, e3) {
- var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
- var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
- return r3 ? i3 : i3.endOf(a2);
- }, $3 = function(t4, e4) {
- return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
- }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
- switch (f3) {
- case h2:
- return r3 ? l3(1, 0) : l3(31, 11);
- case c2:
- return r3 ? l3(1, M4) : l3(0, M4 + 1);
- case o2:
- var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
- return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
- case a2:
- case d2:
- return $3(v3 + "Hours", 0);
- case u2:
- return $3(v3 + "Minutes", 1);
- case s2:
- return $3(v3 + "Seconds", 2);
- case i2:
- return $3(v3 + "Milliseconds", 3);
- default:
- return this.clone();
- }
- }, m3.endOf = function(t3) {
- return this.startOf(t3, false);
- }, m3.$set = function(t3, e3) {
- 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;
- if (o3 === c2 || o3 === h2) {
- var y3 = this.clone().set(d2, 1);
- y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
- } else
- l3 && this.$d[l3]($3);
- return this.init(), this;
- }, m3.set = function(t3, e3) {
- return this.clone().$set(t3, e3);
- }, m3.get = function(t3) {
- return this[b2.p(t3)]();
- }, m3.add = function(r3, f3) {
- var d3, l3 = this;
- r3 = Number(r3);
- var $3 = b2.p(f3), y3 = function(t3) {
- var e3 = O2(l3);
- return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
- };
- if ($3 === c2)
- return this.set(c2, this.$M + r3);
- if ($3 === h2)
- return this.set(h2, this.$y + r3);
- if ($3 === a2)
- return y3(1);
- if ($3 === o2)
- return y3(7);
- var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
- return b2.w(m4, this);
- }, m3.subtract = function(t3, e3) {
- return this.add(-1 * t3, e3);
- }, m3.format = function(t3) {
- var e3 = this, n3 = this.$locale();
- if (!this.isValid())
- return n3.invalidDate || l2;
- 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) {
- return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
- }, d3 = function(t4) {
- return b2.s(s3 % 12 || 12, t4, "0");
- }, $3 = f3 || function(t4, e4, n4) {
- var r4 = t4 < 12 ? "AM" : "PM";
- return n4 ? r4.toLowerCase() : r4;
- };
- return r3.replace(y2, function(t4, r4) {
- return r4 || function(t5) {
- switch (t5) {
- case "YY":
- return String(e3.$y).slice(-2);
- case "YYYY":
- return b2.s(e3.$y, 4, "0");
- case "M":
- return a3 + 1;
- case "MM":
- return b2.s(a3 + 1, 2, "0");
- case "MMM":
- return h3(n3.monthsShort, a3, c3, 3);
- case "MMMM":
- return h3(c3, a3);
- case "D":
- return e3.$D;
- case "DD":
- return b2.s(e3.$D, 2, "0");
- case "d":
- return String(e3.$W);
- case "dd":
- return h3(n3.weekdaysMin, e3.$W, o3, 2);
- case "ddd":
- return h3(n3.weekdaysShort, e3.$W, o3, 3);
- case "dddd":
- return o3[e3.$W];
- case "H":
- return String(s3);
- case "HH":
- return b2.s(s3, 2, "0");
- case "h":
- return d3(1);
- case "hh":
- return d3(2);
- case "a":
- return $3(s3, u3, true);
- case "A":
- return $3(s3, u3, false);
- case "m":
- return String(u3);
- case "mm":
- return b2.s(u3, 2, "0");
- case "s":
- return String(e3.$s);
- case "ss":
- return b2.s(e3.$s, 2, "0");
- case "SSS":
- return b2.s(e3.$ms, 3, "0");
- case "Z":
- return i3;
- }
- return null;
- }(t4) || i3.replace(":", "");
- });
- }, m3.utcOffset = function() {
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
- }, m3.diff = function(r3, d3, l3) {
- var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
- return b2.m(y3, m4);
- };
- switch (M4) {
- case h2:
- $3 = D3() / 12;
- break;
- case c2:
- $3 = D3();
- break;
- case f2:
- $3 = D3() / 3;
- break;
- case o2:
- $3 = (g3 - v3) / 6048e5;
- break;
- case a2:
- $3 = (g3 - v3) / 864e5;
- break;
- case u2:
- $3 = g3 / n2;
- break;
- case s2:
- $3 = g3 / e2;
- break;
- case i2:
- $3 = g3 / t2;
- break;
- default:
- $3 = g3;
- }
- return l3 ? $3 : b2.a($3);
- }, m3.daysInMonth = function() {
- return this.endOf(c2).$D;
- }, m3.$locale = function() {
- return D2[this.$L];
- }, m3.locale = function(t3, e3) {
- if (!t3)
- return this.$L;
- var n3 = this.clone(), r3 = w2(t3, e3, true);
- return r3 && (n3.$L = r3), n3;
- }, m3.clone = function() {
- return b2.w(this.$d, this);
- }, m3.toDate = function() {
- return new Date(this.valueOf());
- }, m3.toJSON = function() {
- return this.isValid() ? this.toISOString() : null;
- }, m3.toISOString = function() {
- return this.$d.toISOString();
- }, m3.toString = function() {
- return this.$d.toUTCString();
- }, M3;
- }(), k = _2.prototype;
- return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
- k[t3[1]] = function(e3) {
- return this.$g(e3, t3[0], t3[1]);
- };
- }), O2.extend = function(t3, e3) {
- return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
- }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
- return O2(1e3 * t3);
- }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
- });
- })(dayjs_min);
- var dayjs_minExports = dayjs_min.exports;
- const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
- var _a, _b;
- 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;
- const updateStorage = (strategy, store, options) => {
- const storage = strategy.storage;
- const storeKey = strategy.key || store.$id;
- const isCustomStorage = isH5 || (options == null ? void 0 : options.enforceCustomStorage);
- if (strategy.paths) {
- const partialState = strategy.paths.reduce((finalObj, key) => {
- finalObj[key] = store.$state[key];
- return finalObj;
- }, {});
- if (isCustomStorage && storage) {
- storage.setItem(storeKey, JSON.stringify(partialState));
- } else {
- index$1.setStorage({ key: storeKey, data: JSON.stringify(partialState) });
- }
- } else if (isCustomStorage && storage) {
- storage.setItem(storeKey, JSON.stringify(store.$state));
- } else {
- index$1.setStorage({ key: storeKey, data: JSON.stringify(store.$state) });
- }
- };
- var index = ({ options, store }) => {
- var _a2, _b2, _c, _d, _e2, _f;
- if ((_a2 = options.persist) == null ? void 0 : _a2.enabled) {
- const defaultStrat = [
- {
- key: store.$id,
- storage: ((_b2 = options.persist) == null ? void 0 : _b2.H5Storage) || (window == null ? void 0 : window.sessionStorage)
- }
- ];
- 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;
- strategies.forEach((strategy) => {
- var _a3, _b3;
- const storage = strategy.storage || ((_a3 = options.persist) == null ? void 0 : _a3.H5Storage) || (window == null ? void 0 : window.sessionStorage);
- const storeKey = strategy.key || store.$id;
- let storageResult;
- if (isH5 || ((_b3 = options.persist) == null ? void 0 : _b3.enforceCustomStorage)) {
- storageResult = storage.getItem(storeKey);
- } else {
- storageResult = index$1.getStorageSync(storeKey);
- }
- if (storageResult) {
- store.$patch(JSON.parse(storageResult));
- updateStorage(strategy, store, options.persist);
- }
- });
- store.$subscribe(() => {
- strategies.forEach((strategy) => {
- updateStorage(strategy, store, options.persist);
- });
- }, { detached: ((_f = options.persist) == null ? void 0 : _f.detached) ? true : false });
- }
- };
- var relativeTime$1 = { exports: {} };
- (function(module2, exports2) {
- !function(r2, e2) {
- module2.exports = e2();
- }(commonjsGlobal, function() {
- return function(r2, e2, t2) {
- r2 = r2 || {};
- 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" };
- function i2(r3, e3, t3, o3) {
- return n2.fromToBase(r3, e3, t3, o3);
- }
- t2.en.relativeTime = o2, n2.fromToBase = function(e3, n3, i3, d3, u2) {
- 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) {
- var y2 = h2[c2];
- y2.d && (f2 = d3 ? t2(e3).diff(i3, y2.d, true) : i3.diff(e3, y2.d, true));
- var p2 = (r2.rounding || Math.round)(Math.abs(f2));
- if (s2 = f2 > 0, p2 <= y2.r || !y2.r) {
- p2 <= 1 && c2 > 0 && (y2 = h2[c2 - 1]);
- var v2 = l2[y2.l];
- u2 && (p2 = u2("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s2);
- break;
- }
- }
- if (n3)
- return a2;
- var M2 = s2 ? l2.future : l2.past;
- return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2);
- }, n2.to = function(r3, e3) {
- return i2(r3, e3, this, true);
- }, n2.from = function(r3, e3) {
- return i2(r3, e3, this);
- };
- var d2 = function(r3) {
- return r3.$u ? t2.utc() : t2();
- };
- n2.toNow = function(r3) {
- return this.to(d2(this), r3);
- }, n2.fromNow = function(r3) {
- return this.from(d2(this), r3);
- };
- };
- });
- })(relativeTime$1);
- var relativeTimeExports = relativeTime$1.exports;
- const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
- var duration$1 = { exports: {} };
- (function(module2, exports2) {
- !function(t2, s2) {
- module2.exports = s2();
- }(commonjsGlobal, function() {
- 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) {
- return t3 instanceof g2;
- }, f2 = function(t3, s3, n3) {
- return new g2(t3, n3, s3.$l);
- }, m2 = function(t3) {
- return s2.p(t3) + "s";
- }, l2 = function(t3) {
- return t3 < 0;
- }, $2 = function(t3) {
- return l2(t3) ? Math.ceil(t3) : Math.floor(t3);
- }, y2 = function(t3) {
- return Math.abs(t3);
- }, v2 = function(t3, s3) {
- return t3 ? l2(t3) ? { negative: true, format: "" + y2(t3) + s3 } : { negative: false, format: "" + t3 + s3 } : { negative: false, format: "" };
- }, g2 = function() {
- function l3(t3, s3, n3) {
- var i3 = this;
- if (this.$d = {}, this.$l = n3, void 0 === t3 && (this.$ms = 0, this.parseFromMilliseconds()), s3)
- return f2(t3 * h2[m2(s3)], this);
- if ("number" == typeof t3)
- return this.$ms = t3, this.parseFromMilliseconds(), this;
- if ("object" == typeof t3)
- return Object.keys(t3).forEach(function(s4) {
- i3.$d[m2(s4)] = t3[s4];
- }), this.calMilliseconds(), this;
- if ("string" == typeof t3) {
- var e3 = t3.match(a2);
- if (e3) {
- var r3 = e3.slice(2).map(function(t4) {
- return null != t4 ? Number(t4) : 0;
- });
- 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;
- }
- }
- return this;
- }
- var y3 = l3.prototype;
- return y3.calMilliseconds = function() {
- var t3 = this;
- this.$ms = Object.keys(this.$d).reduce(function(s3, n3) {
- return s3 + (t3.$d[n3] || 0) * h2[n3];
- }, 0);
- }, y3.parseFromMilliseconds = function() {
- var t3 = this.$ms;
- 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;
- }, y3.toISOString = function() {
- var t3 = v2(this.$d.years, "Y"), s3 = v2(this.$d.months, "M"), n3 = +this.$d.days || 0;
- this.$d.weeks && (n3 += 7 * this.$d.weeks);
- var i3 = v2(n3, "D"), e3 = v2(this.$d.hours, "H"), r3 = v2(this.$d.minutes, "M"), o3 = this.$d.seconds || 0;
- this.$d.milliseconds && (o3 += this.$d.milliseconds / 1e3, o3 = Math.round(1e3 * o3) / 1e3);
- 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;
- return "P" === h3 || "-P" === h3 ? "P0D" : h3;
- }, y3.toJSON = function() {
- return this.toISOString();
- }, y3.format = function(t3) {
- 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") };
- return n3.replace(o2, function(t4, s3) {
- return s3 || String(i3[t4]);
- });
- }, y3.as = function(t3) {
- return this.$ms / h2[m2(t3)];
- }, y3.get = function(t3) {
- var s3 = this.$ms, n3 = m2(t3);
- return "milliseconds" === n3 ? s3 %= 1e3 : s3 = "weeks" === n3 ? $2(s3 / h2[n3]) : this.$d[n3], s3 || 0;
- }, y3.add = function(t3, s3, n3) {
- var i3;
- return i3 = s3 ? t3 * h2[m2(s3)] : c2(t3) ? t3.$ms : f2(t3, this).$ms, f2(this.$ms + i3 * (n3 ? -1 : 1), this);
- }, y3.subtract = function(t3, s3) {
- return this.add(t3, s3, true);
- }, y3.locale = function(t3) {
- var s3 = this.clone();
- return s3.$l = t3, s3;
- }, y3.clone = function() {
- return f2(this.$ms, this);
- }, y3.humanize = function(s3) {
- return t2().add(this.$ms, "ms").locale(this.$l).fromNow(!s3);
- }, y3.valueOf = function() {
- return this.asMilliseconds();
- }, y3.milliseconds = function() {
- return this.get("milliseconds");
- }, y3.asMilliseconds = function() {
- return this.as("milliseconds");
- }, y3.seconds = function() {
- return this.get("seconds");
- }, y3.asSeconds = function() {
- return this.as("seconds");
- }, y3.minutes = function() {
- return this.get("minutes");
- }, y3.asMinutes = function() {
- return this.as("minutes");
- }, y3.hours = function() {
- return this.get("hours");
- }, y3.asHours = function() {
- return this.as("hours");
- }, y3.days = function() {
- return this.get("days");
- }, y3.asDays = function() {
- return this.as("days");
- }, y3.weeks = function() {
- return this.get("weeks");
- }, y3.asWeeks = function() {
- return this.as("weeks");
- }, y3.months = function() {
- return this.get("months");
- }, y3.asMonths = function() {
- return this.as("months");
- }, y3.years = function() {
- return this.get("years");
- }, y3.asYears = function() {
- return this.as("years");
- }, l3;
- }(), p2 = function(t3, s3, n3) {
- 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");
- };
- return function(n3, i3, e3) {
- t2 = e3, s2 = e3().$utils(), e3.duration = function(t3, s3) {
- var n4 = e3.locale();
- return f2(t3, { $l: n4 }, s3);
- }, e3.isDuration = c2;
- var r3 = i3.prototype.add, o3 = i3.prototype.subtract;
- i3.prototype.add = function(t3, s3) {
- return c2(t3) ? p2(this, t3, 1) : r3.bind(this)(t3, s3);
- }, i3.prototype.subtract = function(t3, s3) {
- return c2(t3) ? p2(this, t3, -1) : o3.bind(this)(t3, s3);
- };
- };
- });
- })(duration$1);
- var durationExports = duration$1.exports;
- const duration = /* @__PURE__ */ getDefaultExportFromCjs(durationExports);
- var zhCn = { exports: {} };
- (function(module2, exports2) {
- !function(e2, _2) {
- module2.exports = _2(dayjs_minExports);
- }(commonjsGlobal, function(e2) {
- function _2(e3) {
- return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
- }
- 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) {
- return "W" === _3 ? e3 + "周" : e3 + "日";
- }, 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) {
- var t3 = 100 * e3 + _3;
- return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
- } };
- return t2.default.locale(d2, null, true), d2;
- });
- })(zhCn);
- var qsCanvas = { exports: {} };
- (function(module2) {
- (function() {
- var _nc;
- const platform = getPlatform(), isUni = platform == "uni", isNode = platform == "node", isWeb = platform == "web", imgCache = {}, vmCache = {}, asyncDrawWhiteList = Object.freeze([
- "init",
- "initAsyncDrawMode",
- "initArgs",
- "initCanvas",
- "handleCtx",
- "initData",
- "draw",
- "toImage",
- "updateCanvasWH",
- "clear",
- "restoreAsyncDrawMode"
- ]), calcMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "calcText",
- "calcImg",
- "measureText",
- "loadImage"
- ]), asyncDrawMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "drawText",
- "drawStraightLine",
- "drawDoubleStraightLine",
- "drawDotted",
- "drawDottedStraightLine",
- "drawLine",
- "drawTextDecoration",
- "drawImg",
- "drawQrCode",
- "setCircle",
- "setRect"
- ]), allSelfMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "drawText",
- "drawStraightLine",
- "drawDoubleStraightLine",
- "drawDotted",
- "drawDottedStraightLine",
- "drawLine",
- "drawTextDecoration",
- "drawImg",
- "drawQrCode",
- "setCircle",
- "setRect",
- "calcText",
- "calcImg",
- "measureText",
- "loadImage",
- "drawArray",
- "drawItem"
- ]), needReturnMethods = Object.freeze(["drawText", "drawImg"]), commonMethods = Object.freeze([
- "drawImage",
- "putImageData",
- "getImageData",
- "createImageData",
- "addPage",
- "save",
- "restore",
- "rotate",
- "translate",
- "transform",
- "getTransform",
- "resetTransform",
- "setTransform",
- "isPointInPath",
- "scale",
- "clip",
- "fill",
- "stroke",
- "fillText",
- "strokeText",
- "fillRect",
- "strokeRect",
- "clearRect",
- "rect",
- "measureText",
- "moveTo",
- "lineTo",
- "bezierCurveTo",
- "quadraticCurveTo",
- "beginPath",
- "closePath",
- "arc",
- "arcTo",
- "ellipse",
- "setLineDash",
- "getLineDash",
- "createPattern",
- "createLinearGradient",
- "createRadialGradient"
- ]);
- let nodeCanvas, id = 1;
- function notUnd(t2) {
- return String(t2) != "undefined";
- }
- function isNull(a2) {
- return !((a2 || a2 == 0) && !["undefined", "null"].includes(String(a2)));
- }
- function getPlatform() {
- if (notUnd(typeof index$1))
- return "uni";
- if (notUnd(typeof window) && notUnd(typeof document))
- return "web";
- return "node";
- }
- function getCtx(vm, args) {
- if (isUni) {
- if (!args.canvasId) {
- throw new Error("canvasId 不能为空");
- }
- }
- let canvas, obj = {};
- switch (platform) {
- case "uni":
- canvas = index$1.createCanvasContext(args.canvasId, vm);
- obj.canvas = canvas;
- obj.ctx = canvas;
- break;
- case "web":
- canvas = (args == null ? void 0 : args.canvasId) ? document.getElementById(args == null ? void 0 : args.canvasId) : document.createElement("canvas");
- canvas.width = (args == null ? void 0 : args.width) || 10;
- canvas.height = (args == null ? void 0 : args.height) || 10;
- obj.canvas = canvas;
- obj.ctx = canvas.getContext("2d");
- break;
- case "node":
- canvas = nodeCanvas.createCanvas((args == null ? void 0 : args.width) || 10, (args == null ? void 0 : args.height) || 10);
- obj.canvas = canvas;
- obj.ctx = canvas.getContext("2d");
- break;
- }
- return obj;
- }
- const _QSCanvas = class {
- constructor(obj, vm) {
- __privateAdd(this, _nc, void 0);
- this._id = id++;
- vmCache[this._id] = vm;
- if (obj) {
- this.init(obj);
- }
- }
- init(obj = {}) {
- this.initArgs(obj).initData().initCanvas().handleCtx().resetPaintbrush();
- if (this._data.asyncDrawMode === true) {
- __privateSet(this, _nc, new _QSCanvas({ asyncDrawMode: false }));
- this.initAsyncDrawMode();
- }
- }
- initAsyncDrawMode() {
- if (isUni)
- return;
- const ctxMethods = this._data.ctxMethods;
- const arr = [.../* @__PURE__ */ new Set([...allSelfMethods, ...ctxMethods])];
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- this.handleAsyncDrawModeItem(item);
- }
- }
- handleAsyncDrawModeItem(i2) {
- if (isUni)
- return;
- if (asyncDrawWhiteList.includes(i2)) {
- console.log("白名单跳过");
- return;
- }
- if (typeof this[i2] == "function") {
- if (!this._data.nMethods[i2])
- this._data.nMethods[i2] = this[i2];
- let _this = this;
- this[i2] = function() {
- let r2;
- if (calcMethods.includes(i2)) {
- r2 = __privateGet(_this, _nc)[i2](...arguments);
- }
- if (r2 && r2 !== _this && r2 !== __privateGet(_this, _nc))
- return r2;
- if (asyncDrawMethods.includes(i2) || _this._data.ctxMethods.includes(i2)) {
- _this._data.asyncDrawQueue.push({ method: i2, args: arguments });
- }
- if (needReturnMethods.includes(i2)) {
- return __privateGet(_this, _nc)[i2](...arguments);
- }
- };
- }
- }
- restoreAsyncDrawMode() {
- if (isUni)
- return;
- const nMethods = this._data.nMethods;
- for (const i2 in nMethods) {
- this[i2] = nMethods[i2];
- }
- }
- initArgs(obj = {}) {
- this._args = obj;
- return this;
- }
- initCanvas() {
- const canvasObj = getCtx(vmCache[this._id], this._args);
- this.canvas = canvasObj.canvas;
- this.ctx = canvasObj.ctx;
- return this;
- }
- /**
- * 使QSCanvas拥有原有方法
- */
- handleCtx() {
- const ctx = this.ctx;
- const active = (i2) => {
- this._data.ctxMethods.push(i2);
- this[i2] = ctx[i2].bind(ctx);
- return;
- };
- for (const i2 in ctx) {
- if (typeof ctx[i2] == "function") {
- if (!this[i2]) {
- active(i2);
- }
- }
- }
- for (let k = 0; k < commonMethods.length; k++) {
- const i2 = commonMethods[k];
- if (typeof ctx[i2] == "function") {
- if (!this[i2]) {
- active(i2);
- }
- }
- }
- return this;
- }
- initData() {
- this._data = {
- oldPaintbrushProps: {},
- savedPaintbrushProps: [],
- font: { fontStyle: "normal", fontVariant: "normal", fontWeight: "normal", fontSize: 10, fontFamily: "sans-serif" },
- height: this._args.height || 10,
- width: this._args.width || 10,
- whChange: false,
- asyncDrawQueue: [],
- nMethods: {},
- asyncDrawMode: isNode || isWeb ? this._args.asyncDrawMode !== false : false,
- ctxMethods: []
- };
- return this;
- }
- /**
- * 设置画笔
- */
- setPaintbrush(obj = {}) {
- filterPaintbrushProps(obj);
- for (const k in obj) {
- this.setPaintbrushProp(k, obj[k]);
- }
- return this;
- }
- /**
- * 设置画笔操作兼容uni
- */
- setPaintbrushProp(prop, data) {
- if (isNull(prop) || isNull(data))
- return;
- prop = hyphen2Hump(prop);
- const ctx = this.ctx;
- if (prop == "font") {
- if (data) {
- if (typeof data != "object") {
- console.warn("font属性需Object格式");
- return;
- }
- for (const k in data)
- if (isNull(data[k]))
- delete data[k];
- const font = { ...this._data.font, ...data };
- if (isUni)
- font.fontSize = Math.round(font.fontSize);
- this._data.font = font;
- const f2 = this._data.font;
- this._data.oldPaintbrushProps[prop] = f2;
- const setFont = () => {
- ctx.font = `${f2.fontStyle || "normal"} ${f2.fontVariant || "normal"} ${f2.fontWeight || "normal"} ${f2.fontSize ?? 10}px ${f2.fontFamily || "sans-serif"}`;
- };
- if (isUni) {
- setFont();
- } else
- setFont();
- }
- } else {
- this._data.oldPaintbrushProps[prop] = data;
- const fnn = "set" + prop[0].toUpperCase() + prop.slice(1);
- if (typeof (ctx == null ? void 0 : ctx[fnn]) == "function") {
- ctx[fnn](data);
- } else {
- ctx[prop] = data;
- }
- }
- return this;
- }
- /**
- * 重置画笔
- */
- resetPaintbrush(obj = {}) {
- this.setPaintbrush({
- fillStyle: "#000000",
- strokeStyle: "#000000",
- shadowColor: "#000000",
- shadowBlur: 0,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- lineCap: "butt",
- lineJoin: "miter",
- lineWidth: 1,
- miterLimit: 10,
- font: this._data.font,
- textAlign: "start",
- textBaseline: "top",
- globalAlpha: 1,
- globalCompositeOperation: "source-over",
- ...obj
- });
- return this;
- }
- saveAndSetPaintbrush(paintbrushProps = {}) {
- this.savePaintbrush();
- this.setPaintbrush(paintbrushProps);
- return this;
- }
- /**
- * 保存画笔设置
- */
- savePaintbrush() {
- this._data.savedPaintbrushProps.unshift({ ...this._data.oldPaintbrushProps });
- return this;
- }
- /**
- * 恢复上次保存的画笔设置
- */
- restorePaintbrush() {
- const savedProps = this._data.savedPaintbrushProps.shift();
- if (savedProps)
- this._data.oldPaintbrushProps = { ...this._data.oldPaintbrushProps, ...savedProps };
- this.resetPaintbrush({ ...this._data.oldPaintbrushProps });
- return this;
- }
- /**
- * 更新画布宽高
- */
- updateCanvasWH(obj = {}) {
- var _a2, _b2, _c;
- let { width, height, delay } = obj, setCanvasWH = (_a2 = this._args) == null ? void 0 : _a2.setCanvasWH;
- width = width || ((_b2 = this._data) == null ? void 0 : _b2.width) || 10;
- height = height || ((_c = this._data) == null ? void 0 : _c.height) || 10;
- return new Promise((rs2, rj) => {
- if (isUni) {
- if (!setCanvasWH || typeof setCanvasWH != "function") {
- rj("setCanvasWH异常, uni-app 请在初始化时传入setCanvasWH函数");
- return;
- }
- setCanvasWH({ height, width });
- setTimeout(() => {
- rs2();
- }, delay ?? 50);
- } else {
- this.canvas.height = height;
- this.canvas.width = width;
- rs2();
- }
- }).then((r2) => {
- if (this._data.width != width || this._data.height != height) {
- this._data.whChange = true;
- }
- this._data.width = width;
- this._data.height = height;
- if (!this._data.asyncDrawMode)
- this.resetPaintbrush(this._data.oldPaintbrushProps);
- });
- }
- /**
- * 清除画布内容
- */
- clear() {
- this.ctx.clearRect(0, 0, this._data.width || 999999, this._data.height || 999999);
- return this;
- }
- /**
- * 兼容uni draw
- */
- draw(obj = {}) {
- const { reserve } = obj;
- return new Promise((rs2, rj) => {
- if (isUni) {
- let done = false;
- const settimeoutkey = setTimeout(() => {
- if (!done) {
- rs2();
- } else {
- clearTimeout(settimeoutkey);
- }
- }, 3e3);
- this.ctx.draw(reserve ?? false, () => {
- done = true;
- clearTimeout(settimeoutkey);
- rs2();
- });
- } else {
- if (this._data.asyncDrawMode) {
- if (reserve !== true)
- this.clear();
- this.restoreAsyncDrawMode();
- this.resetPaintbrush();
- const arr = this._data.asyncDrawQueue;
- new Promise(async (resolve2, reject) => {
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- try {
- const r2 = this[item.method].call(this, ...item.args);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- await r2;
- } catch (error) {
- reject(error);
- return;
- }
- }
- resolve2();
- }).then(() => {
- this._data.asyncDrawQueue = [];
- this.initAsyncDrawMode();
- rs2();
- }).catch((err) => {
- this.initAsyncDrawMode();
- rj(err);
- });
- } else {
- rs2();
- }
- }
- });
- }
- /**
- * canvas2image
- */
- toImage(obj = {}) {
- return new Promise((rs2, rj) => {
- if (isUni) {
- const canvasId = this._args.canvasId;
- if (!canvasId) {
- rj("canvasId不存在");
- return;
- }
- index$1.canvasToTempFilePath({
- ...obj,
- canvasId,
- success: (r2) => {
- var _a2;
- (_a2 = obj.success) == null ? void 0 : _a2.call(obj, r2);
- rs2(r2.tempFilePath);
- },
- fail: (err) => {
- var _a2;
- (_a2 = obj.fail) == null ? void 0 : _a2.call(obj, err);
- rj(err);
- }
- }, vmCache[this._id]);
- } else {
- rs2(this.canvas.toDataURL(`image/${["jpg", "jpeg"].includes(obj.fileType) ? "jpeg" : "png"}`, obj.quality ?? 1));
- }
- });
- }
- /**
- * 计算文字多行
- */
- calcText(obj = {}) {
- const line = obj.line || -1;
- return new Promise((rs2, rj) => {
- try {
- let run = function(text, endLine) {
- let endLineWidth = 0;
- const textWidth = mt2(text).width;
- if (endLine) {
- if (textWidth < obj.maxWidth || text.length < 2) {
- return { index: text.length, ellipsis: false, width: textWidth };
- } else {
- endLineWidth = mt2("...").width;
- }
- }
- const textWidthEndLineWidth = textWidth + endLineWidth;
- if (textWidthEndLineWidth < obj.maxWidth || text.length < 2) {
- return { index: text.length, ellipsis: false, width: textWidthEndLineWidth };
- }
- let loop = true, mid = Math.floor((text.length + 1) / 2), oldMid = 1, mode = "", tw;
- while (loop) {
- if (mid <= 1) {
- loop = false;
- break;
- }
- if (mid > text.length) {
- mid = text.length;
- loop = false;
- break;
- }
- const t2 = text.substr(0, mid);
- tw = mt2(t2).width + endLineWidth;
- if (tw > obj.maxWidth) {
- text = t2;
- if (mode == "xy" && Math.abs(oldMid - mid) < 1) {
- loop = false;
- } else {
- mode = "dy";
- oldMid = mid;
- mid = Math.floor((t2.length + 1) / 2);
- }
- } else if (tw == obj.maxWidth) {
- loop = false;
- } else {
- if (mid <= 1 || Math.abs(oldMid - mid) < 1) {
- loop = false;
- } else {
- mode = "xy";
- oldMid = mid;
- mid += Math.floor((text.length - mid) / 2);
- }
- }
- }
- return { index: mid, ellipsis: endLine, width: tw };
- };
- this.saveAndSetPaintbrush({
- ...obj.paintbrushProps || {}
- });
- const mt2 = this.measureText;
- let splitTexts = [], str = obj.val, width = 0;
- const font = { ...this._data.font };
- if (obj.maxWidth) {
- let i2 = 0;
- while (str.length) {
- const endLine = line > 0 && splitTexts.length + 1 >= line, { index: len, ellipsis, width: width2 } = run(str, endLine);
- const txt = str.substr(0, len);
- splitTexts.push({ ...obj, val: txt, y: i2 ? obj.y + (font.fontSize + (obj.lineHeight || 0)) * i2 : obj.y, width: width2 });
- if (endLine) {
- if (ellipsis)
- splitTexts[splitTexts.length - 1].val += "...";
- str = "";
- } else
- str = str.slice(len);
- i2++;
- }
- width = splitTexts.length == 1 ? splitTexts[0].width : splitTexts.length > 1 ? obj.maxWidth : 0;
- } else {
- splitTexts = [obj];
- width = mt2(obj.val).width;
- }
- this.restorePaintbrush();
- rs2({
- ...obj,
- calcTexts: splitTexts,
- _calc: true,
- left: obj.x,
- top: obj.y,
- right: obj.x + width,
- bottom: splitTexts[splitTexts.length - 1].y + font.fontSize,
- width,
- height: splitTexts[splitTexts.length - 1].y + font.fontSize - obj.y,
- fontSize: font.fontSize
- });
- } catch (error) {
- rj(error);
- }
- });
- }
- /* 绘制 */
- /**
- * 绘制文本
- */
- drawText(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- console.warn(`需绘制的文本为空`);
- rs2();
- return;
- }
- this.saveAndSetPaintbrush({
- ...obj.paintbrushProps || {}
- });
- const ft2 = (obj2) => {
- this.fillText(obj2.val, obj2.x, obj2.y);
- }, ftItem = (item) => {
- ft2(item);
- if (item.textDecoration)
- this.drawTextDecoration(item);
- };
- const calcR = obj._calc ? obj : await this.calcText(obj);
- for (let i2 = 0; i2 < calcR.calcTexts.length; i2++) {
- ftItem(calcR.calcTexts[i2]);
- }
- this.restorePaintbrush();
- rs2(calcR);
- } catch (error) {
- rj(error);
- }
- });
- }
- drawStraightLine(obj = {}) {
- const { x1, y1, x2, y2, paintbrushProps } = obj, ctx = this.ctx;
- ctx.beginPath();
- ctx.moveTo(x1, y1);
- ctx.lineTo(x2, y2);
- this.saveAndSetPaintbrush(paintbrushProps || {});
- ctx.stroke();
- this.restorePaintbrush();
- }
- drawDoubleStraightLine(obj = {}) {
- let { gap } = obj;
- gap = gap ?? 1;
- this.drawStraightLine(obj);
- this.drawStraightLine({ ...obj, y1: obj.y1 + gap, y2: obj.y2 + gap });
- }
- drawDotted(obj = {}) {
- this.setCircle(obj);
- if (obj.clip)
- obj.clip = false;
- this.saveAndSetPaintbrush(obj.paintbrushProps || {});
- this.ctx.fill();
- this.restorePaintbrush();
- }
- drawDottedStraightLine(obj = {}) {
- let { x1, x2, y1, y2, gap, width, paintbrushProps } = obj;
- x2 = x2 - width;
- gap = gap || 1;
- const len = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
- const points = getPoints(x1, y1, x2, y2, Math.floor((len - gap) / (width + gap)), 9999999999);
- this.saveAndSetPaintbrush(paintbrushProps);
- this.drawDotted({ x: x1, y: y1, d: width });
- for (let i2 = 0; i2 < points.length; i2++)
- this.drawDotted({ x: points[i2][0], y: points[i2][1], d: width });
- this.drawDotted({ x: x2, y: y2, d: width });
- this.restorePaintbrush();
- }
- drawLine(obj = {}) {
- const { style } = obj;
- switch (style) {
- case "double":
- obj.gap = (obj.width || 1) * 1.5;
- this.drawDoubleStraightLine(obj);
- break;
- case "solide":
- this.drawStraightLine(obj);
- break;
- case "dotted":
- obj.gap = (obj.gap || 1) * 1.5;
- obj.paintbrushProps = { fillStyle: obj.color };
- this.drawDottedStraightLine(obj);
- break;
- }
- }
- /**
- * {
- ...(drawText属性),
- textDecoration: {
- line, //类型 同css text-decoration-line
- color, //线颜色
- width, //线宽度
- * }
- * }
- */
- drawTextDecoration(obj = {}) {
- this.savePaintbrush();
- 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;
- this.setPaintbrush({ lineWidth: width, strokeStyle: color });
- let y2 = 0;
- switch (line) {
- case "line-through":
- y2 = obj.y + fontSize / 2 - width / 2;
- break;
- case "underline":
- y2 = obj.y + fontSize;
- break;
- case "overline":
- y2 = obj.y;
- break;
- }
- switch (oldProps.textBaseline) {
- case "top":
- y2 += width / 2;
- break;
- case "bottom":
- y2 -= fontSize;
- break;
- case "center":
- y2 -= fontSize / 2;
- break;
- }
- y2 += offset;
- switch (line) {
- case "line-through":
- case "underline":
- case "overline":
- this.drawLine({ x1: obj.x, y1: y2, x2: obj.x + tw, y2, style, gap, width, color });
- break;
- }
- this.restorePaintbrush();
- }
- /**
- * 绘制图片
- */
- drawImg(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- console.warn(`需绘制的图片为空`);
- rs2();
- return;
- }
- const calcR = obj._calc ? obj : await this.calcImg(obj);
- if ((calcR == null ? void 0 : calcR.drawImageArgs) && Array.isArray(calcR.drawImageArgs))
- this.ctx.drawImage(...(calcR == null ? void 0 : calcR.drawImageArgs) || []);
- rs2(calcR);
- } catch (error) {
- rj(error);
- }
- });
- }
- calcImg(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- console.warn(`需绘制的图片为空`);
- rs2();
- return;
- }
- const img = await this.loadImage(obj.val), mode = obj.mode || "scaleToFill";
- 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;
- const get_6 = () => {
- if (isUni) {
- }
- return [sx, sy, sw, sh, x, y2, w2, h2];
- };
- switch (mode) {
- case "aspectFit":
- h2 = img.height / img.width * w2;
- if (h2 < obj.height) {
- y2 = Number(obj.y) + obj.height / 2 - h2 / 2;
- } else {
- h2 = obj.height;
- w2 = img.width / img.height * h2;
- x = Number(obj.x) + obj.width / 2 - w2 / 2;
- }
- arr = get_6();
- break;
- case "aspectFill":
- h2 = img.height / img.width * w2;
- if (h2 < obj.height) {
- h2 = obj.height;
- sx = img.width / img.height * obj.height;
- sx = (sx - obj.width) / sx * img.width / 2;
- sw = img.width - sx * 2;
- } else {
- sy = (h2 - obj.height) / h2 * img.height / 2;
- sh = img.height - sy * 2;
- }
- w2 = obj.width;
- h2 = obj.height;
- arr = get_6();
- break;
- case "widthFix":
- h2 = obj.height = img.height / img.width * obj.width;
- arr = [x, y2, w2, h2];
- break;
- case "heightFix":
- w2 = obj.width = img.width / img.height * obj.height;
- arr = [x, y2, w2, h2];
- break;
- default:
- arr = [x, y2, w2, h2];
- }
- arr.unshift(isUni ? img.toString() : img);
- rs2({ ...obj, drawImageArgs: [...arr], img, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.height, _calc: true });
- } catch (error) {
- rj(error);
- }
- });
- }
- /**
- * 绘制二维码
- * 诗小柒 的二维码生成器代码
- */
- drawQrCode(obj = {}) {
- return new Promise((rs2, rj) => {
- if (!(obj == null ? void 0 : obj.val)) {
- console.warn("绘制二维码val为空");
- rs2();
- return;
- }
- this.savePaintbrush();
- let qrcodeAlgObjCache = [];
- let options = {
- text: String(obj.val || "") || "",
- // 生成内容
- size: Number(obj.size || 0) || 200,
- // 二维码大小
- background: String(obj.background || "") || "#ffffff",
- // 背景色
- foreground: String(obj.foreground || "") || "#000000",
- // 前景色
- pdground: String(obj.pdground || "") || "#000000",
- // 定位角点颜色
- correctLevel: Number(obj.correctLevel || 0) || 3,
- // 容错级别
- dx: Number(obj.x || 0) || 0,
- // x轴距离
- dy: Number(obj.y || 0) || 0
- // y轴距离
- };
- let qrCodeAlg = null;
- let d2 = 0;
- for (var i2 = 0, l2 = qrcodeAlgObjCache.length; i2 < l2; i2++) {
- d2 = i2;
- if (qrcodeAlgObjCache[i2].text == options.text && qrcodeAlgObjCache[i2].text.correctLevel == options.correctLevel) {
- qrCodeAlg = qrcodeAlgObjCache[i2].obj;
- break;
- }
- }
- if (d2 == l2) {
- qrCodeAlg = new QRCodeAlg(options.text, options.correctLevel);
- qrcodeAlgObjCache.push({
- text: options.text,
- correctLevel: options.correctLevel,
- obj: qrCodeAlg
- });
- }
- let getForeGround = function(config) {
- let options2 = config.options;
- 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)) {
- return options2.pdground;
- }
- return options2.foreground;
- };
- let count = qrCodeAlg.getModuleCount();
- let ratioSize = options.size;
- let tileW = ratioSize / count;
- let tileH = ratioSize / count;
- for (let row = 0; row < count; row++) {
- for (let col = 0; col < count; col++) {
- let w2 = (col + 1) * tileW - col * tileW;
- let h2 = (row + 1) * tileW - row * tileW;
- let foreground = getForeGround({
- row,
- col,
- count,
- options
- });
- this.setPaintbrush({ fillStyle: qrCodeAlg.modules[row][col] ? foreground : options.background });
- this.ctx.fillRect(options.dx + col * tileW, options.dy + row * tileH, w2, h2);
- }
- }
- this.restorePaintbrush();
- rs2({ ...obj, height: obj.size, width: obj.size, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.size });
- });
- }
- /**
- * 圆形
- */
- setCircle(obj = {}) {
- const ctx = this.ctx;
- let { x, y: y2, d: d2, mode } = obj;
- mode = mode || "leftTop";
- const r2 = d2 / 2;
- if (obj.clip)
- ctx.save();
- ctx.beginPath();
- switch (mode) {
- case "leftTop":
- ctx.arc(x + r2, y2 + r2, r2, 0, 2 * Math.PI);
- break;
- case "center":
- ctx.arc(x, y2, r2, 0, 2 * Math.PI);
- break;
- }
- ctx.closePath();
- if (obj.clip)
- ctx.clip();
- return this;
- }
- /**
- * 矩形
- */
- setRect(obj = {}) {
- const ctx = this.ctx;
- const { x, y: y2, r: r2, height, width } = obj;
- if (obj.clip)
- ctx.save();
- ctx.beginPath();
- if (r2 && r2 > 0) {
- ctx.arc(x + r2, y2 + r2, r2, 1 * Math.PI, 1.5 * Math.PI);
- ctx.lineTo(x + width - r2, y2);
- ctx.arc(x + width - r2, y2 + r2, r2, 1.5 * Math.PI, 0);
- ctx.lineTo(x + width, y2 + height - r2);
- ctx.arc(x + width - r2, y2 + height - r2, r2, 0, 0.5 * Math.PI);
- ctx.lineTo(x + r2, y2 + height);
- ctx.arc(x + r2, y2 + height - r2, r2, 0.5 * Math.PI, 1 * Math.PI);
- ctx.lineTo(x, y2 + r2);
- } else {
- ctx.moveTo(x, y2);
- ctx.lineTo(x + width, y2);
- ctx.lineTo(x + width, y2 + height);
- ctx.lineTo(x, y2 + height);
- ctx.lineTo(x, y2);
- }
- ctx.closePath();
- if (obj.clip)
- ctx.clip();
- return this;
- }
- /**
- * 加载图片
- */
- loadImage(url) {
- return new Promise(async (resolve2, reject) => {
- if (!url) {
- console.warn("加载图片url为空");
- resolve2();
- return;
- }
- if (imgCache[url]) {
- resolve2(imgCache[url]);
- return;
- }
- let img;
- try {
- switch (platform) {
- case "uni":
- img = await new Promise((rs2, rj) => {
- if (url._loaded) {
- rs2(url);
- return;
- }
- if (~url.indexOf("data:image")) {
- let tempFilePath = url, imageInfoR = {};
- imgTools.base64ToPath(url).then((t2) => {
- tempFilePath = t2;
- index$1.getImageInfo({
- src: tempFilePath,
- success: (imgInfo) => {
- imageInfoR = imgInfo;
- const uniImg = new String(tempFilePath);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- }).catch((err) => {
- rj(err);
- });
- } else if (url.substr(0, 4) == "http") {
- index$1.downloadFile({
- url,
- success: ({ tempFilePath }) => {
- index$1.getImageInfo({
- src: tempFilePath,
- success: (imageInfoR) => {
- const uniImg = new String(tempFilePath);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- },
- fail: (error) => rj(error)
- });
- } else {
- index$1.getImageInfo({
- src: url,
- success: (imageInfoR) => {
- const uniImg = new String(url);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- }
- });
- break;
- case "web":
- img = await new Promise((rs2, rj) => {
- if (typeof url != "string") {
- rs2(url);
- return;
- }
- const imgObj = new Image();
- imgObj.onload = () => {
- rs2(imgObj);
- };
- imgObj.onerror = (err) => {
- rj(err);
- };
- imgObj.src = url;
- });
- break;
- case "node":
- img = await new Promise((rs2, rj) => {
- if (typeof url != "string") {
- rs2(url);
- return;
- }
- nodeCanvas.loadImage(url).then((res) => {
- rs2(res);
- }).catch((err) => {
- rj(err);
- });
- });
- break;
- }
- } catch (error) {
- reject(error);
- }
- imgCache[url] = img;
- resolve2(img);
- });
- }
- drawArray(data) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!data) {
- rj("drawArray需绘制参数不存在");
- return;
- }
- if (!Array.isArray(data)) {
- rj("drawArray参数需要是Array");
- return;
- }
- data = [...data].sort((a2, b2) => ((a2 == null ? void 0 : a2.zIndex) ?? 0) - ((b2 == null ? void 0 : b2.zIndex) ?? 0));
- const arr = [];
- for (let i2 = 0; i2 < data.length; i2++) {
- const item = data[i2];
- let r2;
- switch (typeof item) {
- case "function":
- r2 = item();
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- case "object":
- if (Array.isArray(item))
- r2 = await this.drawArray(item);
- else
- r2 = await this.drawItem(item);
- break;
- }
- arr.push({ item, result: r2 });
- }
- rs2(arr);
- } catch (error) {
- rj(error);
- }
- });
- }
- drawItem(obj = {}) {
- return new Promise(async (rs2, rj) => {
- var _a2, _b2;
- try {
- let r2;
- switch (obj.type) {
- case "text":
- r2 = await this.drawText(obj);
- break;
- case "image":
- r2 = await this.drawImg(obj);
- break;
- case "qrcode":
- r2 = await this.drawQrCode(obj);
- break;
- case "method":
- r2 = (_a2 = this[obj.name]) == null ? void 0 : _a2.call(this, ...obj.data ? Array.isArray(obj.data) ? obj.data : [obj.data] : []);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- case "function":
- r2 = (_b2 = obj.val) == null ? void 0 : _b2.call(obj);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- }
- rs2(r2);
- } catch (error) {
- rj(error);
- }
- });
- }
- drawRichText(html) {
- return new Promise(async (rs2, rj) => {
- if (!html) {
- rj("drawRichText需绘制参数不存在");
- return;
- }
- if (typeof html == "string")
- html = htmlParse(html);
- const result2 = [];
- function run(arr, parent) {
- return new Promise(async (res, rej) => {
- var _a2;
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- if (item.type == "text")
- ;
- else {
- switch (item.name) {
- }
- }
- result2.push(item);
- if ((_a2 = item.children) == null ? void 0 : _a2.length) {
- item.__handle = function(obj) {
- };
- try {
- await run(item.children, item);
- } catch (error) {
- rej(error);
- return;
- }
- }
- }
- res(result2);
- });
- }
- try {
- rs2({ html, htmlParses: await run(html) });
- } catch (error) {
- rj(error);
- }
- });
- }
- };
- let QSCanvas2 = _QSCanvas;
- _nc = new WeakMap();
- function filterPaintbrushProps(obj) {
- switch (obj == null ? void 0 : obj.textBaseline) {
- case "normal":
- if (isUni)
- obj.textBaseline = "alphabetic";
- break;
- case "hanging":
- if (isUni)
- obj.textBaseline = "top";
- break;
- case "ideographic":
- if (isUni)
- obj.textBaseline = "bottom";
- break;
- }
- switch (obj == null ? void 0 : obj.textAlign) {
- case "start":
- obj.textAlign = "left";
- break;
- case "end":
- obj.textAlign = "right";
- break;
- }
- }
- function hyphen2Hump(s2) {
- if (!s2)
- return "";
- const arr = s2.split("-");
- for (var i2 = 1; i2 < arr.length; i2++) {
- arr[i2] = arr[i2].charAt(0).toUpperCase() + arr[i2].substring(1);
- }
- return arr.join("");
- }
- function getPoints(x1, y1, x2, y2, pointCount, level) {
- let a2, b2, rSquare, k, kv, points = [];
- if (x1 === x2) {
- a2 = x1 + (y2 - y1) * level;
- b2 = y1 + (y2 - y1) / 2;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- } else if (y1 === y2) {
- a2 = x1 + (x2 - x1) / 2;
- b2 = y1 - (x2 - x1) * level;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- } else {
- let xc = (x1 + x2) / 2, yc = (y1 + y2) / 2, lenSquare = ((x2 - x1) ** 2 + (y2 - y1) ** 2) * level ** 2;
- k = (x2 - x1) / (y1 - y2);
- let l2 = yc - k * xc;
- let a1 = 1 + k ** 2, b1 = 2 * k * (l2 - yc) - 2 * xc, c1 = xc ** 2 + (l2 - yc) ** 2 - lenSquare;
- kv = -1 / k;
- a2 = (-b1 + Math.sqrt(b1 ** 2 - 4 * a1 * c1) * (kv > 0 && x2 > x1 || kv < 0 && x2 < x1 ? 1 : -1)) / (2 * a1);
- b2 = k * a2 + l2;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- }
- if (x1 === x2 || Math.abs(kv) > 1) {
- let yDistance = y2 - y1;
- let yDis = yDistance / (pointCount + 1);
- for (let i2 = 0; i2 < pointCount; i2++) {
- let y3 = y1 + yDis * (i2 + 1);
- let x = Math.sqrt(rSquare - (y3 - b2) ** 2) * (y2 > y1 ? -1 : 1) + a2;
- points.push([x, y3]);
- }
- } else {
- let xDistance = x2 - x1;
- let xDis = xDistance / (pointCount + 1);
- for (let i2 = 0; i2 < pointCount; i2++) {
- let x = x1 + xDis * (i2 + 1);
- let y3 = Math.sqrt(rSquare - (x - a2) ** 2) * (x2 > x1 ? 1 : -1) + b2;
- points.push([x, y3]);
- }
- }
- return points;
- }
- var QRCodeAlg = function() {
- function unicodeFormat8(code) {
- var c0, c1, c2;
- if (code < 128) {
- return [code];
- } else if (code < 2048) {
- c0 = 192 + (code >> 6);
- c1 = 128 + (code & 63);
- return [c0, c1];
- } else {
- c0 = 224 + (code >> 12);
- c1 = 128 + (code >> 6 & 63);
- c2 = 128 + (code & 63);
- return [c0, c1, c2];
- }
- }
- function getUTF8Bytes(string) {
- var utf8codes = [];
- for (var i3 = 0; i3 < string.length; i3++) {
- var code = string.charCodeAt(i3);
- var utf8 = unicodeFormat8(code);
- for (var j2 = 0; j2 < utf8.length; j2++) {
- utf8codes.push(utf8[j2]);
- }
- }
- return utf8codes;
- }
- function QRCodeAlg2(data, errorCorrectLevel) {
- this.typeNumber = -1;
- this.errorCorrectLevel = errorCorrectLevel;
- this.modules = null;
- this.moduleCount = 0;
- this.dataCache = null;
- this.rsBlocks = null;
- this.totalDataCount = -1;
- this.data = data;
- this.utf8bytes = getUTF8Bytes(data);
- this.make();
- }
- QRCodeAlg2.prototype = { constructor: QRCodeAlg2, getModuleCount: function() {
- return this.moduleCount;
- }, make: function() {
- this.getRightType();
- this.dataCache = this.createData();
- this.createQrcode();
- }, makeImpl: function(maskPattern) {
- this.moduleCount = this.typeNumber * 4 + 17;
- this.modules = new Array(this.moduleCount);
- for (var row = 0; row < this.moduleCount; row++) {
- this.modules[row] = new Array(this.moduleCount);
- }
- this.setupPositionProbePattern(0, 0);
- this.setupPositionProbePattern(this.moduleCount - 7, 0);
- this.setupPositionProbePattern(0, this.moduleCount - 7);
- this.setupPositionAdjustPattern();
- this.setupTimingPattern();
- this.setupTypeInfo(true, maskPattern);
- if (this.typeNumber >= 7) {
- this.setupTypeNumber(true);
- }
- this.mapData(this.dataCache, maskPattern);
- }, setupPositionProbePattern: function(row, col) {
- for (var r2 = -1; r2 <= 7; r2++) {
- if (row + r2 <= -1 || this.moduleCount <= row + r2)
- continue;
- for (var c2 = -1; c2 <= 7; c2++) {
- if (col + c2 <= -1 || this.moduleCount <= col + c2)
- continue;
- 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) {
- this.modules[row + r2][col + c2] = true;
- } else {
- this.modules[row + r2][col + c2] = false;
- }
- }
- }
- }, createQrcode: function() {
- var minLostPoint = 0;
- var pattern = 0;
- var bestModules = null;
- for (var i3 = 0; i3 < 8; i3++) {
- this.makeImpl(i3);
- var lostPoint = QRUtil.getLostPoint(this);
- if (i3 == 0 || minLostPoint > lostPoint) {
- minLostPoint = lostPoint;
- pattern = i3;
- bestModules = this.modules;
- }
- }
- this.modules = bestModules;
- this.setupTypeInfo(false, pattern);
- if (this.typeNumber >= 7) {
- this.setupTypeNumber(false);
- }
- }, setupTimingPattern: function() {
- for (var r2 = 8; r2 < this.moduleCount - 8; r2++) {
- if (this.modules[r2][6] != null) {
- continue;
- }
- this.modules[r2][6] = r2 % 2 == 0;
- if (this.modules[6][r2] != null) {
- continue;
- }
- this.modules[6][r2] = r2 % 2 == 0;
- }
- }, setupPositionAdjustPattern: function() {
- var pos = QRUtil.getPatternPosition(this.typeNumber);
- for (var i3 = 0; i3 < pos.length; i3++) {
- for (var j2 = 0; j2 < pos.length; j2++) {
- var row = pos[i3];
- var col = pos[j2];
- if (this.modules[row][col] != null) {
- continue;
- }
- for (var r2 = -2; r2 <= 2; r2++) {
- for (var c2 = -2; c2 <= 2; c2++) {
- if (r2 == -2 || r2 == 2 || c2 == -2 || c2 == 2 || r2 == 0 && c2 == 0) {
- this.modules[row + r2][col + c2] = true;
- } else {
- this.modules[row + r2][col + c2] = false;
- }
- }
- }
- }
- }
- }, setupTypeNumber: function(test) {
- var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
- for (var i3 = 0; i3 < 18; i3++) {
- var mod = !test && (bits >> i3 & 1) == 1;
- this.modules[Math.floor(i3 / 3)][i3 % 3 + this.moduleCount - 8 - 3] = mod;
- this.modules[i3 % 3 + this.moduleCount - 8 - 3][Math.floor(i3 / 3)] = mod;
- }
- }, setupTypeInfo: function(test, maskPattern) {
- var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
- var bits = QRUtil.getBCHTypeInfo(data);
- for (var i3 = 0; i3 < 15; i3++) {
- var mod = !test && (bits >> i3 & 1) == 1;
- if (i3 < 6) {
- this.modules[i3][8] = mod;
- } else if (i3 < 8) {
- this.modules[i3 + 1][8] = mod;
- } else {
- this.modules[this.moduleCount - 15 + i3][8] = mod;
- }
- var mod = !test && (bits >> i3 & 1) == 1;
- if (i3 < 8) {
- this.modules[8][this.moduleCount - i3 - 1] = mod;
- } else if (i3 < 9) {
- this.modules[8][15 - i3 - 1 + 1] = mod;
- } else {
- this.modules[8][15 - i3 - 1] = mod;
- }
- }
- this.modules[this.moduleCount - 8][8] = !test;
- }, createData: function() {
- var buffer2 = new QRBitBuffer();
- var lengthBits = this.typeNumber > 9 ? 16 : 8;
- buffer2.put(4, 4);
- buffer2.put(this.utf8bytes.length, lengthBits);
- for (var i3 = 0, l2 = this.utf8bytes.length; i3 < l2; i3++) {
- buffer2.put(this.utf8bytes[i3], 8);
- }
- if (buffer2.length + 4 <= this.totalDataCount * 8) {
- buffer2.put(0, 4);
- }
- while (buffer2.length % 8 != 0) {
- buffer2.putBit(false);
- }
- while (true) {
- if (buffer2.length >= this.totalDataCount * 8) {
- break;
- }
- buffer2.put(QRCodeAlg2.PAD0, 8);
- if (buffer2.length >= this.totalDataCount * 8) {
- break;
- }
- buffer2.put(QRCodeAlg2.PAD1, 8);
- }
- return this.createBytes(buffer2);
- }, createBytes: function(buffer2) {
- var offset = 0;
- var maxDcCount = 0;
- var maxEcCount = 0;
- var length = this.rsBlock.length / 3;
- var rsBlocks = new Array();
- for (var i3 = 0; i3 < length; i3++) {
- var count = this.rsBlock[i3 * 3 + 0];
- var totalCount = this.rsBlock[i3 * 3 + 1];
- var dataCount = this.rsBlock[i3 * 3 + 2];
- for (var j2 = 0; j2 < count; j2++) {
- rsBlocks.push([dataCount, totalCount]);
- }
- }
- var dcdata = new Array(rsBlocks.length);
- var ecdata = new Array(rsBlocks.length);
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- var dcCount = rsBlocks[r2][0];
- var ecCount = rsBlocks[r2][1] - dcCount;
- maxDcCount = Math.max(maxDcCount, dcCount);
- maxEcCount = Math.max(maxEcCount, ecCount);
- dcdata[r2] = new Array(dcCount);
- for (var i3 = 0; i3 < dcdata[r2].length; i3++) {
- dcdata[r2][i3] = 255 & buffer2.buffer[i3 + offset];
- }
- offset += dcCount;
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
- var rawPoly = new QRPolynomial(dcdata[r2], rsPoly.getLength() - 1);
- var modPoly = rawPoly.mod(rsPoly);
- ecdata[r2] = new Array(rsPoly.getLength() - 1);
- for (var i3 = 0; i3 < ecdata[r2].length; i3++) {
- var modIndex = i3 + modPoly.getLength() - ecdata[r2].length;
- ecdata[r2][i3] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
- }
- }
- var data = new Array(this.totalDataCount);
- var index2 = 0;
- for (var i3 = 0; i3 < maxDcCount; i3++) {
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- if (i3 < dcdata[r2].length) {
- data[index2++] = dcdata[r2][i3];
- }
- }
- }
- for (var i3 = 0; i3 < maxEcCount; i3++) {
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- if (i3 < ecdata[r2].length) {
- data[index2++] = ecdata[r2][i3];
- }
- }
- }
- return data;
- }, mapData: function(data, maskPattern) {
- var inc = -1;
- var row = this.moduleCount - 1;
- var bitIndex = 7;
- var byteIndex = 0;
- for (var col = this.moduleCount - 1; col > 0; col -= 2) {
- if (col == 6)
- col--;
- while (true) {
- for (var c2 = 0; c2 < 2; c2++) {
- if (this.modules[row][col - c2] == null) {
- var dark = false;
- if (byteIndex < data.length) {
- dark = (data[byteIndex] >>> bitIndex & 1) == 1;
- }
- var mask = QRUtil.getMask(maskPattern, row, col - c2);
- if (mask) {
- dark = !dark;
- }
- this.modules[row][col - c2] = dark;
- bitIndex--;
- if (bitIndex == -1) {
- byteIndex++;
- bitIndex = 7;
- }
- }
- }
- row += inc;
- if (row < 0 || this.moduleCount <= row) {
- row -= inc;
- inc = -inc;
- break;
- }
- }
- }
- } };
- QRCodeAlg2.PAD0 = 236;
- QRCodeAlg2.PAD1 = 17;
- var QRErrorCorrectLevel = [1, 0, 3, 2];
- var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };
- 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) {
- var d2 = data << 10;
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
- d2 ^= QRUtil.G15 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15);
- }
- return (data << 10 | d2) ^ QRUtil.G15_MASK;
- }, getBCHTypeNumber: function(data) {
- var d2 = data << 12;
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
- d2 ^= QRUtil.G18 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18);
- }
- return data << 12 | d2;
- }, getBCHDigit: function(data) {
- var digit = 0;
- while (data != 0) {
- digit++;
- data >>>= 1;
- }
- return digit;
- }, getPatternPosition: function(typeNumber) {
- return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
- }, getMask: function(maskPattern, i3, j2) {
- switch (maskPattern) {
- case QRMaskPattern.PATTERN000:
- return (i3 + j2) % 2 == 0;
- case QRMaskPattern.PATTERN001:
- return i3 % 2 == 0;
- case QRMaskPattern.PATTERN010:
- return j2 % 3 == 0;
- case QRMaskPattern.PATTERN011:
- return (i3 + j2) % 3 == 0;
- case QRMaskPattern.PATTERN100:
- return (Math.floor(i3 / 2) + Math.floor(j2 / 3)) % 2 == 0;
- case QRMaskPattern.PATTERN101:
- return i3 * j2 % 2 + i3 * j2 % 3 == 0;
- case QRMaskPattern.PATTERN110:
- return (i3 * j2 % 2 + i3 * j2 % 3) % 2 == 0;
- case QRMaskPattern.PATTERN111:
- return (i3 * j2 % 3 + (i3 + j2) % 2) % 2 == 0;
- default:
- throw new Error("bad maskPattern:" + maskPattern);
- }
- }, getErrorCorrectPolynomial: function(errorCorrectLength) {
- var a2 = new QRPolynomial([1], 0);
- for (var i3 = 0; i3 < errorCorrectLength; i3++) {
- a2 = a2.multiply(new QRPolynomial([1, QRMath.gexp(i3)], 0));
- }
- return a2;
- }, getLostPoint: function(qrCode) {
- var moduleCount = qrCode.getModuleCount(), lostPoint = 0, darkCount = 0;
- for (var row = 0; row < moduleCount; row++) {
- var sameCount = 0;
- var head = qrCode.modules[row][0];
- for (var col = 0; col < moduleCount; col++) {
- var current = qrCode.modules[row][col];
- if (col < moduleCount - 6) {
- 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]) {
- if (col < moduleCount - 10) {
- if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
- lostPoint += 40;
- }
- } else if (col > 3) {
- if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
- lostPoint += 40;
- }
- }
- }
- }
- if (row < moduleCount - 1 && col < moduleCount - 1) {
- var count = 0;
- if (current)
- count++;
- if (qrCode.modules[row + 1][col])
- count++;
- if (qrCode.modules[row][col + 1])
- count++;
- if (qrCode.modules[row + 1][col + 1])
- count++;
- if (count == 0 || count == 4) {
- lostPoint += 3;
- }
- }
- if (head ^ current) {
- sameCount++;
- } else {
- head = current;
- if (sameCount >= 5) {
- lostPoint += 3 + sameCount - 5;
- }
- sameCount = 1;
- }
- if (current) {
- darkCount++;
- }
- }
- }
- for (var col = 0; col < moduleCount; col++) {
- var sameCount = 0;
- var head = qrCode.modules[0][col];
- for (var row = 0; row < moduleCount; row++) {
- var current = qrCode.modules[row][col];
- if (row < moduleCount - 6) {
- 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]) {
- if (row < moduleCount - 10) {
- if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
- lostPoint += 40;
- }
- } else if (row > 3) {
- if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
- lostPoint += 40;
- }
- }
- }
- }
- if (head ^ current) {
- sameCount++;
- } else {
- head = current;
- if (sameCount >= 5) {
- lostPoint += 3 + sameCount - 5;
- }
- sameCount = 1;
- }
- }
- }
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
- lostPoint += ratio * 10;
- return lostPoint;
- } };
- var QRMath = { glog: function(n2) {
- if (n2 < 1) {
- throw new Error("glog(" + n2 + ")");
- }
- return QRMath.LOG_TABLE[n2];
- }, gexp: function(n2) {
- while (n2 < 0) {
- n2 += 255;
- }
- while (n2 >= 256) {
- n2 -= 255;
- }
- return QRMath.EXP_TABLE[n2];
- }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256) };
- for (var i2 = 0; i2 < 8; i2++) {
- QRMath.EXP_TABLE[i2] = 1 << i2;
- }
- for (var i2 = 8; i2 < 256; i2++) {
- QRMath.EXP_TABLE[i2] = QRMath.EXP_TABLE[i2 - 4] ^ QRMath.EXP_TABLE[i2 - 5] ^ QRMath.EXP_TABLE[i2 - 6] ^ QRMath.EXP_TABLE[i2 - 8];
- }
- for (var i2 = 0; i2 < 255; i2++) {
- QRMath.LOG_TABLE[QRMath.EXP_TABLE[i2]] = i2;
- }
- function QRPolynomial(num, shift) {
- if (num.length == void 0) {
- throw new Error(num.length + "/" + shift);
- }
- var offset = 0;
- while (offset < num.length && num[offset] == 0) {
- offset++;
- }
- this.num = new Array(num.length - offset + shift);
- for (var i3 = 0; i3 < num.length - offset; i3++) {
- this.num[i3] = num[i3 + offset];
- }
- }
- QRPolynomial.prototype = { get: function(index2) {
- return this.num[index2];
- }, getLength: function() {
- return this.num.length;
- }, multiply: function(e2) {
- var num = new Array(this.getLength() + e2.getLength() - 1);
- for (var i3 = 0; i3 < this.getLength(); i3++) {
- for (var j2 = 0; j2 < e2.getLength(); j2++) {
- num[i3 + j2] ^= QRMath.gexp(QRMath.glog(this.get(i3)) + QRMath.glog(e2.get(j2)));
- }
- }
- return new QRPolynomial(num, 0);
- }, mod: function(e2) {
- var tl = this.getLength(), el = e2.getLength();
- if (tl - el < 0) {
- return this;
- }
- var num = new Array(tl);
- for (var i3 = 0; i3 < tl; i3++) {
- num[i3] = this.get(i3);
- }
- while (num.length >= el) {
- var ratio = QRMath.glog(num[0]) - QRMath.glog(e2.get(0));
- for (var i3 = 0; i3 < e2.getLength(); i3++) {
- num[i3] ^= QRMath.gexp(QRMath.glog(e2.get(i3)) + ratio);
- }
- while (num[0] == 0) {
- num.shift();
- }
- }
- return new QRPolynomial(num, 0);
- } };
- 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]];
- QRCodeAlg2.prototype.getRightType = function() {
- for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
- var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
- if (rsBlock == void 0) {
- throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
- }
- var length = rsBlock.length / 3;
- var totalDataCount = 0;
- for (var i3 = 0; i3 < length; i3++) {
- var count = rsBlock[i3 * 3 + 0];
- var dataCount = rsBlock[i3 * 3 + 2];
- totalDataCount += dataCount * count;
- }
- var lengthBytes = typeNumber > 9 ? 2 : 1;
- if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
- this.typeNumber = typeNumber;
- this.rsBlock = rsBlock;
- this.totalDataCount = totalDataCount;
- break;
- }
- }
- };
- function QRBitBuffer() {
- this.buffer = new Array();
- this.length = 0;
- }
- QRBitBuffer.prototype = { get: function(index2) {
- var bufIndex = Math.floor(index2 / 8);
- return this.buffer[bufIndex] >>> 7 - index2 % 8 & 1;
- }, put: function(num, length) {
- for (var i3 = 0; i3 < length; i3++) {
- this.putBit(num >>> length - i3 - 1 & 1);
- }
- }, putBit: function(bit) {
- var bufIndex = Math.floor(this.length / 8);
- if (this.buffer.length <= bufIndex) {
- this.buffer.push(0);
- }
- if (bit) {
- this.buffer[bufIndex] |= 128 >>> this.length % 8;
- }
- this.length++;
- } };
- return QRCodeAlg2;
- }();
- var htmlParse = function() {
- var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
- var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
- var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
- var empty = makeMap2("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
- 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");
- 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");
- var closeSelf = makeMap2("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
- var fillAttrs = makeMap2("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
- var special = makeMap2("script,style");
- function HTMLParser(html, handler) {
- var index2;
- var chars;
- var match;
- var stack2 = [];
- var last = html;
- stack2.last = function() {
- return this[this.length - 1];
- };
- while (html) {
- chars = true;
- if (!stack2.last() || !special[stack2.last()]) {
- if (html.indexOf("<!--") == 0) {
- index2 = html.indexOf("-->");
- if (index2 >= 0) {
- if (handler.comment) {
- handler.comment(html.substring(4, index2));
- }
- html = html.substring(index2 + 3);
- chars = false;
- }
- } else if (html.indexOf("</") == 0) {
- match = html.match(endTag);
- if (match) {
- html = html.substring(match[0].length);
- match[0].replace(endTag, parseEndTag);
- chars = false;
- }
- } else if (html.indexOf("<") == 0) {
- match = html.match(startTag);
- if (match) {
- html = html.substring(match[0].length);
- match[0].replace(startTag, parseStartTag);
- chars = false;
- }
- }
- if (chars) {
- index2 = html.indexOf("<");
- var text = index2 < 0 ? html : html.substring(0, index2);
- html = index2 < 0 ? "" : html.substring(index2);
- if (handler.chars) {
- handler.chars(text);
- }
- }
- } else {
- html = html.replace(new RegExp("([\\s\\S]*?)</" + stack2.last() + "[^>]*>"), function(all, text2) {
- text2 = text2.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
- if (handler.chars) {
- handler.chars(text2);
- }
- return "";
- });
- parseEndTag("", stack2.last());
- }
- if (html == last) {
- throw "Parse Error: " + html;
- }
- last = html;
- }
- parseEndTag();
- function parseStartTag(tag, tagName, rest, unary) {
- tagName = tagName.toLowerCase();
- if (block[tagName]) {
- while (stack2.last() && inline[stack2.last()]) {
- parseEndTag("", stack2.last());
- }
- }
- if (closeSelf[tagName] && stack2.last() == tagName) {
- parseEndTag("", tagName);
- }
- unary = empty[tagName] || !!unary;
- if (!unary) {
- stack2.push(tagName);
- }
- if (handler.start) {
- var attrs = [];
- rest.replace(attr, function(match2, name) {
- var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : "";
- attrs.push({ name, value, escaped: value.replace(/(^|[^\\])"/g, '$1\\"') });
- });
- if (handler.start) {
- handler.start(tagName, attrs, unary);
- }
- }
- }
- function parseEndTag(tag, tagName) {
- if (!tagName) {
- var pos = 0;
- } else {
- for (var pos = stack2.length - 1; pos >= 0; pos--) {
- if (stack2[pos] == tagName) {
- break;
- }
- }
- }
- if (pos >= 0) {
- for (var i2 = stack2.length - 1; i2 >= pos; i2--) {
- if (handler.end) {
- handler.end(stack2[i2]);
- }
- }
- stack2.length = pos;
- }
- }
- }
- function makeMap2(str) {
- var obj = {};
- var items = str.split(",");
- for (var i2 = 0; i2 < items.length; i2++) {
- obj[items[i2]] = true;
- }
- return obj;
- }
- function removeDOCTYPE(html) {
- return html.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*>\n/, "").replace(/<!DOCTYPE.*>\n/, "");
- }
- function parseAttrs(attrs) {
- return attrs.reduce(function(pre, attr2) {
- var value = attr2.value;
- var name = attr2.name;
- if (pre[name]) {
- pre[name] = pre[name] + " " + value;
- } else {
- pre[name] = value;
- }
- return pre;
- }, {});
- }
- function parseHtml(html) {
- html = removeDOCTYPE(html);
- var stacks = [];
- var results = { node: "root", children: [] };
- HTMLParser(html, { start: function start(tag, attrs, unary) {
- var node = { name: tag };
- if (attrs.length !== 0) {
- node.attrs = parseAttrs(attrs);
- }
- if (unary) {
- var parent = stacks[0] || results;
- if (!parent.children) {
- parent.children = [];
- }
- parent.children.push(node);
- } else {
- stacks.unshift(node);
- }
- }, end: function end(tag) {
- var node = stacks.shift();
- if (node.name !== tag)
- console.error("invalid state: mismatch end tag");
- if (stacks.length === 0) {
- results.children.push(node);
- } else {
- var parent = stacks[0];
- if (!parent.children) {
- parent.children = [];
- }
- parent.children.push(node);
- }
- }, chars: function chars(text) {
- var node = { type: "text", text };
- if (stacks.length === 0) {
- results.children.push(node);
- } else {
- var parent = stacks[0];
- if (!parent.children) {
- parent.children = [];
- }
- parent.children.push(node);
- }
- }, comment: function comment(text) {
- var node = { node: "comment", text };
- var parent = stacks[0];
- if (!parent.children) {
- parent.children = [];
- }
- parent.children.push(node);
- } });
- return results.children;
- }
- return parseHtml;
- }();
- var imgTools = function() {
- function getLocalFilePath(path) {
- if (path.indexOf("_www") === 0 || path.indexOf("_doc") === 0 || path.indexOf("_documents") === 0 || path.indexOf("_downloads") === 0) {
- return path;
- }
- if (path.indexOf("file://") === 0) {
- return path;
- }
- if (path.indexOf("/storage/emulated/0/") === 0) {
- return path;
- }
- if (path.indexOf("/") === 0) {
- var localFilePath = plus.io.convertAbsoluteFileSystem(path);
- if (localFilePath !== path) {
- return localFilePath;
- } else {
- path = path.substr(1);
- }
- }
- return "_www/" + path;
- }
- function dataUrlToBase64(str) {
- var array = str.split(",");
- return array[array.length - 1];
- }
- var index2 = 0;
- function getNewFileId() {
- return Date.now() + String(index2++);
- }
- function biggerThan(v1, v2) {
- var v1Array = v1.split(".");
- var v2Array = v2.split(".");
- var update = false;
- for (var index3 = 0; index3 < v2Array.length; index3++) {
- var diff2 = v1Array[index3] - v2Array[index3];
- if (diff2 !== 0) {
- update = diff2 > 0;
- break;
- }
- }
- return update;
- }
- function pathToBase64(path) {
- return new Promise(function(resolve2, reject) {
- if (typeof window === "object" && "document" in window) {
- if (typeof FileReader === "function") {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", path, true);
- xhr.responseType = "blob";
- xhr.onload = function() {
- if (this.status === 200) {
- let fileReader = new FileReader();
- fileReader.onload = function(e2) {
- resolve2(e2.target.result);
- };
- fileReader.onerror = reject;
- fileReader.readAsDataURL(this.response);
- }
- };
- xhr.onerror = reject;
- xhr.send();
- return;
- }
- var canvas = document.createElement("canvas");
- var c2x = canvas.getContext("2d");
- var img = new Image();
- img.onload = function() {
- canvas.width = img.width;
- canvas.height = img.height;
- c2x.drawImage(img, 0, 0);
- resolve2(canvas.toDataURL());
- canvas.height = canvas.width = 0;
- };
- img.onerror = reject;
- img.src = path;
- return;
- }
- if (typeof plus === "object") {
- plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
- entry.file(function(file) {
- var fileReader = new plus.io.FileReader();
- fileReader.onload = function(data) {
- resolve2(data.target.result);
- };
- fileReader.onerror = function(error) {
- reject(error);
- };
- fileReader.readAsDataURL(file);
- }, function(error) {
- reject(error);
- });
- }, function(error) {
- reject(error);
- });
- return;
- }
- if (typeof wx$1 === "object" && wx$1.canIUse("getFileSystemManager")) {
- wx$1.getFileSystemManager().readFile({
- filePath: path,
- encoding: "base64",
- success: function(res) {
- resolve2("data:image/png;base64," + res.data);
- },
- fail: function(error) {
- reject(error);
- }
- });
- return;
- }
- reject(new Error("not support"));
- });
- }
- function base64ToPath(base64) {
- return new Promise(function(resolve2, reject) {
- if (typeof window === "object" && "document" in window) {
- base64 = base64.split(",");
- var type = base64[0].match(/:(.*?);/)[1];
- var str = atob(base64[1]);
- var n2 = str.length;
- var array = new Uint8Array(n2);
- while (n2--) {
- array[n2] = str.charCodeAt(n2);
- }
- return resolve2((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type })));
- }
- var extName = base64.split(",")[0].match(/data\:\S+\/(\S+);/);
- if (extName) {
- extName = extName[1];
- } else {
- reject(new Error("base64 error"));
- }
- var fileName = getNewFileId() + "." + extName;
- if (typeof plus === "object") {
- var basePath = "_doc";
- var dirPath = "uniapp_temp";
- var filePath = basePath + "/" + dirPath + "/" + fileName;
- if (!biggerThan(plus.os.name === "Android" ? "1.9.9.80627" : "1.9.9.80472", plus.runtime.innerVersion)) {
- plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
- entry.getDirectory(dirPath, {
- create: true,
- exclusive: false
- }, function(entry2) {
- entry2.getFile(fileName, {
- create: true,
- exclusive: false
- }, function(entry3) {
- entry3.createWriter(function(writer) {
- writer.onwrite = function() {
- resolve2(filePath);
- };
- writer.onerror = reject;
- writer.seek(0);
- writer.writeAsBinary(dataUrlToBase64(base64));
- }, reject);
- }, reject);
- }, reject);
- }, reject);
- return;
- }
- var bitmap = new plus.nativeObj.Bitmap(fileName);
- bitmap.loadBase64Data(base64, function() {
- bitmap.save(filePath, {}, function() {
- bitmap.clear();
- resolve2(filePath);
- }, function(error) {
- bitmap.clear();
- reject(error);
- });
- }, function(error) {
- bitmap.clear();
- reject(error);
- });
- return;
- }
- function getEnvPath() {
- var _a2, _b2, _c, _d, _e2, _f;
- if (typeof my === "object" && ((_a2 = my == null ? void 0 : my.env) == null ? void 0 : _a2.USER_DATA_PATH)) {
- return my.env.USER_DATA_PATH;
- }
- if (typeof swan === "object" && ((_b2 = swan == null ? void 0 : swan.env) == null ? void 0 : _b2.USER_DATA_PATH)) {
- return swan.env.USER_DATA_PATH;
- }
- if (typeof tt === "object" && ((_c = tt == null ? void 0 : tt.env) == null ? void 0 : _c.USER_DATA_PATH)) {
- return tt.env.USER_DATA_PATH;
- }
- if (typeof qq === "object" && ((_d = qq == null ? void 0 : qq.env) == null ? void 0 : _d.USER_DATA_PATH)) {
- return qq.env.USER_DATA_PATH;
- }
- if (typeof qh === "object" && ((_e2 = qh == null ? void 0 : qh.env) == null ? void 0 : _e2.USER_DATA_PATH)) {
- return qh.env.USER_DATA_PATH;
- }
- if (typeof wx$1 === "object" && ((_f = wx$1 == null ? void 0 : wx$1.env) == null ? void 0 : _f.USER_DATA_PATH)) {
- return wx$1.env.USER_DATA_PATH;
- }
- return "https://user";
- }
- try {
- var filePath = getEnvPath() + "/" + fileName;
- index$1.getFileSystemManager().writeFile({
- filePath,
- data: dataUrlToBase64(base64),
- encoding: "base64",
- success: function() {
- resolve2(filePath);
- },
- fail: function(error) {
- reject(error);
- }
- });
- } catch (e2) {
- reject(new Error("not support"));
- }
- });
- }
- return { pathToBase64, base64ToPath };
- }();
- if (notUnd("object")) {
- module2.exports = QSCanvas2;
- }
- return QSCanvas2;
- })();
- })(qsCanvas);
- var qsCanvasExports = qsCanvas.exports;
- const QSCanvas = /* @__PURE__ */ getDefaultExportFromCjs(qsCanvasExports);
- var uniSocket_io = { exports: {} };
- (function(module2, exports2) {
- !function(t2, e2) {
- module2.exports = e2();
- }(window, function() {
- return function(t2) {
- var e2 = {};
- function r2(n2) {
- if (e2[n2])
- return e2[n2].exports;
- var o2 = e2[n2] = { i: n2, l: false, exports: {} };
- return t2[n2].call(o2.exports, o2, o2.exports, r2), o2.l = true, o2.exports;
- }
- return r2.m = t2, r2.c = e2, r2.d = function(t3, e3, n2) {
- r2.o(t3, e3) || Object.defineProperty(t3, e3, { enumerable: true, get: n2 });
- }, r2.r = function(t3) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true });
- }, r2.t = function(t3, e3) {
- if (1 & e3 && (t3 = r2(t3)), 8 & e3)
- return t3;
- if (4 & e3 && "object" == typeof t3 && t3 && t3.__esModule)
- return t3;
- var n2 = /* @__PURE__ */ Object.create(null);
- if (r2.r(n2), Object.defineProperty(n2, "default", { enumerable: true, value: t3 }), 2 & e3 && "string" != typeof t3)
- for (var o2 in t3)
- r2.d(n2, o2, function(e4) {
- return t3[e4];
- }.bind(null, o2));
- return n2;
- }, r2.n = function(t3) {
- var e3 = t3 && t3.__esModule ? function() {
- return t3.default;
- } : function() {
- return t3;
- };
- return r2.d(e3, "a", e3), e3;
- }, r2.o = function(t3, e3) {
- return Object.prototype.hasOwnProperty.call(t3, e3);
- }, r2.p = "", r2(r2.s = 22);
- }([function(t2, e2) {
- t2.exports = function() {
- return function() {
- };
- };
- }, function(t2, e2, r2) {
- function n2(t3) {
- if (t3)
- return function(t4) {
- for (var e3 in n2.prototype)
- t4[e3] = n2.prototype[e3];
- return t4;
- }(t3);
- }
- t2.exports = n2, n2.prototype.on = n2.prototype.addEventListener = function(t3, e3) {
- return this._callbacks = this._callbacks || {}, (this._callbacks["$" + t3] = this._callbacks["$" + t3] || []).push(e3), this;
- }, n2.prototype.once = function(t3, e3) {
- function r3() {
- this.off(t3, r3), e3.apply(this, arguments);
- }
- return r3.fn = e3, this.on(t3, r3), this;
- }, n2.prototype.off = n2.prototype.removeListener = n2.prototype.removeAllListeners = n2.prototype.removeEventListener = function(t3, e3) {
- if (this._callbacks = this._callbacks || {}, 0 == arguments.length)
- return this._callbacks = {}, this;
- var r3, n3 = this._callbacks["$" + t3];
- if (!n3)
- return this;
- if (1 == arguments.length)
- return delete this._callbacks["$" + t3], this;
- for (var o2 = 0; o2 < n3.length; o2++)
- if ((r3 = n3[o2]) === e3 || r3.fn === e3) {
- n3.splice(o2, 1);
- break;
- }
- return this;
- }, n2.prototype.emit = function(t3) {
- this._callbacks = this._callbacks || {};
- var e3 = [].slice.call(arguments, 1), r3 = this._callbacks["$" + t3];
- if (r3)
- for (var n3 = 0, o2 = (r3 = r3.slice(0)).length; n3 < o2; ++n3)
- r3[n3].apply(this, e3);
- return this;
- }, n2.prototype.listeners = function(t3) {
- return this._callbacks = this._callbacks || {}, this._callbacks["$" + t3] || [];
- }, n2.prototype.hasListeners = function(t3) {
- return !!this.listeners(t3).length;
- };
- }, function(t2, e2, r2) {
- var n2, o2 = r2(33), i2 = r2(16), s2 = r2(35), a2 = r2(36), c2 = r2(37);
- "undefined" != typeof ArrayBuffer && (n2 = r2(38));
- var h2 = "undefined" != typeof navigator && /Android/i.test(navigator.userAgent), u2 = "undefined" != typeof navigator && /PhantomJS/i.test(navigator.userAgent), f2 = h2 || u2;
- e2.protocol = 3;
- 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);
- function g2(t3, e3, r3) {
- for (var n3 = new Array(t3.length), o3 = a2(t3.length, r3), i3 = function(t4, r4, o4) {
- e3(r4, function(e4, r5) {
- n3[t4] = r5, o4(e4, n3);
- });
- }, s3 = 0; s3 < t3.length; s3++)
- i3(s3, t3[s3], o3);
- }
- e2.encodePacket = function(t3, r3, n3, o3) {
- "function" == typeof r3 && (o3 = r3, r3 = false), "function" == typeof n3 && (o3 = n3, n3 = null);
- var i3 = void 0 === t3.data ? void 0 : t3.data.buffer || t3.data;
- if ("undefined" != typeof ArrayBuffer && i3 instanceof ArrayBuffer)
- return function(t4, r4, n4) {
- if (!r4)
- return e2.encodeBase64Packet(t4, n4);
- var o4 = t4.data, i4 = new Uint8Array(o4), s4 = new Uint8Array(1 + o4.byteLength);
- s4[0] = p2[t4.type];
- for (var a3 = 0; a3 < i4.length; a3++)
- s4[a3 + 1] = i4[a3];
- return n4(s4.buffer);
- }(t3, r3, o3);
- if (void 0 !== y2 && i3 instanceof y2)
- return function(t4, r4, n4) {
- if (!r4)
- return e2.encodeBase64Packet(t4, n4);
- if (f2)
- return function(t5, r5, n5) {
- if (!r5)
- return e2.encodeBase64Packet(t5, n5);
- var o5 = new FileReader();
- return o5.onload = function() {
- e2.encodePacket({ type: t5.type, data: o5.result }, r5, true, n5);
- }, o5.readAsArrayBuffer(t5.data);
- }(t4, r4, n4);
- var o4 = new Uint8Array(1);
- o4[0] = p2[t4.type];
- var i4 = new y2([o4.buffer, t4.data]);
- return n4(i4);
- }(t3, r3, o3);
- if (i3 && i3.base64)
- return function(t4, r4) {
- var n4 = "b" + e2.packets[t4.type] + t4.data.data;
- return r4(n4);
- }(t3, o3);
- var s3 = p2[t3.type];
- return void 0 !== t3.data && (s3 += n3 ? c2.encode(String(t3.data), { strict: false }) : String(t3.data)), o3("" + s3);
- }, e2.encodeBase64Packet = function(t3, r3) {
- var n3, o3 = "b" + e2.packets[t3.type];
- if (void 0 !== y2 && t3.data instanceof y2) {
- var i3 = new FileReader();
- return i3.onload = function() {
- var t4 = i3.result.split(",")[1];
- r3(o3 + t4);
- }, i3.readAsDataURL(t3.data);
- }
- try {
- n3 = String.fromCharCode.apply(null, new Uint8Array(t3.data));
- } catch (e3) {
- for (var s3 = new Uint8Array(t3.data), a3 = new Array(s3.length), c3 = 0; c3 < s3.length; c3++)
- a3[c3] = s3[c3];
- n3 = String.fromCharCode.apply(null, a3);
- }
- return o3 += btoa(n3), r3(o3);
- }, e2.decodePacket = function(t3, r3, n3) {
- if (void 0 === t3)
- return d2;
- if ("string" == typeof t3) {
- if ("b" === t3.charAt(0))
- return e2.decodeBase64Packet(t3.substr(1), r3);
- if (n3 && false === (t3 = function(t4) {
- try {
- t4 = c2.decode(t4, { strict: false });
- } catch (t5) {
- return false;
- }
- return t4;
- }(t3)))
- return d2;
- var o3 = t3.charAt(0);
- return Number(o3) == o3 && l2[o3] ? t3.length > 1 ? { type: l2[o3], data: t3.substring(1) } : { type: l2[o3] } : d2;
- }
- o3 = new Uint8Array(t3)[0];
- var i3 = s2(t3, 1);
- return y2 && "blob" === r3 && (i3 = new y2([i3])), { type: l2[o3], data: i3 };
- }, e2.decodeBase64Packet = function(t3, e3) {
- var r3 = l2[t3.charAt(0)];
- if (!n2)
- return { type: r3, data: { base64: true, data: t3.substr(1) } };
- var o3 = n2.decode(t3.substr(1));
- return "blob" === e3 && y2 && (o3 = new y2([o3])), { type: r3, data: o3 };
- }, e2.encodePayload = function(t3, r3, n3) {
- "function" == typeof r3 && (n3 = r3, r3 = null);
- var o3 = i2(t3);
- if (r3 && o3)
- return y2 && !f2 ? e2.encodePayloadAsBlob(t3, n3) : e2.encodePayloadAsArrayBuffer(t3, n3);
- if (!t3.length)
- return n3("0:");
- g2(t3, function(t4, n4) {
- e2.encodePacket(t4, !!o3 && r3, false, function(t5) {
- n4(null, function(t6) {
- return t6.length + ":" + t6;
- }(t5));
- });
- }, function(t4, e3) {
- return n3(e3.join(""));
- });
- }, e2.decodePayload = function(t3, r3, n3) {
- if ("string" != typeof t3)
- return e2.decodePayloadAsBinary(t3, r3, n3);
- var o3;
- if ("function" == typeof r3 && (n3 = r3, r3 = null), "" === t3)
- return n3(d2, 0, 1);
- for (var i3, s3, a3 = "", c3 = 0, h3 = t3.length; c3 < h3; c3++) {
- var u3 = t3.charAt(c3);
- if (":" === u3) {
- if ("" === a3 || a3 != (i3 = Number(a3)))
- return n3(d2, 0, 1);
- if (a3 != (s3 = t3.substr(c3 + 1, i3)).length)
- return n3(d2, 0, 1);
- if (s3.length) {
- if (o3 = e2.decodePacket(s3, r3, false), d2.type === o3.type && d2.data === o3.data)
- return n3(d2, 0, 1);
- if (false === n3(o3, c3 + i3, h3))
- return;
- }
- c3 += i3, a3 = "";
- } else
- a3 += u3;
- }
- return "" !== a3 ? n3(d2, 0, 1) : void 0;
- }, e2.encodePayloadAsArrayBuffer = function(t3, r3) {
- if (!t3.length)
- return r3(new ArrayBuffer(0));
- g2(t3, function(t4, r4) {
- e2.encodePacket(t4, true, true, function(t5) {
- return r4(null, t5);
- });
- }, function(t4, e3) {
- var n3 = e3.reduce(function(t5, e4) {
- var r4;
- return t5 + (r4 = "string" == typeof e4 ? e4.length : e4.byteLength).toString().length + r4 + 2;
- }, 0), o3 = new Uint8Array(n3), i3 = 0;
- return e3.forEach(function(t5) {
- var e4 = "string" == typeof t5, r4 = t5;
- if (e4) {
- for (var n4 = new Uint8Array(t5.length), s3 = 0; s3 < t5.length; s3++)
- n4[s3] = t5.charCodeAt(s3);
- r4 = n4.buffer;
- }
- o3[i3++] = e4 ? 0 : 1;
- var a3 = r4.byteLength.toString();
- for (s3 = 0; s3 < a3.length; s3++)
- o3[i3++] = parseInt(a3[s3]);
- o3[i3++] = 255;
- for (n4 = new Uint8Array(r4), s3 = 0; s3 < n4.length; s3++)
- o3[i3++] = n4[s3];
- }), r3(o3.buffer);
- });
- }, e2.encodePayloadAsBlob = function(t3, r3) {
- g2(t3, function(t4, r4) {
- e2.encodePacket(t4, true, true, function(t5) {
- var e3 = new Uint8Array(1);
- if (e3[0] = 1, "string" == typeof t5) {
- for (var n3 = new Uint8Array(t5.length), o3 = 0; o3 < t5.length; o3++)
- n3[o3] = t5.charCodeAt(o3);
- t5 = n3.buffer, e3[0] = 0;
- }
- var i3 = (t5 instanceof ArrayBuffer ? t5.byteLength : t5.size).toString(), s3 = new Uint8Array(i3.length + 1);
- for (o3 = 0; o3 < i3.length; o3++)
- s3[o3] = parseInt(i3[o3]);
- if (s3[i3.length] = 255, y2) {
- var a3 = new y2([e3.buffer, s3.buffer, t5]);
- r4(null, a3);
- }
- });
- }, function(t4, e3) {
- return r3(new y2(e3));
- });
- }, e2.decodePayloadAsBinary = function(t3, r3, n3) {
- "function" == typeof r3 && (n3 = r3, r3 = null);
- for (var o3 = t3, i3 = []; o3.byteLength > 0; ) {
- for (var a3 = new Uint8Array(o3), c3 = 0 === a3[0], h3 = "", u3 = 1; 255 !== a3[u3]; u3++) {
- if (h3.length > 310)
- return n3(d2, 0, 1);
- h3 += a3[u3];
- }
- o3 = s2(o3, 2 + h3.length), h3 = parseInt(h3);
- var f3 = s2(o3, 0, h3);
- if (c3)
- try {
- f3 = String.fromCharCode.apply(null, new Uint8Array(f3));
- } catch (t4) {
- var p3 = new Uint8Array(f3);
- f3 = "";
- for (u3 = 0; u3 < p3.length; u3++)
- f3 += String.fromCharCode(p3[u3]);
- }
- i3.push(f3), o3 = s2(o3, h3);
- }
- var l3 = i3.length;
- i3.forEach(function(t4, o4) {
- n3(e2.decodePacket(t4, r3, true), o4, l3);
- });
- };
- }, function(t2, e2) {
- e2.encode = function(t3) {
- var e3 = "";
- for (var r2 in t3)
- t3.hasOwnProperty(r2) && (e3.length && (e3 += "&"), e3 += encodeURIComponent(r2) + "=" + encodeURIComponent(t3[r2]));
- return e3;
- }, e2.decode = function(t3) {
- for (var e3 = {}, r2 = t3.split("&"), n2 = 0, o2 = r2.length; n2 < o2; n2++) {
- var i2 = r2[n2].split("=");
- e3[decodeURIComponent(i2[0])] = decodeURIComponent(i2[1]);
- }
- return e3;
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3) {
- var r2 = function() {
- };
- r2.prototype = e3.prototype, t3.prototype = new r2(), t3.prototype.constructor = t3;
- };
- }, function(t2, e2, r2) {
- var n2 = r2(0)("socket.io-parser"), o2 = r2(1), i2 = r2(25), s2 = r2(10), a2 = r2(11);
- function c2() {
- }
- 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;
- var h2 = e2.ERROR + '"encode error"';
- function u2(t3) {
- var r3 = "" + t3.type;
- 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) {
- var o3 = function(t4) {
- try {
- return JSON.stringify(t4);
- } catch (t5) {
- return false;
- }
- }(t3.data);
- if (false === o3)
- return h2;
- r3 += o3;
- }
- return n2("encoded %j as %s", t3, r3), r3;
- }
- function f2() {
- this.reconstructor = null;
- }
- function p2(t3) {
- this.reconPack = t3, this.buffers = [];
- }
- function l2(t3) {
- return { type: e2.ERROR, data: "parser error: " + t3 };
- }
- c2.prototype.encode = function(t3, r3) {
- (n2("encoding packet %j", t3), e2.BINARY_EVENT === t3.type || e2.BINARY_ACK === t3.type) ? function(t4, e3) {
- i2.removeBlobs(t4, function(t5) {
- var r4 = i2.deconstructPacket(t5), n3 = u2(r4.packet), o3 = r4.buffers;
- o3.unshift(n3), e3(o3);
- });
- }(t3, r3) : r3([u2(t3)]);
- }, o2(f2.prototype), f2.prototype.add = function(t3) {
- var r3;
- if ("string" == typeof t3)
- r3 = function(t4) {
- var r4 = 0, o3 = { type: Number(t4.charAt(0)) };
- if (null == e2.types[o3.type])
- return l2("unknown packet type " + o3.type);
- if (e2.BINARY_EVENT === o3.type || e2.BINARY_ACK === o3.type) {
- for (var i3 = ""; "-" !== t4.charAt(++r4) && (i3 += t4.charAt(r4), r4 != t4.length); )
- ;
- if (i3 != Number(i3) || "-" !== t4.charAt(r4))
- throw new Error("Illegal attachments");
- o3.attachments = Number(i3);
- }
- if ("/" === t4.charAt(r4 + 1))
- for (o3.nsp = ""; ++r4; ) {
- if ("," === (c3 = t4.charAt(r4)))
- break;
- if (o3.nsp += c3, r4 === t4.length)
- break;
- }
- else
- o3.nsp = "/";
- var a3 = t4.charAt(r4 + 1);
- if ("" !== a3 && Number(a3) == a3) {
- for (o3.id = ""; ++r4; ) {
- var c3;
- if (null == (c3 = t4.charAt(r4)) || Number(c3) != c3) {
- --r4;
- break;
- }
- if (o3.id += t4.charAt(r4), r4 === t4.length)
- break;
- }
- o3.id = Number(o3.id);
- }
- if (t4.charAt(++r4)) {
- var h3 = function(t5) {
- try {
- return JSON.parse(t5);
- } catch (t6) {
- return false;
- }
- }(t4.substr(r4));
- if (!(false !== h3 && (o3.type === e2.ERROR || s2(h3))))
- return l2("invalid payload");
- o3.data = h3;
- }
- return n2("decoded %s as %j", t4, o3), o3;
- }(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);
- else {
- if (!a2(t3) && !t3.base64)
- throw new Error("Unknown type: " + t3);
- if (!this.reconstructor)
- throw new Error("got binary data when not reconstructing a packet");
- (r3 = this.reconstructor.takeBinaryData(t3)) && (this.reconstructor = null, this.emit("decoded", r3));
- }
- }, f2.prototype.destroy = function() {
- this.reconstructor && this.reconstructor.finishedReconstruction();
- }, p2.prototype.takeBinaryData = function(t3) {
- if (this.buffers.push(t3), this.buffers.length === this.reconPack.attachments) {
- var e3 = i2.reconstructPacket(this.reconPack, this.buffers);
- return this.finishedReconstruction(), e3;
- }
- return null;
- }, p2.prototype.finishedReconstruction = function() {
- this.reconPack = null, this.buffers = [];
- };
- }, function(t2, e2, r2) {
- (function(t3) {
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <http://feross.org>
- * @license MIT
- */
- var n2 = r2(26), o2 = r2(27), i2 = r2(28);
- function s2() {
- return c2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
- }
- function a2(t4, e3) {
- if (s2() < e3)
- throw new RangeError("Invalid typed array length");
- return c2.TYPED_ARRAY_SUPPORT ? (t4 = new Uint8Array(e3)).__proto__ = c2.prototype : (null === t4 && (t4 = new c2(e3)), t4.length = e3), t4;
- }
- function c2(t4, e3, r3) {
- if (!(c2.TYPED_ARRAY_SUPPORT || this instanceof c2))
- return new c2(t4, e3, r3);
- if ("number" == typeof t4) {
- if ("string" == typeof e3)
- throw new Error("If encoding is specified then the first argument must be a string");
- return f2(this, t4);
- }
- return h2(this, t4, e3, r3);
- }
- function h2(t4, e3, r3, n3) {
- if ("number" == typeof e3)
- throw new TypeError('"value" argument must not be a number');
- return "undefined" != typeof ArrayBuffer && e3 instanceof ArrayBuffer ? function(t5, e4, r4, n4) {
- if (e4.byteLength, r4 < 0 || e4.byteLength < r4)
- throw new RangeError("'offset' is out of bounds");
- if (e4.byteLength < r4 + (n4 || 0))
- throw new RangeError("'length' is out of bounds");
- e4 = void 0 === r4 && void 0 === n4 ? new Uint8Array(e4) : void 0 === n4 ? new Uint8Array(e4, r4) : new Uint8Array(e4, r4, n4);
- c2.TYPED_ARRAY_SUPPORT ? (t5 = e4).__proto__ = c2.prototype : t5 = p2(t5, e4);
- return t5;
- }(t4, e3, r3, n3) : "string" == typeof e3 ? function(t5, e4, r4) {
- "string" == typeof r4 && "" !== r4 || (r4 = "utf8");
- if (!c2.isEncoding(r4))
- throw new TypeError('"encoding" must be a valid string encoding');
- var n4 = 0 | d2(e4, r4), o3 = (t5 = a2(t5, n4)).write(e4, r4);
- o3 !== n4 && (t5 = t5.slice(0, o3));
- return t5;
- }(t4, e3, r3) : function(t5, e4) {
- if (c2.isBuffer(e4)) {
- var r4 = 0 | l2(e4.length);
- return 0 === (t5 = a2(t5, r4)).length || e4.copy(t5, 0, 0, r4), t5;
- }
- if (e4) {
- if ("undefined" != typeof ArrayBuffer && e4.buffer instanceof ArrayBuffer || "length" in e4)
- return "number" != typeof e4.length || (n4 = e4.length) != n4 ? a2(t5, 0) : p2(t5, e4);
- if ("Buffer" === e4.type && i2(e4.data))
- return p2(t5, e4.data);
- }
- var n4;
- throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
- }(t4, e3);
- }
- function u2(t4) {
- if ("number" != typeof t4)
- throw new TypeError('"size" argument must be a number');
- if (t4 < 0)
- throw new RangeError('"size" argument must not be negative');
- }
- function f2(t4, e3) {
- if (u2(e3), t4 = a2(t4, e3 < 0 ? 0 : 0 | l2(e3)), !c2.TYPED_ARRAY_SUPPORT)
- for (var r3 = 0; r3 < e3; ++r3)
- t4[r3] = 0;
- return t4;
- }
- function p2(t4, e3) {
- var r3 = e3.length < 0 ? 0 : 0 | l2(e3.length);
- t4 = a2(t4, r3);
- for (var n3 = 0; n3 < r3; n3 += 1)
- t4[n3] = 255 & e3[n3];
- return t4;
- }
- function l2(t4) {
- if (t4 >= s2())
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s2().toString(16) + " bytes");
- return 0 | t4;
- }
- function d2(t4, e3) {
- if (c2.isBuffer(t4))
- return t4.length;
- if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t4) || t4 instanceof ArrayBuffer))
- return t4.byteLength;
- "string" != typeof t4 && (t4 = "" + t4);
- var r3 = t4.length;
- if (0 === r3)
- return 0;
- for (var n3 = false; ; )
- switch (e3) {
- case "ascii":
- case "latin1":
- case "binary":
- return r3;
- case "utf8":
- case "utf-8":
- case void 0:
- return q2(t4).length;
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return 2 * r3;
- case "hex":
- return r3 >>> 1;
- case "base64":
- return Y2(t4).length;
- default:
- if (n3)
- return q2(t4).length;
- e3 = ("" + e3).toLowerCase(), n3 = true;
- }
- }
- function y2(t4, e3, r3) {
- var n3 = false;
- if ((void 0 === e3 || e3 < 0) && (e3 = 0), e3 > this.length)
- return "";
- if ((void 0 === r3 || r3 > this.length) && (r3 = this.length), r3 <= 0)
- return "";
- if ((r3 >>>= 0) <= (e3 >>>= 0))
- return "";
- for (t4 || (t4 = "utf8"); ; )
- switch (t4) {
- case "hex":
- return C2(this, e3, r3);
- case "utf8":
- case "utf-8":
- return x(this, e3, r3);
- case "ascii":
- return R2(this, e3, r3);
- case "latin1":
- case "binary":
- return S2(this, e3, r3);
- case "base64":
- return _2(this, e3, r3);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return P2(this, e3, r3);
- default:
- if (n3)
- throw new TypeError("Unknown encoding: " + t4);
- t4 = (t4 + "").toLowerCase(), n3 = true;
- }
- }
- function g2(t4, e3, r3) {
- var n3 = t4[e3];
- t4[e3] = t4[r3], t4[r3] = n3;
- }
- function v2(t4, e3, r3, n3, o3) {
- if (0 === t4.length)
- return -1;
- 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) {
- if (o3)
- return -1;
- r3 = t4.length - 1;
- } else if (r3 < 0) {
- if (!o3)
- return -1;
- r3 = 0;
- }
- if ("string" == typeof e3 && (e3 = c2.from(e3, n3)), c2.isBuffer(e3))
- return 0 === e3.length ? -1 : m2(t4, e3, r3, n3, o3);
- if ("number" == typeof e3)
- 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);
- throw new TypeError("val must be string, number or Buffer");
- }
- function m2(t4, e3, r3, n3, o3) {
- var i3, s3 = 1, a3 = t4.length, c3 = e3.length;
- if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) {
- if (t4.length < 2 || e3.length < 2)
- return -1;
- s3 = 2, a3 /= 2, c3 /= 2, r3 /= 2;
- }
- function h3(t5, e4) {
- return 1 === s3 ? t5[e4] : t5.readUInt16BE(e4 * s3);
- }
- if (o3) {
- var u3 = -1;
- for (i3 = r3; i3 < a3; i3++)
- if (h3(t4, i3) === h3(e3, -1 === u3 ? 0 : i3 - u3)) {
- if (-1 === u3 && (u3 = i3), i3 - u3 + 1 === c3)
- return u3 * s3;
- } else
- -1 !== u3 && (i3 -= i3 - u3), u3 = -1;
- } else
- for (r3 + c3 > a3 && (r3 = a3 - c3), i3 = r3; i3 >= 0; i3--) {
- for (var f3 = true, p3 = 0; p3 < c3; p3++)
- if (h3(t4, i3 + p3) !== h3(e3, p3)) {
- f3 = false;
- break;
- }
- if (f3)
- return i3;
- }
- return -1;
- }
- function b2(t4, e3, r3, n3) {
- r3 = Number(r3) || 0;
- var o3 = t4.length - r3;
- n3 ? (n3 = Number(n3)) > o3 && (n3 = o3) : n3 = o3;
- var i3 = e3.length;
- if (i3 % 2 != 0)
- throw new TypeError("Invalid hex string");
- n3 > i3 / 2 && (n3 = i3 / 2);
- for (var s3 = 0; s3 < n3; ++s3) {
- var a3 = parseInt(e3.substr(2 * s3, 2), 16);
- if (isNaN(a3))
- return s3;
- t4[r3 + s3] = a3;
- }
- return s3;
- }
- function w2(t4, e3, r3, n3) {
- return H2(q2(e3, t4.length - r3), t4, r3, n3);
- }
- function A2(t4, e3, r3, n3) {
- return H2(function(t5) {
- for (var e4 = [], r4 = 0; r4 < t5.length; ++r4)
- e4.push(255 & t5.charCodeAt(r4));
- return e4;
- }(e3), t4, r3, n3);
- }
- function k(t4, e3, r3, n3) {
- return A2(t4, e3, r3, n3);
- }
- function E2(t4, e3, r3, n3) {
- return H2(Y2(e3), t4, r3, n3);
- }
- function B2(t4, e3, r3, n3) {
- return H2(function(t5, e4) {
- for (var r4, n4, o3, i3 = [], s3 = 0; s3 < t5.length && !((e4 -= 2) < 0); ++s3)
- r4 = t5.charCodeAt(s3), n4 = r4 >> 8, o3 = r4 % 256, i3.push(o3), i3.push(n4);
- return i3;
- }(e3, t4.length - r3), t4, r3, n3);
- }
- function _2(t4, e3, r3) {
- return 0 === e3 && r3 === t4.length ? n2.fromByteArray(t4) : n2.fromByteArray(t4.slice(e3, r3));
- }
- function x(t4, e3, r3) {
- r3 = Math.min(t4.length, r3);
- for (var n3 = [], o3 = e3; o3 < r3; ) {
- var i3, s3, a3, c3, h3 = t4[o3], u3 = null, f3 = h3 > 239 ? 4 : h3 > 223 ? 3 : h3 > 191 ? 2 : 1;
- if (o3 + f3 <= r3)
- switch (f3) {
- case 1:
- h3 < 128 && (u3 = h3);
- break;
- case 2:
- 128 == (192 & (i3 = t4[o3 + 1])) && (c3 = (31 & h3) << 6 | 63 & i3) > 127 && (u3 = c3);
- break;
- case 3:
- 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);
- break;
- case 4:
- 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);
- }
- 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;
- }
- return function(t5) {
- var e4 = t5.length;
- if (e4 <= 4096)
- return String.fromCharCode.apply(String, t5);
- var r4 = "", n4 = 0;
- for (; n4 < e4; )
- r4 += String.fromCharCode.apply(String, t5.slice(n4, n4 += 4096));
- return r4;
- }(n3);
- }
- e2.Buffer = c2, e2.SlowBuffer = function(t4) {
- +t4 != t4 && (t4 = 0);
- return c2.alloc(+t4);
- }, e2.INSPECT_MAX_BYTES = 50, c2.TYPED_ARRAY_SUPPORT = void 0 !== t3.TYPED_ARRAY_SUPPORT ? t3.TYPED_ARRAY_SUPPORT : function() {
- try {
- var t4 = new Uint8Array(1);
- return t4.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
- return 42;
- } }, 42 === t4.foo() && "function" == typeof t4.subarray && 0 === t4.subarray(1, 1).byteLength;
- } catch (t5) {
- return false;
- }
- }(), e2.kMaxLength = s2(), c2.poolSize = 8192, c2._augment = function(t4) {
- return t4.__proto__ = c2.prototype, t4;
- }, c2.from = function(t4, e3, r3) {
- return h2(null, t4, e3, r3);
- }, 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) {
- return function(t5, e4, r4, n3) {
- 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);
- }(null, t4, e3, r3);
- }, c2.allocUnsafe = function(t4) {
- return f2(null, t4);
- }, c2.allocUnsafeSlow = function(t4) {
- return f2(null, t4);
- }, c2.isBuffer = function(t4) {
- return !(null == t4 || !t4._isBuffer);
- }, c2.compare = function(t4, e3) {
- if (!c2.isBuffer(t4) || !c2.isBuffer(e3))
- throw new TypeError("Arguments must be Buffers");
- if (t4 === e3)
- return 0;
- for (var r3 = t4.length, n3 = e3.length, o3 = 0, i3 = Math.min(r3, n3); o3 < i3; ++o3)
- if (t4[o3] !== e3[o3]) {
- r3 = t4[o3], n3 = e3[o3];
- break;
- }
- return r3 < n3 ? -1 : n3 < r3 ? 1 : 0;
- }, c2.isEncoding = function(t4) {
- switch (String(t4).toLowerCase()) {
- case "hex":
- case "utf8":
- case "utf-8":
- case "ascii":
- case "latin1":
- case "binary":
- case "base64":
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return true;
- default:
- return false;
- }
- }, c2.concat = function(t4, e3) {
- if (!i2(t4))
- throw new TypeError('"list" argument must be an Array of Buffers');
- if (0 === t4.length)
- return c2.alloc(0);
- var r3;
- if (void 0 === e3)
- for (e3 = 0, r3 = 0; r3 < t4.length; ++r3)
- e3 += t4[r3].length;
- var n3 = c2.allocUnsafe(e3), o3 = 0;
- for (r3 = 0; r3 < t4.length; ++r3) {
- var s3 = t4[r3];
- if (!c2.isBuffer(s3))
- throw new TypeError('"list" argument must be an Array of Buffers');
- s3.copy(n3, o3), o3 += s3.length;
- }
- return n3;
- }, c2.byteLength = d2, c2.prototype._isBuffer = true, c2.prototype.swap16 = function() {
- var t4 = this.length;
- if (t4 % 2 != 0)
- throw new RangeError("Buffer size must be a multiple of 16-bits");
- for (var e3 = 0; e3 < t4; e3 += 2)
- g2(this, e3, e3 + 1);
- return this;
- }, c2.prototype.swap32 = function() {
- var t4 = this.length;
- if (t4 % 4 != 0)
- throw new RangeError("Buffer size must be a multiple of 32-bits");
- for (var e3 = 0; e3 < t4; e3 += 4)
- g2(this, e3, e3 + 3), g2(this, e3 + 1, e3 + 2);
- return this;
- }, c2.prototype.swap64 = function() {
- var t4 = this.length;
- if (t4 % 8 != 0)
- throw new RangeError("Buffer size must be a multiple of 64-bits");
- for (var e3 = 0; e3 < t4; e3 += 8)
- g2(this, e3, e3 + 7), g2(this, e3 + 1, e3 + 6), g2(this, e3 + 2, e3 + 5), g2(this, e3 + 3, e3 + 4);
- return this;
- }, c2.prototype.toString = function() {
- var t4 = 0 | this.length;
- return 0 === t4 ? "" : 0 === arguments.length ? x(this, 0, t4) : y2.apply(this, arguments);
- }, c2.prototype.equals = function(t4) {
- if (!c2.isBuffer(t4))
- throw new TypeError("Argument must be a Buffer");
- return this === t4 || 0 === c2.compare(this, t4);
- }, c2.prototype.inspect = function() {
- var t4 = "", r3 = e2.INSPECT_MAX_BYTES;
- return this.length > 0 && (t4 = this.toString("hex", 0, r3).match(/.{2}/g).join(" "), this.length > r3 && (t4 += " ... ")), "<Buffer " + t4 + ">";
- }, c2.prototype.compare = function(t4, e3, r3, n3, o3) {
- if (!c2.isBuffer(t4))
- throw new TypeError("Argument must be a Buffer");
- 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)
- throw new RangeError("out of range index");
- if (n3 >= o3 && e3 >= r3)
- return 0;
- if (n3 >= o3)
- return -1;
- if (e3 >= r3)
- return 1;
- if (this === t4)
- return 0;
- 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)
- if (h3[f3] !== u3[f3]) {
- i3 = h3[f3], s3 = u3[f3];
- break;
- }
- return i3 < s3 ? -1 : s3 < i3 ? 1 : 0;
- }, c2.prototype.includes = function(t4, e3, r3) {
- return -1 !== this.indexOf(t4, e3, r3);
- }, c2.prototype.indexOf = function(t4, e3, r3) {
- return v2(this, t4, e3, r3, true);
- }, c2.prototype.lastIndexOf = function(t4, e3, r3) {
- return v2(this, t4, e3, r3, false);
- }, c2.prototype.write = function(t4, e3, r3, n3) {
- if (void 0 === e3)
- n3 = "utf8", r3 = this.length, e3 = 0;
- else if (void 0 === r3 && "string" == typeof e3)
- n3 = e3, r3 = this.length, e3 = 0;
- else {
- if (!isFinite(e3))
- throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
- e3 |= 0, isFinite(r3) ? (r3 |= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r3, r3 = void 0);
- }
- var o3 = this.length - e3;
- if ((void 0 === r3 || r3 > o3) && (r3 = o3), t4.length > 0 && (r3 < 0 || e3 < 0) || e3 > this.length)
- throw new RangeError("Attempt to write outside buffer bounds");
- n3 || (n3 = "utf8");
- for (var i3 = false; ; )
- switch (n3) {
- case "hex":
- return b2(this, t4, e3, r3);
- case "utf8":
- case "utf-8":
- return w2(this, t4, e3, r3);
- case "ascii":
- return A2(this, t4, e3, r3);
- case "latin1":
- case "binary":
- return k(this, t4, e3, r3);
- case "base64":
- return E2(this, t4, e3, r3);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return B2(this, t4, e3, r3);
- default:
- if (i3)
- throw new TypeError("Unknown encoding: " + n3);
- n3 = ("" + n3).toLowerCase(), i3 = true;
- }
- }, c2.prototype.toJSON = function() {
- return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
- };
- function R2(t4, e3, r3) {
- var n3 = "";
- r3 = Math.min(t4.length, r3);
- for (var o3 = e3; o3 < r3; ++o3)
- n3 += String.fromCharCode(127 & t4[o3]);
- return n3;
- }
- function S2(t4, e3, r3) {
- var n3 = "";
- r3 = Math.min(t4.length, r3);
- for (var o3 = e3; o3 < r3; ++o3)
- n3 += String.fromCharCode(t4[o3]);
- return n3;
- }
- function C2(t4, e3, r3) {
- var n3 = t4.length;
- (!e3 || e3 < 0) && (e3 = 0), (!r3 || r3 < 0 || r3 > n3) && (r3 = n3);
- for (var o3 = "", i3 = e3; i3 < r3; ++i3)
- o3 += M2(t4[i3]);
- return o3;
- }
- function P2(t4, e3, r3) {
- for (var n3 = t4.slice(e3, r3), o3 = "", i3 = 0; i3 < n3.length; i3 += 2)
- o3 += String.fromCharCode(n3[i3] + 256 * n3[i3 + 1]);
- return o3;
- }
- function T2(t4, e3, r3) {
- if (t4 % 1 != 0 || t4 < 0)
- throw new RangeError("offset is not uint");
- if (t4 + e3 > r3)
- throw new RangeError("Trying to access beyond buffer length");
- }
- function O2(t4, e3, r3, n3, o3, i3) {
- if (!c2.isBuffer(t4))
- throw new TypeError('"buffer" argument must be a Buffer instance');
- if (e3 > o3 || e3 < i3)
- throw new RangeError('"value" argument is out of bounds');
- if (r3 + n3 > t4.length)
- throw new RangeError("Index out of range");
- }
- function N2(t4, e3, r3, n3) {
- e3 < 0 && (e3 = 65535 + e3 + 1);
- for (var o3 = 0, i3 = Math.min(t4.length - r3, 2); o3 < i3; ++o3)
- t4[r3 + o3] = (e3 & 255 << 8 * (n3 ? o3 : 1 - o3)) >>> 8 * (n3 ? o3 : 1 - o3);
- }
- function L2(t4, e3, r3, n3) {
- e3 < 0 && (e3 = 4294967295 + e3 + 1);
- for (var o3 = 0, i3 = Math.min(t4.length - r3, 4); o3 < i3; ++o3)
- t4[r3 + o3] = e3 >>> 8 * (n3 ? o3 : 3 - o3) & 255;
- }
- function U2(t4, e3, r3, n3, o3, i3) {
- if (r3 + n3 > t4.length)
- throw new RangeError("Index out of range");
- if (r3 < 0)
- throw new RangeError("Index out of range");
- }
- function I2(t4, e3, r3, n3, i3) {
- return i3 || U2(t4, 0, r3, 4), o2.write(t4, e3, r3, n3, 23, 4), r3 + 4;
- }
- function j2(t4, e3, r3, n3, i3) {
- return i3 || U2(t4, 0, r3, 8), o2.write(t4, e3, r3, n3, 52, 8), r3 + 8;
- }
- c2.prototype.slice = function(t4, e3) {
- var r3, n3 = this.length;
- 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)
- (r3 = this.subarray(t4, e3)).__proto__ = c2.prototype;
- else {
- var o3 = e3 - t4;
- r3 = new c2(o3, void 0);
- for (var i3 = 0; i3 < o3; ++i3)
- r3[i3] = this[i3 + t4];
- }
- return r3;
- }, c2.prototype.readUIntLE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
- n3 += this[t4 + i3] * o3;
- return n3;
- }, c2.prototype.readUIntBE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4 + --e3], o3 = 1; e3 > 0 && (o3 *= 256); )
- n3 += this[t4 + --e3] * o3;
- return n3;
- }, c2.prototype.readUInt8 = function(t4, e3) {
- return e3 || T2(t4, 1, this.length), this[t4];
- }, c2.prototype.readUInt16LE = function(t4, e3) {
- return e3 || T2(t4, 2, this.length), this[t4] | this[t4 + 1] << 8;
- }, c2.prototype.readUInt16BE = function(t4, e3) {
- return e3 || T2(t4, 2, this.length), this[t4] << 8 | this[t4 + 1];
- }, c2.prototype.readUInt32LE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), (this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16) + 16777216 * this[t4 + 3];
- }, c2.prototype.readUInt32BE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), 16777216 * this[t4] + (this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3]);
- }, c2.prototype.readIntLE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
- n3 += this[t4 + i3] * o3;
- return n3 >= (o3 *= 128) && (n3 -= Math.pow(2, 8 * e3)), n3;
- }, c2.prototype.readIntBE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = e3, o3 = 1, i3 = this[t4 + --n3]; n3 > 0 && (o3 *= 256); )
- i3 += this[t4 + --n3] * o3;
- return i3 >= (o3 *= 128) && (i3 -= Math.pow(2, 8 * e3)), i3;
- }, c2.prototype.readInt8 = function(t4, e3) {
- return e3 || T2(t4, 1, this.length), 128 & this[t4] ? -1 * (255 - this[t4] + 1) : this[t4];
- }, c2.prototype.readInt16LE = function(t4, e3) {
- e3 || T2(t4, 2, this.length);
- var r3 = this[t4] | this[t4 + 1] << 8;
- return 32768 & r3 ? 4294901760 | r3 : r3;
- }, c2.prototype.readInt16BE = function(t4, e3) {
- e3 || T2(t4, 2, this.length);
- var r3 = this[t4 + 1] | this[t4] << 8;
- return 32768 & r3 ? 4294901760 | r3 : r3;
- }, c2.prototype.readInt32LE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16 | this[t4 + 3] << 24;
- }, c2.prototype.readInt32BE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), this[t4] << 24 | this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3];
- }, c2.prototype.readFloatLE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), o2.read(this, t4, true, 23, 4);
- }, c2.prototype.readFloatBE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), o2.read(this, t4, false, 23, 4);
- }, c2.prototype.readDoubleLE = function(t4, e3) {
- return e3 || T2(t4, 8, this.length), o2.read(this, t4, true, 52, 8);
- }, c2.prototype.readDoubleBE = function(t4, e3) {
- return e3 || T2(t4, 8, this.length), o2.read(this, t4, false, 52, 8);
- }, c2.prototype.writeUIntLE = function(t4, e3, r3, n3) {
- (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
- var o3 = 1, i3 = 0;
- for (this[e3] = 255 & t4; ++i3 < r3 && (o3 *= 256); )
- this[e3 + i3] = t4 / o3 & 255;
- return e3 + r3;
- }, c2.prototype.writeUIntBE = function(t4, e3, r3, n3) {
- (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
- var o3 = r3 - 1, i3 = 1;
- for (this[e3 + o3] = 255 & t4; --o3 >= 0 && (i3 *= 256); )
- this[e3 + o3] = t4 / i3 & 255;
- return e3 + r3;
- }, c2.prototype.writeUInt8 = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeUInt16LE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeUInt16BE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeUInt32LE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeUInt32BE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeIntLE = function(t4, e3, r3, n3) {
- if (t4 = +t4, e3 |= 0, !n3) {
- var o3 = Math.pow(2, 8 * r3 - 1);
- O2(this, t4, e3, r3, o3 - 1, -o3);
- }
- var i3 = 0, s3 = 1, a3 = 0;
- for (this[e3] = 255 & t4; ++i3 < r3 && (s3 *= 256); )
- t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 - 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
- return e3 + r3;
- }, c2.prototype.writeIntBE = function(t4, e3, r3, n3) {
- if (t4 = +t4, e3 |= 0, !n3) {
- var o3 = Math.pow(2, 8 * r3 - 1);
- O2(this, t4, e3, r3, o3 - 1, -o3);
- }
- var i3 = r3 - 1, s3 = 1, a3 = 0;
- for (this[e3 + i3] = 255 & t4; --i3 >= 0 && (s3 *= 256); )
- t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 + 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
- return e3 + r3;
- }, c2.prototype.writeInt8 = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeInt16LE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeInt16BE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeInt32LE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeInt32BE = function(t4, e3, r3) {
- 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;
- }, c2.prototype.writeFloatLE = function(t4, e3, r3) {
- return I2(this, t4, e3, true, r3);
- }, c2.prototype.writeFloatBE = function(t4, e3, r3) {
- return I2(this, t4, e3, false, r3);
- }, c2.prototype.writeDoubleLE = function(t4, e3, r3) {
- return j2(this, t4, e3, true, r3);
- }, c2.prototype.writeDoubleBE = function(t4, e3, r3) {
- return j2(this, t4, e3, false, r3);
- }, c2.prototype.copy = function(t4, e3, r3, n3) {
- 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)
- return 0;
- if (0 === t4.length || 0 === this.length)
- return 0;
- if (e3 < 0)
- throw new RangeError("targetStart out of bounds");
- if (r3 < 0 || r3 >= this.length)
- throw new RangeError("sourceStart out of bounds");
- if (n3 < 0)
- throw new RangeError("sourceEnd out of bounds");
- n3 > this.length && (n3 = this.length), t4.length - e3 < n3 - r3 && (n3 = t4.length - e3 + r3);
- var o3, i3 = n3 - r3;
- if (this === t4 && r3 < e3 && e3 < n3)
- for (o3 = i3 - 1; o3 >= 0; --o3)
- t4[o3 + e3] = this[o3 + r3];
- else if (i3 < 1e3 || !c2.TYPED_ARRAY_SUPPORT)
- for (o3 = 0; o3 < i3; ++o3)
- t4[o3 + e3] = this[o3 + r3];
- else
- Uint8Array.prototype.set.call(t4, this.subarray(r3, r3 + i3), e3);
- return i3;
- }, c2.prototype.fill = function(t4, e3, r3, n3) {
- if ("string" == typeof t4) {
- if ("string" == typeof e3 ? (n3 = e3, e3 = 0, r3 = this.length) : "string" == typeof r3 && (n3 = r3, r3 = this.length), 1 === t4.length) {
- var o3 = t4.charCodeAt(0);
- o3 < 256 && (t4 = o3);
- }
- if (void 0 !== n3 && "string" != typeof n3)
- throw new TypeError("encoding must be a string");
- if ("string" == typeof n3 && !c2.isEncoding(n3))
- throw new TypeError("Unknown encoding: " + n3);
- } else
- "number" == typeof t4 && (t4 &= 255);
- if (e3 < 0 || this.length < e3 || this.length < r3)
- throw new RangeError("Out of range index");
- if (r3 <= e3)
- return this;
- var i3;
- if (e3 >>>= 0, r3 = void 0 === r3 ? this.length : r3 >>> 0, t4 || (t4 = 0), "number" == typeof t4)
- for (i3 = e3; i3 < r3; ++i3)
- this[i3] = t4;
- else {
- var s3 = c2.isBuffer(t4) ? t4 : q2(new c2(t4, n3).toString()), a3 = s3.length;
- for (i3 = 0; i3 < r3 - e3; ++i3)
- this[i3 + e3] = s3[i3 % a3];
- }
- return this;
- };
- var D2 = /[^+\/0-9A-Za-z-_]/g;
- function M2(t4) {
- return t4 < 16 ? "0" + t4.toString(16) : t4.toString(16);
- }
- function q2(t4, e3) {
- var r3;
- e3 = e3 || 1 / 0;
- for (var n3 = t4.length, o3 = null, i3 = [], s3 = 0; s3 < n3; ++s3) {
- if ((r3 = t4.charCodeAt(s3)) > 55295 && r3 < 57344) {
- if (!o3) {
- if (r3 > 56319) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189);
- continue;
- }
- if (s3 + 1 === n3) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189);
- continue;
- }
- o3 = r3;
- continue;
- }
- if (r3 < 56320) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189), o3 = r3;
- continue;
- }
- r3 = 65536 + (o3 - 55296 << 10 | r3 - 56320);
- } else
- o3 && (e3 -= 3) > -1 && i3.push(239, 191, 189);
- if (o3 = null, r3 < 128) {
- if ((e3 -= 1) < 0)
- break;
- i3.push(r3);
- } else if (r3 < 2048) {
- if ((e3 -= 2) < 0)
- break;
- i3.push(r3 >> 6 | 192, 63 & r3 | 128);
- } else if (r3 < 65536) {
- if ((e3 -= 3) < 0)
- break;
- i3.push(r3 >> 12 | 224, r3 >> 6 & 63 | 128, 63 & r3 | 128);
- } else {
- if (!(r3 < 1114112))
- throw new Error("Invalid code point");
- if ((e3 -= 4) < 0)
- break;
- i3.push(r3 >> 18 | 240, r3 >> 12 & 63 | 128, r3 >> 6 & 63 | 128, 63 & r3 | 128);
- }
- }
- return i3;
- }
- function Y2(t4) {
- return n2.toByteArray(function(t5) {
- if ((t5 = function(t6) {
- return t6.trim ? t6.trim() : t6.replace(/^\s+|\s+$/g, "");
- }(t5).replace(D2, "")).length < 2)
- return "";
- for (; t5.length % 4 != 0; )
- t5 += "=";
- return t5;
- }(t4));
- }
- function H2(t4, e3, r3, n3) {
- for (var o3 = 0; o3 < n3 && !(o3 + r3 >= e3.length || o3 >= t4.length); ++o3)
- e3[o3 + r3] = t4[o3];
- return o3;
- }
- }).call(this, r2(12));
- }, function(t2, e2, r2) {
- var n2 = r2(31);
- t2.exports = function(t3) {
- var e3 = t3.xdomain, r3 = t3.xscheme, o2 = t3.enablesXDR;
- try {
- if ("undefined" != typeof XMLHttpRequest && (!e3 || n2))
- return new XMLHttpRequest();
- } catch (t4) {
- }
- try {
- if ("undefined" != typeof XDomainRequest && !r3 && o2)
- return new XDomainRequest();
- } catch (t4) {
- }
- if (!e3)
- try {
- return new self[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
- } catch (t4) {
- }
- };
- }, function(t2, e2, r2) {
- var n2 = r2(2), o2 = r2(1);
- function i2(t3) {
- 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;
- }
- t2.exports = i2, o2(i2.prototype), i2.prototype.onError = function(t3, e3) {
- var r3 = new Error(t3);
- return r3.type = "TransportError", r3.description = e3, this.emit("error", r3), this;
- }, i2.prototype.open = function() {
- return "closed" !== this.readyState && "" !== this.readyState || (this.readyState = "opening", this.doOpen()), this;
- }, i2.prototype.close = function() {
- return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this;
- }, i2.prototype.send = function(t3) {
- if ("open" !== this.readyState)
- throw new Error("Transport not open");
- this.write(t3);
- }, i2.prototype.onOpen = function() {
- this.readyState = "open", this.writable = true, this.emit("open");
- }, i2.prototype.onData = function(t3) {
- var e3 = n2.decodePacket(t3, this.socket.binaryType);
- this.onPacket(e3);
- }, i2.prototype.onPacket = function(t3) {
- this.emit("packet", t3);
- }, i2.prototype.onClose = function() {
- this.readyState = "closed", this.emit("close");
- };
- }, function(t2, e2) {
- 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"];
- t2.exports = function(t3) {
- var e3 = t3, o2 = t3.indexOf("["), i2 = t3.indexOf("]");
- -1 != o2 && -1 != i2 && (t3 = t3.substring(0, o2) + t3.substring(o2, i2).replace(/:/g, ";") + t3.substring(i2, t3.length));
- for (var s2 = r2.exec(t3 || ""), a2 = {}, c2 = 14; c2--; )
- a2[n2[c2]] = s2[c2] || "";
- 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;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2, r2) {
- (function(e3) {
- t2.exports = function(t3) {
- return r3 && e3.isBuffer(t3) || n2 && (t3 instanceof ArrayBuffer || function(t4) {
- return "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(t4) : t4.buffer instanceof ArrayBuffer;
- }(t3));
- };
- var r3 = "function" == typeof e3 && "function" == typeof e3.isBuffer, n2 = "function" == typeof ArrayBuffer;
- }).call(this, r2(6).Buffer);
- }, function(t2, e2) {
- var r2;
- r2 = function() {
- return this;
- }();
- try {
- r2 = r2 || new Function("return this")();
- } catch (t3) {
- "object" == typeof window && (r2 = window);
- }
- t2.exports = r2;
- }, function(t2, e2, r2) {
- 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;
- function l2(t3, e3) {
- if (!(this instanceof l2))
- return new l2(t3, e3);
- 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 = [];
- var r3 = e3.parser || s2;
- this.encoder = new r3.Encoder(), this.decoder = new r3.Decoder(), this.autoConnect = false !== e3.autoConnect, this.autoConnect && this.open();
- }
- t2.exports = l2, l2.prototype.emitAll = function() {
- for (var t3 in this.emit.apply(this, arguments), this.nsps)
- p2.call(this.nsps, t3) && this.nsps[t3].emit.apply(this.nsps[t3], arguments);
- }, l2.prototype.updateSocketIds = function() {
- for (var t3 in this.nsps)
- p2.call(this.nsps, t3) && (this.nsps[t3].id = this.generateId(t3));
- }, l2.prototype.generateId = function(t3) {
- return ("/" === t3 ? "" : t3 + "#") + this.engine.id;
- }, i2(l2.prototype), l2.prototype.reconnection = function(t3) {
- return arguments.length ? (this._reconnection = !!t3, this) : this._reconnection;
- }, l2.prototype.reconnectionAttempts = function(t3) {
- return arguments.length ? (this._reconnectionAttempts = t3, this) : this._reconnectionAttempts;
- }, l2.prototype.reconnectionDelay = function(t3) {
- return arguments.length ? (this._reconnectionDelay = t3, this.backoff && this.backoff.setMin(t3), this) : this._reconnectionDelay;
- }, l2.prototype.randomizationFactor = function(t3) {
- return arguments.length ? (this._randomizationFactor = t3, this.backoff && this.backoff.setJitter(t3), this) : this._randomizationFactor;
- }, l2.prototype.reconnectionDelayMax = function(t3) {
- return arguments.length ? (this._reconnectionDelayMax = t3, this.backoff && this.backoff.setMax(t3), this) : this._reconnectionDelayMax;
- }, l2.prototype.timeout = function(t3) {
- return arguments.length ? (this._timeout = t3, this) : this._timeout;
- }, l2.prototype.maybeReconnectOnOpen = function() {
- !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect();
- }, l2.prototype.open = l2.prototype.connect = function(t3, e3) {
- if (h2("readyState %s", this.readyState), ~this.readyState.indexOf("open"))
- return this;
- h2("opening %s", this.uri), this.engine = n2(this.uri, this.opts);
- var r3 = this.engine, o3 = this;
- this.readyState = "opening", this.skipReconnect = false;
- var i3 = a2(r3, "open", function() {
- o3.onopen(), t3 && t3();
- }), s3 = a2(r3, "error", function(e4) {
- if (h2("connect_error"), o3.cleanup(), o3.readyState = "closed", o3.emitAll("connect_error", e4), t3) {
- var r4 = new Error("Connection error");
- r4.data = e4, t3(r4);
- } else
- o3.maybeReconnectOnOpen();
- });
- if (false !== this._timeout) {
- var c3 = this._timeout;
- h2("connect attempt will timeout after %d", c3);
- var u3 = setTimeout(function() {
- h2("connect attempt timed out after %d", c3), i3.destroy(), r3.close(), r3.emit("error", "timeout"), o3.emitAll("connect_timeout", c3);
- }, c3);
- this.subs.push({ destroy: function() {
- clearTimeout(u3);
- } });
- }
- return this.subs.push(i3), this.subs.push(s3), this;
- }, l2.prototype.onopen = function() {
- h2("open"), this.cleanup(), this.readyState = "open", this.emit("open");
- var t3 = this.engine;
- 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")));
- }, l2.prototype.onping = function() {
- this.lastPing = /* @__PURE__ */ new Date(), this.emitAll("ping");
- }, l2.prototype.onpong = function() {
- this.emitAll("pong", /* @__PURE__ */ new Date() - this.lastPing);
- }, l2.prototype.ondata = function(t3) {
- this.decoder.add(t3);
- }, l2.prototype.ondecoded = function(t3) {
- this.emit("packet", t3);
- }, l2.prototype.onerror = function(t3) {
- h2("error", t3), this.emitAll("error", t3);
- }, l2.prototype.socket = function(t3, e3) {
- var r3 = this.nsps[t3];
- if (!r3) {
- r3 = new o2(this, t3, e3), this.nsps[t3] = r3;
- var n3 = this;
- r3.on("connecting", i3), r3.on("connect", function() {
- r3.id = n3.generateId(t3);
- }), this.autoConnect && i3();
- }
- function i3() {
- ~u2(n3.connecting, r3) || n3.connecting.push(r3);
- }
- return r3;
- }, l2.prototype.destroy = function(t3) {
- var e3 = u2(this.connecting, t3);
- ~e3 && this.connecting.splice(e3, 1), this.connecting.length || this.close();
- }, l2.prototype.packet = function(t3) {
- h2("writing packet %j", t3);
- var e3 = this;
- t3.query && 0 === t3.type && (t3.nsp += "?" + t3.query), e3.encoding ? e3.packetBuffer.push(t3) : (e3.encoding = true, this.encoder.encode(t3, function(r3) {
- for (var n3 = 0; n3 < r3.length; n3++)
- e3.engine.write(r3[n3], t3.options);
- e3.encoding = false, e3.processPacketQueue();
- }));
- }, l2.prototype.processPacketQueue = function() {
- if (this.packetBuffer.length > 0 && !this.encoding) {
- var t3 = this.packetBuffer.shift();
- this.packet(t3);
- }
- }, l2.prototype.cleanup = function() {
- h2("cleanup");
- for (var t3 = this.subs.length, e3 = 0; e3 < t3; e3++) {
- this.subs.shift().destroy();
- }
- this.packetBuffer = [], this.encoding = false, this.lastPing = null, this.decoder.destroy();
- }, l2.prototype.close = l2.prototype.disconnect = function() {
- h2("disconnect"), this.skipReconnect = true, this.reconnecting = false, "opening" === this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close();
- }, l2.prototype.onclose = function(t3) {
- h2("onclose"), this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", t3), this._reconnection && !this.skipReconnect && this.reconnect();
- }, l2.prototype.reconnect = function() {
- if (this.reconnecting || this.skipReconnect)
- return this;
- var t3 = this;
- if (this.backoff.attempts >= this._reconnectionAttempts)
- h2("reconnect failed"), this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = false;
- else {
- var e3 = this.backoff.duration();
- h2("will wait %dms before reconnect attempt", e3), this.reconnecting = true;
- var r3 = setTimeout(function() {
- t3.skipReconnect || (h2("attempting reconnect"), t3.emitAll("reconnect_attempt", t3.backoff.attempts), t3.emitAll("reconnecting", t3.backoff.attempts), t3.skipReconnect || t3.open(function(e4) {
- e4 ? (h2("reconnect attempt error"), t3.reconnecting = false, t3.reconnect(), t3.emitAll("reconnect_error", e4.data)) : (h2("reconnect success"), t3.onreconnect());
- }));
- }, e3);
- this.subs.push({ destroy: function() {
- clearTimeout(r3);
- } });
- }
- }, l2.prototype.onreconnect = function() {
- var t3 = this.backoff.attempts;
- this.reconnecting = false, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", t3);
- };
- }, function(t2, e2, r2) {
- var n2 = r2(7), o2 = r2(32), i2 = r2(40), s2 = r2(41);
- e2.polling = function(t3) {
- var e3 = false, r3 = false, s3 = false !== t3.jsonp;
- if ("undefined" != typeof location) {
- var a2 = "https:" === location.protocol, c2 = location.port;
- c2 || (c2 = a2 ? 443 : 80), e3 = t3.hostname !== location.hostname || c2 !== t3.port, r3 = t3.secure !== a2;
- }
- if (t3.xdomain = e3, t3.xscheme = r3, "open" in new n2(t3) && !t3.forceJSONP)
- return new o2(t3);
- if (!s3)
- throw new Error("JSONP disabled");
- return new i2(t3);
- }, e2.websocket = s2;
- }, function(t2, e2, r2) {
- var n2 = r2(8), o2 = r2(3), i2 = r2(2), s2 = r2(4), a2 = r2(17), c2 = r2(0)("engine.io-client:polling");
- t2.exports = u2;
- var h2 = null != new (r2(7))({ xdomain: false }).responseType;
- function u2(t3) {
- var e3 = t3 && t3.forceBase64;
- h2 && !e3 || (this.supportsBinary = false), n2.call(this, t3);
- }
- s2(u2, n2), u2.prototype.name = "polling", u2.prototype.doOpen = function() {
- this.poll();
- }, u2.prototype.pause = function(t3) {
- var e3 = this;
- function r3() {
- c2("paused"), e3.readyState = "paused", t3();
- }
- if (this.readyState = "pausing", this.polling || !this.writable) {
- var n3 = 0;
- this.polling && (c2("we are currently polling - waiting to pause"), n3++, this.once("pollComplete", function() {
- c2("pre-pause polling complete"), --n3 || r3();
- })), this.writable || (c2("we are currently writing - waiting to pause"), n3++, this.once("drain", function() {
- c2("pre-pause writing complete"), --n3 || r3();
- }));
- } else
- r3();
- }, u2.prototype.poll = function() {
- c2("polling"), this.polling = true, this.doPoll(), this.emit("poll");
- }, u2.prototype.onData = function(t3) {
- var e3 = this;
- c2("polling got data %s", t3);
- i2.decodePayload(t3, this.socket.binaryType, function(t4, r3, n3) {
- if ("opening" === e3.readyState && e3.onOpen(), "close" === t4.type)
- return e3.onClose(), false;
- e3.onPacket(t4);
- }), "closed" !== this.readyState && (this.polling = false, this.emit("pollComplete"), "open" === this.readyState ? this.poll() : c2('ignoring poll - transport state "%s"', this.readyState));
- }, u2.prototype.doClose = function() {
- var t3 = this;
- function e3() {
- c2("writing close packet"), t3.write([{ type: "close" }]);
- }
- "open" === this.readyState ? (c2("transport open - closing"), e3()) : (c2("transport not open - deferring close"), this.once("open", e3));
- }, u2.prototype.write = function(t3) {
- var e3 = this;
- this.writable = false;
- var r3 = function() {
- e3.writable = true, e3.emit("drain");
- };
- i2.encodePayload(t3, this.supportsBinary, function(t4) {
- e3.doWrite(t4, r3);
- });
- }, u2.prototype.uri = function() {
- var t3 = this.query || {}, e3 = this.secure ? "https" : "http", r3 = "";
- 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;
- };
- }, function(t2, e2, r2) {
- (function(e3) {
- 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);
- t2.exports = function t3(r3) {
- if (!r3 || "object" != typeof r3)
- return false;
- if (n2(r3)) {
- for (var o3 = 0, a2 = r3.length; o3 < a2; o3++)
- if (t3(r3[o3]))
- return true;
- return false;
- }
- if ("function" == typeof e3 && e3.isBuffer && e3.isBuffer(r3) || "function" == typeof ArrayBuffer && r3 instanceof ArrayBuffer || i2 && r3 instanceof Blob || s2 && r3 instanceof File)
- return true;
- if (r3.toJSON && "function" == typeof r3.toJSON && 1 === arguments.length)
- return t3(r3.toJSON(), true);
- for (var c2 in r3)
- if (Object.prototype.hasOwnProperty.call(r3, c2) && t3(r3[c2]))
- return true;
- return false;
- };
- }).call(this, r2(6).Buffer);
- }, function(t2, e2, r2) {
- var n2, o2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), i2 = {}, s2 = 0, a2 = 0;
- function c2(t3) {
- var e3 = "";
- do {
- e3 = o2[t3 % 64] + e3, t3 = Math.floor(t3 / 64);
- } while (t3 > 0);
- return e3;
- }
- function h2() {
- var t3 = c2(+/* @__PURE__ */ new Date());
- return t3 !== n2 ? (s2 = 0, n2 = t3) : t3 + "." + c2(s2++);
- }
- for (; a2 < 64; a2++)
- i2[o2[a2]] = a2;
- h2.encode = c2, h2.decode = function(t3) {
- var e3 = 0;
- for (a2 = 0; a2 < t3.length; a2++)
- e3 = 64 * e3 + i2[t3.charAt(a2)];
- return e3;
- }, t2.exports = h2;
- }, function(t2, e2) {
- var r2 = [].indexOf;
- t2.exports = function(t3, e3) {
- if (r2)
- return t3.indexOf(e3);
- for (var n2 = 0; n2 < t3.length; ++n2)
- if (t3[n2] === e3)
- return n2;
- return -1;
- };
- }, function(t2, e2, r2) {
- 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);
- t2.exports = l2;
- 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;
- function l2(t3, e3, r3) {
- 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();
- }
- o2(l2.prototype), l2.prototype.subEvents = function() {
- if (!this.subs) {
- var t3 = this.io;
- this.subs = [s2(t3, "open", a2(this, "onopen")), s2(t3, "packet", a2(this, "onpacket")), s2(t3, "close", a2(this, "onclose"))];
- }
- }, l2.prototype.open = l2.prototype.connect = function() {
- return this.connected || (this.subEvents(), this.io.open(), "open" === this.io.readyState && this.onopen(), this.emit("connecting")), this;
- }, l2.prototype.send = function() {
- var t3 = i2(arguments);
- return t3.unshift("message"), this.emit.apply(this, t3), this;
- }, l2.prototype.emit = function(t3) {
- if (f2.hasOwnProperty(t3))
- return p2.apply(this, arguments), this;
- var e3 = i2(arguments), r3 = { type: (void 0 !== this.flags.binary ? this.flags.binary : u2(e3)) ? n2.BINARY_EVENT : n2.EVENT, data: e3, options: {} };
- 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;
- }, l2.prototype.packet = function(t3) {
- t3.nsp = this.nsp, this.io.packet(t3);
- }, l2.prototype.onopen = function() {
- if (c2("transport is open - connecting"), "/" !== this.nsp)
- if (this.query) {
- var t3 = "object" == typeof this.query ? h2.encode(this.query) : this.query;
- c2("sending connect packet with query %s", t3), this.packet({ type: n2.CONNECT, query: t3 });
- } else
- this.packet({ type: n2.CONNECT });
- }, l2.prototype.onclose = function(t3) {
- c2("close (%s)", t3), this.connected = false, this.disconnected = true, delete this.id, this.emit("disconnect", t3);
- }, l2.prototype.onpacket = function(t3) {
- var e3 = t3.nsp === this.nsp, r3 = t3.type === n2.ERROR && "/" === t3.nsp;
- if (e3 || r3)
- switch (t3.type) {
- case n2.CONNECT:
- this.onconnect();
- break;
- case n2.EVENT:
- case n2.BINARY_EVENT:
- this.onevent(t3);
- break;
- case n2.ACK:
- case n2.BINARY_ACK:
- this.onack(t3);
- break;
- case n2.DISCONNECT:
- this.ondisconnect();
- break;
- case n2.ERROR:
- this.emit("error", t3.data);
- }
- }, l2.prototype.onevent = function(t3) {
- var e3 = t3.data || [];
- 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);
- }, l2.prototype.ack = function(t3) {
- var e3 = this, r3 = false;
- return function() {
- if (!r3) {
- r3 = true;
- var o3 = i2(arguments);
- c2("sending ack %j", o3), e3.packet({ type: u2(o3) ? n2.BINARY_ACK : n2.ACK, id: t3, data: o3 });
- }
- };
- }, l2.prototype.onack = function(t3) {
- var e3 = this.acks[t3.id];
- "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);
- }, l2.prototype.onconnect = function() {
- this.connected = true, this.disconnected = false, this.emit("connect"), this.emitBuffered();
- }, l2.prototype.emitBuffered = function() {
- var t3;
- for (t3 = 0; t3 < this.receiveBuffer.length; t3++)
- p2.apply(this, this.receiveBuffer[t3]);
- for (this.receiveBuffer = [], t3 = 0; t3 < this.sendBuffer.length; t3++)
- this.packet(this.sendBuffer[t3]);
- this.sendBuffer = [];
- }, l2.prototype.ondisconnect = function() {
- c2("server disconnect (%s)", this.nsp), this.destroy(), this.onclose("io server disconnect");
- }, l2.prototype.destroy = function() {
- if (this.subs) {
- for (var t3 = 0; t3 < this.subs.length; t3++)
- this.subs[t3].destroy();
- this.subs = null;
- }
- this.io.destroy(this);
- }, l2.prototype.close = l2.prototype.disconnect = function() {
- return this.connected && (c2("performing disconnect (%s)", this.nsp), this.packet({ type: n2.DISCONNECT })), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
- }, l2.prototype.compress = function(t3) {
- return this.flags.compress = t3, this;
- }, l2.prototype.binary = function(t3) {
- return this.flags.binary = t3, this;
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3, r2) {
- return t3.on(e3, r2), { destroy: function() {
- t3.removeListener(e3, r2);
- } };
- };
- }, function(t2, e2) {
- var r2 = [].slice;
- t2.exports = function(t3, e3) {
- if ("string" == typeof e3 && (e3 = t3[e3]), "function" != typeof e3)
- throw new Error("bind() requires a function");
- var n2 = r2.call(arguments, 2);
- return function() {
- return e3.apply(t3, n2.concat(r2.call(arguments)));
- };
- };
- }, function(t2, e2, r2) {
- t2.exports = r2(23);
- }, function(t2, e2, r2) {
- var n2 = r2(24), o2 = r2(5), i2 = r2(13), s2 = r2(0)("socket.io-client");
- t2.exports = e2 = c2;
- var a2 = e2.managers = {};
- function c2(t3, e3) {
- "object" == typeof t3 && (e3 = t3, t3 = void 0), e3 = e3 || {};
- var r3, o3 = n2(t3), c3 = o3.source, h2 = o3.id, u2 = o3.path, f2 = a2[h2] && u2 in a2[h2].nsps;
- 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);
- }
- e2.protocol = o2.protocol, e2.connect = c2, e2.Manager = r2(13), e2.Socket = r2(19);
- }, function(t2, e2, r2) {
- var n2 = r2(9), o2 = r2(0)("socket.io-client:url");
- t2.exports = function(t3, e3) {
- var r3 = t3;
- e3 = e3 || "undefined" != typeof location && location, null == t3 && (t3 = e3.protocol + "//" + e3.host);
- "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));
- r3.port || (/^(http|ws)$/.test(r3.protocol) ? r3.port = "80" : /^(http|ws)s$/.test(r3.protocol) && (r3.port = "443"));
- r3.path = r3.path || "/";
- var i2 = -1 !== r3.host.indexOf(":") ? "[" + r3.host + "]" : r3.host;
- return r3.id = r3.protocol + "://" + i2 + ":" + r3.port, r3.href = r3.protocol + "://" + i2 + (e3 && e3.port === r3.port ? "" : ":" + r3.port), r3;
- };
- }, function(t2, e2, r2) {
- 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);
- e2.deconstructPacket = function(t3) {
- var e3 = [], r3 = t3.data, i3 = t3;
- return i3.data = function t4(e4, r4) {
- if (!e4)
- return e4;
- if (o2(e4)) {
- var i4 = { _placeholder: true, num: r4.length };
- return r4.push(e4), i4;
- }
- if (n2(e4)) {
- for (var s3 = new Array(e4.length), a3 = 0; a3 < e4.length; a3++)
- s3[a3] = t4(e4[a3], r4);
- return s3;
- }
- if ("object" == typeof e4 && !(e4 instanceof Date)) {
- s3 = {};
- for (var c2 in e4)
- s3[c2] = t4(e4[c2], r4);
- return s3;
- }
- return e4;
- }(r3, e3), i3.attachments = e3.length, { packet: i3, buffers: e3 };
- }, e2.reconstructPacket = function(t3, e3) {
- return t3.data = function t4(e4, r3) {
- if (!e4)
- return e4;
- if (e4 && e4._placeholder)
- return r3[e4.num];
- if (n2(e4))
- for (var o3 = 0; o3 < e4.length; o3++)
- e4[o3] = t4(e4[o3], r3);
- else if ("object" == typeof e4)
- for (var i3 in e4)
- e4[i3] = t4(e4[i3], r3);
- return e4;
- }(t3.data, e3), t3.attachments = void 0, t3;
- }, e2.removeBlobs = function(t3, e3) {
- var r3 = 0, i3 = t3;
- !function t4(c2, h2, u2) {
- if (!c2)
- return c2;
- if (s2 && c2 instanceof Blob || a2 && c2 instanceof File) {
- r3++;
- var f2 = new FileReader();
- f2.onload = function() {
- u2 ? u2[h2] = this.result : i3 = this.result, --r3 || e3(i3);
- }, f2.readAsArrayBuffer(c2);
- } else if (n2(c2))
- for (var p2 = 0; p2 < c2.length; p2++)
- t4(c2[p2], p2, c2);
- else if ("object" == typeof c2 && !o2(c2))
- for (var l2 in c2)
- t4(c2[l2], l2, c2);
- }(i3), r3 || e3(i3);
- };
- }, function(t2, e2, r2) {
- e2.byteLength = function(t3) {
- var e3 = h2(t3), r3 = e3[0], n3 = e3[1];
- return 3 * (r3 + n3) / 4 - n3;
- }, e2.toByteArray = function(t3) {
- var e3, r3, n3 = h2(t3), s3 = n3[0], a3 = n3[1], c3 = new i2(function(t4, e4, r4) {
- return 3 * (e4 + r4) / 4 - r4;
- }(0, s3, a3)), u3 = 0, f2 = a3 > 0 ? s3 - 4 : s3;
- for (r3 = 0; r3 < f2; r3 += 4)
- 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;
- 2 === a3 && (e3 = o2[t3.charCodeAt(r3)] << 2 | o2[t3.charCodeAt(r3 + 1)] >> 4, c3[u3++] = 255 & e3);
- 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);
- return c3;
- }, e2.fromByteArray = function(t3) {
- for (var e3, r3 = t3.length, o3 = r3 % 3, i3 = [], s3 = 0, a3 = r3 - o3; s3 < a3; s3 += 16383)
- i3.push(u2(t3, s3, s3 + 16383 > a3 ? a3 : s3 + 16383));
- 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] + "="));
- return i3.join("");
- };
- for (var n2 = [], o2 = [], i2 = "undefined" != typeof Uint8Array ? Uint8Array : Array, s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a2 = 0, c2 = s2.length; a2 < c2; ++a2)
- n2[a2] = s2[a2], o2[s2.charCodeAt(a2)] = a2;
- function h2(t3) {
- var e3 = t3.length;
- if (e3 % 4 > 0)
- throw new Error("Invalid string. Length must be a multiple of 4");
- var r3 = t3.indexOf("=");
- return -1 === r3 && (r3 = e3), [r3, r3 === e3 ? 0 : 4 - r3 % 4];
- }
- function u2(t3, e3, r3) {
- for (var o3, i3, s3 = [], a3 = e3; a3 < r3; a3 += 3)
- 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]);
- return s3.join("");
- }
- o2["-".charCodeAt(0)] = 62, o2["_".charCodeAt(0)] = 63;
- }, function(t2, e2) {
- e2.read = function(t3, e3, r2, n2, o2) {
- 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];
- for (f2 += p2, i2 = l2 & (1 << -u2) - 1, l2 >>= -u2, u2 += a2; u2 > 0; i2 = 256 * i2 + t3[e3 + f2], f2 += p2, u2 -= 8)
- ;
- for (s2 = i2 & (1 << -u2) - 1, i2 >>= -u2, u2 += n2; u2 > 0; s2 = 256 * s2 + t3[e3 + f2], f2 += p2, u2 -= 8)
- ;
- if (0 === i2)
- i2 = 1 - h2;
- else {
- if (i2 === c2)
- return s2 ? NaN : 1 / 0 * (l2 ? -1 : 1);
- s2 += Math.pow(2, n2), i2 -= h2;
- }
- return (l2 ? -1 : 1) * s2 * Math.pow(2, i2 - n2);
- }, e2.write = function(t3, e3, r2, n2, o2, i2) {
- 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;
- 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)
- ;
- for (s2 = s2 << o2 | a2, h2 += o2; h2 > 0; t3[r2 + l2] = 255 & s2, l2 += d2, s2 /= 256, h2 -= 8)
- ;
- t3[r2 + l2 - d2] |= 128 * y2;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2, r2) {
- t2.exports = r2(30), t2.exports.parser = r2(2);
- }, function(t2, e2, r2) {
- 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);
- function u2(t3, e3) {
- if (!(this instanceof u2))
- return new u2(t3, e3);
- 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();
- }
- 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) {
- i2('creating transport "%s"', t3);
- var e3 = function(t4) {
- var e4 = {};
- for (var r4 in t4)
- t4.hasOwnProperty(r4) && (e4[r4] = t4[r4]);
- return e4;
- }(this.query);
- e3.EIO = a2.protocol, e3.transport = t3;
- var r3 = this.transportOptions[t3] || {};
- 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 });
- }, u2.prototype.open = function() {
- var t3;
- if (this.rememberUpgrade && u2.priorWebsocketSuccess && -1 !== this.transports.indexOf("websocket"))
- t3 = "websocket";
- else {
- if (0 === this.transports.length) {
- var e3 = this;
- return void setTimeout(function() {
- e3.emit("error", "No transports available");
- }, 0);
- }
- t3 = this.transports[0];
- }
- this.readyState = "opening";
- try {
- t3 = this.createTransport(t3);
- } catch (t4) {
- return this.transports.shift(), void this.open();
- }
- t3.open(), this.setTransport(t3);
- }, u2.prototype.setTransport = function(t3) {
- i2("setting transport %s", t3.name);
- var e3 = this;
- this.transport && (i2("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = t3, t3.on("drain", function() {
- e3.onDrain();
- }).on("packet", function(t4) {
- e3.onPacket(t4);
- }).on("error", function(t4) {
- e3.onError(t4);
- }).on("close", function() {
- e3.onClose("transport close");
- });
- }, u2.prototype.probe = function(t3) {
- i2('probing transport "%s"', t3);
- var e3 = this.createTransport(t3, { probe: 1 }), r3 = false, n3 = this;
- function o3() {
- if (n3.onlyBinaryUpgrades) {
- var o4 = !this.supportsBinary && n3.transport.supportsBinary;
- r3 = r3 || o4;
- }
- r3 || (i2('probe transport "%s" opened', t3), e3.send([{ type: "ping", data: "probe" }]), e3.once("packet", function(o5) {
- if (!r3)
- if ("pong" === o5.type && "probe" === o5.data) {
- if (i2('probe transport "%s" pong', t3), n3.upgrading = true, n3.emit("upgrading", e3), !e3)
- return;
- u2.priorWebsocketSuccess = "websocket" === e3.name, i2('pausing current transport "%s"', n3.transport.name), n3.transport.pause(function() {
- 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());
- });
- } else {
- i2('probe transport "%s" failed', t3);
- var s4 = new Error("probe error");
- s4.transport = e3.name, n3.emit("upgradeError", s4);
- }
- }));
- }
- function s3() {
- r3 || (r3 = true, p2(), e3.close(), e3 = null);
- }
- function a3(r4) {
- var o4 = new Error("probe error: " + r4);
- o4.transport = e3.name, s3(), i2('probe transport "%s" failed because of error: %s', t3, r4), n3.emit("upgradeError", o4);
- }
- function c3() {
- a3("transport closed");
- }
- function h3() {
- a3("socket closed");
- }
- function f2(t4) {
- e3 && t4.name !== e3.name && (i2('"%s" works - aborting "%s"', t4.name, e3.name), s3());
- }
- function p2() {
- e3.removeListener("open", o3), e3.removeListener("error", a3), e3.removeListener("close", c3), n3.removeListener("close", h3), n3.removeListener("upgrading", f2);
- }
- 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();
- }, u2.prototype.onOpen = function() {
- 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) {
- i2("starting upgrade probes");
- for (var t3 = 0, e3 = this.upgrades.length; t3 < e3; t3++)
- this.probe(this.upgrades[t3]);
- }
- }, u2.prototype.onPacket = function(t3) {
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState)
- switch (i2('socket receive: type "%s", data "%s"', t3.type, t3.data), this.emit("packet", t3), this.emit("heartbeat"), t3.type) {
- case "open":
- this.onHandshake(JSON.parse(t3.data));
- break;
- case "pong":
- this.setPing(), this.emit("pong");
- break;
- case "error":
- var e3 = new Error("server error");
- e3.code = t3.data, this.onError(e3);
- break;
- case "message":
- this.emit("data", t3.data), this.emit("message", t3.data);
- }
- else
- i2('packet received with socket readyState "%s"', this.readyState);
- }, u2.prototype.onHandshake = function(t3) {
- 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));
- }, u2.prototype.onHeartbeat = function(t3) {
- clearTimeout(this.pingTimeoutTimer);
- var e3 = this;
- e3.pingTimeoutTimer = setTimeout(function() {
- "closed" !== e3.readyState && e3.onClose("ping timeout");
- }, t3 || e3.pingInterval + e3.pingTimeout);
- }, u2.prototype.setPing = function() {
- var t3 = this;
- clearTimeout(t3.pingIntervalTimer), t3.pingIntervalTimer = setTimeout(function() {
- i2("writing ping packet - expecting pong within %sms", t3.pingTimeout), t3.ping(), t3.onHeartbeat(t3.pingTimeout);
- }, t3.pingInterval);
- }, u2.prototype.ping = function() {
- var t3 = this;
- this.sendPacket("ping", function() {
- t3.emit("ping");
- });
- }, u2.prototype.onDrain = function() {
- this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush();
- }, u2.prototype.flush = function() {
- "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"));
- }, u2.prototype.write = u2.prototype.send = function(t3, e3, r3) {
- return this.sendPacket("message", t3, e3, r3), this;
- }, u2.prototype.sendPacket = function(t3, e3, r3, n3) {
- if ("function" == typeof e3 && (n3 = e3, e3 = void 0), "function" == typeof r3 && (n3 = r3, r3 = null), "closing" !== this.readyState && "closed" !== this.readyState) {
- (r3 = r3 || {}).compress = false !== r3.compress;
- var o3 = { type: t3, data: e3, options: r3 };
- this.emit("packetCreate", o3), this.writeBuffer.push(o3), n3 && this.once("flush", n3), this.flush();
- }
- }, u2.prototype.close = function() {
- if ("opening" === this.readyState || "open" === this.readyState) {
- this.readyState = "closing";
- var t3 = this;
- this.writeBuffer.length ? this.once("drain", function() {
- this.upgrading ? n3() : e3();
- }) : this.upgrading ? n3() : e3();
- }
- function e3() {
- t3.onClose("forced close"), i2("socket closing - telling transport to close"), t3.transport.close();
- }
- function r3() {
- t3.removeListener("upgrade", r3), t3.removeListener("upgradeError", r3), e3();
- }
- function n3() {
- t3.once("upgrade", r3), t3.once("upgradeError", r3);
- }
- return this;
- }, u2.prototype.onError = function(t3) {
- i2("socket error %j", t3), u2.priorWebsocketSuccess = false, this.emit("error", t3), this.onClose("transport error", t3);
- }, u2.prototype.onClose = function(t3, e3) {
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
- i2('socket close with reason: "%s"', t3);
- 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;
- }
- }, u2.prototype.filterUpgrades = function(t3) {
- for (var e3 = [], r3 = 0, n3 = t3.length; r3 < n3; r3++)
- ~s2(this.transports, t3[r3]) && e3.push(t3[r3]);
- return e3;
- };
- }, function(t2, e2) {
- try {
- t2.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest();
- } catch (e3) {
- t2.exports = false;
- }
- }, function(t2, e2, r2) {
- var n2 = r2(7), o2 = r2(15), i2 = r2(1), s2 = r2(4), a2 = r2(0)("engine.io-client:polling-xhr");
- function c2() {
- }
- function h2(t3) {
- if (o2.call(this, t3), this.requestTimeout = t3.requestTimeout, this.extraHeaders = t3.extraHeaders, "undefined" != typeof location) {
- var e3 = "https:" === location.protocol, r3 = location.port;
- r3 || (r3 = e3 ? 443 : 80), this.xd = "undefined" != typeof location && t3.hostname !== location.hostname || r3 !== t3.port, this.xs = t3.secure !== e3;
- }
- }
- function u2(t3) {
- 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();
- }
- if (t2.exports = h2, t2.exports.Request = u2, s2(h2, o2), h2.prototype.supportsBinary = true, h2.prototype.request = function(t3) {
- 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);
- }, h2.prototype.doWrite = function(t3, e3) {
- var r3 = "string" != typeof t3 && void 0 !== t3, n3 = this.request({ method: "POST", data: t3, isBinary: r3 }), o3 = this;
- n3.on("success", e3), n3.on("error", function(t4) {
- o3.onError("xhr post error", t4);
- }), this.sendXhr = n3;
- }, h2.prototype.doPoll = function() {
- a2("xhr poll");
- var t3 = this.request(), e3 = this;
- t3.on("data", function(t4) {
- e3.onData(t4);
- }), t3.on("error", function(t4) {
- e3.onError("xhr poll error", t4);
- }), this.pollXhr = t3;
- }, i2(u2.prototype), u2.prototype.create = function() {
- var t3 = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
- 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;
- var e3 = this.xhr = new n2(t3), r3 = this;
- try {
- a2("xhr open %s: %s", this.method, this.uri), e3.open(this.method, this.uri, this.async);
- try {
- if (this.extraHeaders)
- for (var o3 in e3.setDisableHeaderCheck && e3.setDisableHeaderCheck(true), this.extraHeaders)
- this.extraHeaders.hasOwnProperty(o3) && e3.setRequestHeader(o3, this.extraHeaders[o3]);
- } catch (t4) {
- }
- if ("POST" === this.method)
- try {
- this.isBinary ? e3.setRequestHeader("Content-type", "application/octet-stream") : e3.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
- } catch (t4) {
- }
- try {
- e3.setRequestHeader("Accept", "*/*");
- } catch (t4) {
- }
- "withCredentials" in e3 && (e3.withCredentials = this.withCredentials), this.requestTimeout && (e3.timeout = this.requestTimeout), this.hasXDR() ? (e3.onload = function() {
- r3.onLoad();
- }, e3.onerror = function() {
- r3.onError(e3.responseText);
- }) : e3.onreadystatechange = function() {
- if (2 === e3.readyState)
- try {
- var t4 = e3.getResponseHeader("Content-Type");
- (r3.supportsBinary && "application/octet-stream" === t4 || "application/octet-stream; charset=UTF-8" === t4) && (e3.responseType = "arraybuffer");
- } catch (t5) {
- }
- 4 === e3.readyState && (200 === e3.status || 1223 === e3.status ? r3.onLoad() : setTimeout(function() {
- r3.onError("number" == typeof e3.status ? e3.status : 0);
- }, 0));
- }, a2("xhr data %s", this.data), e3.send(this.data);
- } catch (t4) {
- return void setTimeout(function() {
- r3.onError(t4);
- }, 0);
- }
- "undefined" != typeof document && (this.index = u2.requestsCount++, u2.requests[this.index] = this);
- }, u2.prototype.onSuccess = function() {
- this.emit("success"), this.cleanup();
- }, u2.prototype.onData = function(t3) {
- this.emit("data", t3), this.onSuccess();
- }, u2.prototype.onError = function(t3) {
- this.emit("error", t3), this.cleanup(true);
- }, u2.prototype.cleanup = function(t3) {
- if (void 0 !== this.xhr && null !== this.xhr) {
- if (this.hasXDR() ? this.xhr.onload = this.xhr.onerror = c2 : this.xhr.onreadystatechange = c2, t3)
- try {
- this.xhr.abort();
- } catch (t4) {
- }
- "undefined" != typeof document && delete u2.requests[this.index], this.xhr = null;
- }
- }, u2.prototype.onLoad = function() {
- var t3;
- try {
- var e3;
- try {
- e3 = this.xhr.getResponseHeader("Content-Type");
- } catch (t4) {
- }
- t3 = ("application/octet-stream" === e3 || "application/octet-stream; charset=UTF-8" === e3) && this.xhr.response || this.xhr.responseText;
- } catch (t4) {
- this.onError(t4);
- }
- null != t3 && this.onData(t3);
- }, u2.prototype.hasXDR = function() {
- return "undefined" != typeof XDomainRequest && !this.xs && this.enablesXDR;
- }, u2.prototype.abort = function() {
- this.cleanup();
- }, u2.requestsCount = 0, u2.requests = {}, "undefined" != typeof document) {
- if ("function" == typeof attachEvent)
- attachEvent("onunload", p2);
- else if ("function" == typeof addEventListener) {
- var f2 = "onpagehide" in self ? "pagehide" : "unload";
- addEventListener(f2, p2, false);
- }
- }
- function p2() {
- for (var t3 in u2.requests)
- u2.requests.hasOwnProperty(t3) && u2.requests[t3].abort();
- }
- }, function(t2, e2) {
- t2.exports = Object.keys || function(t3) {
- var e3 = [], r2 = Object.prototype.hasOwnProperty;
- for (var n2 in t3)
- r2.call(t3, n2) && e3.push(n2);
- return e3;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3, r2) {
- var n2 = t3.byteLength;
- if (e3 = e3 || 0, r2 = r2 || n2, t3.slice)
- return t3.slice(e3, r2);
- if (e3 < 0 && (e3 += n2), r2 < 0 && (r2 += n2), r2 > n2 && (r2 = n2), e3 >= n2 || e3 >= r2 || 0 === n2)
- return new ArrayBuffer(0);
- for (var o2 = new Uint8Array(t3), i2 = new Uint8Array(r2 - e3), s2 = e3, a2 = 0; s2 < r2; s2++, a2++)
- i2[a2] = o2[s2];
- return i2.buffer;
- };
- }, function(t2, e2) {
- function r2() {
- }
- t2.exports = function(t3, e3, n2) {
- var o2 = false;
- return n2 = n2 || r2, i2.count = t3, 0 === t3 ? e3() : i2;
- function i2(t4, r3) {
- if (i2.count <= 0)
- throw new Error("after called too many times");
- --i2.count, t4 ? (o2 = true, e3(t4), e3 = n2) : 0 !== i2.count || o2 || e3(null, r3);
- }
- };
- }, function(t2, e2) {
- /*! https://mths.be/utf8js v2.1.2 by @mathias */
- var r2, n2, o2, i2 = String.fromCharCode;
- function s2(t3) {
- for (var e3, r3, n3 = [], o3 = 0, i3 = t3.length; o3 < i3; )
- (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);
- return n3;
- }
- function a2(t3, e3) {
- if (t3 >= 55296 && t3 <= 57343) {
- if (e3)
- throw Error("Lone surrogate U+" + t3.toString(16).toUpperCase() + " is not a scalar value");
- return false;
- }
- return true;
- }
- function c2(t3, e3) {
- return i2(t3 >> e3 & 63 | 128);
- }
- function h2(t3, e3) {
- if (0 == (4294967168 & t3))
- return i2(t3);
- var r3 = "";
- 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);
- }
- function u2() {
- if (o2 >= n2)
- throw Error("Invalid byte index");
- var t3 = 255 & r2[o2];
- if (o2++, 128 == (192 & t3))
- return 63 & t3;
- throw Error("Invalid continuation byte");
- }
- function f2(t3) {
- var e3, i3;
- if (o2 > n2)
- throw Error("Invalid byte index");
- if (o2 == n2)
- return false;
- if (e3 = 255 & r2[o2], o2++, 0 == (128 & e3))
- return e3;
- if (192 == (224 & e3)) {
- if ((i3 = (31 & e3) << 6 | u2()) >= 128)
- return i3;
- throw Error("Invalid continuation byte");
- }
- if (224 == (240 & e3)) {
- if ((i3 = (15 & e3) << 12 | u2() << 6 | u2()) >= 2048)
- return a2(i3, t3) ? i3 : 65533;
- throw Error("Invalid continuation byte");
- }
- if (240 == (248 & e3) && (i3 = (7 & e3) << 18 | u2() << 12 | u2() << 6 | u2()) >= 65536 && i3 <= 1114111)
- return i3;
- throw Error("Invalid UTF-8 detected");
- }
- t2.exports = { version: "2.1.2", encode: function(t3, e3) {
- for (var r3 = false !== (e3 = e3 || {}).strict, n3 = s2(t3), o3 = n3.length, i3 = -1, a3 = ""; ++i3 < o3; )
- a3 += h2(n3[i3], r3);
- return a3;
- }, decode: function(t3, e3) {
- var a3 = false !== (e3 = e3 || {}).strict;
- r2 = s2(t3), n2 = r2.length, o2 = 0;
- for (var c3, h3 = []; false !== (c3 = f2(a3)); )
- h3.push(c3);
- return function(t4) {
- for (var e4, r3 = t4.length, n3 = -1, o3 = ""; ++n3 < r3; )
- (e4 = t4[n3]) > 65535 && (o3 += i2((e4 -= 65536) >>> 10 & 1023 | 55296), e4 = 56320 | 1023 & e4), o3 += i2(e4);
- return o3;
- }(h3);
- } };
- }, function(t2, e2) {
- !function() {
- for (var t3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r2 = new Uint8Array(256), n2 = 0; n2 < t3.length; n2++)
- r2[t3.charCodeAt(n2)] = n2;
- e2.encode = function(e3) {
- var r3, n3 = new Uint8Array(e3), o2 = n3.length, i2 = "";
- for (r3 = 0; r3 < o2; r3 += 3)
- 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]];
- return o2 % 3 == 2 ? i2 = i2.substring(0, i2.length - 1) + "=" : o2 % 3 == 1 && (i2 = i2.substring(0, i2.length - 2) + "=="), i2;
- }, e2.decode = function(t4) {
- var e3, n3, o2, i2, s2, a2 = 0.75 * t4.length, c2 = t4.length, h2 = 0;
- "=" === t4[t4.length - 1] && (a2--, "=" === t4[t4.length - 2] && a2--);
- var u2 = new ArrayBuffer(a2), f2 = new Uint8Array(u2);
- for (e3 = 0; e3 < c2; e3 += 4)
- 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;
- return u2;
- };
- }();
- }, function(t2, e2) {
- var r2 = void 0 !== r2 ? r2 : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder && MozBlobBuilder, n2 = function() {
- try {
- return 2 === new Blob(["hi"]).size;
- } catch (t3) {
- return false;
- }
- }(), o2 = n2 && function() {
- try {
- return 2 === new Blob([new Uint8Array([1, 2])]).size;
- } catch (t3) {
- return false;
- }
- }(), i2 = r2 && r2.prototype.append && r2.prototype.getBlob;
- function s2(t3) {
- return t3.map(function(t4) {
- if (t4.buffer instanceof ArrayBuffer) {
- var e3 = t4.buffer;
- if (t4.byteLength !== e3.byteLength) {
- var r3 = new Uint8Array(t4.byteLength);
- r3.set(new Uint8Array(e3, t4.byteOffset, t4.byteLength)), e3 = r3.buffer;
- }
- return e3;
- }
- return t4;
- });
- }
- function a2(t3, e3) {
- e3 = e3 || {};
- var n3 = new r2();
- return s2(t3).forEach(function(t4) {
- n3.append(t4);
- }), e3.type ? n3.getBlob(e3.type) : n3.getBlob();
- }
- function c2(t3, e3) {
- return new Blob(s2(t3), e3 || {});
- }
- "undefined" != typeof Blob && (a2.prototype = Blob.prototype, c2.prototype = Blob.prototype), t2.exports = n2 ? o2 ? Blob : c2 : i2 ? a2 : void 0;
- }, function(t2, e2, r2) {
- (function(e3) {
- var n2 = r2(15), o2 = r2(4);
- t2.exports = u2;
- var i2, s2 = /\n/g, a2 = /\\n/g;
- function c2() {
- }
- function h2() {
- return "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== e3 ? e3 : {};
- }
- function u2(t3) {
- if (n2.call(this, t3), this.query = this.query || {}, !i2) {
- var e4 = h2();
- i2 = e4.___eio = e4.___eio || [];
- }
- this.index = i2.length;
- var r3 = this;
- i2.push(function(t4) {
- r3.onData(t4);
- }), this.query.j = this.index, "function" == typeof addEventListener && addEventListener("beforeunload", function() {
- r3.script && (r3.script.onerror = c2);
- }, false);
- }
- o2(u2, n2), u2.prototype.supportsBinary = false, u2.prototype.doClose = function() {
- 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);
- }, u2.prototype.doPoll = function() {
- var t3 = this, e4 = document.createElement("script");
- this.script && (this.script.parentNode.removeChild(this.script), this.script = null), e4.async = true, e4.src = this.uri(), e4.onerror = function(e5) {
- t3.onError("jsonp poll error", e5);
- };
- var r3 = document.getElementsByTagName("script")[0];
- 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() {
- var t4 = document.createElement("iframe");
- document.body.appendChild(t4), document.body.removeChild(t4);
- }, 100);
- }, u2.prototype.doWrite = function(t3, e4) {
- var r3 = this;
- if (!this.form) {
- var n3, o3 = document.createElement("form"), i3 = document.createElement("textarea"), c3 = this.iframeId = "eio_iframe_" + this.index;
- 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;
- }
- function h3() {
- u3(), e4();
- }
- function u3() {
- if (r3.iframe)
- try {
- r3.form.removeChild(r3.iframe);
- } catch (t5) {
- r3.onError("jsonp polling iframe removal error", t5);
- }
- try {
- var t4 = '<iframe src="javascript:0" name="' + r3.iframeId + '">';
- n3 = document.createElement(t4);
- } catch (t5) {
- (n3 = document.createElement("iframe")).name = r3.iframeId, n3.src = "javascript:0";
- }
- n3.id = r3.iframeId, r3.form.appendChild(n3), r3.iframe = n3;
- }
- this.form.action = this.uri(), u3(), t3 = t3.replace(a2, "\\\n"), this.area.value = t3.replace(s2, "\\n");
- try {
- this.form.submit();
- } catch (t4) {
- }
- this.iframe.attachEvent ? this.iframe.onreadystatechange = function() {
- "complete" === r3.iframe.readyState && h3();
- } : this.iframe.onload = h3;
- };
- }).call(this, r2(12));
- }, function(t2, e2, r2) {
- (function(e3) {
- 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");
- if ("undefined" != typeof WebSocket ? n2 = WebSocket : "undefined" != typeof self && (n2 = self.WebSocket || self.MozWebSocket), "undefined" == typeof window)
- try {
- o2 = r2(42);
- } catch (t3) {
- }
- var f2 = n2 || o2;
- function p2(t3) {
- 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);
- }
- t2.exports = p2, c2(p2, i2), p2.prototype.name = "websocket", p2.prototype.supportsBinary = true, p2.prototype.doOpen = function() {
- if (this.check()) {
- var t3 = this.uri(), e4 = this.protocols, r3 = { agent: this.agent, perMessageDeflate: this.perMessageDeflate };
- 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);
- try {
- this.ws = this.usingBrowserWebSocket && !this.isReactNative ? e4 ? new f2(t3, e4) : new f2(t3) : new f2(t3, e4, r3);
- } catch (t4) {
- return this.emit("error", t4);
- }
- 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();
- }
- }, p2.prototype.addEventListeners = function() {
- var t3 = this;
- this.ws.onopen = function() {
- t3.onOpen();
- }, this.ws.onclose = function() {
- t3.onClose();
- }, this.ws.onmessage = function(e4) {
- t3.onData(e4.data);
- }, this.ws.onerror = function(e4) {
- t3.onError("websocket error", e4);
- };
- }, p2.prototype.write = function(t3) {
- var r3 = this;
- this.writable = false;
- for (var n3 = t3.length, o3 = 0, i3 = n3; o3 < i3; o3++)
- !function(t4) {
- s2.encodePacket(t4, r3.supportsBinary, function(o4) {
- if (!r3.usingBrowserWebSocket) {
- var i4 = {};
- if (t4.options && (i4.compress = t4.options.compress), r3.perMessageDeflate)
- ("string" == typeof o4 ? e3.byteLength(o4) : o4.length) < r3.perMessageDeflate.threshold && (i4.compress = false);
- }
- try {
- r3.usingBrowserWebSocket ? r3.ws.send(o4) : r3.ws.send(o4, i4);
- } catch (t5) {
- u2("websocket closed before onclose event");
- }
- --n3 || a3();
- });
- }(t3[o3]);
- function a3() {
- r3.emit("flush"), setTimeout(function() {
- r3.writable = true, r3.emit("drain");
- }, 0);
- }
- }, p2.prototype.onClose = function() {
- i2.prototype.onClose.call(this);
- }, p2.prototype.doClose = function() {
- void 0 !== this.ws && this.ws.close();
- }, p2.prototype.uri = function() {
- var t3 = this.query || {}, e4 = this.secure ? "wss" : "ws", r3 = "";
- 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;
- }, p2.prototype.check = function() {
- return !(!f2 || "__initialize" in f2 && this.name === p2.prototype.name);
- };
- }).call(this, r2(6).Buffer);
- }, function(t2, e2, r2) {
- const n2 = r2(43), o2 = r2(44), i2 = r2(0)("@hyoga/uni-socket:"), s2 = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], a2 = index$1 || wx$1;
- class c2 extends n2 {
- constructor(t3, e3, r3) {
- 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));
- }
- get CONNECTING() {
- return c2.CONNECTING;
- }
- get CLOSING() {
- return c2.CLOSING;
- }
- get CLOSED() {
- return c2.CLOSED;
- }
- get OPEN() {
- return c2.OPEN;
- }
- addSocketEventListeners() {
- this._socket.onOpen(() => {
- this.readyState = c2.OPEN, this.onopen();
- }), this._socket.onClose((t3) => {
- i2("onclose: ", t3), this.readyState = c2.CLOSED, this.onclose(t3.code, t3.reason);
- }), this._socket.onError((t3) => {
- i2("onerror: ", t3), this.onerror(t3);
- }), this._socket.onMessage((t3) => {
- this.onmessage(t3);
- });
- }
- send(t3) {
- i2("send data: ", t3, this.readyState), this.readyState === c2.OPEN && this._socket.send({ data: t3 });
- }
- close(t3, e3) {
- i2("close socket: ", t3, e3), this.readyState = c2.CLOSING, this._socket.close({ code: t3, reason: e3 });
- }
- }
- function h2(t3, e3, r3) {
- Object.assign(r3, { url: t3, header: { "content-type": "application/json" }, protocols: e3, method: "GET" }), this._socket = function(t4) {
- const e4 = a2.connectSocket({ complete: () => {
- }, ...t4 });
- if (e4)
- return e4;
- return { onClose: a2.onSocketClose, onOpen: a2.onSocketOpen, onError: a2.onSocketError, onMessage: a2.onSocketMessage, send: a2.sendSocketMessage, close: a2.closeSocket };
- }(r3), this.addSocketEventListeners();
- }
- s2.forEach((t3, e3) => {
- c2[s2[e3]] = e3;
- });
- ["open", "error", "close", "message"].forEach((t3) => {
- Object.defineProperty(c2.prototype, `on${t3}`, { get() {
- const e3 = this.listeners(t3);
- for (var r3 = 0; r3 < e3.length; r3++)
- if (e3[r3]._listener)
- return e3[r3]._listener;
- }, set(e3) {
- const r3 = this.listeners(t3);
- for (var n3 = 0; n3 < r3.length; n3++)
- r3[n3]._listener && this.removeListener(t3, r3[n3]);
- this.addEventListener(t3, e3);
- } });
- }), c2.prototype.addEventListener = o2.addEventListener, c2.prototype.removeEventListener = o2.removeEventListener, t2.exports = c2;
- }, function(t2, e2, r2) {
- var n2, o2 = "object" == typeof Reflect ? Reflect : null, i2 = o2 && "function" == typeof o2.apply ? o2.apply : function(t3, e3, r3) {
- return Function.prototype.apply.call(t3, e3, r3);
- };
- n2 = o2 && "function" == typeof o2.ownKeys ? o2.ownKeys : Object.getOwnPropertySymbols ? function(t3) {
- return Object.getOwnPropertyNames(t3).concat(Object.getOwnPropertySymbols(t3));
- } : function(t3) {
- return Object.getOwnPropertyNames(t3);
- };
- var s2 = Number.isNaN || function(t3) {
- return t3 != t3;
- };
- function a2() {
- a2.init.call(this);
- }
- t2.exports = a2, a2.EventEmitter = a2, a2.prototype._events = void 0, a2.prototype._eventsCount = 0, a2.prototype._maxListeners = void 0;
- var c2 = 10;
- function h2(t3) {
- if ("function" != typeof t3)
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t3);
- }
- function u2(t3) {
- return void 0 === t3._maxListeners ? a2.defaultMaxListeners : t3._maxListeners;
- }
- function f2(t3, e3, r3, n3) {
- var o3, i3, s3, a3;
- 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)
- s3 = i3[e3] = r3, ++t3._eventsCount;
- 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) {
- s3.warned = true;
- var c3 = new Error("Possible EventEmitter memory leak detected. " + s3.length + " " + String(e3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
- c3.name = "MaxListenersExceededWarning", c3.emitter = t3, c3.type = e3, c3.count = s3.length, a3 = c3, console && console.warn && console.warn(a3);
- }
- return t3;
- }
- function p2() {
- if (!this.fired)
- 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);
- }
- function l2(t3, e3, r3) {
- var n3 = { fired: false, wrapFn: void 0, target: t3, type: e3, listener: r3 }, o3 = p2.bind(n3);
- return o3.listener = r3, n3.wrapFn = o3, o3;
- }
- function d2(t3, e3, r3) {
- var n3 = t3._events;
- if (void 0 === n3)
- return [];
- var o3 = n3[e3];
- return void 0 === o3 ? [] : "function" == typeof o3 ? r3 ? [o3.listener || o3] : [o3] : r3 ? function(t4) {
- for (var e4 = new Array(t4.length), r4 = 0; r4 < e4.length; ++r4)
- e4[r4] = t4[r4].listener || t4[r4];
- return e4;
- }(o3) : g2(o3, o3.length);
- }
- function y2(t3) {
- var e3 = this._events;
- if (void 0 !== e3) {
- var r3 = e3[t3];
- if ("function" == typeof r3)
- return 1;
- if (void 0 !== r3)
- return r3.length;
- }
- return 0;
- }
- function g2(t3, e3) {
- for (var r3 = new Array(e3), n3 = 0; n3 < e3; ++n3)
- r3[n3] = t3[n3];
- return r3;
- }
- Object.defineProperty(a2, "defaultMaxListeners", { enumerable: true, get: function() {
- return c2;
- }, set: function(t3) {
- if ("number" != typeof t3 || t3 < 0 || s2(t3))
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t3 + ".");
- c2 = t3;
- } }), a2.init = function() {
- 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;
- }, a2.prototype.setMaxListeners = function(t3) {
- if ("number" != typeof t3 || t3 < 0 || s2(t3))
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t3 + ".");
- return this._maxListeners = t3, this;
- }, a2.prototype.getMaxListeners = function() {
- return u2(this);
- }, a2.prototype.emit = function(t3) {
- for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
- e3.push(arguments[r3]);
- var n3 = "error" === t3, o3 = this._events;
- if (void 0 !== o3)
- n3 = n3 && void 0 === o3.error;
- else if (!n3)
- return false;
- if (n3) {
- var s3;
- if (e3.length > 0 && (s3 = e3[0]), s3 instanceof Error)
- throw s3;
- var a3 = new Error("Unhandled error." + (s3 ? " (" + s3.message + ")" : ""));
- throw a3.context = s3, a3;
- }
- var c3 = o3[t3];
- if (void 0 === c3)
- return false;
- if ("function" == typeof c3)
- i2(c3, this, e3);
- else {
- var h3 = c3.length, u3 = g2(c3, h3);
- for (r3 = 0; r3 < h3; ++r3)
- i2(u3[r3], this, e3);
- }
- return true;
- }, a2.prototype.addListener = function(t3, e3) {
- return f2(this, t3, e3, false);
- }, a2.prototype.on = a2.prototype.addListener, a2.prototype.prependListener = function(t3, e3) {
- return f2(this, t3, e3, true);
- }, a2.prototype.once = function(t3, e3) {
- return h2(e3), this.on(t3, l2(this, t3, e3)), this;
- }, a2.prototype.prependOnceListener = function(t3, e3) {
- return h2(e3), this.prependListener(t3, l2(this, t3, e3)), this;
- }, a2.prototype.removeListener = function(t3, e3) {
- var r3, n3, o3, i3, s3;
- if (h2(e3), void 0 === (n3 = this._events))
- return this;
- if (void 0 === (r3 = n3[t3]))
- return this;
- if (r3 === e3 || r3.listener === e3)
- 0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete n3[t3], n3.removeListener && this.emit("removeListener", t3, r3.listener || e3));
- else if ("function" != typeof r3) {
- for (o3 = -1, i3 = r3.length - 1; i3 >= 0; i3--)
- if (r3[i3] === e3 || r3[i3].listener === e3) {
- s3 = r3[i3].listener, o3 = i3;
- break;
- }
- if (o3 < 0)
- return this;
- 0 === o3 ? r3.shift() : function(t4, e4) {
- for (; e4 + 1 < t4.length; e4++)
- t4[e4] = t4[e4 + 1];
- t4.pop();
- }(r3, o3), 1 === r3.length && (n3[t3] = r3[0]), void 0 !== n3.removeListener && this.emit("removeListener", t3, s3 || e3);
- }
- return this;
- }, a2.prototype.off = a2.prototype.removeListener, a2.prototype.removeAllListeners = function(t3) {
- var e3, r3, n3;
- if (void 0 === (r3 = this._events))
- return this;
- if (void 0 === r3.removeListener)
- 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;
- if (0 === arguments.length) {
- var o3, i3 = Object.keys(r3);
- for (n3 = 0; n3 < i3.length; ++n3)
- "removeListener" !== (o3 = i3[n3]) && this.removeAllListeners(o3);
- return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
- }
- if ("function" == typeof (e3 = r3[t3]))
- this.removeListener(t3, e3);
- else if (void 0 !== e3)
- for (n3 = e3.length - 1; n3 >= 0; n3--)
- this.removeListener(t3, e3[n3]);
- return this;
- }, a2.prototype.listeners = function(t3) {
- return d2(this, t3, true);
- }, a2.prototype.rawListeners = function(t3) {
- return d2(this, t3, false);
- }, a2.listenerCount = function(t3, e3) {
- return "function" == typeof t3.listenerCount ? t3.listenerCount(e3) : y2.call(t3, e3);
- }, a2.prototype.listenerCount = y2, a2.prototype.eventNames = function() {
- return this._eventsCount > 0 ? n2(this._events) : [];
- };
- }, function(t2, e2, r2) {
- class n2 {
- constructor(t3, e3) {
- this.target = e3, this.type = t3;
- }
- }
- class o2 extends n2 {
- constructor(t3, e3) {
- super("message", e3), this.data = t3;
- }
- }
- class i2 extends n2 {
- constructor(t3, e3, r3) {
- super("close", r3), this.wasClean = r3._closeFrameReceived && r3._closeFrameSent, this.reason = e3, this.code = t3;
- }
- }
- class s2 extends n2 {
- constructor(t3) {
- super("open", t3);
- }
- }
- class a2 extends n2 {
- constructor(t3, e3) {
- super("error", e3), this.message = t3.message, this.error = t3;
- }
- }
- const c2 = { addEventListener(t3, e3) {
- function r3(t4) {
- e3.call(this, new o2(t4, this));
- }
- function n3(t4, r4) {
- e3.call(this, new i2(t4, r4, this));
- }
- function c3(t4) {
- e3.call(this, new a2(t4, this));
- }
- function h2() {
- e3.call(this, new s2(this));
- }
- "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));
- }, removeEventListener(t3, e3) {
- const r3 = this.listeners(t3);
- for (var n3 = 0; n3 < r3.length; n3++)
- r3[n3] !== e3 && r3[n3]._listener !== e3 || this.removeListener(t3, r3[n3]);
- } };
- t2.exports = c2;
- }, function(t2, e2) {
- t2.exports = function(t3, e3) {
- for (var r2 = [], n2 = (e3 = e3 || 0) || 0; n2 < t3.length; n2++)
- r2[n2 - e3] = t3[n2];
- return r2;
- };
- }, function(t2, e2) {
- function r2(t3) {
- 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;
- }
- t2.exports = r2, r2.prototype.duration = function() {
- var t3 = this.ms * Math.pow(this.factor, this.attempts++);
- if (this.jitter) {
- var e3 = Math.random(), r3 = Math.floor(e3 * this.jitter * t3);
- t3 = 0 == (1 & Math.floor(10 * e3)) ? t3 - r3 : t3 + r3;
- }
- return 0 | Math.min(t3, this.max);
- }, r2.prototype.reset = function() {
- this.attempts = 0;
- }, r2.prototype.setMin = function(t3) {
- this.ms = t3;
- }, r2.prototype.setMax = function(t3) {
- this.max = t3;
- }, r2.prototype.setJitter = function(t3) {
- this.jitter = t3;
- };
- }]);
- });
- })(uniSocket_io);
- var uniSocket_ioExports = uniSocket_io.exports;
- const io = /* @__PURE__ */ getDefaultExportFromCjs(uniSocket_ioExports);
- function _typeof$1(obj) {
- "@babel/helpers - typeof";
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
- return typeof obj2;
- } : function(obj2) {
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
- }, _typeof$1(obj);
- }
- function _defineProperties$2(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$2(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$2(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$2(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- function _classCallCheck$2(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function");
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
- Object.defineProperty(subClass, "prototype", { writable: false });
- if (superClass)
- _setPrototypeOf(subClass, superClass);
- }
- function _createSuper(Derived) {
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
- return function _createSuperInternal() {
- var Super = _getPrototypeOf(Derived), result2;
- if (hasNativeReflectConstruct) {
- var NewTarget = _getPrototypeOf(this).constructor;
- result2 = Reflect.construct(Super, arguments, NewTarget);
- } else {
- result2 = Super.apply(this, arguments);
- }
- return _possibleConstructorReturn(this, result2);
- };
- }
- function _possibleConstructorReturn(self2, call) {
- if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
- return call;
- } else if (call !== void 0) {
- throw new TypeError("Derived constructors may only return object or undefined");
- }
- return _assertThisInitialized(self2);
- }
- function _assertThisInitialized(self2) {
- if (self2 === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return self2;
- }
- function _wrapNativeSuper(Class) {
- var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
- _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
- if (Class2 === null || !_isNativeFunction(Class2))
- return Class2;
- if (typeof Class2 !== "function") {
- throw new TypeError("Super expression must either be null or a function");
- }
- if (typeof _cache !== "undefined") {
- if (_cache.has(Class2))
- return _cache.get(Class2);
- _cache.set(Class2, Wrapper);
- }
- function Wrapper() {
- return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
- }
- Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
- return _setPrototypeOf(Wrapper, Class2);
- };
- return _wrapNativeSuper(Class);
- }
- function _construct(Parent, args, Class) {
- if (_isNativeReflectConstruct()) {
- _construct = Reflect.construct;
- } else {
- _construct = function _construct2(Parent2, args2, Class2) {
- var a2 = [null];
- a2.push.apply(a2, args2);
- var Constructor = Function.bind.apply(Parent2, a2);
- var instance = new Constructor();
- if (Class2)
- _setPrototypeOf(instance, Class2.prototype);
- return instance;
- };
- }
- return _construct.apply(null, arguments);
- }
- function _isNativeReflectConstruct() {
- if (typeof Reflect === "undefined" || !Reflect.construct)
- return false;
- if (Reflect.construct.sham)
- return false;
- if (typeof Proxy === "function")
- return true;
- try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
- }));
- return true;
- } catch (e2) {
- return false;
- }
- }
- function _isNativeFunction(fn) {
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
- }
- function _setPrototypeOf(o2, p2) {
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
- o3.__proto__ = p3;
- return o3;
- };
- return _setPrototypeOf(o2, p2);
- }
- function _getPrototypeOf(o2) {
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
- return o3.__proto__ || Object.getPrototypeOf(o3);
- };
- return _getPrototypeOf(o2);
- }
- var ParseError = /* @__PURE__ */ function(_Error) {
- _inherits(ParseError2, _Error);
- var _super = _createSuper(ParseError2);
- function ParseError2(code) {
- var _this;
- _classCallCheck$2(this, ParseError2);
- _this = _super.call(this, code);
- Object.setPrototypeOf(_assertThisInitialized(_this), ParseError2.prototype);
- _this.name = _this.constructor.name;
- return _this;
- }
- return _createClass$2(ParseError2);
- }(/* @__PURE__ */ _wrapNativeSuper(Error));
- var MIN_LENGTH_FOR_NSN = 2;
- var MAX_LENGTH_FOR_NSN = 17;
- var MAX_LENGTH_COUNTRY_CODE = 3;
- var VALID_DIGITS = "0-90-9٠-٩۰-۹";
- var DASHES = "-‐-―−ー-";
- var SLASHES = "//";
- var DOTS = "..";
- var WHITESPACE = " ";
- var BRACKETS = "()()[]\\[\\]";
- var TILDES = "~⁓∼~";
- var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
- var PLUS_CHARS = "++";
- function compare(a2, b2) {
- a2 = a2.split("-");
- b2 = b2.split("-");
- var pa = a2[0].split(".");
- var pb = b2[0].split(".");
- for (var i2 = 0; i2 < 3; i2++) {
- var na = Number(pa[i2]);
- var nb = Number(pb[i2]);
- if (na > nb)
- return 1;
- if (nb > na)
- return -1;
- if (!isNaN(na) && isNaN(nb))
- return 1;
- if (isNaN(na) && !isNaN(nb))
- return -1;
- }
- if (a2[1] && b2[1]) {
- return a2[1] > b2[1] ? 1 : a2[1] < b2[1] ? -1 : 0;
- }
- return !a2[1] && b2[1] ? 1 : a2[1] && !b2[1] ? -1 : 0;
- }
- var objectConstructor = {}.constructor;
- function isObject(object) {
- return object !== void 0 && object !== null && object.constructor === objectConstructor;
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
- return typeof obj2;
- } : function(obj2) {
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
- }, _typeof(obj);
- }
- function _classCallCheck$1(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$1(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$1(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$1(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$1(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var V3 = "1.2.0";
- var V4 = "1.7.35";
- var DEFAULT_EXT_PREFIX = " ext. ";
- var CALLING_CODE_REG_EXP = /^\d+$/;
- var Metadata = /* @__PURE__ */ function() {
- function Metadata2(metadata2) {
- _classCallCheck$1(this, Metadata2);
- validateMetadata(metadata2);
- this.metadata = metadata2;
- setVersion.call(this, metadata2);
- }
- _createClass$1(Metadata2, [{
- key: "getCountries",
- value: function getCountries() {
- return Object.keys(this.metadata.countries).filter(function(_2) {
- return _2 !== "001";
- });
- }
- }, {
- key: "getCountryMetadata",
- value: function getCountryMetadata(countryCode) {
- return this.metadata.countries[countryCode];
- }
- }, {
- key: "nonGeographic",
- value: function nonGeographic() {
- if (this.v1 || this.v2 || this.v3)
- return;
- return this.metadata.nonGeographic || this.metadata.nonGeographical;
- }
- }, {
- key: "hasCountry",
- value: function hasCountry(country) {
- return this.getCountryMetadata(country) !== void 0;
- }
- }, {
- key: "hasCallingCode",
- value: function hasCallingCode(callingCode) {
- if (this.getCountryCodesForCallingCode(callingCode)) {
- return true;
- }
- if (this.nonGeographic()) {
- if (this.nonGeographic()[callingCode]) {
- return true;
- }
- } else {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
- return true;
- }
- }
- }
- }, {
- key: "isNonGeographicCallingCode",
- value: function isNonGeographicCallingCode(callingCode) {
- if (this.nonGeographic()) {
- return this.nonGeographic()[callingCode] ? true : false;
- } else {
- return this.getCountryCodesForCallingCode(callingCode) ? false : true;
- }
- }
- // Deprecated.
- }, {
- key: "country",
- value: function country(countryCode) {
- return this.selectNumberingPlan(countryCode);
- }
- }, {
- key: "selectNumberingPlan",
- value: function selectNumberingPlan(countryCode, callingCode) {
- if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
- callingCode = countryCode;
- countryCode = null;
- }
- if (countryCode && countryCode !== "001") {
- if (!this.hasCountry(countryCode)) {
- throw new Error("Unknown country: ".concat(countryCode));
- }
- this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
- } else if (callingCode) {
- if (!this.hasCallingCode(callingCode)) {
- throw new Error("Unknown calling code: ".concat(callingCode));
- }
- this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
- } else {
- this.numberingPlan = void 0;
- }
- return this;
- }
- }, {
- key: "getCountryCodesForCallingCode",
- value: function getCountryCodesForCallingCode(callingCode) {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes) {
- if (countryCodes.length === 1 && countryCodes[0].length === 3) {
- return;
- }
- return countryCodes;
- }
- }
- }, {
- key: "getCountryCodeForCallingCode",
- value: function getCountryCodeForCallingCode(callingCode) {
- var countryCodes = this.getCountryCodesForCallingCode(callingCode);
- if (countryCodes) {
- return countryCodes[0];
- }
- }
- }, {
- key: "getNumberingPlanMetadata",
- value: function getNumberingPlanMetadata(callingCode) {
- var countryCode = this.getCountryCodeForCallingCode(callingCode);
- if (countryCode) {
- return this.getCountryMetadata(countryCode);
- }
- if (this.nonGeographic()) {
- var metadata2 = this.nonGeographic()[callingCode];
- if (metadata2) {
- return metadata2;
- }
- } else {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
- return this.metadata.countries["001"];
- }
- }
- }
- // Deprecated.
- }, {
- key: "countryCallingCode",
- value: function countryCallingCode() {
- return this.numberingPlan.callingCode();
- }
- // Deprecated.
- }, {
- key: "IDDPrefix",
- value: function IDDPrefix() {
- return this.numberingPlan.IDDPrefix();
- }
- // Deprecated.
- }, {
- key: "defaultIDDPrefix",
- value: function defaultIDDPrefix() {
- return this.numberingPlan.defaultIDDPrefix();
- }
- // Deprecated.
- }, {
- key: "nationalNumberPattern",
- value: function nationalNumberPattern() {
- return this.numberingPlan.nationalNumberPattern();
- }
- // Deprecated.
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- return this.numberingPlan.possibleLengths();
- }
- // Deprecated.
- }, {
- key: "formats",
- value: function formats() {
- return this.numberingPlan.formats();
- }
- // Deprecated.
- }, {
- key: "nationalPrefixForParsing",
- value: function nationalPrefixForParsing() {
- return this.numberingPlan.nationalPrefixForParsing();
- }
- // Deprecated.
- }, {
- key: "nationalPrefixTransformRule",
- value: function nationalPrefixTransformRule() {
- return this.numberingPlan.nationalPrefixTransformRule();
- }
- // Deprecated.
- }, {
- key: "leadingDigits",
- value: function leadingDigits() {
- return this.numberingPlan.leadingDigits();
- }
- // Deprecated.
- }, {
- key: "hasTypes",
- value: function hasTypes() {
- return this.numberingPlan.hasTypes();
- }
- // Deprecated.
- }, {
- key: "type",
- value: function type(_type) {
- return this.numberingPlan.type(_type);
- }
- // Deprecated.
- }, {
- key: "ext",
- value: function ext() {
- return this.numberingPlan.ext();
- }
- }, {
- key: "countryCallingCodes",
- value: function countryCallingCodes() {
- if (this.v1)
- return this.metadata.country_phone_code_to_countries;
- return this.metadata.country_calling_codes;
- }
- // Deprecated.
- }, {
- key: "chooseCountryByCountryCallingCode",
- value: function chooseCountryByCountryCallingCode(callingCode) {
- return this.selectNumberingPlan(callingCode);
- }
- }, {
- key: "hasSelectedNumberingPlan",
- value: function hasSelectedNumberingPlan() {
- return this.numberingPlan !== void 0;
- }
- }]);
- return Metadata2;
- }();
- var NumberingPlan = /* @__PURE__ */ function() {
- function NumberingPlan2(metadata2, globalMetadataObject) {
- _classCallCheck$1(this, NumberingPlan2);
- this.globalMetadataObject = globalMetadataObject;
- this.metadata = metadata2;
- setVersion.call(this, globalMetadataObject.metadata);
- }
- _createClass$1(NumberingPlan2, [{
- key: "callingCode",
- value: function callingCode() {
- return this.metadata[0];
- }
- // Formatting information for regions which share
- // a country calling code is contained by only one region
- // for performance reasons. For example, for NANPA region
- // ("North American Numbering Plan Administration",
- // which includes USA, Canada, Cayman Islands, Bahamas, etc)
- // it will be contained in the metadata for `US`.
- }, {
- key: "getDefaultCountryMetadataForRegion",
- value: function getDefaultCountryMetadataForRegion() {
- return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
- }
- // Is always present.
- }, {
- key: "IDDPrefix",
- value: function IDDPrefix() {
- if (this.v1 || this.v2)
- return;
- return this.metadata[1];
- }
- // Is only present when a country supports multiple IDD prefixes.
- }, {
- key: "defaultIDDPrefix",
- value: function defaultIDDPrefix() {
- if (this.v1 || this.v2)
- return;
- return this.metadata[12];
- }
- }, {
- key: "nationalNumberPattern",
- value: function nationalNumberPattern() {
- if (this.v1 || this.v2)
- return this.metadata[1];
- return this.metadata[2];
- }
- // "possible length" data is always present in Google's metadata.
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- if (this.v1)
- return;
- return this.metadata[this.v2 ? 2 : 3];
- }
- }, {
- key: "_getFormats",
- value: function _getFormats(metadata2) {
- return metadata2[this.v1 ? 2 : this.v2 ? 3 : 4];
- }
- // For countries of the same region (e.g. NANPA)
- // formats are all stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "formats",
- value: function formats() {
- var _this = this;
- var formats2 = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
- return formats2.map(function(_2) {
- return new Format(_2, _this);
- });
- }
- }, {
- key: "nationalPrefix",
- value: function nationalPrefix() {
- return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
- }
- }, {
- key: "_getNationalPrefixFormattingRule",
- value: function _getNationalPrefixFormattingRule(metadata2) {
- return metadata2[this.v1 ? 4 : this.v2 ? 5 : 6];
- }
- // For countries of the same region (e.g. NANPA)
- // national prefix formatting rule is stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "nationalPrefixFormattingRule",
- value: function nationalPrefixFormattingRule() {
- return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
- }
- }, {
- key: "_nationalPrefixForParsing",
- value: function _nationalPrefixForParsing() {
- return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
- }
- }, {
- key: "nationalPrefixForParsing",
- value: function nationalPrefixForParsing() {
- return this._nationalPrefixForParsing() || this.nationalPrefix();
- }
- }, {
- key: "nationalPrefixTransformRule",
- value: function nationalPrefixTransformRule() {
- return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
- }
- }, {
- key: "_getNationalPrefixIsOptionalWhenFormatting",
- value: function _getNationalPrefixIsOptionalWhenFormatting() {
- return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
- }
- // For countries of the same region (e.g. NANPA)
- // "national prefix is optional when formatting" flag is
- // stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
- return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
- }
- }, {
- key: "leadingDigits",
- value: function leadingDigits() {
- return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
- }
- }, {
- key: "types",
- value: function types() {
- return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
- }
- }, {
- key: "hasTypes",
- value: function hasTypes() {
- if (this.types() && this.types().length === 0) {
- return false;
- }
- return !!this.types();
- }
- }, {
- key: "type",
- value: function type(_type2) {
- if (this.hasTypes() && getType(this.types(), _type2)) {
- return new Type(getType(this.types(), _type2), this);
- }
- }
- }, {
- key: "ext",
- value: function ext() {
- if (this.v1 || this.v2)
- return DEFAULT_EXT_PREFIX;
- return this.metadata[13] || DEFAULT_EXT_PREFIX;
- }
- }]);
- return NumberingPlan2;
- }();
- var Format = /* @__PURE__ */ function() {
- function Format2(format, metadata2) {
- _classCallCheck$1(this, Format2);
- this._format = format;
- this.metadata = metadata2;
- }
- _createClass$1(Format2, [{
- key: "pattern",
- value: function pattern() {
- return this._format[0];
- }
- }, {
- key: "format",
- value: function format() {
- return this._format[1];
- }
- }, {
- key: "leadingDigitsPatterns",
- value: function leadingDigitsPatterns() {
- return this._format[2] || [];
- }
- }, {
- key: "nationalPrefixFormattingRule",
- value: function nationalPrefixFormattingRule() {
- return this._format[3] || this.metadata.nationalPrefixFormattingRule();
- }
- }, {
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
- return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
- }
- }, {
- key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
- value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
- return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
- }
- // Checks whether national prefix formatting rule contains national prefix.
- }, {
- key: "usesNationalPrefix",
- value: function usesNationalPrefix() {
- return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
- !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
- }
- }, {
- key: "internationalFormat",
- value: function internationalFormat() {
- return this._format[5] || this.format();
- }
- }]);
- return Format2;
- }();
- var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
- var Type = /* @__PURE__ */ function() {
- function Type2(type, metadata2) {
- _classCallCheck$1(this, Type2);
- this.type = type;
- this.metadata = metadata2;
- }
- _createClass$1(Type2, [{
- key: "pattern",
- value: function pattern() {
- if (this.metadata.v1)
- return this.type;
- return this.type[0];
- }
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- if (this.metadata.v1)
- return;
- return this.type[1] || this.metadata.possibleLengths();
- }
- }]);
- return Type2;
- }();
- function getType(types, type) {
- switch (type) {
- case "FIXED_LINE":
- return types[0];
- case "MOBILE":
- return types[1];
- case "TOLL_FREE":
- return types[2];
- case "PREMIUM_RATE":
- return types[3];
- case "PERSONAL_NUMBER":
- return types[4];
- case "VOICEMAIL":
- return types[5];
- case "UAN":
- return types[6];
- case "PAGER":
- return types[7];
- case "VOIP":
- return types[8];
- case "SHARED_COST":
- return types[9];
- }
- }
- function validateMetadata(metadata2) {
- if (!metadata2) {
- throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
- }
- if (!isObject(metadata2) || !isObject(metadata2.countries)) {
- 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, "."));
- }
- }
- var typeOf = function typeOf2(_2) {
- return _typeof(_2);
- };
- function getCountryCallingCode(country, metadata2) {
- metadata2 = new Metadata(metadata2);
- if (metadata2.hasCountry(country)) {
- return metadata2.country(country).countryCallingCode();
- }
- throw new Error("Unknown country: ".concat(country));
- }
- function isSupportedCountry(country, metadata2) {
- return metadata2.countries.hasOwnProperty(country);
- }
- function setVersion(metadata2) {
- var version2 = metadata2.version;
- if (typeof version2 === "number") {
- this.v1 = version2 === 1;
- this.v2 = version2 === 2;
- this.v3 = version2 === 3;
- this.v4 = version2 === 4;
- } else {
- if (!version2) {
- this.v1 = true;
- } else if (compare(version2, V3) === -1) {
- this.v2 = true;
- } else if (compare(version2, V4) === -1) {
- this.v3 = true;
- } else {
- this.v4 = true;
- }
- }
- }
- var RFC3966_EXTN_PREFIX = ";ext=";
- var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
- return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
- };
- function createExtensionPattern(purpose) {
- var extLimitAfterExplicitLabel = "20";
- var extLimitAfterLikelyLabel = "15";
- var extLimitAfterAmbiguousChar = "9";
- var extLimitWhenNotSure = "6";
- var possibleSeparatorsBetweenNumberAndExtLabel = "[ \\t,]*";
- var possibleCharsAfterExtLabel = "[:\\..]?[ \\t,-]*";
- var optionalExtnSuffix = "#?";
- var explicitExtLabels = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)";
- var ambiguousExtLabels = "(?:[xx##~~]|int|int)";
- var ambiguousSeparator = "[- ]+";
- var possibleSeparatorsNumberExtLabelNoComma = "[ \\t]*";
- var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
- var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
- var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
- var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
- var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
- var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
- var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
- return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
- }
- var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
- var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
- var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
- var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
- "(?:" + createExtensionPattern() + ")?";
- var VALID_PHONE_NUMBER_PATTERN = new RegExp(
- // Either a short two-digit-only phone number
- "^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
- "i"
- );
- function isViablePhoneNumber(number) {
- return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
- }
- function isViablePhoneNumberStart(number) {
- return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
- }
- var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
- function extractExtension(number) {
- var start = number.search(EXTN_PATTERN);
- if (start < 0) {
- return {};
- }
- var numberWithoutExtension = number.slice(0, start);
- var matches = number.match(EXTN_PATTERN);
- var i2 = 1;
- while (i2 < matches.length) {
- if (matches[i2]) {
- return {
- number: numberWithoutExtension,
- ext: matches[i2]
- };
- }
- i2++;
- }
- }
- var DIGITS = {
- "0": "0",
- "1": "1",
- "2": "2",
- "3": "3",
- "4": "4",
- "5": "5",
- "6": "6",
- "7": "7",
- "8": "8",
- "9": "9",
- "0": "0",
- // Fullwidth digit 0
- "1": "1",
- // Fullwidth digit 1
- "2": "2",
- // Fullwidth digit 2
- "3": "3",
- // Fullwidth digit 3
- "4": "4",
- // Fullwidth digit 4
- "5": "5",
- // Fullwidth digit 5
- "6": "6",
- // Fullwidth digit 6
- "7": "7",
- // Fullwidth digit 7
- "8": "8",
- // Fullwidth digit 8
- "9": "9",
- // Fullwidth digit 9
- "٠": "0",
- // Arabic-indic digit 0
- "١": "1",
- // Arabic-indic digit 1
- "٢": "2",
- // Arabic-indic digit 2
- "٣": "3",
- // Arabic-indic digit 3
- "٤": "4",
- // Arabic-indic digit 4
- "٥": "5",
- // Arabic-indic digit 5
- "٦": "6",
- // Arabic-indic digit 6
- "٧": "7",
- // Arabic-indic digit 7
- "٨": "8",
- // Arabic-indic digit 8
- "٩": "9",
- // Arabic-indic digit 9
- "۰": "0",
- // Eastern-Arabic digit 0
- "۱": "1",
- // Eastern-Arabic digit 1
- "۲": "2",
- // Eastern-Arabic digit 2
- "۳": "3",
- // Eastern-Arabic digit 3
- "۴": "4",
- // Eastern-Arabic digit 4
- "۵": "5",
- // Eastern-Arabic digit 5
- "۶": "6",
- // Eastern-Arabic digit 6
- "۷": "7",
- // Eastern-Arabic digit 7
- "۸": "8",
- // Eastern-Arabic digit 8
- "۹": "9"
- // Eastern-Arabic digit 9
- };
- function parseDigit(character) {
- return DIGITS[character];
- }
- function _createForOfIteratorHelperLoose$4(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$5(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$5(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$5(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$5(o2, minLen);
- }
- function _arrayLikeToArray$5(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function parseIncompletePhoneNumber(string) {
- var result2 = "";
- for (var _iterator = _createForOfIteratorHelperLoose$4(string.split("")), _step; !(_step = _iterator()).done; ) {
- var character = _step.value;
- result2 += parsePhoneNumberCharacter(character, result2) || "";
- }
- return result2;
- }
- function parsePhoneNumberCharacter(character, prevParsedCharacters, emitEvent) {
- if (character === "+") {
- if (prevParsedCharacters) {
- if (typeof emitEvent === "function") {
- emitEvent("end");
- }
- return;
- }
- return "+";
- }
- return parseDigit(character);
- }
- function _createForOfIteratorHelperLoose$3(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$4(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$4(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$4(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$4(o2, minLen);
- }
- function _arrayLikeToArray$4(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function mergeArrays(a2, b2) {
- var merged = a2.slice();
- for (var _iterator = _createForOfIteratorHelperLoose$3(b2), _step; !(_step = _iterator()).done; ) {
- var element = _step.value;
- if (a2.indexOf(element) < 0) {
- merged.push(element);
- }
- }
- return merged.sort(function(a3, b3) {
- return a3 - b3;
- });
- }
- function checkNumberLength(nationalNumber, metadata2) {
- return checkNumberLengthForType(nationalNumber, void 0, metadata2);
- }
- function checkNumberLengthForType(nationalNumber, type, metadata2) {
- var type_info = metadata2.type(type);
- var possible_lengths = type_info && type_info.possibleLengths() || metadata2.possibleLengths();
- if (!possible_lengths) {
- return "IS_POSSIBLE";
- }
- if (type === "FIXED_LINE_OR_MOBILE") {
- if (!metadata2.type("FIXED_LINE")) {
- return checkNumberLengthForType(nationalNumber, "MOBILE", metadata2);
- }
- var mobile_type = metadata2.type("MOBILE");
- if (mobile_type) {
- possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
- }
- } else if (type && !type_info) {
- return "INVALID_LENGTH";
- }
- var actual_length = nationalNumber.length;
- var minimum_length = possible_lengths[0];
- if (minimum_length === actual_length) {
- return "IS_POSSIBLE";
- }
- if (minimum_length > actual_length) {
- return "TOO_SHORT";
- }
- if (possible_lengths[possible_lengths.length - 1] < actual_length) {
- return "TOO_LONG";
- }
- return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
- }
- function isPossiblePhoneNumber(input, options, metadata2) {
- if (options === void 0) {
- options = {};
- }
- metadata2 = new Metadata(metadata2);
- if (options.v2) {
- if (!input.countryCallingCode) {
- throw new Error("Invalid phone number object passed");
- }
- metadata2.selectNumberingPlan(input.countryCallingCode);
- } else {
- if (!input.phone) {
- return false;
- }
- if (input.country) {
- if (!metadata2.hasCountry(input.country)) {
- throw new Error("Unknown country: ".concat(input.country));
- }
- metadata2.country(input.country);
- } else {
- if (!input.countryCallingCode) {
- throw new Error("Invalid phone number object passed");
- }
- metadata2.selectNumberingPlan(input.countryCallingCode);
- }
- }
- if (metadata2.possibleLengths()) {
- return isPossibleNumber(input.phone || input.nationalNumber, metadata2);
- } else {
- if (input.countryCallingCode && metadata2.isNonGeographicCallingCode(input.countryCallingCode)) {
- return true;
- } else {
- throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
- }
- }
- }
- function isPossibleNumber(nationalNumber, metadata2) {
- switch (checkNumberLength(nationalNumber, metadata2)) {
- case "IS_POSSIBLE":
- return true;
- default:
- return false;
- }
- }
- function matchesEntirely(text, regular_expression) {
- text = text || "";
- return new RegExp("^(?:" + regular_expression + ")$").test(text);
- }
- function _createForOfIteratorHelperLoose$2(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$3(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$3(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$3(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$3(o2, minLen);
- }
- function _arrayLikeToArray$3(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
- function getNumberType(input, options, metadata2) {
- options = options || {};
- if (!input.country && !input.countryCallingCode) {
- return;
- }
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
- if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern())) {
- return;
- }
- if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata2)) {
- if (metadata2.type("MOBILE") && metadata2.type("MOBILE").pattern() === "") {
- return "FIXED_LINE_OR_MOBILE";
- }
- if (!metadata2.type("MOBILE")) {
- return "FIXED_LINE_OR_MOBILE";
- }
- if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata2)) {
- return "FIXED_LINE_OR_MOBILE";
- }
- return "FIXED_LINE";
- }
- for (var _iterator = _createForOfIteratorHelperLoose$2(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
- var type = _step.value;
- if (isNumberTypeEqualTo(nationalNumber, type, metadata2)) {
- return type;
- }
- }
- }
- function isNumberTypeEqualTo(nationalNumber, type, metadata2) {
- type = metadata2.type(type);
- if (!type || !type.pattern()) {
- return false;
- }
- if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
- return false;
- }
- return matchesEntirely(nationalNumber, type.pattern());
- }
- function isValidNumber(input, options, metadata2) {
- options = options || {};
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
- if (metadata2.hasTypes()) {
- return getNumberType(input, options, metadata2.metadata) !== void 0;
- }
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
- return matchesEntirely(nationalNumber, metadata2.nationalNumberPattern());
- }
- function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata2) {
- var _metadata = new Metadata(metadata2);
- var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
- if (!possibleCountries) {
- return [];
- }
- return possibleCountries.filter(function(country) {
- return couldNationalNumberBelongToCountry(nationalNumber, country, metadata2);
- });
- }
- function couldNationalNumberBelongToCountry(nationalNumber, country, metadata2) {
- var _metadata = new Metadata(metadata2);
- _metadata.selectNumberingPlan(country);
- if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {
- return true;
- }
- return false;
- }
- function applyInternationalSeparatorStyle(formattedNumber) {
- return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
- }
- var FIRST_GROUP_PATTERN = /(\$\d)/;
- function formatNationalNumberUsingFormat(number, format, _ref) {
- var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix;
- _ref.carrierCode;
- _ref.metadata;
- var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : (
- // This library doesn't use `domestic_carrier_code_formatting_rule`,
- // because that one is only used when formatting phone numbers
- // for dialing from a mobile phone, and this is not a dialing library.
- // carrierCode && format.domesticCarrierCodeFormattingRule()
- // // First, replace the $CC in the formatting rule with the desired carrier code.
- // // Then, replace the $FG in the formatting rule with the first group
- // // and the carrier code combined in the appropriate way.
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
- // : (
- // withNationalPrefix && format.nationalPrefixFormattingRule()
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
- // : format.format()
- // )
- withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format()
- ));
- if (useInternationalFormat) {
- return applyInternationalSeparatorStyle(formattedNumber);
- }
- return formattedNumber;
- }
- var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
- function getIddPrefix(country, callingCode, metadata2) {
- var countryMetadata = new Metadata(metadata2);
- countryMetadata.selectNumberingPlan(country, callingCode);
- if (countryMetadata.defaultIDDPrefix()) {
- return countryMetadata.defaultIDDPrefix();
- }
- if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
- return countryMetadata.IDDPrefix();
- }
- }
- function formatRFC3966(_ref) {
- var number = _ref.number, ext = _ref.ext;
- if (!number) {
- return "";
- }
- if (number[0] !== "+") {
- throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
- }
- return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
- }
- function _createForOfIteratorHelperLoose$1(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$2(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$2(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$2(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$2(o2, minLen);
- }
- function _arrayLikeToArray$2(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function ownKeys$4(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$4(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
- _defineProperty$4(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$4(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- var DEFAULT_OPTIONS = {
- formatExtension: function formatExtension(formattedNumber, extension, metadata2) {
- return "".concat(formattedNumber).concat(metadata2.ext()).concat(extension);
- }
- };
- function formatNumber(input, format, options, metadata2) {
- if (options) {
- options = _objectSpread$4(_objectSpread$4({}, DEFAULT_OPTIONS), options);
- } else {
- options = DEFAULT_OPTIONS;
- }
- metadata2 = new Metadata(metadata2);
- if (input.country && input.country !== "001") {
- if (!metadata2.hasCountry(input.country)) {
- throw new Error("Unknown country: ".concat(input.country));
- }
- metadata2.country(input.country);
- } else if (input.countryCallingCode) {
- metadata2.selectNumberingPlan(input.countryCallingCode);
- } else
- return input.phone || "";
- var countryCallingCode = metadata2.countryCallingCode();
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
- var number;
- switch (format) {
- case "NATIONAL":
- if (!nationalNumber) {
- return "";
- }
- number = formatNationalNumber(nationalNumber, input.carrierCode, "NATIONAL", metadata2, options);
- return addExtension(number, input.ext, metadata2, options.formatExtension);
- case "INTERNATIONAL":
- if (!nationalNumber) {
- return "+".concat(countryCallingCode);
- }
- number = formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata2, options);
- number = "+".concat(countryCallingCode, " ").concat(number);
- return addExtension(number, input.ext, metadata2, options.formatExtension);
- case "E.164":
- return "+".concat(countryCallingCode).concat(nationalNumber);
- case "RFC3966":
- return formatRFC3966({
- number: "+".concat(countryCallingCode).concat(nationalNumber),
- ext: input.ext
- });
- case "IDD":
- if (!options.fromCountry) {
- return;
- }
- var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata2);
- return addExtension(formattedNumber, input.ext, metadata2, options.formatExtension);
- default:
- throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format, '"'));
- }
- }
- function formatNationalNumber(number, carrierCode, formatAs, metadata2, options) {
- var format = chooseFormatForNumber(metadata2.formats(), number);
- if (!format) {
- return number;
- }
- return formatNationalNumberUsingFormat(number, format, {
- useInternationalFormat: formatAs === "INTERNATIONAL",
- withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
- carrierCode,
- metadata: metadata2
- });
- }
- function chooseFormatForNumber(availableFormats, nationalNnumber) {
- for (var _iterator = _createForOfIteratorHelperLoose$1(availableFormats), _step; !(_step = _iterator()).done; ) {
- var format = _step.value;
- if (format.leadingDigitsPatterns().length > 0) {
- var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];
- if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
- continue;
- }
- }
- if (matchesEntirely(nationalNnumber, format.pattern())) {
- return format;
- }
- }
- }
- function addExtension(formattedNumber, ext, metadata2, formatExtension2) {
- return ext ? formatExtension2(formattedNumber, ext, metadata2) : formattedNumber;
- }
- function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata2) {
- var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata2.metadata);
- if (fromCountryCallingCode === countryCallingCode) {
- var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, "NATIONAL", metadata2);
- if (countryCallingCode === "1") {
- return countryCallingCode + " " + formattedNumber;
- }
- return formattedNumber;
- }
- var iddPrefix = getIddPrefix(fromCountry, void 0, metadata2.metadata);
- if (iddPrefix) {
- return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata2));
- }
- }
- function ownKeys$3(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$3(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$3(Object(source), true).forEach(function(key) {
- _defineProperty$3(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$3(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var PhoneNumber = /* @__PURE__ */ function() {
- function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata2) {
- _classCallCheck(this, PhoneNumber2);
- if (!countryOrCountryCallingCode) {
- throw new TypeError("`country` or `countryCallingCode` not passed");
- }
- if (!nationalNumber) {
- throw new TypeError("`nationalNumber` not passed");
- }
- if (!metadata2) {
- throw new TypeError("`metadata` not passed");
- }
- var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata2), country = _getCountryAndCountry.country, countryCallingCode = _getCountryAndCountry.countryCallingCode;
- this.country = country;
- this.countryCallingCode = countryCallingCode;
- this.nationalNumber = nationalNumber;
- this.number = "+" + this.countryCallingCode + this.nationalNumber;
- this.getMetadata = function() {
- return metadata2;
- };
- }
- _createClass(PhoneNumber2, [{
- key: "setExt",
- value: function setExt(ext) {
- this.ext = ext;
- }
- }, {
- key: "getPossibleCountries",
- value: function getPossibleCountries() {
- if (this.country) {
- return [this.country];
- }
- return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
- }
- }, {
- key: "isPossible",
- value: function isPossible() {
- return isPossiblePhoneNumber(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "isValid",
- value: function isValid() {
- return isValidNumber(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "isNonGeographic",
- value: function isNonGeographic() {
- var metadata2 = new Metadata(this.getMetadata());
- return metadata2.isNonGeographicCallingCode(this.countryCallingCode);
- }
- }, {
- key: "isEqual",
- value: function isEqual(phoneNumber) {
- return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
- }
- // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
- // but later it was found out that it doesn't include the possible `TOO_SHORT` result
- // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
- // so eventually I simply commented out this method from the `PhoneNumber` class
- // and just left the `validatePhoneNumberLength()` function, even though that one would require
- // and additional step to also validate the actual country / calling code of the phone number.
- // validateLength() {
- // const metadata = new Metadata(this.getMetadata())
- // metadata.selectNumberingPlan(this.countryCallingCode)
- // const result = checkNumberLength(this.nationalNumber, metadata)
- // if (result !== 'IS_POSSIBLE') {
- // return result
- // }
- // }
- }, {
- key: "getType",
- value: function getType2() {
- return getNumberType(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "format",
- value: function format(_format, options) {
- return formatNumber(this, _format, options ? _objectSpread$3(_objectSpread$3({}, options), {}, {
- v2: true
- }) : {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "formatNational",
- value: function formatNational(options) {
- return this.format("NATIONAL", options);
- }
- }, {
- key: "formatInternational",
- value: function formatInternational(options) {
- return this.format("INTERNATIONAL", options);
- }
- }, {
- key: "getURI",
- value: function getURI(options) {
- return this.format("RFC3966", options);
- }
- }]);
- return PhoneNumber2;
- }();
- var isCountryCode = function isCountryCode2(value) {
- return /^[A-Z]{2}$/.test(value);
- };
- function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {
- var country;
- var countryCallingCode;
- var metadata2 = new Metadata(metadataJson);
- if (isCountryCode(countryOrCountryCallingCode)) {
- country = countryOrCountryCallingCode;
- metadata2.selectNumberingPlan(country);
- countryCallingCode = metadata2.countryCallingCode();
- } else {
- countryCallingCode = countryOrCountryCallingCode;
- }
- return {
- country,
- countryCallingCode
- };
- }
- var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
- function stripIddPrefix(number, country, callingCode, metadata2) {
- if (!country) {
- return;
- }
- var countryMetadata = new Metadata(metadata2);
- countryMetadata.selectNumberingPlan(country, callingCode);
- var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
- if (number.search(IDDPrefixPattern) !== 0) {
- return;
- }
- number = number.slice(number.match(IDDPrefixPattern)[0].length);
- var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
- if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
- if (matchedGroups[1] === "0") {
- return;
- }
- }
- return number;
- }
- function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata2) {
- if (number && metadata2.numberingPlan.nationalPrefixForParsing()) {
- var prefixPattern = new RegExp("^(?:" + metadata2.numberingPlan.nationalPrefixForParsing() + ")");
- var prefixMatch = prefixPattern.exec(number);
- if (prefixMatch) {
- var nationalNumber;
- var carrierCode;
- var capturedGroupsCount = prefixMatch.length - 1;
- var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
- if (metadata2.nationalPrefixTransformRule() && hasCapturedGroups) {
- nationalNumber = number.replace(prefixPattern, metadata2.nationalPrefixTransformRule());
- if (capturedGroupsCount > 1) {
- carrierCode = prefixMatch[1];
- }
- } else {
- var prefixBeforeNationalNumber = prefixMatch[0];
- nationalNumber = number.slice(prefixBeforeNationalNumber.length);
- if (hasCapturedGroups) {
- carrierCode = prefixMatch[1];
- }
- }
- var nationalPrefix;
- if (hasCapturedGroups) {
- var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
- var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
- if (possibleNationalPrefix === metadata2.numberingPlan.nationalPrefix()) {
- nationalPrefix = metadata2.numberingPlan.nationalPrefix();
- }
- } else {
- nationalPrefix = prefixMatch[0];
- }
- return {
- nationalNumber,
- nationalPrefix,
- carrierCode
- };
- }
- }
- return {
- nationalNumber: number
- };
- }
- function extractNationalNumber(number, metadata2) {
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata2), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
- if (nationalNumber !== number) {
- if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata2)) {
- return {
- nationalNumber: number
- };
- }
- if (metadata2.possibleLengths()) {
- if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata2)) {
- return {
- nationalNumber: number
- };
- }
- }
- }
- return {
- nationalNumber,
- carrierCode
- };
- }
- function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata2) {
- if (matchesEntirely(nationalNumberBefore, metadata2.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata2.nationalNumberPattern())) {
- return false;
- }
- return true;
- }
- function isPossibleIncompleteNationalNumber(nationalNumber, metadata2) {
- switch (checkNumberLength(nationalNumber, metadata2)) {
- case "TOO_SHORT":
- case "INVALID_LENGTH":
- return false;
- default:
- return true;
- }
- }
- function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata2) {
- var countryCallingCode = country ? getCountryCallingCode(country, metadata2) : callingCode;
- if (number.indexOf(countryCallingCode) === 0) {
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(country, callingCode);
- var possibleShorterNumber = number.slice(countryCallingCode.length);
- var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata2), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
- var _extractNationalNumbe2 = extractNationalNumber(number, metadata2), nationalNumber = _extractNationalNumbe2.nationalNumber;
- if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata2.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata2) === "TOO_LONG") {
- return {
- countryCallingCode,
- number: possibleShorterNumber
- };
- }
- }
- return {
- number
- };
- }
- function extractCountryCallingCode(number, country, callingCode, metadata2) {
- if (!number) {
- return {};
- }
- var isNumberWithIddPrefix;
- if (number[0] !== "+") {
- var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata2);
- if (numberWithoutIDD && numberWithoutIDD !== number) {
- isNumberWithIddPrefix = true;
- number = "+" + numberWithoutIDD;
- } else {
- if (country || callingCode) {
- var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata2), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
- if (countryCallingCode) {
- return {
- countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
- countryCallingCode,
- number: shorterNumber
- };
- }
- }
- return {
- // No need to set it to `UNSPECIFIED`. It can be just `undefined`.
- // countryCallingCodeSource: 'UNSPECIFIED',
- number
- };
- }
- }
- if (number[1] === "0") {
- return {};
- }
- metadata2 = new Metadata(metadata2);
- var i2 = 2;
- while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number.length) {
- var _countryCallingCode = number.slice(1, i2);
- if (metadata2.hasCallingCode(_countryCallingCode)) {
- metadata2.selectNumberingPlan(_countryCallingCode);
- return {
- countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
- countryCallingCode: _countryCallingCode,
- number: number.slice(i2)
- };
- }
- i2++;
- }
- return {};
- }
- function _createForOfIteratorHelperLoose(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$1(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$1(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$1(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$1(o2, minLen);
- }
- function _arrayLikeToArray$1(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
- var countries = _ref.countries, defaultCountry = _ref.defaultCountry, metadata2 = _ref.metadata;
- metadata2 = new Metadata(metadata2);
- var matchingCountries = [];
- for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done; ) {
- var country = _step.value;
- metadata2.country(country);
- if (metadata2.leadingDigits()) {
- if (nationalPhoneNumber && nationalPhoneNumber.search(metadata2.leadingDigits()) === 0) {
- return country;
- }
- } else if (getNumberType({
- phone: nationalPhoneNumber,
- country
- }, void 0, metadata2.metadata)) {
- if (defaultCountry) {
- if (country === defaultCountry) {
- return country;
- }
- matchingCountries.push(country);
- } else {
- return country;
- }
- }
- }
- if (matchingCountries.length > 0) {
- return matchingCountries[0];
- }
- }
- var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
- function getCountryByCallingCode(callingCode, _ref) {
- var nationalPhoneNumber = _ref.nationalNumber, defaultCountry = _ref.defaultCountry, metadata2 = _ref.metadata;
- if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
- if (metadata2.isNonGeographicCallingCode(callingCode)) {
- return "001";
- }
- }
- var possibleCountries = metadata2.getCountryCodesForCallingCode(callingCode);
- if (!possibleCountries) {
- return;
- }
- if (possibleCountries.length === 1) {
- return possibleCountries[0];
- }
- return getCountryByNationalNumber(nationalPhoneNumber, {
- countries: possibleCountries,
- defaultCountry,
- metadata: metadata2.metadata
- });
- }
- var PLUS_SIGN = "+";
- var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
- var RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
- var RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
- var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
- var ALPHANUM_ = VALID_DIGITS;
- var RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
- var VALID_ALPHA_ = "a-zA-Z";
- var RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
- var RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
- var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
- var RFC3966_PREFIX_ = "tel:";
- var RFC3966_PHONE_CONTEXT_ = ";phone-context=";
- var RFC3966_ISDN_SUBADDRESS_ = ";isub=";
- function extractPhoneContext(numberToExtractFrom) {
- var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
- if (indexOfPhoneContext < 0) {
- return null;
- }
- var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
- if (phoneContextStart >= numberToExtractFrom.length) {
- return "";
- }
- var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
- if (phoneContextEnd >= 0) {
- return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
- } else {
- return numberToExtractFrom.substring(phoneContextStart);
- }
- }
- function isPhoneContextValid(phoneContext) {
- if (phoneContext === null) {
- return true;
- }
- if (phoneContext.length === 0) {
- return false;
- }
- return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
- }
- function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
- var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;
- var phoneContext = extractPhoneContext(numberToParse);
- if (!isPhoneContextValid(phoneContext)) {
- throw new ParseError("NOT_A_NUMBER");
- }
- var phoneNumberString;
- if (phoneContext === null) {
- phoneNumberString = extractFormattedPhoneNumber(numberToParse) || "";
- } else {
- phoneNumberString = "";
- if (phoneContext.charAt(0) === PLUS_SIGN) {
- phoneNumberString += phoneContext;
- }
- var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
- var indexOfNationalNumber;
- if (indexOfRfc3966Prefix >= 0) {
- indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
- } else {
- indexOfNationalNumber = 0;
- }
- var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
- phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
- }
- var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
- if (indexOfIsdn > 0) {
- phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
- }
- if (phoneNumberString !== "") {
- return phoneNumberString;
- }
- }
- var MAX_INPUT_STRING_LENGTH = 250;
- var PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
- var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
- function parse(text, options, metadata2) {
- options = options || {};
- metadata2 = new Metadata(metadata2);
- if (options.defaultCountry && !metadata2.hasCountry(options.defaultCountry)) {
- if (options.v2) {
- throw new ParseError("INVALID_COUNTRY");
- }
- throw new Error("Unknown country: ".concat(options.defaultCountry));
- }
- var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error = _parseInput.error;
- if (!formattedPhoneNumber) {
- if (options.v2) {
- if (error === "TOO_SHORT") {
- throw new ParseError("TOO_SHORT");
- }
- throw new ParseError("NOT_A_NUMBER");
- }
- return {};
- }
- 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;
- if (!metadata2.hasSelectedNumberingPlan()) {
- if (options.v2) {
- throw new ParseError("INVALID_COUNTRY");
- }
- return {};
- }
- if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
- if (options.v2) {
- throw new ParseError("TOO_SHORT");
- }
- return {};
- }
- if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
- if (options.v2) {
- throw new ParseError("TOO_LONG");
- }
- return {};
- }
- if (options.v2) {
- var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata2.metadata);
- if (country) {
- phoneNumber.country = country;
- }
- if (carrierCode) {
- phoneNumber.carrierCode = carrierCode;
- }
- if (ext) {
- phoneNumber.ext = ext;
- }
- phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
- return phoneNumber;
- }
- var valid = (options.extended ? metadata2.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) : false;
- if (!options.extended) {
- return valid ? result(country, nationalNumber, ext) : {};
- }
- return {
- country,
- countryCallingCode,
- carrierCode,
- valid,
- possible: valid ? true : options.extended === true && metadata2.possibleLengths() && isPossibleNumber(nationalNumber, metadata2) ? true : false,
- phone: nationalNumber,
- ext
- };
- }
- function _extractFormattedPhoneNumber(text, extract, throwOnError) {
- if (!text) {
- return;
- }
- if (text.length > MAX_INPUT_STRING_LENGTH) {
- if (throwOnError) {
- throw new ParseError("TOO_LONG");
- }
- return;
- }
- if (extract === false) {
- return text;
- }
- var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
- if (startsAt < 0) {
- return;
- }
- return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
- }
- function parseInput(text, v2, extract) {
- var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
- extractFormattedPhoneNumber: function extractFormattedPhoneNumber(text2) {
- return _extractFormattedPhoneNumber(text2, extract, v2);
- }
- });
- if (!number) {
- return {};
- }
- if (!isViablePhoneNumber(number)) {
- if (isViablePhoneNumberStart(number)) {
- return {
- error: "TOO_SHORT"
- };
- }
- return {};
- }
- var withExtensionStripped = extractExtension(number);
- if (withExtensionStripped.ext) {
- return withExtensionStripped;
- }
- return {
- number
- };
- }
- function result(country, nationalNumber, ext) {
- var result2 = {
- country,
- phone: nationalNumber
- };
- if (ext) {
- result2.ext = ext;
- }
- return result2;
- }
- function parsePhoneNumber$3(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata2) {
- var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata2.metadata), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
- var country;
- if (countryCallingCode) {
- metadata2.selectNumberingPlan(countryCallingCode);
- } else if (number && (defaultCountry || defaultCallingCode)) {
- metadata2.selectNumberingPlan(defaultCountry, defaultCallingCode);
- if (defaultCountry) {
- country = defaultCountry;
- }
- countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata2.metadata);
- } else
- return {};
- if (!number) {
- return {
- countryCallingCodeSource,
- countryCallingCode
- };
- }
- var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata2), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
- var exactCountry = getCountryByCallingCode(countryCallingCode, {
- nationalNumber,
- defaultCountry,
- metadata: metadata2
- });
- if (exactCountry) {
- country = exactCountry;
- if (exactCountry === "001")
- ;
- else {
- metadata2.country(country);
- }
- }
- return {
- country,
- countryCallingCode,
- countryCallingCodeSource,
- nationalNumber,
- carrierCode
- };
- }
- function ownKeys$2(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$2(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$2(Object(source), true).forEach(function(key) {
- _defineProperty$2(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$2(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function parsePhoneNumberWithError(text, options, metadata2) {
- return parse(text, _objectSpread$2(_objectSpread$2({}, options), {}, {
- v2: true
- }), metadata2);
- }
- function ownKeys$1(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$1(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
- _defineProperty$1(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$1(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _slicedToArray(arr, i2) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray(o2, minLen);
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _iterableToArrayLimit(arr, i2) {
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
- if (_i == null)
- return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s2, _e2;
- try {
- for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
- _arr.push(_s2.value);
- if (i2 && _arr.length === i2)
- break;
- }
- } catch (err) {
- _d = true;
- _e2 = err;
- } finally {
- try {
- if (!_n && _i["return"] != null)
- _i["return"]();
- } finally {
- if (_d)
- throw _e2;
- }
- }
- return _arr;
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr))
- return arr;
- }
- function normalizeArguments(args) {
- 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];
- var text;
- var options;
- var metadata2;
- if (typeof arg_1 === "string") {
- text = arg_1;
- } else
- throw new TypeError("A text for parsing must be a string.");
- if (!arg_2 || typeof arg_2 === "string") {
- if (arg_4) {
- options = arg_3;
- metadata2 = arg_4;
- } else {
- options = void 0;
- metadata2 = arg_3;
- }
- if (arg_2) {
- options = _objectSpread$1({
- defaultCountry: arg_2
- }, options);
- }
- } else if (isObject(arg_2)) {
- if (arg_3) {
- options = arg_2;
- metadata2 = arg_3;
- } else {
- metadata2 = arg_2;
- }
- } else
- throw new Error("Invalid second argument: ".concat(arg_2));
- return {
- text,
- options,
- metadata: metadata2
- };
- }
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function parsePhoneNumber$2(text, options, metadata2) {
- if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata2)) {
- options = _objectSpread(_objectSpread({}, options), {}, {
- defaultCountry: void 0
- });
- }
- try {
- return parsePhoneNumberWithError(text, options, metadata2);
- } catch (error) {
- if (error instanceof ParseError)
- ;
- else {
- throw error;
- }
- }
- }
- function parsePhoneNumber$1() {
- var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata2 = _normalizeArguments.metadata;
- return parsePhoneNumber$2(text, options, metadata2);
- }
- 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}"]]] } };
- function withMetadataArgument(func, _arguments) {
- var args = Array.prototype.slice.call(_arguments);
- args.push(metadata);
- return func.apply(this, args);
- }
- function parsePhoneNumber() {
- return withMetadataArgument(parsePhoneNumber$1, arguments);
- }
- const easycom = {
- autoscan: true,
- custom: {
- "^s-(.*)": "@/sheep/components/s-$1/s-$1.vue",
- "^su-(.*)": "@/sheep/ui/su-$1/su-$1.vue"
- }
- };
- const pages = [
- {
- path: "pages/index/index",
- aliasPath: "/",
- style: {
- navigationBarTitleText: "首页",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "首页",
- group: "商城"
- }
- },
- {
- path: "pages/index/user",
- style: {
- navigationBarTitleText: "个人中心",
- enablePullDownRefresh: true
- },
- meta: {
- sync: true,
- title: "个人中心",
- group: "商城"
- }
- },
- {
- path: "pages/index/category",
- style: {
- navigationBarTitleText: "商品分类"
- },
- meta: {
- sync: true,
- title: "商品分类",
- group: "商城"
- }
- },
- {
- path: "pages/index/cart",
- style: {
- navigationBarTitleText: "购物车"
- },
- meta: {
- sync: true,
- title: "购物车",
- group: "商城"
- }
- },
- {
- path: "pages/index/login"
- },
- {
- path: "pages/index/search",
- style: {
- navigationBarTitleText: "搜索"
- },
- meta: {
- sync: true,
- title: "搜索",
- group: "商城"
- }
- },
- {
- path: "pages/index/page",
- style: {
- navigationBarTitleText: ""
- },
- meta: {
- auth: false,
- sync: true,
- title: "自定义页面",
- group: "商城"
- }
- }
- ];
- const subPackages = [
- {
- root: "pages/goods",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "商品详情"
- },
- meta: {
- sync: true,
- title: "普通商品",
- group: "商品"
- }
- },
- {
- path: "groupon",
- style: {
- navigationBarTitleText: "拼团商品"
- },
- meta: {
- sync: true,
- title: "拼团商品",
- group: "商品"
- }
- },
- {
- path: "seckill",
- style: {
- navigationBarTitleText: "秒杀商品"
- },
- meta: {
- sync: true,
- title: "秒杀商品",
- group: "商品"
- }
- },
- {
- path: "list",
- style: {
- navigationBarTitleText: "商品列表"
- },
- meta: {
- sync: true,
- title: "商品列表",
- group: "商品"
- }
- },
- {
- path: "comment/add",
- style: {
- navigationBarTitleText: "评价商品"
- },
- meta: {
- auth: true
- }
- },
- {
- path: "comment/list",
- style: {
- navigationBarTitleText: "商品评价"
- }
- }
- ]
- },
- {
- root: "pages/order",
- pages: [
- {
- path: "detail",
- style: {
- navigationBarTitleText: "订单详情"
- },
- meta: {
- auth: true,
- title: "订单详情"
- }
- },
- {
- path: "confirm",
- style: {
- navigationBarTitleText: "确认订单"
- },
- meta: {
- auth: true,
- title: "确认订单"
- }
- },
- {
- path: "list",
- style: {
- navigationBarTitleText: "我的订单",
- enablePullDownRefresh: true
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户订单",
- group: "订单中心"
- }
- },
- {
- path: "aftersale/apply",
- style: {
- navigationBarTitleText: "申请售后"
- },
- meta: {
- auth: true,
- title: "申请售后"
- }
- },
- {
- path: "aftersale/return-delivery",
- style: {
- navigationBarTitleText: "退货物流"
- },
- meta: {
- auth: true,
- title: "退货物流"
- }
- },
- {
- path: "aftersale/list",
- style: {
- navigationBarTitleText: "售后列表"
- },
- meta: {
- auth: true,
- sync: true,
- title: "售后订单",
- group: "订单中心"
- }
- },
- {
- path: "aftersale/detail",
- style: {
- navigationBarTitleText: "售后详情"
- },
- meta: {
- auth: true,
- title: "售后详情"
- }
- },
- {
- path: "aftersale/log",
- style: {
- navigationBarTitleText: "售后进度"
- },
- meta: {
- auth: true,
- title: "售后进度"
- }
- },
- {
- path: "express/log",
- style: {
- navigationBarTitleText: "物流轨迹"
- },
- meta: {
- auth: true,
- title: "物流轨迹"
- }
- },
- {
- path: "otherlist",
- style: {
- navigationBarTitleText: "",
- enablePullDownRefresh: false
- }
- }
- ]
- },
- {
- root: "pages/user",
- pages: [
- {
- path: "info",
- style: {
- navigationBarTitleText: "我的信息"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户信息",
- group: "用户中心"
- }
- },
- {
- path: "setting",
- style: {
- navigationBarTitleText: "用户设置"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户设置",
- group: "用户中心"
- }
- },
- {
- path: "qrcode-share",
- style: {
- navigationBarTitleText: "我的二维码/分享页"
- },
- meta: {
- auth: true,
- sync: true,
- title: "我的二维码/分享页",
- group: "用户中心"
- }
- },
- {
- path: "goods-collect",
- style: {
- navigationBarTitleText: "我的收藏"
- },
- meta: {
- auth: true,
- sync: true,
- title: "商品收藏",
- group: "用户中心"
- }
- },
- {
- path: "goods-log",
- style: {
- navigationBarTitleText: "我的足迹"
- },
- meta: {
- auth: true,
- sync: true,
- title: "浏览记录",
- group: "用户中心"
- }
- },
- {
- path: "address/list",
- style: {
- navigationBarTitleText: "实体商品收货地址"
- },
- meta: {
- auth: true,
- sync: true,
- title: "地址管理",
- group: "用户中心"
- }
- },
- {
- path: "dummyAddress/list",
- style: {
- navigationBarTitleText: "虚拟商品收货地址"
- },
- meta: {
- auth: true,
- sync: true,
- title: "虚拟商品收货地址",
- group: "用户中心"
- }
- },
- {
- path: "invoice/edit",
- style: {
- navigationBarTitleText: "发票抬头编辑"
- },
- meta: {
- auth: true,
- title: "发票抬头"
- }
- },
- {
- path: "invoice/list",
- style: {
- navigationBarTitleText: "发票抬头管理"
- },
- meta: {
- auth: true,
- sync: true,
- title: "发票抬头管理",
- group: "用户中心"
- }
- },
- {
- path: "address/edit",
- style: {
- navigationBarTitleText: "编辑地址"
- },
- meta: {
- auth: true,
- title: "编辑地址"
- }
- },
- {
- path: "dummyAddress/edit",
- style: {
- navigationBarTitleText: "编辑地址"
- },
- meta: {
- auth: true,
- title: "编辑地址"
- }
- },
- {
- path: "wallet/money",
- style: {
- navigationBarTitleText: "我的余额"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户余额",
- group: "用户中心"
- }
- },
- {
- path: "wallet/score",
- style: {
- navigationBarTitleText: "我的积分"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户积分",
- group: "用户中心"
- }
- },
- {
- path: "wallet/scoreToMoney",
- style: {
- navigationBarTitleText: "积分兑换"
- },
- meta: {
- auth: true,
- sync: true,
- title: "积分兑换",
- group: "用户中心"
- }
- },
- {
- path: "wallet/ScoreLog"
- },
- {
- path: "wallet/maxScoreLog"
- },
- {
- path: "wallet/team",
- style: {
- navigationBarTitleText: "团队"
- },
- meta: {
- auth: true,
- sync: true,
- title: "团队",
- group: "用户中心"
- }
- }
- ]
- },
- {
- root: "pages/commission",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "分销"
- },
- meta: {
- auth: true,
- sync: true,
- title: "分销中心",
- group: "分销商城"
- }
- },
- {
- path: "wallet",
- style: {
- navigationBarTitleText: "我的佣金"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户佣金",
- group: "分销中心"
- }
- },
- {
- path: "goods",
- style: {
- navigationBarTitleText: "推广商品"
- },
- meta: {
- auth: true,
- sync: true,
- title: "推广商品",
- group: "分销商城"
- }
- },
- {
- path: "order",
- style: {
- navigationBarTitleText: "分销订单"
- },
- meta: {
- auth: true,
- sync: true,
- title: "分销订单",
- group: "分销商城"
- }
- },
- {
- path: "team",
- style: {
- navigationBarTitleText: "我的团队"
- },
- meta: {
- auth: true,
- sync: true,
- title: "我的团队",
- group: "分销商城"
- }
- },
- {
- path: "promoter",
- style: {
- navigationBarTitleText: "推广人排行榜"
- },
- meta: {
- auth: true,
- sync: true,
- title: "推广人排行榜",
- group: "分销商城"
- }
- },
- {
- path: "commission-ranking",
- style: {
- navigationBarTitleText: "佣金排行榜"
- },
- meta: {
- auth: true,
- sync: true,
- title: "佣金排行榜",
- group: "分销商城"
- }
- },
- {
- path: "withdraw",
- style: {
- navigationBarTitleText: "申请提现"
- },
- meta: {
- auth: true,
- sync: true,
- title: "申请提现",
- group: "分销商城"
- }
- }
- ]
- },
- {
- root: "pages/app",
- pages: [
- {
- path: "sign",
- style: {
- navigationBarTitleText: "签到中心"
- },
- meta: {
- auth: true,
- sync: true,
- title: "签到中心",
- group: "应用"
- }
- }
- ]
- },
- {
- root: "pages/shop",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "店铺首页"
- },
- meta: {
- auth: true,
- sync: true,
- title: "店铺首页",
- group: "应用"
- }
- }
- ]
- },
- {
- root: "pages/public",
- pages: [
- {
- path: "setting",
- style: {
- navigationBarTitleText: "系统设置"
- },
- meta: {
- sync: true,
- title: "系统设置",
- group: "通用"
- }
- },
- {
- path: "richtext",
- style: {
- navigationBarTitleText: "富文本"
- },
- meta: {
- sync: true,
- title: "富文本",
- group: "通用"
- }
- },
- {
- path: "faq",
- style: {
- navigationBarTitleText: "常见问题"
- },
- meta: {
- sync: true,
- title: "常见问题",
- group: "通用"
- }
- },
- {
- path: "error",
- style: {
- navigationBarTitleText: "错误页面"
- }
- },
- {
- path: "webview",
- style: {
- navigationBarTitleText: ""
- }
- }
- ]
- },
- {
- root: "pages/coupon",
- pages: [
- {
- path: "list",
- style: {
- navigationBarTitleText: "领券中心"
- },
- meta: {
- sync: true,
- title: "领券中心",
- group: "优惠券"
- }
- },
- {
- path: "detail",
- style: {
- navigationBarTitleText: "优惠券"
- },
- meta: {
- auth: false,
- sync: true,
- title: "优惠券详情",
- group: "优惠券"
- }
- }
- ]
- },
- {
- root: "pages/chat",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "客服"
- },
- meta: {
- auth: true,
- sync: true,
- title: "客服",
- group: "客服"
- }
- },
- {
- path: "speechtotext",
- style: {
- navigationBarTitleText: "语音转文字",
- enablePullDownRefresh: false
- },
- meta: {
- auth: true,
- sync: true,
- title: "语音转文字",
- group: "语音转文字"
- }
- }
- ]
- },
- {
- root: "pages/pay",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "收银台"
- }
- },
- {
- path: "result",
- style: {
- navigationBarTitleText: "支付结果"
- }
- },
- {
- path: "recharge",
- style: {
- navigationBarTitleText: "充值余额"
- },
- meta: {
- auth: true,
- sync: true,
- title: "充值余额",
- group: "支付"
- }
- },
- {
- path: "recharge-log",
- style: {
- navigationBarTitleText: "充值记录"
- },
- meta: {
- auth: true,
- sync: true,
- title: "充值记录",
- group: "支付"
- }
- }
- ]
- },
- {
- root: "pages/activity",
- pages: [
- {
- path: "groupon/detail",
- style: {
- navigationBarTitleText: "拼团详情"
- }
- },
- {
- path: "groupon/order",
- style: {
- navigationBarTitleText: "我的拼团",
- enablePullDownRefresh: true
- },
- meta: {
- auth: true,
- sync: true,
- title: "拼团订单",
- group: "营销活动"
- }
- },
- {
- path: "index",
- style: {
- navigationBarTitleText: "营销商品"
- },
- meta: {
- sync: true,
- title: "营销商品",
- group: "营销活动"
- }
- },
- {
- path: "groupon/list",
- style: {
- navigationBarTitleText: "拼团活动"
- },
- meta: {
- sync: true,
- title: "拼团活动",
- group: "营销活动"
- }
- },
- {
- path: "seckill/list",
- style: {
- navigationBarTitleText: "秒杀活动"
- },
- meta: {
- sync: true,
- title: "秒杀活动",
- group: "营销活动"
- }
- },
- {
- path: "bargain/list",
- style: {
- navigationBarTitleText: "砍价列表"
- },
- meta: {
- sync: true,
- title: "砍价列表",
- group: "营销活动"
- }
- },
- {
- path: "bargain/detail",
- style: {
- navigationBarTitleText: "砍价详情"
- },
- meta: {
- sync: true,
- title: "砍价详情",
- group: "营销活动"
- }
- }
- ]
- }
- ];
- const globalStyle = {
- navigationBarTextStyle: "black",
- navigationBarTitleText: "常来此购",
- navigationBarBackgroundColor: "#FFFFFF",
- backgroundColor: "#FFFFFF",
- navigationStyle: "custom"
- };
- const tabBar = {
- list: [
- {
- pagePath: "pages/index/index"
- },
- {
- pagePath: "pages/index/cart"
- },
- {
- pagePath: "pages/index/user"
- }
- ]
- };
- const condition = {
- current: 0,
- list: [
- {
- name: "",
- path: "",
- query: ""
- }
- ]
- };
- const usingComponents = {
- richtext: "@/pages/public/richtext"
- };
- const e = {
- easycom,
- pages,
- subPackages,
- globalStyle,
- tabBar,
- condition,
- usingComponents
- };
- function t(e2) {
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
- }
- function n(e2, t2, n2) {
- return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
- return function() {
- throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
- }(null == t3 && n2.path);
- } }, n2.exports), n2.exports;
- }
- var s = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = n2 || function(e3, t3) {
- var n3 = Object.create || function() {
- function e4() {
- }
- return function(t4) {
- var n4;
- return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
- };
- }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
- var t4 = n3(this);
- return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
- t4.$super.init.apply(this, arguments);
- }), t4.init.prototype = t4, t4.$super = this, t4;
- }, create: function() {
- var e4 = this.extend();
- return e4.init.apply(e4, arguments), e4;
- }, init: function() {
- }, mixIn: function(e4) {
- for (var t4 in e4)
- e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
- e4.hasOwnProperty("toString") && (this.toString = e4.toString);
- }, clone: function() {
- return this.init.prototype.extend(this);
- } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
- e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
- }, toString: function(e4) {
- return (e4 || c2).stringify(this);
- }, concat: function(e4) {
- var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
- if (this.clamp(), s3 % 4)
- for (var i3 = 0; i3 < r3; i3++) {
- var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
- t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
- }
- else
- for (i3 = 0; i3 < r3; i3 += 4)
- t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
- return this.sigBytes += r3, this;
- }, clamp: function() {
- var t4 = this.words, n4 = this.sigBytes;
- t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4.words = this.words.slice(0), e4;
- }, random: function(t4) {
- for (var n4, s3 = [], r3 = function(t5) {
- t5 = t5;
- var n5 = 987654321, s4 = 4294967295;
- return function() {
- var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
- return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
- };
- }, i3 = 0; i3 < t4; i3 += 4) {
- var a3 = r3(4294967296 * (n4 || e3.random()));
- n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
- }
- return new o2.init(s3, t4);
- } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
- for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
- var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
- s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
- }
- return s3.join("");
- }, parse: function(e4) {
- for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
- n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
- return new o2.init(n4, t4 / 2);
- } }, u2 = a2.Latin1 = { stringify: function(e4) {
- for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
- var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
- s3.push(String.fromCharCode(i3));
- }
- return s3.join("");
- }, parse: function(e4) {
- for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
- n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
- return new o2.init(n4, t4);
- } }, h2 = a2.Utf8 = { stringify: function(e4) {
- try {
- return decodeURIComponent(escape(u2.stringify(e4)));
- } catch (e5) {
- throw new Error("Malformed UTF-8 data");
- }
- }, parse: function(e4) {
- return u2.parse(unescape(encodeURIComponent(e4)));
- } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
- this._data = new o2.init(), this._nDataBytes = 0;
- }, _append: function(e4) {
- "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
- }, _process: function(t4) {
- 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);
- if (c3) {
- for (var h3 = 0; h3 < c3; h3 += i3)
- this._doProcessBlock(s3, h3);
- var l3 = s3.splice(0, c3);
- n4.sigBytes -= u3;
- }
- return new o2.init(l3, u3);
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._data = this._data.clone(), e4;
- }, _minBufferSize: 0 });
- r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
- this.cfg = this.cfg.extend(e4), this.reset();
- }, reset: function() {
- l2.reset.call(this), this._doReset();
- }, update: function(e4) {
- return this._append(e4), this._process(), this;
- }, finalize: function(e4) {
- return e4 && this._append(e4), this._doFinalize();
- }, blockSize: 16, _createHelper: function(e4) {
- return function(t4, n4) {
- return new e4.init(n4).finalize(t4);
- };
- }, _createHmacHelper: function(e4) {
- return function(t4, n4) {
- return new d2.HMAC.init(e4, n4).finalize(t4);
- };
- } });
- var d2 = s2.algo = {};
- return s2;
- }(Math), n2);
- }), r = s, i = (n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function(e3) {
- var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
- !function() {
- for (var t4 = 0; t4 < 64; t4++)
- a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
- }();
- var c2 = o2.MD5 = i2.extend({ _doReset: function() {
- this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
- }, _doProcessBlock: function(e4, t4) {
- for (var n3 = 0; n3 < 16; n3++) {
- var s3 = t4 + n3, r3 = e4[s3];
- e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
- }
- 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];
- 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;
- }, _doFinalize: function() {
- var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
- n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
- var i3 = e3.floor(s3 / 4294967296), o3 = s3;
- 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();
- for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
- var h3 = c3[u3];
- c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
- }
- return a3;
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._hash = this._hash.clone(), e4;
- } });
- function u2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function h2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function l2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function d2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
- }(Math), n2.MD5);
- }), n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, void function() {
- var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
- e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
- e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
- var n3 = e4.blockSize, r2 = 4 * n3;
- t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
- for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
- a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
- i2.sigBytes = o2.sigBytes = r2, this.reset();
- }, reset: function() {
- var e4 = this._hasher;
- e4.reset(), e4.update(this._iKey);
- }, update: function(e4) {
- return this._hasher.update(e4), this;
- }, finalize: function(e4) {
- var t4 = this._hasher, n3 = t4.finalize(e4);
- return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
- } });
- }());
- }), n(function(e2, t2) {
- e2.exports = r.HmacMD5;
- })), o = n(function(e2, t2) {
- e2.exports = r.enc.Utf8;
- }), a = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function() {
- var e3 = n2, t3 = e3.lib.WordArray;
- function s2(e4, n3, s3) {
- for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
- if (o2 % 4) {
- var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
- r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
- }
- return t3.create(r2, i2);
- }
- e3.enc.Base64 = { stringify: function(e4) {
- var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
- e4.clamp();
- for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
- 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++)
- r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
- var c2 = s3.charAt(64);
- if (c2)
- for (; r2.length % 4; )
- r2.push(c2);
- return r2.join("");
- }, parse: function(e4) {
- var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
- if (!r2) {
- r2 = this._reverseMap = [];
- for (var i2 = 0; i2 < n3.length; i2++)
- r2[n3.charCodeAt(i2)] = i2;
- }
- var o2 = n3.charAt(64);
- if (o2) {
- var a2 = e4.indexOf(o2);
- -1 !== a2 && (t4 = a2);
- }
- return s2(e4, t4, r2);
- }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
- }(), n2.enc.Base64);
- });
- const c = "FUNCTION", u = "OBJECT", h = "CLIENT_DB", l = "pending", d = "fulfilled", p = "rejected";
- function f(e2) {
- return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
- }
- function g(e2) {
- return "object" === f(e2);
- }
- function m(e2) {
- return "function" == typeof e2;
- }
- function y(e2) {
- return function() {
- try {
- return e2.apply(e2, arguments);
- } catch (e3) {
- console.error(e3);
- }
- };
- }
- const _ = "REJECTED", w = "NOT_PENDING";
- class v {
- constructor({ createPromise: e2, retryRule: t2 = _ } = {}) {
- this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
- }
- get needRetry() {
- if (!this.status)
- return true;
- switch (this.retryRule) {
- case _:
- return this.status === p;
- case w:
- return this.status !== l;
- }
- }
- exec() {
- 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;
- }
- }
- function I(e2) {
- return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
- }
- const S = true, b = "mp-weixin", A = I([]), P = b, T = I(""), C = I("[]") || [];
- let O = "";
- try {
- O = "__UNI__7806143";
- } catch (e2) {
- }
- let E = {};
- function L(e2, t2 = {}) {
- var n2, s2;
- return n2 = E, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (E[e2] = t2), E[e2];
- }
- const R = ["invoke", "success", "fail", "complete"], U = L("_globalUniCloudInterceptor");
- function N(e2, t2) {
- U[e2] || (U[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => {
- R.indexOf(n2) > -1 && function(e3, t3, n3) {
- let s2 = U[e3][t3];
- s2 || (s2 = U[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3);
- }(e2, n2, t2[n2]);
- });
- }
- function D(e2, t2) {
- U[e2] || (U[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => {
- R.indexOf(n2) > -1 && function(e3, t3, n3) {
- const s2 = U[e3][t3];
- if (!s2)
- return;
- const r2 = s2.indexOf(n3);
- r2 > -1 && s2.splice(r2, 1);
- }(e2, n2, t2[n2]);
- }) : delete U[e2];
- }
- function M(e2, t2) {
- return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
- }
- function q(e2, t2) {
- return U[e2] && U[e2][t2] || [];
- }
- function F(e2) {
- N("callObject", e2);
- }
- const K = L("_globalUniCloudListener"), j = "response", $ = "needLogin", B = "refreshToken", W = "clientdb", H = "cloudfunction", z = "cloudobject";
- function J(e2) {
- return K[e2] || (K[e2] = []), K[e2];
- }
- function G(e2, t2) {
- const n2 = J(e2);
- n2.includes(t2) || n2.push(t2);
- }
- function V(e2, t2) {
- const n2 = J(e2), s2 = n2.indexOf(t2);
- -1 !== s2 && n2.splice(s2, 1);
- }
- function Y(e2, t2) {
- const n2 = J(e2);
- for (let e3 = 0; e3 < n2.length; e3++) {
- (0, n2[e3])(t2);
- }
- }
- let Q, X = false;
- function Z() {
- return Q || (Q = new Promise((e2) => {
- X && e2(), function t2() {
- if ("function" == typeof getCurrentPages) {
- const t3 = getCurrentPages();
- t3 && t3[0] && (X = true, e2());
- }
- X || setTimeout(() => {
- t2();
- }, 30);
- }();
- }), Q);
- }
- function ee(e2) {
- const t2 = {};
- for (const n2 in e2) {
- const s2 = e2[n2];
- m(s2) && (t2[n2] = y(s2));
- }
- return t2;
- }
- class te extends Error {
- constructor(e2) {
- 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;
- }
- toJson(e2 = 0) {
- if (!(e2 >= 10))
- return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
- }
- }
- 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() };
- function se(e2) {
- return e2 && se(e2.__v_raw) || e2;
- }
- function re() {
- return { token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"), tokenExpired: ne.getStorageSync("uni_id_token_expired") };
- }
- function ie({ token: e2, tokenExpired: t2 } = {}) {
- e2 && ne.setStorageSync("uni_id_token", e2), t2 && ne.setStorageSync("uni_id_token_expired", t2);
- }
- let oe, ae;
- function ce() {
- return oe || (oe = index$1.getSystemInfoSync()), oe;
- }
- function ue() {
- let e2, t2;
- try {
- if (index$1.getLaunchOptionsSync) {
- if (index$1.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
- return;
- const { scene: n2, channel: s2 } = index$1.getLaunchOptionsSync();
- e2 = s2, t2 = n2;
- }
- } catch (e3) {
- }
- return { channel: e2, scene: t2 };
- }
- function he() {
- const e2 = index$1.getLocale && index$1.getLocale() || "en";
- if (ae)
- return { ...ae, locale: e2, LOCALE: e2 };
- 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"];
- for (let e3 = 0; e3 < o2.length; e3++) {
- delete t2[o2[e3]];
- }
- return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...ae, locale: e2, LOCALE: e2 };
- }
- var le = { sign: function(e2, t2) {
- let n2 = "";
- return Object.keys(e2).sort().forEach(function(t3) {
- e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
- }), n2 = n2.slice(1), i(n2, t2).toString();
- }, wrappedRequest: function(e2, t2) {
- return new Promise((n2, s2) => {
- t2(Object.assign(e2, { complete(e3) {
- e3 || (e3 = {});
- const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
- if (!e3.statusCode || e3.statusCode >= 400)
- return s2(new te({ code: "SYS_ERR", message: e3.errMsg || "request:fail", requestId: t3 }));
- const r2 = e3.data;
- if (r2.error)
- return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
- r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
- } }));
- });
- }, toBase64: function(e2) {
- return a.stringify(o.parse(e2));
- } };
- var de = class {
- constructor(e2) {
- ["spaceId", "clientSecret"].forEach((t2) => {
- if (!Object.prototype.hasOwnProperty.call(e2, t2))
- throw new Error(`${t2} required`);
- }), 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) => {
- if (!e3.result || !e3.result.accessToken)
- throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
- this.setAccessToken(e3.result.accessToken);
- }), retryRule: w });
- }
- get hasAccessToken() {
- return !!this.accessToken;
- }
- setAccessToken(e2) {
- this.accessToken = e2;
- }
- requestWrapped(e2) {
- return le.wrappedRequest(e2, this.adapter.request);
- }
- requestAuth(e2) {
- return this.requestWrapped(e2);
- }
- request(e2, t2) {
- return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
- !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
- }).then(() => this.getAccessToken()).then(() => {
- const t4 = this.rebuildRequest(e2);
- return this.request(t4, true);
- })) : this.getAccessToken().then(() => {
- const t3 = this.rebuildRequest(e2);
- return this.request(t3, true);
- }));
- }
- rebuildRequest(e2) {
- const t2 = Object.assign({}, e2);
- 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;
- }
- setupRequest(e2, t2) {
- const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
- 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 };
- }
- getAccessToken() {
- return this._getAccessTokenPromiseHub.exec();
- }
- async authorize() {
- await this.getAccessToken();
- }
- callFunction(e2) {
- const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
- return this.request(this.setupRequest(t2));
- }
- getOSSUploadOptionsFromPath(e2) {
- const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
- return this.request(this.setupRequest(t2));
- }
- uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
- return new Promise((o2, a2) => {
- const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
- e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
- i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }
- reportOSSUpload(e2) {
- const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
- return this.request(this.setupRequest(t2));
- }
- async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
- if ("string" !== f(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
- if (!(t2 = t2.trim()))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
- if (/:\/\//.test(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
- const o2 = i2 && i2.envType || this.config.envType;
- if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
- throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
- 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 };
- if (u2 && (_2["x-oss-security-token"] = u2), y2) {
- const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
- _2.callback = le.toBase64(e3);
- }
- const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
- if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
- return { success: true, filePath: e2, fileID: c2 };
- if ((await this.reportOSSUpload({ id: g2 })).success)
- return { success: true, filePath: e2, fileID: c2 };
- throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
- }
- getTempFileURL({ fileList: e2 } = {}) {
- return new Promise((t2, n2) => {
- Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
- });
- }
- async getFileInfo({ fileList: e2 } = {}) {
- if (!Array.isArray(e2) || 0 === e2.length)
- throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
- const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
- return { fileList: (await this.request(this.setupRequest(t2))).result };
- }
- };
- var pe = { init(e2) {
- const t2 = new de(e2), n2 = { signInAnonymously: function() {
- return t2.authorize();
- }, getLoginState: function() {
- return Promise.resolve(false);
- } };
- return t2.auth = function() {
- return n2;
- }, t2.customAuth = t2.auth, t2;
- } };
- const fe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
- var ge;
- !function(e2) {
- e2.local = "local", e2.none = "none", e2.session = "session";
- }(ge || (ge = {}));
- var me = function() {
- }, ye = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function(e3) {
- var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
- !function() {
- function t4(t5) {
- for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
- if (!(t5 % s4))
- return false;
- return true;
- }
- function n3(e4) {
- return 4294967296 * (e4 - (0 | e4)) | 0;
- }
- for (var s3 = 2, r3 = 0; r3 < 64; )
- t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
- }();
- var u2 = [], h2 = o2.SHA256 = i2.extend({ _doReset: function() {
- this._hash = new r2.init(a2.slice(0));
- }, _doProcessBlock: function(e4, t4) {
- 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++) {
- if (p2 < 16)
- u2[p2] = 0 | e4[t4 + p2];
- else {
- 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;
- u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
- }
- 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];
- d2 = l2, l2 = h3, h3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
- }
- 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;
- }, _doFinalize: function() {
- var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
- 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;
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._hash = this._hash.clone(), e4;
- } });
- t3.SHA256 = i2._createHelper(h2), t3.HmacSHA256 = i2._createHmacHelper(h2);
- }(Math), n2.SHA256);
- }), _e = ye, we = n(function(e2, t2) {
- e2.exports = r.HmacSHA256;
- });
- const ve = () => {
- let e2;
- if (!Promise) {
- e2 = () => {
- }, e2.promise = {};
- const t3 = () => {
- throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
- };
- return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
- }
- const t2 = new Promise((t3, n2) => {
- e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
- });
- return e2.promise = t2, e2;
- };
- function Ie(e2) {
- return void 0 === e2;
- }
- function Se(e2) {
- return "[object Null]" === Object.prototype.toString.call(e2);
- }
- var be;
- function ke(e2) {
- const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
- var n2;
- for (const e3 of t2) {
- const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
- if (t3())
- return { adapter: n3(), runtime: s2 };
- }
- }
- !function(e2) {
- e2.WEB = "web", e2.WX_MP = "wx_mp";
- }(be || (be = {}));
- const Ae = { adapter: null, runtime: void 0 }, Pe = ["anonymousUuidKey"];
- class Te extends me {
- constructor() {
- super(), Ae.adapter.root.tcbObject || (Ae.adapter.root.tcbObject = {});
- }
- setItem(e2, t2) {
- Ae.adapter.root.tcbObject[e2] = t2;
- }
- getItem(e2) {
- return Ae.adapter.root.tcbObject[e2];
- }
- removeItem(e2) {
- delete Ae.adapter.root.tcbObject[e2];
- }
- clear() {
- delete Ae.adapter.root.tcbObject;
- }
- }
- function Ce(e2, t2) {
- switch (e2) {
- case "local":
- return t2.localStorage || new Te();
- case "none":
- return new Te();
- default:
- return t2.sessionStorage || new Te();
- }
- }
- class xe {
- constructor(e2) {
- if (!this._storage) {
- this._persistence = Ae.adapter.primaryStorage || e2.persistence, this._storage = Ce(this._persistence, Ae.adapter);
- 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}`;
- this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
- }
- }
- updatePersistence(e2) {
- if (e2 === this._persistence)
- return;
- const t2 = "local" === this._persistence;
- this._persistence = e2;
- const n2 = Ce(e2, Ae.adapter);
- for (const e3 in this.keys) {
- const s2 = this.keys[e3];
- if (t2 && Pe.includes(e3))
- continue;
- const r2 = this._storage.getItem(s2);
- Ie(r2) || Se(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
- }
- this._storage = n2;
- }
- setStore(e2, t2, n2) {
- if (!this._storage)
- return;
- const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
- try {
- this._storage.setItem(e2, r2);
- } catch (e3) {
- throw e3;
- }
- }
- getStore(e2, t2) {
- try {
- if (!this._storage)
- return;
- } catch (e3) {
- return "";
- }
- t2 = t2 || "localCachev1";
- const n2 = this._storage.getItem(e2);
- if (!n2)
- return "";
- if (n2.indexOf(t2) >= 0) {
- return JSON.parse(n2).content;
- }
- return "";
- }
- removeStore(e2) {
- this._storage.removeItem(e2);
- }
- }
- const Oe = {}, Ee = {};
- function Le(e2) {
- return Oe[e2];
- }
- class Re {
- constructor(e2, t2) {
- this.data = t2 || null, this.name = e2;
- }
- }
- class Ue extends Re {
- constructor(e2, t2) {
- super("error", { error: e2, data: t2 }), this.error = e2;
- }
- }
- const Ne = new class {
- constructor() {
- this._listeners = {};
- }
- on(e2, t2) {
- return function(e3, t3, n2) {
- n2[e3] = n2[e3] || [], n2[e3].push(t3);
- }(e2, t2, this._listeners), this;
- }
- off(e2, t2) {
- return function(e3, t3, n2) {
- if (n2 && n2[e3]) {
- const s2 = n2[e3].indexOf(t3);
- -1 !== s2 && n2[e3].splice(s2, 1);
- }
- }(e2, t2, this._listeners), this;
- }
- fire(e2, t2) {
- if (e2 instanceof Ue)
- return console.error(e2.error), this;
- const n2 = "string" == typeof e2 ? new Re(e2, t2 || {}) : e2;
- const s2 = n2.name;
- if (this._listens(s2)) {
- n2.target = this;
- const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
- for (const t3 of e3)
- t3.call(this, n2);
- }
- return this;
- }
- _listens(e2) {
- return this._listeners[e2] && this._listeners[e2].length > 0;
- }
- }();
- function De(e2, t2) {
- Ne.on(e2, t2);
- }
- function Me(e2, t2 = {}) {
- Ne.fire(e2, t2);
- }
- function qe(e2, t2) {
- Ne.off(e2, t2);
- }
- const Fe = "loginStateChanged", Ke = "loginStateExpire", je = "loginTypeChanged", $e = "anonymousConverted", Be = "refreshAccessToken";
- var We;
- !function(e2) {
- 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";
- }(We || (We = {}));
- 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" };
- function Je(e2, t2, n2) {
- const s2 = e2[t2];
- e2[t2] = function(t3) {
- const r2 = {}, i2 = {};
- n2.forEach((n3) => {
- const { data: s3, headers: o3 } = n3.call(e2, t3);
- Object.assign(r2, s3), Object.assign(i2, o3);
- });
- const o2 = t3.data;
- return o2 && (() => {
- var e3;
- if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
- t3.data = { ...o2, ...r2 };
- else
- for (const e4 in r2)
- o2.append(e4, r2[e4]);
- })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
- };
- }
- function Ge() {
- const e2 = Math.random().toString(16).slice(2);
- return { data: { seqId: e2 }, headers: { ...ze, "x-seqid": e2 } };
- }
- class Ve {
- constructor(e2 = {}) {
- var t2;
- 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]);
- }
- async post(e2) {
- return await this._reqClass.post(e2);
- }
- async upload(e2) {
- return await this._reqClass.upload(e2);
- }
- async download(e2) {
- return await this._reqClass.download(e2);
- }
- async refreshAccessToken() {
- let e2, t2;
- this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
- try {
- e2 = await this._refreshAccessTokenPromise;
- } catch (e3) {
- t2 = e3;
- }
- if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
- throw t2;
- return e2;
- }
- async _refreshAccessToken() {
- const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
- this._cache.removeStore(e2), this._cache.removeStore(t2);
- let i2 = this._cache.getStore(n2);
- if (!i2)
- throw new te({ message: "未登录CloudBase" });
- const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
- if (a2.data.code) {
- const { code: e3 } = a2.data;
- if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
- if (this._cache.getStore(s2) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
- const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
- return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
- }
- Me(Ke), this._cache.removeStore(n2);
- }
- throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
- }
- if (a2.data.access_token)
- 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 };
- a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
- }
- async getAccessToken() {
- const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
- if (!this._cache.getStore(n2))
- throw new te({ message: "refresh token不存在,登录状态异常" });
- let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
- return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
- }
- async request(e2, t2, n2) {
- const s2 = `x-tcb-trace_${this.config.env}`;
- let r2 = "application/x-www-form-urlencoded";
- const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
- if (-1 === He.indexOf(e2)) {
- const { refreshTokenKey: e3 } = this._cache.keys;
- this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
- }
- let o2;
- if ("storage.uploadFile" === e2) {
- o2 = new FormData();
- for (let e3 in o2)
- o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
- r2 = "multipart/form-data";
- } else {
- r2 = "application/json", o2 = {};
- for (let e3 in i2)
- void 0 !== i2[e3] && (o2[e3] = i2[e3]);
- }
- let a2 = { headers: { "content-type": r2 } };
- n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
- const c2 = this._localCache.getStore(s2);
- c2 && (a2.headers["X-TCB-Trace"] = c2);
- const { parse: u2, inQuery: h2, search: l2 } = t2;
- let d2 = { env: this.config.env };
- u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
- let p2 = function(e3, t3, n3 = {}) {
- const s3 = /\?/.test(t3);
- let r3 = "";
- for (let e4 in n3)
- "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
- return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
- }(fe, "//tcb-api.tencentcloudapi.com/web", d2);
- l2 && (p2 += l2);
- const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
- if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
- throw new te({ code: "NETWORK_ERROR", message: "network request error" });
- return f2;
- }
- async send(e2, t2 = {}) {
- const n2 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
- if ("ACCESS_TOKEN_EXPIRED" === n2.data.code && -1 === He.indexOf(e2)) {
- await this.refreshAccessToken();
- const n3 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
- if (n3.data.code)
- throw new te({ code: n3.data.code, message: n3.data.message });
- return n3.data;
- }
- if (n2.data.code)
- throw new te({ code: n2.data.code, message: n2.data.message });
- return n2.data;
- }
- setRefreshToken(e2) {
- const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
- }
- }
- const Ye = {};
- function Qe(e2) {
- return Ye[e2];
- }
- class Xe {
- constructor(e2) {
- this.config = e2, this._cache = Le(e2.env), this._request = Qe(e2.env);
- }
- setRefreshToken(e2) {
- const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
- }
- setAccessToken(e2, t2) {
- const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
- this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
- }
- async refreshUserInfo() {
- const { data: e2 } = await this._request.send("auth.getUserInfo", {});
- return this.setLocalUserInfo(e2), e2;
- }
- setLocalUserInfo(e2) {
- const { userInfoKey: t2 } = this._cache.keys;
- this._cache.setStore(t2, e2);
- }
- }
- class Ze {
- constructor(e2) {
- if (!e2)
- throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
- this._envId = e2, this._cache = Le(this._envId), this._request = Qe(this._envId), this.setUserInfo();
- }
- linkWithTicket(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
- return this._request.send("auth.linkWithTicket", { ticket: e2 });
- }
- linkWithRedirect(e2) {
- e2.signInWithRedirect();
- }
- updatePassword(e2, t2) {
- return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
- }
- updateEmail(e2) {
- return this._request.send("auth.updateEmail", { newEmail: e2 });
- }
- updateUsername(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- return this._request.send("auth.updateUsername", { username: e2 });
- }
- async getLinkedUidList() {
- const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
- let t2 = false;
- const { users: n2 } = e2;
- return n2.forEach((e3) => {
- e3.wxOpenId && e3.wxPublicId && (t2 = true);
- }), { users: n2, hasPrimaryUid: t2 };
- }
- setPrimaryUid(e2) {
- return this._request.send("auth.setPrimaryUid", { uid: e2 });
- }
- unlink(e2) {
- return this._request.send("auth.unlink", { platform: e2 });
- }
- async update(e2) {
- 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 });
- this.setLocalUserInfo(a2);
- }
- async refresh() {
- const { data: e2 } = await this._request.send("auth.getUserInfo", {});
- return this.setLocalUserInfo(e2), e2;
- }
- setUserInfo() {
- const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
- ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
- this[e3] = t2[e3];
- }), this.location = { country: t2.country, province: t2.province, city: t2.city };
- }
- setLocalUserInfo(e2) {
- const { userInfoKey: t2 } = this._cache.keys;
- this._cache.setStore(t2, e2), this.setUserInfo();
- }
- }
- class et {
- constructor(e2) {
- if (!e2)
- throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
- this._cache = Le(e2);
- 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);
- this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new Ze(e2);
- }
- get isAnonymousAuth() {
- return this.loginType === We.ANONYMOUS;
- }
- get isCustomAuth() {
- return this.loginType === We.CUSTOM;
- }
- get isWeixinAuth() {
- return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
- }
- get loginType() {
- return this._cache.getStore(this._cache.keys.loginTypeKey);
- }
- }
- let tt$1 = class tt2 extends Xe {
- async signIn() {
- this._cache.updatePersistence("local");
- 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 });
- if (r2.uuid && r2.refresh_token) {
- 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" });
- const e3 = new et(this.config.env);
- return await e3.user.refresh(), e3;
- }
- throw new te({ message: "匿名登录失败" });
- }
- async linkAndRetrieveDataWithTicket(e2) {
- 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 });
- if (i2.refresh_token)
- 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 } };
- throw new te({ message: "匿名转化失败" });
- }
- _setAnonymousUUID(e2) {
- const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, We.ANONYMOUS);
- }
- _clearAnonymousUUID() {
- this._cache.removeStore(this._cache.keys.anonymousUuidKey);
- }
- };
- class nt extends Xe {
- async signIn(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
- const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
- if (n2.refresh_token)
- 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);
- throw new te({ message: "自定义登录失败" });
- }
- }
- class st extends Xe {
- async signIn(e2, t2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
- 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;
- if (r2)
- 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);
- throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
- }
- async activate(e2) {
- return this._request.send("auth.activateEndUserMail", { token: e2 });
- }
- async resetPasswordWithToken(e2, t2) {
- return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
- }
- }
- class rt extends Xe {
- async signIn(e2, t2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
- 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;
- if (r2)
- 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);
- throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
- }
- }
- class it {
- constructor(e2) {
- 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);
- }
- get currentUser() {
- const e2 = this.hasLoginState();
- return e2 && e2.user || null;
- }
- get loginType() {
- return this._cache.getStore(this._cache.keys.loginTypeKey);
- }
- anonymousAuthProvider() {
- return new tt$1(this.config);
- }
- customAuthProvider() {
- return new nt(this.config);
- }
- emailAuthProvider() {
- return new st(this.config);
- }
- usernameAuthProvider() {
- return new rt(this.config);
- }
- async signInAnonymously() {
- return new tt$1(this.config).signIn();
- }
- async signInWithEmailAndPassword(e2, t2) {
- return new st(this.config).signIn(e2, t2);
- }
- signInWithUsernameAndPassword(e2, t2) {
- return new rt(this.config).signIn(e2, t2);
- }
- async linkAndRetrieveDataWithTicket(e2) {
- this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt$1(this.config)), De($e, this._onAnonymousConverted);
- return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
- }
- async signOut() {
- if (this.loginType === We.ANONYMOUS)
- throw new te({ message: "匿名用户不支持登出操作" });
- const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
- if (!s2)
- return;
- const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
- 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;
- }
- async signUpWithEmailAndPassword(e2, t2) {
- return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
- }
- async sendPasswordResetEmail(e2) {
- return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
- }
- onLoginStateChanged(e2) {
- De(Fe, () => {
- const t3 = this.hasLoginState();
- e2.call(this, t3);
- });
- const t2 = this.hasLoginState();
- e2.call(this, t2);
- }
- onLoginStateExpired(e2) {
- De(Ke, e2.bind(this));
- }
- onAccessTokenRefreshed(e2) {
- De(Be, e2.bind(this));
- }
- onAnonymousConverted(e2) {
- De($e, e2.bind(this));
- }
- onLoginTypeChanged(e2) {
- De(je, () => {
- const t2 = this.hasLoginState();
- e2.call(this, t2);
- });
- }
- async getAccessToken() {
- return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
- }
- hasLoginState() {
- const { refreshTokenKey: e2 } = this._cache.keys;
- return this._cache.getStore(e2) ? new et(this.config.env) : null;
- }
- async isUsernameRegistered(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
- return t2 && t2.isRegistered;
- }
- getLoginState() {
- return Promise.resolve(this.hasLoginState());
- }
- async signInWithTicket(e2) {
- return new nt(this.config).signIn(e2);
- }
- shouldRefreshAccessToken(e2) {
- this._request._shouldRefreshAccessTokenHook = e2.bind(this);
- }
- getUserInfo() {
- return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
- }
- getAuthHeader() {
- const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
- return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
- }
- _onAnonymousConverted(e2) {
- const { env: t2 } = e2.data;
- t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
- }
- _onLoginTypeChanged(e2) {
- const { loginType: t2, persistence: n2, env: s2 } = e2.data;
- s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
- }
- }
- const ot = function(e2, t2) {
- t2 = t2 || ve();
- const n2 = Qe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
- return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
- 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 };
- n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
- 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
- }).catch((e4) => {
- t2(e4);
- });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, at = function(e2, t2) {
- t2 = t2 || ve();
- const n2 = Qe(this.config.env), { cloudPath: s2 } = e2;
- return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
- t2(null, e3);
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ct = function({ fileList: e2 }, t2) {
- if (t2 = t2 || ve(), !e2 || !Array.isArray(e2))
- return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
- for (let t3 of e2)
- if (!t3 || "string" != typeof t3)
- return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
- const n2 = { fileid_list: e2 };
- return Qe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
- e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ut = function({ fileList: e2 }, t2) {
- t2 = t2 || ve(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
- let n2 = [];
- for (let s3 of e2)
- "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的元素必须是字符串" });
- const s2 = { file_list: n2 };
- return Qe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
- e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ht = async function({ fileID: e2 }, t2) {
- const n2 = (await ut.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
- if ("SUCCESS" !== n2.code)
- return t2 ? t2(n2) : new Promise((e3) => {
- e3(n2);
- });
- const s2 = Qe(this.config.env);
- let r2 = n2.download_url;
- if (r2 = encodeURI(r2), !t2)
- return s2.download({ url: r2 });
- t2(await s2.download({ url: r2 }));
- }, lt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2 }, i2) {
- const o2 = i2 || ve();
- let a2;
- try {
- a2 = t2 ? JSON.stringify(t2) : "";
- } catch (e3) {
- return Promise.reject(e3);
- }
- if (!e2)
- return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
- const c2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: a2 };
- return Qe(this.config.env).send("functions.invokeFunction", c2).then((e3) => {
- if (e3.code)
- o2(null, e3);
- else {
- let t3 = e3.data.response_data;
- if (s2)
- o2(null, { result: t3, requestId: e3.requestId });
- else
- try {
- t3 = JSON.parse(e3.data.response_data), o2(null, { result: t3, requestId: e3.requestId });
- } catch (e4) {
- o2(new te({ message: "response data must be json" }));
- }
- }
- return o2.promise;
- }).catch((e3) => {
- o2(e3);
- }), o2.promise;
- }, dt = { timeout: 15e3, persistence: "session" }, pt = {};
- class ft {
- constructor(e2) {
- this.config = e2 || this.config, this.authObj = void 0;
- }
- init(e2) {
- switch (Ae.adapter || (this.requestClient = new Ae.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...dt, ...e2 }, true) {
- case this.config.timeout > 6e5:
- console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
- break;
- case this.config.timeout < 100:
- console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
- }
- return new ft(this.config);
- }
- auth({ persistence: e2 } = {}) {
- if (this.authObj)
- return this.authObj;
- const t2 = e2 || Ae.adapter.primaryStorage || dt.persistence;
- var n2;
- return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
- const { env: t3 } = e3;
- Oe[t3] = new xe(e3), Ee[t3] = new xe({ ...e3, persistence: "local" });
- }(this.config), n2 = this.config, Ye[n2.env] = new Ve(n2), this.authObj = new it(this.config), this.authObj;
- }
- on(e2, t2) {
- return De.apply(this, [e2, t2]);
- }
- off(e2, t2) {
- return qe.apply(this, [e2, t2]);
- }
- callFunction(e2, t2) {
- return lt.apply(this, [e2, t2]);
- }
- deleteFile(e2, t2) {
- return ct.apply(this, [e2, t2]);
- }
- getTempFileURL(e2, t2) {
- return ut.apply(this, [e2, t2]);
- }
- downloadFile(e2, t2) {
- return ht.apply(this, [e2, t2]);
- }
- uploadFile(e2, t2) {
- return ot.apply(this, [e2, t2]);
- }
- getUploadMetadata(e2, t2) {
- return at.apply(this, [e2, t2]);
- }
- registerExtension(e2) {
- pt[e2.name] = e2;
- }
- async invokeExtension(e2, t2) {
- const n2 = pt[e2];
- if (!n2)
- throw new te({ message: `扩展${e2} 必须先注册` });
- return await n2.invoke(t2, this);
- }
- useAdapters(e2) {
- const { adapter: t2, runtime: n2 } = ke(e2) || {};
- t2 && (Ae.adapter = t2), n2 && (Ae.runtime = n2);
- }
- }
- var gt = new ft();
- function mt(e2, t2, n2) {
- void 0 === n2 && (n2 = {});
- var s2 = /\?/.test(t2), r2 = "";
- for (var i2 in n2)
- "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
- return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
- }
- class yt {
- post(e2) {
- const { url: t2, data: n2, headers: s2 } = e2;
- return new Promise((e3, r2) => {
- ne.request({ url: mt("https:", t2), data: n2, method: "POST", header: s2, success(t3) {
- e3(t3);
- }, fail(e4) {
- r2(e4);
- } });
- });
- }
- upload(e2) {
- return new Promise((t2, n2) => {
- 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) {
- const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
- 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
- }, fail(e3) {
- n2(new Error(e3.errMsg || "uploadFile:fail"));
- } });
- "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
- e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
- });
- });
- }
- }
- const _t = { setItem(e2, t2) {
- ne.setStorageSync(e2, t2);
- }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
- ne.removeStorageSync(e2);
- }, clear() {
- ne.clearStorageSync();
- } };
- var wt = { genAdapter: function() {
- return { root: {}, reqClass: yt, localStorage: _t, primaryStorage: "local" };
- }, isMatch: function() {
- return true;
- }, runtime: "uni_app" };
- gt.useAdapters(wt);
- const vt = gt, It = vt.init;
- vt.init = function(e2) {
- e2.env = e2.spaceId;
- const t2 = It.call(this, e2);
- t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
- const n2 = t2.auth;
- return t2.auth = function(e3) {
- const t3 = n2.call(this, e3);
- return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
- var n3;
- t3[e4] = (n3 = t3[e4], function(e5) {
- e5 = e5 || {};
- const { success: t4, fail: s2, complete: r2 } = ee(e5);
- if (!(t4 || s2 || r2))
- return n3.call(this, e5);
- n3.call(this, e5).then((e6) => {
- t4 && t4(e6), r2 && r2(e6);
- }, (e6) => {
- s2 && s2(e6), r2 && r2(e6);
- });
- }).bind(t3);
- }), t3;
- }, t2.customAuth = t2.auth, t2;
- };
- var St = vt;
- var bt = class extends de {
- getAccessToken() {
- return new Promise((e2, t2) => {
- const n2 = "Anonymous_Access_token";
- this.setAccessToken(n2), e2(n2);
- });
- }
- setupRequest(e2, t2) {
- const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
- "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = le.sign(n2, this.config.clientSecret);
- const r2 = he();
- s2["x-client-info"] = encodeURIComponent(JSON.stringify(r2));
- const { token: i2 } = re();
- return s2["x-client-token"] = i2, { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: JSON.parse(JSON.stringify(s2)) };
- }
- uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
- return new Promise((o2, a2) => {
- const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, success(e3) {
- e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
- i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }
- uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
- if (!t2)
- throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
- let r2;
- return this.getOSSUploadOptionsFromPath({ cloudPath: t2 }).then((t3) => {
- const { url: i2, formData: o2, name: a2 } = t3.result;
- r2 = t3.result.fileUrl;
- const c2 = { url: i2, formData: o2, name: a2, filePath: e2, fileType: n2 };
- return this.uploadFileToOSS(Object.assign({}, c2, { onUploadProgress: s2 }));
- }).then(() => this.reportOSSUpload({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
- t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }));
- }
- deleteFile({ fileList: e2 }) {
- const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
- return this.request(this.setupRequest(t2)).then((e3) => {
- if (e3.success)
- return e3.result;
- throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
- });
- }
- getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
- if (!Array.isArray(e2) || 0 === e2.length)
- throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
- const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
- return this.request(this.setupRequest(n2)).then((e3) => {
- if (e3.success)
- return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
- throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
- });
- }
- };
- var kt = { init(e2) {
- const t2 = new bt(e2), n2 = { signInAnonymously: function() {
- return t2.authorize();
- }, getLoginState: function() {
- return Promise.resolve(false);
- } };
- return t2.auth = function() {
- return n2;
- }, t2.customAuth = t2.auth, t2;
- } }, At = n(function(e2, t2) {
- e2.exports = r.enc.Hex;
- });
- function Pt(e2 = "", t2 = {}) {
- 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) {
- var t3 = 16 * Math.random() | 0;
- return ("x" === e3 ? t3 : 3 & t3 | 8).toString(16);
- }), 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) {
- const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
- `).join(""), s3 = _e(e3.body).toString(At), r3 = `${e3.method.toUpperCase()}
- ${e3.path}
- ${e3.query}
- ${n3}
- ${t3}
- ${s3}
- `, i3 = _e(r3).toString(At), o3 = `HMAC-SHA256
- ${e3.timestamp}
- ${i3}
- `, a3 = we(o3, e3.secretKey).toString(At);
- return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`;
- }({ path: d2, query: p2, method: r2, headers: h2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: l2.sort() });
- return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, h2, { Authorization: f2 }) };
- }
- function Tt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {} }) {
- return new Promise((r2, i2) => {
- ne.request({ url: e2, method: n2, data: t2, header: s2, dataType: "json", complete: (e3 = {}) => {
- const t3 = s2["x-trace-id"] || "";
- if (!e3.statusCode || e3.statusCode >= 400) {
- const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
- return i2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
- }
- r2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
- } });
- });
- }
- function Ct(e2, t2) {
- 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 });
- return Tt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
- const t3 = e3.data || {};
- if (!t3.success)
- throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
- return t3.data || {};
- }).catch((e3) => {
- throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
- });
- }
- function xt(e2 = "") {
- const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
- if (n2 <= 0)
- throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
- const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
- return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
- }
- function Ot(e2 = "") {
- return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
- }
- var Et = class {
- constructor(e2) {
- if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
- if (!Object.prototype.hasOwnProperty.call(e2, t2))
- throw new Error(`${t2} required`);
- }), e2.endpoint) {
- if ("string" != typeof e2.endpoint)
- throw new Error("endpoint must be string");
- if (!/^https:\/\//.test(e2.endpoint))
- throw new Error("endpoint must start with https://");
- e2.endpoint = e2.endpoint.replace(/\/$/, "");
- }
- this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn` });
- }
- callFunction(e2) {
- return function(e3, t2) {
- 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 });
- return Tt({ url: i2, data: s2, method: r2, headers: o2 }).then((e4) => ({ errCode: 0, success: true, requestId: e4.requestId, result: e4.data })).catch((e4) => {
- throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
- });
- }(e2, this.config);
- }
- uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
- return new Promise((i2, o2) => {
- const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
- e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
- r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }
- async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
- if ("string" !== f(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
- if (!(t2 = t2.trim()))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
- if (/:\/\//.test(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
- 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), {});
- return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
- }
- async getTempFileURL({ fileList: e2 }) {
- return new Promise((t2, n2) => {
- (!e2 || e2.length < 0) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList不能为空数组" })), e2.length > 50 && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList数组长度不能超过50" }));
- const s2 = [];
- for (const t3 of e2) {
- "string" !== f(t3) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList的元素必须是非空的字符串" }));
- const e3 = xt.call(this, t3);
- s2.push({ file_id: e3, expire: 600 });
- }
- Ct({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
- const { file_list: n3 = [] } = e3;
- t2({ fileList: n3.map((e4) => ({ fileID: Ot.call(this, e4.file_id), tempFileURL: e4.download_url })) });
- }).catch((e3) => n2(e3));
- });
- }
- };
- var Lt = { init: (e2) => {
- e2.provider = "alipay";
- const t2 = new Et(e2);
- return t2.auth = function() {
- return { signInAnonymously: function() {
- return Promise.resolve();
- }, getLoginState: function() {
- return Promise.resolve(true);
- } };
- }, t2;
- } };
- function Rt({ data: e2 }) {
- let t2;
- t2 = he();
- const n2 = JSON.parse(JSON.stringify(e2 || {}));
- if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
- const { token: e3 } = re();
- e3 && (n2.uniIdToken = e3);
- }
- return n2;
- }
- async function Ut({ name: e2, data: t2 } = {}) {
- await this.__dev__.initLocalNetwork();
- 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}`;
- return new Promise((t3, n3) => {
- ne.request({ method: "POST", url: o2, data: { name: e2, platform: P, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) {
- t3(e3);
- }, fail() {
- t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
- } });
- }).then(({ data: e3 } = {}) => {
- const { code: t3, message: n3 } = e3 || {};
- return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
- }).then(({ code: n3, message: s3 }) => {
- if (0 !== n3) {
- switch (n3) {
- case "MODULE_ENCRYPTED":
- console.error(`此云函数(${e2})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
- break;
- case "FUNCTION_ENCRYPTED":
- console.error(`此云函数(${e2})已加密不可本地调试,自动切换为云端已部署的云函数`);
- break;
- case "ACTION_ENCRYPTED":
- console.error(s3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
- break;
- case "NETWORK_ERROR": {
- const e3 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
- throw console.error(e3), new Error(e3);
- }
- case "SWITCH_TO_CLOUD":
- break;
- default: {
- const e3 = `检测本地调试服务出现错误:${s3},请检查网络环境或重启客户端再试`;
- throw console.error(e3), new Error(e3);
- }
- }
- return this._callCloudFunction({ name: e2, data: t2 });
- }
- return new Promise((e3, n4) => {
- const s4 = Rt.call(this, { data: t2 });
- 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) {
- n4(new te({ code: e4.code || e4.errCode || "SYS_ERR", message: e4.message || e4.errMsg || "request:fail" }));
- } });
- });
- });
- }
- const Nt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
- var Dt = /[\\^$.*+?()[\]{}|]/g, Mt = RegExp(Dt.source);
- function qt(e2, t2, n2) {
- return e2.replace(new RegExp((s2 = t2) && Mt.test(s2) ? s2.replace(Dt, "\\$&") : s2, "g"), n2);
- var s2;
- }
- const Kt = "request", jt = "response", $t = "both";
- const An = { code: 2e4, message: "System error" }, Pn = { code: 20101, message: "Invalid client" };
- function xn(e2) {
- const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
- return new te({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || An.code, message: r2 || o2, cause: a2 });
- }
- let En;
- function Dn({ secretType: e2 } = {}) {
- return e2 === Kt || e2 === jt || e2 === $t;
- }
- function Mn({ name: e2, data: t2 = {} } = {}) {
- return "app" === P;
- }
- function qn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
- const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
- let o2 = r2;
- "app" === r2 && (o2 = i2);
- const a2 = function({ provider: e3, spaceId: t3 } = {}) {
- const n3 = A;
- if (!n3)
- return {};
- e3 = function(e4) {
- return "tencent" === e4 ? "tcb" : e4;
- }(e3);
- const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
- return s3 && s3.config;
- }({ provider: e2, spaceId: t2 });
- if (!a2 || !a2.accessControl || !a2.accessControl.enable)
- return false;
- const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
- if (0 === u2.length)
- return true;
- const h2 = function(e3, t3) {
- let n3, s3, r3;
- for (let i3 = 0; i3 < e3.length; i3++) {
- const o3 = e3[i3];
- o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
- }
- return n3 || s3 || r3;
- }(u2, n2);
- if (!h2)
- return false;
- if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
- return true;
- throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), xn(Pn);
- }
- function Fn({ functionName: e2, result: t2, logPvd: n2 }) {
- if (this.__dev__.debugLog && t2 && t2.requestId) {
- const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
- console.log(`[${n2}-request]${s2}[/${n2}-request]`);
- }
- }
- function Kn(e2) {
- const t2 = e2.callFunction, n2 = function(n3) {
- const s2 = n3.name;
- n3.data = Rt.call(e2, { data: n3.data });
- const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay" }[this.config.provider], i2 = Dn(n3), o2 = Mn(n3), a2 = i2 || o2;
- 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 = [] } = {}) {
- for (let s3 = 0; s3 < n4.length; s3++) {
- const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
- if (!a3)
- continue;
- let c2 = i3;
- for (let e5 = 1; e5 < a3.length; e5++)
- c2 = qt(c2, `{$${e5}}`, a3[e5]);
- for (const e5 in t3)
- c2 = qt(c2, `{${e5}}`, t3[e5]);
- return "replace" === o3 ? c2 : e4 + c2;
- }
- return e4;
- }({ message: `[${n3.name}]: ${e3.message}`, formatter: Nt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
- };
- e2.callFunction = function(t3) {
- const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
- let o2, a2;
- 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))
- ;
- else if (function({ name: e3, data: t4 = {} }) {
- return "uni-id-co" === e3 && "secureNetworkHandshakeByWeixin" === t4.method;
- }(t3))
- a2 = o2.call(e2, t3);
- else if (Dn(t3)) {
- a2 = new En({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
- } else if (qn({ provider: s2, spaceId: r2, functionName: i2 })) {
- a2 = new En({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
- } else
- a2 = o2(t3);
- 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));
- };
- }
- En = class {
- constructor() {
- throw xn({ message: `Platform ${P} is not enabled, please check whether secure network module is enabled in your manifest.json` });
- }
- };
- const jn = Symbol("CLIENT_DB_INTERNAL");
- function $n(e2, t2) {
- return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = jn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
- if ("_uniClient" === n2)
- return null;
- if ("symbol" == typeof n2)
- return e3[n2];
- if (n2 in e3 || "string" != typeof n2) {
- const t3 = e3[n2];
- return "function" == typeof t3 ? t3.bind(e3) : t3;
- }
- return t2.get(e3, n2, s2);
- } });
- }
- function Bn(e2) {
- return { on: (t2, n2) => {
- e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
- }, off: (t2, n2) => {
- e2[t2] = e2[t2] || [];
- const s2 = e2[t2].indexOf(n2);
- -1 !== s2 && e2[t2].splice(s2, 1);
- } };
- }
- const Wn = ["db.Geo", "db.command", "command.aggregate"];
- function Hn(e2, t2) {
- return Wn.indexOf(`${e2}.${t2}`) > -1;
- }
- function zn(e2) {
- switch (f(e2 = se(e2))) {
- case "array":
- return e2.map((e3) => zn(e3));
- case "object":
- return e2._internalType === jn || Object.keys(e2).forEach((t2) => {
- e2[t2] = zn(e2[t2]);
- }), e2;
- case "regexp":
- return { $regexp: { source: e2.source, flags: e2.flags } };
- case "date":
- return { $date: e2.toISOString() };
- default:
- return e2;
- }
- }
- function Jn(e2) {
- return e2 && e2.content && e2.content.$method;
- }
- class Gn {
- constructor(e2, t2, n2) {
- this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
- }
- toJSON() {
- let e2 = this;
- const t2 = [e2.content];
- for (; e2.prevStage; )
- e2 = e2.prevStage, t2.push(e2.content);
- return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: zn(e3.$param) })) };
- }
- toString() {
- return JSON.stringify(this.toJSON());
- }
- getAction() {
- const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
- return e2 && e2.$param && e2.$param[0];
- }
- getCommand() {
- return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
- }
- get isAggregate() {
- let e2 = this;
- for (; e2; ) {
- const t2 = Jn(e2), n2 = Jn(e2.prevStage);
- if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- get isCommand() {
- let e2 = this;
- for (; e2; ) {
- if ("command" === Jn(e2))
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- get isAggregateCommand() {
- let e2 = this;
- for (; e2; ) {
- const t2 = Jn(e2), n2 = Jn(e2.prevStage);
- if ("aggregate" === t2 && "command" === n2)
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- getNextStageFn(e2) {
- const t2 = this;
- return function() {
- return Vn({ $method: e2, $param: zn(Array.from(arguments)) }, t2, t2._database);
- };
- }
- get count() {
- return this.isAggregate ? this.getNextStageFn("count") : function() {
- return this._send("count", Array.from(arguments));
- };
- }
- get remove() {
- return this.isCommand ? this.getNextStageFn("remove") : function() {
- return this._send("remove", Array.from(arguments));
- };
- }
- get() {
- return this._send("get", Array.from(arguments));
- }
- get add() {
- return this.isCommand ? this.getNextStageFn("add") : function() {
- return this._send("add", Array.from(arguments));
- };
- }
- update() {
- return this._send("update", Array.from(arguments));
- }
- end() {
- return this._send("end", Array.from(arguments));
- }
- get set() {
- return this.isCommand ? this.getNextStageFn("set") : function() {
- throw new Error("JQL禁止使用set方法");
- };
- }
- _send(e2, t2) {
- const n2 = this.getAction(), s2 = this.getCommand();
- if (s2.$db.push({ $method: e2, $param: zn(t2) }), S) {
- const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
- 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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
- }
- return this._database._callCloudFunction({ action: n2, command: s2 });
- }
- }
- function Vn(e2, t2, n2) {
- return $n(new Gn(e2, t2, n2), { get(e3, t3) {
- let s2 = "db";
- return e3 && e3.content && (s2 = e3.content.$method), Hn(s2, t3) ? Vn({ $method: t3 }, e3, n2) : function() {
- return Vn({ $method: t3, $param: zn(Array.from(arguments)) }, e3, n2);
- };
- } });
- }
- function Yn({ path: e2, method: t2 }) {
- return class {
- constructor() {
- this.param = Array.from(arguments);
- }
- toJSON() {
- return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
- }
- toString() {
- return JSON.stringify(this.toJSON());
- }
- };
- }
- function Qn(e2, t2 = {}) {
- return $n(new e2(t2), { get: (e3, t3) => Hn("db", t3) ? Vn({ $method: t3 }, null, e3) : function() {
- return Vn({ $method: t3, $param: zn(Array.from(arguments)) }, null, e3);
- } });
- }
- class Xn extends class {
- constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
- 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" });
- }
- getCloudEnv(e2) {
- if ("string" != typeof e2 || !e2.trim())
- throw new Error("getCloudEnv参数错误");
- return { $env: e2.replace("$cloudEnv_", "") };
- }
- _callback(e2, t2) {
- const n2 = this._dbCallBacks;
- n2[e2] && n2[e2].forEach((e3) => {
- e3(...t2);
- });
- }
- _callbackAuth(e2, t2) {
- const n2 = this._authCallBacks;
- n2[e2] && n2[e2].forEach((e3) => {
- e3(...t2);
- });
- }
- multiSend() {
- const e2 = Array.from(arguments), t2 = e2.map((e3) => {
- const t3 = e3.getAction(), n2 = e3.getCommand();
- if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
- throw new Error("multiSend只支持子命令内使用getTemp");
- return { action: t3, command: n2 };
- });
- return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
- }
- } {
- _parseResult(e2) {
- return this._isJQL ? e2.result : e2;
- }
- _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
- function r2(e3, t3) {
- if (n2 && s2)
- for (let n3 = 0; n3 < s2.length; n3++) {
- const r3 = s2[n3];
- r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
- }
- }
- const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
- function a2(e3) {
- 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)));
- }
- const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
- return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: h, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
- const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
- if (u3)
- for (let e4 = 0; e4 < u3.length; e4++) {
- const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console[t4] || console.log;
- let i3 = "[System Info]" + n4;
- s4 && (i3 = `${i3}
- 详细信息:${s4}`), r3(i3);
- }
- if (t3) {
- return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
- }
- 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 }));
- const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
- for (let t4 = 0; t4 < h2.length; t4++) {
- const { prop: n4, tips: s4 } = h2[t4];
- if (n4 in e3.result) {
- const t5 = e3.result[n4];
- Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
- }
- }
- return function(e4) {
- return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
- r2(e4, null);
- const t4 = i2._parseResult(e4);
- return Y(j, { type: W, content: t4 }), Promise.resolve(t4);
- });
- }(e3);
- }, (e3) => {
- /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
- return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
- });
- }
- }
- 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 };
- function ss(e2, t2) {
- let n2 = "";
- return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
- }
- function rs(e2 = [], t2 = "") {
- const n2 = [], s2 = [];
- return e2.forEach((e3) => {
- true === e3.needLogin ? n2.push(ss(t2, e3.path)) : false === e3.needLogin && s2.push(ss(t2, e3.path));
- }), { needLoginPage: n2, notNeedLoginPage: s2 };
- }
- function is(e2) {
- return e2.split("?")[0].replace(/^\//, "");
- }
- function os() {
- return function(e2) {
- let t2 = e2 && e2.$page && e2.$page.fullPath || "";
- return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
- }(function() {
- const e2 = getCurrentPages();
- return e2[e2.length - 1];
- }());
- }
- function as() {
- return is(os());
- }
- function cs(e2 = "", t2 = {}) {
- if (!e2)
- return false;
- if (!(t2 && t2.list && t2.list.length))
- return false;
- const n2 = t2.list, s2 = is(e2);
- return n2.some((e3) => e3.pagePath === s2);
- }
- const us = !!e.uniIdRouter;
- const { loginPage: hs, routerNeedLogin: ls, resToLogin: ds, needLoginPage: ps, notNeedLoginPage: fs, loginPageInTabBar: gs } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
- const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = rs(t2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e2 = []) {
- const t3 = [], n3 = [];
- return e2.forEach((e3) => {
- const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = rs(r3, s3);
- t3.push(...i3), n3.push(...o3);
- }), { needLoginPage: t3, notNeedLoginPage: n3 };
- }(n2);
- return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: cs(i2, r2) };
- }();
- if (ps.indexOf(hs) > -1)
- throw new Error(`Login page [${hs}] should not be "needLogin", please check your pages.json`);
- function ms(e2) {
- const t2 = as();
- if ("/" === e2.charAt(0))
- return e2;
- const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
- i2.pop();
- for (let e3 = 0; e3 < r2.length; e3++) {
- const t3 = r2[e3];
- ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
- }
- return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
- }
- function ys(e2) {
- const t2 = is(ms(e2));
- return !(fs.indexOf(t2) > -1) && (ps.indexOf(t2) > -1 || ls.some((t3) => function(e3, t4) {
- return new RegExp(t4).test(e3);
- }(e2, t3)));
- }
- function _s({ redirect: e2 }) {
- const t2 = is(e2), n2 = is(hs);
- return as() !== n2 && t2 !== n2;
- }
- function ws({ api: e2, redirect: t2 } = {}) {
- if (!t2 || !_s({ redirect: t2 }))
- return;
- const n2 = function(e3, t3) {
- return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
- }(hs, t2);
- gs ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
- const s2 = { navigateTo: index$1.navigateTo, redirectTo: index$1.redirectTo, switchTab: index$1.switchTab, reLaunch: index$1.reLaunch };
- setTimeout(() => {
- s2[e2]({ url: n2 });
- });
- }
- function vs({ url: e2 } = {}) {
- const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
- const { token: e3, tokenExpired: t3 } = re();
- let n3;
- if (e3) {
- if (t3 < Date.now()) {
- const e4 = "uni-id-token-expired";
- n3 = { errCode: e4, errMsg: ns[e4] };
- }
- } else {
- const e4 = "uni-id-check-token-failed";
- n3 = { errCode: e4, errMsg: ns[e4] };
- }
- return n3;
- }();
- if (ys(e2) && n2) {
- n2.uniIdRedirectUrl = e2;
- if (J($).length > 0)
- return setTimeout(() => {
- Y($, n2);
- }, 0), t2.abortLoginPageJump = true, t2;
- t2.autoToLoginPage = true;
- }
- return t2;
- }
- function Is() {
- !function() {
- const e3 = os(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = vs({ url: e3 });
- t2 || n2 && ws({ api: "redirectTo", redirect: e3 });
- }();
- const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
- for (let t2 = 0; t2 < e2.length; t2++) {
- const n2 = e2[t2];
- index$1.addInterceptor(n2, { invoke(e3) {
- const { abortLoginPageJump: t3, autoToLoginPage: s2 } = vs({ url: e3.url });
- return t3 ? e3 : s2 ? (ws({ api: n2, redirect: ms(e3.url) }), false) : e3;
- } });
- }
- }
- function Ss() {
- this.onResponse((e2) => {
- const { type: t2, content: n2 } = e2;
- let s2 = false;
- switch (t2) {
- case "cloudobject":
- s2 = function(e3) {
- if ("object" != typeof e3)
- return false;
- const { errCode: t3 } = e3 || {};
- return t3 in ns;
- }(n2);
- break;
- case "clientdb":
- s2 = function(e3) {
- if ("object" != typeof e3)
- return false;
- const { errCode: t3 } = e3 || {};
- return t3 in ts;
- }(n2);
- }
- s2 && function(e3 = {}) {
- const t3 = J($);
- Z().then(() => {
- const n3 = os();
- if (n3 && _s({ redirect: n3 }))
- return t3.length > 0 ? Y($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (hs && ws({ api: "navigateTo", redirect: n3 }));
- });
- }(n2);
- });
- }
- function bs(e2) {
- !function(e3) {
- e3.onResponse = function(e4) {
- G(j, e4);
- }, e3.offResponse = function(e4) {
- V(j, e4);
- };
- }(e2), function(e3) {
- e3.onNeedLogin = function(e4) {
- G($, e4);
- }, e3.offNeedLogin = function(e4) {
- V($, e4);
- }, us && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = true, Z().then(() => {
- Is.call(e3);
- }), ds && Ss.call(e3)));
- }(e2), function(e3) {
- e3.onRefreshToken = function(e4) {
- G(B, e4);
- }, e3.offRefreshToken = function(e4) {
- V(B, e4);
- };
- }(e2);
- }
- let ks;
- const As = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Ps = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
- function Ts() {
- const e2 = re().token || "", t2 = e2.split(".");
- if (!e2 || 3 !== t2.length)
- return { uid: null, role: [], permission: [], tokenExpired: 0 };
- let n2;
- try {
- n2 = JSON.parse((s2 = t2[1], decodeURIComponent(ks(s2).split("").map(function(e3) {
- return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
- }).join(""))));
- } catch (e3) {
- throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
- }
- var s2;
- return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
- }
- ks = "function" != typeof atob ? function(e2) {
- if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !Ps.test(e2))
- throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
- var t2;
- e2 += "==".slice(2 - (3 & e2.length));
- for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
- 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);
- return r2;
- } : atob;
- var Cs = n(function(e2, t2) {
- Object.defineProperty(t2, "__esModule", { value: true });
- const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
- function r2(e3, t3) {
- return e3.tempFiles.forEach((e4, n3) => {
- 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("."));
- }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
- }
- function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
- return t3.then((e4) => {
- if (s3) {
- const t4 = s3(e4);
- if (void 0 !== t4)
- return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
- }
- return e4;
- }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
- (t5 = Object.assign({}, t5)).errMsg = n2;
- const i3 = t5.tempFiles, o2 = i3.length;
- let a2 = 0;
- return new Promise((n3) => {
- for (; a2 < s4; )
- c2();
- function c2() {
- const s5 = a2++;
- if (s5 >= o2)
- return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
- const u2 = i3[s5];
- e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
- e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
- } }).then((e5) => {
- u2.url = e5.fileID, s5 < o2 && c2();
- }).catch((e5) => {
- u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
- });
- }
- });
- }(e3, t4, 5, r3));
- }
- t2.initChooseAndUploadFile = function(e3) {
- return function(t3 = { type: "all" }) {
- return "image" === t3.type ? i2(e3, function(e4) {
- const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
- return new Promise((e5, a2) => {
- index$1.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
- e5(r2(t5, "image"));
- }, fail(e6) {
- a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
- } });
- });
- }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
- const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
- return new Promise((e5, c2) => {
- index$1.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
- const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
- 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"));
- }, fail(e6) {
- c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
- } });
- });
- }(t3), t3) : i2(e3, function(e4) {
- const { count: t4, extension: n3 } = e4;
- return new Promise((e5, i3) => {
- let o2 = index$1.chooseFile;
- if ("undefined" != typeof wx$1 && "function" == typeof wx$1.chooseMessageFile && (o2 = wx$1.chooseMessageFile), "function" != typeof o2)
- return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
- o2({ type: "all", count: t4, extension: n3, success(t5) {
- e5(r2(t5));
- }, fail(e6) {
- i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
- } });
- });
- }(t3), t3);
- };
- };
- }), xs = t(Cs);
- const Os = "manual";
- function Es(e2) {
- 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() {
- this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
- var e3 = [];
- return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
- e3.push(this[t2]);
- }), e3;
- }, (e3, t2) => {
- if (this.loadtime === Os)
- return;
- let n2 = false;
- const s2 = [];
- for (let r2 = 2; r2 < e3.length; r2++)
- e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
- e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
- });
- }, methods: { onMixinDatacomPropsChange(e3, t2) {
- }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
- this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
- this.mixinDatacomLoading = false;
- const { data: s2, count: r2 } = n3.result;
- this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
- const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
- this.mixinDatacomResData = i2, t2 && t2(i2);
- }).catch((e4) => {
- this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
- }));
- }, mixinDatacomGet(t2 = {}) {
- let n2;
- t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
- const s2 = t2.action || this.action;
- s2 && (n2 = n2.action(s2));
- const r2 = t2.collection || this.collection;
- n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
- const i2 = t2.where || this.where;
- i2 && Object.keys(i2).length && (n2 = n2.where(i2));
- const o2 = t2.field || this.field;
- o2 && (n2 = n2.field(o2));
- const a2 = t2.foreignKey || this.foreignKey;
- a2 && (n2 = n2.foreignKey(a2));
- const c2 = t2.groupby || this.groupby;
- c2 && (n2 = n2.groupBy(c2));
- const u2 = t2.groupField || this.groupField;
- u2 && (n2 = n2.groupField(u2));
- true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
- const h2 = t2.orderby || this.orderby;
- h2 && (n2 = n2.orderBy(h2));
- 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 };
- return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
- } } };
- }
- function Ls(e2) {
- return function(t2, n2 = {}) {
- n2 = function(e3, t3 = {}) {
- 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;
- }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
- const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
- return new Proxy({}, { get(s3, c2) {
- switch (c2) {
- case "toString":
- return "[object UniCloudObject]";
- case "toJSON":
- return {};
- }
- return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
- return async function(...s4) {
- const r3 = n3 ? n3({ params: s4 }) : {};
- let i3, o3;
- try {
- return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
- } catch (e4) {
- throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
- } finally {
- await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
- }
- };
- }({ fn: async function s4(...h2) {
- let l2;
- a2 && index$1.showLoading({ title: r2.title, mask: r2.mask });
- const d2 = { name: t2, type: u, data: { method: c2, params: h2 } };
- "object" == typeof n2.secretMethods && function(e3, t3) {
- const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
- r3 && (t3.secretType = r3);
- }(n2, d2);
- let p2 = false;
- try {
- l2 = await e2.callFunction(d2);
- } catch (e3) {
- p2 = true, l2 = { result: new te(e3) };
- }
- const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = l2.result || {};
- if (a2 && index$1.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(B, { ...y2 })), g2) {
- let e3 = m2;
- if (p2 && o2) {
- e3 = (await o2({ objectName: t2, methodName: c2, params: h2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
- }
- if (a2)
- if ("toast" === i2.type)
- index$1.showToast({ title: e3, icon: "none" });
- else {
- if ("modal" !== i2.type)
- throw new Error(`Invalid errorOptions.type: ${i2.type}`);
- {
- const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
- return new Promise((i3, o3) => {
- index$1.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
- i3(e5);
- }, fail() {
- i3({ confirm: false, cancel: true });
- } });
- });
- }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
- if (i2.retry && t3)
- return s4(...h2);
- }
- }
- const n3 = new te({ subject: f2, code: g2, message: m2, requestId: l2.requestId });
- throw n3.detail = l2.result, Y(j, { type: z, content: n3 }), n3;
- }
- return Y(j, { type: z, content: l2.result }), l2.result;
- }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
- return { objectName: t2, methodName: c2, params: e3 };
- } });
- } });
- };
- }
- function Rs(e2) {
- return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
- }
- async function Us({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
- const n2 = Rs(this);
- if (e2 && t2)
- throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
- if (e2)
- return n2.mpWeixinOpenid = e2, {};
- const s2 = await new Promise((e3, t3) => {
- index$1.login({ success(t4) {
- e3(t4.code);
- }, fail(e4) {
- t3(new Error(e4.errMsg));
- } });
- }), r2 = this.importObject("uni-id-co", { customUI: true });
- return await r2.secureNetworkHandshakeByWeixin({ code: s2, callLoginByWeixin: t2 }), n2.mpWeixinCode = s2, { code: s2 };
- }
- async function Ns(e2) {
- const t2 = Rs(this);
- return t2.initPromise || (t2.initPromise = Us.call(this, e2).then((e3) => e3).catch((e3) => {
- throw delete t2.initPromise, e3;
- })), t2.initPromise;
- }
- function Ds(e2) {
- return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
- return Ns.call(e2, { openid: t2, callLoginByWeixin: n2 });
- };
- }
- function Ms(e2) {
- const t2 = { getSystemInfo: index$1.getSystemInfo, getPushClientId: index$1.getPushClientId };
- return function(n2) {
- return new Promise((s2, r2) => {
- t2[e2]({ ...n2, success(e3) {
- s2(e3);
- }, fail(e3) {
- r2(e3);
- } });
- });
- };
- }
- class qs extends class {
- constructor() {
- this._callback = {};
- }
- addListener(e2, t2) {
- this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
- }
- on(e2, t2) {
- return this.addListener(e2, t2);
- }
- removeListener(e2, t2) {
- if (!t2)
- throw new Error('The "listener" argument must be of type function. Received undefined');
- const n2 = this._callback[e2];
- if (!n2)
- return;
- const s2 = function(e3, t3) {
- for (let n3 = e3.length - 1; n3 >= 0; n3--)
- if (e3[n3] === t3)
- return n3;
- return -1;
- }(n2, t2);
- n2.splice(s2, 1);
- }
- off(e2, t2) {
- return this.removeListener(e2, t2);
- }
- removeAllListener(e2) {
- delete this._callback[e2];
- }
- emit(e2, ...t2) {
- const n2 = this._callback[e2];
- if (n2)
- for (let e3 = 0; e3 < n2.length; e3++)
- n2[e3](...t2);
- }
- } {
- constructor() {
- super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
- }
- init() {
- return Promise.all([Ms("getSystemInfo")(), Ms("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
- if (!e2)
- throw new Error("Invalid appId, please check the manifest.json file");
- if (!t2)
- throw new Error("Invalid push client id");
- this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
- }, (e2) => {
- throw this.emit("error", e2), this.close(), e2;
- });
- }
- async open() {
- return this.init();
- }
- _isUniCloudSSE(e2) {
- if ("receive" !== e2.type)
- return false;
- const t2 = e2 && e2.data && e2.data.payload;
- return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
- }
- _receivePushMessage(e2) {
- if (!this._isUniCloudSSE(e2))
- return;
- const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
- this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
- }
- _consumMessage() {
- for (; ; ) {
- const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
- if (!e2)
- break;
- this._currentMessageId++, this._parseMessagePayload(e2);
- }
- }
- _parseMessagePayload(e2) {
- const { action: t2, messageId: n2, message: s2 } = e2;
- "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
- }
- _appendMessage({ messageId: e2, message: t2 } = {}) {
- this.emit("message", t2);
- }
- _end({ messageId: e2, message: t2 } = {}) {
- this.emit("end", t2), this.close();
- }
- _initMessageListener() {
- index$1.onPushMessage(this._uniPushMessageCallback);
- }
- _destroy() {
- index$1.offPushMessage(this._uniPushMessageCallback);
- }
- toJSON() {
- return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
- }
- close() {
- this._destroy(), this.emit("close");
- }
- }
- async function Fs(e2, t2) {
- const n2 = `http://${e2}:${t2}/system/ping`;
- try {
- const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
- ne.request({ ...s2, success(t4) {
- e4(t4);
- }, fail(e5) {
- t3(e5);
- } });
- }));
- return !(!e3.data || 0 !== e3.data.code);
- } catch (e3) {
- return false;
- }
- var s2;
- }
- async function Ks(e2) {
- const t2 = e2.__dev__;
- if (!t2.debugInfo)
- return;
- const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await async function(e3, t3) {
- let n3;
- for (let s3 = 0; s3 < e3.length; s3++) {
- const r3 = e3[s3];
- if (await Fs(r3, t3)) {
- n3 = r3;
- break;
- }
- }
- return { address: n3, port: t3 };
- }(n2, s2);
- if (r2)
- return t2.localAddress = r2, void (t2.localPort = s2);
- const i2 = console["warn"];
- let o2 = "";
- 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)
- throw new Error(o2);
- i2(o2);
- }
- function js(e2) {
- e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() {
- let t2 = Promise.resolve();
- var n2;
- n2 = 1, t2 = new Promise((e3) => {
- setTimeout(() => {
- e3();
- }, n2);
- });
- const s2 = e2.auth();
- return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
- } }));
- }
- const $s = { tcb: St, tencent: St, aliyun: pe, private: kt, alipay: Lt };
- let Bs = new class {
- init(e2) {
- let t2 = {};
- const n2 = $s[e2.provider];
- if (!n2)
- throw new Error("未提供正确的provider参数");
- t2 = n2.init(e2), function(e3) {
- const t3 = {};
- e3.__dev__ = t3, t3.debugLog = "app" === P;
- const n3 = T;
- n3 && !n3.code && (t3.debugInfo = n3);
- const s2 = new v({ createPromise: function() {
- return Ks(e3);
- } });
- t3.initLocalNetwork = function() {
- return s2.exec();
- };
- }(t2), js(t2), Kn(t2), function(e3) {
- const t3 = e3.uploadFile;
- e3.uploadFile = function(e4) {
- return t3.call(this, e4);
- };
- }(t2), function(e3) {
- e3.database = function(t3) {
- if (t3 && Object.keys(t3).length > 0)
- return e3.init(t3).database();
- if (this._database)
- return this._database;
- const n3 = Qn(Xn, { uniClient: e3 });
- return this._database = n3, n3;
- }, e3.databaseForJQL = function(t3) {
- if (t3 && Object.keys(t3).length > 0)
- return e3.init(t3).databaseForJQL();
- if (this._databaseForJQL)
- return this._databaseForJQL;
- const n3 = Qn(Xn, { uniClient: e3, isJQL: true });
- return this._databaseForJQL = n3, n3;
- };
- }(t2), function(e3) {
- e3.getCurrentUserInfo = Ts, e3.chooseAndUploadFile = xs.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
- return Es(e3);
- } }), e3.SSEChannel = qs, e3.initSecureNetworkByWeixin = Ds(e3), e3.importObject = Ls(e3);
- }(t2);
- return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
- if (!t2[e3])
- return;
- const n3 = t2[e3];
- t2[e3] = function() {
- return n3.apply(t2, Array.from(arguments));
- }, t2[e3] = function(e4, t3) {
- return function(n4) {
- let s2 = false;
- if ("callFunction" === t3) {
- const e5 = n4 && n4.type || c;
- s2 = e5 !== c;
- }
- const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
- n4 = n4 || {};
- 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))));
- if (!(o2 || a2 || u2))
- return h2;
- h2.then((e5) => {
- o2 && o2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
- }, (e5) => {
- a2 && a2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
- });
- };
- }(t2[e3], e3).bind(t2);
- }), t2.init = this.init, t2;
- }
- }();
- (() => {
- const e2 = C;
- let t2 = {};
- if (e2 && 1 === e2.length)
- t2 = e2[0], Bs = Bs.init(t2), Bs._isDefault = true;
- else {
- const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
- let n2;
- n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
- Bs[e3] = function() {
- return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
- };
- });
- }
- Object.assign(Bs, { get mixinDatacom() {
- return Es(Bs);
- } }), bs(Bs), Bs.addInterceptor = N, Bs.removeInterceptor = D, Bs.interceptObject = F;
- })();
- var Ws = Bs;
- exports.QSCanvas = QSCanvas;
- exports.Request = Request;
- exports.Ws = Ws;
- exports._ = _$1;
- exports._export_sfc = _export_sfc;
- exports.computed = computed;
- exports.createPinia = createPinia;
- exports.createSSRApp = createSSRApp;
- exports.dayjs = dayjs;
- exports.defineStore = defineStore;
- exports.duration = duration;
- exports.e = e$1;
- exports.f = f$1;
- exports.getCurrentInstance = getCurrentInstance;
- exports.index = index$1;
- exports.index$1 = index;
- exports.initVueI18n = initVueI18n;
- exports.io = io;
- exports.lodashExports = lodashExports;
- exports.m = m$1;
- exports.n = n$1;
- exports.nextTick$1 = nextTick$1;
- exports.o = o$1;
- exports.onBackPress = onBackPress;
- exports.onBeforeMount = onBeforeMount;
- exports.onError = onError;
- exports.onHide = onHide;
- exports.onLaunch = onLaunch;
- exports.onLoad = onLoad;
- exports.onMounted = onMounted;
- exports.onPageScroll = onPageScroll;
- exports.onPullDownRefresh = onPullDownRefresh;
- exports.onReachBottom = onReachBottom;
- exports.onReady = onReady;
- exports.onShareAppMessage = onShareAppMessage;
- exports.onShow = onShow;
- exports.p = p$1;
- exports.parsePhoneNumber = parsePhoneNumber;
- exports.reactive = reactive;
- exports.ref = ref;
- exports.relativeTime = relativeTime;
- exports.resolveComponent = resolveComponent;
- exports.s = s$1;
- exports.sr = sr;
- exports.t = t$1;
- exports.toRefs = toRefs;
- exports.unref = unref;
- exports.useCssVars = useCssVars;
- exports.watch = watch;
- exports.watchEffect = watchEffect;
- exports.watchPostEffect = watchPostEffect;
- exports.wx$1 = wx$1;
|