vendor.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  11. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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 _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  12. var realAtob;
  13. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  14. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15. if (typeof atob !== 'function') {
  16. realAtob = function realAtob(str) {
  17. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  18. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  19. // Adding the padding if missing, for semplicity
  20. str += '=='.slice(2 - (str.length & 3));
  21. var bitmap;var result = '';var r1;var r2;var i = 0;
  22. for (; i < str.length;) {
  23. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  24. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  25. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  26. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  27. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  28. }
  29. return result;
  30. };
  31. } else {
  32. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  33. realAtob = atob;
  34. }
  35. function b64DecodeUnicode(str) {
  36. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  37. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  38. }).join(''));
  39. }
  40. function getCurrentUserInfo() {
  41. var token = wx.getStorageSync('uni_id_token') || '';
  42. var tokenArr = token.split('.');
  43. if (!token || tokenArr.length !== 3) {
  44. return {
  45. uid: null,
  46. role: [],
  47. permission: [],
  48. tokenExpired: 0 };
  49. }
  50. var userInfo;
  51. try {
  52. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  53. } catch (error) {
  54. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  55. }
  56. userInfo.tokenExpired = userInfo.exp * 1000;
  57. delete userInfo.exp;
  58. delete userInfo.iat;
  59. return userInfo;
  60. }
  61. function uniIdMixin(Vue) {
  62. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  63. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  64. return role.indexOf(roleId) > -1;
  65. };
  66. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  67. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  68. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  69. };
  70. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  71. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  72. return tokenExpired > Date.now();
  73. };
  74. }
  75. var _toString = Object.prototype.toString;
  76. var hasOwnProperty = Object.prototype.hasOwnProperty;
  77. function isFn(fn) {
  78. return typeof fn === 'function';
  79. }
  80. function isStr(str) {
  81. return typeof str === 'string';
  82. }
  83. function isPlainObject(obj) {
  84. return _toString.call(obj) === '[object Object]';
  85. }
  86. function hasOwn(obj, key) {
  87. return hasOwnProperty.call(obj, key);
  88. }
  89. function noop() {}
  90. /**
  91. * Create a cached version of a pure function.
  92. */
  93. function cached(fn) {
  94. var cache = Object.create(null);
  95. return function cachedFn(str) {
  96. var hit = cache[str];
  97. return hit || (cache[str] = fn(str));
  98. };
  99. }
  100. /**
  101. * Camelize a hyphen-delimited string.
  102. */
  103. var camelizeRE = /-(\w)/g;
  104. var camelize = cached(function (str) {
  105. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  106. });
  107. function sortObject(obj) {
  108. var sortObj = {};
  109. if (isPlainObject(obj)) {
  110. Object.keys(obj).sort().forEach(function (key) {
  111. sortObj[key] = obj[key];
  112. });
  113. }
  114. return !Object.keys(sortObj) ? obj : sortObj;
  115. }
  116. var HOOKS = [
  117. 'invoke',
  118. 'success',
  119. 'fail',
  120. 'complete',
  121. 'returnValue'];
  122. var globalInterceptors = {};
  123. var scopedInterceptors = {};
  124. function mergeHook(parentVal, childVal) {
  125. var res = childVal ?
  126. parentVal ?
  127. parentVal.concat(childVal) :
  128. Array.isArray(childVal) ?
  129. childVal : [childVal] :
  130. parentVal;
  131. return res ?
  132. dedupeHooks(res) :
  133. res;
  134. }
  135. function dedupeHooks(hooks) {
  136. var res = [];
  137. for (var i = 0; i < hooks.length; i++) {
  138. if (res.indexOf(hooks[i]) === -1) {
  139. res.push(hooks[i]);
  140. }
  141. }
  142. return res;
  143. }
  144. function removeHook(hooks, hook) {
  145. var index = hooks.indexOf(hook);
  146. if (index !== -1) {
  147. hooks.splice(index, 1);
  148. }
  149. }
  150. function mergeInterceptorHook(interceptor, option) {
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function removeInterceptorHook(interceptor, option) {
  158. if (!interceptor || !option) {
  159. return;
  160. }
  161. Object.keys(option).forEach(function (hook) {
  162. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  163. removeHook(interceptor[hook], option[hook]);
  164. }
  165. });
  166. }
  167. function addInterceptor(method, option) {
  168. if (typeof method === 'string' && isPlainObject(option)) {
  169. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  170. } else if (isPlainObject(method)) {
  171. mergeInterceptorHook(globalInterceptors, method);
  172. }
  173. }
  174. function removeInterceptor(method, option) {
  175. if (typeof method === 'string') {
  176. if (isPlainObject(option)) {
  177. removeInterceptorHook(scopedInterceptors[method], option);
  178. } else {
  179. delete scopedInterceptors[method];
  180. }
  181. } else if (isPlainObject(method)) {
  182. removeInterceptorHook(globalInterceptors, method);
  183. }
  184. }
  185. function wrapperHook(hook) {
  186. return function (data) {
  187. return hook(data) || data;
  188. };
  189. }
  190. function isPromise(obj) {
  191. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  192. }
  193. function queue(hooks, data) {
  194. var promise = false;
  195. for (var i = 0; i < hooks.length; i++) {
  196. var hook = hooks[i];
  197. if (promise) {
  198. promise = Promise.resolve(wrapperHook(hook));
  199. } else {
  200. var res = hook(data);
  201. if (isPromise(res)) {
  202. promise = Promise.resolve(res);
  203. }
  204. if (res === false) {
  205. return {
  206. then: function then() {} };
  207. }
  208. }
  209. }
  210. return promise || {
  211. then: function then(callback) {
  212. return callback(data);
  213. } };
  214. }
  215. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  216. ['success', 'fail', 'complete'].forEach(function (name) {
  217. if (Array.isArray(interceptor[name])) {
  218. var oldCallback = options[name];
  219. options[name] = function callbackInterceptor(res) {
  220. queue(interceptor[name], res).then(function (res) {
  221. /* eslint-disable no-mixed-operators */
  222. return isFn(oldCallback) && oldCallback(res) || res;
  223. });
  224. };
  225. }
  226. });
  227. return options;
  228. }
  229. function wrapperReturnValue(method, returnValue) {
  230. var returnValueHooks = [];
  231. if (Array.isArray(globalInterceptors.returnValue)) {
  232. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  233. }
  234. var interceptor = scopedInterceptors[method];
  235. if (interceptor && Array.isArray(interceptor.returnValue)) {
  236. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  237. }
  238. returnValueHooks.forEach(function (hook) {
  239. returnValue = hook(returnValue) || returnValue;
  240. });
  241. return returnValue;
  242. }
  243. function getApiInterceptorHooks(method) {
  244. var interceptor = Object.create(null);
  245. Object.keys(globalInterceptors).forEach(function (hook) {
  246. if (hook !== 'returnValue') {
  247. interceptor[hook] = globalInterceptors[hook].slice();
  248. }
  249. });
  250. var scopedInterceptor = scopedInterceptors[method];
  251. if (scopedInterceptor) {
  252. Object.keys(scopedInterceptor).forEach(function (hook) {
  253. if (hook !== 'returnValue') {
  254. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  255. }
  256. });
  257. }
  258. return interceptor;
  259. }
  260. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  261. var interceptor = getApiInterceptorHooks(method);
  262. if (interceptor && Object.keys(interceptor).length) {
  263. if (Array.isArray(interceptor.invoke)) {
  264. var res = queue(interceptor.invoke, options);
  265. return res.then(function (options) {
  266. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  267. });
  268. } else {
  269. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  270. }
  271. }
  272. return api.apply(void 0, [options].concat(params));
  273. }
  274. var promiseInterceptor = {
  275. returnValue: function returnValue(res) {
  276. if (!isPromise(res)) {
  277. return res;
  278. }
  279. return new Promise(function (resolve, reject) {
  280. res.then(function (res) {
  281. if (res[0]) {
  282. reject(res[0]);
  283. } else {
  284. resolve(res[1]);
  285. }
  286. });
  287. });
  288. } };
  289. var SYNC_API_RE =
  290. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  291. var CONTEXT_API_RE = /^create|Manager$/;
  292. // Context例外情况
  293. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  294. // 同步例外情况
  295. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  296. var CALLBACK_API_RE = /^on|^off/;
  297. function isContextApi(name) {
  298. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  299. }
  300. function isSyncApi(name) {
  301. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  302. }
  303. function isCallbackApi(name) {
  304. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  305. }
  306. function handlePromise(promise) {
  307. return promise.then(function (data) {
  308. return [null, data];
  309. }).
  310. catch(function (err) {return [err];});
  311. }
  312. function shouldPromise(name) {
  313. if (
  314. isContextApi(name) ||
  315. isSyncApi(name) ||
  316. isCallbackApi(name))
  317. {
  318. return false;
  319. }
  320. return true;
  321. }
  322. /* eslint-disable no-extend-native */
  323. if (!Promise.prototype.finally) {
  324. Promise.prototype.finally = function (callback) {
  325. var promise = this.constructor;
  326. return this.then(
  327. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  328. function (reason) {return promise.resolve(callback()).then(function () {
  329. throw reason;
  330. });});
  331. };
  332. }
  333. function promisify(name, api) {
  334. if (!shouldPromise(name)) {
  335. return api;
  336. }
  337. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  338. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  339. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  340. }
  341. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  342. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  343. success: resolve,
  344. fail: reject })].concat(
  345. params));
  346. })));
  347. };
  348. }
  349. var EPS = 1e-4;
  350. var BASE_DEVICE_WIDTH = 750;
  351. var isIOS = false;
  352. var deviceWidth = 0;
  353. var deviceDPR = 0;
  354. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  355. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  356. deviceWidth = windowWidth;
  357. deviceDPR = pixelRatio;
  358. isIOS = platform === 'ios';
  359. }
  360. function upx2px(number, newDeviceWidth) {
  361. if (deviceWidth === 0) {
  362. checkDeviceWidth();
  363. }
  364. number = Number(number);
  365. if (number === 0) {
  366. return 0;
  367. }
  368. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  369. if (result < 0) {
  370. result = -result;
  371. }
  372. result = Math.floor(result + EPS);
  373. if (result === 0) {
  374. if (deviceDPR === 1 || !isIOS) {
  375. result = 1;
  376. } else {
  377. result = 0.5;
  378. }
  379. }
  380. return number < 0 ? -result : result;
  381. }
  382. var LOCALE_ZH_HANS = 'zh-Hans';
  383. var LOCALE_ZH_HANT = 'zh-Hant';
  384. var LOCALE_EN = 'en';
  385. var LOCALE_FR = 'fr';
  386. var LOCALE_ES = 'es';
  387. var messages = {};
  388. var locale;
  389. {
  390. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  391. }
  392. function initI18nMessages() {
  393. if (!isEnableLocale()) {
  394. return;
  395. }
  396. var localeKeys = Object.keys(__uniConfig.locales);
  397. if (localeKeys.length) {
  398. localeKeys.forEach(function (locale) {
  399. var curMessages = messages[locale];
  400. var userMessages = __uniConfig.locales[locale];
  401. if (curMessages) {
  402. Object.assign(curMessages, userMessages);
  403. } else {
  404. messages[locale] = userMessages;
  405. }
  406. });
  407. }
  408. }
  409. initI18nMessages();
  410. var i18n = (0, _uniI18n.initVueI18n)(
  411. locale,
  412. {});
  413. var t = i18n.t;
  414. var i18nMixin = i18n.mixin = {
  415. beforeCreate: function beforeCreate() {var _this = this;
  416. var unwatch = i18n.i18n.watchLocale(function () {
  417. _this.$forceUpdate();
  418. });
  419. this.$once('hook:beforeDestroy', function () {
  420. unwatch();
  421. });
  422. },
  423. methods: {
  424. $$t: function $$t(key, values) {
  425. return t(key, values);
  426. } } };
  427. var setLocale = i18n.setLocale;
  428. var getLocale = i18n.getLocale;
  429. function initAppLocale(Vue, appVm, locale) {
  430. var state = Vue.observable({
  431. locale: locale || i18n.getLocale() });
  432. var localeWatchers = [];
  433. appVm.$watchLocale = function (fn) {
  434. localeWatchers.push(fn);
  435. };
  436. Object.defineProperty(appVm, '$locale', {
  437. get: function get() {
  438. return state.locale;
  439. },
  440. set: function set(v) {
  441. state.locale = v;
  442. localeWatchers.forEach(function (watch) {return watch(v);});
  443. } });
  444. }
  445. function isEnableLocale() {
  446. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  447. }
  448. function include(str, parts) {
  449. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  450. }
  451. function startsWith(str, parts) {
  452. return parts.find(function (part) {return str.indexOf(part) === 0;});
  453. }
  454. function normalizeLocale(locale, messages) {
  455. if (!locale) {
  456. return;
  457. }
  458. locale = locale.trim().replace(/_/g, '-');
  459. if (messages && messages[locale]) {
  460. return locale;
  461. }
  462. locale = locale.toLowerCase();
  463. if (locale === 'chinese') {
  464. // 支付宝
  465. return LOCALE_ZH_HANS;
  466. }
  467. if (locale.indexOf('zh') === 0) {
  468. if (locale.indexOf('-hans') > -1) {
  469. return LOCALE_ZH_HANS;
  470. }
  471. if (locale.indexOf('-hant') > -1) {
  472. return LOCALE_ZH_HANT;
  473. }
  474. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  475. return LOCALE_ZH_HANT;
  476. }
  477. return LOCALE_ZH_HANS;
  478. }
  479. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  480. if (lang) {
  481. return lang;
  482. }
  483. }
  484. // export function initI18n() {
  485. // const localeKeys = Object.keys(__uniConfig.locales || {})
  486. // if (localeKeys.length) {
  487. // localeKeys.forEach((locale) =>
  488. // i18n.add(locale, __uniConfig.locales[locale])
  489. // )
  490. // }
  491. // }
  492. function getLocale$1() {
  493. // 优先使用 $locale
  494. var app = getApp({
  495. allowDefault: true });
  496. if (app && app.$vm) {
  497. return app.$vm.$locale;
  498. }
  499. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  500. }
  501. function setLocale$1(locale) {
  502. var app = getApp();
  503. if (!app) {
  504. return false;
  505. }
  506. var oldLocale = app.$vm.$locale;
  507. if (oldLocale !== locale) {
  508. app.$vm.$locale = locale;
  509. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  510. locale: locale });});
  511. return true;
  512. }
  513. return false;
  514. }
  515. var onLocaleChangeCallbacks = [];
  516. function onLocaleChange(fn) {
  517. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  518. onLocaleChangeCallbacks.push(fn);
  519. }
  520. }
  521. if (typeof global !== 'undefined') {
  522. global.getLocale = getLocale$1;
  523. }
  524. var interceptors = {
  525. promiseInterceptor: promiseInterceptor };
  526. var baseApi = /*#__PURE__*/Object.freeze({
  527. __proto__: null,
  528. upx2px: upx2px,
  529. getLocale: getLocale$1,
  530. setLocale: setLocale$1,
  531. onLocaleChange: onLocaleChange,
  532. addInterceptor: addInterceptor,
  533. removeInterceptor: removeInterceptor,
  534. interceptors: interceptors });
  535. function findExistsPageIndex(url) {
  536. var pages = getCurrentPages();
  537. var len = pages.length;
  538. while (len--) {
  539. var page = pages[len];
  540. if (page.$page && page.$page.fullPath === url) {
  541. return len;
  542. }
  543. }
  544. return -1;
  545. }
  546. var redirectTo = {
  547. name: function name(fromArgs) {
  548. if (fromArgs.exists === 'back' && fromArgs.delta) {
  549. return 'navigateBack';
  550. }
  551. return 'redirectTo';
  552. },
  553. args: function args(fromArgs) {
  554. if (fromArgs.exists === 'back' && fromArgs.url) {
  555. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  556. if (existsPageIndex !== -1) {
  557. var delta = getCurrentPages().length - 1 - existsPageIndex;
  558. if (delta > 0) {
  559. fromArgs.delta = delta;
  560. }
  561. }
  562. }
  563. } };
  564. var previewImage = {
  565. args: function args(fromArgs) {
  566. var currentIndex = parseInt(fromArgs.current);
  567. if (isNaN(currentIndex)) {
  568. return;
  569. }
  570. var urls = fromArgs.urls;
  571. if (!Array.isArray(urls)) {
  572. return;
  573. }
  574. var len = urls.length;
  575. if (!len) {
  576. return;
  577. }
  578. if (currentIndex < 0) {
  579. currentIndex = 0;
  580. } else if (currentIndex >= len) {
  581. currentIndex = len - 1;
  582. }
  583. if (currentIndex > 0) {
  584. fromArgs.current = urls[currentIndex];
  585. fromArgs.urls = urls.filter(
  586. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  587. } else {
  588. fromArgs.current = urls[0];
  589. }
  590. return {
  591. indicator: false,
  592. loop: false };
  593. } };
  594. var UUID_KEY = '__DC_STAT_UUID';
  595. var deviceId;
  596. function useDeviceId(result) {
  597. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  598. if (!deviceId) {
  599. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  600. wx.setStorage({
  601. key: UUID_KEY,
  602. data: deviceId });
  603. }
  604. result.deviceId = deviceId;
  605. }
  606. function addSafeAreaInsets(result) {
  607. if (result.safeArea) {
  608. var safeArea = result.safeArea;
  609. result.safeAreaInsets = {
  610. top: safeArea.top,
  611. left: safeArea.left,
  612. right: result.windowWidth - safeArea.right,
  613. bottom: result.screenHeight - safeArea.bottom };
  614. }
  615. }
  616. function populateParameters(result) {var _result$brand =
  617. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  618. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  619. // osName osVersion
  620. var osName = '';
  621. var osVersion = '';
  622. {
  623. osName = system.split(' ')[0] || '';
  624. osVersion = system.split(' ')[1] || '';
  625. }
  626. var hostVersion = version;
  627. // deviceType
  628. var deviceType = getGetDeviceType(result, model);
  629. // deviceModel
  630. var deviceBrand = getDeviceBrand(brand);
  631. // hostName
  632. var _hostName = getHostName(result);
  633. // deviceOrientation
  634. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  635. // devicePixelRatio
  636. var _devicePixelRatio = pixelRatio;
  637. // SDKVersion
  638. var _SDKVersion = SDKVersion;
  639. // hostLanguage
  640. var hostLanguage = language.replace(/_/g, '-');
  641. // wx.getAccountInfoSync
  642. var parameters = {
  643. appId: "__UNI__524F1F7",
  644. appName: "broke_news_wx",
  645. appVersion: "1.0.0",
  646. appVersionCode: "100",
  647. appLanguage: getAppLanguage(hostLanguage),
  648. uniCompileVersion: "3.5.3",
  649. uniRuntimeVersion: "3.5.3",
  650. uniPlatform: undefined || "mp-weixin",
  651. deviceBrand: deviceBrand,
  652. deviceModel: model,
  653. deviceType: deviceType,
  654. devicePixelRatio: _devicePixelRatio,
  655. deviceOrientation: _deviceOrientation,
  656. osName: osName.toLocaleLowerCase(),
  657. osVersion: osVersion,
  658. hostTheme: theme,
  659. hostVersion: hostVersion,
  660. hostLanguage: hostLanguage,
  661. hostName: _hostName,
  662. hostSDKVersion: _SDKVersion,
  663. hostFontSizeSetting: fontSizeSetting,
  664. windowTop: 0,
  665. windowBottom: 0,
  666. // TODO
  667. osLanguage: undefined,
  668. osTheme: undefined,
  669. ua: undefined,
  670. hostPackageName: undefined,
  671. browserName: undefined,
  672. browserVersion: undefined };
  673. Object.assign(result, parameters);
  674. }
  675. function getGetDeviceType(result, model) {
  676. var deviceType = result.deviceType || 'phone';
  677. {
  678. var deviceTypeMaps = {
  679. ipad: 'pad',
  680. windows: 'pc',
  681. mac: 'pc' };
  682. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  683. var _model = model.toLocaleLowerCase();
  684. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  685. var _m = deviceTypeMapsKeys[index];
  686. if (_model.indexOf(_m) !== -1) {
  687. deviceType = deviceTypeMaps[_m];
  688. break;
  689. }
  690. }
  691. }
  692. return deviceType;
  693. }
  694. function getDeviceBrand(brand) {
  695. var deviceBrand = brand;
  696. if (deviceBrand) {
  697. deviceBrand = brand.toLocaleLowerCase();
  698. }
  699. return deviceBrand;
  700. }
  701. function getAppLanguage(defaultLanguage) {
  702. return getLocale$1 ?
  703. getLocale$1() :
  704. defaultLanguage;
  705. }
  706. function getHostName(result) {
  707. var _platform = 'WeChat';
  708. var _hostName = result.hostName || _platform; // mp-jd
  709. {
  710. if (result.environment) {
  711. _hostName = result.environment;
  712. } else if (result.host && result.host.env) {
  713. _hostName = result.host.env;
  714. }
  715. }
  716. return _hostName;
  717. }
  718. var getSystemInfo = {
  719. returnValue: function returnValue(result) {
  720. useDeviceId(result);
  721. addSafeAreaInsets(result);
  722. populateParameters(result);
  723. } };
  724. var showActionSheet = {
  725. args: function args(fromArgs) {
  726. if (typeof fromArgs === 'object') {
  727. fromArgs.alertText = fromArgs.title;
  728. }
  729. } };
  730. var getAppBaseInfo = {
  731. returnValue: function returnValue(result) {var _result =
  732. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  733. var _hostName = getHostName(result);
  734. var hostLanguage = language.replace('_', '-');
  735. result = sortObject(Object.assign(result, {
  736. appId: "__UNI__524F1F7",
  737. appName: "broke_news_wx",
  738. appVersion: "1.0.0",
  739. appVersionCode: "100",
  740. appLanguage: getAppLanguage(hostLanguage),
  741. hostVersion: version,
  742. hostLanguage: hostLanguage,
  743. hostName: _hostName,
  744. hostSDKVersion: SDKVersion,
  745. hostTheme: theme }));
  746. } };
  747. var getDeviceInfo = {
  748. returnValue: function returnValue(result) {var _result2 =
  749. result,brand = _result2.brand,model = _result2.model;
  750. var deviceType = getGetDeviceType(result, model);
  751. var deviceBrand = getDeviceBrand(brand);
  752. useDeviceId(result);
  753. result = sortObject(Object.assign(result, {
  754. deviceType: deviceType,
  755. deviceBrand: deviceBrand,
  756. deviceModel: model }));
  757. } };
  758. var getWindowInfo = {
  759. returnValue: function returnValue(result) {
  760. addSafeAreaInsets(result);
  761. result = sortObject(Object.assign(result, {
  762. windowTop: 0,
  763. windowBottom: 0 }));
  764. } };
  765. var getAppAuthorizeSetting = {
  766. returnValue: function returnValue(result) {var
  767. locationReducedAccuracy = result.locationReducedAccuracy;
  768. result.locationAccuracy = 'unsupported';
  769. if (locationReducedAccuracy === true) {
  770. result.locationAccuracy = 'reduced';
  771. } else if (locationReducedAccuracy === false) {
  772. result.locationAccuracy = 'full';
  773. }
  774. } };
  775. // import navigateTo from 'uni-helpers/navigate-to'
  776. var protocols = {
  777. redirectTo: redirectTo,
  778. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  779. previewImage: previewImage,
  780. getSystemInfo: getSystemInfo,
  781. getSystemInfoSync: getSystemInfo,
  782. showActionSheet: showActionSheet,
  783. getAppBaseInfo: getAppBaseInfo,
  784. getDeviceInfo: getDeviceInfo,
  785. getWindowInfo: getWindowInfo,
  786. getAppAuthorizeSetting: getAppAuthorizeSetting };
  787. var todos = [
  788. 'vibrate',
  789. 'preloadPage',
  790. 'unPreloadPage',
  791. 'loadSubPackage'];
  792. var canIUses = [];
  793. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  794. function processCallback(methodName, method, returnValue) {
  795. return function (res) {
  796. return method(processReturnValue(methodName, res, returnValue));
  797. };
  798. }
  799. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  800. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  801. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  802. if (isFn(argsOption)) {
  803. argsOption = argsOption(fromArgs, toArgs) || {};
  804. }
  805. for (var key in fromArgs) {
  806. if (hasOwn(argsOption, key)) {
  807. var keyOption = argsOption[key];
  808. if (isFn(keyOption)) {
  809. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  810. }
  811. if (!keyOption) {// 不支持的参数
  812. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  813. } else if (isStr(keyOption)) {// 重写参数 key
  814. toArgs[keyOption] = fromArgs[key];
  815. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  816. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  817. }
  818. } else if (CALLBACKS.indexOf(key) !== -1) {
  819. if (isFn(fromArgs[key])) {
  820. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  821. }
  822. } else {
  823. if (!keepFromArgs) {
  824. toArgs[key] = fromArgs[key];
  825. }
  826. }
  827. }
  828. return toArgs;
  829. } else if (isFn(fromArgs)) {
  830. fromArgs = processCallback(methodName, fromArgs, returnValue);
  831. }
  832. return fromArgs;
  833. }
  834. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  835. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  836. res = protocols.returnValue(methodName, res);
  837. }
  838. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  839. }
  840. function wrapper(methodName, method) {
  841. if (hasOwn(protocols, methodName)) {
  842. var protocol = protocols[methodName];
  843. if (!protocol) {// 暂不支持的 api
  844. return function () {
  845. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  846. };
  847. }
  848. return function (arg1, arg2) {// 目前 api 最多两个参数
  849. var options = protocol;
  850. if (isFn(protocol)) {
  851. options = protocol(arg1);
  852. }
  853. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  854. var args = [arg1];
  855. if (typeof arg2 !== 'undefined') {
  856. args.push(arg2);
  857. }
  858. if (isFn(options.name)) {
  859. methodName = options.name(arg1);
  860. } else if (isStr(options.name)) {
  861. methodName = options.name;
  862. }
  863. var returnValue = wx[methodName].apply(wx, args);
  864. if (isSyncApi(methodName)) {// 同步 api
  865. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  866. }
  867. return returnValue;
  868. };
  869. }
  870. return method;
  871. }
  872. var todoApis = Object.create(null);
  873. var TODOS = [
  874. 'onTabBarMidButtonTap',
  875. 'subscribePush',
  876. 'unsubscribePush',
  877. 'onPush',
  878. 'offPush',
  879. 'share'];
  880. function createTodoApi(name) {
  881. return function todoApi(_ref)
  882. {var fail = _ref.fail,complete = _ref.complete;
  883. var res = {
  884. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  885. isFn(fail) && fail(res);
  886. isFn(complete) && complete(res);
  887. };
  888. }
  889. TODOS.forEach(function (name) {
  890. todoApis[name] = createTodoApi(name);
  891. });
  892. var providers = {
  893. oauth: ['weixin'],
  894. share: ['weixin'],
  895. payment: ['wxpay'],
  896. push: ['weixin'] };
  897. function getProvider(_ref2)
  898. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  899. var res = false;
  900. if (providers[service]) {
  901. res = {
  902. errMsg: 'getProvider:ok',
  903. service: service,
  904. provider: providers[service] };
  905. isFn(success) && success(res);
  906. } else {
  907. res = {
  908. errMsg: 'getProvider:fail service not found' };
  909. isFn(fail) && fail(res);
  910. }
  911. isFn(complete) && complete(res);
  912. }
  913. var extraApi = /*#__PURE__*/Object.freeze({
  914. __proto__: null,
  915. getProvider: getProvider });
  916. var getEmitter = function () {
  917. var Emitter;
  918. return function getUniEmitter() {
  919. if (!Emitter) {
  920. Emitter = new _vue.default();
  921. }
  922. return Emitter;
  923. };
  924. }();
  925. function apply(ctx, method, args) {
  926. return ctx[method].apply(ctx, args);
  927. }
  928. function $on() {
  929. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  930. }
  931. function $off() {
  932. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  933. }
  934. function $once() {
  935. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  936. }
  937. function $emit() {
  938. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  939. }
  940. var eventApi = /*#__PURE__*/Object.freeze({
  941. __proto__: null,
  942. $on: $on,
  943. $off: $off,
  944. $once: $once,
  945. $emit: $emit });
  946. /**
  947. * 框架内 try-catch
  948. */
  949. /**
  950. * 开发者 try-catch
  951. */
  952. function tryCatch(fn) {
  953. return function () {
  954. try {
  955. return fn.apply(fn, arguments);
  956. } catch (e) {
  957. // TODO
  958. console.error(e);
  959. }
  960. };
  961. }
  962. function getApiCallbacks(params) {
  963. var apiCallbacks = {};
  964. for (var name in params) {
  965. var param = params[name];
  966. if (isFn(param)) {
  967. apiCallbacks[name] = tryCatch(param);
  968. delete params[name];
  969. }
  970. }
  971. return apiCallbacks;
  972. }
  973. var cid;
  974. var cidErrMsg;
  975. var enabled;
  976. function normalizePushMessage(message) {
  977. try {
  978. return JSON.parse(message);
  979. } catch (e) {}
  980. return message;
  981. }
  982. function invokePushCallback(
  983. args)
  984. {
  985. if (args.type === 'enabled') {
  986. enabled = true;
  987. } else if (args.type === 'clientId') {
  988. cid = args.cid;
  989. cidErrMsg = args.errMsg;
  990. invokeGetPushCidCallbacks(cid, args.errMsg);
  991. } else if (args.type === 'pushMsg') {
  992. var message = {
  993. type: 'receive',
  994. data: normalizePushMessage(args.message) };
  995. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  996. var callback = onPushMessageCallbacks[i];
  997. callback(message);
  998. // 该消息已被阻止
  999. if (message.stopped) {
  1000. break;
  1001. }
  1002. }
  1003. } else if (args.type === 'click') {
  1004. onPushMessageCallbacks.forEach(function (callback) {
  1005. callback({
  1006. type: 'click',
  1007. data: normalizePushMessage(args.message) });
  1008. });
  1009. }
  1010. }
  1011. var getPushCidCallbacks = [];
  1012. function invokeGetPushCidCallbacks(cid, errMsg) {
  1013. getPushCidCallbacks.forEach(function (callback) {
  1014. callback(cid, errMsg);
  1015. });
  1016. getPushCidCallbacks.length = 0;
  1017. }
  1018. function getPushClientId(args) {
  1019. if (!isPlainObject(args)) {
  1020. args = {};
  1021. }var _getApiCallbacks =
  1022. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1023. var hasSuccess = isFn(success);
  1024. var hasFail = isFn(fail);
  1025. var hasComplete = isFn(complete);
  1026. Promise.resolve().then(function () {
  1027. if (typeof enabled === 'undefined') {
  1028. enabled = false;
  1029. cid = '';
  1030. cidErrMsg = 'unipush is not enabled';
  1031. }
  1032. getPushCidCallbacks.push(function (cid, errMsg) {
  1033. var res;
  1034. if (cid) {
  1035. res = {
  1036. errMsg: 'getPushClientId:ok',
  1037. cid: cid };
  1038. hasSuccess && success(res);
  1039. } else {
  1040. res = {
  1041. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') };
  1042. hasFail && fail(res);
  1043. }
  1044. hasComplete && complete(res);
  1045. });
  1046. if (typeof cid !== 'undefined') {
  1047. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1048. }
  1049. });
  1050. }
  1051. var onPushMessageCallbacks = [];
  1052. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1053. var onPushMessage = function onPushMessage(fn) {
  1054. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1055. onPushMessageCallbacks.push(fn);
  1056. }
  1057. };
  1058. var offPushMessage = function offPushMessage(fn) {
  1059. if (!fn) {
  1060. onPushMessageCallbacks.length = 0;
  1061. } else {
  1062. var index = onPushMessageCallbacks.indexOf(fn);
  1063. if (index > -1) {
  1064. onPushMessageCallbacks.splice(index, 1);
  1065. }
  1066. }
  1067. };
  1068. var api = /*#__PURE__*/Object.freeze({
  1069. __proto__: null,
  1070. getPushClientId: getPushClientId,
  1071. onPushMessage: onPushMessage,
  1072. offPushMessage: offPushMessage,
  1073. invokePushCallback: invokePushCallback });
  1074. var MPPage = Page;
  1075. var MPComponent = Component;
  1076. var customizeRE = /:/g;
  1077. var customize = cached(function (str) {
  1078. return camelize(str.replace(customizeRE, '-'));
  1079. });
  1080. function initTriggerEvent(mpInstance) {
  1081. var oldTriggerEvent = mpInstance.triggerEvent;
  1082. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1083. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1084. };
  1085. try {
  1086. // 京东小程序 triggerEvent 为只读
  1087. mpInstance.triggerEvent = newTriggerEvent;
  1088. } catch (error) {
  1089. mpInstance._triggerEvent = newTriggerEvent;
  1090. }
  1091. }
  1092. function initHook(name, options, isComponent) {
  1093. var oldHook = options[name];
  1094. if (!oldHook) {
  1095. options[name] = function () {
  1096. initTriggerEvent(this);
  1097. };
  1098. } else {
  1099. options[name] = function () {
  1100. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1101. return oldHook.apply(this, args);
  1102. };
  1103. }
  1104. }
  1105. if (!MPPage.__$wrappered) {
  1106. MPPage.__$wrappered = true;
  1107. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1108. initHook('onLoad', options);
  1109. return MPPage(options);
  1110. };
  1111. Page.after = MPPage.after;
  1112. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1113. initHook('created', options);
  1114. return MPComponent(options);
  1115. };
  1116. }
  1117. var PAGE_EVENT_HOOKS = [
  1118. 'onPullDownRefresh',
  1119. 'onReachBottom',
  1120. 'onAddToFavorites',
  1121. 'onShareTimeline',
  1122. 'onShareAppMessage',
  1123. 'onPageScroll',
  1124. 'onResize',
  1125. 'onTabItemTap'];
  1126. function initMocks(vm, mocks) {
  1127. var mpInstance = vm.$mp[vm.mpType];
  1128. mocks.forEach(function (mock) {
  1129. if (hasOwn(mpInstance, mock)) {
  1130. vm[mock] = mpInstance[mock];
  1131. }
  1132. });
  1133. }
  1134. function hasHook(hook, vueOptions) {
  1135. if (!vueOptions) {
  1136. return true;
  1137. }
  1138. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1139. return true;
  1140. }
  1141. vueOptions = vueOptions.default || vueOptions;
  1142. if (isFn(vueOptions)) {
  1143. if (isFn(vueOptions.extendOptions[hook])) {
  1144. return true;
  1145. }
  1146. if (vueOptions.super &&
  1147. vueOptions.super.options &&
  1148. Array.isArray(vueOptions.super.options[hook])) {
  1149. return true;
  1150. }
  1151. return false;
  1152. }
  1153. if (isFn(vueOptions[hook])) {
  1154. return true;
  1155. }
  1156. var mixins = vueOptions.mixins;
  1157. if (Array.isArray(mixins)) {
  1158. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1159. }
  1160. }
  1161. function initHooks(mpOptions, hooks, vueOptions) {
  1162. hooks.forEach(function (hook) {
  1163. if (hasHook(hook, vueOptions)) {
  1164. mpOptions[hook] = function (args) {
  1165. return this.$vm && this.$vm.__call_hook(hook, args);
  1166. };
  1167. }
  1168. });
  1169. }
  1170. function initVueComponent(Vue, vueOptions) {
  1171. vueOptions = vueOptions.default || vueOptions;
  1172. var VueComponent;
  1173. if (isFn(vueOptions)) {
  1174. VueComponent = vueOptions;
  1175. } else {
  1176. VueComponent = Vue.extend(vueOptions);
  1177. }
  1178. vueOptions = VueComponent.options;
  1179. return [VueComponent, vueOptions];
  1180. }
  1181. function initSlots(vm, vueSlots) {
  1182. if (Array.isArray(vueSlots) && vueSlots.length) {
  1183. var $slots = Object.create(null);
  1184. vueSlots.forEach(function (slotName) {
  1185. $slots[slotName] = true;
  1186. });
  1187. vm.$scopedSlots = vm.$slots = $slots;
  1188. }
  1189. }
  1190. function initVueIds(vueIds, mpInstance) {
  1191. vueIds = (vueIds || '').split(',');
  1192. var len = vueIds.length;
  1193. if (len === 1) {
  1194. mpInstance._$vueId = vueIds[0];
  1195. } else if (len === 2) {
  1196. mpInstance._$vueId = vueIds[0];
  1197. mpInstance._$vuePid = vueIds[1];
  1198. }
  1199. }
  1200. function initData(vueOptions, context) {
  1201. var data = vueOptions.data || {};
  1202. var methods = vueOptions.methods || {};
  1203. if (typeof data === 'function') {
  1204. try {
  1205. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1206. } catch (e) {
  1207. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1208. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1209. }
  1210. }
  1211. } else {
  1212. try {
  1213. // 对 data 格式化
  1214. data = JSON.parse(JSON.stringify(data));
  1215. } catch (e) {}
  1216. }
  1217. if (!isPlainObject(data)) {
  1218. data = {};
  1219. }
  1220. Object.keys(methods).forEach(function (methodName) {
  1221. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1222. data[methodName] = methods[methodName];
  1223. }
  1224. });
  1225. return data;
  1226. }
  1227. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1228. function createObserver(name) {
  1229. return function observer(newVal, oldVal) {
  1230. if (this.$vm) {
  1231. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1232. }
  1233. };
  1234. }
  1235. function initBehaviors(vueOptions, initBehavior) {
  1236. var vueBehaviors = vueOptions.behaviors;
  1237. var vueExtends = vueOptions.extends;
  1238. var vueMixins = vueOptions.mixins;
  1239. var vueProps = vueOptions.props;
  1240. if (!vueProps) {
  1241. vueOptions.props = vueProps = [];
  1242. }
  1243. var behaviors = [];
  1244. if (Array.isArray(vueBehaviors)) {
  1245. vueBehaviors.forEach(function (behavior) {
  1246. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1247. if (behavior === 'uni://form-field') {
  1248. if (Array.isArray(vueProps)) {
  1249. vueProps.push('name');
  1250. vueProps.push('value');
  1251. } else {
  1252. vueProps.name = {
  1253. type: String,
  1254. default: '' };
  1255. vueProps.value = {
  1256. type: [String, Number, Boolean, Array, Object, Date],
  1257. default: '' };
  1258. }
  1259. }
  1260. });
  1261. }
  1262. if (isPlainObject(vueExtends) && vueExtends.props) {
  1263. behaviors.push(
  1264. initBehavior({
  1265. properties: initProperties(vueExtends.props, true) }));
  1266. }
  1267. if (Array.isArray(vueMixins)) {
  1268. vueMixins.forEach(function (vueMixin) {
  1269. if (isPlainObject(vueMixin) && vueMixin.props) {
  1270. behaviors.push(
  1271. initBehavior({
  1272. properties: initProperties(vueMixin.props, true) }));
  1273. }
  1274. });
  1275. }
  1276. return behaviors;
  1277. }
  1278. function parsePropType(key, type, defaultValue, file) {
  1279. // [String]=>String
  1280. if (Array.isArray(type) && type.length === 1) {
  1281. return type[0];
  1282. }
  1283. return type;
  1284. }
  1285. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var options = arguments.length > 3 ? arguments[3] : undefined;
  1286. var properties = {};
  1287. if (!isBehavior) {
  1288. properties.vueId = {
  1289. type: String,
  1290. value: '' };
  1291. {
  1292. if (options.virtualHost) {
  1293. properties.virtualHostStyle = {
  1294. type: null,
  1295. value: '' };
  1296. properties.virtualHostClass = {
  1297. type: null,
  1298. value: '' };
  1299. }
  1300. }
  1301. // scopedSlotsCompiler auto
  1302. properties.scopedSlotsCompiler = {
  1303. type: String,
  1304. value: '' };
  1305. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1306. type: null,
  1307. value: [],
  1308. observer: function observer(newVal, oldVal) {
  1309. var $slots = Object.create(null);
  1310. newVal.forEach(function (slotName) {
  1311. $slots[slotName] = true;
  1312. });
  1313. this.setData({
  1314. $slots: $slots });
  1315. } };
  1316. }
  1317. if (Array.isArray(props)) {// ['title']
  1318. props.forEach(function (key) {
  1319. properties[key] = {
  1320. type: null,
  1321. observer: createObserver(key) };
  1322. });
  1323. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1324. Object.keys(props).forEach(function (key) {
  1325. var opts = props[key];
  1326. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1327. var value = opts.default;
  1328. if (isFn(value)) {
  1329. value = value();
  1330. }
  1331. opts.type = parsePropType(key, opts.type);
  1332. properties[key] = {
  1333. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1334. value: value,
  1335. observer: createObserver(key) };
  1336. } else {// content:String
  1337. var type = parsePropType(key, opts);
  1338. properties[key] = {
  1339. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1340. observer: createObserver(key) };
  1341. }
  1342. });
  1343. }
  1344. return properties;
  1345. }
  1346. function wrapper$1(event) {
  1347. // TODO 又得兼容 mpvue 的 mp 对象
  1348. try {
  1349. event.mp = JSON.parse(JSON.stringify(event));
  1350. } catch (e) {}
  1351. event.stopPropagation = noop;
  1352. event.preventDefault = noop;
  1353. event.target = event.target || {};
  1354. if (!hasOwn(event, 'detail')) {
  1355. event.detail = {};
  1356. }
  1357. if (hasOwn(event, 'markerId')) {
  1358. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1359. event.detail.markerId = event.markerId;
  1360. }
  1361. if (isPlainObject(event.detail)) {
  1362. event.target = Object.assign({}, event.target, event.detail);
  1363. }
  1364. return event;
  1365. }
  1366. function getExtraValue(vm, dataPathsArray) {
  1367. var context = vm;
  1368. dataPathsArray.forEach(function (dataPathArray) {
  1369. var dataPath = dataPathArray[0];
  1370. var value = dataPathArray[2];
  1371. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1372. var propPath = dataPathArray[1];
  1373. var valuePath = dataPathArray[3];
  1374. var vFor;
  1375. if (Number.isInteger(dataPath)) {
  1376. vFor = dataPath;
  1377. } else if (!dataPath) {
  1378. vFor = context;
  1379. } else if (typeof dataPath === 'string' && dataPath) {
  1380. if (dataPath.indexOf('#s#') === 0) {
  1381. vFor = dataPath.substr(3);
  1382. } else {
  1383. vFor = vm.__get_value(dataPath, context);
  1384. }
  1385. }
  1386. if (Number.isInteger(vFor)) {
  1387. context = value;
  1388. } else if (!propPath) {
  1389. context = vFor[value];
  1390. } else {
  1391. if (Array.isArray(vFor)) {
  1392. context = vFor.find(function (vForItem) {
  1393. return vm.__get_value(propPath, vForItem) === value;
  1394. });
  1395. } else if (isPlainObject(vFor)) {
  1396. context = Object.keys(vFor).find(function (vForKey) {
  1397. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1398. });
  1399. } else {
  1400. console.error('v-for 暂不支持循环数据:', vFor);
  1401. }
  1402. }
  1403. if (valuePath) {
  1404. context = vm.__get_value(valuePath, context);
  1405. }
  1406. }
  1407. });
  1408. return context;
  1409. }
  1410. function processEventExtra(vm, extra, event) {
  1411. var extraObj = {};
  1412. if (Array.isArray(extra) && extra.length) {
  1413. /**
  1414. *[
  1415. * ['data.items', 'data.id', item.data.id],
  1416. * ['metas', 'id', meta.id]
  1417. *],
  1418. *[
  1419. * ['data.items', 'data.id', item.data.id],
  1420. * ['metas', 'id', meta.id]
  1421. *],
  1422. *'test'
  1423. */
  1424. extra.forEach(function (dataPath, index) {
  1425. if (typeof dataPath === 'string') {
  1426. if (!dataPath) {// model,prop.sync
  1427. extraObj['$' + index] = vm;
  1428. } else {
  1429. if (dataPath === '$event') {// $event
  1430. extraObj['$' + index] = event;
  1431. } else if (dataPath === 'arguments') {
  1432. if (event.detail && event.detail.__args__) {
  1433. extraObj['$' + index] = event.detail.__args__;
  1434. } else {
  1435. extraObj['$' + index] = [event];
  1436. }
  1437. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1438. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1439. } else {
  1440. extraObj['$' + index] = vm.__get_value(dataPath);
  1441. }
  1442. }
  1443. } else {
  1444. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1445. }
  1446. });
  1447. }
  1448. return extraObj;
  1449. }
  1450. function getObjByArray(arr) {
  1451. var obj = {};
  1452. for (var i = 1; i < arr.length; i++) {
  1453. var element = arr[i];
  1454. obj[element[0]] = element[1];
  1455. }
  1456. return obj;
  1457. }
  1458. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1459. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1460. if (isCustom) {// 自定义事件
  1461. isCustomMPEvent = event.currentTarget &&
  1462. event.currentTarget.dataset &&
  1463. event.currentTarget.dataset.comType === 'wx';
  1464. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1465. if (isCustomMPEvent) {
  1466. return [event];
  1467. }
  1468. return event.detail.__args__ || event.detail;
  1469. }
  1470. }
  1471. var extraObj = processEventExtra(vm, extra, event);
  1472. var ret = [];
  1473. args.forEach(function (arg) {
  1474. if (arg === '$event') {
  1475. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1476. ret.push(event.target.value);
  1477. } else {
  1478. if (isCustom && !isCustomMPEvent) {
  1479. ret.push(event.detail.__args__[0]);
  1480. } else {// wxcomponent 组件或内置组件
  1481. ret.push(event);
  1482. }
  1483. }
  1484. } else {
  1485. if (Array.isArray(arg) && arg[0] === 'o') {
  1486. ret.push(getObjByArray(arg));
  1487. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1488. ret.push(extraObj[arg]);
  1489. } else {
  1490. ret.push(arg);
  1491. }
  1492. }
  1493. });
  1494. return ret;
  1495. }
  1496. var ONCE = '~';
  1497. var CUSTOM = '^';
  1498. function isMatchEventType(eventType, optType) {
  1499. return eventType === optType ||
  1500. optType === 'regionchange' && (
  1501. eventType === 'begin' ||
  1502. eventType === 'end');
  1503. }
  1504. function getContextVm(vm) {
  1505. var $parent = vm.$parent;
  1506. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1507. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1508. $parent = $parent.$parent;
  1509. }
  1510. return $parent && $parent.$parent;
  1511. }
  1512. function handleEvent(event) {var _this2 = this;
  1513. event = wrapper$1(event);
  1514. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1515. var dataset = (event.currentTarget || event.target).dataset;
  1516. if (!dataset) {
  1517. return console.warn('事件信息不存在');
  1518. }
  1519. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1520. if (!eventOpts) {
  1521. return console.warn('事件信息不存在');
  1522. }
  1523. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1524. var eventType = event.type;
  1525. var ret = [];
  1526. eventOpts.forEach(function (eventOpt) {
  1527. var type = eventOpt[0];
  1528. var eventsArray = eventOpt[1];
  1529. var isCustom = type.charAt(0) === CUSTOM;
  1530. type = isCustom ? type.slice(1) : type;
  1531. var isOnce = type.charAt(0) === ONCE;
  1532. type = isOnce ? type.slice(1) : type;
  1533. if (eventsArray && isMatchEventType(eventType, type)) {
  1534. eventsArray.forEach(function (eventArray) {
  1535. var methodName = eventArray[0];
  1536. if (methodName) {
  1537. var handlerCtx = _this2.$vm;
  1538. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1539. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1540. }
  1541. if (methodName === '$emit') {
  1542. handlerCtx.$emit.apply(handlerCtx,
  1543. processEventArgs(
  1544. _this2.$vm,
  1545. event,
  1546. eventArray[1],
  1547. eventArray[2],
  1548. isCustom,
  1549. methodName));
  1550. return;
  1551. }
  1552. var handler = handlerCtx[methodName];
  1553. if (!isFn(handler)) {
  1554. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1555. var path = _this2.route || _this2.is;
  1556. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1557. }
  1558. if (isOnce) {
  1559. if (handler.once) {
  1560. return;
  1561. }
  1562. handler.once = true;
  1563. }
  1564. var params = processEventArgs(
  1565. _this2.$vm,
  1566. event,
  1567. eventArray[1],
  1568. eventArray[2],
  1569. isCustom,
  1570. methodName);
  1571. params = Array.isArray(params) ? params : [];
  1572. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1573. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1574. // eslint-disable-next-line no-sparse-arrays
  1575. params = params.concat([,,,,,,,,,, event]);
  1576. }
  1577. ret.push(handler.apply(handlerCtx, params));
  1578. }
  1579. });
  1580. }
  1581. });
  1582. if (
  1583. eventType === 'input' &&
  1584. ret.length === 1 &&
  1585. typeof ret[0] !== 'undefined')
  1586. {
  1587. return ret[0];
  1588. }
  1589. }
  1590. var eventChannels = {};
  1591. var eventChannelStack = [];
  1592. function getEventChannel(id) {
  1593. if (id) {
  1594. var eventChannel = eventChannels[id];
  1595. delete eventChannels[id];
  1596. return eventChannel;
  1597. }
  1598. return eventChannelStack.shift();
  1599. }
  1600. var hooks = [
  1601. 'onShow',
  1602. 'onHide',
  1603. 'onError',
  1604. 'onPageNotFound',
  1605. 'onThemeChange',
  1606. 'onUnhandledRejection'];
  1607. function initEventChannel() {
  1608. _vue.default.prototype.getOpenerEventChannel = function () {
  1609. // 微信小程序使用自身getOpenerEventChannel
  1610. {
  1611. return this.$scope.getOpenerEventChannel();
  1612. }
  1613. };
  1614. var callHook = _vue.default.prototype.__call_hook;
  1615. _vue.default.prototype.__call_hook = function (hook, args) {
  1616. if (hook === 'onLoad' && args && args.__id__) {
  1617. this.__eventChannel__ = getEventChannel(args.__id__);
  1618. delete args.__id__;
  1619. }
  1620. return callHook.call(this, hook, args);
  1621. };
  1622. }
  1623. function initScopedSlotsParams() {
  1624. var center = {};
  1625. var parents = {};
  1626. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1627. var has = center[vueId];
  1628. if (!has) {
  1629. parents[vueId] = this;
  1630. this.$on('hook:destroyed', function () {
  1631. delete parents[vueId];
  1632. });
  1633. }
  1634. return has;
  1635. };
  1636. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1637. var data = center[vueId];
  1638. if (data) {
  1639. var object = data[name] || {};
  1640. return key ? object[key] : object;
  1641. } else {
  1642. parents[vueId] = this;
  1643. this.$on('hook:destroyed', function () {
  1644. delete parents[vueId];
  1645. });
  1646. }
  1647. };
  1648. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1649. var vueIds = this.$options.propsData.vueId;
  1650. if (vueIds) {
  1651. var vueId = vueIds.split(',')[0];
  1652. var object = center[vueId] = center[vueId] || {};
  1653. object[name] = value;
  1654. if (parents[vueId]) {
  1655. parents[vueId].$forceUpdate();
  1656. }
  1657. }
  1658. };
  1659. _vue.default.mixin({
  1660. destroyed: function destroyed() {
  1661. var propsData = this.$options.propsData;
  1662. var vueId = propsData && propsData.vueId;
  1663. if (vueId) {
  1664. delete center[vueId];
  1665. delete parents[vueId];
  1666. }
  1667. } });
  1668. }
  1669. function parseBaseApp(vm, _ref3)
  1670. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1671. initEventChannel();
  1672. {
  1673. initScopedSlotsParams();
  1674. }
  1675. if (vm.$options.store) {
  1676. _vue.default.prototype.$store = vm.$options.store;
  1677. }
  1678. uniIdMixin(_vue.default);
  1679. _vue.default.prototype.mpHost = "mp-weixin";
  1680. _vue.default.mixin({
  1681. beforeCreate: function beforeCreate() {
  1682. if (!this.$options.mpType) {
  1683. return;
  1684. }
  1685. this.mpType = this.$options.mpType;
  1686. this.$mp = _defineProperty({
  1687. data: {} },
  1688. this.mpType, this.$options.mpInstance);
  1689. this.$scope = this.$options.mpInstance;
  1690. delete this.$options.mpType;
  1691. delete this.$options.mpInstance;
  1692. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1693. var app = getApp();
  1694. if (app.$vm && app.$vm.$i18n) {
  1695. this._i18n = app.$vm.$i18n;
  1696. }
  1697. }
  1698. if (this.mpType !== 'app') {
  1699. initRefs(this);
  1700. initMocks(this, mocks);
  1701. }
  1702. } });
  1703. var appOptions = {
  1704. onLaunch: function onLaunch(args) {
  1705. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1706. return;
  1707. }
  1708. {
  1709. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1710. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1711. }
  1712. }
  1713. this.$vm = vm;
  1714. this.$vm.$mp = {
  1715. app: this };
  1716. this.$vm.$scope = this;
  1717. // vm 上也挂载 globalData
  1718. this.$vm.globalData = this.globalData;
  1719. this.$vm._isMounted = true;
  1720. this.$vm.__call_hook('mounted', args);
  1721. this.$vm.__call_hook('onLaunch', args);
  1722. } };
  1723. // 兼容旧版本 globalData
  1724. appOptions.globalData = vm.$options.globalData || {};
  1725. // 将 methods 中的方法挂在 getApp() 中
  1726. var methods = vm.$options.methods;
  1727. if (methods) {
  1728. Object.keys(methods).forEach(function (name) {
  1729. appOptions[name] = methods[name];
  1730. });
  1731. }
  1732. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1733. initHooks(appOptions, hooks);
  1734. return appOptions;
  1735. }
  1736. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1737. function findVmByVueId(vm, vuePid) {
  1738. var $children = vm.$children;
  1739. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1740. for (var i = $children.length - 1; i >= 0; i--) {
  1741. var childVm = $children[i];
  1742. if (childVm.$scope._$vueId === vuePid) {
  1743. return childVm;
  1744. }
  1745. }
  1746. // 反向递归查找
  1747. var parentVm;
  1748. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1749. parentVm = findVmByVueId($children[_i], vuePid);
  1750. if (parentVm) {
  1751. return parentVm;
  1752. }
  1753. }
  1754. }
  1755. function initBehavior(options) {
  1756. return Behavior(options);
  1757. }
  1758. function isPage() {
  1759. return !!this.route;
  1760. }
  1761. function initRelation(detail) {
  1762. this.triggerEvent('__l', detail);
  1763. }
  1764. function selectAllComponents(mpInstance, selector, $refs) {
  1765. var components = mpInstance.selectAllComponents(selector);
  1766. components.forEach(function (component) {
  1767. var ref = component.dataset.ref;
  1768. $refs[ref] = component.$vm || component;
  1769. {
  1770. if (component.dataset.vueGeneric === 'scoped') {
  1771. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1772. selectAllComponents(scopedComponent, selector, $refs);
  1773. });
  1774. }
  1775. }
  1776. });
  1777. }
  1778. function initRefs(vm) {
  1779. var mpInstance = vm.$scope;
  1780. Object.defineProperty(vm, '$refs', {
  1781. get: function get() {
  1782. var $refs = {};
  1783. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1784. // TODO 暂不考虑 for 中的 scoped
  1785. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1786. forComponents.forEach(function (component) {
  1787. var ref = component.dataset.ref;
  1788. if (!$refs[ref]) {
  1789. $refs[ref] = [];
  1790. }
  1791. $refs[ref].push(component.$vm || component);
  1792. });
  1793. return $refs;
  1794. } });
  1795. }
  1796. function handleLink(event) {var _ref4 =
  1797. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1798. var parentVm;
  1799. if (vuePid) {
  1800. parentVm = findVmByVueId(this.$vm, vuePid);
  1801. }
  1802. if (!parentVm) {
  1803. parentVm = this.$vm;
  1804. }
  1805. vueOptions.parent = parentVm;
  1806. }
  1807. function parseApp(vm) {
  1808. return parseBaseApp(vm, {
  1809. mocks: mocks,
  1810. initRefs: initRefs });
  1811. }
  1812. function createApp(vm) {
  1813. App(parseApp(vm));
  1814. return vm;
  1815. }
  1816. var encodeReserveRE = /[!'()*]/g;
  1817. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1818. var commaRE = /%2C/g;
  1819. // fixed encodeURIComponent which is more conformant to RFC3986:
  1820. // - escapes [!'()*]
  1821. // - preserve commas
  1822. var encode = function encode(str) {return encodeURIComponent(str).
  1823. replace(encodeReserveRE, encodeReserveReplacer).
  1824. replace(commaRE, ',');};
  1825. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1826. var res = obj ? Object.keys(obj).map(function (key) {
  1827. var val = obj[key];
  1828. if (val === undefined) {
  1829. return '';
  1830. }
  1831. if (val === null) {
  1832. return encodeStr(key);
  1833. }
  1834. if (Array.isArray(val)) {
  1835. var result = [];
  1836. val.forEach(function (val2) {
  1837. if (val2 === undefined) {
  1838. return;
  1839. }
  1840. if (val2 === null) {
  1841. result.push(encodeStr(key));
  1842. } else {
  1843. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1844. }
  1845. });
  1846. return result.join('&');
  1847. }
  1848. return encodeStr(key) + '=' + encodeStr(val);
  1849. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1850. return res ? "?".concat(res) : '';
  1851. }
  1852. function parseBaseComponent(vueComponentOptions)
  1853. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1854. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1855. var options = _objectSpread({
  1856. multipleSlots: true,
  1857. addGlobalClass: true },
  1858. vueOptions.options || {});
  1859. {
  1860. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1861. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1862. Object.assign(options, vueOptions['mp-weixin'].options);
  1863. }
  1864. }
  1865. var componentOptions = {
  1866. options: options,
  1867. data: initData(vueOptions, _vue.default.prototype),
  1868. behaviors: initBehaviors(vueOptions, initBehavior),
  1869. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  1870. lifetimes: {
  1871. attached: function attached() {
  1872. var properties = this.properties;
  1873. var options = {
  1874. mpType: isPage.call(this) ? 'page' : 'component',
  1875. mpInstance: this,
  1876. propsData: properties };
  1877. initVueIds(properties.vueId, this);
  1878. // 处理父子关系
  1879. initRelation.call(this, {
  1880. vuePid: this._$vuePid,
  1881. vueOptions: options });
  1882. // 初始化 vue 实例
  1883. this.$vm = new VueComponent(options);
  1884. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1885. initSlots(this.$vm, properties.vueSlots);
  1886. // 触发首次 setData
  1887. this.$vm.$mount();
  1888. },
  1889. ready: function ready() {
  1890. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1891. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1892. if (this.$vm) {
  1893. this.$vm._isMounted = true;
  1894. this.$vm.__call_hook('mounted');
  1895. this.$vm.__call_hook('onReady');
  1896. }
  1897. },
  1898. detached: function detached() {
  1899. this.$vm && this.$vm.$destroy();
  1900. } },
  1901. pageLifetimes: {
  1902. show: function show(args) {
  1903. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1904. },
  1905. hide: function hide() {
  1906. this.$vm && this.$vm.__call_hook('onPageHide');
  1907. },
  1908. resize: function resize(size) {
  1909. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1910. } },
  1911. methods: {
  1912. __l: handleLink,
  1913. __e: handleEvent } };
  1914. // externalClasses
  1915. if (vueOptions.externalClasses) {
  1916. componentOptions.externalClasses = vueOptions.externalClasses;
  1917. }
  1918. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1919. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1920. componentOptions.methods[callMethod] = function (args) {
  1921. return this.$vm[callMethod](args);
  1922. };
  1923. });
  1924. }
  1925. if (isPage) {
  1926. return componentOptions;
  1927. }
  1928. return [componentOptions, VueComponent];
  1929. }
  1930. function parseComponent(vueComponentOptions) {
  1931. return parseBaseComponent(vueComponentOptions, {
  1932. isPage: isPage,
  1933. initRelation: initRelation });
  1934. }
  1935. var hooks$1 = [
  1936. 'onShow',
  1937. 'onHide',
  1938. 'onUnload'];
  1939. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1940. function parseBasePage(vuePageOptions, _ref6)
  1941. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1942. var pageOptions = parseComponent(vuePageOptions);
  1943. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1944. pageOptions.methods.onLoad = function (query) {
  1945. this.options = query;
  1946. var copyQuery = Object.assign({}, query);
  1947. delete copyQuery.__id__;
  1948. this.$page = {
  1949. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1950. this.$vm.$mp.query = query; // 兼容 mpvue
  1951. this.$vm.__call_hook('onLoad', query);
  1952. };
  1953. return pageOptions;
  1954. }
  1955. function parsePage(vuePageOptions) {
  1956. return parseBasePage(vuePageOptions, {
  1957. isPage: isPage,
  1958. initRelation: initRelation });
  1959. }
  1960. function createPage(vuePageOptions) {
  1961. {
  1962. return Component(parsePage(vuePageOptions));
  1963. }
  1964. }
  1965. function createComponent(vueOptions) {
  1966. {
  1967. return Component(parseComponent(vueOptions));
  1968. }
  1969. }
  1970. function createSubpackageApp(vm) {
  1971. var appOptions = parseApp(vm);
  1972. var app = getApp({
  1973. allowDefault: true });
  1974. vm.$scope = app;
  1975. var globalData = app.globalData;
  1976. if (globalData) {
  1977. Object.keys(appOptions.globalData).forEach(function (name) {
  1978. if (!hasOwn(globalData, name)) {
  1979. globalData[name] = appOptions.globalData[name];
  1980. }
  1981. });
  1982. }
  1983. Object.keys(appOptions).forEach(function (name) {
  1984. if (!hasOwn(app, name)) {
  1985. app[name] = appOptions[name];
  1986. }
  1987. });
  1988. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1989. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1990. vm.__call_hook('onShow', args);
  1991. });
  1992. }
  1993. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1994. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1995. vm.__call_hook('onHide', args);
  1996. });
  1997. }
  1998. if (isFn(appOptions.onLaunch)) {
  1999. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2000. vm.__call_hook('onLaunch', args);
  2001. }
  2002. return vm;
  2003. }
  2004. function createPlugin(vm) {
  2005. var appOptions = parseApp(vm);
  2006. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2007. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  2008. vm.__call_hook('onShow', args);
  2009. });
  2010. }
  2011. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2012. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  2013. vm.__call_hook('onHide', args);
  2014. });
  2015. }
  2016. if (isFn(appOptions.onLaunch)) {
  2017. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2018. vm.__call_hook('onLaunch', args);
  2019. }
  2020. return vm;
  2021. }
  2022. todos.forEach(function (todoApi) {
  2023. protocols[todoApi] = false;
  2024. });
  2025. canIUses.forEach(function (canIUseApi) {
  2026. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2027. canIUseApi;
  2028. if (!wx.canIUse(apiName)) {
  2029. protocols[canIUseApi] = false;
  2030. }
  2031. });
  2032. var uni = {};
  2033. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2034. uni = new Proxy({}, {
  2035. get: function get(target, name) {
  2036. if (hasOwn(target, name)) {
  2037. return target[name];
  2038. }
  2039. if (baseApi[name]) {
  2040. return baseApi[name];
  2041. }
  2042. if (api[name]) {
  2043. return promisify(name, api[name]);
  2044. }
  2045. {
  2046. if (extraApi[name]) {
  2047. return promisify(name, extraApi[name]);
  2048. }
  2049. if (todoApis[name]) {
  2050. return promisify(name, todoApis[name]);
  2051. }
  2052. }
  2053. if (eventApi[name]) {
  2054. return eventApi[name];
  2055. }
  2056. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2057. return;
  2058. }
  2059. return promisify(name, wrapper(name, wx[name]));
  2060. },
  2061. set: function set(target, name, value) {
  2062. target[name] = value;
  2063. return true;
  2064. } });
  2065. } else {
  2066. Object.keys(baseApi).forEach(function (name) {
  2067. uni[name] = baseApi[name];
  2068. });
  2069. {
  2070. Object.keys(todoApis).forEach(function (name) {
  2071. uni[name] = promisify(name, todoApis[name]);
  2072. });
  2073. Object.keys(extraApi).forEach(function (name) {
  2074. uni[name] = promisify(name, todoApis[name]);
  2075. });
  2076. }
  2077. Object.keys(eventApi).forEach(function (name) {
  2078. uni[name] = eventApi[name];
  2079. });
  2080. Object.keys(api).forEach(function (name) {
  2081. uni[name] = promisify(name, api[name]);
  2082. });
  2083. Object.keys(wx).forEach(function (name) {
  2084. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2085. uni[name] = promisify(name, wrapper(name, wx[name]));
  2086. }
  2087. });
  2088. }
  2089. wx.createApp = createApp;
  2090. wx.createPage = createPage;
  2091. wx.createComponent = createComponent;
  2092. wx.createSubpackageApp = createSubpackageApp;
  2093. wx.createPlugin = createPlugin;
  2094. var uni$1 = uni;var _default =
  2095. uni$1;exports.default = _default;
  2096. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2097. /***/ }),
  2098. /* 2 */
  2099. /*!***********************************!*\
  2100. !*** (webpack)/buildin/global.js ***!
  2101. \***********************************/
  2102. /*! no static exports found */
  2103. /***/ (function(module, exports) {
  2104. var g;
  2105. // This works in non-strict mode
  2106. g = (function() {
  2107. return this;
  2108. })();
  2109. try {
  2110. // This works if eval is allowed (see CSP)
  2111. g = g || new Function("return this")();
  2112. } catch (e) {
  2113. // This works if the window reference is available
  2114. if (typeof window === "object") g = window;
  2115. }
  2116. // g can still be undefined, but nothing to do about it...
  2117. // We return undefined, instead of nothing here, so it's
  2118. // easier to handle this case. if(!global) { ...}
  2119. module.exports = g;
  2120. /***/ }),
  2121. /* 3 */
  2122. /*!*************************************************************!*\
  2123. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2124. \*************************************************************/
  2125. /*! no static exports found */
  2126. /***/ (function(module, exports, __webpack_require__) {
  2127. "use strict";
  2128. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];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);return Constructor;}var isArray = Array.isArray;
  2129. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  2130. var defaultDelimiters = ['{', '}'];var
  2131. BaseFormatter = /*#__PURE__*/function () {
  2132. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  2133. this._caches = Object.create(null);
  2134. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  2135. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2136. if (!values) {
  2137. return [message];
  2138. }
  2139. var tokens = this._caches[message];
  2140. if (!tokens) {
  2141. tokens = parse(message, delimiters);
  2142. this._caches[message] = tokens;
  2143. }
  2144. return compile(tokens, values);
  2145. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  2146. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2147. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2148. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  2149. var tokens = [];
  2150. var position = 0;
  2151. var text = '';
  2152. while (position < format.length) {
  2153. var char = format[position++];
  2154. if (char === startDelimiter) {
  2155. if (text) {
  2156. tokens.push({ type: 'text', value: text });
  2157. }
  2158. text = '';
  2159. var sub = '';
  2160. char = format[position++];
  2161. while (char !== undefined && char !== endDelimiter) {
  2162. sub += char;
  2163. char = format[position++];
  2164. }
  2165. var isClosed = char === endDelimiter;
  2166. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  2167. 'list' :
  2168. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  2169. 'named' :
  2170. 'unknown';
  2171. tokens.push({ value: sub, type: type });
  2172. }
  2173. // else if (char === '%') {
  2174. // // when found rails i18n syntax, skip text capture
  2175. // if (format[position] !== '{') {
  2176. // text += char
  2177. // }
  2178. // }
  2179. else {
  2180. text += char;
  2181. }
  2182. }
  2183. text && tokens.push({ type: 'text', value: text });
  2184. return tokens;
  2185. }
  2186. function compile(tokens, values) {
  2187. var compiled = [];
  2188. var index = 0;
  2189. var mode = isArray(values) ?
  2190. 'list' :
  2191. isObject(values) ?
  2192. 'named' :
  2193. 'unknown';
  2194. if (mode === 'unknown') {
  2195. return compiled;
  2196. }
  2197. while (index < tokens.length) {
  2198. var token = tokens[index];
  2199. switch (token.type) {
  2200. case 'text':
  2201. compiled.push(token.value);
  2202. break;
  2203. case 'list':
  2204. compiled.push(values[parseInt(token.value, 10)]);
  2205. break;
  2206. case 'named':
  2207. if (mode === 'named') {
  2208. compiled.push(values[token.value]);
  2209. } else
  2210. {
  2211. if (true) {
  2212. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2213. }
  2214. }
  2215. break;
  2216. case 'unknown':
  2217. if (true) {
  2218. console.warn("Detect 'unknown' type of token!");
  2219. }
  2220. break;}
  2221. index++;
  2222. }
  2223. return compiled;
  2224. }
  2225. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2226. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2227. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  2228. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  2229. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  2230. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2231. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  2232. var defaultFormatter = new BaseFormatter();
  2233. function include(str, parts) {
  2234. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  2235. }
  2236. function startsWith(str, parts) {
  2237. return parts.find(function (part) {return str.indexOf(part) === 0;});
  2238. }
  2239. function normalizeLocale(locale, messages) {
  2240. if (!locale) {
  2241. return;
  2242. }
  2243. locale = locale.trim().replace(/_/g, '-');
  2244. if (messages && messages[locale]) {
  2245. return locale;
  2246. }
  2247. locale = locale.toLowerCase();
  2248. if (locale.indexOf('zh') === 0) {
  2249. if (locale.indexOf('-hans') > -1) {
  2250. return LOCALE_ZH_HANS;
  2251. }
  2252. if (locale.indexOf('-hant') > -1) {
  2253. return LOCALE_ZH_HANT;
  2254. }
  2255. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2256. return LOCALE_ZH_HANT;
  2257. }
  2258. return LOCALE_ZH_HANS;
  2259. }
  2260. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2261. if (lang) {
  2262. return lang;
  2263. }
  2264. }var
  2265. I18n = /*#__PURE__*/function () {
  2266. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  2267. this.locale = LOCALE_EN;
  2268. this.fallbackLocale = LOCALE_EN;
  2269. this.message = {};
  2270. this.messages = {};
  2271. this.watchers = [];
  2272. if (fallbackLocale) {
  2273. this.fallbackLocale = fallbackLocale;
  2274. }
  2275. this.formater = formater || defaultFormatter;
  2276. this.messages = messages || {};
  2277. this.setLocale(locale || LOCALE_EN);
  2278. if (watcher) {
  2279. this.watchLocale(watcher);
  2280. }
  2281. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  2282. locale) {var _this = this;
  2283. var oldLocale = this.locale;
  2284. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2285. if (!this.messages[this.locale]) {
  2286. // 可能初始化时不存在
  2287. this.messages[this.locale] = {};
  2288. }
  2289. this.message = this.messages[this.locale];
  2290. // 仅发生变化时,通知
  2291. if (oldLocale !== this.locale) {
  2292. this.watchers.forEach(function (watcher) {
  2293. watcher(_this.locale, oldLocale);
  2294. });
  2295. }
  2296. } }, { key: "getLocale", value: function getLocale()
  2297. {
  2298. return this.locale;
  2299. } }, { key: "watchLocale", value: function watchLocale(
  2300. fn) {var _this2 = this;
  2301. var index = this.watchers.push(fn) - 1;
  2302. return function () {
  2303. _this2.watchers.splice(index, 1);
  2304. };
  2305. } }, { key: "add", value: function add(
  2306. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2307. var curMessages = this.messages[locale];
  2308. if (curMessages) {
  2309. if (override) {
  2310. Object.assign(curMessages, message);
  2311. } else
  2312. {
  2313. Object.keys(message).forEach(function (key) {
  2314. if (!hasOwn(curMessages, key)) {
  2315. curMessages[key] = message[key];
  2316. }
  2317. });
  2318. }
  2319. } else
  2320. {
  2321. this.messages[locale] = message;
  2322. }
  2323. } }, { key: "f", value: function f(
  2324. message, values, delimiters) {
  2325. return this.formater.interpolate(message, values, delimiters).join('');
  2326. } }, { key: "t", value: function t(
  2327. key, locale, values) {
  2328. var message = this.message;
  2329. if (typeof locale === 'string') {
  2330. locale = normalizeLocale(locale, this.messages);
  2331. locale && (message = this.messages[locale]);
  2332. } else
  2333. {
  2334. values = locale;
  2335. }
  2336. if (!hasOwn(message, key)) {
  2337. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2338. return key;
  2339. }
  2340. return this.formater.interpolate(message[key], values).join('');
  2341. } }]);return I18n;}();exports.I18n = I18n;
  2342. function watchAppLocale(appVm, i18n) {
  2343. // 需要保证 watch 的触发在组件渲染之前
  2344. if (appVm.$watchLocale) {
  2345. // vue2
  2346. appVm.$watchLocale(function (newLocale) {
  2347. i18n.setLocale(newLocale);
  2348. });
  2349. } else
  2350. {
  2351. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  2352. i18n.setLocale(newLocale);
  2353. });
  2354. }
  2355. }
  2356. function getDefaultLocale() {
  2357. if (typeof uni !== 'undefined' && uni.getLocale) {
  2358. return uni.getLocale();
  2359. }
  2360. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2361. if (typeof global !== 'undefined' && global.getLocale) {
  2362. return global.getLocale();
  2363. }
  2364. return LOCALE_EN;
  2365. }
  2366. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  2367. // 兼容旧版本入参
  2368. if (typeof locale !== 'string') {var _ref4 =
  2369. [
  2370. messages,
  2371. locale];locale = _ref4[0];messages = _ref4[1];
  2372. }
  2373. if (typeof locale !== 'string') {
  2374. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  2375. locale = getDefaultLocale();
  2376. }
  2377. if (typeof fallbackLocale !== 'string') {
  2378. fallbackLocale =
  2379. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  2380. LOCALE_EN;
  2381. }
  2382. var i18n = new I18n({
  2383. locale: locale,
  2384. fallbackLocale: fallbackLocale,
  2385. messages: messages,
  2386. watcher: watcher });
  2387. var _t = function t(key, values) {
  2388. if (typeof getApp !== 'function') {
  2389. // app view
  2390. /* eslint-disable no-func-assign */
  2391. _t = function t(key, values) {
  2392. return i18n.t(key, values);
  2393. };
  2394. } else
  2395. {
  2396. var isWatchedAppLocale = false;
  2397. _t = function t(key, values) {
  2398. var appVm = getApp().$vm;
  2399. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  2400. // options: {
  2401. // type: Array,
  2402. // default () {
  2403. // return [{
  2404. // icon: 'shop',
  2405. // text: t("uni-goods-nav.options.shop"),
  2406. // }, {
  2407. // icon: 'cart',
  2408. // text: t("uni-goods-nav.options.cart")
  2409. // }]
  2410. // }
  2411. // },
  2412. if (appVm) {
  2413. // 触发响应式
  2414. appVm.$locale;
  2415. if (!isWatchedAppLocale) {
  2416. isWatchedAppLocale = true;
  2417. watchAppLocale(appVm, i18n);
  2418. }
  2419. }
  2420. return i18n.t(key, values);
  2421. };
  2422. }
  2423. return _t(key, values);
  2424. };
  2425. return {
  2426. i18n: i18n,
  2427. f: function f(message, values, delimiters) {
  2428. return i18n.f(message, values, delimiters);
  2429. },
  2430. t: function t(key, values) {
  2431. return _t(key, values);
  2432. },
  2433. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2434. return i18n.add(locale, message, override);
  2435. },
  2436. watch: function watch(fn) {
  2437. return i18n.watchLocale(fn);
  2438. },
  2439. getLocale: function getLocale() {
  2440. return i18n.getLocale();
  2441. },
  2442. setLocale: function setLocale(newLocale) {
  2443. return i18n.setLocale(newLocale);
  2444. } };
  2445. }
  2446. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  2447. var formater;
  2448. function hasI18nJson(jsonObj, delimiters) {
  2449. if (!formater) {
  2450. formater = new BaseFormatter();
  2451. }
  2452. return walkJsonObj(jsonObj, function (jsonObj, key) {
  2453. var value = jsonObj[key];
  2454. if (isString(value)) {
  2455. if (isI18nStr(value, delimiters)) {
  2456. return true;
  2457. }
  2458. } else
  2459. {
  2460. return hasI18nJson(value, delimiters);
  2461. }
  2462. });
  2463. }
  2464. function parseI18nJson(jsonObj, values, delimiters) {
  2465. if (!formater) {
  2466. formater = new BaseFormatter();
  2467. }
  2468. walkJsonObj(jsonObj, function (jsonObj, key) {
  2469. var value = jsonObj[key];
  2470. if (isString(value)) {
  2471. if (isI18nStr(value, delimiters)) {
  2472. jsonObj[key] = compileStr(value, values, delimiters);
  2473. }
  2474. } else
  2475. {
  2476. parseI18nJson(value, values, delimiters);
  2477. }
  2478. });
  2479. return jsonObj;
  2480. }
  2481. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  2482. if (!isI18nStr(jsonStr, delimiters)) {
  2483. return jsonStr;
  2484. }
  2485. if (!formater) {
  2486. formater = new BaseFormatter();
  2487. }
  2488. var localeValues = [];
  2489. Object.keys(locales).forEach(function (name) {
  2490. if (name !== locale) {
  2491. localeValues.push({
  2492. locale: name,
  2493. values: locales[name] });
  2494. }
  2495. });
  2496. localeValues.unshift({ locale: locale, values: locales[locale] });
  2497. try {
  2498. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  2499. }
  2500. catch (e) {}
  2501. return jsonStr;
  2502. }
  2503. function isI18nStr(value, delimiters) {
  2504. return value.indexOf(delimiters[0]) > -1;
  2505. }
  2506. function compileStr(value, values, delimiters) {
  2507. return formater.interpolate(value, values, delimiters).join('');
  2508. }
  2509. function compileValue(jsonObj, key, localeValues, delimiters) {
  2510. var value = jsonObj[key];
  2511. if (isString(value)) {
  2512. // 存在国际化
  2513. if (isI18nStr(value, delimiters)) {
  2514. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  2515. if (localeValues.length > 1) {
  2516. // 格式化国际化语言
  2517. var valueLocales = jsonObj[key + 'Locales'] = {};
  2518. localeValues.forEach(function (localValue) {
  2519. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  2520. });
  2521. }
  2522. }
  2523. } else
  2524. {
  2525. compileJsonObj(value, localeValues, delimiters);
  2526. }
  2527. }
  2528. function compileJsonObj(jsonObj, localeValues, delimiters) {
  2529. walkJsonObj(jsonObj, function (jsonObj, key) {
  2530. compileValue(jsonObj, key, localeValues, delimiters);
  2531. });
  2532. return jsonObj;
  2533. }
  2534. function walkJsonObj(jsonObj, walk) {
  2535. if (isArray(jsonObj)) {
  2536. for (var i = 0; i < jsonObj.length; i++) {
  2537. if (walk(jsonObj, i)) {
  2538. return true;
  2539. }
  2540. }
  2541. } else
  2542. if (isObject(jsonObj)) {
  2543. for (var key in jsonObj) {
  2544. if (walk(jsonObj, key)) {
  2545. return true;
  2546. }
  2547. }
  2548. }
  2549. return false;
  2550. }
  2551. function resolveLocale(locales) {
  2552. return function (locale) {
  2553. if (!locale) {
  2554. return locale;
  2555. }
  2556. locale = normalizeLocale(locale) || locale;
  2557. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  2558. };
  2559. }
  2560. function resolveLocaleChain(locale) {
  2561. var chain = [];
  2562. var tokens = locale.split('-');
  2563. while (tokens.length) {
  2564. chain.push(tokens.join('-'));
  2565. tokens.pop();
  2566. }
  2567. return chain;
  2568. }
  2569. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2570. /***/ }),
  2571. /* 4 */
  2572. /*!******************************************************************************************!*\
  2573. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2574. \******************************************************************************************/
  2575. /*! exports provided: default */
  2576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2577. "use strict";
  2578. __webpack_require__.r(__webpack_exports__);
  2579. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2580. * Vue.js v2.6.11
  2581. * (c) 2014-2022 Evan You
  2582. * Released under the MIT License.
  2583. */
  2584. /* */
  2585. var emptyObject = Object.freeze({});
  2586. // These helpers produce better VM code in JS engines due to their
  2587. // explicitness and function inlining.
  2588. function isUndef (v) {
  2589. return v === undefined || v === null
  2590. }
  2591. function isDef (v) {
  2592. return v !== undefined && v !== null
  2593. }
  2594. function isTrue (v) {
  2595. return v === true
  2596. }
  2597. function isFalse (v) {
  2598. return v === false
  2599. }
  2600. /**
  2601. * Check if value is primitive.
  2602. */
  2603. function isPrimitive (value) {
  2604. return (
  2605. typeof value === 'string' ||
  2606. typeof value === 'number' ||
  2607. // $flow-disable-line
  2608. typeof value === 'symbol' ||
  2609. typeof value === 'boolean'
  2610. )
  2611. }
  2612. /**
  2613. * Quick object check - this is primarily used to tell
  2614. * Objects from primitive values when we know the value
  2615. * is a JSON-compliant type.
  2616. */
  2617. function isObject (obj) {
  2618. return obj !== null && typeof obj === 'object'
  2619. }
  2620. /**
  2621. * Get the raw type string of a value, e.g., [object Object].
  2622. */
  2623. var _toString = Object.prototype.toString;
  2624. function toRawType (value) {
  2625. return _toString.call(value).slice(8, -1)
  2626. }
  2627. /**
  2628. * Strict object type check. Only returns true
  2629. * for plain JavaScript objects.
  2630. */
  2631. function isPlainObject (obj) {
  2632. return _toString.call(obj) === '[object Object]'
  2633. }
  2634. function isRegExp (v) {
  2635. return _toString.call(v) === '[object RegExp]'
  2636. }
  2637. /**
  2638. * Check if val is a valid array index.
  2639. */
  2640. function isValidArrayIndex (val) {
  2641. var n = parseFloat(String(val));
  2642. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2643. }
  2644. function isPromise (val) {
  2645. return (
  2646. isDef(val) &&
  2647. typeof val.then === 'function' &&
  2648. typeof val.catch === 'function'
  2649. )
  2650. }
  2651. /**
  2652. * Convert a value to a string that is actually rendered.
  2653. */
  2654. function toString (val) {
  2655. return val == null
  2656. ? ''
  2657. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2658. ? JSON.stringify(val, null, 2)
  2659. : String(val)
  2660. }
  2661. /**
  2662. * Convert an input value to a number for persistence.
  2663. * If the conversion fails, return original string.
  2664. */
  2665. function toNumber (val) {
  2666. var n = parseFloat(val);
  2667. return isNaN(n) ? val : n
  2668. }
  2669. /**
  2670. * Make a map and return a function for checking if a key
  2671. * is in that map.
  2672. */
  2673. function makeMap (
  2674. str,
  2675. expectsLowerCase
  2676. ) {
  2677. var map = Object.create(null);
  2678. var list = str.split(',');
  2679. for (var i = 0; i < list.length; i++) {
  2680. map[list[i]] = true;
  2681. }
  2682. return expectsLowerCase
  2683. ? function (val) { return map[val.toLowerCase()]; }
  2684. : function (val) { return map[val]; }
  2685. }
  2686. /**
  2687. * Check if a tag is a built-in tag.
  2688. */
  2689. var isBuiltInTag = makeMap('slot,component', true);
  2690. /**
  2691. * Check if an attribute is a reserved attribute.
  2692. */
  2693. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2694. /**
  2695. * Remove an item from an array.
  2696. */
  2697. function remove (arr, item) {
  2698. if (arr.length) {
  2699. var index = arr.indexOf(item);
  2700. if (index > -1) {
  2701. return arr.splice(index, 1)
  2702. }
  2703. }
  2704. }
  2705. /**
  2706. * Check whether an object has the property.
  2707. */
  2708. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2709. function hasOwn (obj, key) {
  2710. return hasOwnProperty.call(obj, key)
  2711. }
  2712. /**
  2713. * Create a cached version of a pure function.
  2714. */
  2715. function cached (fn) {
  2716. var cache = Object.create(null);
  2717. return (function cachedFn (str) {
  2718. var hit = cache[str];
  2719. return hit || (cache[str] = fn(str))
  2720. })
  2721. }
  2722. /**
  2723. * Camelize a hyphen-delimited string.
  2724. */
  2725. var camelizeRE = /-(\w)/g;
  2726. var camelize = cached(function (str) {
  2727. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2728. });
  2729. /**
  2730. * Capitalize a string.
  2731. */
  2732. var capitalize = cached(function (str) {
  2733. return str.charAt(0).toUpperCase() + str.slice(1)
  2734. });
  2735. /**
  2736. * Hyphenate a camelCase string.
  2737. */
  2738. var hyphenateRE = /\B([A-Z])/g;
  2739. var hyphenate = cached(function (str) {
  2740. return str.replace(hyphenateRE, '-$1').toLowerCase()
  2741. });
  2742. /**
  2743. * Simple bind polyfill for environments that do not support it,
  2744. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  2745. * since native bind is now performant enough in most browsers.
  2746. * But removing it would mean breaking code that was able to run in
  2747. * PhantomJS 1.x, so this must be kept for backward compatibility.
  2748. */
  2749. /* istanbul ignore next */
  2750. function polyfillBind (fn, ctx) {
  2751. function boundFn (a) {
  2752. var l = arguments.length;
  2753. return l
  2754. ? l > 1
  2755. ? fn.apply(ctx, arguments)
  2756. : fn.call(ctx, a)
  2757. : fn.call(ctx)
  2758. }
  2759. boundFn._length = fn.length;
  2760. return boundFn
  2761. }
  2762. function nativeBind (fn, ctx) {
  2763. return fn.bind(ctx)
  2764. }
  2765. var bind = Function.prototype.bind
  2766. ? nativeBind
  2767. : polyfillBind;
  2768. /**
  2769. * Convert an Array-like object to a real Array.
  2770. */
  2771. function toArray (list, start) {
  2772. start = start || 0;
  2773. var i = list.length - start;
  2774. var ret = new Array(i);
  2775. while (i--) {
  2776. ret[i] = list[i + start];
  2777. }
  2778. return ret
  2779. }
  2780. /**
  2781. * Mix properties into target object.
  2782. */
  2783. function extend (to, _from) {
  2784. for (var key in _from) {
  2785. to[key] = _from[key];
  2786. }
  2787. return to
  2788. }
  2789. /**
  2790. * Merge an Array of Objects into a single Object.
  2791. */
  2792. function toObject (arr) {
  2793. var res = {};
  2794. for (var i = 0; i < arr.length; i++) {
  2795. if (arr[i]) {
  2796. extend(res, arr[i]);
  2797. }
  2798. }
  2799. return res
  2800. }
  2801. /* eslint-disable no-unused-vars */
  2802. /**
  2803. * Perform no operation.
  2804. * Stubbing args to make Flow happy without leaving useless transpiled code
  2805. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2806. */
  2807. function noop (a, b, c) {}
  2808. /**
  2809. * Always return false.
  2810. */
  2811. var no = function (a, b, c) { return false; };
  2812. /* eslint-enable no-unused-vars */
  2813. /**
  2814. * Return the same value.
  2815. */
  2816. var identity = function (_) { return _; };
  2817. /**
  2818. * Check if two values are loosely equal - that is,
  2819. * if they are plain objects, do they have the same shape?
  2820. */
  2821. function looseEqual (a, b) {
  2822. if (a === b) { return true }
  2823. var isObjectA = isObject(a);
  2824. var isObjectB = isObject(b);
  2825. if (isObjectA && isObjectB) {
  2826. try {
  2827. var isArrayA = Array.isArray(a);
  2828. var isArrayB = Array.isArray(b);
  2829. if (isArrayA && isArrayB) {
  2830. return a.length === b.length && a.every(function (e, i) {
  2831. return looseEqual(e, b[i])
  2832. })
  2833. } else if (a instanceof Date && b instanceof Date) {
  2834. return a.getTime() === b.getTime()
  2835. } else if (!isArrayA && !isArrayB) {
  2836. var keysA = Object.keys(a);
  2837. var keysB = Object.keys(b);
  2838. return keysA.length === keysB.length && keysA.every(function (key) {
  2839. return looseEqual(a[key], b[key])
  2840. })
  2841. } else {
  2842. /* istanbul ignore next */
  2843. return false
  2844. }
  2845. } catch (e) {
  2846. /* istanbul ignore next */
  2847. return false
  2848. }
  2849. } else if (!isObjectA && !isObjectB) {
  2850. return String(a) === String(b)
  2851. } else {
  2852. return false
  2853. }
  2854. }
  2855. /**
  2856. * Return the first index at which a loosely equal value can be
  2857. * found in the array (if value is a plain object, the array must
  2858. * contain an object of the same shape), or -1 if it is not present.
  2859. */
  2860. function looseIndexOf (arr, val) {
  2861. for (var i = 0; i < arr.length; i++) {
  2862. if (looseEqual(arr[i], val)) { return i }
  2863. }
  2864. return -1
  2865. }
  2866. /**
  2867. * Ensure a function is called only once.
  2868. */
  2869. function once (fn) {
  2870. var called = false;
  2871. return function () {
  2872. if (!called) {
  2873. called = true;
  2874. fn.apply(this, arguments);
  2875. }
  2876. }
  2877. }
  2878. var ASSET_TYPES = [
  2879. 'component',
  2880. 'directive',
  2881. 'filter'
  2882. ];
  2883. var LIFECYCLE_HOOKS = [
  2884. 'beforeCreate',
  2885. 'created',
  2886. 'beforeMount',
  2887. 'mounted',
  2888. 'beforeUpdate',
  2889. 'updated',
  2890. 'beforeDestroy',
  2891. 'destroyed',
  2892. 'activated',
  2893. 'deactivated',
  2894. 'errorCaptured',
  2895. 'serverPrefetch'
  2896. ];
  2897. /* */
  2898. var config = ({
  2899. /**
  2900. * Option merge strategies (used in core/util/options)
  2901. */
  2902. // $flow-disable-line
  2903. optionMergeStrategies: Object.create(null),
  2904. /**
  2905. * Whether to suppress warnings.
  2906. */
  2907. silent: false,
  2908. /**
  2909. * Show production mode tip message on boot?
  2910. */
  2911. productionTip: "development" !== 'production',
  2912. /**
  2913. * Whether to enable devtools
  2914. */
  2915. devtools: "development" !== 'production',
  2916. /**
  2917. * Whether to record perf
  2918. */
  2919. performance: false,
  2920. /**
  2921. * Error handler for watcher errors
  2922. */
  2923. errorHandler: null,
  2924. /**
  2925. * Warn handler for watcher warns
  2926. */
  2927. warnHandler: null,
  2928. /**
  2929. * Ignore certain custom elements
  2930. */
  2931. ignoredElements: [],
  2932. /**
  2933. * Custom user key aliases for v-on
  2934. */
  2935. // $flow-disable-line
  2936. keyCodes: Object.create(null),
  2937. /**
  2938. * Check if a tag is reserved so that it cannot be registered as a
  2939. * component. This is platform-dependent and may be overwritten.
  2940. */
  2941. isReservedTag: no,
  2942. /**
  2943. * Check if an attribute is reserved so that it cannot be used as a component
  2944. * prop. This is platform-dependent and may be overwritten.
  2945. */
  2946. isReservedAttr: no,
  2947. /**
  2948. * Check if a tag is an unknown element.
  2949. * Platform-dependent.
  2950. */
  2951. isUnknownElement: no,
  2952. /**
  2953. * Get the namespace of an element
  2954. */
  2955. getTagNamespace: noop,
  2956. /**
  2957. * Parse the real tag name for the specific platform.
  2958. */
  2959. parsePlatformTagName: identity,
  2960. /**
  2961. * Check if an attribute must be bound using property, e.g. value
  2962. * Platform-dependent.
  2963. */
  2964. mustUseProp: no,
  2965. /**
  2966. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2967. * This will significantly reduce performance if set to false.
  2968. */
  2969. async: true,
  2970. /**
  2971. * Exposed for legacy reasons
  2972. */
  2973. _lifecycleHooks: LIFECYCLE_HOOKS
  2974. });
  2975. /* */
  2976. /**
  2977. * unicode letters used for parsing html tags, component names and property paths.
  2978. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2979. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2980. */
  2981. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  2982. /**
  2983. * Check if a string starts with $ or _
  2984. */
  2985. function isReserved (str) {
  2986. var c = (str + '').charCodeAt(0);
  2987. return c === 0x24 || c === 0x5F
  2988. }
  2989. /**
  2990. * Define a property.
  2991. */
  2992. function def (obj, key, val, enumerable) {
  2993. Object.defineProperty(obj, key, {
  2994. value: val,
  2995. enumerable: !!enumerable,
  2996. writable: true,
  2997. configurable: true
  2998. });
  2999. }
  3000. /**
  3001. * Parse simple path.
  3002. */
  3003. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3004. function parsePath (path) {
  3005. if (bailRE.test(path)) {
  3006. return
  3007. }
  3008. var segments = path.split('.');
  3009. return function (obj) {
  3010. for (var i = 0; i < segments.length; i++) {
  3011. if (!obj) { return }
  3012. obj = obj[segments[i]];
  3013. }
  3014. return obj
  3015. }
  3016. }
  3017. /* */
  3018. // can we use __proto__?
  3019. var hasProto = '__proto__' in {};
  3020. // Browser environment sniffing
  3021. var inBrowser = typeof window !== 'undefined';
  3022. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3023. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3024. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3025. var isIE = UA && /msie|trident/.test(UA);
  3026. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3027. var isEdge = UA && UA.indexOf('edge/') > 0;
  3028. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3029. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3030. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3031. var isPhantomJS = UA && /phantomjs/.test(UA);
  3032. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3033. // Firefox has a "watch" function on Object.prototype...
  3034. var nativeWatch = ({}).watch;
  3035. if (inBrowser) {
  3036. try {
  3037. var opts = {};
  3038. Object.defineProperty(opts, 'passive', ({
  3039. get: function get () {
  3040. }
  3041. })); // https://github.com/facebook/flow/issues/285
  3042. window.addEventListener('test-passive', null, opts);
  3043. } catch (e) {}
  3044. }
  3045. // this needs to be lazy-evaled because vue may be required before
  3046. // vue-server-renderer can set VUE_ENV
  3047. var _isServer;
  3048. var isServerRendering = function () {
  3049. if (_isServer === undefined) {
  3050. /* istanbul ignore if */
  3051. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3052. // detect presence of vue-server-renderer and avoid
  3053. // Webpack shimming the process
  3054. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3055. } else {
  3056. _isServer = false;
  3057. }
  3058. }
  3059. return _isServer
  3060. };
  3061. // detect devtools
  3062. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3063. /* istanbul ignore next */
  3064. function isNative (Ctor) {
  3065. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3066. }
  3067. var hasSymbol =
  3068. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3069. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3070. var _Set;
  3071. /* istanbul ignore if */ // $flow-disable-line
  3072. if (typeof Set !== 'undefined' && isNative(Set)) {
  3073. // use native Set when available.
  3074. _Set = Set;
  3075. } else {
  3076. // a non-standard Set polyfill that only works with primitive keys.
  3077. _Set = /*@__PURE__*/(function () {
  3078. function Set () {
  3079. this.set = Object.create(null);
  3080. }
  3081. Set.prototype.has = function has (key) {
  3082. return this.set[key] === true
  3083. };
  3084. Set.prototype.add = function add (key) {
  3085. this.set[key] = true;
  3086. };
  3087. Set.prototype.clear = function clear () {
  3088. this.set = Object.create(null);
  3089. };
  3090. return Set;
  3091. }());
  3092. }
  3093. /* */
  3094. var warn = noop;
  3095. var tip = noop;
  3096. var generateComponentTrace = (noop); // work around flow check
  3097. var formatComponentName = (noop);
  3098. if (true) {
  3099. var hasConsole = typeof console !== 'undefined';
  3100. var classifyRE = /(?:^|[-_])(\w)/g;
  3101. var classify = function (str) { return str
  3102. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3103. .replace(/[-_]/g, ''); };
  3104. warn = function (msg, vm) {
  3105. var trace = vm ? generateComponentTrace(vm) : '';
  3106. if (config.warnHandler) {
  3107. config.warnHandler.call(null, msg, vm, trace);
  3108. } else if (hasConsole && (!config.silent)) {
  3109. console.error(("[Vue warn]: " + msg + trace));
  3110. }
  3111. };
  3112. tip = function (msg, vm) {
  3113. if (hasConsole && (!config.silent)) {
  3114. console.warn("[Vue tip]: " + msg + (
  3115. vm ? generateComponentTrace(vm) : ''
  3116. ));
  3117. }
  3118. };
  3119. formatComponentName = function (vm, includeFile) {
  3120. if (vm.$root === vm) {
  3121. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3122. return ('') + vm.$options.__file
  3123. }
  3124. return '<Root>'
  3125. }
  3126. var options = typeof vm === 'function' && vm.cid != null
  3127. ? vm.options
  3128. : vm._isVue
  3129. ? vm.$options || vm.constructor.options
  3130. : vm;
  3131. var name = options.name || options._componentTag;
  3132. var file = options.__file;
  3133. if (!name && file) {
  3134. var match = file.match(/([^/\\]+)\.vue$/);
  3135. name = match && match[1];
  3136. }
  3137. return (
  3138. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3139. (file && includeFile !== false ? (" at " + file) : '')
  3140. )
  3141. };
  3142. var repeat = function (str, n) {
  3143. var res = '';
  3144. while (n) {
  3145. if (n % 2 === 1) { res += str; }
  3146. if (n > 1) { str += str; }
  3147. n >>= 1;
  3148. }
  3149. return res
  3150. };
  3151. generateComponentTrace = function (vm) {
  3152. if (vm._isVue && vm.$parent) {
  3153. var tree = [];
  3154. var currentRecursiveSequence = 0;
  3155. while (vm && vm.$options.name !== 'PageBody') {
  3156. if (tree.length > 0) {
  3157. var last = tree[tree.length - 1];
  3158. if (last.constructor === vm.constructor) {
  3159. currentRecursiveSequence++;
  3160. vm = vm.$parent;
  3161. continue
  3162. } else if (currentRecursiveSequence > 0) {
  3163. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3164. currentRecursiveSequence = 0;
  3165. }
  3166. }
  3167. !vm.$options.isReserved && tree.push(vm);
  3168. vm = vm.$parent;
  3169. }
  3170. return '\n\nfound in\n\n' + tree
  3171. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3172. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3173. : formatComponentName(vm))); })
  3174. .join('\n')
  3175. } else {
  3176. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3177. }
  3178. };
  3179. }
  3180. /* */
  3181. var uid = 0;
  3182. /**
  3183. * A dep is an observable that can have multiple
  3184. * directives subscribing to it.
  3185. */
  3186. var Dep = function Dep () {
  3187. this.id = uid++;
  3188. this.subs = [];
  3189. };
  3190. Dep.prototype.addSub = function addSub (sub) {
  3191. this.subs.push(sub);
  3192. };
  3193. Dep.prototype.removeSub = function removeSub (sub) {
  3194. remove(this.subs, sub);
  3195. };
  3196. Dep.prototype.depend = function depend () {
  3197. if (Dep.SharedObject.target) {
  3198. Dep.SharedObject.target.addDep(this);
  3199. }
  3200. };
  3201. Dep.prototype.notify = function notify () {
  3202. // stabilize the subscriber list first
  3203. var subs = this.subs.slice();
  3204. if ( true && !config.async) {
  3205. // subs aren't sorted in scheduler if not running async
  3206. // we need to sort them now to make sure they fire in correct
  3207. // order
  3208. subs.sort(function (a, b) { return a.id - b.id; });
  3209. }
  3210. for (var i = 0, l = subs.length; i < l; i++) {
  3211. subs[i].update();
  3212. }
  3213. };
  3214. // The current target watcher being evaluated.
  3215. // This is globally unique because only one watcher
  3216. // can be evaluated at a time.
  3217. // fixed by xxxxxx (nvue shared vuex)
  3218. /* eslint-disable no-undef */
  3219. Dep.SharedObject = {};
  3220. Dep.SharedObject.target = null;
  3221. Dep.SharedObject.targetStack = [];
  3222. function pushTarget (target) {
  3223. Dep.SharedObject.targetStack.push(target);
  3224. Dep.SharedObject.target = target;
  3225. Dep.target = target;
  3226. }
  3227. function popTarget () {
  3228. Dep.SharedObject.targetStack.pop();
  3229. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3230. Dep.target = Dep.SharedObject.target;
  3231. }
  3232. /* */
  3233. var VNode = function VNode (
  3234. tag,
  3235. data,
  3236. children,
  3237. text,
  3238. elm,
  3239. context,
  3240. componentOptions,
  3241. asyncFactory
  3242. ) {
  3243. this.tag = tag;
  3244. this.data = data;
  3245. this.children = children;
  3246. this.text = text;
  3247. this.elm = elm;
  3248. this.ns = undefined;
  3249. this.context = context;
  3250. this.fnContext = undefined;
  3251. this.fnOptions = undefined;
  3252. this.fnScopeId = undefined;
  3253. this.key = data && data.key;
  3254. this.componentOptions = componentOptions;
  3255. this.componentInstance = undefined;
  3256. this.parent = undefined;
  3257. this.raw = false;
  3258. this.isStatic = false;
  3259. this.isRootInsert = true;
  3260. this.isComment = false;
  3261. this.isCloned = false;
  3262. this.isOnce = false;
  3263. this.asyncFactory = asyncFactory;
  3264. this.asyncMeta = undefined;
  3265. this.isAsyncPlaceholder = false;
  3266. };
  3267. var prototypeAccessors = { child: { configurable: true } };
  3268. // DEPRECATED: alias for componentInstance for backwards compat.
  3269. /* istanbul ignore next */
  3270. prototypeAccessors.child.get = function () {
  3271. return this.componentInstance
  3272. };
  3273. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3274. var createEmptyVNode = function (text) {
  3275. if ( text === void 0 ) text = '';
  3276. var node = new VNode();
  3277. node.text = text;
  3278. node.isComment = true;
  3279. return node
  3280. };
  3281. function createTextVNode (val) {
  3282. return new VNode(undefined, undefined, undefined, String(val))
  3283. }
  3284. // optimized shallow clone
  3285. // used for static nodes and slot nodes because they may be reused across
  3286. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3287. // on their elm reference.
  3288. function cloneVNode (vnode) {
  3289. var cloned = new VNode(
  3290. vnode.tag,
  3291. vnode.data,
  3292. // #7975
  3293. // clone children array to avoid mutating original in case of cloning
  3294. // a child.
  3295. vnode.children && vnode.children.slice(),
  3296. vnode.text,
  3297. vnode.elm,
  3298. vnode.context,
  3299. vnode.componentOptions,
  3300. vnode.asyncFactory
  3301. );
  3302. cloned.ns = vnode.ns;
  3303. cloned.isStatic = vnode.isStatic;
  3304. cloned.key = vnode.key;
  3305. cloned.isComment = vnode.isComment;
  3306. cloned.fnContext = vnode.fnContext;
  3307. cloned.fnOptions = vnode.fnOptions;
  3308. cloned.fnScopeId = vnode.fnScopeId;
  3309. cloned.asyncMeta = vnode.asyncMeta;
  3310. cloned.isCloned = true;
  3311. return cloned
  3312. }
  3313. /*
  3314. * not type checking this file because flow doesn't play well with
  3315. * dynamically accessing methods on Array prototype
  3316. */
  3317. var arrayProto = Array.prototype;
  3318. var arrayMethods = Object.create(arrayProto);
  3319. var methodsToPatch = [
  3320. 'push',
  3321. 'pop',
  3322. 'shift',
  3323. 'unshift',
  3324. 'splice',
  3325. 'sort',
  3326. 'reverse'
  3327. ];
  3328. /**
  3329. * Intercept mutating methods and emit events
  3330. */
  3331. methodsToPatch.forEach(function (method) {
  3332. // cache original method
  3333. var original = arrayProto[method];
  3334. def(arrayMethods, method, function mutator () {
  3335. var args = [], len = arguments.length;
  3336. while ( len-- ) args[ len ] = arguments[ len ];
  3337. var result = original.apply(this, args);
  3338. var ob = this.__ob__;
  3339. var inserted;
  3340. switch (method) {
  3341. case 'push':
  3342. case 'unshift':
  3343. inserted = args;
  3344. break
  3345. case 'splice':
  3346. inserted = args.slice(2);
  3347. break
  3348. }
  3349. if (inserted) { ob.observeArray(inserted); }
  3350. // notify change
  3351. ob.dep.notify();
  3352. return result
  3353. });
  3354. });
  3355. /* */
  3356. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3357. /**
  3358. * In some cases we may want to disable observation inside a component's
  3359. * update computation.
  3360. */
  3361. var shouldObserve = true;
  3362. function toggleObserving (value) {
  3363. shouldObserve = value;
  3364. }
  3365. /**
  3366. * Observer class that is attached to each observed
  3367. * object. Once attached, the observer converts the target
  3368. * object's property keys into getter/setters that
  3369. * collect dependencies and dispatch updates.
  3370. */
  3371. var Observer = function Observer (value) {
  3372. this.value = value;
  3373. this.dep = new Dep();
  3374. this.vmCount = 0;
  3375. def(value, '__ob__', this);
  3376. if (Array.isArray(value)) {
  3377. if (hasProto) {
  3378. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3379. if(value.push !== value.__proto__.push){
  3380. copyAugment(value, arrayMethods, arrayKeys);
  3381. } else {
  3382. protoAugment(value, arrayMethods);
  3383. }
  3384. }
  3385. } else {
  3386. copyAugment(value, arrayMethods, arrayKeys);
  3387. }
  3388. this.observeArray(value);
  3389. } else {
  3390. this.walk(value);
  3391. }
  3392. };
  3393. /**
  3394. * Walk through all properties and convert them into
  3395. * getter/setters. This method should only be called when
  3396. * value type is Object.
  3397. */
  3398. Observer.prototype.walk = function walk (obj) {
  3399. var keys = Object.keys(obj);
  3400. for (var i = 0; i < keys.length; i++) {
  3401. defineReactive$$1(obj, keys[i]);
  3402. }
  3403. };
  3404. /**
  3405. * Observe a list of Array items.
  3406. */
  3407. Observer.prototype.observeArray = function observeArray (items) {
  3408. for (var i = 0, l = items.length; i < l; i++) {
  3409. observe(items[i]);
  3410. }
  3411. };
  3412. // helpers
  3413. /**
  3414. * Augment a target Object or Array by intercepting
  3415. * the prototype chain using __proto__
  3416. */
  3417. function protoAugment (target, src) {
  3418. /* eslint-disable no-proto */
  3419. target.__proto__ = src;
  3420. /* eslint-enable no-proto */
  3421. }
  3422. /**
  3423. * Augment a target Object or Array by defining
  3424. * hidden properties.
  3425. */
  3426. /* istanbul ignore next */
  3427. function copyAugment (target, src, keys) {
  3428. for (var i = 0, l = keys.length; i < l; i++) {
  3429. var key = keys[i];
  3430. def(target, key, src[key]);
  3431. }
  3432. }
  3433. /**
  3434. * Attempt to create an observer instance for a value,
  3435. * returns the new observer if successfully observed,
  3436. * or the existing observer if the value already has one.
  3437. */
  3438. function observe (value, asRootData) {
  3439. if (!isObject(value) || value instanceof VNode) {
  3440. return
  3441. }
  3442. var ob;
  3443. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3444. ob = value.__ob__;
  3445. } else if (
  3446. shouldObserve &&
  3447. !isServerRendering() &&
  3448. (Array.isArray(value) || isPlainObject(value)) &&
  3449. Object.isExtensible(value) &&
  3450. !value._isVue
  3451. ) {
  3452. ob = new Observer(value);
  3453. }
  3454. if (asRootData && ob) {
  3455. ob.vmCount++;
  3456. }
  3457. return ob
  3458. }
  3459. /**
  3460. * Define a reactive property on an Object.
  3461. */
  3462. function defineReactive$$1 (
  3463. obj,
  3464. key,
  3465. val,
  3466. customSetter,
  3467. shallow
  3468. ) {
  3469. var dep = new Dep();
  3470. var property = Object.getOwnPropertyDescriptor(obj, key);
  3471. if (property && property.configurable === false) {
  3472. return
  3473. }
  3474. // cater for pre-defined getter/setters
  3475. var getter = property && property.get;
  3476. var setter = property && property.set;
  3477. if ((!getter || setter) && arguments.length === 2) {
  3478. val = obj[key];
  3479. }
  3480. var childOb = !shallow && observe(val);
  3481. Object.defineProperty(obj, key, {
  3482. enumerable: true,
  3483. configurable: true,
  3484. get: function reactiveGetter () {
  3485. var value = getter ? getter.call(obj) : val;
  3486. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3487. dep.depend();
  3488. if (childOb) {
  3489. childOb.dep.depend();
  3490. if (Array.isArray(value)) {
  3491. dependArray(value);
  3492. }
  3493. }
  3494. }
  3495. return value
  3496. },
  3497. set: function reactiveSetter (newVal) {
  3498. var value = getter ? getter.call(obj) : val;
  3499. /* eslint-disable no-self-compare */
  3500. if (newVal === value || (newVal !== newVal && value !== value)) {
  3501. return
  3502. }
  3503. /* eslint-enable no-self-compare */
  3504. if ( true && customSetter) {
  3505. customSetter();
  3506. }
  3507. // #7981: for accessor properties without setter
  3508. if (getter && !setter) { return }
  3509. if (setter) {
  3510. setter.call(obj, newVal);
  3511. } else {
  3512. val = newVal;
  3513. }
  3514. childOb = !shallow && observe(newVal);
  3515. dep.notify();
  3516. }
  3517. });
  3518. }
  3519. /**
  3520. * Set a property on an object. Adds the new property and
  3521. * triggers change notification if the property doesn't
  3522. * already exist.
  3523. */
  3524. function set (target, key, val) {
  3525. if ( true &&
  3526. (isUndef(target) || isPrimitive(target))
  3527. ) {
  3528. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3529. }
  3530. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3531. target.length = Math.max(target.length, key);
  3532. target.splice(key, 1, val);
  3533. return val
  3534. }
  3535. if (key in target && !(key in Object.prototype)) {
  3536. target[key] = val;
  3537. return val
  3538. }
  3539. var ob = (target).__ob__;
  3540. if (target._isVue || (ob && ob.vmCount)) {
  3541. true && warn(
  3542. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3543. 'at runtime - declare it upfront in the data option.'
  3544. );
  3545. return val
  3546. }
  3547. if (!ob) {
  3548. target[key] = val;
  3549. return val
  3550. }
  3551. defineReactive$$1(ob.value, key, val);
  3552. ob.dep.notify();
  3553. return val
  3554. }
  3555. /**
  3556. * Delete a property and trigger change if necessary.
  3557. */
  3558. function del (target, key) {
  3559. if ( true &&
  3560. (isUndef(target) || isPrimitive(target))
  3561. ) {
  3562. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3563. }
  3564. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3565. target.splice(key, 1);
  3566. return
  3567. }
  3568. var ob = (target).__ob__;
  3569. if (target._isVue || (ob && ob.vmCount)) {
  3570. true && warn(
  3571. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3572. '- just set it to null.'
  3573. );
  3574. return
  3575. }
  3576. if (!hasOwn(target, key)) {
  3577. return
  3578. }
  3579. delete target[key];
  3580. if (!ob) {
  3581. return
  3582. }
  3583. ob.dep.notify();
  3584. }
  3585. /**
  3586. * Collect dependencies on array elements when the array is touched, since
  3587. * we cannot intercept array element access like property getters.
  3588. */
  3589. function dependArray (value) {
  3590. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3591. e = value[i];
  3592. e && e.__ob__ && e.__ob__.dep.depend();
  3593. if (Array.isArray(e)) {
  3594. dependArray(e);
  3595. }
  3596. }
  3597. }
  3598. /* */
  3599. /**
  3600. * Option overwriting strategies are functions that handle
  3601. * how to merge a parent option value and a child option
  3602. * value into the final value.
  3603. */
  3604. var strats = config.optionMergeStrategies;
  3605. /**
  3606. * Options with restrictions
  3607. */
  3608. if (true) {
  3609. strats.el = strats.propsData = function (parent, child, vm, key) {
  3610. if (!vm) {
  3611. warn(
  3612. "option \"" + key + "\" can only be used during instance " +
  3613. 'creation with the `new` keyword.'
  3614. );
  3615. }
  3616. return defaultStrat(parent, child)
  3617. };
  3618. }
  3619. /**
  3620. * Helper that recursively merges two data objects together.
  3621. */
  3622. function mergeData (to, from) {
  3623. if (!from) { return to }
  3624. var key, toVal, fromVal;
  3625. var keys = hasSymbol
  3626. ? Reflect.ownKeys(from)
  3627. : Object.keys(from);
  3628. for (var i = 0; i < keys.length; i++) {
  3629. key = keys[i];
  3630. // in case the object is already observed...
  3631. if (key === '__ob__') { continue }
  3632. toVal = to[key];
  3633. fromVal = from[key];
  3634. if (!hasOwn(to, key)) {
  3635. set(to, key, fromVal);
  3636. } else if (
  3637. toVal !== fromVal &&
  3638. isPlainObject(toVal) &&
  3639. isPlainObject(fromVal)
  3640. ) {
  3641. mergeData(toVal, fromVal);
  3642. }
  3643. }
  3644. return to
  3645. }
  3646. /**
  3647. * Data
  3648. */
  3649. function mergeDataOrFn (
  3650. parentVal,
  3651. childVal,
  3652. vm
  3653. ) {
  3654. if (!vm) {
  3655. // in a Vue.extend merge, both should be functions
  3656. if (!childVal) {
  3657. return parentVal
  3658. }
  3659. if (!parentVal) {
  3660. return childVal
  3661. }
  3662. // when parentVal & childVal are both present,
  3663. // we need to return a function that returns the
  3664. // merged result of both functions... no need to
  3665. // check if parentVal is a function here because
  3666. // it has to be a function to pass previous merges.
  3667. return function mergedDataFn () {
  3668. return mergeData(
  3669. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3670. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3671. )
  3672. }
  3673. } else {
  3674. return function mergedInstanceDataFn () {
  3675. // instance merge
  3676. var instanceData = typeof childVal === 'function'
  3677. ? childVal.call(vm, vm)
  3678. : childVal;
  3679. var defaultData = typeof parentVal === 'function'
  3680. ? parentVal.call(vm, vm)
  3681. : parentVal;
  3682. if (instanceData) {
  3683. return mergeData(instanceData, defaultData)
  3684. } else {
  3685. return defaultData
  3686. }
  3687. }
  3688. }
  3689. }
  3690. strats.data = function (
  3691. parentVal,
  3692. childVal,
  3693. vm
  3694. ) {
  3695. if (!vm) {
  3696. if (childVal && typeof childVal !== 'function') {
  3697. true && warn(
  3698. 'The "data" option should be a function ' +
  3699. 'that returns a per-instance value in component ' +
  3700. 'definitions.',
  3701. vm
  3702. );
  3703. return parentVal
  3704. }
  3705. return mergeDataOrFn(parentVal, childVal)
  3706. }
  3707. return mergeDataOrFn(parentVal, childVal, vm)
  3708. };
  3709. /**
  3710. * Hooks and props are merged as arrays.
  3711. */
  3712. function mergeHook (
  3713. parentVal,
  3714. childVal
  3715. ) {
  3716. var res = childVal
  3717. ? parentVal
  3718. ? parentVal.concat(childVal)
  3719. : Array.isArray(childVal)
  3720. ? childVal
  3721. : [childVal]
  3722. : parentVal;
  3723. return res
  3724. ? dedupeHooks(res)
  3725. : res
  3726. }
  3727. function dedupeHooks (hooks) {
  3728. var res = [];
  3729. for (var i = 0; i < hooks.length; i++) {
  3730. if (res.indexOf(hooks[i]) === -1) {
  3731. res.push(hooks[i]);
  3732. }
  3733. }
  3734. return res
  3735. }
  3736. LIFECYCLE_HOOKS.forEach(function (hook) {
  3737. strats[hook] = mergeHook;
  3738. });
  3739. /**
  3740. * Assets
  3741. *
  3742. * When a vm is present (instance creation), we need to do
  3743. * a three-way merge between constructor options, instance
  3744. * options and parent options.
  3745. */
  3746. function mergeAssets (
  3747. parentVal,
  3748. childVal,
  3749. vm,
  3750. key
  3751. ) {
  3752. var res = Object.create(parentVal || null);
  3753. if (childVal) {
  3754. true && assertObjectType(key, childVal, vm);
  3755. return extend(res, childVal)
  3756. } else {
  3757. return res
  3758. }
  3759. }
  3760. ASSET_TYPES.forEach(function (type) {
  3761. strats[type + 's'] = mergeAssets;
  3762. });
  3763. /**
  3764. * Watchers.
  3765. *
  3766. * Watchers hashes should not overwrite one
  3767. * another, so we merge them as arrays.
  3768. */
  3769. strats.watch = function (
  3770. parentVal,
  3771. childVal,
  3772. vm,
  3773. key
  3774. ) {
  3775. // work around Firefox's Object.prototype.watch...
  3776. if (parentVal === nativeWatch) { parentVal = undefined; }
  3777. if (childVal === nativeWatch) { childVal = undefined; }
  3778. /* istanbul ignore if */
  3779. if (!childVal) { return Object.create(parentVal || null) }
  3780. if (true) {
  3781. assertObjectType(key, childVal, vm);
  3782. }
  3783. if (!parentVal) { return childVal }
  3784. var ret = {};
  3785. extend(ret, parentVal);
  3786. for (var key$1 in childVal) {
  3787. var parent = ret[key$1];
  3788. var child = childVal[key$1];
  3789. if (parent && !Array.isArray(parent)) {
  3790. parent = [parent];
  3791. }
  3792. ret[key$1] = parent
  3793. ? parent.concat(child)
  3794. : Array.isArray(child) ? child : [child];
  3795. }
  3796. return ret
  3797. };
  3798. /**
  3799. * Other object hashes.
  3800. */
  3801. strats.props =
  3802. strats.methods =
  3803. strats.inject =
  3804. strats.computed = function (
  3805. parentVal,
  3806. childVal,
  3807. vm,
  3808. key
  3809. ) {
  3810. if (childVal && "development" !== 'production') {
  3811. assertObjectType(key, childVal, vm);
  3812. }
  3813. if (!parentVal) { return childVal }
  3814. var ret = Object.create(null);
  3815. extend(ret, parentVal);
  3816. if (childVal) { extend(ret, childVal); }
  3817. return ret
  3818. };
  3819. strats.provide = mergeDataOrFn;
  3820. /**
  3821. * Default strategy.
  3822. */
  3823. var defaultStrat = function (parentVal, childVal) {
  3824. return childVal === undefined
  3825. ? parentVal
  3826. : childVal
  3827. };
  3828. /**
  3829. * Validate component names
  3830. */
  3831. function checkComponents (options) {
  3832. for (var key in options.components) {
  3833. validateComponentName(key);
  3834. }
  3835. }
  3836. function validateComponentName (name) {
  3837. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3838. warn(
  3839. 'Invalid component name: "' + name + '". Component names ' +
  3840. 'should conform to valid custom element name in html5 specification.'
  3841. );
  3842. }
  3843. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3844. warn(
  3845. 'Do not use built-in or reserved HTML elements as component ' +
  3846. 'id: ' + name
  3847. );
  3848. }
  3849. }
  3850. /**
  3851. * Ensure all props option syntax are normalized into the
  3852. * Object-based format.
  3853. */
  3854. function normalizeProps (options, vm) {
  3855. var props = options.props;
  3856. if (!props) { return }
  3857. var res = {};
  3858. var i, val, name;
  3859. if (Array.isArray(props)) {
  3860. i = props.length;
  3861. while (i--) {
  3862. val = props[i];
  3863. if (typeof val === 'string') {
  3864. name = camelize(val);
  3865. res[name] = { type: null };
  3866. } else if (true) {
  3867. warn('props must be strings when using array syntax.');
  3868. }
  3869. }
  3870. } else if (isPlainObject(props)) {
  3871. for (var key in props) {
  3872. val = props[key];
  3873. name = camelize(key);
  3874. res[name] = isPlainObject(val)
  3875. ? val
  3876. : { type: val };
  3877. }
  3878. } else if (true) {
  3879. warn(
  3880. "Invalid value for option \"props\": expected an Array or an Object, " +
  3881. "but got " + (toRawType(props)) + ".",
  3882. vm
  3883. );
  3884. }
  3885. options.props = res;
  3886. }
  3887. /**
  3888. * Normalize all injections into Object-based format
  3889. */
  3890. function normalizeInject (options, vm) {
  3891. var inject = options.inject;
  3892. if (!inject) { return }
  3893. var normalized = options.inject = {};
  3894. if (Array.isArray(inject)) {
  3895. for (var i = 0; i < inject.length; i++) {
  3896. normalized[inject[i]] = { from: inject[i] };
  3897. }
  3898. } else if (isPlainObject(inject)) {
  3899. for (var key in inject) {
  3900. var val = inject[key];
  3901. normalized[key] = isPlainObject(val)
  3902. ? extend({ from: key }, val)
  3903. : { from: val };
  3904. }
  3905. } else if (true) {
  3906. warn(
  3907. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3908. "but got " + (toRawType(inject)) + ".",
  3909. vm
  3910. );
  3911. }
  3912. }
  3913. /**
  3914. * Normalize raw function directives into object format.
  3915. */
  3916. function normalizeDirectives (options) {
  3917. var dirs = options.directives;
  3918. if (dirs) {
  3919. for (var key in dirs) {
  3920. var def$$1 = dirs[key];
  3921. if (typeof def$$1 === 'function') {
  3922. dirs[key] = { bind: def$$1, update: def$$1 };
  3923. }
  3924. }
  3925. }
  3926. }
  3927. function assertObjectType (name, value, vm) {
  3928. if (!isPlainObject(value)) {
  3929. warn(
  3930. "Invalid value for option \"" + name + "\": expected an Object, " +
  3931. "but got " + (toRawType(value)) + ".",
  3932. vm
  3933. );
  3934. }
  3935. }
  3936. /**
  3937. * Merge two option objects into a new one.
  3938. * Core utility used in both instantiation and inheritance.
  3939. */
  3940. function mergeOptions (
  3941. parent,
  3942. child,
  3943. vm
  3944. ) {
  3945. if (true) {
  3946. checkComponents(child);
  3947. }
  3948. if (typeof child === 'function') {
  3949. child = child.options;
  3950. }
  3951. normalizeProps(child, vm);
  3952. normalizeInject(child, vm);
  3953. normalizeDirectives(child);
  3954. // Apply extends and mixins on the child options,
  3955. // but only if it is a raw options object that isn't
  3956. // the result of another mergeOptions call.
  3957. // Only merged options has the _base property.
  3958. if (!child._base) {
  3959. if (child.extends) {
  3960. parent = mergeOptions(parent, child.extends, vm);
  3961. }
  3962. if (child.mixins) {
  3963. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3964. parent = mergeOptions(parent, child.mixins[i], vm);
  3965. }
  3966. }
  3967. }
  3968. var options = {};
  3969. var key;
  3970. for (key in parent) {
  3971. mergeField(key);
  3972. }
  3973. for (key in child) {
  3974. if (!hasOwn(parent, key)) {
  3975. mergeField(key);
  3976. }
  3977. }
  3978. function mergeField (key) {
  3979. var strat = strats[key] || defaultStrat;
  3980. options[key] = strat(parent[key], child[key], vm, key);
  3981. }
  3982. return options
  3983. }
  3984. /**
  3985. * Resolve an asset.
  3986. * This function is used because child instances need access
  3987. * to assets defined in its ancestor chain.
  3988. */
  3989. function resolveAsset (
  3990. options,
  3991. type,
  3992. id,
  3993. warnMissing
  3994. ) {
  3995. /* istanbul ignore if */
  3996. if (typeof id !== 'string') {
  3997. return
  3998. }
  3999. var assets = options[type];
  4000. // check local registration variations first
  4001. if (hasOwn(assets, id)) { return assets[id] }
  4002. var camelizedId = camelize(id);
  4003. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4004. var PascalCaseId = capitalize(camelizedId);
  4005. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4006. // fallback to prototype chain
  4007. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4008. if ( true && warnMissing && !res) {
  4009. warn(
  4010. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4011. options
  4012. );
  4013. }
  4014. return res
  4015. }
  4016. /* */
  4017. function validateProp (
  4018. key,
  4019. propOptions,
  4020. propsData,
  4021. vm
  4022. ) {
  4023. var prop = propOptions[key];
  4024. var absent = !hasOwn(propsData, key);
  4025. var value = propsData[key];
  4026. // boolean casting
  4027. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4028. if (booleanIndex > -1) {
  4029. if (absent && !hasOwn(prop, 'default')) {
  4030. value = false;
  4031. } else if (value === '' || value === hyphenate(key)) {
  4032. // only cast empty string / same name to boolean if
  4033. // boolean has higher priority
  4034. var stringIndex = getTypeIndex(String, prop.type);
  4035. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4036. value = true;
  4037. }
  4038. }
  4039. }
  4040. // check default value
  4041. if (value === undefined) {
  4042. value = getPropDefaultValue(vm, prop, key);
  4043. // since the default value is a fresh copy,
  4044. // make sure to observe it.
  4045. var prevShouldObserve = shouldObserve;
  4046. toggleObserving(true);
  4047. observe(value);
  4048. toggleObserving(prevShouldObserve);
  4049. }
  4050. if (
  4051. true
  4052. ) {
  4053. assertProp(prop, key, value, vm, absent);
  4054. }
  4055. return value
  4056. }
  4057. /**
  4058. * Get the default value of a prop.
  4059. */
  4060. function getPropDefaultValue (vm, prop, key) {
  4061. // no default, return undefined
  4062. if (!hasOwn(prop, 'default')) {
  4063. return undefined
  4064. }
  4065. var def = prop.default;
  4066. // warn against non-factory defaults for Object & Array
  4067. if ( true && isObject(def)) {
  4068. warn(
  4069. 'Invalid default value for prop "' + key + '": ' +
  4070. 'Props with type Object/Array must use a factory function ' +
  4071. 'to return the default value.',
  4072. vm
  4073. );
  4074. }
  4075. // the raw prop value was also undefined from previous render,
  4076. // return previous default value to avoid unnecessary watcher trigger
  4077. if (vm && vm.$options.propsData &&
  4078. vm.$options.propsData[key] === undefined &&
  4079. vm._props[key] !== undefined
  4080. ) {
  4081. return vm._props[key]
  4082. }
  4083. // call factory function for non-Function types
  4084. // a value is Function if its prototype is function even across different execution context
  4085. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4086. ? def.call(vm)
  4087. : def
  4088. }
  4089. /**
  4090. * Assert whether a prop is valid.
  4091. */
  4092. function assertProp (
  4093. prop,
  4094. name,
  4095. value,
  4096. vm,
  4097. absent
  4098. ) {
  4099. if (prop.required && absent) {
  4100. warn(
  4101. 'Missing required prop: "' + name + '"',
  4102. vm
  4103. );
  4104. return
  4105. }
  4106. if (value == null && !prop.required) {
  4107. return
  4108. }
  4109. var type = prop.type;
  4110. var valid = !type || type === true;
  4111. var expectedTypes = [];
  4112. if (type) {
  4113. if (!Array.isArray(type)) {
  4114. type = [type];
  4115. }
  4116. for (var i = 0; i < type.length && !valid; i++) {
  4117. var assertedType = assertType(value, type[i]);
  4118. expectedTypes.push(assertedType.expectedType || '');
  4119. valid = assertedType.valid;
  4120. }
  4121. }
  4122. if (!valid) {
  4123. warn(
  4124. getInvalidTypeMessage(name, value, expectedTypes),
  4125. vm
  4126. );
  4127. return
  4128. }
  4129. var validator = prop.validator;
  4130. if (validator) {
  4131. if (!validator(value)) {
  4132. warn(
  4133. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4134. vm
  4135. );
  4136. }
  4137. }
  4138. }
  4139. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4140. function assertType (value, type) {
  4141. var valid;
  4142. var expectedType = getType(type);
  4143. if (simpleCheckRE.test(expectedType)) {
  4144. var t = typeof value;
  4145. valid = t === expectedType.toLowerCase();
  4146. // for primitive wrapper objects
  4147. if (!valid && t === 'object') {
  4148. valid = value instanceof type;
  4149. }
  4150. } else if (expectedType === 'Object') {
  4151. valid = isPlainObject(value);
  4152. } else if (expectedType === 'Array') {
  4153. valid = Array.isArray(value);
  4154. } else {
  4155. valid = value instanceof type;
  4156. }
  4157. return {
  4158. valid: valid,
  4159. expectedType: expectedType
  4160. }
  4161. }
  4162. /**
  4163. * Use function string name to check built-in types,
  4164. * because a simple equality check will fail when running
  4165. * across different vms / iframes.
  4166. */
  4167. function getType (fn) {
  4168. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4169. return match ? match[1] : ''
  4170. }
  4171. function isSameType (a, b) {
  4172. return getType(a) === getType(b)
  4173. }
  4174. function getTypeIndex (type, expectedTypes) {
  4175. if (!Array.isArray(expectedTypes)) {
  4176. return isSameType(expectedTypes, type) ? 0 : -1
  4177. }
  4178. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4179. if (isSameType(expectedTypes[i], type)) {
  4180. return i
  4181. }
  4182. }
  4183. return -1
  4184. }
  4185. function getInvalidTypeMessage (name, value, expectedTypes) {
  4186. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4187. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4188. var expectedType = expectedTypes[0];
  4189. var receivedType = toRawType(value);
  4190. var expectedValue = styleValue(value, expectedType);
  4191. var receivedValue = styleValue(value, receivedType);
  4192. // check if we need to specify expected value
  4193. if (expectedTypes.length === 1 &&
  4194. isExplicable(expectedType) &&
  4195. !isBoolean(expectedType, receivedType)) {
  4196. message += " with value " + expectedValue;
  4197. }
  4198. message += ", got " + receivedType + " ";
  4199. // check if we need to specify received value
  4200. if (isExplicable(receivedType)) {
  4201. message += "with value " + receivedValue + ".";
  4202. }
  4203. return message
  4204. }
  4205. function styleValue (value, type) {
  4206. if (type === 'String') {
  4207. return ("\"" + value + "\"")
  4208. } else if (type === 'Number') {
  4209. return ("" + (Number(value)))
  4210. } else {
  4211. return ("" + value)
  4212. }
  4213. }
  4214. function isExplicable (value) {
  4215. var explicitTypes = ['string', 'number', 'boolean'];
  4216. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4217. }
  4218. function isBoolean () {
  4219. var args = [], len = arguments.length;
  4220. while ( len-- ) args[ len ] = arguments[ len ];
  4221. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4222. }
  4223. /* */
  4224. function handleError (err, vm, info) {
  4225. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4226. // See: https://github.com/vuejs/vuex/issues/1505
  4227. pushTarget();
  4228. try {
  4229. if (vm) {
  4230. var cur = vm;
  4231. while ((cur = cur.$parent)) {
  4232. var hooks = cur.$options.errorCaptured;
  4233. if (hooks) {
  4234. for (var i = 0; i < hooks.length; i++) {
  4235. try {
  4236. var capture = hooks[i].call(cur, err, vm, info) === false;
  4237. if (capture) { return }
  4238. } catch (e) {
  4239. globalHandleError(e, cur, 'errorCaptured hook');
  4240. }
  4241. }
  4242. }
  4243. }
  4244. }
  4245. globalHandleError(err, vm, info);
  4246. } finally {
  4247. popTarget();
  4248. }
  4249. }
  4250. function invokeWithErrorHandling (
  4251. handler,
  4252. context,
  4253. args,
  4254. vm,
  4255. info
  4256. ) {
  4257. var res;
  4258. try {
  4259. res = args ? handler.apply(context, args) : handler.call(context);
  4260. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4261. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4262. // issue #9511
  4263. // avoid catch triggering multiple times when nested calls
  4264. res._handled = true;
  4265. }
  4266. } catch (e) {
  4267. handleError(e, vm, info);
  4268. }
  4269. return res
  4270. }
  4271. function globalHandleError (err, vm, info) {
  4272. if (config.errorHandler) {
  4273. try {
  4274. return config.errorHandler.call(null, err, vm, info)
  4275. } catch (e) {
  4276. // if the user intentionally throws the original error in the handler,
  4277. // do not log it twice
  4278. if (e !== err) {
  4279. logError(e, null, 'config.errorHandler');
  4280. }
  4281. }
  4282. }
  4283. logError(err, vm, info);
  4284. }
  4285. function logError (err, vm, info) {
  4286. if (true) {
  4287. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4288. }
  4289. /* istanbul ignore else */
  4290. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4291. console.error(err);
  4292. } else {
  4293. throw err
  4294. }
  4295. }
  4296. /* */
  4297. var callbacks = [];
  4298. var pending = false;
  4299. function flushCallbacks () {
  4300. pending = false;
  4301. var copies = callbacks.slice(0);
  4302. callbacks.length = 0;
  4303. for (var i = 0; i < copies.length; i++) {
  4304. copies[i]();
  4305. }
  4306. }
  4307. // Here we have async deferring wrappers using microtasks.
  4308. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4309. // However, it has subtle problems when state is changed right before repaint
  4310. // (e.g. #6813, out-in transitions).
  4311. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4312. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4313. // So we now use microtasks everywhere, again.
  4314. // A major drawback of this tradeoff is that there are some scenarios
  4315. // where microtasks have too high a priority and fire in between supposedly
  4316. // sequential events (e.g. #4521, #6690, which have workarounds)
  4317. // or even between bubbling of the same event (#6566).
  4318. var timerFunc;
  4319. // The nextTick behavior leverages the microtask queue, which can be accessed
  4320. // via either native Promise.then or MutationObserver.
  4321. // MutationObserver has wider support, however it is seriously bugged in
  4322. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4323. // completely stops working after triggering a few times... so, if native
  4324. // Promise is available, we will use it:
  4325. /* istanbul ignore next, $flow-disable-line */
  4326. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4327. var p = Promise.resolve();
  4328. timerFunc = function () {
  4329. p.then(flushCallbacks);
  4330. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4331. // it can get stuck in a weird state where callbacks are pushed into the
  4332. // microtask queue but the queue isn't being flushed, until the browser
  4333. // needs to do some other work, e.g. handle a timer. Therefore we can
  4334. // "force" the microtask queue to be flushed by adding an empty timer.
  4335. if (isIOS) { setTimeout(noop); }
  4336. };
  4337. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4338. isNative(MutationObserver) ||
  4339. // PhantomJS and iOS 7.x
  4340. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4341. )) {
  4342. // Use MutationObserver where native Promise is not available,
  4343. // e.g. PhantomJS, iOS7, Android 4.4
  4344. // (#6466 MutationObserver is unreliable in IE11)
  4345. var counter = 1;
  4346. var observer = new MutationObserver(flushCallbacks);
  4347. var textNode = document.createTextNode(String(counter));
  4348. observer.observe(textNode, {
  4349. characterData: true
  4350. });
  4351. timerFunc = function () {
  4352. counter = (counter + 1) % 2;
  4353. textNode.data = String(counter);
  4354. };
  4355. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4356. // Fallback to setImmediate.
  4357. // Technically it leverages the (macro) task queue,
  4358. // but it is still a better choice than setTimeout.
  4359. timerFunc = function () {
  4360. setImmediate(flushCallbacks);
  4361. };
  4362. } else {
  4363. // Fallback to setTimeout.
  4364. timerFunc = function () {
  4365. setTimeout(flushCallbacks, 0);
  4366. };
  4367. }
  4368. function nextTick (cb, ctx) {
  4369. var _resolve;
  4370. callbacks.push(function () {
  4371. if (cb) {
  4372. try {
  4373. cb.call(ctx);
  4374. } catch (e) {
  4375. handleError(e, ctx, 'nextTick');
  4376. }
  4377. } else if (_resolve) {
  4378. _resolve(ctx);
  4379. }
  4380. });
  4381. if (!pending) {
  4382. pending = true;
  4383. timerFunc();
  4384. }
  4385. // $flow-disable-line
  4386. if (!cb && typeof Promise !== 'undefined') {
  4387. return new Promise(function (resolve) {
  4388. _resolve = resolve;
  4389. })
  4390. }
  4391. }
  4392. /* */
  4393. /* not type checking this file because flow doesn't play well with Proxy */
  4394. var initProxy;
  4395. if (true) {
  4396. var allowedGlobals = makeMap(
  4397. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4398. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4399. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4400. 'require' // for Webpack/Browserify
  4401. );
  4402. var warnNonPresent = function (target, key) {
  4403. warn(
  4404. "Property or method \"" + key + "\" is not defined on the instance but " +
  4405. 'referenced during render. Make sure that this property is reactive, ' +
  4406. 'either in the data option, or for class-based components, by ' +
  4407. 'initializing the property. ' +
  4408. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4409. target
  4410. );
  4411. };
  4412. var warnReservedPrefix = function (target, key) {
  4413. warn(
  4414. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4415. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4416. 'prevent conflicts with Vue internals. ' +
  4417. 'See: https://vuejs.org/v2/api/#data',
  4418. target
  4419. );
  4420. };
  4421. var hasProxy =
  4422. typeof Proxy !== 'undefined' && isNative(Proxy);
  4423. if (hasProxy) {
  4424. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4425. config.keyCodes = new Proxy(config.keyCodes, {
  4426. set: function set (target, key, value) {
  4427. if (isBuiltInModifier(key)) {
  4428. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4429. return false
  4430. } else {
  4431. target[key] = value;
  4432. return true
  4433. }
  4434. }
  4435. });
  4436. }
  4437. var hasHandler = {
  4438. has: function has (target, key) {
  4439. var has = key in target;
  4440. var isAllowed = allowedGlobals(key) ||
  4441. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4442. if (!has && !isAllowed) {
  4443. if (key in target.$data) { warnReservedPrefix(target, key); }
  4444. else { warnNonPresent(target, key); }
  4445. }
  4446. return has || !isAllowed
  4447. }
  4448. };
  4449. var getHandler = {
  4450. get: function get (target, key) {
  4451. if (typeof key === 'string' && !(key in target)) {
  4452. if (key in target.$data) { warnReservedPrefix(target, key); }
  4453. else { warnNonPresent(target, key); }
  4454. }
  4455. return target[key]
  4456. }
  4457. };
  4458. initProxy = function initProxy (vm) {
  4459. if (hasProxy) {
  4460. // determine which proxy handler to use
  4461. var options = vm.$options;
  4462. var handlers = options.render && options.render._withStripped
  4463. ? getHandler
  4464. : hasHandler;
  4465. vm._renderProxy = new Proxy(vm, handlers);
  4466. } else {
  4467. vm._renderProxy = vm;
  4468. }
  4469. };
  4470. }
  4471. /* */
  4472. var seenObjects = new _Set();
  4473. /**
  4474. * Recursively traverse an object to evoke all converted
  4475. * getters, so that every nested property inside the object
  4476. * is collected as a "deep" dependency.
  4477. */
  4478. function traverse (val) {
  4479. _traverse(val, seenObjects);
  4480. seenObjects.clear();
  4481. }
  4482. function _traverse (val, seen) {
  4483. var i, keys;
  4484. var isA = Array.isArray(val);
  4485. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4486. return
  4487. }
  4488. if (val.__ob__) {
  4489. var depId = val.__ob__.dep.id;
  4490. if (seen.has(depId)) {
  4491. return
  4492. }
  4493. seen.add(depId);
  4494. }
  4495. if (isA) {
  4496. i = val.length;
  4497. while (i--) { _traverse(val[i], seen); }
  4498. } else {
  4499. keys = Object.keys(val);
  4500. i = keys.length;
  4501. while (i--) { _traverse(val[keys[i]], seen); }
  4502. }
  4503. }
  4504. var mark;
  4505. var measure;
  4506. if (true) {
  4507. var perf = inBrowser && window.performance;
  4508. /* istanbul ignore if */
  4509. if (
  4510. perf &&
  4511. perf.mark &&
  4512. perf.measure &&
  4513. perf.clearMarks &&
  4514. perf.clearMeasures
  4515. ) {
  4516. mark = function (tag) { return perf.mark(tag); };
  4517. measure = function (name, startTag, endTag) {
  4518. perf.measure(name, startTag, endTag);
  4519. perf.clearMarks(startTag);
  4520. perf.clearMarks(endTag);
  4521. // perf.clearMeasures(name)
  4522. };
  4523. }
  4524. }
  4525. /* */
  4526. var normalizeEvent = cached(function (name) {
  4527. var passive = name.charAt(0) === '&';
  4528. name = passive ? name.slice(1) : name;
  4529. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4530. name = once$$1 ? name.slice(1) : name;
  4531. var capture = name.charAt(0) === '!';
  4532. name = capture ? name.slice(1) : name;
  4533. return {
  4534. name: name,
  4535. once: once$$1,
  4536. capture: capture,
  4537. passive: passive
  4538. }
  4539. });
  4540. function createFnInvoker (fns, vm) {
  4541. function invoker () {
  4542. var arguments$1 = arguments;
  4543. var fns = invoker.fns;
  4544. if (Array.isArray(fns)) {
  4545. var cloned = fns.slice();
  4546. for (var i = 0; i < cloned.length; i++) {
  4547. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4548. }
  4549. } else {
  4550. // return handler return value for single handlers
  4551. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4552. }
  4553. }
  4554. invoker.fns = fns;
  4555. return invoker
  4556. }
  4557. function updateListeners (
  4558. on,
  4559. oldOn,
  4560. add,
  4561. remove$$1,
  4562. createOnceHandler,
  4563. vm
  4564. ) {
  4565. var name, def$$1, cur, old, event;
  4566. for (name in on) {
  4567. def$$1 = cur = on[name];
  4568. old = oldOn[name];
  4569. event = normalizeEvent(name);
  4570. if (isUndef(cur)) {
  4571. true && warn(
  4572. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4573. vm
  4574. );
  4575. } else if (isUndef(old)) {
  4576. if (isUndef(cur.fns)) {
  4577. cur = on[name] = createFnInvoker(cur, vm);
  4578. }
  4579. if (isTrue(event.once)) {
  4580. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4581. }
  4582. add(event.name, cur, event.capture, event.passive, event.params);
  4583. } else if (cur !== old) {
  4584. old.fns = cur;
  4585. on[name] = old;
  4586. }
  4587. }
  4588. for (name in oldOn) {
  4589. if (isUndef(on[name])) {
  4590. event = normalizeEvent(name);
  4591. remove$$1(event.name, oldOn[name], event.capture);
  4592. }
  4593. }
  4594. }
  4595. /* */
  4596. /* */
  4597. // fixed by xxxxxx (mp properties)
  4598. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4599. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4600. if (isUndef(propOptions)) {
  4601. return res
  4602. }
  4603. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4604. var attrs = data.attrs;
  4605. var props = data.props;
  4606. if (isDef(attrs) || isDef(props)) {
  4607. for (var key in propOptions) {
  4608. var altKey = hyphenate(key);
  4609. var result = checkProp(res, props, key, altKey, true) ||
  4610. checkProp(res, attrs, key, altKey, false);
  4611. // externalClass
  4612. if (
  4613. result &&
  4614. res[key] &&
  4615. externalClasses.indexOf(altKey) !== -1 &&
  4616. context[camelize(res[key])]
  4617. ) {
  4618. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4619. res[key] = context[camelize(res[key])];
  4620. }
  4621. }
  4622. }
  4623. return res
  4624. }
  4625. function extractPropsFromVNodeData (
  4626. data,
  4627. Ctor,
  4628. tag,
  4629. context// fixed by xxxxxx
  4630. ) {
  4631. // we are only extracting raw values here.
  4632. // validation and default values are handled in the child
  4633. // component itself.
  4634. var propOptions = Ctor.options.props;
  4635. if (isUndef(propOptions)) {
  4636. // fixed by xxxxxx
  4637. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4638. }
  4639. var res = {};
  4640. var attrs = data.attrs;
  4641. var props = data.props;
  4642. if (isDef(attrs) || isDef(props)) {
  4643. for (var key in propOptions) {
  4644. var altKey = hyphenate(key);
  4645. if (true) {
  4646. var keyInLowerCase = key.toLowerCase();
  4647. if (
  4648. key !== keyInLowerCase &&
  4649. attrs && hasOwn(attrs, keyInLowerCase)
  4650. ) {
  4651. tip(
  4652. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4653. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4654. " \"" + key + "\". " +
  4655. "Note that HTML attributes are case-insensitive and camelCased " +
  4656. "props need to use their kebab-case equivalents when using in-DOM " +
  4657. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4658. );
  4659. }
  4660. }
  4661. checkProp(res, props, key, altKey, true) ||
  4662. checkProp(res, attrs, key, altKey, false);
  4663. }
  4664. }
  4665. // fixed by xxxxxx
  4666. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4667. }
  4668. function checkProp (
  4669. res,
  4670. hash,
  4671. key,
  4672. altKey,
  4673. preserve
  4674. ) {
  4675. if (isDef(hash)) {
  4676. if (hasOwn(hash, key)) {
  4677. res[key] = hash[key];
  4678. if (!preserve) {
  4679. delete hash[key];
  4680. }
  4681. return true
  4682. } else if (hasOwn(hash, altKey)) {
  4683. res[key] = hash[altKey];
  4684. if (!preserve) {
  4685. delete hash[altKey];
  4686. }
  4687. return true
  4688. }
  4689. }
  4690. return false
  4691. }
  4692. /* */
  4693. // The template compiler attempts to minimize the need for normalization by
  4694. // statically analyzing the template at compile time.
  4695. //
  4696. // For plain HTML markup, normalization can be completely skipped because the
  4697. // generated render function is guaranteed to return Array<VNode>. There are
  4698. // two cases where extra normalization is needed:
  4699. // 1. When the children contains components - because a functional component
  4700. // may return an Array instead of a single root. In this case, just a simple
  4701. // normalization is needed - if any child is an Array, we flatten the whole
  4702. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4703. // because functional components already normalize their own children.
  4704. function simpleNormalizeChildren (children) {
  4705. for (var i = 0; i < children.length; i++) {
  4706. if (Array.isArray(children[i])) {
  4707. return Array.prototype.concat.apply([], children)
  4708. }
  4709. }
  4710. return children
  4711. }
  4712. // 2. When the children contains constructs that always generated nested Arrays,
  4713. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4714. // with hand-written render functions / JSX. In such cases a full normalization
  4715. // is needed to cater to all possible types of children values.
  4716. function normalizeChildren (children) {
  4717. return isPrimitive(children)
  4718. ? [createTextVNode(children)]
  4719. : Array.isArray(children)
  4720. ? normalizeArrayChildren(children)
  4721. : undefined
  4722. }
  4723. function isTextNode (node) {
  4724. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4725. }
  4726. function normalizeArrayChildren (children, nestedIndex) {
  4727. var res = [];
  4728. var i, c, lastIndex, last;
  4729. for (i = 0; i < children.length; i++) {
  4730. c = children[i];
  4731. if (isUndef(c) || typeof c === 'boolean') { continue }
  4732. lastIndex = res.length - 1;
  4733. last = res[lastIndex];
  4734. // nested
  4735. if (Array.isArray(c)) {
  4736. if (c.length > 0) {
  4737. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4738. // merge adjacent text nodes
  4739. if (isTextNode(c[0]) && isTextNode(last)) {
  4740. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  4741. c.shift();
  4742. }
  4743. res.push.apply(res, c);
  4744. }
  4745. } else if (isPrimitive(c)) {
  4746. if (isTextNode(last)) {
  4747. // merge adjacent text nodes
  4748. // this is necessary for SSR hydration because text nodes are
  4749. // essentially merged when rendered to HTML strings
  4750. res[lastIndex] = createTextVNode(last.text + c);
  4751. } else if (c !== '') {
  4752. // convert primitive to vnode
  4753. res.push(createTextVNode(c));
  4754. }
  4755. } else {
  4756. if (isTextNode(c) && isTextNode(last)) {
  4757. // merge adjacent text nodes
  4758. res[lastIndex] = createTextVNode(last.text + c.text);
  4759. } else {
  4760. // default key for nested array children (likely generated by v-for)
  4761. if (isTrue(children._isVList) &&
  4762. isDef(c.tag) &&
  4763. isUndef(c.key) &&
  4764. isDef(nestedIndex)) {
  4765. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  4766. }
  4767. res.push(c);
  4768. }
  4769. }
  4770. }
  4771. return res
  4772. }
  4773. /* */
  4774. function initProvide (vm) {
  4775. var provide = vm.$options.provide;
  4776. if (provide) {
  4777. vm._provided = typeof provide === 'function'
  4778. ? provide.call(vm)
  4779. : provide;
  4780. }
  4781. }
  4782. function initInjections (vm) {
  4783. var result = resolveInject(vm.$options.inject, vm);
  4784. if (result) {
  4785. toggleObserving(false);
  4786. Object.keys(result).forEach(function (key) {
  4787. /* istanbul ignore else */
  4788. if (true) {
  4789. defineReactive$$1(vm, key, result[key], function () {
  4790. warn(
  4791. "Avoid mutating an injected value directly since the changes will be " +
  4792. "overwritten whenever the provided component re-renders. " +
  4793. "injection being mutated: \"" + key + "\"",
  4794. vm
  4795. );
  4796. });
  4797. } else {}
  4798. });
  4799. toggleObserving(true);
  4800. }
  4801. }
  4802. function resolveInject (inject, vm) {
  4803. if (inject) {
  4804. // inject is :any because flow is not smart enough to figure out cached
  4805. var result = Object.create(null);
  4806. var keys = hasSymbol
  4807. ? Reflect.ownKeys(inject)
  4808. : Object.keys(inject);
  4809. for (var i = 0; i < keys.length; i++) {
  4810. var key = keys[i];
  4811. // #6574 in case the inject object is observed...
  4812. if (key === '__ob__') { continue }
  4813. var provideKey = inject[key].from;
  4814. var source = vm;
  4815. while (source) {
  4816. if (source._provided && hasOwn(source._provided, provideKey)) {
  4817. result[key] = source._provided[provideKey];
  4818. break
  4819. }
  4820. source = source.$parent;
  4821. }
  4822. if (!source) {
  4823. if ('default' in inject[key]) {
  4824. var provideDefault = inject[key].default;
  4825. result[key] = typeof provideDefault === 'function'
  4826. ? provideDefault.call(vm)
  4827. : provideDefault;
  4828. } else if (true) {
  4829. warn(("Injection \"" + key + "\" not found"), vm);
  4830. }
  4831. }
  4832. }
  4833. return result
  4834. }
  4835. }
  4836. /* */
  4837. /**
  4838. * Runtime helper for resolving raw children VNodes into a slot object.
  4839. */
  4840. function resolveSlots (
  4841. children,
  4842. context
  4843. ) {
  4844. if (!children || !children.length) {
  4845. return {}
  4846. }
  4847. var slots = {};
  4848. for (var i = 0, l = children.length; i < l; i++) {
  4849. var child = children[i];
  4850. var data = child.data;
  4851. // remove slot attribute if the node is resolved as a Vue slot node
  4852. if (data && data.attrs && data.attrs.slot) {
  4853. delete data.attrs.slot;
  4854. }
  4855. // named slots should only be respected if the vnode was rendered in the
  4856. // same context.
  4857. if ((child.context === context || child.fnContext === context) &&
  4858. data && data.slot != null
  4859. ) {
  4860. var name = data.slot;
  4861. var slot = (slots[name] || (slots[name] = []));
  4862. if (child.tag === 'template') {
  4863. slot.push.apply(slot, child.children || []);
  4864. } else {
  4865. slot.push(child);
  4866. }
  4867. } else {
  4868. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4869. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4870. (slots['page'] || (slots['page'] = [])).push(child);
  4871. }else{
  4872. (slots.default || (slots.default = [])).push(child);
  4873. }
  4874. }
  4875. }
  4876. // ignore slots that contains only whitespace
  4877. for (var name$1 in slots) {
  4878. if (slots[name$1].every(isWhitespace)) {
  4879. delete slots[name$1];
  4880. }
  4881. }
  4882. return slots
  4883. }
  4884. function isWhitespace (node) {
  4885. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4886. }
  4887. /* */
  4888. function normalizeScopedSlots (
  4889. slots,
  4890. normalSlots,
  4891. prevSlots
  4892. ) {
  4893. var res;
  4894. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4895. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4896. var key = slots && slots.$key;
  4897. if (!slots) {
  4898. res = {};
  4899. } else if (slots._normalized) {
  4900. // fast path 1: child component re-render only, parent did not change
  4901. return slots._normalized
  4902. } else if (
  4903. isStable &&
  4904. prevSlots &&
  4905. prevSlots !== emptyObject &&
  4906. key === prevSlots.$key &&
  4907. !hasNormalSlots &&
  4908. !prevSlots.$hasNormal
  4909. ) {
  4910. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4911. // only need to normalize once
  4912. return prevSlots
  4913. } else {
  4914. res = {};
  4915. for (var key$1 in slots) {
  4916. if (slots[key$1] && key$1[0] !== '$') {
  4917. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4918. }
  4919. }
  4920. }
  4921. // expose normal slots on scopedSlots
  4922. for (var key$2 in normalSlots) {
  4923. if (!(key$2 in res)) {
  4924. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4925. }
  4926. }
  4927. // avoriaz seems to mock a non-extensible $scopedSlots object
  4928. // and when that is passed down this would cause an error
  4929. if (slots && Object.isExtensible(slots)) {
  4930. (slots)._normalized = res;
  4931. }
  4932. def(res, '$stable', isStable);
  4933. def(res, '$key', key);
  4934. def(res, '$hasNormal', hasNormalSlots);
  4935. return res
  4936. }
  4937. function normalizeScopedSlot(normalSlots, key, fn) {
  4938. var normalized = function () {
  4939. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4940. res = res && typeof res === 'object' && !Array.isArray(res)
  4941. ? [res] // single vnode
  4942. : normalizeChildren(res);
  4943. return res && (
  4944. res.length === 0 ||
  4945. (res.length === 1 && res[0].isComment) // #9658
  4946. ) ? undefined
  4947. : res
  4948. };
  4949. // this is a slot using the new v-slot syntax without scope. although it is
  4950. // compiled as a scoped slot, render fn users would expect it to be present
  4951. // on this.$slots because the usage is semantically a normal slot.
  4952. if (fn.proxy) {
  4953. Object.defineProperty(normalSlots, key, {
  4954. get: normalized,
  4955. enumerable: true,
  4956. configurable: true
  4957. });
  4958. }
  4959. return normalized
  4960. }
  4961. function proxyNormalSlot(slots, key) {
  4962. return function () { return slots[key]; }
  4963. }
  4964. /* */
  4965. /**
  4966. * Runtime helper for rendering v-for lists.
  4967. */
  4968. function renderList (
  4969. val,
  4970. render
  4971. ) {
  4972. var ret, i, l, keys, key;
  4973. if (Array.isArray(val) || typeof val === 'string') {
  4974. ret = new Array(val.length);
  4975. for (i = 0, l = val.length; i < l; i++) {
  4976. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4977. }
  4978. } else if (typeof val === 'number') {
  4979. ret = new Array(val);
  4980. for (i = 0; i < val; i++) {
  4981. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4982. }
  4983. } else if (isObject(val)) {
  4984. if (hasSymbol && val[Symbol.iterator]) {
  4985. ret = [];
  4986. var iterator = val[Symbol.iterator]();
  4987. var result = iterator.next();
  4988. while (!result.done) {
  4989. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4990. result = iterator.next();
  4991. }
  4992. } else {
  4993. keys = Object.keys(val);
  4994. ret = new Array(keys.length);
  4995. for (i = 0, l = keys.length; i < l; i++) {
  4996. key = keys[i];
  4997. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4998. }
  4999. }
  5000. }
  5001. if (!isDef(ret)) {
  5002. ret = [];
  5003. }
  5004. (ret)._isVList = true;
  5005. return ret
  5006. }
  5007. /* */
  5008. /**
  5009. * Runtime helper for rendering <slot>
  5010. */
  5011. function renderSlot (
  5012. name,
  5013. fallback,
  5014. props,
  5015. bindObject
  5016. ) {
  5017. var scopedSlotFn = this.$scopedSlots[name];
  5018. var nodes;
  5019. if (scopedSlotFn) { // scoped slot
  5020. props = props || {};
  5021. if (bindObject) {
  5022. if ( true && !isObject(bindObject)) {
  5023. warn(
  5024. 'slot v-bind without argument expects an Object',
  5025. this
  5026. );
  5027. }
  5028. props = extend(extend({}, bindObject), props);
  5029. }
  5030. // fixed by xxxxxx app-plus scopedSlot
  5031. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5032. } else {
  5033. nodes = this.$slots[name] || fallback;
  5034. }
  5035. var target = props && props.slot;
  5036. if (target) {
  5037. return this.$createElement('template', { slot: target }, nodes)
  5038. } else {
  5039. return nodes
  5040. }
  5041. }
  5042. /* */
  5043. /**
  5044. * Runtime helper for resolving filters
  5045. */
  5046. function resolveFilter (id) {
  5047. return resolveAsset(this.$options, 'filters', id, true) || identity
  5048. }
  5049. /* */
  5050. function isKeyNotMatch (expect, actual) {
  5051. if (Array.isArray(expect)) {
  5052. return expect.indexOf(actual) === -1
  5053. } else {
  5054. return expect !== actual
  5055. }
  5056. }
  5057. /**
  5058. * Runtime helper for checking keyCodes from config.
  5059. * exposed as Vue.prototype._k
  5060. * passing in eventKeyName as last argument separately for backwards compat
  5061. */
  5062. function checkKeyCodes (
  5063. eventKeyCode,
  5064. key,
  5065. builtInKeyCode,
  5066. eventKeyName,
  5067. builtInKeyName
  5068. ) {
  5069. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5070. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5071. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5072. } else if (mappedKeyCode) {
  5073. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5074. } else if (eventKeyName) {
  5075. return hyphenate(eventKeyName) !== key
  5076. }
  5077. }
  5078. /* */
  5079. /**
  5080. * Runtime helper for merging v-bind="object" into a VNode's data.
  5081. */
  5082. function bindObjectProps (
  5083. data,
  5084. tag,
  5085. value,
  5086. asProp,
  5087. isSync
  5088. ) {
  5089. if (value) {
  5090. if (!isObject(value)) {
  5091. true && warn(
  5092. 'v-bind without argument expects an Object or Array value',
  5093. this
  5094. );
  5095. } else {
  5096. if (Array.isArray(value)) {
  5097. value = toObject(value);
  5098. }
  5099. var hash;
  5100. var loop = function ( key ) {
  5101. if (
  5102. key === 'class' ||
  5103. key === 'style' ||
  5104. isReservedAttribute(key)
  5105. ) {
  5106. hash = data;
  5107. } else {
  5108. var type = data.attrs && data.attrs.type;
  5109. hash = asProp || config.mustUseProp(tag, type, key)
  5110. ? data.domProps || (data.domProps = {})
  5111. : data.attrs || (data.attrs = {});
  5112. }
  5113. var camelizedKey = camelize(key);
  5114. var hyphenatedKey = hyphenate(key);
  5115. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5116. hash[key] = value[key];
  5117. if (isSync) {
  5118. var on = data.on || (data.on = {});
  5119. on[("update:" + key)] = function ($event) {
  5120. value[key] = $event;
  5121. };
  5122. }
  5123. }
  5124. };
  5125. for (var key in value) loop( key );
  5126. }
  5127. }
  5128. return data
  5129. }
  5130. /* */
  5131. /**
  5132. * Runtime helper for rendering static trees.
  5133. */
  5134. function renderStatic (
  5135. index,
  5136. isInFor
  5137. ) {
  5138. var cached = this._staticTrees || (this._staticTrees = []);
  5139. var tree = cached[index];
  5140. // if has already-rendered static tree and not inside v-for,
  5141. // we can reuse the same tree.
  5142. if (tree && !isInFor) {
  5143. return tree
  5144. }
  5145. // otherwise, render a fresh tree.
  5146. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5147. this._renderProxy,
  5148. null,
  5149. this // for render fns generated for functional component templates
  5150. );
  5151. markStatic(tree, ("__static__" + index), false);
  5152. return tree
  5153. }
  5154. /**
  5155. * Runtime helper for v-once.
  5156. * Effectively it means marking the node as static with a unique key.
  5157. */
  5158. function markOnce (
  5159. tree,
  5160. index,
  5161. key
  5162. ) {
  5163. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5164. return tree
  5165. }
  5166. function markStatic (
  5167. tree,
  5168. key,
  5169. isOnce
  5170. ) {
  5171. if (Array.isArray(tree)) {
  5172. for (var i = 0; i < tree.length; i++) {
  5173. if (tree[i] && typeof tree[i] !== 'string') {
  5174. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5175. }
  5176. }
  5177. } else {
  5178. markStaticNode(tree, key, isOnce);
  5179. }
  5180. }
  5181. function markStaticNode (node, key, isOnce) {
  5182. node.isStatic = true;
  5183. node.key = key;
  5184. node.isOnce = isOnce;
  5185. }
  5186. /* */
  5187. function bindObjectListeners (data, value) {
  5188. if (value) {
  5189. if (!isPlainObject(value)) {
  5190. true && warn(
  5191. 'v-on without argument expects an Object value',
  5192. this
  5193. );
  5194. } else {
  5195. var on = data.on = data.on ? extend({}, data.on) : {};
  5196. for (var key in value) {
  5197. var existing = on[key];
  5198. var ours = value[key];
  5199. on[key] = existing ? [].concat(existing, ours) : ours;
  5200. }
  5201. }
  5202. }
  5203. return data
  5204. }
  5205. /* */
  5206. function resolveScopedSlots (
  5207. fns, // see flow/vnode
  5208. res,
  5209. // the following are added in 2.6
  5210. hasDynamicKeys,
  5211. contentHashKey
  5212. ) {
  5213. res = res || { $stable: !hasDynamicKeys };
  5214. for (var i = 0; i < fns.length; i++) {
  5215. var slot = fns[i];
  5216. if (Array.isArray(slot)) {
  5217. resolveScopedSlots(slot, res, hasDynamicKeys);
  5218. } else if (slot) {
  5219. // marker for reverse proxying v-slot without scope on this.$slots
  5220. if (slot.proxy) {
  5221. slot.fn.proxy = true;
  5222. }
  5223. res[slot.key] = slot.fn;
  5224. }
  5225. }
  5226. if (contentHashKey) {
  5227. (res).$key = contentHashKey;
  5228. }
  5229. return res
  5230. }
  5231. /* */
  5232. function bindDynamicKeys (baseObj, values) {
  5233. for (var i = 0; i < values.length; i += 2) {
  5234. var key = values[i];
  5235. if (typeof key === 'string' && key) {
  5236. baseObj[values[i]] = values[i + 1];
  5237. } else if ( true && key !== '' && key !== null) {
  5238. // null is a special value for explicitly removing a binding
  5239. warn(
  5240. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5241. this
  5242. );
  5243. }
  5244. }
  5245. return baseObj
  5246. }
  5247. // helper to dynamically append modifier runtime markers to event names.
  5248. // ensure only append when value is already string, otherwise it will be cast
  5249. // to string and cause the type check to miss.
  5250. function prependModifier (value, symbol) {
  5251. return typeof value === 'string' ? symbol + value : value
  5252. }
  5253. /* */
  5254. function installRenderHelpers (target) {
  5255. target._o = markOnce;
  5256. target._n = toNumber;
  5257. target._s = toString;
  5258. target._l = renderList;
  5259. target._t = renderSlot;
  5260. target._q = looseEqual;
  5261. target._i = looseIndexOf;
  5262. target._m = renderStatic;
  5263. target._f = resolveFilter;
  5264. target._k = checkKeyCodes;
  5265. target._b = bindObjectProps;
  5266. target._v = createTextVNode;
  5267. target._e = createEmptyVNode;
  5268. target._u = resolveScopedSlots;
  5269. target._g = bindObjectListeners;
  5270. target._d = bindDynamicKeys;
  5271. target._p = prependModifier;
  5272. }
  5273. /* */
  5274. function FunctionalRenderContext (
  5275. data,
  5276. props,
  5277. children,
  5278. parent,
  5279. Ctor
  5280. ) {
  5281. var this$1 = this;
  5282. var options = Ctor.options;
  5283. // ensure the createElement function in functional components
  5284. // gets a unique context - this is necessary for correct named slot check
  5285. var contextVm;
  5286. if (hasOwn(parent, '_uid')) {
  5287. contextVm = Object.create(parent);
  5288. // $flow-disable-line
  5289. contextVm._original = parent;
  5290. } else {
  5291. // the context vm passed in is a functional context as well.
  5292. // in this case we want to make sure we are able to get a hold to the
  5293. // real context instance.
  5294. contextVm = parent;
  5295. // $flow-disable-line
  5296. parent = parent._original;
  5297. }
  5298. var isCompiled = isTrue(options._compiled);
  5299. var needNormalization = !isCompiled;
  5300. this.data = data;
  5301. this.props = props;
  5302. this.children = children;
  5303. this.parent = parent;
  5304. this.listeners = data.on || emptyObject;
  5305. this.injections = resolveInject(options.inject, parent);
  5306. this.slots = function () {
  5307. if (!this$1.$slots) {
  5308. normalizeScopedSlots(
  5309. data.scopedSlots,
  5310. this$1.$slots = resolveSlots(children, parent)
  5311. );
  5312. }
  5313. return this$1.$slots
  5314. };
  5315. Object.defineProperty(this, 'scopedSlots', ({
  5316. enumerable: true,
  5317. get: function get () {
  5318. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5319. }
  5320. }));
  5321. // support for compiled functional template
  5322. if (isCompiled) {
  5323. // exposing $options for renderStatic()
  5324. this.$options = options;
  5325. // pre-resolve slots for renderSlot()
  5326. this.$slots = this.slots();
  5327. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5328. }
  5329. if (options._scopeId) {
  5330. this._c = function (a, b, c, d) {
  5331. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5332. if (vnode && !Array.isArray(vnode)) {
  5333. vnode.fnScopeId = options._scopeId;
  5334. vnode.fnContext = parent;
  5335. }
  5336. return vnode
  5337. };
  5338. } else {
  5339. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5340. }
  5341. }
  5342. installRenderHelpers(FunctionalRenderContext.prototype);
  5343. function createFunctionalComponent (
  5344. Ctor,
  5345. propsData,
  5346. data,
  5347. contextVm,
  5348. children
  5349. ) {
  5350. var options = Ctor.options;
  5351. var props = {};
  5352. var propOptions = options.props;
  5353. if (isDef(propOptions)) {
  5354. for (var key in propOptions) {
  5355. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5356. }
  5357. } else {
  5358. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5359. if (isDef(data.props)) { mergeProps(props, data.props); }
  5360. }
  5361. var renderContext = new FunctionalRenderContext(
  5362. data,
  5363. props,
  5364. children,
  5365. contextVm,
  5366. Ctor
  5367. );
  5368. var vnode = options.render.call(null, renderContext._c, renderContext);
  5369. if (vnode instanceof VNode) {
  5370. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5371. } else if (Array.isArray(vnode)) {
  5372. var vnodes = normalizeChildren(vnode) || [];
  5373. var res = new Array(vnodes.length);
  5374. for (var i = 0; i < vnodes.length; i++) {
  5375. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5376. }
  5377. return res
  5378. }
  5379. }
  5380. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5381. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5382. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5383. // that should not be matched to match.
  5384. var clone = cloneVNode(vnode);
  5385. clone.fnContext = contextVm;
  5386. clone.fnOptions = options;
  5387. if (true) {
  5388. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5389. }
  5390. if (data.slot) {
  5391. (clone.data || (clone.data = {})).slot = data.slot;
  5392. }
  5393. return clone
  5394. }
  5395. function mergeProps (to, from) {
  5396. for (var key in from) {
  5397. to[camelize(key)] = from[key];
  5398. }
  5399. }
  5400. /* */
  5401. /* */
  5402. /* */
  5403. /* */
  5404. // inline hooks to be invoked on component VNodes during patch
  5405. var componentVNodeHooks = {
  5406. init: function init (vnode, hydrating) {
  5407. if (
  5408. vnode.componentInstance &&
  5409. !vnode.componentInstance._isDestroyed &&
  5410. vnode.data.keepAlive
  5411. ) {
  5412. // kept-alive components, treat as a patch
  5413. var mountedNode = vnode; // work around flow
  5414. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5415. } else {
  5416. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5417. vnode,
  5418. activeInstance
  5419. );
  5420. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5421. }
  5422. },
  5423. prepatch: function prepatch (oldVnode, vnode) {
  5424. var options = vnode.componentOptions;
  5425. var child = vnode.componentInstance = oldVnode.componentInstance;
  5426. updateChildComponent(
  5427. child,
  5428. options.propsData, // updated props
  5429. options.listeners, // updated listeners
  5430. vnode, // new parent vnode
  5431. options.children // new children
  5432. );
  5433. },
  5434. insert: function insert (vnode) {
  5435. var context = vnode.context;
  5436. var componentInstance = vnode.componentInstance;
  5437. if (!componentInstance._isMounted) {
  5438. callHook(componentInstance, 'onServiceCreated');
  5439. callHook(componentInstance, 'onServiceAttached');
  5440. componentInstance._isMounted = true;
  5441. callHook(componentInstance, 'mounted');
  5442. }
  5443. if (vnode.data.keepAlive) {
  5444. if (context._isMounted) {
  5445. // vue-router#1212
  5446. // During updates, a kept-alive component's child components may
  5447. // change, so directly walking the tree here may call activated hooks
  5448. // on incorrect children. Instead we push them into a queue which will
  5449. // be processed after the whole patch process ended.
  5450. queueActivatedComponent(componentInstance);
  5451. } else {
  5452. activateChildComponent(componentInstance, true /* direct */);
  5453. }
  5454. }
  5455. },
  5456. destroy: function destroy (vnode) {
  5457. var componentInstance = vnode.componentInstance;
  5458. if (!componentInstance._isDestroyed) {
  5459. if (!vnode.data.keepAlive) {
  5460. componentInstance.$destroy();
  5461. } else {
  5462. deactivateChildComponent(componentInstance, true /* direct */);
  5463. }
  5464. }
  5465. }
  5466. };
  5467. var hooksToMerge = Object.keys(componentVNodeHooks);
  5468. function createComponent (
  5469. Ctor,
  5470. data,
  5471. context,
  5472. children,
  5473. tag
  5474. ) {
  5475. if (isUndef(Ctor)) {
  5476. return
  5477. }
  5478. var baseCtor = context.$options._base;
  5479. // plain options object: turn it into a constructor
  5480. if (isObject(Ctor)) {
  5481. Ctor = baseCtor.extend(Ctor);
  5482. }
  5483. // if at this stage it's not a constructor or an async component factory,
  5484. // reject.
  5485. if (typeof Ctor !== 'function') {
  5486. if (true) {
  5487. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5488. }
  5489. return
  5490. }
  5491. // async component
  5492. var asyncFactory;
  5493. if (isUndef(Ctor.cid)) {
  5494. asyncFactory = Ctor;
  5495. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5496. if (Ctor === undefined) {
  5497. // return a placeholder node for async component, which is rendered
  5498. // as a comment node but preserves all the raw information for the node.
  5499. // the information will be used for async server-rendering and hydration.
  5500. return createAsyncPlaceholder(
  5501. asyncFactory,
  5502. data,
  5503. context,
  5504. children,
  5505. tag
  5506. )
  5507. }
  5508. }
  5509. data = data || {};
  5510. // resolve constructor options in case global mixins are applied after
  5511. // component constructor creation
  5512. resolveConstructorOptions(Ctor);
  5513. // transform component v-model data into props & events
  5514. if (isDef(data.model)) {
  5515. transformModel(Ctor.options, data);
  5516. }
  5517. // extract props
  5518. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5519. // functional component
  5520. if (isTrue(Ctor.options.functional)) {
  5521. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5522. }
  5523. // extract listeners, since these needs to be treated as
  5524. // child component listeners instead of DOM listeners
  5525. var listeners = data.on;
  5526. // replace with listeners with .native modifier
  5527. // so it gets processed during parent component patch.
  5528. data.on = data.nativeOn;
  5529. if (isTrue(Ctor.options.abstract)) {
  5530. // abstract components do not keep anything
  5531. // other than props & listeners & slot
  5532. // work around flow
  5533. var slot = data.slot;
  5534. data = {};
  5535. if (slot) {
  5536. data.slot = slot;
  5537. }
  5538. }
  5539. // install component management hooks onto the placeholder node
  5540. installComponentHooks(data);
  5541. // return a placeholder vnode
  5542. var name = Ctor.options.name || tag;
  5543. var vnode = new VNode(
  5544. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5545. data, undefined, undefined, undefined, context,
  5546. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5547. asyncFactory
  5548. );
  5549. return vnode
  5550. }
  5551. function createComponentInstanceForVnode (
  5552. vnode, // we know it's MountedComponentVNode but flow doesn't
  5553. parent // activeInstance in lifecycle state
  5554. ) {
  5555. var options = {
  5556. _isComponent: true,
  5557. _parentVnode: vnode,
  5558. parent: parent
  5559. };
  5560. // check inline-template render functions
  5561. var inlineTemplate = vnode.data.inlineTemplate;
  5562. if (isDef(inlineTemplate)) {
  5563. options.render = inlineTemplate.render;
  5564. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5565. }
  5566. return new vnode.componentOptions.Ctor(options)
  5567. }
  5568. function installComponentHooks (data) {
  5569. var hooks = data.hook || (data.hook = {});
  5570. for (var i = 0; i < hooksToMerge.length; i++) {
  5571. var key = hooksToMerge[i];
  5572. var existing = hooks[key];
  5573. var toMerge = componentVNodeHooks[key];
  5574. if (existing !== toMerge && !(existing && existing._merged)) {
  5575. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5576. }
  5577. }
  5578. }
  5579. function mergeHook$1 (f1, f2) {
  5580. var merged = function (a, b) {
  5581. // flow complains about extra args which is why we use any
  5582. f1(a, b);
  5583. f2(a, b);
  5584. };
  5585. merged._merged = true;
  5586. return merged
  5587. }
  5588. // transform component v-model info (value and callback) into
  5589. // prop and event handler respectively.
  5590. function transformModel (options, data) {
  5591. var prop = (options.model && options.model.prop) || 'value';
  5592. var event = (options.model && options.model.event) || 'input'
  5593. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5594. var on = data.on || (data.on = {});
  5595. var existing = on[event];
  5596. var callback = data.model.callback;
  5597. if (isDef(existing)) {
  5598. if (
  5599. Array.isArray(existing)
  5600. ? existing.indexOf(callback) === -1
  5601. : existing !== callback
  5602. ) {
  5603. on[event] = [callback].concat(existing);
  5604. }
  5605. } else {
  5606. on[event] = callback;
  5607. }
  5608. }
  5609. /* */
  5610. var SIMPLE_NORMALIZE = 1;
  5611. var ALWAYS_NORMALIZE = 2;
  5612. // wrapper function for providing a more flexible interface
  5613. // without getting yelled at by flow
  5614. function createElement (
  5615. context,
  5616. tag,
  5617. data,
  5618. children,
  5619. normalizationType,
  5620. alwaysNormalize
  5621. ) {
  5622. if (Array.isArray(data) || isPrimitive(data)) {
  5623. normalizationType = children;
  5624. children = data;
  5625. data = undefined;
  5626. }
  5627. if (isTrue(alwaysNormalize)) {
  5628. normalizationType = ALWAYS_NORMALIZE;
  5629. }
  5630. return _createElement(context, tag, data, children, normalizationType)
  5631. }
  5632. function _createElement (
  5633. context,
  5634. tag,
  5635. data,
  5636. children,
  5637. normalizationType
  5638. ) {
  5639. if (isDef(data) && isDef((data).__ob__)) {
  5640. true && warn(
  5641. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5642. 'Always create fresh vnode data objects in each render!',
  5643. context
  5644. );
  5645. return createEmptyVNode()
  5646. }
  5647. // object syntax in v-bind
  5648. if (isDef(data) && isDef(data.is)) {
  5649. tag = data.is;
  5650. }
  5651. if (!tag) {
  5652. // in case of component :is set to falsy value
  5653. return createEmptyVNode()
  5654. }
  5655. // warn against non-primitive key
  5656. if ( true &&
  5657. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5658. ) {
  5659. {
  5660. warn(
  5661. 'Avoid using non-primitive value as key, ' +
  5662. 'use string/number value instead.',
  5663. context
  5664. );
  5665. }
  5666. }
  5667. // support single function children as default scoped slot
  5668. if (Array.isArray(children) &&
  5669. typeof children[0] === 'function'
  5670. ) {
  5671. data = data || {};
  5672. data.scopedSlots = { default: children[0] };
  5673. children.length = 0;
  5674. }
  5675. if (normalizationType === ALWAYS_NORMALIZE) {
  5676. children = normalizeChildren(children);
  5677. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5678. children = simpleNormalizeChildren(children);
  5679. }
  5680. var vnode, ns;
  5681. if (typeof tag === 'string') {
  5682. var Ctor;
  5683. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5684. if (config.isReservedTag(tag)) {
  5685. // platform built-in elements
  5686. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5687. warn(
  5688. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5689. context
  5690. );
  5691. }
  5692. vnode = new VNode(
  5693. config.parsePlatformTagName(tag), data, children,
  5694. undefined, undefined, context
  5695. );
  5696. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5697. // component
  5698. vnode = createComponent(Ctor, data, context, children, tag);
  5699. } else {
  5700. // unknown or unlisted namespaced elements
  5701. // check at runtime because it may get assigned a namespace when its
  5702. // parent normalizes children
  5703. vnode = new VNode(
  5704. tag, data, children,
  5705. undefined, undefined, context
  5706. );
  5707. }
  5708. } else {
  5709. // direct component options / constructor
  5710. vnode = createComponent(tag, data, context, children);
  5711. }
  5712. if (Array.isArray(vnode)) {
  5713. return vnode
  5714. } else if (isDef(vnode)) {
  5715. if (isDef(ns)) { applyNS(vnode, ns); }
  5716. if (isDef(data)) { registerDeepBindings(data); }
  5717. return vnode
  5718. } else {
  5719. return createEmptyVNode()
  5720. }
  5721. }
  5722. function applyNS (vnode, ns, force) {
  5723. vnode.ns = ns;
  5724. if (vnode.tag === 'foreignObject') {
  5725. // use default namespace inside foreignObject
  5726. ns = undefined;
  5727. force = true;
  5728. }
  5729. if (isDef(vnode.children)) {
  5730. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5731. var child = vnode.children[i];
  5732. if (isDef(child.tag) && (
  5733. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5734. applyNS(child, ns, force);
  5735. }
  5736. }
  5737. }
  5738. }
  5739. // ref #5318
  5740. // necessary to ensure parent re-render when deep bindings like :style and
  5741. // :class are used on slot nodes
  5742. function registerDeepBindings (data) {
  5743. if (isObject(data.style)) {
  5744. traverse(data.style);
  5745. }
  5746. if (isObject(data.class)) {
  5747. traverse(data.class);
  5748. }
  5749. }
  5750. /* */
  5751. function initRender (vm) {
  5752. vm._vnode = null; // the root of the child tree
  5753. vm._staticTrees = null; // v-once cached trees
  5754. var options = vm.$options;
  5755. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  5756. var renderContext = parentVnode && parentVnode.context;
  5757. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  5758. vm.$scopedSlots = emptyObject;
  5759. // bind the createElement fn to this instance
  5760. // so that we get proper render context inside it.
  5761. // args order: tag, data, children, normalizationType, alwaysNormalize
  5762. // internal version is used by render functions compiled from templates
  5763. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  5764. // normalization is always applied for the public version, used in
  5765. // user-written render functions.
  5766. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  5767. // $attrs & $listeners are exposed for easier HOC creation.
  5768. // they need to be reactive so that HOCs using them are always updated
  5769. var parentData = parentVnode && parentVnode.data;
  5770. /* istanbul ignore else */
  5771. if (true) {
  5772. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  5773. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  5774. }, true);
  5775. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  5776. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  5777. }, true);
  5778. } else {}
  5779. }
  5780. var currentRenderingInstance = null;
  5781. function renderMixin (Vue) {
  5782. // install runtime convenience helpers
  5783. installRenderHelpers(Vue.prototype);
  5784. Vue.prototype.$nextTick = function (fn) {
  5785. return nextTick(fn, this)
  5786. };
  5787. Vue.prototype._render = function () {
  5788. var vm = this;
  5789. var ref = vm.$options;
  5790. var render = ref.render;
  5791. var _parentVnode = ref._parentVnode;
  5792. if (_parentVnode) {
  5793. vm.$scopedSlots = normalizeScopedSlots(
  5794. _parentVnode.data.scopedSlots,
  5795. vm.$slots,
  5796. vm.$scopedSlots
  5797. );
  5798. }
  5799. // set parent vnode. this allows render functions to have access
  5800. // to the data on the placeholder node.
  5801. vm.$vnode = _parentVnode;
  5802. // render self
  5803. var vnode;
  5804. try {
  5805. // There's no need to maintain a stack because all render fns are called
  5806. // separately from one another. Nested component's render fns are called
  5807. // when parent component is patched.
  5808. currentRenderingInstance = vm;
  5809. vnode = render.call(vm._renderProxy, vm.$createElement);
  5810. } catch (e) {
  5811. handleError(e, vm, "render");
  5812. // return error render result,
  5813. // or previous vnode to prevent render error causing blank component
  5814. /* istanbul ignore else */
  5815. if ( true && vm.$options.renderError) {
  5816. try {
  5817. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5818. } catch (e) {
  5819. handleError(e, vm, "renderError");
  5820. vnode = vm._vnode;
  5821. }
  5822. } else {
  5823. vnode = vm._vnode;
  5824. }
  5825. } finally {
  5826. currentRenderingInstance = null;
  5827. }
  5828. // if the returned array contains only a single node, allow it
  5829. if (Array.isArray(vnode) && vnode.length === 1) {
  5830. vnode = vnode[0];
  5831. }
  5832. // return empty vnode in case the render function errored out
  5833. if (!(vnode instanceof VNode)) {
  5834. if ( true && Array.isArray(vnode)) {
  5835. warn(
  5836. 'Multiple root nodes returned from render function. Render function ' +
  5837. 'should return a single root node.',
  5838. vm
  5839. );
  5840. }
  5841. vnode = createEmptyVNode();
  5842. }
  5843. // set parent
  5844. vnode.parent = _parentVnode;
  5845. return vnode
  5846. };
  5847. }
  5848. /* */
  5849. function ensureCtor (comp, base) {
  5850. if (
  5851. comp.__esModule ||
  5852. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5853. ) {
  5854. comp = comp.default;
  5855. }
  5856. return isObject(comp)
  5857. ? base.extend(comp)
  5858. : comp
  5859. }
  5860. function createAsyncPlaceholder (
  5861. factory,
  5862. data,
  5863. context,
  5864. children,
  5865. tag
  5866. ) {
  5867. var node = createEmptyVNode();
  5868. node.asyncFactory = factory;
  5869. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5870. return node
  5871. }
  5872. function resolveAsyncComponent (
  5873. factory,
  5874. baseCtor
  5875. ) {
  5876. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5877. return factory.errorComp
  5878. }
  5879. if (isDef(factory.resolved)) {
  5880. return factory.resolved
  5881. }
  5882. var owner = currentRenderingInstance;
  5883. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5884. // already pending
  5885. factory.owners.push(owner);
  5886. }
  5887. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5888. return factory.loadingComp
  5889. }
  5890. if (owner && !isDef(factory.owners)) {
  5891. var owners = factory.owners = [owner];
  5892. var sync = true;
  5893. var timerLoading = null;
  5894. var timerTimeout = null
  5895. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5896. var forceRender = function (renderCompleted) {
  5897. for (var i = 0, l = owners.length; i < l; i++) {
  5898. (owners[i]).$forceUpdate();
  5899. }
  5900. if (renderCompleted) {
  5901. owners.length = 0;
  5902. if (timerLoading !== null) {
  5903. clearTimeout(timerLoading);
  5904. timerLoading = null;
  5905. }
  5906. if (timerTimeout !== null) {
  5907. clearTimeout(timerTimeout);
  5908. timerTimeout = null;
  5909. }
  5910. }
  5911. };
  5912. var resolve = once(function (res) {
  5913. // cache resolved
  5914. factory.resolved = ensureCtor(res, baseCtor);
  5915. // invoke callbacks only if this is not a synchronous resolve
  5916. // (async resolves are shimmed as synchronous during SSR)
  5917. if (!sync) {
  5918. forceRender(true);
  5919. } else {
  5920. owners.length = 0;
  5921. }
  5922. });
  5923. var reject = once(function (reason) {
  5924. true && warn(
  5925. "Failed to resolve async component: " + (String(factory)) +
  5926. (reason ? ("\nReason: " + reason) : '')
  5927. );
  5928. if (isDef(factory.errorComp)) {
  5929. factory.error = true;
  5930. forceRender(true);
  5931. }
  5932. });
  5933. var res = factory(resolve, reject);
  5934. if (isObject(res)) {
  5935. if (isPromise(res)) {
  5936. // () => Promise
  5937. if (isUndef(factory.resolved)) {
  5938. res.then(resolve, reject);
  5939. }
  5940. } else if (isPromise(res.component)) {
  5941. res.component.then(resolve, reject);
  5942. if (isDef(res.error)) {
  5943. factory.errorComp = ensureCtor(res.error, baseCtor);
  5944. }
  5945. if (isDef(res.loading)) {
  5946. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5947. if (res.delay === 0) {
  5948. factory.loading = true;
  5949. } else {
  5950. timerLoading = setTimeout(function () {
  5951. timerLoading = null;
  5952. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5953. factory.loading = true;
  5954. forceRender(false);
  5955. }
  5956. }, res.delay || 200);
  5957. }
  5958. }
  5959. if (isDef(res.timeout)) {
  5960. timerTimeout = setTimeout(function () {
  5961. timerTimeout = null;
  5962. if (isUndef(factory.resolved)) {
  5963. reject(
  5964. true
  5965. ? ("timeout (" + (res.timeout) + "ms)")
  5966. : undefined
  5967. );
  5968. }
  5969. }, res.timeout);
  5970. }
  5971. }
  5972. }
  5973. sync = false;
  5974. // return in case resolved synchronously
  5975. return factory.loading
  5976. ? factory.loadingComp
  5977. : factory.resolved
  5978. }
  5979. }
  5980. /* */
  5981. function isAsyncPlaceholder (node) {
  5982. return node.isComment && node.asyncFactory
  5983. }
  5984. /* */
  5985. function getFirstComponentChild (children) {
  5986. if (Array.isArray(children)) {
  5987. for (var i = 0; i < children.length; i++) {
  5988. var c = children[i];
  5989. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5990. return c
  5991. }
  5992. }
  5993. }
  5994. }
  5995. /* */
  5996. /* */
  5997. function initEvents (vm) {
  5998. vm._events = Object.create(null);
  5999. vm._hasHookEvent = false;
  6000. // init parent attached events
  6001. var listeners = vm.$options._parentListeners;
  6002. if (listeners) {
  6003. updateComponentListeners(vm, listeners);
  6004. }
  6005. }
  6006. var target;
  6007. function add (event, fn) {
  6008. target.$on(event, fn);
  6009. }
  6010. function remove$1 (event, fn) {
  6011. target.$off(event, fn);
  6012. }
  6013. function createOnceHandler (event, fn) {
  6014. var _target = target;
  6015. return function onceHandler () {
  6016. var res = fn.apply(null, arguments);
  6017. if (res !== null) {
  6018. _target.$off(event, onceHandler);
  6019. }
  6020. }
  6021. }
  6022. function updateComponentListeners (
  6023. vm,
  6024. listeners,
  6025. oldListeners
  6026. ) {
  6027. target = vm;
  6028. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6029. target = undefined;
  6030. }
  6031. function eventsMixin (Vue) {
  6032. var hookRE = /^hook:/;
  6033. Vue.prototype.$on = function (event, fn) {
  6034. var vm = this;
  6035. if (Array.isArray(event)) {
  6036. for (var i = 0, l = event.length; i < l; i++) {
  6037. vm.$on(event[i], fn);
  6038. }
  6039. } else {
  6040. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6041. // optimize hook:event cost by using a boolean flag marked at registration
  6042. // instead of a hash lookup
  6043. if (hookRE.test(event)) {
  6044. vm._hasHookEvent = true;
  6045. }
  6046. }
  6047. return vm
  6048. };
  6049. Vue.prototype.$once = function (event, fn) {
  6050. var vm = this;
  6051. function on () {
  6052. vm.$off(event, on);
  6053. fn.apply(vm, arguments);
  6054. }
  6055. on.fn = fn;
  6056. vm.$on(event, on);
  6057. return vm
  6058. };
  6059. Vue.prototype.$off = function (event, fn) {
  6060. var vm = this;
  6061. // all
  6062. if (!arguments.length) {
  6063. vm._events = Object.create(null);
  6064. return vm
  6065. }
  6066. // array of events
  6067. if (Array.isArray(event)) {
  6068. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6069. vm.$off(event[i$1], fn);
  6070. }
  6071. return vm
  6072. }
  6073. // specific event
  6074. var cbs = vm._events[event];
  6075. if (!cbs) {
  6076. return vm
  6077. }
  6078. if (!fn) {
  6079. vm._events[event] = null;
  6080. return vm
  6081. }
  6082. // specific handler
  6083. var cb;
  6084. var i = cbs.length;
  6085. while (i--) {
  6086. cb = cbs[i];
  6087. if (cb === fn || cb.fn === fn) {
  6088. cbs.splice(i, 1);
  6089. break
  6090. }
  6091. }
  6092. return vm
  6093. };
  6094. Vue.prototype.$emit = function (event) {
  6095. var vm = this;
  6096. if (true) {
  6097. var lowerCaseEvent = event.toLowerCase();
  6098. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6099. tip(
  6100. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6101. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6102. "Note that HTML attributes are case-insensitive and you cannot use " +
  6103. "v-on to listen to camelCase events when using in-DOM templates. " +
  6104. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6105. );
  6106. }
  6107. }
  6108. var cbs = vm._events[event];
  6109. if (cbs) {
  6110. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6111. var args = toArray(arguments, 1);
  6112. var info = "event handler for \"" + event + "\"";
  6113. for (var i = 0, l = cbs.length; i < l; i++) {
  6114. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6115. }
  6116. }
  6117. return vm
  6118. };
  6119. }
  6120. /* */
  6121. var activeInstance = null;
  6122. var isUpdatingChildComponent = false;
  6123. function setActiveInstance(vm) {
  6124. var prevActiveInstance = activeInstance;
  6125. activeInstance = vm;
  6126. return function () {
  6127. activeInstance = prevActiveInstance;
  6128. }
  6129. }
  6130. function initLifecycle (vm) {
  6131. var options = vm.$options;
  6132. // locate first non-abstract parent
  6133. var parent = options.parent;
  6134. if (parent && !options.abstract) {
  6135. while (parent.$options.abstract && parent.$parent) {
  6136. parent = parent.$parent;
  6137. }
  6138. parent.$children.push(vm);
  6139. }
  6140. vm.$parent = parent;
  6141. vm.$root = parent ? parent.$root : vm;
  6142. vm.$children = [];
  6143. vm.$refs = {};
  6144. vm._watcher = null;
  6145. vm._inactive = null;
  6146. vm._directInactive = false;
  6147. vm._isMounted = false;
  6148. vm._isDestroyed = false;
  6149. vm._isBeingDestroyed = false;
  6150. }
  6151. function lifecycleMixin (Vue) {
  6152. Vue.prototype._update = function (vnode, hydrating) {
  6153. var vm = this;
  6154. var prevEl = vm.$el;
  6155. var prevVnode = vm._vnode;
  6156. var restoreActiveInstance = setActiveInstance(vm);
  6157. vm._vnode = vnode;
  6158. // Vue.prototype.__patch__ is injected in entry points
  6159. // based on the rendering backend used.
  6160. if (!prevVnode) {
  6161. // initial render
  6162. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6163. } else {
  6164. // updates
  6165. vm.$el = vm.__patch__(prevVnode, vnode);
  6166. }
  6167. restoreActiveInstance();
  6168. // update __vue__ reference
  6169. if (prevEl) {
  6170. prevEl.__vue__ = null;
  6171. }
  6172. if (vm.$el) {
  6173. vm.$el.__vue__ = vm;
  6174. }
  6175. // if parent is an HOC, update its $el as well
  6176. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6177. vm.$parent.$el = vm.$el;
  6178. }
  6179. // updated hook is called by the scheduler to ensure that children are
  6180. // updated in a parent's updated hook.
  6181. };
  6182. Vue.prototype.$forceUpdate = function () {
  6183. var vm = this;
  6184. if (vm._watcher) {
  6185. vm._watcher.update();
  6186. }
  6187. };
  6188. Vue.prototype.$destroy = function () {
  6189. var vm = this;
  6190. if (vm._isBeingDestroyed) {
  6191. return
  6192. }
  6193. callHook(vm, 'beforeDestroy');
  6194. vm._isBeingDestroyed = true;
  6195. // remove self from parent
  6196. var parent = vm.$parent;
  6197. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6198. remove(parent.$children, vm);
  6199. }
  6200. // teardown watchers
  6201. if (vm._watcher) {
  6202. vm._watcher.teardown();
  6203. }
  6204. var i = vm._watchers.length;
  6205. while (i--) {
  6206. vm._watchers[i].teardown();
  6207. }
  6208. // remove reference from data ob
  6209. // frozen object may not have observer.
  6210. if (vm._data.__ob__) {
  6211. vm._data.__ob__.vmCount--;
  6212. }
  6213. // call the last hook...
  6214. vm._isDestroyed = true;
  6215. // invoke destroy hooks on current rendered tree
  6216. vm.__patch__(vm._vnode, null);
  6217. // fire destroyed hook
  6218. callHook(vm, 'destroyed');
  6219. // turn off all instance listeners.
  6220. vm.$off();
  6221. // remove __vue__ reference
  6222. if (vm.$el) {
  6223. vm.$el.__vue__ = null;
  6224. }
  6225. // release circular reference (#6759)
  6226. if (vm.$vnode) {
  6227. vm.$vnode.parent = null;
  6228. }
  6229. };
  6230. }
  6231. function updateChildComponent (
  6232. vm,
  6233. propsData,
  6234. listeners,
  6235. parentVnode,
  6236. renderChildren
  6237. ) {
  6238. if (true) {
  6239. isUpdatingChildComponent = true;
  6240. }
  6241. // determine whether component has slot children
  6242. // we need to do this before overwriting $options._renderChildren.
  6243. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6244. // dynamic slot names). Static scoped slots compiled from template has the
  6245. // "$stable" marker.
  6246. var newScopedSlots = parentVnode.data.scopedSlots;
  6247. var oldScopedSlots = vm.$scopedSlots;
  6248. var hasDynamicScopedSlot = !!(
  6249. (newScopedSlots && !newScopedSlots.$stable) ||
  6250. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6251. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6252. );
  6253. // Any static slot children from the parent may have changed during parent's
  6254. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6255. // update is necessary to ensure correctness.
  6256. var needsForceUpdate = !!(
  6257. renderChildren || // has new static slots
  6258. vm.$options._renderChildren || // has old static slots
  6259. hasDynamicScopedSlot
  6260. );
  6261. vm.$options._parentVnode = parentVnode;
  6262. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6263. if (vm._vnode) { // update child tree's parent
  6264. vm._vnode.parent = parentVnode;
  6265. }
  6266. vm.$options._renderChildren = renderChildren;
  6267. // update $attrs and $listeners hash
  6268. // these are also reactive so they may trigger child update if the child
  6269. // used them during render
  6270. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6271. vm.$listeners = listeners || emptyObject;
  6272. // update props
  6273. if (propsData && vm.$options.props) {
  6274. toggleObserving(false);
  6275. var props = vm._props;
  6276. var propKeys = vm.$options._propKeys || [];
  6277. for (var i = 0; i < propKeys.length; i++) {
  6278. var key = propKeys[i];
  6279. var propOptions = vm.$options.props; // wtf flow?
  6280. props[key] = validateProp(key, propOptions, propsData, vm);
  6281. }
  6282. toggleObserving(true);
  6283. // keep a copy of raw propsData
  6284. vm.$options.propsData = propsData;
  6285. }
  6286. // fixed by xxxxxx update properties(mp runtime)
  6287. vm._$updateProperties && vm._$updateProperties(vm);
  6288. // update listeners
  6289. listeners = listeners || emptyObject;
  6290. var oldListeners = vm.$options._parentListeners;
  6291. vm.$options._parentListeners = listeners;
  6292. updateComponentListeners(vm, listeners, oldListeners);
  6293. // resolve slots + force update if has children
  6294. if (needsForceUpdate) {
  6295. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6296. vm.$forceUpdate();
  6297. }
  6298. if (true) {
  6299. isUpdatingChildComponent = false;
  6300. }
  6301. }
  6302. function isInInactiveTree (vm) {
  6303. while (vm && (vm = vm.$parent)) {
  6304. if (vm._inactive) { return true }
  6305. }
  6306. return false
  6307. }
  6308. function activateChildComponent (vm, direct) {
  6309. if (direct) {
  6310. vm._directInactive = false;
  6311. if (isInInactiveTree(vm)) {
  6312. return
  6313. }
  6314. } else if (vm._directInactive) {
  6315. return
  6316. }
  6317. if (vm._inactive || vm._inactive === null) {
  6318. vm._inactive = false;
  6319. for (var i = 0; i < vm.$children.length; i++) {
  6320. activateChildComponent(vm.$children[i]);
  6321. }
  6322. callHook(vm, 'activated');
  6323. }
  6324. }
  6325. function deactivateChildComponent (vm, direct) {
  6326. if (direct) {
  6327. vm._directInactive = true;
  6328. if (isInInactiveTree(vm)) {
  6329. return
  6330. }
  6331. }
  6332. if (!vm._inactive) {
  6333. vm._inactive = true;
  6334. for (var i = 0; i < vm.$children.length; i++) {
  6335. deactivateChildComponent(vm.$children[i]);
  6336. }
  6337. callHook(vm, 'deactivated');
  6338. }
  6339. }
  6340. function callHook (vm, hook) {
  6341. // #7573 disable dep collection when invoking lifecycle hooks
  6342. pushTarget();
  6343. var handlers = vm.$options[hook];
  6344. var info = hook + " hook";
  6345. if (handlers) {
  6346. for (var i = 0, j = handlers.length; i < j; i++) {
  6347. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6348. }
  6349. }
  6350. if (vm._hasHookEvent) {
  6351. vm.$emit('hook:' + hook);
  6352. }
  6353. popTarget();
  6354. }
  6355. /* */
  6356. var MAX_UPDATE_COUNT = 100;
  6357. var queue = [];
  6358. var activatedChildren = [];
  6359. var has = {};
  6360. var circular = {};
  6361. var waiting = false;
  6362. var flushing = false;
  6363. var index = 0;
  6364. /**
  6365. * Reset the scheduler's state.
  6366. */
  6367. function resetSchedulerState () {
  6368. index = queue.length = activatedChildren.length = 0;
  6369. has = {};
  6370. if (true) {
  6371. circular = {};
  6372. }
  6373. waiting = flushing = false;
  6374. }
  6375. // Async edge case #6566 requires saving the timestamp when event listeners are
  6376. // attached. However, calling performance.now() has a perf overhead especially
  6377. // if the page has thousands of event listeners. Instead, we take a timestamp
  6378. // every time the scheduler flushes and use that for all event listeners
  6379. // attached during that flush.
  6380. var currentFlushTimestamp = 0;
  6381. // Async edge case fix requires storing an event listener's attach timestamp.
  6382. var getNow = Date.now;
  6383. // Determine what event timestamp the browser is using. Annoyingly, the
  6384. // timestamp can either be hi-res (relative to page load) or low-res
  6385. // (relative to UNIX epoch), so in order to compare time we have to use the
  6386. // same timestamp type when saving the flush timestamp.
  6387. // All IE versions use low-res event timestamps, and have problematic clock
  6388. // implementations (#9632)
  6389. if (inBrowser && !isIE) {
  6390. var performance = window.performance;
  6391. if (
  6392. performance &&
  6393. typeof performance.now === 'function' &&
  6394. getNow() > document.createEvent('Event').timeStamp
  6395. ) {
  6396. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6397. // smaller than it, it means the event is using a hi-res timestamp,
  6398. // and we need to use the hi-res version for event listener timestamps as
  6399. // well.
  6400. getNow = function () { return performance.now(); };
  6401. }
  6402. }
  6403. /**
  6404. * Flush both queues and run the watchers.
  6405. */
  6406. function flushSchedulerQueue () {
  6407. currentFlushTimestamp = getNow();
  6408. flushing = true;
  6409. var watcher, id;
  6410. // Sort queue before flush.
  6411. // This ensures that:
  6412. // 1. Components are updated from parent to child. (because parent is always
  6413. // created before the child)
  6414. // 2. A component's user watchers are run before its render watcher (because
  6415. // user watchers are created before the render watcher)
  6416. // 3. If a component is destroyed during a parent component's watcher run,
  6417. // its watchers can be skipped.
  6418. queue.sort(function (a, b) { return a.id - b.id; });
  6419. // do not cache length because more watchers might be pushed
  6420. // as we run existing watchers
  6421. for (index = 0; index < queue.length; index++) {
  6422. watcher = queue[index];
  6423. if (watcher.before) {
  6424. watcher.before();
  6425. }
  6426. id = watcher.id;
  6427. has[id] = null;
  6428. watcher.run();
  6429. // in dev build, check and stop circular updates.
  6430. if ( true && has[id] != null) {
  6431. circular[id] = (circular[id] || 0) + 1;
  6432. if (circular[id] > MAX_UPDATE_COUNT) {
  6433. warn(
  6434. 'You may have an infinite update loop ' + (
  6435. watcher.user
  6436. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6437. : "in a component render function."
  6438. ),
  6439. watcher.vm
  6440. );
  6441. break
  6442. }
  6443. }
  6444. }
  6445. // keep copies of post queues before resetting state
  6446. var activatedQueue = activatedChildren.slice();
  6447. var updatedQueue = queue.slice();
  6448. resetSchedulerState();
  6449. // call component updated and activated hooks
  6450. callActivatedHooks(activatedQueue);
  6451. callUpdatedHooks(updatedQueue);
  6452. // devtool hook
  6453. /* istanbul ignore if */
  6454. if (devtools && config.devtools) {
  6455. devtools.emit('flush');
  6456. }
  6457. }
  6458. function callUpdatedHooks (queue) {
  6459. var i = queue.length;
  6460. while (i--) {
  6461. var watcher = queue[i];
  6462. var vm = watcher.vm;
  6463. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6464. callHook(vm, 'updated');
  6465. }
  6466. }
  6467. }
  6468. /**
  6469. * Queue a kept-alive component that was activated during patch.
  6470. * The queue will be processed after the entire tree has been patched.
  6471. */
  6472. function queueActivatedComponent (vm) {
  6473. // setting _inactive to false here so that a render function can
  6474. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6475. vm._inactive = false;
  6476. activatedChildren.push(vm);
  6477. }
  6478. function callActivatedHooks (queue) {
  6479. for (var i = 0; i < queue.length; i++) {
  6480. queue[i]._inactive = true;
  6481. activateChildComponent(queue[i], true /* true */);
  6482. }
  6483. }
  6484. /**
  6485. * Push a watcher into the watcher queue.
  6486. * Jobs with duplicate IDs will be skipped unless it's
  6487. * pushed when the queue is being flushed.
  6488. */
  6489. function queueWatcher (watcher) {
  6490. var id = watcher.id;
  6491. if (has[id] == null) {
  6492. has[id] = true;
  6493. if (!flushing) {
  6494. queue.push(watcher);
  6495. } else {
  6496. // if already flushing, splice the watcher based on its id
  6497. // if already past its id, it will be run next immediately.
  6498. var i = queue.length - 1;
  6499. while (i > index && queue[i].id > watcher.id) {
  6500. i--;
  6501. }
  6502. queue.splice(i + 1, 0, watcher);
  6503. }
  6504. // queue the flush
  6505. if (!waiting) {
  6506. waiting = true;
  6507. if ( true && !config.async) {
  6508. flushSchedulerQueue();
  6509. return
  6510. }
  6511. nextTick(flushSchedulerQueue);
  6512. }
  6513. }
  6514. }
  6515. /* */
  6516. var uid$2 = 0;
  6517. /**
  6518. * A watcher parses an expression, collects dependencies,
  6519. * and fires callback when the expression value changes.
  6520. * This is used for both the $watch() api and directives.
  6521. */
  6522. var Watcher = function Watcher (
  6523. vm,
  6524. expOrFn,
  6525. cb,
  6526. options,
  6527. isRenderWatcher
  6528. ) {
  6529. this.vm = vm;
  6530. if (isRenderWatcher) {
  6531. vm._watcher = this;
  6532. }
  6533. vm._watchers.push(this);
  6534. // options
  6535. if (options) {
  6536. this.deep = !!options.deep;
  6537. this.user = !!options.user;
  6538. this.lazy = !!options.lazy;
  6539. this.sync = !!options.sync;
  6540. this.before = options.before;
  6541. } else {
  6542. this.deep = this.user = this.lazy = this.sync = false;
  6543. }
  6544. this.cb = cb;
  6545. this.id = ++uid$2; // uid for batching
  6546. this.active = true;
  6547. this.dirty = this.lazy; // for lazy watchers
  6548. this.deps = [];
  6549. this.newDeps = [];
  6550. this.depIds = new _Set();
  6551. this.newDepIds = new _Set();
  6552. this.expression = true
  6553. ? expOrFn.toString()
  6554. : undefined;
  6555. // parse expression for getter
  6556. if (typeof expOrFn === 'function') {
  6557. this.getter = expOrFn;
  6558. } else {
  6559. this.getter = parsePath(expOrFn);
  6560. if (!this.getter) {
  6561. this.getter = noop;
  6562. true && warn(
  6563. "Failed watching path: \"" + expOrFn + "\" " +
  6564. 'Watcher only accepts simple dot-delimited paths. ' +
  6565. 'For full control, use a function instead.',
  6566. vm
  6567. );
  6568. }
  6569. }
  6570. this.value = this.lazy
  6571. ? undefined
  6572. : this.get();
  6573. };
  6574. /**
  6575. * Evaluate the getter, and re-collect dependencies.
  6576. */
  6577. Watcher.prototype.get = function get () {
  6578. pushTarget(this);
  6579. var value;
  6580. var vm = this.vm;
  6581. try {
  6582. value = this.getter.call(vm, vm);
  6583. } catch (e) {
  6584. if (this.user) {
  6585. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6586. } else {
  6587. throw e
  6588. }
  6589. } finally {
  6590. // "touch" every property so they are all tracked as
  6591. // dependencies for deep watching
  6592. if (this.deep) {
  6593. traverse(value);
  6594. }
  6595. popTarget();
  6596. this.cleanupDeps();
  6597. }
  6598. return value
  6599. };
  6600. /**
  6601. * Add a dependency to this directive.
  6602. */
  6603. Watcher.prototype.addDep = function addDep (dep) {
  6604. var id = dep.id;
  6605. if (!this.newDepIds.has(id)) {
  6606. this.newDepIds.add(id);
  6607. this.newDeps.push(dep);
  6608. if (!this.depIds.has(id)) {
  6609. dep.addSub(this);
  6610. }
  6611. }
  6612. };
  6613. /**
  6614. * Clean up for dependency collection.
  6615. */
  6616. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6617. var i = this.deps.length;
  6618. while (i--) {
  6619. var dep = this.deps[i];
  6620. if (!this.newDepIds.has(dep.id)) {
  6621. dep.removeSub(this);
  6622. }
  6623. }
  6624. var tmp = this.depIds;
  6625. this.depIds = this.newDepIds;
  6626. this.newDepIds = tmp;
  6627. this.newDepIds.clear();
  6628. tmp = this.deps;
  6629. this.deps = this.newDeps;
  6630. this.newDeps = tmp;
  6631. this.newDeps.length = 0;
  6632. };
  6633. /**
  6634. * Subscriber interface.
  6635. * Will be called when a dependency changes.
  6636. */
  6637. Watcher.prototype.update = function update () {
  6638. /* istanbul ignore else */
  6639. if (this.lazy) {
  6640. this.dirty = true;
  6641. } else if (this.sync) {
  6642. this.run();
  6643. } else {
  6644. queueWatcher(this);
  6645. }
  6646. };
  6647. /**
  6648. * Scheduler job interface.
  6649. * Will be called by the scheduler.
  6650. */
  6651. Watcher.prototype.run = function run () {
  6652. if (this.active) {
  6653. var value = this.get();
  6654. if (
  6655. value !== this.value ||
  6656. // Deep watchers and watchers on Object/Arrays should fire even
  6657. // when the value is the same, because the value may
  6658. // have mutated.
  6659. isObject(value) ||
  6660. this.deep
  6661. ) {
  6662. // set new value
  6663. var oldValue = this.value;
  6664. this.value = value;
  6665. if (this.user) {
  6666. try {
  6667. this.cb.call(this.vm, value, oldValue);
  6668. } catch (e) {
  6669. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6670. }
  6671. } else {
  6672. this.cb.call(this.vm, value, oldValue);
  6673. }
  6674. }
  6675. }
  6676. };
  6677. /**
  6678. * Evaluate the value of the watcher.
  6679. * This only gets called for lazy watchers.
  6680. */
  6681. Watcher.prototype.evaluate = function evaluate () {
  6682. this.value = this.get();
  6683. this.dirty = false;
  6684. };
  6685. /**
  6686. * Depend on all deps collected by this watcher.
  6687. */
  6688. Watcher.prototype.depend = function depend () {
  6689. var i = this.deps.length;
  6690. while (i--) {
  6691. this.deps[i].depend();
  6692. }
  6693. };
  6694. /**
  6695. * Remove self from all dependencies' subscriber list.
  6696. */
  6697. Watcher.prototype.teardown = function teardown () {
  6698. if (this.active) {
  6699. // remove self from vm's watcher list
  6700. // this is a somewhat expensive operation so we skip it
  6701. // if the vm is being destroyed.
  6702. if (!this.vm._isBeingDestroyed) {
  6703. remove(this.vm._watchers, this);
  6704. }
  6705. var i = this.deps.length;
  6706. while (i--) {
  6707. this.deps[i].removeSub(this);
  6708. }
  6709. this.active = false;
  6710. }
  6711. };
  6712. /* */
  6713. var sharedPropertyDefinition = {
  6714. enumerable: true,
  6715. configurable: true,
  6716. get: noop,
  6717. set: noop
  6718. };
  6719. function proxy (target, sourceKey, key) {
  6720. sharedPropertyDefinition.get = function proxyGetter () {
  6721. return this[sourceKey][key]
  6722. };
  6723. sharedPropertyDefinition.set = function proxySetter (val) {
  6724. this[sourceKey][key] = val;
  6725. };
  6726. Object.defineProperty(target, key, sharedPropertyDefinition);
  6727. }
  6728. function initState (vm) {
  6729. vm._watchers = [];
  6730. var opts = vm.$options;
  6731. if (opts.props) { initProps(vm, opts.props); }
  6732. if (opts.methods) { initMethods(vm, opts.methods); }
  6733. if (opts.data) {
  6734. initData(vm);
  6735. } else {
  6736. observe(vm._data = {}, true /* asRootData */);
  6737. }
  6738. if (opts.computed) { initComputed(vm, opts.computed); }
  6739. if (opts.watch && opts.watch !== nativeWatch) {
  6740. initWatch(vm, opts.watch);
  6741. }
  6742. }
  6743. function initProps (vm, propsOptions) {
  6744. var propsData = vm.$options.propsData || {};
  6745. var props = vm._props = {};
  6746. // cache prop keys so that future props updates can iterate using Array
  6747. // instead of dynamic object key enumeration.
  6748. var keys = vm.$options._propKeys = [];
  6749. var isRoot = !vm.$parent;
  6750. // root instance props should be converted
  6751. if (!isRoot) {
  6752. toggleObserving(false);
  6753. }
  6754. var loop = function ( key ) {
  6755. keys.push(key);
  6756. var value = validateProp(key, propsOptions, propsData, vm);
  6757. /* istanbul ignore else */
  6758. if (true) {
  6759. var hyphenatedKey = hyphenate(key);
  6760. if (isReservedAttribute(hyphenatedKey) ||
  6761. config.isReservedAttr(hyphenatedKey)) {
  6762. warn(
  6763. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  6764. vm
  6765. );
  6766. }
  6767. defineReactive$$1(props, key, value, function () {
  6768. if (!isRoot && !isUpdatingChildComponent) {
  6769. {
  6770. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  6771. return
  6772. }
  6773. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  6774. if(
  6775. key === 'value' &&
  6776. Array.isArray(vm.$options.behaviors) &&
  6777. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6778. ){
  6779. return
  6780. }
  6781. if(vm._getFormData){
  6782. return
  6783. }
  6784. var $parent = vm.$parent;
  6785. while($parent){
  6786. if($parent.__next_tick_pending){
  6787. return
  6788. }
  6789. $parent = $parent.$parent;
  6790. }
  6791. }
  6792. warn(
  6793. "Avoid mutating a prop directly since the value will be " +
  6794. "overwritten whenever the parent component re-renders. " +
  6795. "Instead, use a data or computed property based on the prop's " +
  6796. "value. Prop being mutated: \"" + key + "\"",
  6797. vm
  6798. );
  6799. }
  6800. });
  6801. } else {}
  6802. // static props are already proxied on the component's prototype
  6803. // during Vue.extend(). We only need to proxy props defined at
  6804. // instantiation here.
  6805. if (!(key in vm)) {
  6806. proxy(vm, "_props", key);
  6807. }
  6808. };
  6809. for (var key in propsOptions) loop( key );
  6810. toggleObserving(true);
  6811. }
  6812. function initData (vm) {
  6813. var data = vm.$options.data;
  6814. data = vm._data = typeof data === 'function'
  6815. ? getData(data, vm)
  6816. : data || {};
  6817. if (!isPlainObject(data)) {
  6818. data = {};
  6819. true && warn(
  6820. 'data functions should return an object:\n' +
  6821. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6822. vm
  6823. );
  6824. }
  6825. // proxy data on instance
  6826. var keys = Object.keys(data);
  6827. var props = vm.$options.props;
  6828. var methods = vm.$options.methods;
  6829. var i = keys.length;
  6830. while (i--) {
  6831. var key = keys[i];
  6832. if (true) {
  6833. if (methods && hasOwn(methods, key)) {
  6834. warn(
  6835. ("Method \"" + key + "\" has already been defined as a data property."),
  6836. vm
  6837. );
  6838. }
  6839. }
  6840. if (props && hasOwn(props, key)) {
  6841. true && warn(
  6842. "The data property \"" + key + "\" is already declared as a prop. " +
  6843. "Use prop default value instead.",
  6844. vm
  6845. );
  6846. } else if (!isReserved(key)) {
  6847. proxy(vm, "_data", key);
  6848. }
  6849. }
  6850. // observe data
  6851. observe(data, true /* asRootData */);
  6852. }
  6853. function getData (data, vm) {
  6854. // #7573 disable dep collection when invoking data getters
  6855. pushTarget();
  6856. try {
  6857. return data.call(vm, vm)
  6858. } catch (e) {
  6859. handleError(e, vm, "data()");
  6860. return {}
  6861. } finally {
  6862. popTarget();
  6863. }
  6864. }
  6865. var computedWatcherOptions = { lazy: true };
  6866. function initComputed (vm, computed) {
  6867. // $flow-disable-line
  6868. var watchers = vm._computedWatchers = Object.create(null);
  6869. // computed properties are just getters during SSR
  6870. var isSSR = isServerRendering();
  6871. for (var key in computed) {
  6872. var userDef = computed[key];
  6873. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6874. if ( true && getter == null) {
  6875. warn(
  6876. ("Getter is missing for computed property \"" + key + "\"."),
  6877. vm
  6878. );
  6879. }
  6880. if (!isSSR) {
  6881. // create internal watcher for the computed property.
  6882. watchers[key] = new Watcher(
  6883. vm,
  6884. getter || noop,
  6885. noop,
  6886. computedWatcherOptions
  6887. );
  6888. }
  6889. // component-defined computed properties are already defined on the
  6890. // component prototype. We only need to define computed properties defined
  6891. // at instantiation here.
  6892. if (!(key in vm)) {
  6893. defineComputed(vm, key, userDef);
  6894. } else if (true) {
  6895. if (key in vm.$data) {
  6896. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6897. } else if (vm.$options.props && key in vm.$options.props) {
  6898. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6899. }
  6900. }
  6901. }
  6902. }
  6903. function defineComputed (
  6904. target,
  6905. key,
  6906. userDef
  6907. ) {
  6908. var shouldCache = !isServerRendering();
  6909. if (typeof userDef === 'function') {
  6910. sharedPropertyDefinition.get = shouldCache
  6911. ? createComputedGetter(key)
  6912. : createGetterInvoker(userDef);
  6913. sharedPropertyDefinition.set = noop;
  6914. } else {
  6915. sharedPropertyDefinition.get = userDef.get
  6916. ? shouldCache && userDef.cache !== false
  6917. ? createComputedGetter(key)
  6918. : createGetterInvoker(userDef.get)
  6919. : noop;
  6920. sharedPropertyDefinition.set = userDef.set || noop;
  6921. }
  6922. if ( true &&
  6923. sharedPropertyDefinition.set === noop) {
  6924. sharedPropertyDefinition.set = function () {
  6925. warn(
  6926. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6927. this
  6928. );
  6929. };
  6930. }
  6931. Object.defineProperty(target, key, sharedPropertyDefinition);
  6932. }
  6933. function createComputedGetter (key) {
  6934. return function computedGetter () {
  6935. var watcher = this._computedWatchers && this._computedWatchers[key];
  6936. if (watcher) {
  6937. if (watcher.dirty) {
  6938. watcher.evaluate();
  6939. }
  6940. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6941. watcher.depend();
  6942. }
  6943. return watcher.value
  6944. }
  6945. }
  6946. }
  6947. function createGetterInvoker(fn) {
  6948. return function computedGetter () {
  6949. return fn.call(this, this)
  6950. }
  6951. }
  6952. function initMethods (vm, methods) {
  6953. var props = vm.$options.props;
  6954. for (var key in methods) {
  6955. if (true) {
  6956. if (typeof methods[key] !== 'function') {
  6957. warn(
  6958. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6959. "Did you reference the function correctly?",
  6960. vm
  6961. );
  6962. }
  6963. if (props && hasOwn(props, key)) {
  6964. warn(
  6965. ("Method \"" + key + "\" has already been defined as a prop."),
  6966. vm
  6967. );
  6968. }
  6969. if ((key in vm) && isReserved(key)) {
  6970. warn(
  6971. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6972. "Avoid defining component methods that start with _ or $."
  6973. );
  6974. }
  6975. }
  6976. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6977. }
  6978. }
  6979. function initWatch (vm, watch) {
  6980. for (var key in watch) {
  6981. var handler = watch[key];
  6982. if (Array.isArray(handler)) {
  6983. for (var i = 0; i < handler.length; i++) {
  6984. createWatcher(vm, key, handler[i]);
  6985. }
  6986. } else {
  6987. createWatcher(vm, key, handler);
  6988. }
  6989. }
  6990. }
  6991. function createWatcher (
  6992. vm,
  6993. expOrFn,
  6994. handler,
  6995. options
  6996. ) {
  6997. if (isPlainObject(handler)) {
  6998. options = handler;
  6999. handler = handler.handler;
  7000. }
  7001. if (typeof handler === 'string') {
  7002. handler = vm[handler];
  7003. }
  7004. return vm.$watch(expOrFn, handler, options)
  7005. }
  7006. function stateMixin (Vue) {
  7007. // flow somehow has problems with directly declared definition object
  7008. // when using Object.defineProperty, so we have to procedurally build up
  7009. // the object here.
  7010. var dataDef = {};
  7011. dataDef.get = function () { return this._data };
  7012. var propsDef = {};
  7013. propsDef.get = function () { return this._props };
  7014. if (true) {
  7015. dataDef.set = function () {
  7016. warn(
  7017. 'Avoid replacing instance root $data. ' +
  7018. 'Use nested data properties instead.',
  7019. this
  7020. );
  7021. };
  7022. propsDef.set = function () {
  7023. warn("$props is readonly.", this);
  7024. };
  7025. }
  7026. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7027. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7028. Vue.prototype.$set = set;
  7029. Vue.prototype.$delete = del;
  7030. Vue.prototype.$watch = function (
  7031. expOrFn,
  7032. cb,
  7033. options
  7034. ) {
  7035. var vm = this;
  7036. if (isPlainObject(cb)) {
  7037. return createWatcher(vm, expOrFn, cb, options)
  7038. }
  7039. options = options || {};
  7040. options.user = true;
  7041. var watcher = new Watcher(vm, expOrFn, cb, options);
  7042. if (options.immediate) {
  7043. try {
  7044. cb.call(vm, watcher.value);
  7045. } catch (error) {
  7046. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7047. }
  7048. }
  7049. return function unwatchFn () {
  7050. watcher.teardown();
  7051. }
  7052. };
  7053. }
  7054. /* */
  7055. var uid$3 = 0;
  7056. function initMixin (Vue) {
  7057. Vue.prototype._init = function (options) {
  7058. var vm = this;
  7059. // a uid
  7060. vm._uid = uid$3++;
  7061. var startTag, endTag;
  7062. /* istanbul ignore if */
  7063. if ( true && config.performance && mark) {
  7064. startTag = "vue-perf-start:" + (vm._uid);
  7065. endTag = "vue-perf-end:" + (vm._uid);
  7066. mark(startTag);
  7067. }
  7068. // a flag to avoid this being observed
  7069. vm._isVue = true;
  7070. // merge options
  7071. if (options && options._isComponent) {
  7072. // optimize internal component instantiation
  7073. // since dynamic options merging is pretty slow, and none of the
  7074. // internal component options needs special treatment.
  7075. initInternalComponent(vm, options);
  7076. } else {
  7077. vm.$options = mergeOptions(
  7078. resolveConstructorOptions(vm.constructor),
  7079. options || {},
  7080. vm
  7081. );
  7082. }
  7083. /* istanbul ignore else */
  7084. if (true) {
  7085. initProxy(vm);
  7086. } else {}
  7087. // expose real self
  7088. vm._self = vm;
  7089. initLifecycle(vm);
  7090. initEvents(vm);
  7091. initRender(vm);
  7092. callHook(vm, 'beforeCreate');
  7093. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7094. initState(vm);
  7095. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7096. !vm._$fallback && callHook(vm, 'created');
  7097. /* istanbul ignore if */
  7098. if ( true && config.performance && mark) {
  7099. vm._name = formatComponentName(vm, false);
  7100. mark(endTag);
  7101. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7102. }
  7103. if (vm.$options.el) {
  7104. vm.$mount(vm.$options.el);
  7105. }
  7106. };
  7107. }
  7108. function initInternalComponent (vm, options) {
  7109. var opts = vm.$options = Object.create(vm.constructor.options);
  7110. // doing this because it's faster than dynamic enumeration.
  7111. var parentVnode = options._parentVnode;
  7112. opts.parent = options.parent;
  7113. opts._parentVnode = parentVnode;
  7114. var vnodeComponentOptions = parentVnode.componentOptions;
  7115. opts.propsData = vnodeComponentOptions.propsData;
  7116. opts._parentListeners = vnodeComponentOptions.listeners;
  7117. opts._renderChildren = vnodeComponentOptions.children;
  7118. opts._componentTag = vnodeComponentOptions.tag;
  7119. if (options.render) {
  7120. opts.render = options.render;
  7121. opts.staticRenderFns = options.staticRenderFns;
  7122. }
  7123. }
  7124. function resolveConstructorOptions (Ctor) {
  7125. var options = Ctor.options;
  7126. if (Ctor.super) {
  7127. var superOptions = resolveConstructorOptions(Ctor.super);
  7128. var cachedSuperOptions = Ctor.superOptions;
  7129. if (superOptions !== cachedSuperOptions) {
  7130. // super option changed,
  7131. // need to resolve new options.
  7132. Ctor.superOptions = superOptions;
  7133. // check if there are any late-modified/attached options (#4976)
  7134. var modifiedOptions = resolveModifiedOptions(Ctor);
  7135. // update base extend options
  7136. if (modifiedOptions) {
  7137. extend(Ctor.extendOptions, modifiedOptions);
  7138. }
  7139. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7140. if (options.name) {
  7141. options.components[options.name] = Ctor;
  7142. }
  7143. }
  7144. }
  7145. return options
  7146. }
  7147. function resolveModifiedOptions (Ctor) {
  7148. var modified;
  7149. var latest = Ctor.options;
  7150. var sealed = Ctor.sealedOptions;
  7151. for (var key in latest) {
  7152. if (latest[key] !== sealed[key]) {
  7153. if (!modified) { modified = {}; }
  7154. modified[key] = latest[key];
  7155. }
  7156. }
  7157. return modified
  7158. }
  7159. function Vue (options) {
  7160. if ( true &&
  7161. !(this instanceof Vue)
  7162. ) {
  7163. warn('Vue is a constructor and should be called with the `new` keyword');
  7164. }
  7165. this._init(options);
  7166. }
  7167. initMixin(Vue);
  7168. stateMixin(Vue);
  7169. eventsMixin(Vue);
  7170. lifecycleMixin(Vue);
  7171. renderMixin(Vue);
  7172. /* */
  7173. function initUse (Vue) {
  7174. Vue.use = function (plugin) {
  7175. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7176. if (installedPlugins.indexOf(plugin) > -1) {
  7177. return this
  7178. }
  7179. // additional parameters
  7180. var args = toArray(arguments, 1);
  7181. args.unshift(this);
  7182. if (typeof plugin.install === 'function') {
  7183. plugin.install.apply(plugin, args);
  7184. } else if (typeof plugin === 'function') {
  7185. plugin.apply(null, args);
  7186. }
  7187. installedPlugins.push(plugin);
  7188. return this
  7189. };
  7190. }
  7191. /* */
  7192. function initMixin$1 (Vue) {
  7193. Vue.mixin = function (mixin) {
  7194. this.options = mergeOptions(this.options, mixin);
  7195. return this
  7196. };
  7197. }
  7198. /* */
  7199. function initExtend (Vue) {
  7200. /**
  7201. * Each instance constructor, including Vue, has a unique
  7202. * cid. This enables us to create wrapped "child
  7203. * constructors" for prototypal inheritance and cache them.
  7204. */
  7205. Vue.cid = 0;
  7206. var cid = 1;
  7207. /**
  7208. * Class inheritance
  7209. */
  7210. Vue.extend = function (extendOptions) {
  7211. extendOptions = extendOptions || {};
  7212. var Super = this;
  7213. var SuperId = Super.cid;
  7214. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7215. if (cachedCtors[SuperId]) {
  7216. return cachedCtors[SuperId]
  7217. }
  7218. var name = extendOptions.name || Super.options.name;
  7219. if ( true && name) {
  7220. validateComponentName(name);
  7221. }
  7222. var Sub = function VueComponent (options) {
  7223. this._init(options);
  7224. };
  7225. Sub.prototype = Object.create(Super.prototype);
  7226. Sub.prototype.constructor = Sub;
  7227. Sub.cid = cid++;
  7228. Sub.options = mergeOptions(
  7229. Super.options,
  7230. extendOptions
  7231. );
  7232. Sub['super'] = Super;
  7233. // For props and computed properties, we define the proxy getters on
  7234. // the Vue instances at extension time, on the extended prototype. This
  7235. // avoids Object.defineProperty calls for each instance created.
  7236. if (Sub.options.props) {
  7237. initProps$1(Sub);
  7238. }
  7239. if (Sub.options.computed) {
  7240. initComputed$1(Sub);
  7241. }
  7242. // allow further extension/mixin/plugin usage
  7243. Sub.extend = Super.extend;
  7244. Sub.mixin = Super.mixin;
  7245. Sub.use = Super.use;
  7246. // create asset registers, so extended classes
  7247. // can have their private assets too.
  7248. ASSET_TYPES.forEach(function (type) {
  7249. Sub[type] = Super[type];
  7250. });
  7251. // enable recursive self-lookup
  7252. if (name) {
  7253. Sub.options.components[name] = Sub;
  7254. }
  7255. // keep a reference to the super options at extension time.
  7256. // later at instantiation we can check if Super's options have
  7257. // been updated.
  7258. Sub.superOptions = Super.options;
  7259. Sub.extendOptions = extendOptions;
  7260. Sub.sealedOptions = extend({}, Sub.options);
  7261. // cache constructor
  7262. cachedCtors[SuperId] = Sub;
  7263. return Sub
  7264. };
  7265. }
  7266. function initProps$1 (Comp) {
  7267. var props = Comp.options.props;
  7268. for (var key in props) {
  7269. proxy(Comp.prototype, "_props", key);
  7270. }
  7271. }
  7272. function initComputed$1 (Comp) {
  7273. var computed = Comp.options.computed;
  7274. for (var key in computed) {
  7275. defineComputed(Comp.prototype, key, computed[key]);
  7276. }
  7277. }
  7278. /* */
  7279. function initAssetRegisters (Vue) {
  7280. /**
  7281. * Create asset registration methods.
  7282. */
  7283. ASSET_TYPES.forEach(function (type) {
  7284. Vue[type] = function (
  7285. id,
  7286. definition
  7287. ) {
  7288. if (!definition) {
  7289. return this.options[type + 's'][id]
  7290. } else {
  7291. /* istanbul ignore if */
  7292. if ( true && type === 'component') {
  7293. validateComponentName(id);
  7294. }
  7295. if (type === 'component' && isPlainObject(definition)) {
  7296. definition.name = definition.name || id;
  7297. definition = this.options._base.extend(definition);
  7298. }
  7299. if (type === 'directive' && typeof definition === 'function') {
  7300. definition = { bind: definition, update: definition };
  7301. }
  7302. this.options[type + 's'][id] = definition;
  7303. return definition
  7304. }
  7305. };
  7306. });
  7307. }
  7308. /* */
  7309. function getComponentName (opts) {
  7310. return opts && (opts.Ctor.options.name || opts.tag)
  7311. }
  7312. function matches (pattern, name) {
  7313. if (Array.isArray(pattern)) {
  7314. return pattern.indexOf(name) > -1
  7315. } else if (typeof pattern === 'string') {
  7316. return pattern.split(',').indexOf(name) > -1
  7317. } else if (isRegExp(pattern)) {
  7318. return pattern.test(name)
  7319. }
  7320. /* istanbul ignore next */
  7321. return false
  7322. }
  7323. function pruneCache (keepAliveInstance, filter) {
  7324. var cache = keepAliveInstance.cache;
  7325. var keys = keepAliveInstance.keys;
  7326. var _vnode = keepAliveInstance._vnode;
  7327. for (var key in cache) {
  7328. var cachedNode = cache[key];
  7329. if (cachedNode) {
  7330. var name = getComponentName(cachedNode.componentOptions);
  7331. if (name && !filter(name)) {
  7332. pruneCacheEntry(cache, key, keys, _vnode);
  7333. }
  7334. }
  7335. }
  7336. }
  7337. function pruneCacheEntry (
  7338. cache,
  7339. key,
  7340. keys,
  7341. current
  7342. ) {
  7343. var cached$$1 = cache[key];
  7344. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7345. cached$$1.componentInstance.$destroy();
  7346. }
  7347. cache[key] = null;
  7348. remove(keys, key);
  7349. }
  7350. var patternTypes = [String, RegExp, Array];
  7351. var KeepAlive = {
  7352. name: 'keep-alive',
  7353. abstract: true,
  7354. props: {
  7355. include: patternTypes,
  7356. exclude: patternTypes,
  7357. max: [String, Number]
  7358. },
  7359. created: function created () {
  7360. this.cache = Object.create(null);
  7361. this.keys = [];
  7362. },
  7363. destroyed: function destroyed () {
  7364. for (var key in this.cache) {
  7365. pruneCacheEntry(this.cache, key, this.keys);
  7366. }
  7367. },
  7368. mounted: function mounted () {
  7369. var this$1 = this;
  7370. this.$watch('include', function (val) {
  7371. pruneCache(this$1, function (name) { return matches(val, name); });
  7372. });
  7373. this.$watch('exclude', function (val) {
  7374. pruneCache(this$1, function (name) { return !matches(val, name); });
  7375. });
  7376. },
  7377. render: function render () {
  7378. var slot = this.$slots.default;
  7379. var vnode = getFirstComponentChild(slot);
  7380. var componentOptions = vnode && vnode.componentOptions;
  7381. if (componentOptions) {
  7382. // check pattern
  7383. var name = getComponentName(componentOptions);
  7384. var ref = this;
  7385. var include = ref.include;
  7386. var exclude = ref.exclude;
  7387. if (
  7388. // not included
  7389. (include && (!name || !matches(include, name))) ||
  7390. // excluded
  7391. (exclude && name && matches(exclude, name))
  7392. ) {
  7393. return vnode
  7394. }
  7395. var ref$1 = this;
  7396. var cache = ref$1.cache;
  7397. var keys = ref$1.keys;
  7398. var key = vnode.key == null
  7399. // same constructor may get registered as different local components
  7400. // so cid alone is not enough (#3269)
  7401. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7402. : vnode.key;
  7403. if (cache[key]) {
  7404. vnode.componentInstance = cache[key].componentInstance;
  7405. // make current key freshest
  7406. remove(keys, key);
  7407. keys.push(key);
  7408. } else {
  7409. cache[key] = vnode;
  7410. keys.push(key);
  7411. // prune oldest entry
  7412. if (this.max && keys.length > parseInt(this.max)) {
  7413. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7414. }
  7415. }
  7416. vnode.data.keepAlive = true;
  7417. }
  7418. return vnode || (slot && slot[0])
  7419. }
  7420. };
  7421. var builtInComponents = {
  7422. KeepAlive: KeepAlive
  7423. };
  7424. /* */
  7425. function initGlobalAPI (Vue) {
  7426. // config
  7427. var configDef = {};
  7428. configDef.get = function () { return config; };
  7429. if (true) {
  7430. configDef.set = function () {
  7431. warn(
  7432. 'Do not replace the Vue.config object, set individual fields instead.'
  7433. );
  7434. };
  7435. }
  7436. Object.defineProperty(Vue, 'config', configDef);
  7437. // exposed util methods.
  7438. // NOTE: these are not considered part of the public API - avoid relying on
  7439. // them unless you are aware of the risk.
  7440. Vue.util = {
  7441. warn: warn,
  7442. extend: extend,
  7443. mergeOptions: mergeOptions,
  7444. defineReactive: defineReactive$$1
  7445. };
  7446. Vue.set = set;
  7447. Vue.delete = del;
  7448. Vue.nextTick = nextTick;
  7449. // 2.6 explicit observable API
  7450. Vue.observable = function (obj) {
  7451. observe(obj);
  7452. return obj
  7453. };
  7454. Vue.options = Object.create(null);
  7455. ASSET_TYPES.forEach(function (type) {
  7456. Vue.options[type + 's'] = Object.create(null);
  7457. });
  7458. // this is used to identify the "base" constructor to extend all plain-object
  7459. // components with in Weex's multi-instance scenarios.
  7460. Vue.options._base = Vue;
  7461. extend(Vue.options.components, builtInComponents);
  7462. initUse(Vue);
  7463. initMixin$1(Vue);
  7464. initExtend(Vue);
  7465. initAssetRegisters(Vue);
  7466. }
  7467. initGlobalAPI(Vue);
  7468. Object.defineProperty(Vue.prototype, '$isServer', {
  7469. get: isServerRendering
  7470. });
  7471. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7472. get: function get () {
  7473. /* istanbul ignore next */
  7474. return this.$vnode && this.$vnode.ssrContext
  7475. }
  7476. });
  7477. // expose FunctionalRenderContext for ssr runtime helper installation
  7478. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7479. value: FunctionalRenderContext
  7480. });
  7481. Vue.version = '2.6.11';
  7482. /**
  7483. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7484. */
  7485. var ARRAYTYPE = '[object Array]';
  7486. var OBJECTTYPE = '[object Object]';
  7487. // const FUNCTIONTYPE = '[object Function]'
  7488. function diff(current, pre) {
  7489. var result = {};
  7490. syncKeys(current, pre);
  7491. _diff(current, pre, '', result);
  7492. return result
  7493. }
  7494. function syncKeys(current, pre) {
  7495. if (current === pre) { return }
  7496. var rootCurrentType = type(current);
  7497. var rootPreType = type(pre);
  7498. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7499. if(Object.keys(current).length >= Object.keys(pre).length){
  7500. for (var key in pre) {
  7501. var currentValue = current[key];
  7502. if (currentValue === undefined) {
  7503. current[key] = null;
  7504. } else {
  7505. syncKeys(currentValue, pre[key]);
  7506. }
  7507. }
  7508. }
  7509. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7510. if (current.length >= pre.length) {
  7511. pre.forEach(function (item, index) {
  7512. syncKeys(current[index], item);
  7513. });
  7514. }
  7515. }
  7516. }
  7517. function _diff(current, pre, path, result) {
  7518. if (current === pre) { return }
  7519. var rootCurrentType = type(current);
  7520. var rootPreType = type(pre);
  7521. if (rootCurrentType == OBJECTTYPE) {
  7522. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7523. setResult(result, path, current);
  7524. } else {
  7525. var loop = function ( key ) {
  7526. var currentValue = current[key];
  7527. var preValue = pre[key];
  7528. var currentType = type(currentValue);
  7529. var preType = type(preValue);
  7530. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7531. if (currentValue !== pre[key]) {
  7532. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7533. }
  7534. } else if (currentType == ARRAYTYPE) {
  7535. if (preType != ARRAYTYPE) {
  7536. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7537. } else {
  7538. if (currentValue.length < preValue.length) {
  7539. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7540. } else {
  7541. currentValue.forEach(function (item, index) {
  7542. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7543. });
  7544. }
  7545. }
  7546. } else if (currentType == OBJECTTYPE) {
  7547. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7548. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7549. } else {
  7550. for (var subKey in currentValue) {
  7551. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7552. }
  7553. }
  7554. }
  7555. };
  7556. for (var key in current) loop( key );
  7557. }
  7558. } else if (rootCurrentType == ARRAYTYPE) {
  7559. if (rootPreType != ARRAYTYPE) {
  7560. setResult(result, path, current);
  7561. } else {
  7562. if (current.length < pre.length) {
  7563. setResult(result, path, current);
  7564. } else {
  7565. current.forEach(function (item, index) {
  7566. _diff(item, pre[index], path + '[' + index + ']', result);
  7567. });
  7568. }
  7569. }
  7570. } else {
  7571. setResult(result, path, current);
  7572. }
  7573. }
  7574. function setResult(result, k, v) {
  7575. // if (type(v) != FUNCTIONTYPE) {
  7576. result[k] = v;
  7577. // }
  7578. }
  7579. function type(obj) {
  7580. return Object.prototype.toString.call(obj)
  7581. }
  7582. /* */
  7583. function flushCallbacks$1(vm) {
  7584. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7585. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7586. var mpInstance = vm.$scope;
  7587. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7588. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7589. }
  7590. var copies = vm.__next_tick_callbacks.slice(0);
  7591. vm.__next_tick_callbacks.length = 0;
  7592. for (var i = 0; i < copies.length; i++) {
  7593. copies[i]();
  7594. }
  7595. }
  7596. }
  7597. function hasRenderWatcher(vm) {
  7598. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7599. }
  7600. function nextTick$1(vm, cb) {
  7601. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7602. //2.nextTick 之前存在 render watcher
  7603. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7604. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7605. var mpInstance = vm.$scope;
  7606. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7607. ']:nextVueTick');
  7608. }
  7609. return nextTick(cb, vm)
  7610. }else{
  7611. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7612. var mpInstance$1 = vm.$scope;
  7613. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7614. ']:nextMPTick');
  7615. }
  7616. }
  7617. var _resolve;
  7618. if (!vm.__next_tick_callbacks) {
  7619. vm.__next_tick_callbacks = [];
  7620. }
  7621. vm.__next_tick_callbacks.push(function () {
  7622. if (cb) {
  7623. try {
  7624. cb.call(vm);
  7625. } catch (e) {
  7626. handleError(e, vm, 'nextTick');
  7627. }
  7628. } else if (_resolve) {
  7629. _resolve(vm);
  7630. }
  7631. });
  7632. // $flow-disable-line
  7633. if (!cb && typeof Promise !== 'undefined') {
  7634. return new Promise(function (resolve) {
  7635. _resolve = resolve;
  7636. })
  7637. }
  7638. }
  7639. /* */
  7640. function cloneWithData(vm) {
  7641. // 确保当前 vm 所有数据被同步
  7642. var ret = Object.create(null);
  7643. var dataKeys = [].concat(
  7644. Object.keys(vm._data || {}),
  7645. Object.keys(vm._computedWatchers || {}));
  7646. dataKeys.reduce(function(ret, key) {
  7647. ret[key] = vm[key];
  7648. return ret
  7649. }, ret);
  7650. // vue-composition-api
  7651. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  7652. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  7653. if (rawBindings) {
  7654. Object.keys(rawBindings).forEach(function (key) {
  7655. ret[key] = vm[key];
  7656. });
  7657. }
  7658. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7659. Object.assign(ret, vm.$mp.data || {});
  7660. if (
  7661. Array.isArray(vm.$options.behaviors) &&
  7662. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7663. ) { //form-field
  7664. ret['name'] = vm.name;
  7665. ret['value'] = vm.value;
  7666. }
  7667. return JSON.parse(JSON.stringify(ret))
  7668. }
  7669. var patch = function(oldVnode, vnode) {
  7670. var this$1 = this;
  7671. if (vnode === null) { //destroy
  7672. return
  7673. }
  7674. if (this.mpType === 'page' || this.mpType === 'component') {
  7675. var mpInstance = this.$scope;
  7676. var data = Object.create(null);
  7677. try {
  7678. data = cloneWithData(this);
  7679. } catch (err) {
  7680. console.error(err);
  7681. }
  7682. data.__webviewId__ = mpInstance.data.__webviewId__;
  7683. var mpData = Object.create(null);
  7684. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7685. mpData[key] = mpInstance.data[key];
  7686. });
  7687. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7688. if (Object.keys(diffData).length) {
  7689. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7690. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7691. ']差量更新',
  7692. JSON.stringify(diffData));
  7693. }
  7694. this.__next_tick_pending = true;
  7695. mpInstance.setData(diffData, function () {
  7696. this$1.__next_tick_pending = false;
  7697. flushCallbacks$1(this$1);
  7698. });
  7699. } else {
  7700. flushCallbacks$1(this);
  7701. }
  7702. }
  7703. };
  7704. /* */
  7705. function createEmptyRender() {
  7706. }
  7707. function mountComponent$1(
  7708. vm,
  7709. el,
  7710. hydrating
  7711. ) {
  7712. if (!vm.mpType) {//main.js 中的 new Vue
  7713. return vm
  7714. }
  7715. if (vm.mpType === 'app') {
  7716. vm.$options.render = createEmptyRender;
  7717. }
  7718. if (!vm.$options.render) {
  7719. vm.$options.render = createEmptyRender;
  7720. if (true) {
  7721. /* istanbul ignore if */
  7722. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7723. vm.$options.el || el) {
  7724. warn(
  7725. 'You are using the runtime-only build of Vue where the template ' +
  7726. 'compiler is not available. Either pre-compile the templates into ' +
  7727. 'render functions, or use the compiler-included build.',
  7728. vm
  7729. );
  7730. } else {
  7731. warn(
  7732. 'Failed to mount component: template or render function not defined.',
  7733. vm
  7734. );
  7735. }
  7736. }
  7737. }
  7738. !vm._$fallback && callHook(vm, 'beforeMount');
  7739. var updateComponent = function () {
  7740. vm._update(vm._render(), hydrating);
  7741. };
  7742. // we set this to vm._watcher inside the watcher's constructor
  7743. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  7744. // component's mounted hook), which relies on vm._watcher being already defined
  7745. new Watcher(vm, updateComponent, noop, {
  7746. before: function before() {
  7747. if (vm._isMounted && !vm._isDestroyed) {
  7748. callHook(vm, 'beforeUpdate');
  7749. }
  7750. }
  7751. }, true /* isRenderWatcher */);
  7752. hydrating = false;
  7753. return vm
  7754. }
  7755. /* */
  7756. function renderClass (
  7757. staticClass,
  7758. dynamicClass
  7759. ) {
  7760. if (isDef(staticClass) || isDef(dynamicClass)) {
  7761. return concat(staticClass, stringifyClass(dynamicClass))
  7762. }
  7763. /* istanbul ignore next */
  7764. return ''
  7765. }
  7766. function concat (a, b) {
  7767. return a ? b ? (a + ' ' + b) : a : (b || '')
  7768. }
  7769. function stringifyClass (value) {
  7770. if (Array.isArray(value)) {
  7771. return stringifyArray(value)
  7772. }
  7773. if (isObject(value)) {
  7774. return stringifyObject(value)
  7775. }
  7776. if (typeof value === 'string') {
  7777. return value
  7778. }
  7779. /* istanbul ignore next */
  7780. return ''
  7781. }
  7782. function stringifyArray (value) {
  7783. var res = '';
  7784. var stringified;
  7785. for (var i = 0, l = value.length; i < l; i++) {
  7786. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7787. if (res) { res += ' '; }
  7788. res += stringified;
  7789. }
  7790. }
  7791. return res
  7792. }
  7793. function stringifyObject (value) {
  7794. var res = '';
  7795. for (var key in value) {
  7796. if (value[key]) {
  7797. if (res) { res += ' '; }
  7798. res += key;
  7799. }
  7800. }
  7801. return res
  7802. }
  7803. /* */
  7804. var parseStyleText = cached(function (cssText) {
  7805. var res = {};
  7806. var listDelimiter = /;(?![^(]*\))/g;
  7807. var propertyDelimiter = /:(.+)/;
  7808. cssText.split(listDelimiter).forEach(function (item) {
  7809. if (item) {
  7810. var tmp = item.split(propertyDelimiter);
  7811. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7812. }
  7813. });
  7814. return res
  7815. });
  7816. // normalize possible array / string values into Object
  7817. function normalizeStyleBinding (bindingStyle) {
  7818. if (Array.isArray(bindingStyle)) {
  7819. return toObject(bindingStyle)
  7820. }
  7821. if (typeof bindingStyle === 'string') {
  7822. return parseStyleText(bindingStyle)
  7823. }
  7824. return bindingStyle
  7825. }
  7826. /* */
  7827. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7828. function getTarget(obj, path) {
  7829. var parts = path.split('.');
  7830. var key = parts[0];
  7831. if (key.indexOf('__$n') === 0) { //number index
  7832. key = parseInt(key.replace('__$n', ''));
  7833. }
  7834. if (parts.length === 1) {
  7835. return obj[key]
  7836. }
  7837. return getTarget(obj[key], parts.slice(1).join('.'))
  7838. }
  7839. function internalMixin(Vue) {
  7840. Vue.config.errorHandler = function(err, vm, info) {
  7841. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7842. console.error(err);
  7843. /* eslint-disable no-undef */
  7844. var app = typeof getApp === 'function' && getApp();
  7845. if (app && app.onError) {
  7846. app.onError(err);
  7847. }
  7848. };
  7849. var oldEmit = Vue.prototype.$emit;
  7850. Vue.prototype.$emit = function(event) {
  7851. if (this.$scope && event) {
  7852. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  7853. __args__: toArray(arguments, 1)
  7854. });
  7855. }
  7856. return oldEmit.apply(this, arguments)
  7857. };
  7858. Vue.prototype.$nextTick = function(fn) {
  7859. return nextTick$1(this, fn)
  7860. };
  7861. MP_METHODS.forEach(function (method) {
  7862. Vue.prototype[method] = function(args) {
  7863. if (this.$scope && this.$scope[method]) {
  7864. return this.$scope[method](args)
  7865. }
  7866. // mp-alipay
  7867. if (typeof my === 'undefined') {
  7868. return
  7869. }
  7870. if (method === 'createSelectorQuery') {
  7871. /* eslint-disable no-undef */
  7872. return my.createSelectorQuery(args)
  7873. } else if (method === 'createIntersectionObserver') {
  7874. /* eslint-disable no-undef */
  7875. return my.createIntersectionObserver(args)
  7876. }
  7877. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7878. };
  7879. });
  7880. Vue.prototype.__init_provide = initProvide;
  7881. Vue.prototype.__init_injections = initInjections;
  7882. Vue.prototype.__call_hook = function(hook, args) {
  7883. var vm = this;
  7884. // #7573 disable dep collection when invoking lifecycle hooks
  7885. pushTarget();
  7886. var handlers = vm.$options[hook];
  7887. var info = hook + " hook";
  7888. var ret;
  7889. if (handlers) {
  7890. for (var i = 0, j = handlers.length; i < j; i++) {
  7891. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7892. }
  7893. }
  7894. if (vm._hasHookEvent) {
  7895. vm.$emit('hook:' + hook, args);
  7896. }
  7897. popTarget();
  7898. return ret
  7899. };
  7900. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7901. if (Array.isArray(modifiers)) {
  7902. if (modifiers.indexOf('trim') !== -1) {
  7903. value = value.trim();
  7904. }
  7905. if (modifiers.indexOf('number') !== -1) {
  7906. value = this._n(value);
  7907. }
  7908. }
  7909. if (!target) {
  7910. target = this;
  7911. }
  7912. // 解决动态属性添加
  7913. Vue.set(target, key, value);
  7914. };
  7915. Vue.prototype.__set_sync = function(target, key, value) {
  7916. if (!target) {
  7917. target = this;
  7918. }
  7919. // 解决动态属性添加
  7920. Vue.set(target, key, value);
  7921. };
  7922. Vue.prototype.__get_orig = function(item) {
  7923. if (isPlainObject(item)) {
  7924. return item['$orig'] || item
  7925. }
  7926. return item
  7927. };
  7928. Vue.prototype.__get_value = function(dataPath, target) {
  7929. return getTarget(target || this, dataPath)
  7930. };
  7931. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7932. return renderClass(staticClass, dynamicClass)
  7933. };
  7934. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7935. if (!dynamicStyle && !staticStyle) {
  7936. return ''
  7937. }
  7938. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7939. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7940. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7941. };
  7942. Vue.prototype.__map = function(val, iteratee) {
  7943. //TODO 暂不考虑 string
  7944. var ret, i, l, keys, key;
  7945. if (Array.isArray(val)) {
  7946. ret = new Array(val.length);
  7947. for (i = 0, l = val.length; i < l; i++) {
  7948. ret[i] = iteratee(val[i], i);
  7949. }
  7950. return ret
  7951. } else if (isObject(val)) {
  7952. keys = Object.keys(val);
  7953. ret = Object.create(null);
  7954. for (i = 0, l = keys.length; i < l; i++) {
  7955. key = keys[i];
  7956. ret[key] = iteratee(val[key], key, i);
  7957. }
  7958. return ret
  7959. } else if (typeof val === 'number') {
  7960. ret = new Array(val);
  7961. for (i = 0, l = val; i < l; i++) {
  7962. // 第一个参数暂时仍和小程序一致
  7963. ret[i] = iteratee(i, i);
  7964. }
  7965. return ret
  7966. }
  7967. return []
  7968. };
  7969. }
  7970. /* */
  7971. var LIFECYCLE_HOOKS$1 = [
  7972. //App
  7973. 'onLaunch',
  7974. 'onShow',
  7975. 'onHide',
  7976. 'onUniNViewMessage',
  7977. 'onPageNotFound',
  7978. 'onThemeChange',
  7979. 'onError',
  7980. 'onUnhandledRejection',
  7981. //Page
  7982. 'onInit',
  7983. 'onLoad',
  7984. // 'onShow',
  7985. 'onReady',
  7986. // 'onHide',
  7987. 'onUnload',
  7988. 'onPullDownRefresh',
  7989. 'onReachBottom',
  7990. 'onTabItemTap',
  7991. 'onAddToFavorites',
  7992. 'onShareTimeline',
  7993. 'onShareAppMessage',
  7994. 'onResize',
  7995. 'onPageScroll',
  7996. 'onNavigationBarButtonTap',
  7997. 'onBackPress',
  7998. 'onNavigationBarSearchInputChanged',
  7999. 'onNavigationBarSearchInputConfirmed',
  8000. 'onNavigationBarSearchInputClicked',
  8001. //Component
  8002. // 'onReady', // 兼容旧版本,应该移除该事件
  8003. 'onPageShow',
  8004. 'onPageHide',
  8005. 'onPageResize'
  8006. ];
  8007. function lifecycleMixin$1(Vue) {
  8008. //fixed vue-class-component
  8009. var oldExtend = Vue.extend;
  8010. Vue.extend = function(extendOptions) {
  8011. extendOptions = extendOptions || {};
  8012. var methods = extendOptions.methods;
  8013. if (methods) {
  8014. Object.keys(methods).forEach(function (methodName) {
  8015. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8016. extendOptions[methodName] = methods[methodName];
  8017. delete methods[methodName];
  8018. }
  8019. });
  8020. }
  8021. return oldExtend.call(this, extendOptions)
  8022. };
  8023. var strategies = Vue.config.optionMergeStrategies;
  8024. var mergeHook = strategies.created;
  8025. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8026. strategies[hook] = mergeHook;
  8027. });
  8028. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8029. }
  8030. /* */
  8031. // install platform patch function
  8032. Vue.prototype.__patch__ = patch;
  8033. // public mount method
  8034. Vue.prototype.$mount = function(
  8035. el ,
  8036. hydrating
  8037. ) {
  8038. return mountComponent$1(this, el, hydrating)
  8039. };
  8040. lifecycleMixin$1(Vue);
  8041. internalMixin(Vue);
  8042. /* */
  8043. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8044. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8045. /***/ }),
  8046. /* 5 */
  8047. /*!*********************************************!*\
  8048. !*** D:/code/work/broke_news_wx/pages.json ***!
  8049. \*********************************************/
  8050. /*! no static exports found */
  8051. /***/ (function(module, exports) {
  8052. /***/ }),
  8053. /* 6 */,
  8054. /* 7 */,
  8055. /* 8 */,
  8056. /* 9 */,
  8057. /* 10 */,
  8058. /* 11 */
  8059. /*!**********************************************************************************************************!*\
  8060. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8061. \**********************************************************************************************************/
  8062. /*! exports provided: default */
  8063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8064. "use strict";
  8065. __webpack_require__.r(__webpack_exports__);
  8066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8067. /* globals __VUE_SSR_CONTEXT__ */
  8068. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8069. // This module is a runtime utility for cleaner component module output and will
  8070. // be included in the final webpack user bundle.
  8071. function normalizeComponent (
  8072. scriptExports,
  8073. render,
  8074. staticRenderFns,
  8075. functionalTemplate,
  8076. injectStyles,
  8077. scopeId,
  8078. moduleIdentifier, /* server only */
  8079. shadowMode, /* vue-cli only */
  8080. components, // fixed by xxxxxx auto components
  8081. renderjs // fixed by xxxxxx renderjs
  8082. ) {
  8083. // Vue.extend constructor export interop
  8084. var options = typeof scriptExports === 'function'
  8085. ? scriptExports.options
  8086. : scriptExports
  8087. // fixed by xxxxxx auto components
  8088. if (components) {
  8089. if (!options.components) {
  8090. options.components = {}
  8091. }
  8092. var hasOwn = Object.prototype.hasOwnProperty
  8093. for (var name in components) {
  8094. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8095. options.components[name] = components[name]
  8096. }
  8097. }
  8098. }
  8099. // fixed by xxxxxx renderjs
  8100. if (renderjs) {
  8101. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8102. this[renderjs.__module] = this
  8103. });
  8104. (options.mixins || (options.mixins = [])).push(renderjs)
  8105. }
  8106. // render functions
  8107. if (render) {
  8108. options.render = render
  8109. options.staticRenderFns = staticRenderFns
  8110. options._compiled = true
  8111. }
  8112. // functional template
  8113. if (functionalTemplate) {
  8114. options.functional = true
  8115. }
  8116. // scopedId
  8117. if (scopeId) {
  8118. options._scopeId = 'data-v-' + scopeId
  8119. }
  8120. var hook
  8121. if (moduleIdentifier) { // server build
  8122. hook = function (context) {
  8123. // 2.3 injection
  8124. context =
  8125. context || // cached call
  8126. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8127. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8128. // 2.2 with runInNewContext: true
  8129. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8130. context = __VUE_SSR_CONTEXT__
  8131. }
  8132. // inject component styles
  8133. if (injectStyles) {
  8134. injectStyles.call(this, context)
  8135. }
  8136. // register component module identifier for async chunk inferrence
  8137. if (context && context._registeredComponents) {
  8138. context._registeredComponents.add(moduleIdentifier)
  8139. }
  8140. }
  8141. // used by ssr in case component is cached and beforeCreate
  8142. // never gets called
  8143. options._ssrRegister = hook
  8144. } else if (injectStyles) {
  8145. hook = shadowMode
  8146. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8147. : injectStyles
  8148. }
  8149. if (hook) {
  8150. if (options.functional) {
  8151. // for template-only hot-reload because in that case the render fn doesn't
  8152. // go through the normalizer
  8153. options._injectStyles = hook
  8154. // register for functioal component in vue file
  8155. var originalRender = options.render
  8156. options.render = function renderWithStyleInjection (h, context) {
  8157. hook.call(context)
  8158. return originalRender(h, context)
  8159. }
  8160. } else {
  8161. // inject component registration as beforeCreate hook
  8162. var existing = options.beforeCreate
  8163. options.beforeCreate = existing
  8164. ? [].concat(existing, hook)
  8165. : [hook]
  8166. }
  8167. }
  8168. return {
  8169. exports: scriptExports,
  8170. options: options
  8171. }
  8172. }
  8173. /***/ }),
  8174. /* 12 */
  8175. /*!*************************************************!*\
  8176. !*** D:/code/work/broke_news_wx/store/index.js ***!
  8177. \*************************************************/
  8178. /*! no static exports found */
  8179. /***/ (function(module, exports, __webpack_require__) {
  8180. "use strict";
  8181. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));
  8182. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8183. _vue.default.use(_vuex.default);
  8184. var files = __webpack_require__(14);
  8185. var modules = {
  8186. state: {},
  8187. mutations: {},
  8188. actions: {} };
  8189. files.keys().forEach(function (key) {
  8190. Object.assign(modules.state, files(key)["state"]);
  8191. Object.assign(modules.mutations, files(key)["mutations"]);
  8192. Object.assign(modules.actions, files(key)["actions"]);
  8193. });
  8194. var store = new _vuex.default.Store(modules);var _default =
  8195. store;exports.default = _default;
  8196. /***/ }),
  8197. /* 13 */
  8198. /*!**************************************************************************************!*\
  8199. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  8200. \**************************************************************************************/
  8201. /*! no static exports found */
  8202. /***/ (function(module, exports, __webpack_require__) {
  8203. "use strict";
  8204. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8205. * vuex v3.6.2
  8206. * (c) 2021 Evan You
  8207. * @license MIT
  8208. */
  8209. function applyMixin (Vue) {
  8210. var version = Number(Vue.version.split('.')[0]);
  8211. if (version >= 2) {
  8212. Vue.mixin({ beforeCreate: vuexInit });
  8213. } else {
  8214. // override init and inject vuex init procedure
  8215. // for 1.x backwards compatibility.
  8216. var _init = Vue.prototype._init;
  8217. Vue.prototype._init = function (options) {
  8218. if ( options === void 0 ) options = {};
  8219. options.init = options.init
  8220. ? [vuexInit].concat(options.init)
  8221. : vuexInit;
  8222. _init.call(this, options);
  8223. };
  8224. }
  8225. /**
  8226. * Vuex init hook, injected into each instances init hooks list.
  8227. */
  8228. function vuexInit () {
  8229. var options = this.$options;
  8230. // store injection
  8231. if (options.store) {
  8232. this.$store = typeof options.store === 'function'
  8233. ? options.store()
  8234. : options.store;
  8235. } else if (options.parent && options.parent.$store) {
  8236. this.$store = options.parent.$store;
  8237. }
  8238. }
  8239. }
  8240. var target = typeof window !== 'undefined'
  8241. ? window
  8242. : typeof global !== 'undefined'
  8243. ? global
  8244. : {};
  8245. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8246. function devtoolPlugin (store) {
  8247. if (!devtoolHook) { return }
  8248. store._devtoolHook = devtoolHook;
  8249. devtoolHook.emit('vuex:init', store);
  8250. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  8251. store.replaceState(targetState);
  8252. });
  8253. store.subscribe(function (mutation, state) {
  8254. devtoolHook.emit('vuex:mutation', mutation, state);
  8255. }, { prepend: true });
  8256. store.subscribeAction(function (action, state) {
  8257. devtoolHook.emit('vuex:action', action, state);
  8258. }, { prepend: true });
  8259. }
  8260. /**
  8261. * Get the first item that pass the test
  8262. * by second argument function
  8263. *
  8264. * @param {Array} list
  8265. * @param {Function} f
  8266. * @return {*}
  8267. */
  8268. function find (list, f) {
  8269. return list.filter(f)[0]
  8270. }
  8271. /**
  8272. * Deep copy the given object considering circular structure.
  8273. * This function caches all nested objects and its copies.
  8274. * If it detects circular structure, use cached copy to avoid infinite loop.
  8275. *
  8276. * @param {*} obj
  8277. * @param {Array<Object>} cache
  8278. * @return {*}
  8279. */
  8280. function deepCopy (obj, cache) {
  8281. if ( cache === void 0 ) cache = [];
  8282. // just return if obj is immutable value
  8283. if (obj === null || typeof obj !== 'object') {
  8284. return obj
  8285. }
  8286. // if obj is hit, it is in circular structure
  8287. var hit = find(cache, function (c) { return c.original === obj; });
  8288. if (hit) {
  8289. return hit.copy
  8290. }
  8291. var copy = Array.isArray(obj) ? [] : {};
  8292. // put the copy into cache at first
  8293. // because we want to refer it in recursive deepCopy
  8294. cache.push({
  8295. original: obj,
  8296. copy: copy
  8297. });
  8298. Object.keys(obj).forEach(function (key) {
  8299. copy[key] = deepCopy(obj[key], cache);
  8300. });
  8301. return copy
  8302. }
  8303. /**
  8304. * forEach for object
  8305. */
  8306. function forEachValue (obj, fn) {
  8307. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  8308. }
  8309. function isObject (obj) {
  8310. return obj !== null && typeof obj === 'object'
  8311. }
  8312. function isPromise (val) {
  8313. return val && typeof val.then === 'function'
  8314. }
  8315. function assert (condition, msg) {
  8316. if (!condition) { throw new Error(("[vuex] " + msg)) }
  8317. }
  8318. function partial (fn, arg) {
  8319. return function () {
  8320. return fn(arg)
  8321. }
  8322. }
  8323. // Base data struct for store's module, package with some attribute and method
  8324. var Module = function Module (rawModule, runtime) {
  8325. this.runtime = runtime;
  8326. // Store some children item
  8327. this._children = Object.create(null);
  8328. // Store the origin module object which passed by programmer
  8329. this._rawModule = rawModule;
  8330. var rawState = rawModule.state;
  8331. // Store the origin module's state
  8332. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  8333. };
  8334. var prototypeAccessors = { namespaced: { configurable: true } };
  8335. prototypeAccessors.namespaced.get = function () {
  8336. return !!this._rawModule.namespaced
  8337. };
  8338. Module.prototype.addChild = function addChild (key, module) {
  8339. this._children[key] = module;
  8340. };
  8341. Module.prototype.removeChild = function removeChild (key) {
  8342. delete this._children[key];
  8343. };
  8344. Module.prototype.getChild = function getChild (key) {
  8345. return this._children[key]
  8346. };
  8347. Module.prototype.hasChild = function hasChild (key) {
  8348. return key in this._children
  8349. };
  8350. Module.prototype.update = function update (rawModule) {
  8351. this._rawModule.namespaced = rawModule.namespaced;
  8352. if (rawModule.actions) {
  8353. this._rawModule.actions = rawModule.actions;
  8354. }
  8355. if (rawModule.mutations) {
  8356. this._rawModule.mutations = rawModule.mutations;
  8357. }
  8358. if (rawModule.getters) {
  8359. this._rawModule.getters = rawModule.getters;
  8360. }
  8361. };
  8362. Module.prototype.forEachChild = function forEachChild (fn) {
  8363. forEachValue(this._children, fn);
  8364. };
  8365. Module.prototype.forEachGetter = function forEachGetter (fn) {
  8366. if (this._rawModule.getters) {
  8367. forEachValue(this._rawModule.getters, fn);
  8368. }
  8369. };
  8370. Module.prototype.forEachAction = function forEachAction (fn) {
  8371. if (this._rawModule.actions) {
  8372. forEachValue(this._rawModule.actions, fn);
  8373. }
  8374. };
  8375. Module.prototype.forEachMutation = function forEachMutation (fn) {
  8376. if (this._rawModule.mutations) {
  8377. forEachValue(this._rawModule.mutations, fn);
  8378. }
  8379. };
  8380. Object.defineProperties( Module.prototype, prototypeAccessors );
  8381. var ModuleCollection = function ModuleCollection (rawRootModule) {
  8382. // register root module (Vuex.Store options)
  8383. this.register([], rawRootModule, false);
  8384. };
  8385. ModuleCollection.prototype.get = function get (path) {
  8386. return path.reduce(function (module, key) {
  8387. return module.getChild(key)
  8388. }, this.root)
  8389. };
  8390. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  8391. var module = this.root;
  8392. return path.reduce(function (namespace, key) {
  8393. module = module.getChild(key);
  8394. return namespace + (module.namespaced ? key + '/' : '')
  8395. }, '')
  8396. };
  8397. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  8398. update([], this.root, rawRootModule);
  8399. };
  8400. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  8401. var this$1 = this;
  8402. if ( runtime === void 0 ) runtime = true;
  8403. if ((true)) {
  8404. assertRawModule(path, rawModule);
  8405. }
  8406. var newModule = new Module(rawModule, runtime);
  8407. if (path.length === 0) {
  8408. this.root = newModule;
  8409. } else {
  8410. var parent = this.get(path.slice(0, -1));
  8411. parent.addChild(path[path.length - 1], newModule);
  8412. }
  8413. // register nested modules
  8414. if (rawModule.modules) {
  8415. forEachValue(rawModule.modules, function (rawChildModule, key) {
  8416. this$1.register(path.concat(key), rawChildModule, runtime);
  8417. });
  8418. }
  8419. };
  8420. ModuleCollection.prototype.unregister = function unregister (path) {
  8421. var parent = this.get(path.slice(0, -1));
  8422. var key = path[path.length - 1];
  8423. var child = parent.getChild(key);
  8424. if (!child) {
  8425. if ((true)) {
  8426. console.warn(
  8427. "[vuex] trying to unregister module '" + key + "', which is " +
  8428. "not registered"
  8429. );
  8430. }
  8431. return
  8432. }
  8433. if (!child.runtime) {
  8434. return
  8435. }
  8436. parent.removeChild(key);
  8437. };
  8438. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  8439. var parent = this.get(path.slice(0, -1));
  8440. var key = path[path.length - 1];
  8441. if (parent) {
  8442. return parent.hasChild(key)
  8443. }
  8444. return false
  8445. };
  8446. function update (path, targetModule, newModule) {
  8447. if ((true)) {
  8448. assertRawModule(path, newModule);
  8449. }
  8450. // update target module
  8451. targetModule.update(newModule);
  8452. // update nested modules
  8453. if (newModule.modules) {
  8454. for (var key in newModule.modules) {
  8455. if (!targetModule.getChild(key)) {
  8456. if ((true)) {
  8457. console.warn(
  8458. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  8459. 'manual reload is needed'
  8460. );
  8461. }
  8462. return
  8463. }
  8464. update(
  8465. path.concat(key),
  8466. targetModule.getChild(key),
  8467. newModule.modules[key]
  8468. );
  8469. }
  8470. }
  8471. }
  8472. var functionAssert = {
  8473. assert: function (value) { return typeof value === 'function'; },
  8474. expected: 'function'
  8475. };
  8476. var objectAssert = {
  8477. assert: function (value) { return typeof value === 'function' ||
  8478. (typeof value === 'object' && typeof value.handler === 'function'); },
  8479. expected: 'function or object with "handler" function'
  8480. };
  8481. var assertTypes = {
  8482. getters: functionAssert,
  8483. mutations: functionAssert,
  8484. actions: objectAssert
  8485. };
  8486. function assertRawModule (path, rawModule) {
  8487. Object.keys(assertTypes).forEach(function (key) {
  8488. if (!rawModule[key]) { return }
  8489. var assertOptions = assertTypes[key];
  8490. forEachValue(rawModule[key], function (value, type) {
  8491. assert(
  8492. assertOptions.assert(value),
  8493. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  8494. );
  8495. });
  8496. });
  8497. }
  8498. function makeAssertionMessage (path, key, type, value, expected) {
  8499. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  8500. if (path.length > 0) {
  8501. buf += " in module \"" + (path.join('.')) + "\"";
  8502. }
  8503. buf += " is " + (JSON.stringify(value)) + ".";
  8504. return buf
  8505. }
  8506. var Vue; // bind on install
  8507. var Store = function Store (options) {
  8508. var this$1 = this;
  8509. if ( options === void 0 ) options = {};
  8510. // Auto install if it is not done yet and `window` has `Vue`.
  8511. // To allow users to avoid auto-installation in some cases,
  8512. // this code should be placed here. See #731
  8513. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  8514. install(window.Vue);
  8515. }
  8516. if ((true)) {
  8517. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  8518. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  8519. assert(this instanceof Store, "store must be called with the new operator.");
  8520. }
  8521. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  8522. var strict = options.strict; if ( strict === void 0 ) strict = false;
  8523. // store internal state
  8524. this._committing = false;
  8525. this._actions = Object.create(null);
  8526. this._actionSubscribers = [];
  8527. this._mutations = Object.create(null);
  8528. this._wrappedGetters = Object.create(null);
  8529. this._modules = new ModuleCollection(options);
  8530. this._modulesNamespaceMap = Object.create(null);
  8531. this._subscribers = [];
  8532. this._watcherVM = new Vue();
  8533. this._makeLocalGettersCache = Object.create(null);
  8534. // bind commit and dispatch to self
  8535. var store = this;
  8536. var ref = this;
  8537. var dispatch = ref.dispatch;
  8538. var commit = ref.commit;
  8539. this.dispatch = function boundDispatch (type, payload) {
  8540. return dispatch.call(store, type, payload)
  8541. };
  8542. this.commit = function boundCommit (type, payload, options) {
  8543. return commit.call(store, type, payload, options)
  8544. };
  8545. // strict mode
  8546. this.strict = strict;
  8547. var state = this._modules.root.state;
  8548. // init root module.
  8549. // this also recursively registers all sub-modules
  8550. // and collects all module getters inside this._wrappedGetters
  8551. installModule(this, state, [], this._modules.root);
  8552. // initialize the store vm, which is responsible for the reactivity
  8553. // (also registers _wrappedGetters as computed properties)
  8554. resetStoreVM(this, state);
  8555. // apply plugins
  8556. plugins.forEach(function (plugin) { return plugin(this$1); });
  8557. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  8558. if (useDevtools) {
  8559. devtoolPlugin(this);
  8560. }
  8561. };
  8562. var prototypeAccessors$1 = { state: { configurable: true } };
  8563. prototypeAccessors$1.state.get = function () {
  8564. return this._vm._data.$$state
  8565. };
  8566. prototypeAccessors$1.state.set = function (v) {
  8567. if ((true)) {
  8568. assert(false, "use store.replaceState() to explicit replace store state.");
  8569. }
  8570. };
  8571. Store.prototype.commit = function commit (_type, _payload, _options) {
  8572. var this$1 = this;
  8573. // check object-style commit
  8574. var ref = unifyObjectStyle(_type, _payload, _options);
  8575. var type = ref.type;
  8576. var payload = ref.payload;
  8577. var options = ref.options;
  8578. var mutation = { type: type, payload: payload };
  8579. var entry = this._mutations[type];
  8580. if (!entry) {
  8581. if ((true)) {
  8582. console.error(("[vuex] unknown mutation type: " + type));
  8583. }
  8584. return
  8585. }
  8586. this._withCommit(function () {
  8587. entry.forEach(function commitIterator (handler) {
  8588. handler(payload);
  8589. });
  8590. });
  8591. this._subscribers
  8592. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8593. .forEach(function (sub) { return sub(mutation, this$1.state); });
  8594. if (
  8595. ( true) &&
  8596. options && options.silent
  8597. ) {
  8598. console.warn(
  8599. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  8600. 'Use the filter functionality in the vue-devtools'
  8601. );
  8602. }
  8603. };
  8604. Store.prototype.dispatch = function dispatch (_type, _payload) {
  8605. var this$1 = this;
  8606. // check object-style dispatch
  8607. var ref = unifyObjectStyle(_type, _payload);
  8608. var type = ref.type;
  8609. var payload = ref.payload;
  8610. var action = { type: type, payload: payload };
  8611. var entry = this._actions[type];
  8612. if (!entry) {
  8613. if ((true)) {
  8614. console.error(("[vuex] unknown action type: " + type));
  8615. }
  8616. return
  8617. }
  8618. try {
  8619. this._actionSubscribers
  8620. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8621. .filter(function (sub) { return sub.before; })
  8622. .forEach(function (sub) { return sub.before(action, this$1.state); });
  8623. } catch (e) {
  8624. if ((true)) {
  8625. console.warn("[vuex] error in before action subscribers: ");
  8626. console.error(e);
  8627. }
  8628. }
  8629. var result = entry.length > 1
  8630. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  8631. : entry[0](payload);
  8632. return new Promise(function (resolve, reject) {
  8633. result.then(function (res) {
  8634. try {
  8635. this$1._actionSubscribers
  8636. .filter(function (sub) { return sub.after; })
  8637. .forEach(function (sub) { return sub.after(action, this$1.state); });
  8638. } catch (e) {
  8639. if ((true)) {
  8640. console.warn("[vuex] error in after action subscribers: ");
  8641. console.error(e);
  8642. }
  8643. }
  8644. resolve(res);
  8645. }, function (error) {
  8646. try {
  8647. this$1._actionSubscribers
  8648. .filter(function (sub) { return sub.error; })
  8649. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  8650. } catch (e) {
  8651. if ((true)) {
  8652. console.warn("[vuex] error in error action subscribers: ");
  8653. console.error(e);
  8654. }
  8655. }
  8656. reject(error);
  8657. });
  8658. })
  8659. };
  8660. Store.prototype.subscribe = function subscribe (fn, options) {
  8661. return genericSubscribe(fn, this._subscribers, options)
  8662. };
  8663. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  8664. var subs = typeof fn === 'function' ? { before: fn } : fn;
  8665. return genericSubscribe(subs, this._actionSubscribers, options)
  8666. };
  8667. Store.prototype.watch = function watch (getter, cb, options) {
  8668. var this$1 = this;
  8669. if ((true)) {
  8670. assert(typeof getter === 'function', "store.watch only accepts a function.");
  8671. }
  8672. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  8673. };
  8674. Store.prototype.replaceState = function replaceState (state) {
  8675. var this$1 = this;
  8676. this._withCommit(function () {
  8677. this$1._vm._data.$$state = state;
  8678. });
  8679. };
  8680. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  8681. if ( options === void 0 ) options = {};
  8682. if (typeof path === 'string') { path = [path]; }
  8683. if ((true)) {
  8684. assert(Array.isArray(path), "module path must be a string or an Array.");
  8685. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  8686. }
  8687. this._modules.register(path, rawModule);
  8688. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  8689. // reset store to update getters...
  8690. resetStoreVM(this, this.state);
  8691. };
  8692. Store.prototype.unregisterModule = function unregisterModule (path) {
  8693. var this$1 = this;
  8694. if (typeof path === 'string') { path = [path]; }
  8695. if ((true)) {
  8696. assert(Array.isArray(path), "module path must be a string or an Array.");
  8697. }
  8698. this._modules.unregister(path);
  8699. this._withCommit(function () {
  8700. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  8701. Vue.delete(parentState, path[path.length - 1]);
  8702. });
  8703. resetStore(this);
  8704. };
  8705. Store.prototype.hasModule = function hasModule (path) {
  8706. if (typeof path === 'string') { path = [path]; }
  8707. if ((true)) {
  8708. assert(Array.isArray(path), "module path must be a string or an Array.");
  8709. }
  8710. return this._modules.isRegistered(path)
  8711. };
  8712. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  8713. this._modules.update(newOptions);
  8714. resetStore(this, true);
  8715. };
  8716. Store.prototype._withCommit = function _withCommit (fn) {
  8717. var committing = this._committing;
  8718. this._committing = true;
  8719. fn();
  8720. this._committing = committing;
  8721. };
  8722. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  8723. function genericSubscribe (fn, subs, options) {
  8724. if (subs.indexOf(fn) < 0) {
  8725. options && options.prepend
  8726. ? subs.unshift(fn)
  8727. : subs.push(fn);
  8728. }
  8729. return function () {
  8730. var i = subs.indexOf(fn);
  8731. if (i > -1) {
  8732. subs.splice(i, 1);
  8733. }
  8734. }
  8735. }
  8736. function resetStore (store, hot) {
  8737. store._actions = Object.create(null);
  8738. store._mutations = Object.create(null);
  8739. store._wrappedGetters = Object.create(null);
  8740. store._modulesNamespaceMap = Object.create(null);
  8741. var state = store.state;
  8742. // init all modules
  8743. installModule(store, state, [], store._modules.root, true);
  8744. // reset vm
  8745. resetStoreVM(store, state, hot);
  8746. }
  8747. function resetStoreVM (store, state, hot) {
  8748. var oldVm = store._vm;
  8749. // bind store public getters
  8750. store.getters = {};
  8751. // reset local getters cache
  8752. store._makeLocalGettersCache = Object.create(null);
  8753. var wrappedGetters = store._wrappedGetters;
  8754. var computed = {};
  8755. forEachValue(wrappedGetters, function (fn, key) {
  8756. // use computed to leverage its lazy-caching mechanism
  8757. // direct inline function use will lead to closure preserving oldVm.
  8758. // using partial to return function with only arguments preserved in closure environment.
  8759. computed[key] = partial(fn, store);
  8760. Object.defineProperty(store.getters, key, {
  8761. get: function () { return store._vm[key]; },
  8762. enumerable: true // for local getters
  8763. });
  8764. });
  8765. // use a Vue instance to store the state tree
  8766. // suppress warnings just in case the user has added
  8767. // some funky global mixins
  8768. var silent = Vue.config.silent;
  8769. Vue.config.silent = true;
  8770. store._vm = new Vue({
  8771. data: {
  8772. $$state: state
  8773. },
  8774. computed: computed
  8775. });
  8776. Vue.config.silent = silent;
  8777. // enable strict mode for new vm
  8778. if (store.strict) {
  8779. enableStrictMode(store);
  8780. }
  8781. if (oldVm) {
  8782. if (hot) {
  8783. // dispatch changes in all subscribed watchers
  8784. // to force getter re-evaluation for hot reloading.
  8785. store._withCommit(function () {
  8786. oldVm._data.$$state = null;
  8787. });
  8788. }
  8789. Vue.nextTick(function () { return oldVm.$destroy(); });
  8790. }
  8791. }
  8792. function installModule (store, rootState, path, module, hot) {
  8793. var isRoot = !path.length;
  8794. var namespace = store._modules.getNamespace(path);
  8795. // register in namespace map
  8796. if (module.namespaced) {
  8797. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  8798. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  8799. }
  8800. store._modulesNamespaceMap[namespace] = module;
  8801. }
  8802. // set state
  8803. if (!isRoot && !hot) {
  8804. var parentState = getNestedState(rootState, path.slice(0, -1));
  8805. var moduleName = path[path.length - 1];
  8806. store._withCommit(function () {
  8807. if ((true)) {
  8808. if (moduleName in parentState) {
  8809. console.warn(
  8810. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  8811. );
  8812. }
  8813. }
  8814. Vue.set(parentState, moduleName, module.state);
  8815. });
  8816. }
  8817. var local = module.context = makeLocalContext(store, namespace, path);
  8818. module.forEachMutation(function (mutation, key) {
  8819. var namespacedType = namespace + key;
  8820. registerMutation(store, namespacedType, mutation, local);
  8821. });
  8822. module.forEachAction(function (action, key) {
  8823. var type = action.root ? key : namespace + key;
  8824. var handler = action.handler || action;
  8825. registerAction(store, type, handler, local);
  8826. });
  8827. module.forEachGetter(function (getter, key) {
  8828. var namespacedType = namespace + key;
  8829. registerGetter(store, namespacedType, getter, local);
  8830. });
  8831. module.forEachChild(function (child, key) {
  8832. installModule(store, rootState, path.concat(key), child, hot);
  8833. });
  8834. }
  8835. /**
  8836. * make localized dispatch, commit, getters and state
  8837. * if there is no namespace, just use root ones
  8838. */
  8839. function makeLocalContext (store, namespace, path) {
  8840. var noNamespace = namespace === '';
  8841. var local = {
  8842. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  8843. var args = unifyObjectStyle(_type, _payload, _options);
  8844. var payload = args.payload;
  8845. var options = args.options;
  8846. var type = args.type;
  8847. if (!options || !options.root) {
  8848. type = namespace + type;
  8849. if (( true) && !store._actions[type]) {
  8850. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  8851. return
  8852. }
  8853. }
  8854. return store.dispatch(type, payload)
  8855. },
  8856. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  8857. var args = unifyObjectStyle(_type, _payload, _options);
  8858. var payload = args.payload;
  8859. var options = args.options;
  8860. var type = args.type;
  8861. if (!options || !options.root) {
  8862. type = namespace + type;
  8863. if (( true) && !store._mutations[type]) {
  8864. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  8865. return
  8866. }
  8867. }
  8868. store.commit(type, payload, options);
  8869. }
  8870. };
  8871. // getters and state object must be gotten lazily
  8872. // because they will be changed by vm update
  8873. Object.defineProperties(local, {
  8874. getters: {
  8875. get: noNamespace
  8876. ? function () { return store.getters; }
  8877. : function () { return makeLocalGetters(store, namespace); }
  8878. },
  8879. state: {
  8880. get: function () { return getNestedState(store.state, path); }
  8881. }
  8882. });
  8883. return local
  8884. }
  8885. function makeLocalGetters (store, namespace) {
  8886. if (!store._makeLocalGettersCache[namespace]) {
  8887. var gettersProxy = {};
  8888. var splitPos = namespace.length;
  8889. Object.keys(store.getters).forEach(function (type) {
  8890. // skip if the target getter is not match this namespace
  8891. if (type.slice(0, splitPos) !== namespace) { return }
  8892. // extract local getter type
  8893. var localType = type.slice(splitPos);
  8894. // Add a port to the getters proxy.
  8895. // Define as getter property because
  8896. // we do not want to evaluate the getters in this time.
  8897. Object.defineProperty(gettersProxy, localType, {
  8898. get: function () { return store.getters[type]; },
  8899. enumerable: true
  8900. });
  8901. });
  8902. store._makeLocalGettersCache[namespace] = gettersProxy;
  8903. }
  8904. return store._makeLocalGettersCache[namespace]
  8905. }
  8906. function registerMutation (store, type, handler, local) {
  8907. var entry = store._mutations[type] || (store._mutations[type] = []);
  8908. entry.push(function wrappedMutationHandler (payload) {
  8909. handler.call(store, local.state, payload);
  8910. });
  8911. }
  8912. function registerAction (store, type, handler, local) {
  8913. var entry = store._actions[type] || (store._actions[type] = []);
  8914. entry.push(function wrappedActionHandler (payload) {
  8915. var res = handler.call(store, {
  8916. dispatch: local.dispatch,
  8917. commit: local.commit,
  8918. getters: local.getters,
  8919. state: local.state,
  8920. rootGetters: store.getters,
  8921. rootState: store.state
  8922. }, payload);
  8923. if (!isPromise(res)) {
  8924. res = Promise.resolve(res);
  8925. }
  8926. if (store._devtoolHook) {
  8927. return res.catch(function (err) {
  8928. store._devtoolHook.emit('vuex:error', err);
  8929. throw err
  8930. })
  8931. } else {
  8932. return res
  8933. }
  8934. });
  8935. }
  8936. function registerGetter (store, type, rawGetter, local) {
  8937. if (store._wrappedGetters[type]) {
  8938. if ((true)) {
  8939. console.error(("[vuex] duplicate getter key: " + type));
  8940. }
  8941. return
  8942. }
  8943. store._wrappedGetters[type] = function wrappedGetter (store) {
  8944. return rawGetter(
  8945. local.state, // local state
  8946. local.getters, // local getters
  8947. store.state, // root state
  8948. store.getters // root getters
  8949. )
  8950. };
  8951. }
  8952. function enableStrictMode (store) {
  8953. store._vm.$watch(function () { return this._data.$$state }, function () {
  8954. if ((true)) {
  8955. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  8956. }
  8957. }, { deep: true, sync: true });
  8958. }
  8959. function getNestedState (state, path) {
  8960. return path.reduce(function (state, key) { return state[key]; }, state)
  8961. }
  8962. function unifyObjectStyle (type, payload, options) {
  8963. if (isObject(type) && type.type) {
  8964. options = payload;
  8965. payload = type;
  8966. type = type.type;
  8967. }
  8968. if ((true)) {
  8969. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  8970. }
  8971. return { type: type, payload: payload, options: options }
  8972. }
  8973. function install (_Vue) {
  8974. if (Vue && _Vue === Vue) {
  8975. if ((true)) {
  8976. console.error(
  8977. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  8978. );
  8979. }
  8980. return
  8981. }
  8982. Vue = _Vue;
  8983. applyMixin(Vue);
  8984. }
  8985. /**
  8986. * Reduce the code which written in Vue.js for getting the state.
  8987. * @param {String} [namespace] - Module's namespace
  8988. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  8989. * @param {Object}
  8990. */
  8991. var mapState = normalizeNamespace(function (namespace, states) {
  8992. var res = {};
  8993. if (( true) && !isValidMap(states)) {
  8994. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  8995. }
  8996. normalizeMap(states).forEach(function (ref) {
  8997. var key = ref.key;
  8998. var val = ref.val;
  8999. res[key] = function mappedState () {
  9000. var state = this.$store.state;
  9001. var getters = this.$store.getters;
  9002. if (namespace) {
  9003. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  9004. if (!module) {
  9005. return
  9006. }
  9007. state = module.context.state;
  9008. getters = module.context.getters;
  9009. }
  9010. return typeof val === 'function'
  9011. ? val.call(this, state, getters)
  9012. : state[val]
  9013. };
  9014. // mark vuex getter for devtools
  9015. res[key].vuex = true;
  9016. });
  9017. return res
  9018. });
  9019. /**
  9020. * Reduce the code which written in Vue.js for committing the mutation
  9021. * @param {String} [namespace] - Module's namespace
  9022. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9023. * @return {Object}
  9024. */
  9025. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  9026. var res = {};
  9027. if (( true) && !isValidMap(mutations)) {
  9028. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  9029. }
  9030. normalizeMap(mutations).forEach(function (ref) {
  9031. var key = ref.key;
  9032. var val = ref.val;
  9033. res[key] = function mappedMutation () {
  9034. var args = [], len = arguments.length;
  9035. while ( len-- ) args[ len ] = arguments[ len ];
  9036. // Get the commit method from store
  9037. var commit = this.$store.commit;
  9038. if (namespace) {
  9039. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  9040. if (!module) {
  9041. return
  9042. }
  9043. commit = module.context.commit;
  9044. }
  9045. return typeof val === 'function'
  9046. ? val.apply(this, [commit].concat(args))
  9047. : commit.apply(this.$store, [val].concat(args))
  9048. };
  9049. });
  9050. return res
  9051. });
  9052. /**
  9053. * Reduce the code which written in Vue.js for getting the getters
  9054. * @param {String} [namespace] - Module's namespace
  9055. * @param {Object|Array} getters
  9056. * @return {Object}
  9057. */
  9058. var mapGetters = normalizeNamespace(function (namespace, getters) {
  9059. var res = {};
  9060. if (( true) && !isValidMap(getters)) {
  9061. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  9062. }
  9063. normalizeMap(getters).forEach(function (ref) {
  9064. var key = ref.key;
  9065. var val = ref.val;
  9066. // The namespace has been mutated by normalizeNamespace
  9067. val = namespace + val;
  9068. res[key] = function mappedGetter () {
  9069. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  9070. return
  9071. }
  9072. if (( true) && !(val in this.$store.getters)) {
  9073. console.error(("[vuex] unknown getter: " + val));
  9074. return
  9075. }
  9076. return this.$store.getters[val]
  9077. };
  9078. // mark vuex getter for devtools
  9079. res[key].vuex = true;
  9080. });
  9081. return res
  9082. });
  9083. /**
  9084. * Reduce the code which written in Vue.js for dispatch the action
  9085. * @param {String} [namespace] - Module's namespace
  9086. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9087. * @return {Object}
  9088. */
  9089. var mapActions = normalizeNamespace(function (namespace, actions) {
  9090. var res = {};
  9091. if (( true) && !isValidMap(actions)) {
  9092. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  9093. }
  9094. normalizeMap(actions).forEach(function (ref) {
  9095. var key = ref.key;
  9096. var val = ref.val;
  9097. res[key] = function mappedAction () {
  9098. var args = [], len = arguments.length;
  9099. while ( len-- ) args[ len ] = arguments[ len ];
  9100. // get dispatch function from store
  9101. var dispatch = this.$store.dispatch;
  9102. if (namespace) {
  9103. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  9104. if (!module) {
  9105. return
  9106. }
  9107. dispatch = module.context.dispatch;
  9108. }
  9109. return typeof val === 'function'
  9110. ? val.apply(this, [dispatch].concat(args))
  9111. : dispatch.apply(this.$store, [val].concat(args))
  9112. };
  9113. });
  9114. return res
  9115. });
  9116. /**
  9117. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  9118. * @param {String} namespace
  9119. * @return {Object}
  9120. */
  9121. var createNamespacedHelpers = function (namespace) { return ({
  9122. mapState: mapState.bind(null, namespace),
  9123. mapGetters: mapGetters.bind(null, namespace),
  9124. mapMutations: mapMutations.bind(null, namespace),
  9125. mapActions: mapActions.bind(null, namespace)
  9126. }); };
  9127. /**
  9128. * Normalize the map
  9129. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  9130. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  9131. * @param {Array|Object} map
  9132. * @return {Object}
  9133. */
  9134. function normalizeMap (map) {
  9135. if (!isValidMap(map)) {
  9136. return []
  9137. }
  9138. return Array.isArray(map)
  9139. ? map.map(function (key) { return ({ key: key, val: key }); })
  9140. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  9141. }
  9142. /**
  9143. * Validate whether given map is valid or not
  9144. * @param {*} map
  9145. * @return {Boolean}
  9146. */
  9147. function isValidMap (map) {
  9148. return Array.isArray(map) || isObject(map)
  9149. }
  9150. /**
  9151. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  9152. * @param {Function} fn
  9153. * @return {Function}
  9154. */
  9155. function normalizeNamespace (fn) {
  9156. return function (namespace, map) {
  9157. if (typeof namespace !== 'string') {
  9158. map = namespace;
  9159. namespace = '';
  9160. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  9161. namespace += '/';
  9162. }
  9163. return fn(namespace, map)
  9164. }
  9165. }
  9166. /**
  9167. * Search a special module from store by namespace. if module not exist, print error message.
  9168. * @param {Object} store
  9169. * @param {String} helper
  9170. * @param {String} namespace
  9171. * @return {Object}
  9172. */
  9173. function getModuleByNamespace (store, helper, namespace) {
  9174. var module = store._modulesNamespaceMap[namespace];
  9175. if (( true) && !module) {
  9176. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  9177. }
  9178. return module
  9179. }
  9180. // Credits: borrowed code from fcomb/redux-logger
  9181. function createLogger (ref) {
  9182. if ( ref === void 0 ) ref = {};
  9183. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  9184. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  9185. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  9186. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  9187. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  9188. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  9189. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  9190. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  9191. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  9192. return function (store) {
  9193. var prevState = deepCopy(store.state);
  9194. if (typeof logger === 'undefined') {
  9195. return
  9196. }
  9197. if (logMutations) {
  9198. store.subscribe(function (mutation, state) {
  9199. var nextState = deepCopy(state);
  9200. if (filter(mutation, prevState, nextState)) {
  9201. var formattedTime = getFormattedTime();
  9202. var formattedMutation = mutationTransformer(mutation);
  9203. var message = "mutation " + (mutation.type) + formattedTime;
  9204. startMessage(logger, message, collapsed);
  9205. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  9206. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  9207. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  9208. endMessage(logger);
  9209. }
  9210. prevState = nextState;
  9211. });
  9212. }
  9213. if (logActions) {
  9214. store.subscribeAction(function (action, state) {
  9215. if (actionFilter(action, state)) {
  9216. var formattedTime = getFormattedTime();
  9217. var formattedAction = actionTransformer(action);
  9218. var message = "action " + (action.type) + formattedTime;
  9219. startMessage(logger, message, collapsed);
  9220. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  9221. endMessage(logger);
  9222. }
  9223. });
  9224. }
  9225. }
  9226. }
  9227. function startMessage (logger, message, collapsed) {
  9228. var startMessage = collapsed
  9229. ? logger.groupCollapsed
  9230. : logger.group;
  9231. // render
  9232. try {
  9233. startMessage.call(logger, message);
  9234. } catch (e) {
  9235. logger.log(message);
  9236. }
  9237. }
  9238. function endMessage (logger) {
  9239. try {
  9240. logger.groupEnd();
  9241. } catch (e) {
  9242. logger.log('—— log end ——');
  9243. }
  9244. }
  9245. function getFormattedTime () {
  9246. var time = new Date();
  9247. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  9248. }
  9249. function repeat (str, times) {
  9250. return (new Array(times + 1)).join(str)
  9251. }
  9252. function pad (num, maxLength) {
  9253. return repeat('0', maxLength - num.toString().length) + num
  9254. }
  9255. var index_cjs = {
  9256. Store: Store,
  9257. install: install,
  9258. version: '3.6.2',
  9259. mapState: mapState,
  9260. mapMutations: mapMutations,
  9261. mapGetters: mapGetters,
  9262. mapActions: mapActions,
  9263. createNamespacedHelpers: createNamespacedHelpers,
  9264. createLogger: createLogger
  9265. };
  9266. module.exports = index_cjs;
  9267. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  9268. /***/ }),
  9269. /* 14 */
  9270. /*!************************************************************************!*\
  9271. !*** D:/code/work/broke_news_wx/store/modules sync nonrecursive \.js$ ***!
  9272. \************************************************************************/
  9273. /*! no static exports found */
  9274. /***/ (function(module, exports, __webpack_require__) {
  9275. var map = {
  9276. "./user.js": 15
  9277. };
  9278. function webpackContext(req) {
  9279. var id = webpackContextResolve(req);
  9280. return __webpack_require__(id);
  9281. }
  9282. function webpackContextResolve(req) {
  9283. if(!__webpack_require__.o(map, req)) {
  9284. var e = new Error("Cannot find module '" + req + "'");
  9285. e.code = 'MODULE_NOT_FOUND';
  9286. throw e;
  9287. }
  9288. return map[req];
  9289. }
  9290. webpackContext.keys = function webpackContextKeys() {
  9291. return Object.keys(map);
  9292. };
  9293. webpackContext.resolve = webpackContextResolve;
  9294. module.exports = webpackContext;
  9295. webpackContext.id = 14;
  9296. /***/ }),
  9297. /* 15 */
  9298. /*!********************************************************!*\
  9299. !*** D:/code/work/broke_news_wx/store/modules/user.js ***!
  9300. \********************************************************/
  9301. /*! no static exports found */
  9302. /***/ (function(module, exports, __webpack_require__) {
  9303. "use strict";
  9304. Object.defineProperty(exports, "__esModule", { value: true });exports.actions = exports.mutations = exports.state = void 0;var state = {
  9305. //用户数据
  9306. userInfo: {
  9307. phone: '',
  9308. name: '' } };exports.state = state;
  9309. var mutations = {
  9310. //储存用户信息
  9311. setUserInfo: function setUserInfo(state, data) {
  9312. if (data) {
  9313. state.userInfo = Object.assign({}, state.userInfo, data);
  9314. }
  9315. },
  9316. emptyUserInfo: function emptyUserInfo(state) {
  9317. state.userInfo = {};
  9318. }
  9319. // 退出A
  9320. };exports.mutations = mutations;
  9321. var actions = {};exports.actions = actions;
  9322. /***/ }),
  9323. /* 16 */
  9324. /*!********************************************************!*\
  9325. !*** D:/code/work/broke_news_wx/js_sdk/share/index.js ***!
  9326. \********************************************************/
  9327. /*! no static exports found */
  9328. /***/ (function(module, exports, __webpack_require__) {
  9329. "use strict";
  9330. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp -> 小程序分享能力
  9331. var _default = {
  9332. data: function data() {
  9333. return {
  9334. //设置默认的分享参数
  9335. share: {
  9336. share_title: '快报嗨享平台',
  9337. share_path: '/pages/index/index',
  9338. share_imageUrl: '',
  9339. share_desc: '',
  9340. share_content: '' } };
  9341. },
  9342. onShareAppMessage: function onShareAppMessage(res) {
  9343. return {
  9344. // title: this.share.share_title,
  9345. // path: this.share.share_path,
  9346. // imageUrl: this.share.share_imageUrl,
  9347. // desc: this.share.share_desc,
  9348. // content: this.share.share_content,
  9349. // success(res) {
  9350. // uni.showToast({
  9351. // title: '分享成功'
  9352. // })
  9353. // },
  9354. // fail(res) {
  9355. // uni.showToast({
  9356. // title: '分享失败',
  9357. // icon: 'none'
  9358. // })
  9359. // }
  9360. };
  9361. },
  9362. //分享到朋友圈
  9363. onShareTimeline: function onShareTimeline(res) {
  9364. return {
  9365. // title: this.share.share_title,
  9366. // type: 0,
  9367. // summary: "",
  9368. };
  9369. } };exports.default = _default;
  9370. /***/ }),
  9371. /* 17 */,
  9372. /* 18 */,
  9373. /* 19 */,
  9374. /* 20 */,
  9375. /* 21 */,
  9376. /* 22 */,
  9377. /* 23 */
  9378. /*!**********************************************************!*\
  9379. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  9380. \**********************************************************/
  9381. /*! no static exports found */
  9382. /***/ (function(module, exports, __webpack_require__) {
  9383. module.exports = __webpack_require__(/*! regenerator-runtime */ 24);
  9384. /***/ }),
  9385. /* 24 */
  9386. /*!************************************************************!*\
  9387. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  9388. \************************************************************/
  9389. /*! no static exports found */
  9390. /***/ (function(module, exports, __webpack_require__) {
  9391. /**
  9392. * Copyright (c) 2014-present, Facebook, Inc.
  9393. *
  9394. * This source code is licensed under the MIT license found in the
  9395. * LICENSE file in the root directory of this source tree.
  9396. */
  9397. // This method of obtaining a reference to the global object needs to be
  9398. // kept identical to the way it is obtained in runtime.js
  9399. var g = (function() {
  9400. return this || (typeof self === "object" && self);
  9401. })() || Function("return this")();
  9402. // Use `getOwnPropertyNames` because not all browsers support calling
  9403. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  9404. var hadRuntime = g.regeneratorRuntime &&
  9405. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  9406. // Save the old regeneratorRuntime in case it needs to be restored later.
  9407. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  9408. // Force reevalutation of runtime.js.
  9409. g.regeneratorRuntime = undefined;
  9410. module.exports = __webpack_require__(/*! ./runtime */ 25);
  9411. if (hadRuntime) {
  9412. // Restore the original runtime.
  9413. g.regeneratorRuntime = oldRuntime;
  9414. } else {
  9415. // Remove the global property added by runtime.js.
  9416. try {
  9417. delete g.regeneratorRuntime;
  9418. } catch(e) {
  9419. g.regeneratorRuntime = undefined;
  9420. }
  9421. }
  9422. /***/ }),
  9423. /* 25 */
  9424. /*!*****************************************************!*\
  9425. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  9426. \*****************************************************/
  9427. /*! no static exports found */
  9428. /***/ (function(module, exports) {
  9429. /**
  9430. * Copyright (c) 2014-present, Facebook, Inc.
  9431. *
  9432. * This source code is licensed under the MIT license found in the
  9433. * LICENSE file in the root directory of this source tree.
  9434. */
  9435. !(function(global) {
  9436. "use strict";
  9437. var Op = Object.prototype;
  9438. var hasOwn = Op.hasOwnProperty;
  9439. var undefined; // More compressible than void 0.
  9440. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  9441. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  9442. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  9443. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9444. var inModule = typeof module === "object";
  9445. var runtime = global.regeneratorRuntime;
  9446. if (runtime) {
  9447. if (inModule) {
  9448. // If regeneratorRuntime is defined globally and we're in a module,
  9449. // make the exports object identical to regeneratorRuntime.
  9450. module.exports = runtime;
  9451. }
  9452. // Don't bother evaluating the rest of this file if the runtime was
  9453. // already defined globally.
  9454. return;
  9455. }
  9456. // Define the runtime globally (as expected by generated code) as either
  9457. // module.exports (if we're in a module) or a new, empty object.
  9458. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  9459. function wrap(innerFn, outerFn, self, tryLocsList) {
  9460. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9461. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9462. var generator = Object.create(protoGenerator.prototype);
  9463. var context = new Context(tryLocsList || []);
  9464. // The ._invoke method unifies the implementations of the .next,
  9465. // .throw, and .return methods.
  9466. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9467. return generator;
  9468. }
  9469. runtime.wrap = wrap;
  9470. // Try/catch helper to minimize deoptimizations. Returns a completion
  9471. // record like context.tryEntries[i].completion. This interface could
  9472. // have been (and was previously) designed to take a closure to be
  9473. // invoked without arguments, but in all the cases we care about we
  9474. // already have an existing method we want to call, so there's no need
  9475. // to create a new function object. We can even get away with assuming
  9476. // the method takes exactly one argument, since that happens to be true
  9477. // in every case, so we don't have to touch the arguments object. The
  9478. // only additional allocation required is the completion record, which
  9479. // has a stable shape and so hopefully should be cheap to allocate.
  9480. function tryCatch(fn, obj, arg) {
  9481. try {
  9482. return { type: "normal", arg: fn.call(obj, arg) };
  9483. } catch (err) {
  9484. return { type: "throw", arg: err };
  9485. }
  9486. }
  9487. var GenStateSuspendedStart = "suspendedStart";
  9488. var GenStateSuspendedYield = "suspendedYield";
  9489. var GenStateExecuting = "executing";
  9490. var GenStateCompleted = "completed";
  9491. // Returning this object from the innerFn has the same effect as
  9492. // breaking out of the dispatch switch statement.
  9493. var ContinueSentinel = {};
  9494. // Dummy constructor functions that we use as the .constructor and
  9495. // .constructor.prototype properties for functions that return Generator
  9496. // objects. For full spec compliance, you may wish to configure your
  9497. // minifier not to mangle the names of these two functions.
  9498. function Generator() {}
  9499. function GeneratorFunction() {}
  9500. function GeneratorFunctionPrototype() {}
  9501. // This is a polyfill for %IteratorPrototype% for environments that
  9502. // don't natively support it.
  9503. var IteratorPrototype = {};
  9504. IteratorPrototype[iteratorSymbol] = function () {
  9505. return this;
  9506. };
  9507. var getProto = Object.getPrototypeOf;
  9508. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9509. if (NativeIteratorPrototype &&
  9510. NativeIteratorPrototype !== Op &&
  9511. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9512. // This environment has a native %IteratorPrototype%; use it instead
  9513. // of the polyfill.
  9514. IteratorPrototype = NativeIteratorPrototype;
  9515. }
  9516. var Gp = GeneratorFunctionPrototype.prototype =
  9517. Generator.prototype = Object.create(IteratorPrototype);
  9518. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9519. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9520. GeneratorFunctionPrototype[toStringTagSymbol] =
  9521. GeneratorFunction.displayName = "GeneratorFunction";
  9522. // Helper for defining the .next, .throw, and .return methods of the
  9523. // Iterator interface in terms of a single ._invoke method.
  9524. function defineIteratorMethods(prototype) {
  9525. ["next", "throw", "return"].forEach(function(method) {
  9526. prototype[method] = function(arg) {
  9527. return this._invoke(method, arg);
  9528. };
  9529. });
  9530. }
  9531. runtime.isGeneratorFunction = function(genFun) {
  9532. var ctor = typeof genFun === "function" && genFun.constructor;
  9533. return ctor
  9534. ? ctor === GeneratorFunction ||
  9535. // For the native GeneratorFunction constructor, the best we can
  9536. // do is to check its .name property.
  9537. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9538. : false;
  9539. };
  9540. runtime.mark = function(genFun) {
  9541. if (Object.setPrototypeOf) {
  9542. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9543. } else {
  9544. genFun.__proto__ = GeneratorFunctionPrototype;
  9545. if (!(toStringTagSymbol in genFun)) {
  9546. genFun[toStringTagSymbol] = "GeneratorFunction";
  9547. }
  9548. }
  9549. genFun.prototype = Object.create(Gp);
  9550. return genFun;
  9551. };
  9552. // Within the body of any async function, `await x` is transformed to
  9553. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9554. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9555. // meant to be awaited.
  9556. runtime.awrap = function(arg) {
  9557. return { __await: arg };
  9558. };
  9559. function AsyncIterator(generator) {
  9560. function invoke(method, arg, resolve, reject) {
  9561. var record = tryCatch(generator[method], generator, arg);
  9562. if (record.type === "throw") {
  9563. reject(record.arg);
  9564. } else {
  9565. var result = record.arg;
  9566. var value = result.value;
  9567. if (value &&
  9568. typeof value === "object" &&
  9569. hasOwn.call(value, "__await")) {
  9570. return Promise.resolve(value.__await).then(function(value) {
  9571. invoke("next", value, resolve, reject);
  9572. }, function(err) {
  9573. invoke("throw", err, resolve, reject);
  9574. });
  9575. }
  9576. return Promise.resolve(value).then(function(unwrapped) {
  9577. // When a yielded Promise is resolved, its final value becomes
  9578. // the .value of the Promise<{value,done}> result for the
  9579. // current iteration.
  9580. result.value = unwrapped;
  9581. resolve(result);
  9582. }, function(error) {
  9583. // If a rejected Promise was yielded, throw the rejection back
  9584. // into the async generator function so it can be handled there.
  9585. return invoke("throw", error, resolve, reject);
  9586. });
  9587. }
  9588. }
  9589. var previousPromise;
  9590. function enqueue(method, arg) {
  9591. function callInvokeWithMethodAndArg() {
  9592. return new Promise(function(resolve, reject) {
  9593. invoke(method, arg, resolve, reject);
  9594. });
  9595. }
  9596. return previousPromise =
  9597. // If enqueue has been called before, then we want to wait until
  9598. // all previous Promises have been resolved before calling invoke,
  9599. // so that results are always delivered in the correct order. If
  9600. // enqueue has not been called before, then it is important to
  9601. // call invoke immediately, without waiting on a callback to fire,
  9602. // so that the async generator function has the opportunity to do
  9603. // any necessary setup in a predictable way. This predictability
  9604. // is why the Promise constructor synchronously invokes its
  9605. // executor callback, and why async functions synchronously
  9606. // execute code before the first await. Since we implement simple
  9607. // async functions in terms of async generators, it is especially
  9608. // important to get this right, even though it requires care.
  9609. previousPromise ? previousPromise.then(
  9610. callInvokeWithMethodAndArg,
  9611. // Avoid propagating failures to Promises returned by later
  9612. // invocations of the iterator.
  9613. callInvokeWithMethodAndArg
  9614. ) : callInvokeWithMethodAndArg();
  9615. }
  9616. // Define the unified helper method that is used to implement .next,
  9617. // .throw, and .return (see defineIteratorMethods).
  9618. this._invoke = enqueue;
  9619. }
  9620. defineIteratorMethods(AsyncIterator.prototype);
  9621. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9622. return this;
  9623. };
  9624. runtime.AsyncIterator = AsyncIterator;
  9625. // Note that simple async functions are implemented on top of
  9626. // AsyncIterator objects; they just return a Promise for the value of
  9627. // the final result produced by the iterator.
  9628. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9629. var iter = new AsyncIterator(
  9630. wrap(innerFn, outerFn, self, tryLocsList)
  9631. );
  9632. return runtime.isGeneratorFunction(outerFn)
  9633. ? iter // If outerFn is a generator, return the full iterator.
  9634. : iter.next().then(function(result) {
  9635. return result.done ? result.value : iter.next();
  9636. });
  9637. };
  9638. function makeInvokeMethod(innerFn, self, context) {
  9639. var state = GenStateSuspendedStart;
  9640. return function invoke(method, arg) {
  9641. if (state === GenStateExecuting) {
  9642. throw new Error("Generator is already running");
  9643. }
  9644. if (state === GenStateCompleted) {
  9645. if (method === "throw") {
  9646. throw arg;
  9647. }
  9648. // Be forgiving, per 25.3.3.3.3 of the spec:
  9649. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9650. return doneResult();
  9651. }
  9652. context.method = method;
  9653. context.arg = arg;
  9654. while (true) {
  9655. var delegate = context.delegate;
  9656. if (delegate) {
  9657. var delegateResult = maybeInvokeDelegate(delegate, context);
  9658. if (delegateResult) {
  9659. if (delegateResult === ContinueSentinel) continue;
  9660. return delegateResult;
  9661. }
  9662. }
  9663. if (context.method === "next") {
  9664. // Setting context._sent for legacy support of Babel's
  9665. // function.sent implementation.
  9666. context.sent = context._sent = context.arg;
  9667. } else if (context.method === "throw") {
  9668. if (state === GenStateSuspendedStart) {
  9669. state = GenStateCompleted;
  9670. throw context.arg;
  9671. }
  9672. context.dispatchException(context.arg);
  9673. } else if (context.method === "return") {
  9674. context.abrupt("return", context.arg);
  9675. }
  9676. state = GenStateExecuting;
  9677. var record = tryCatch(innerFn, self, context);
  9678. if (record.type === "normal") {
  9679. // If an exception is thrown from innerFn, we leave state ===
  9680. // GenStateExecuting and loop back for another invocation.
  9681. state = context.done
  9682. ? GenStateCompleted
  9683. : GenStateSuspendedYield;
  9684. if (record.arg === ContinueSentinel) {
  9685. continue;
  9686. }
  9687. return {
  9688. value: record.arg,
  9689. done: context.done
  9690. };
  9691. } else if (record.type === "throw") {
  9692. state = GenStateCompleted;
  9693. // Dispatch the exception by looping back around to the
  9694. // context.dispatchException(context.arg) call above.
  9695. context.method = "throw";
  9696. context.arg = record.arg;
  9697. }
  9698. }
  9699. };
  9700. }
  9701. // Call delegate.iterator[context.method](context.arg) and handle the
  9702. // result, either by returning a { value, done } result from the
  9703. // delegate iterator, or by modifying context.method and context.arg,
  9704. // setting context.delegate to null, and returning the ContinueSentinel.
  9705. function maybeInvokeDelegate(delegate, context) {
  9706. var method = delegate.iterator[context.method];
  9707. if (method === undefined) {
  9708. // A .throw or .return when the delegate iterator has no .throw
  9709. // method always terminates the yield* loop.
  9710. context.delegate = null;
  9711. if (context.method === "throw") {
  9712. if (delegate.iterator.return) {
  9713. // If the delegate iterator has a return method, give it a
  9714. // chance to clean up.
  9715. context.method = "return";
  9716. context.arg = undefined;
  9717. maybeInvokeDelegate(delegate, context);
  9718. if (context.method === "throw") {
  9719. // If maybeInvokeDelegate(context) changed context.method from
  9720. // "return" to "throw", let that override the TypeError below.
  9721. return ContinueSentinel;
  9722. }
  9723. }
  9724. context.method = "throw";
  9725. context.arg = new TypeError(
  9726. "The iterator does not provide a 'throw' method");
  9727. }
  9728. return ContinueSentinel;
  9729. }
  9730. var record = tryCatch(method, delegate.iterator, context.arg);
  9731. if (record.type === "throw") {
  9732. context.method = "throw";
  9733. context.arg = record.arg;
  9734. context.delegate = null;
  9735. return ContinueSentinel;
  9736. }
  9737. var info = record.arg;
  9738. if (! info) {
  9739. context.method = "throw";
  9740. context.arg = new TypeError("iterator result is not an object");
  9741. context.delegate = null;
  9742. return ContinueSentinel;
  9743. }
  9744. if (info.done) {
  9745. // Assign the result of the finished delegate to the temporary
  9746. // variable specified by delegate.resultName (see delegateYield).
  9747. context[delegate.resultName] = info.value;
  9748. // Resume execution at the desired location (see delegateYield).
  9749. context.next = delegate.nextLoc;
  9750. // If context.method was "throw" but the delegate handled the
  9751. // exception, let the outer generator proceed normally. If
  9752. // context.method was "next", forget context.arg since it has been
  9753. // "consumed" by the delegate iterator. If context.method was
  9754. // "return", allow the original .return call to continue in the
  9755. // outer generator.
  9756. if (context.method !== "return") {
  9757. context.method = "next";
  9758. context.arg = undefined;
  9759. }
  9760. } else {
  9761. // Re-yield the result returned by the delegate method.
  9762. return info;
  9763. }
  9764. // The delegate iterator is finished, so forget it and continue with
  9765. // the outer generator.
  9766. context.delegate = null;
  9767. return ContinueSentinel;
  9768. }
  9769. // Define Generator.prototype.{next,throw,return} in terms of the
  9770. // unified ._invoke helper method.
  9771. defineIteratorMethods(Gp);
  9772. Gp[toStringTagSymbol] = "Generator";
  9773. // A Generator should always return itself as the iterator object when the
  9774. // @@iterator function is called on it. Some browsers' implementations of the
  9775. // iterator prototype chain incorrectly implement this, causing the Generator
  9776. // object to not be returned from this call. This ensures that doesn't happen.
  9777. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9778. Gp[iteratorSymbol] = function() {
  9779. return this;
  9780. };
  9781. Gp.toString = function() {
  9782. return "[object Generator]";
  9783. };
  9784. function pushTryEntry(locs) {
  9785. var entry = { tryLoc: locs[0] };
  9786. if (1 in locs) {
  9787. entry.catchLoc = locs[1];
  9788. }
  9789. if (2 in locs) {
  9790. entry.finallyLoc = locs[2];
  9791. entry.afterLoc = locs[3];
  9792. }
  9793. this.tryEntries.push(entry);
  9794. }
  9795. function resetTryEntry(entry) {
  9796. var record = entry.completion || {};
  9797. record.type = "normal";
  9798. delete record.arg;
  9799. entry.completion = record;
  9800. }
  9801. function Context(tryLocsList) {
  9802. // The root entry object (effectively a try statement without a catch
  9803. // or a finally block) gives us a place to store values thrown from
  9804. // locations where there is no enclosing try statement.
  9805. this.tryEntries = [{ tryLoc: "root" }];
  9806. tryLocsList.forEach(pushTryEntry, this);
  9807. this.reset(true);
  9808. }
  9809. runtime.keys = function(object) {
  9810. var keys = [];
  9811. for (var key in object) {
  9812. keys.push(key);
  9813. }
  9814. keys.reverse();
  9815. // Rather than returning an object with a next method, we keep
  9816. // things simple and return the next function itself.
  9817. return function next() {
  9818. while (keys.length) {
  9819. var key = keys.pop();
  9820. if (key in object) {
  9821. next.value = key;
  9822. next.done = false;
  9823. return next;
  9824. }
  9825. }
  9826. // To avoid creating an additional object, we just hang the .value
  9827. // and .done properties off the next function object itself. This
  9828. // also ensures that the minifier will not anonymize the function.
  9829. next.done = true;
  9830. return next;
  9831. };
  9832. };
  9833. function values(iterable) {
  9834. if (iterable) {
  9835. var iteratorMethod = iterable[iteratorSymbol];
  9836. if (iteratorMethod) {
  9837. return iteratorMethod.call(iterable);
  9838. }
  9839. if (typeof iterable.next === "function") {
  9840. return iterable;
  9841. }
  9842. if (!isNaN(iterable.length)) {
  9843. var i = -1, next = function next() {
  9844. while (++i < iterable.length) {
  9845. if (hasOwn.call(iterable, i)) {
  9846. next.value = iterable[i];
  9847. next.done = false;
  9848. return next;
  9849. }
  9850. }
  9851. next.value = undefined;
  9852. next.done = true;
  9853. return next;
  9854. };
  9855. return next.next = next;
  9856. }
  9857. }
  9858. // Return an iterator with no values.
  9859. return { next: doneResult };
  9860. }
  9861. runtime.values = values;
  9862. function doneResult() {
  9863. return { value: undefined, done: true };
  9864. }
  9865. Context.prototype = {
  9866. constructor: Context,
  9867. reset: function(skipTempReset) {
  9868. this.prev = 0;
  9869. this.next = 0;
  9870. // Resetting context._sent for legacy support of Babel's
  9871. // function.sent implementation.
  9872. this.sent = this._sent = undefined;
  9873. this.done = false;
  9874. this.delegate = null;
  9875. this.method = "next";
  9876. this.arg = undefined;
  9877. this.tryEntries.forEach(resetTryEntry);
  9878. if (!skipTempReset) {
  9879. for (var name in this) {
  9880. // Not sure about the optimal order of these conditions:
  9881. if (name.charAt(0) === "t" &&
  9882. hasOwn.call(this, name) &&
  9883. !isNaN(+name.slice(1))) {
  9884. this[name] = undefined;
  9885. }
  9886. }
  9887. }
  9888. },
  9889. stop: function() {
  9890. this.done = true;
  9891. var rootEntry = this.tryEntries[0];
  9892. var rootRecord = rootEntry.completion;
  9893. if (rootRecord.type === "throw") {
  9894. throw rootRecord.arg;
  9895. }
  9896. return this.rval;
  9897. },
  9898. dispatchException: function(exception) {
  9899. if (this.done) {
  9900. throw exception;
  9901. }
  9902. var context = this;
  9903. function handle(loc, caught) {
  9904. record.type = "throw";
  9905. record.arg = exception;
  9906. context.next = loc;
  9907. if (caught) {
  9908. // If the dispatched exception was caught by a catch block,
  9909. // then let that catch block handle the exception normally.
  9910. context.method = "next";
  9911. context.arg = undefined;
  9912. }
  9913. return !! caught;
  9914. }
  9915. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9916. var entry = this.tryEntries[i];
  9917. var record = entry.completion;
  9918. if (entry.tryLoc === "root") {
  9919. // Exception thrown outside of any try block that could handle
  9920. // it, so set the completion value of the entire function to
  9921. // throw the exception.
  9922. return handle("end");
  9923. }
  9924. if (entry.tryLoc <= this.prev) {
  9925. var hasCatch = hasOwn.call(entry, "catchLoc");
  9926. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9927. if (hasCatch && hasFinally) {
  9928. if (this.prev < entry.catchLoc) {
  9929. return handle(entry.catchLoc, true);
  9930. } else if (this.prev < entry.finallyLoc) {
  9931. return handle(entry.finallyLoc);
  9932. }
  9933. } else if (hasCatch) {
  9934. if (this.prev < entry.catchLoc) {
  9935. return handle(entry.catchLoc, true);
  9936. }
  9937. } else if (hasFinally) {
  9938. if (this.prev < entry.finallyLoc) {
  9939. return handle(entry.finallyLoc);
  9940. }
  9941. } else {
  9942. throw new Error("try statement without catch or finally");
  9943. }
  9944. }
  9945. }
  9946. },
  9947. abrupt: function(type, arg) {
  9948. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9949. var entry = this.tryEntries[i];
  9950. if (entry.tryLoc <= this.prev &&
  9951. hasOwn.call(entry, "finallyLoc") &&
  9952. this.prev < entry.finallyLoc) {
  9953. var finallyEntry = entry;
  9954. break;
  9955. }
  9956. }
  9957. if (finallyEntry &&
  9958. (type === "break" ||
  9959. type === "continue") &&
  9960. finallyEntry.tryLoc <= arg &&
  9961. arg <= finallyEntry.finallyLoc) {
  9962. // Ignore the finally entry if control is not jumping to a
  9963. // location outside the try/catch block.
  9964. finallyEntry = null;
  9965. }
  9966. var record = finallyEntry ? finallyEntry.completion : {};
  9967. record.type = type;
  9968. record.arg = arg;
  9969. if (finallyEntry) {
  9970. this.method = "next";
  9971. this.next = finallyEntry.finallyLoc;
  9972. return ContinueSentinel;
  9973. }
  9974. return this.complete(record);
  9975. },
  9976. complete: function(record, afterLoc) {
  9977. if (record.type === "throw") {
  9978. throw record.arg;
  9979. }
  9980. if (record.type === "break" ||
  9981. record.type === "continue") {
  9982. this.next = record.arg;
  9983. } else if (record.type === "return") {
  9984. this.rval = this.arg = record.arg;
  9985. this.method = "return";
  9986. this.next = "end";
  9987. } else if (record.type === "normal" && afterLoc) {
  9988. this.next = afterLoc;
  9989. }
  9990. return ContinueSentinel;
  9991. },
  9992. finish: function(finallyLoc) {
  9993. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9994. var entry = this.tryEntries[i];
  9995. if (entry.finallyLoc === finallyLoc) {
  9996. this.complete(entry.completion, entry.afterLoc);
  9997. resetTryEntry(entry);
  9998. return ContinueSentinel;
  9999. }
  10000. }
  10001. },
  10002. "catch": function(tryLoc) {
  10003. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10004. var entry = this.tryEntries[i];
  10005. if (entry.tryLoc === tryLoc) {
  10006. var record = entry.completion;
  10007. if (record.type === "throw") {
  10008. var thrown = record.arg;
  10009. resetTryEntry(entry);
  10010. }
  10011. return thrown;
  10012. }
  10013. }
  10014. // The context.catch method must only be called with a location
  10015. // argument that corresponds to a known catch block.
  10016. throw new Error("illegal catch attempt");
  10017. },
  10018. delegateYield: function(iterable, resultName, nextLoc) {
  10019. this.delegate = {
  10020. iterator: values(iterable),
  10021. resultName: resultName,
  10022. nextLoc: nextLoc
  10023. };
  10024. if (this.method === "next") {
  10025. // Deliberately forget the last sent value so that we don't
  10026. // accidentally pass it on to the delegate.
  10027. this.arg = undefined;
  10028. }
  10029. return ContinueSentinel;
  10030. }
  10031. };
  10032. })(
  10033. // In sloppy mode, unbound `this` refers to the global object, fallback to
  10034. // Function constructor if we're in global strict mode. That is sadly a form
  10035. // of indirect eval which violates Content Security Policy.
  10036. (function() {
  10037. return this || (typeof self === "object" && self);
  10038. })() || Function("return this")()
  10039. );
  10040. /***/ }),
  10041. /* 26 */
  10042. /*!*************************************************!*\
  10043. !*** D:/code/work/broke_news_wx/network/api.js ***!
  10044. \*************************************************/
  10045. /*! no static exports found */
  10046. /***/ (function(module, exports, __webpack_require__) {
  10047. "use strict";
  10048. Object.defineProperty(exports, "__esModule", { value: true });exports.findUserAuth = exports.getMobile = exports.getClueById = exports.findPage = exports.saveClue = exports.uploadMediaFile = void 0;var _http = __webpack_require__(/*! ./http.js */ 27);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {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: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  10049. //上传素材
  10050. var uploadMediaFile = function uploadMediaFile(data) {
  10051. return (0, _http.uploadFile)(_objectSpread({
  10052. url: '/cmsback/api/clue/uploadMediaFile' },
  10053. data));
  10054. };
  10055. //发布报料
  10056. exports.uploadMediaFile = uploadMediaFile;var saveClue = function saveClue(data) {
  10057. return (0, _http.myRequest)({
  10058. url: '/cmsback/api/clue/save',
  10059. method: 'POST',
  10060. data: data });
  10061. };
  10062. //报料广场
  10063. exports.saveClue = saveClue;var findPage = function findPage(data) {
  10064. return (0, _http.myRequest)({
  10065. url: '/cmsback/api/clue/findPage',
  10066. method: 'POST',
  10067. data: data });
  10068. };
  10069. //查看线索详情
  10070. exports.findPage = findPage;var getClueById = function getClueById(id) {
  10071. return (0, _http.myRequest)({
  10072. url: "/cmsback/api/clue/getClueById/".concat(id),
  10073. method: 'GET' });
  10074. };
  10075. //获取手机号码
  10076. exports.getClueById = getClueById;var getMobile = function getMobile(data) {
  10077. return (0, _http.myRequest)({
  10078. url: '/cmsback/api/clue/findMobile',
  10079. method: "POST",
  10080. data: data });
  10081. };
  10082. //获取用户权限
  10083. exports.getMobile = getMobile;var findUserAuth = function findUserAuth(data) {
  10084. return (0, _http.myRequest)({
  10085. url: '/cmsback/api/clue/checkAuth',
  10086. method: 'GET',
  10087. data: data });
  10088. };exports.findUserAuth = findUserAuth;
  10089. /***/ }),
  10090. /* 27 */
  10091. /*!**************************************************!*\
  10092. !*** D:/code/work/broke_news_wx/network/http.js ***!
  10093. \**************************************************/
  10094. /*! no static exports found */
  10095. /***/ (function(module, exports, __webpack_require__) {
  10096. "use strict";
  10097. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.uploadFile = exports.myRequest = void 0;
  10098. var _config = __webpack_require__(/*! ../utils/config.js */ 28);var baseURL = 'https://console.sxtvs.com.cn';
  10099. var myRequest = function myRequest(options) {
  10100. uni.showLoading({
  10101. title: '加载中...' });
  10102. return new Promise(function (resolve, reject) {
  10103. uni.request({
  10104. url: "".concat(baseURL).concat(options.url), //接口地址:前缀+方法中传入的地址
  10105. method: options.method || 'GET', //请求方法:传入的方法或者默认是“GET”
  10106. data: options.data || {}, //传递参数:传入的参数或者默认传递空集合
  10107. header: {
  10108. 'tenantId': _config.config.tenantId },
  10109. success: function success(res) {
  10110. //返回的数据(不固定,看后端接口,这里是做了一个判断,如果不为true,用uni.showToast方法提示获取数据失败)
  10111. // if (res.data.success != true) {
  10112. // return uni.showToast({
  10113. // title: '获取数据失败',
  10114. // icon: 'none'
  10115. // })
  10116. // }
  10117. // 如果不满足上述判断就输出数据
  10118. uni.hideLoading();
  10119. resolve(res);
  10120. },
  10121. // 这里的接口请求,如果出现问题就输出接口请求失败
  10122. fail: function fail(err) {
  10123. uni.hideLoading();
  10124. console.log(err);
  10125. reject(err);
  10126. } });
  10127. });
  10128. };
  10129. //上传文件
  10130. exports.myRequest = myRequest;var uploadFile = function uploadFile(options) {
  10131. uni.showLoading({
  10132. title: '加载中...' });
  10133. return new Promise(function (resolve, reject) {
  10134. console.log(options);
  10135. uni.uploadFile({
  10136. url: "".concat(baseURL).concat(options.url),
  10137. name: 'file',
  10138. fileType: options.fileType,
  10139. filePath: options.filePath, // 文件
  10140. formData: options.formData, // 除文件外其他所有数据,传对象,会默认转换为 FormData
  10141. header: {
  10142. 'tenantId': _config.config.tenantId },
  10143. success: function success(res) {
  10144. uni.hideLoading();
  10145. resolve(JSON.parse(res.data));
  10146. },
  10147. // 这里的接口请求,如果出现问题就输出接口请求失败
  10148. fail: function fail(err) {
  10149. uni.hideLoading();
  10150. console.log(err);
  10151. reject(err);
  10152. } });
  10153. });
  10154. };exports.uploadFile = uploadFile;
  10155. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10156. /***/ }),
  10157. /* 28 */
  10158. /*!**************************************************!*\
  10159. !*** D:/code/work/broke_news_wx/utils/config.js ***!
  10160. \**************************************************/
  10161. /*! no static exports found */
  10162. /***/ (function(module, exports, __webpack_require__) {
  10163. "use strict";
  10164. Object.defineProperty(exports, "__esModule", { value: true });exports.config = void 0;var config = {
  10165. cmc_group_url: "",
  10166. public_key: "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+1/AVZ8ngWzh+lF6O2niL594SI0G0ac++a7ZfaUl6Qn4CiaY5Wk4T2ljqt4zaBVecWEP/HD1gaIzh/Swjc6SmbxGddElTtrmU5UwXYwlys+oU5husvzA+Um6vFWU5umE1tvnt2S4CBijBrY+iM0/67oZNDnR/1CKMRpZwtDNR5QIDAQAB-----END PUBLIC KEY-----",
  10167. geetest_js_url: "/gt.js",
  10168. vaptcha_js_url: "/v3.js",
  10169. oauth_login_url: "/lr/login/oauth-login",
  10170. local_login_url: "/lr/login/local-login",
  10171. local_logout_url: "/lr/login/login-out",
  10172. local_reg_url: "/lr/reg/local-reguser",
  10173. reset_user_pwd_url: "/gu/user/reset-user-pwd",
  10174. send_mobile_code_message_url: "/vcode-server/send-mobile-vcode",
  10175. first_login_url: '/lr/login/first-login',
  10176. login_duration: 3 * 24 * 60 * 60,
  10177. session_storage_key: "cmc_login_session_storage",
  10178. agreement_url: "/agreement.html",
  10179. ip_location_url: "/ip/api/index?ip=&type=0",
  10180. multiTenantLogin: true,
  10181. multi_tenant_login_url: "/lr/login/multi-tenant-login",
  10182. broke_enws_baoliao_righi: { All_List: "33628ed877bf589f50806fd7f8235d08", AuditedList: "088fdda97c1779587e135978c012611f", Reply: "db9c6764be89713ee823d51ff741e391", Audit: "ca00f0116a153e249861505386170e6f" },
  10183. tenantId: 'dcfc7ff84dd717c9713049d205f113be',
  10184. BMapKey: 'tIRoQn8nup0e5zCKgcy4MGditGy9xu3K' };
  10185. // window.configs = config
  10186. exports.config = config;
  10187. /***/ }),
  10188. /* 29 */,
  10189. /* 30 */,
  10190. /* 31 */,
  10191. /* 32 */,
  10192. /* 33 */,
  10193. /* 34 */,
  10194. /* 35 */,
  10195. /* 36 */,
  10196. /* 37 */,
  10197. /* 38 */,
  10198. /* 39 */,
  10199. /* 40 */,
  10200. /* 41 */,
  10201. /* 42 */,
  10202. /* 43 */,
  10203. /* 44 */,
  10204. /* 45 */,
  10205. /* 46 */,
  10206. /* 47 */,
  10207. /* 48 */,
  10208. /* 49 */,
  10209. /* 50 */,
  10210. /* 51 */,
  10211. /* 52 */,
  10212. /* 53 */,
  10213. /* 54 */,
  10214. /* 55 */,
  10215. /* 56 */,
  10216. /* 57 */,
  10217. /* 58 */,
  10218. /* 59 */,
  10219. /* 60 */,
  10220. /* 61 */,
  10221. /* 62 */,
  10222. /* 63 */,
  10223. /* 64 */,
  10224. /* 65 */,
  10225. /* 66 */,
  10226. /* 67 */,
  10227. /* 68 */,
  10228. /* 69 */,
  10229. /* 70 */,
  10230. /* 71 */
  10231. /*!***********************************************!*\
  10232. !*** D:/code/work/broke_news_wx/utils/rsa.js ***!
  10233. \***********************************************/
  10234. /*! no static exports found */
  10235. /***/ (function(module, exports, __webpack_require__) {
  10236. "use strict";
  10237. Object.defineProperty(exports, "__esModule", { value: true });exports.rsaEncrypt = rsaEncrypt;var _jsencrypt = _interopRequireDefault(__webpack_require__(/*! @/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.vue */ 72));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10238. // import JSEncrypt from './jsencrypt.js';
  10239. // 加密公钥
  10240. var key = "\n\t-----BEGIN PUBLIC KEY-----\n\tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDvUWs2UiUj8quRyePoTXZLlK+Q\n\tvWnyPLgsvYdZedfwQIK4DYdkYwqMHvuPAc1xYjtMqegGpF8cmMpnz3w32zB1ESWx\n\tPXWYZETytDmRp4BUyA4usmVLA0Z9SwDEURDyjrJSdBuKqeid3fMk6C+3YmI/kxvP\n\t/rj9Oj+LX9YaMUKgqwIDAQAB\n\t-----END PUBLIC KEY-----\n";
  10241. // 加密
  10242. // 此加密公钥不能含有 '_' '-'字符串 参考:https://www.codenong.com/jsc71374f48fb3/
  10243. function rsaEncrypt(msg) {
  10244. var encryptMsg = _jsencrypt.default.setEncrypt(key, msg);
  10245. return encryptMsg;
  10246. }
  10247. //超长字符加密 支持汉字加密
  10248. // var ArrayData=jsencrypt.setLongEncrypt(key,"超长字符加密支持汉字加密");
  10249. /***/ }),
  10250. /* 72 */,
  10251. /* 73 */,
  10252. /* 74 */,
  10253. /* 75 */,
  10254. /* 76 */,
  10255. /* 77 */
  10256. /*!**********************************************************************************!*\
  10257. !*** D:/code/work/broke_news_wx/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js ***!
  10258. \**********************************************************************************/
  10259. /*! no static exports found */
  10260. /***/ (function(module, exports, __webpack_require__) {
  10261. /* WEBPACK VAR INJECTION */(function(global) {var CryptoJS = CryptoJS || function (a, b) {var c, e, f, g, h, i, j, k, l, m, n, o, q;if (!c && "undefined" != typeof global && global.crypto && (c = global.crypto), !c && "function" == "function") try {c = __webpack_require__(/*! crypto */ 78);} catch (d) {}return e = function e() {if (c) {if ("function" == typeof c.getRandomValues) try {return c.getRandomValues(new Uint32Array(1))[0];} catch (a) {}if ("function" == typeof c.randomBytes) try {return c.randomBytes(4).readInt32LE();} catch (a) {}}throw new Error("Native crypto module could not be used to get secure random number.");}, f = Object.create || function () {function a() {}return function (b) {var c;return a.prototype = b, c = new a(), a.prototype = null, c;};}(), g = {}, h = g.lib = {}, i = h.Base = function () {return { extend: function extend(a) {var b = f(this);return a && b.mixIn(a), b.hasOwnProperty("init") && this.init !== b.init || (b.init = function () {b.$super.init.apply(this, arguments);}), b.init.prototype = b, b.$super = this, b;}, create: function create() {var a = this.extend();return a.init.apply(a, arguments), a;}, init: function init() {}, mixIn: function mixIn(a) {for (var b in a) {a.hasOwnProperty(b) && (this[b] = a[b]);}a.hasOwnProperty("toString") && (this.toString = a.toString);}, clone: function clone() {return this.init.prototype.extend(this);} };}(), j = h.WordArray = i.extend({ init: function init(a, c) {a = this.words = a || [], this.sigBytes = c != b ? c : 4 * a.length;}, toString: function toString(a) {return (a || l).stringify(this);}, concat: function concat(a) {var f,g,b = this.words,c = a.words,d = this.sigBytes,e = a.sigBytes;if (this.clamp(), d % 4) for (f = 0; e > f; f++) {g = 255 & c[f >>> 2] >>> 24 - 8 * (f % 4), b[d + f >>> 2] |= g << 24 - 8 * ((d + f) % 4);} else for (f = 0; e > f; f += 4) {b[d + f >>> 2] = c[f >>> 2];}return this.sigBytes += e, this;}, clamp: function clamp() {var b = this.words,c = this.sigBytes;b[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4), b.length = a.ceil(c / 4);}, clone: function clone() {var a = i.clone.call(this);return a.words = this.words.slice(0), a;}, random: function random(a) {var c,b = [];for (c = 0; a > c; c += 4) {b.push(e());}return new j.init(b, a);} }), k = g.enc = {}, l = k.Hex = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e++) {f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push((f >>> 4).toString(16)), d.push((15 & f).toString(16));}return d.join("");}, parse: function parse(a) {var d,b = a.length,c = [];for (d = 0; b > d; d += 2) {c[d >>> 3] |= parseInt(a.substr(d, 2), 16) << 24 - 4 * (d % 8);}return new j.init(c, b / 2);} }, m = k.Latin1 = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e++) {f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push(String.fromCharCode(f));}return d.join("");}, parse: function parse(a) {var d,b = a.length,c = [];for (d = 0; b > d; d++) {c[d >>> 2] |= (255 & a.charCodeAt(d)) << 24 - 8 * (d % 4);}return new j.init(c, b);} }, n = k.Utf8 = { stringify: function stringify(a) {try {return decodeURIComponent(escape(m.stringify(a)));} catch (b) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(a) {return m.parse(unescape(encodeURIComponent(a)));} }, o = h.BufferedBlockAlgorithm = i.extend({ reset: function reset() {this._data = new j.init(), this._nDataBytes = 0;}, _append: function _append(a) {"string" == typeof a && (a = n.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;}, _process: function _process(b) {var c,k,l,m,d = this._data,e = d.words,f = d.sigBytes,g = this.blockSize,h = 4 * g,i = f / h;if (i = b ? a.ceil(i) : a.max((0 | i) - this._minBufferSize, 0), k = i * g, l = a.min(4 * k, f), k) {for (m = 0; k > m; m += g) {this._doProcessBlock(e, m);}c = e.splice(0, k), d.sigBytes -= l;}return new j.init(c, l);}, clone: function clone() {var a = i.clone.call(this);return a._data = this._data.clone(), a;}, _minBufferSize: 0 }), h.Hasher = o.extend({ cfg: i.extend(), init: function init(a) {this.cfg = this.cfg.extend(a), this.reset();}, reset: function reset() {o.reset.call(this), this._doReset();}, update: function update(a) {return this._append(a), this._process(), this;}, finalize: function finalize(a) {a && this._append(a);var b = this._doFinalize();return b;}, blockSize: 16, _createHelper: function _createHelper(a) {return function (b, c) {return new a.init(c).finalize(b);};}, _createHmacHelper: function _createHmacHelper(a) {return function (b, c) {return new q.HMAC.init(a, c).finalize(b);};} }), q = g.algo = {}, g;}(Math);!function () {function f(a, b, d) {var g,h,i,j,e = [],f = 0;for (g = 0; b > g; g++) {g % 4 && (h = d[a.charCodeAt(g - 1)] << 2 * (g % 4), i = d[a.charCodeAt(g)] >>> 6 - 2 * (g % 4), j = h | i, e[f >>> 2] |= j << 24 - 8 * (f % 4), f++);}return c.create(e, f);}var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.enc;d.Base64 = { stringify: function stringify(a) {var e,f,g,h,i,j,k,l,b = a.words,c = a.sigBytes,d = this._map;for (a.clamp(), e = [], f = 0; c > f; f += 3) {for (g = 255 & b[f >>> 2] >>> 24 - 8 * (f % 4), h = 255 & b[f + 1 >>> 2] >>> 24 - 8 * ((f + 1) % 4), i = 255 & b[f + 2 >>> 2] >>> 24 - 8 * ((f + 2) % 4), j = g << 16 | h << 8 | i, k = 0; 4 > k && c > f + .75 * k; k++) {e.push(d.charAt(63 & j >>> 6 * (3 - k)));}}if (l = d.charAt(64)) for (; e.length % 4;) {e.push(l);}return e.join("");}, parse: function parse(a) {var e,g,h,b = a.length,c = this._map,d = this._reverseMap;if (!d) for (d = this._reverseMap = [], e = 0; e < c.length; e++) {d[c.charCodeAt(e)] = e;}return g = c.charAt(64), g && (h = a.indexOf(g), -1 !== h && (b = h)), f(a, b, d);}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };}(), function (a) {function i(a, b, c, d, e, f, g) {var h = a + (b & c | ~b & d) + e + g;return (h << f | h >>> 32 - f) + b;}function j(a, b, c, d, e, f, g) {var h = a + (b & d | c & ~d) + e + g;return (h << f | h >>> 32 - f) + b;}function k(a, b, c, d, e, f, g) {var h = a + (b ^ c ^ d) + e + g;return (h << f | h >>> 32 - f) + b;}function l(a, b, c, d, e, f, g) {var h = a + (c ^ (b | ~d)) + e + g;return (h << f | h >>> 32 - f) + b;}var h,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = [];!function () {for (var b = 0; 64 > b; b++) {g[b] = 0 | 4294967296 * a.abs(a.sin(b + 1));}}(), h = f.MD5 = e.extend({ _doReset: function _doReset() {this._hash = new d.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(a, b) {var c, d, e, f, h, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E;for (c = 0; 16 > c; c++) {d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);}f = this._hash.words, h = a[b + 0], m = a[b + 1], n = a[b + 2], o = a[b + 3], p = a[b + 4], q = a[b + 5], r = a[b + 6], s = a[b + 7], t = a[b + 8], u = a[b + 9], v = a[b + 10], w = a[b + 11], x = a[b + 12], y = a[b + 13], z = a[b + 14], A = a[b + 15], B = f[0], C = f[1], D = f[2], E = f[3], B = i(B, C, D, E, h, 7, g[0]), E = i(E, B, C, D, m, 12, g[1]), D = i(D, E, B, C, n, 17, g[2]), C = i(C, D, E, B, o, 22, g[3]), B = i(B, C, D, E, p, 7, g[4]), E = i(E, B, C, D, q, 12, g[5]), D = i(D, E, B, C, r, 17, g[6]), C = i(C, D, E, B, s, 22, g[7]), B = i(B, C, D, E, t, 7, g[8]), E = i(E, B, C, D, u, 12, g[9]), D = i(D, E, B, C, v, 17, g[10]), C = i(C, D, E, B, w, 22, g[11]), B = i(B, C, D, E, x, 7, g[12]), E = i(E, B, C, D, y, 12, g[13]), D = i(D, E, B, C, z, 17, g[14]), C = i(C, D, E, B, A, 22, g[15]), B = j(B, C, D, E, m, 5, g[16]), E = j(E, B, C, D, r, 9, g[17]), D = j(D, E, B, C, w, 14, g[18]), C = j(C, D, E, B, h, 20, g[19]), B = j(B, C, D, E, q, 5, g[20]), E = j(E, B, C, D, v, 9, g[21]), D = j(D, E, B, C, A, 14, g[22]), C = j(C, D, E, B, p, 20, g[23]), B = j(B, C, D, E, u, 5, g[24]), E = j(E, B, C, D, z, 9, g[25]), D = j(D, E, B, C, o, 14, g[26]), C = j(C, D, E, B, t, 20, g[27]), B = j(B, C, D, E, y, 5, g[28]), E = j(E, B, C, D, n, 9, g[29]), D = j(D, E, B, C, s, 14, g[30]), C = j(C, D, E, B, x, 20, g[31]), B = k(B, C, D, E, q, 4, g[32]), E = k(E, B, C, D, t, 11, g[33]), D = k(D, E, B, C, w, 16, g[34]), C = k(C, D, E, B, z, 23, g[35]), B = k(B, C, D, E, m, 4, g[36]), E = k(E, B, C, D, p, 11, g[37]), D = k(D, E, B, C, s, 16, g[38]), C = k(C, D, E, B, v, 23, g[39]), B = k(B, C, D, E, y, 4, g[40]), E = k(E, B, C, D, h, 11, g[41]), D = k(D, E, B, C, o, 16, g[42]), C = k(C, D, E, B, r, 23, g[43]), B = k(B, C, D, E, u, 4, g[44]), E = k(E, B, C, D, x, 11, g[45]), D = k(D, E, B, C, A, 16, g[46]), C = k(C, D, E, B, n, 23, g[47]), B = l(B, C, D, E, h, 6, g[48]), E = l(E, B, C, D, s, 10, g[49]), D = l(D, E, B, C, z, 15, g[50]), C = l(C, D, E, B, q, 21, g[51]), B = l(B, C, D, E, x, 6, g[52]), E = l(E, B, C, D, o, 10, g[53]), D = l(D, E, B, C, v, 15, g[54]), C = l(C, D, E, B, m, 21, g[55]), B = l(B, C, D, E, t, 6, g[56]), E = l(E, B, C, D, A, 10, g[57]), D = l(D, E, B, C, r, 15, g[58]), C = l(C, D, E, B, y, 21, g[59]), B = l(B, C, D, E, p, 6, g[60]), E = l(E, B, C, D, w, 10, g[61]), D = l(D, E, B, C, n, 15, g[62]), C = l(C, D, E, B, u, 21, g[63]), f[0] = 0 | f[0] + B, f[1] = 0 | f[1] + C, f[2] = 0 | f[2] + D, f[3] = 0 | f[3] + E;}, _doFinalize: function _doFinalize() {var f,g,h,i,j,k,b = this._data,c = b.words,d = 8 * this._nDataBytes,e = 8 * b.sigBytes;for (c[e >>> 5] |= 128 << 24 - e % 32, f = a.floor(d / 4294967296), g = d, c[(e + 64 >>> 9 << 4) + 15] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), c[(e + 64 >>> 9 << 4) + 14] = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), b.sigBytes = 4 * (c.length + 1), this._process(), h = this._hash, i = h.words, j = 0; 4 > j; j++) {k = i[j], i[j] = 16711935 & (k << 8 | k >>> 24) | 4278255360 & (k << 24 | k >>> 8);}return h;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} }), b.MD5 = e._createHelper(h), b.HmacMD5 = e._createHmacHelper(h);}(Math), function () {var a = CryptoJS,b = a.lib,c = b.WordArray,d = b.Hasher,e = a.algo,f = [],g = e.SHA1 = d.extend({ _doReset: function _doReset() {this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(a, b) {var j,k,l,c = this._hash.words,d = c[0],e = c[1],g = c[2],h = c[3],i = c[4];for (j = 0; 80 > j; j++) {16 > j ? f[j] = 0 | a[b + j] : (k = f[j - 3] ^ f[j - 8] ^ f[j - 14] ^ f[j - 16], f[j] = k << 1 | k >>> 31), l = (d << 5 | d >>> 27) + i + f[j], l += 20 > j ? (e & g | ~e & h) + 1518500249 : 40 > j ? (e ^ g ^ h) + 1859775393 : 60 > j ? (e & g | e & h | g & h) - 1894007588 : (e ^ g ^ h) - 899497514, i = h, h = g, g = e << 30 | e >>> 2, e = d, d = l;}c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + g, c[3] = 0 | c[3] + h, c[4] = 0 | c[4] + i;}, _doFinalize: function _doFinalize() {var a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = Math.floor(c / 4294967296), b[(d + 64 >>> 9 << 4) + 15] = c, a.sigBytes = 4 * b.length, this._process(), this._hash;}, clone: function clone() {var a = d.clone.call(this);return a._hash = this._hash.clone(), a;} });a.SHA1 = d._createHelper(g), a.HmacSHA1 = d._createHmacHelper(g);}(), function (a) {var i,j,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = [],h = [];!function () {function b(b) {var d,c = a.sqrt(b);for (d = 2; c >= d; d++) {if (!(b % d)) return !1;}return !0;}function c(a) {return 0 | 4294967296 * (a - (0 | a));}for (var d = 2, e = 0; 64 > e;) {b(d) && (8 > e && (g[e] = c(a.pow(d, .5))), h[e] = c(a.pow(d, 1 / 3)), e++), d++;}}(), i = [], j = f.SHA256 = e.extend({ _doReset: function _doReset() {this._hash = new d.init(g.slice(0));}, _doProcessBlock: function _doProcessBlock(a, b) {var n,o,p,q,r,s,t,u,v,w,x,c = this._hash.words,d = c[0],e = c[1],f = c[2],g = c[3],j = c[4],k = c[5],l = c[6],m = c[7];for (n = 0; 64 > n; n++) {16 > n ? i[n] = 0 | a[b + n] : (o = i[n - 15], p = (o << 25 | o >>> 7) ^ (o << 14 | o >>> 18) ^ o >>> 3, q = i[n - 2], r = (q << 15 | q >>> 17) ^ (q << 13 | q >>> 19) ^ q >>> 10, i[n] = p + i[n - 7] + r + i[n - 16]), s = j & k ^ ~j & l, t = d & e ^ d & f ^ e & f, u = (d << 30 | d >>> 2) ^ (d << 19 | d >>> 13) ^ (d << 10 | d >>> 22), v = (j << 26 | j >>> 6) ^ (j << 21 | j >>> 11) ^ (j << 7 | j >>> 25), w = m + v + s + h[n] + i[n], x = u + t, m = l, l = k, k = j, j = 0 | g + w, g = f, f = e, e = d, d = 0 | w + x;}c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + f, c[3] = 0 | c[3] + g, c[4] = 0 | c[4] + j, c[5] = 0 | c[5] + k, c[6] = 0 | c[6] + l, c[7] = 0 | c[7] + m;}, _doFinalize: function _doFinalize() {var b = this._data,c = b.words,d = 8 * this._nDataBytes,e = 8 * b.sigBytes;return c[e >>> 5] |= 128 << 24 - e % 32, c[(e + 64 >>> 9 << 4) + 14] = a.floor(d / 4294967296), c[(e + 64 >>> 9 << 4) + 15] = d, b.sigBytes = 4 * c.length, this._process(), this._hash;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} }), b.SHA256 = e._createHelper(j), b.HmacSHA256 = e._createHmacHelper(j);}(Math), function () {function f(a) {return 4278255360 & a << 8 | 16711935 & a >>> 8;}var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.enc;d.Utf16 = d.Utf16BE = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e += 2) {f = 65535 & b[e >>> 2] >>> 16 - 8 * (e % 4), d.push(String.fromCharCode(f));}return d.join("");}, parse: function parse(a) {var e,b = a.length,d = [];for (e = 0; b > e; e++) {d[e >>> 1] |= a.charCodeAt(e) << 16 - 16 * (e % 2);}return c.create(d, 2 * b);} }, d.Utf16LE = { stringify: function stringify(a) {var e,g,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e += 2) {g = f(65535 & b[e >>> 2] >>> 16 - 8 * (e % 4)), d.push(String.fromCharCode(g));}return d.join("");}, parse: function parse(a) {var e,b = a.length,d = [];for (e = 0; b > e; e++) {d[e >>> 1] |= f(a.charCodeAt(e) << 16 - 16 * (e % 2));}return c.create(d, 2 * b);} };}(), function () {var a, b, c, d, e;"function" == typeof ArrayBuffer && (a = CryptoJS, b = a.lib, c = b.WordArray, d = c.init, e = c.init = function (a) {var b, c, e;if (a instanceof ArrayBuffer && (a = new Uint8Array(a)), (a instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && a instanceof Uint8ClampedArray || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array) && (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)), a instanceof Uint8Array) {for (b = a.byteLength, c = [], e = 0; b > e; e++) {c[e >>> 2] |= a[e] << 24 - 8 * (e % 4);}d.call(this, c, b);} else d.apply(this, arguments);}, e.prototype = c);}(), function () {function n(a, b, c) {return a ^ b ^ c;}function o(a, b, c) {return a & b | ~a & c;}function p(a, b, c) {return (a | ~b) ^ c;}function q(a, b, c) {return a & c | b & ~c;}function r(a, b, c) {return a ^ (b | ~c);}function s(a, b) {return a << b | a >>> 32 - b;}var b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = d.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),h = d.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),i = d.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),j = d.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),k = d.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),l = d.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),m = f.RIPEMD160 = e.extend({ _doReset: function _doReset() {this._hash = d.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(a, b) {var c, d, e, f, m, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I;for (c = 0; 16 > c; c++) {d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);}for (f = this._hash.words, m = k.words, t = l.words, u = g.words, v = h.words, w = i.words, x = j.words, D = y = f[0], E = z = f[1], F = A = f[2], G = B = f[3], H = C = f[4], c = 0; 80 > c; c += 1) {I = 0 | y + a[b + u[c]], I += 16 > c ? n(z, A, B) + m[0] : 32 > c ? o(z, A, B) + m[1] : 48 > c ? p(z, A, B) + m[2] : 64 > c ? q(z, A, B) + m[3] : r(z, A, B) + m[4], I = 0 | I, I = s(I, w[c]), I = 0 | I + C, y = C, C = B, B = s(A, 10), A = z, z = I, I = 0 | D + a[b + v[c]], I += 16 > c ? r(E, F, G) + t[0] : 32 > c ? q(E, F, G) + t[1] : 48 > c ? p(E, F, G) + t[2] : 64 > c ? o(E, F, G) + t[3] : n(E, F, G) + t[4], I = 0 | I, I = s(I, x[c]), I = 0 | I + H, D = H, H = G, G = s(F, 10), F = E, E = I;}I = 0 | f[1] + A + G, f[1] = 0 | f[2] + B + H, f[2] = 0 | f[3] + C + D, f[3] = 0 | f[4] + y + E, f[4] = 0 | f[0] + z + F, f[0] = I;}, _doFinalize: function _doFinalize() {var e,f,g,h,a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;for (b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), a.sigBytes = 4 * (b.length + 1), this._process(), e = this._hash, f = e.words, g = 0; 5 > g; g++) {h = f[g], f[g] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);}return e;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} });b.RIPEMD160 = e._createHelper(m), b.HmacRIPEMD160 = e._createHmacHelper(m);}(Math), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = a.enc,e = d.Utf8,f = a.algo;f.HMAC = c.extend({ init: function init(a, b) {var c, d, f, g, h, i, j;for (a = this._hasher = new a.init(), "string" == typeof b && (b = e.parse(b)), c = a.blockSize, d = 4 * c, b.sigBytes > d && (b = a.finalize(b)), b.clamp(), f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, i = g.words, j = 0; c > j; j++) {h[j] ^= 1549556828, i[j] ^= 909522486;}f.sigBytes = g.sigBytes = d, this.reset();}, reset: function reset() {var a = this._hasher;a.reset(), a.update(this._iKey);}, update: function update(a) {return this._hasher.update(a), this;}, finalize: function finalize(a) {var d,b = this._hasher,c = b.finalize(a);return b.reset(), d = b.finalize(this._oKey.clone().concat(c));} });}(), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = b.WordArray,e = a.algo,f = e.SHA1,g = e.HMAC,h = e.PBKDF2 = c.extend({ cfg: c.extend({ keySize: 4, hasher: f, iterations: 1 }), init: function init(a) {this.cfg = this.cfg.extend(a);}, compute: function compute(a, b) {for (var m, n, o, p, q, r, s, c = this.cfg, e = g.create(c.hasher, a), f = d.create(), h = d.create([1]), i = f.words, j = h.words, k = c.keySize, l = c.iterations; i.length < k;) {for (m = e.update(b).finalize(h), e.reset(), n = m.words, o = n.length, p = m, q = 1; l > q; q++) {for (p = e.finalize(p), e.reset(), r = p.words, s = 0; o > s; s++) {n[s] ^= r[s];}}f.concat(m), j[0]++;}return f.sigBytes = 4 * k, f;} });a.PBKDF2 = function (a, b, c) {return h.create(c).compute(a, b);};}(), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = b.WordArray,e = a.algo,f = e.MD5,g = e.EvpKDF = c.extend({ cfg: c.extend({ keySize: 4, hasher: f, iterations: 1 }), init: function init(a) {this.cfg = this.cfg.extend(a);}, compute: function compute(a, b) {for (var c, k, e = this.cfg, f = e.hasher.create(), g = d.create(), h = g.words, i = e.keySize, j = e.iterations; h.length < i;) {for (c && f.update(c), c = f.update(a).finalize(b), f.reset(), k = 1; j > k; k++) {c = f.finalize(c), f.reset();}g.concat(c);}return g.sigBytes = 4 * i, g;} });a.EvpKDF = function (a, b, c) {return g.create(c).compute(a, b);};}(), function () {var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.algo,e = d.SHA256,f = d.SHA224 = e.extend({ _doReset: function _doReset() {this._hash = new c.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);}, _doFinalize: function _doFinalize() {var a = e._doFinalize.call(this);return a.sigBytes -= 4, a;} });a.SHA224 = e._createHelper(f), a.HmacSHA224 = e._createHmacHelper(f);}(), function (a) {var b = CryptoJS,c = b.lib,d = c.Base,e = c.WordArray,f = b.x64 = {};f.Word = d.extend({ init: function init(a, b) {this.high = a, this.low = b;} }), f.WordArray = d.extend({ init: function init(b, c) {b = this.words = b || [], this.sigBytes = c != a ? c : 8 * b.length;}, toX32: function toX32() {var d,f,a = this.words,b = a.length,c = [];for (d = 0; b > d; d++) {f = a[d], c.push(f.high), c.push(f.low);}return e.create(c, this.sigBytes);}, clone: function clone() {var e,a = d.clone.call(this),b = a.words = this.words.slice(0),c = b.length;for (e = 0; c > e; e++) {b[e] = b[e].clone();}return a;} });}(), function (a) {var l,m,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.x64,g = f.Word,h = b.algo,i = [],j = [],k = [];!function () {var c,d,e,f,h,l,m,n,o,a = 1,b = 0;for (c = 0; 24 > c; c++) {i[a + 5 * b] = (c + 1) * (c + 2) / 2 % 64, d = b % 5, e = (2 * a + 3 * b) % 5, a = d, b = e;}for (a = 0; 5 > a; a++) {for (b = 0; 5 > b; b++) {j[a + 5 * b] = b + 5 * ((2 * a + 3 * b) % 5);}}for (f = 1, h = 0; 24 > h; h++) {for (l = 0, m = 0, n = 0; 7 > n; n++) {1 & f && (o = (1 << n) - 1, 32 > o ? m ^= 1 << o : l ^= 1 << o - 32), 128 & f ? f = 113 ^ f << 1 : f <<= 1;}k[h] = g.create(l, m);}}(), l = [], function () {for (var a = 0; 25 > a; a++) {l[a] = g.create();}}(), m = h.SHA3 = e.extend({ cfg: e.cfg.extend({ outputLength: 512 }), _doReset: function _doReset() {var b,a = this._state = [];for (b = 0; 25 > b; b++) {a[b] = new g.init();}this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;}, _doProcessBlock: function _doProcessBlock(a, b) {var e,f,g,h,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,c = this._state,d = this.blockSize / 2;for (e = 0; d > e; e++) {f = a[b + 2 * e], g = a[b + 2 * e + 1], f = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), g = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), h = c[e], h.high ^= g, h.low ^= f;}for (m = 0; 24 > m; m++) {for (n = 0; 5 > n; n++) {for (o = 0, p = 0, q = 0; 5 > q; q++) {h = c[n + 5 * q], o ^= h.high, p ^= h.low;}r = l[n], r.high = o, r.low = p;}for (n = 0; 5 > n; n++) {for (s = l[(n + 4) % 5], t = l[(n + 1) % 5], u = t.high, v = t.low, o = s.high ^ (u << 1 | v >>> 31), p = s.low ^ (v << 1 | u >>> 31), q = 0; 5 > q; q++) {h = c[n + 5 * q], h.high ^= o, h.low ^= p;}}for (w = 1; 25 > w; w++) {h = c[w], x = h.high, y = h.low, z = i[w], 32 > z ? (o = x << z | y >>> 32 - z, p = y << z | x >>> 32 - z) : (o = y << z - 32 | x >>> 64 - z, p = x << z - 32 | y >>> 64 - z), A = l[j[w]], A.high = o, A.low = p;}for (B = l[0], C = c[0], B.high = C.high, B.low = C.low, n = 0; 5 > n; n++) {for (q = 0; 5 > q; q++) {w = n + 5 * q, h = c[w], D = l[w], E = l[(n + 1) % 5 + 5 * q], F = l[(n + 2) % 5 + 5 * q], h.high = D.high ^ ~E.high & F.high, h.low = D.low ^ ~E.low & F.low;}}h = c[0], G = k[m], h.high ^= G.high, h.low ^= G.low;}}, _doFinalize: function _doFinalize() {var f,g,h,i,j,k,l,m,n,o,b = this._data,c = b.words;for (8 * this._nDataBytes, f = 8 * b.sigBytes, g = 32 * this.blockSize, c[f >>> 5] |= 1 << 24 - f % 32, c[(a.ceil((f + 1) / g) * g >>> 5) - 1] |= 128, b.sigBytes = 4 * c.length, this._process(), h = this._state, i = this.cfg.outputLength / 8, j = i / 8, k = [], l = 0; j > l; l++) {m = h[l], n = m.high, o = m.low, n = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), k.push(o), k.push(n);}return new d.init(k, i);}, clone: function clone() {var c,a = e.clone.call(this),b = a._state = this._state.slice(0);for (c = 0; 25 > c; c++) {b[c] = b[c].clone();}return a;} }), b.SHA3 = e._createHelper(m), b.HmacSHA3 = e._createHmacHelper(m);}(Math), function () {function h() {return e.create.apply(e, arguments);}var k,a = CryptoJS,b = a.lib,c = b.Hasher,d = a.x64,e = d.Word,f = d.WordArray,g = a.algo,i = [h(1116352408, 3609767458), h(1899447441, 602891725), h(3049323471, 3964484399), h(3921009573, 2173295548), h(961987163, 4081628472), h(1508970993, 3053834265), h(2453635748, 2937671579), h(2870763221, 3664609560), h(3624381080, 2734883394), h(310598401, 1164996542), h(607225278, 1323610764), h(1426881987, 3590304994), h(1925078388, 4068182383), h(2162078206, 991336113), h(2614888103, 633803317), h(3248222580, 3479774868), h(3835390401, 2666613458), h(4022224774, 944711139), h(264347078, 2341262773), h(604807628, 2007800933), h(770255983, 1495990901), h(1249150122, 1856431235), h(1555081692, 3175218132), h(1996064986, 2198950837), h(2554220882, 3999719339), h(2821834349, 766784016), h(2952996808, 2566594879), h(3210313671, 3203337956), h(3336571891, 1034457026), h(3584528711, 2466948901), h(113926993, 3758326383), h(338241895, 168717936), h(666307205, 1188179964), h(773529912, 1546045734), h(1294757372, 1522805485), h(1396182291, 2643833823), h(1695183700, 2343527390), h(1986661051, 1014477480), h(2177026350, 1206759142), h(2456956037, 344077627), h(2730485921, 1290863460), h(2820302411, 3158454273), h(3259730800, 3505952657), h(3345764771, 106217008), h(3516065817, 3606008344), h(3600352804, 1432725776), h(4094571909, 1467031594), h(275423344, 851169720), h(430227734, 3100823752), h(506948616, 1363258195), h(659060556, 3750685593), h(883997877, 3785050280), h(958139571, 3318307427), h(1322822218, 3812723403), h(1537002063, 2003034995), h(1747873779, 3602036899), h(1955562222, 1575990012), h(2024104815, 1125592928), h(2227730452, 2716904306), h(2361852424, 442776044), h(2428436474, 593698344), h(2756734187, 3733110249), h(3204031479, 2999351573), h(3329325298, 3815920427), h(3391569614, 3928383900), h(3515267271, 566280711), h(3940187606, 3454069534), h(4118630271, 4000239992), h(116418474, 1914138554), h(174292421, 2731055270), h(289380356, 3203993006), h(460393269, 320620315), h(685471733, 587496836), h(852142971, 1086792851), h(1017036298, 365543100), h(1126000580, 2618297676), h(1288033470, 3409855158), h(1501505948, 4234509866), h(1607167915, 987167468), h(1816402316, 1246189591)],j = [];!function () {for (var a = 0; 80 > a; a++) {j[a] = h();}}(), k = g.SHA512 = c.extend({ _doReset: function _doReset() {this._hash = new f.init([new e.init(1779033703, 4089235720), new e.init(3144134277, 2227873595), new e.init(1013904242, 4271175723), new e.init(2773480762, 1595750129), new e.init(1359893119, 2917565137), new e.init(2600822924, 725511199), new e.init(528734635, 4215389547), new e.init(1541459225, 327033209)]);}, _doProcessBlock: function _doProcessBlock(a, b) {var T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,c = this._hash.words,d = c[0],e = c[1],f = c[2],g = c[3],h = c[4],k = c[5],l = c[6],m = c[7],n = d.high,o = d.low,p = e.high,q = e.low,r = f.high,s = f.low,t = g.high,u = g.low,v = h.high,w = h.low,x = k.high,y = k.low,z = l.high,A = l.low,B = m.high,C = m.low,D = n,E = o,F = p,G = q,H = r,I = s,J = t,K = u,L = v,M = w,N = x,O = y,P = z,Q = A,R = B,S = C;for (T = 0; 80 > T; T++) {W = j[T], 16 > T ? (V = W.high = 0 | a[b + 2 * T], U = W.low = 0 | a[b + 2 * T + 1]) : (X = j[T - 15], Y = X.high, Z = X.low, $ = (Y >>> 1 | Z << 31) ^ (Y >>> 8 | Z << 24) ^ Y >>> 7, _ = (Z >>> 1 | Y << 31) ^ (Z >>> 8 | Y << 24) ^ (Z >>> 7 | Y << 25), ab = j[T - 2], bb = ab.high, cb = ab.low, db = (bb >>> 19 | cb << 13) ^ (bb << 3 | cb >>> 29) ^ bb >>> 6, eb = (cb >>> 19 | bb << 13) ^ (cb << 3 | bb >>> 29) ^ (cb >>> 6 | bb << 26), fb = j[T - 7], gb = fb.high, hb = fb.low, ib = j[T - 16], jb = ib.high, kb = ib.low, U = _ + hb, V = $ + gb + (_ >>> 0 > U >>> 0 ? 1 : 0), U += eb, V = V + db + (eb >>> 0 > U >>> 0 ? 1 : 0), U += kb, V = V + jb + (kb >>> 0 > U >>> 0 ? 1 : 0), W.high = V, W.low = U), lb = L & N ^ ~L & P, mb = M & O ^ ~M & Q, nb = D & F ^ D & H ^ F & H, ob = E & G ^ E & I ^ G & I, pb = (D >>> 28 | E << 4) ^ (D << 30 | E >>> 2) ^ (D << 25 | E >>> 7), qb = (E >>> 28 | D << 4) ^ (E << 30 | D >>> 2) ^ (E << 25 | D >>> 7), rb = (L >>> 14 | M << 18) ^ (L >>> 18 | M << 14) ^ (L << 23 | M >>> 9), sb = (M >>> 14 | L << 18) ^ (M >>> 18 | L << 14) ^ (M << 23 | L >>> 9), tb = i[T], ub = tb.high, vb = tb.low, wb = S + sb, xb = R + rb + (S >>> 0 > wb >>> 0 ? 1 : 0), wb += mb, xb = xb + lb + (mb >>> 0 > wb >>> 0 ? 1 : 0), wb += vb, xb = xb + ub + (vb >>> 0 > wb >>> 0 ? 1 : 0), wb += U, xb = xb + V + (U >>> 0 > wb >>> 0 ? 1 : 0), yb = qb + ob, zb = pb + nb + (qb >>> 0 > yb >>> 0 ? 1 : 0), R = P, S = Q, P = N, Q = O, N = L, O = M, M = 0 | K + wb, L = 0 | J + xb + (K >>> 0 > M >>> 0 ? 1 : 0), J = H, K = I, H = F, I = G, F = D, G = E, E = 0 | wb + yb, D = 0 | xb + zb + (wb >>> 0 > E >>> 0 ? 1 : 0);}o = d.low = o + E, d.high = n + D + (E >>> 0 > o >>> 0 ? 1 : 0), q = e.low = q + G, e.high = p + F + (G >>> 0 > q >>> 0 ? 1 : 0), s = f.low = s + I, f.high = r + H + (I >>> 0 > s >>> 0 ? 1 : 0), u = g.low = u + K, g.high = t + J + (K >>> 0 > u >>> 0 ? 1 : 0), w = h.low = w + M, h.high = v + L + (M >>> 0 > w >>> 0 ? 1 : 0), y = k.low = y + O, k.high = x + N + (O >>> 0 > y >>> 0 ? 1 : 0), A = l.low = A + Q, l.high = z + P + (Q >>> 0 > A >>> 0 ? 1 : 0), C = m.low = C + S, m.high = B + R + (S >>> 0 > C >>> 0 ? 1 : 0);}, _doFinalize: function _doFinalize() {var e,a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296), b[(d + 128 >>> 10 << 5) + 31] = c, a.sigBytes = 4 * b.length, this._process(), e = this._hash.toX32();}, clone: function clone() {var a = c.clone.call(this);return a._hash = this._hash.clone(), a;}, blockSize: 32 }), a.SHA512 = c._createHelper(k), a.HmacSHA512 = c._createHmacHelper(k);}(), function () {var a = CryptoJS,b = a.x64,c = b.Word,d = b.WordArray,e = a.algo,f = e.SHA512,g = e.SHA384 = f.extend({ _doReset: function _doReset() {this._hash = new d.init([new c.init(3418070365, 3238371032), new c.init(1654270250, 914150663), new c.init(2438529370, 812702999), new c.init(355462360, 4144912697), new c.init(1731405415, 4290775857), new c.init(2394180231, 1750603025), new c.init(3675008525, 1694076839), new c.init(1203062813, 3204075428)]);}, _doFinalize: function _doFinalize() {var a = f._doFinalize.call(this);return a.sigBytes -= 16, a;} });a.SHA384 = f._createHelper(g), a.HmacSHA384 = f._createHmacHelper(g);}(), CryptoJS.lib.Cipher || function (a) {var i,j,k,l,n,o,p,q,r,t,u,v,w,x,y,z,b = CryptoJS,c = b.lib,d = c.Base,e = c.WordArray,f = c.BufferedBlockAlgorithm,g = b.enc;g.Utf8, i = g.Base64, j = b.algo, k = j.EvpKDF, l = c.Cipher = f.extend({ cfg: d.extend(), createEncryptor: function createEncryptor(a, b) {return this.create(this._ENC_XFORM_MODE, a, b);}, createDecryptor: function createDecryptor(a, b) {return this.create(this._DEC_XFORM_MODE, a, b);}, init: function init(a, b, c) {this.cfg = this.cfg.extend(c), this._xformMode = a, this._key = b, this.reset();}, reset: function reset() {f.reset.call(this), this._doReset();}, process: function process(a) {return this._append(a), this._process();}, finalize: function finalize(a) {a && this._append(a);var b = this._doFinalize();return b;}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () {function a(a) {return "string" == typeof a ? z : w;}return function (b) {return { encrypt: function encrypt(c, d, e) {return a(d).encrypt(b, c, d, e);}, decrypt: function decrypt(c, d, e) {return a(d).decrypt(b, c, d, e);} };};}() }), c.StreamCipher = l.extend({ _doFinalize: function _doFinalize() {var a = this._process(!0);return a;}, blockSize: 1 }), n = b.mode = {}, o = c.BlockCipherMode = d.extend({ createEncryptor: function createEncryptor(a, b) {return this.Encryptor.create(a, b);}, createDecryptor: function createDecryptor(a, b) {return this.Decryptor.create(a, b);}, init: function init(a, b) {this._cipher = a, this._iv = b;} }), p = n.CBC = function () {function c(b, c, d) {var e,g,f = this._iv;for (f ? (e = f, this._iv = a) : e = this._prevBlock, g = 0; d > g; g++) {b[c + g] ^= e[g];}}var b = o.extend();return b.Encryptor = b.extend({ processBlock: function processBlock(a, b) {var d = this._cipher,e = d.blockSize;c.call(this, a, b, e), d.encryptBlock(a, b), this._prevBlock = a.slice(b, b + e);} }), b.Decryptor = b.extend({ processBlock: function processBlock(a, b) {var d = this._cipher,e = d.blockSize,f = a.slice(b, b + e);d.decryptBlock(a, b), c.call(this, a, b, e), this._prevBlock = f;} }), b;}(), q = b.pad = {}, r = q.Pkcs7 = { pad: function pad(a, b) {var h,i,c = 4 * b,d = c - a.sigBytes % c,f = d << 24 | d << 16 | d << 8 | d,g = [];for (h = 0; d > h; h += 4) {g.push(f);}i = e.create(g, d), a.concat(i);}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, c.BlockCipher = l.extend({ cfg: l.cfg.extend({ mode: p, padding: r }), reset: function reset() {var a, b, c, d;l.reset.call(this), b = this.cfg, c = b.iv, d = b.mode, this._xformMode == this._ENC_XFORM_MODE ? a = d.createEncryptor : (a = d.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, c && c.words) : (this._mode = a.call(d, this, c && c.words), this._mode.__creator = a);}, _doProcessBlock: function _doProcessBlock(a, b) {this._mode.processBlock(a, b);}, _doFinalize: function _doFinalize() {var a,b = this.cfg.padding;return this._xformMode == this._ENC_XFORM_MODE ? (b.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), b.unpad(a)), a;}, blockSize: 4 }), t = c.CipherParams = d.extend({ init: function init(a) {this.mixIn(a);}, toString: function toString(a) {return (a || this.formatter).stringify(this);} }), u = b.format = {}, v = u.OpenSSL = { stringify: function stringify(a) {var b,c = a.ciphertext,d = a.salt;return b = d ? e.create([1398893684, 1701076831]).concat(d).concat(c) : c, b.toString(i);}, parse: function parse(a) {var b,c = i.parse(a),d = c.words;return 1398893684 == d[0] && 1701076831 == d[1] && (b = e.create(d.slice(2, 4)), d.splice(0, 4), c.sigBytes -= 16), t.create({ ciphertext: c, salt: b });} }, w = c.SerializableCipher = d.extend({ cfg: d.extend({ format: v }), encrypt: function encrypt(a, b, c, d) {var e, f, g;return d = this.cfg.extend(d), e = a.createEncryptor(c, d), f = e.finalize(b), g = e.cfg, t.create({ ciphertext: f, key: c, iv: g.iv, algorithm: a, mode: g.mode, padding: g.padding, blockSize: a.blockSize, formatter: d.format });}, decrypt: function decrypt(a, b, c, d) {d = this.cfg.extend(d), b = this._parse(b, d.format);var e = a.createDecryptor(c, d).finalize(b.ciphertext);return e;}, _parse: function _parse(a, b) {return "string" == typeof a ? b.parse(a, this) : a;} }), x = b.kdf = {}, y = x.OpenSSL = { execute: function execute(a, b, c, d) {var f, g;return d || (d = e.random(8)), f = k.create({ keySize: b + c }).compute(a, d), g = e.create(f.words.slice(b), 4 * c), f.sigBytes = 4 * b, t.create({ key: f, iv: g, salt: d });} }, z = c.PasswordBasedCipher = w.extend({ cfg: w.cfg.extend({ kdf: y }), encrypt: function encrypt(a, b, c, d) {var e, f;return d = this.cfg.extend(d), e = d.kdf.execute(c, a.keySize, a.ivSize), d.iv = e.iv, f = w.encrypt.call(this, a, b, e.key, d), f.mixIn(e), f;}, decrypt: function decrypt(a, b, c, d) {var e, f;return d = this.cfg.extend(d), b = this._parse(b, d.format), e = d.kdf.execute(c, a.keySize, a.ivSize, b.salt), d.iv = e.iv, f = w.decrypt.call(this, a, b, e.key, d);} });}(), CryptoJS.mode.CFB = function () {function b(a, b, c, d) {var e,g,f = this._iv;for (f ? (e = f.slice(0), this._iv = void 0) : e = this._prevBlock, d.encryptBlock(e, 0), g = 0; c > g; g++) {a[b + g] ^= e[g];}}var a = CryptoJS.lib.BlockCipherMode.extend();return a.Encryptor = a.extend({ processBlock: function processBlock(a, c) {var d = this._cipher,e = d.blockSize;b.call(this, a, c, e, d), this._prevBlock = a.slice(c, c + e);} }), a.Decryptor = a.extend({ processBlock: function processBlock(a, c) {var d = this._cipher,e = d.blockSize,f = a.slice(c, c + e);b.call(this, a, c, e, d), this._prevBlock = f;} }), a;}(), CryptoJS.mode.ECB = function () {var a = CryptoJS.lib.BlockCipherMode.extend();return a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {this._cipher.encryptBlock(a, b);} }), a.Decryptor = a.extend({ processBlock: function processBlock(a, b) {this._cipher.decryptBlock(a, b);} }), a;}(), CryptoJS.pad.AnsiX923 = { pad: function pad(a, b) {var c = a.sigBytes,d = 4 * b,e = d - c % d,f = c + e - 1;a.clamp(), a.words[f >>> 2] |= e << 24 - 8 * (f % 4), a.sigBytes += e;}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, CryptoJS.pad.Iso10126 = { pad: function pad(a, b) {var c = 4 * b,d = c - a.sigBytes % c;a.concat(CryptoJS.lib.WordArray.random(d - 1)).concat(CryptoJS.lib.WordArray.create([d << 24], 1));}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, CryptoJS.pad.Iso97971 = { pad: function pad(a, b) {a.concat(CryptoJS.lib.WordArray.create([2147483648], 1)), CryptoJS.pad.ZeroPadding.pad(a, b);}, unpad: function unpad(a) {CryptoJS.pad.ZeroPadding.unpad(a), a.sigBytes--;} }, CryptoJS.mode.OFB = function () {var a = CryptoJS.lib.BlockCipherMode.extend(),b = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var g,c = this._cipher,d = c.blockSize,e = this._iv,f = this._keystream;for (e && (f = this._keystream = e.slice(0), this._iv = void 0), c.encryptBlock(f, 0), g = 0; d > g; g++) {a[b + g] ^= f[g];}} });return a.Decryptor = b, a;}(), CryptoJS.pad.NoPadding = { pad: function pad() {}, unpad: function unpad() {} }, function () {var b = CryptoJS,c = b.lib,d = c.CipherParams,e = b.enc,f = e.Hex,g = b.format;g.Hex = { stringify: function stringify(a) {return a.ciphertext.toString(f);}, parse: function parse(a) {var b = f.parse(a);return d.create({ ciphertext: b });} };}(), function () {var o,p,a = CryptoJS,b = a.lib,c = b.BlockCipher,d = a.algo,e = [],f = [],g = [],h = [],i = [],j = [],k = [],l = [],m = [],n = [];!function () {var b,c,d,o,p,q,r,s,a = [];for (b = 0; 256 > b; b++) {a[b] = 128 > b ? b << 1 : 283 ^ b << 1;}for (c = 0, d = 0, b = 0; 256 > b; b++) {o = d ^ d << 1 ^ d << 2 ^ d << 3 ^ d << 4, o = 99 ^ (o >>> 8 ^ 255 & o), e[c] = o, f[o] = c, p = a[c], q = a[p], r = a[q], s = 257 * a[o] ^ 16843008 * o, g[c] = s << 24 | s >>> 8, h[c] = s << 16 | s >>> 16, i[c] = s << 8 | s >>> 24, j[c] = s, s = 16843009 * r ^ 65537 * q ^ 257 * p ^ 16843008 * c, k[o] = s << 24 | s >>> 8, l[o] = s << 16 | s >>> 16, m[o] = s << 8 | s >>> 24, n[o] = s, c ? (c = p ^ a[a[a[r ^ p]]], d ^= a[a[d]]) : c = d = 1;}}(), o = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], p = d.AES = c.extend({ _doReset: function _doReset() {var a, b, c, d, f, g, h, i, j, p;if (!this._nRounds || this._keyPriorReset !== this._key) {for (b = this._keyPriorReset = this._key, c = b.words, d = b.sigBytes / 4, f = this._nRounds = d + 6, g = 4 * (f + 1), h = this._keySchedule = [], i = 0; g > i; i++) {d > i ? h[i] = c[i] : (a = h[i - 1], i % d ? d > 6 && 4 == i % d && (a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a]) : (a = a << 8 | a >>> 24, a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a], a ^= o[0 | i / d] << 24), h[i] = h[i - d] ^ a);}for (j = this._invKeySchedule = [], p = 0; g > p; p++) {i = g - p, a = p % 4 ? h[i] : h[i - 4], j[p] = 4 > p || 4 >= i ? a : k[e[a >>> 24]] ^ l[e[255 & a >>> 16]] ^ m[e[255 & a >>> 8]] ^ n[e[255 & a]];}}}, encryptBlock: function encryptBlock(a, b) {this._doCryptBlock(a, b, this._keySchedule, g, h, i, j, e);}, decryptBlock: function decryptBlock(a, b) {var c = a[b + 1];a[b + 1] = a[b + 3], a[b + 3] = c, this._doCryptBlock(a, b, this._invKeySchedule, k, l, m, n, f), c = a[b + 1], a[b + 1] = a[b + 3], a[b + 3] = c;}, _doCryptBlock: function _doCryptBlock(a, b, c, d, e, f, g, h) {var o,p,q,r,s,i = this._nRounds,j = a[b] ^ c[0],k = a[b + 1] ^ c[1],l = a[b + 2] ^ c[2],m = a[b + 3] ^ c[3],n = 4;for (o = 1; i > o; o++) {p = d[j >>> 24] ^ e[255 & k >>> 16] ^ f[255 & l >>> 8] ^ g[255 & m] ^ c[n++], q = d[k >>> 24] ^ e[255 & l >>> 16] ^ f[255 & m >>> 8] ^ g[255 & j] ^ c[n++], r = d[l >>> 24] ^ e[255 & m >>> 16] ^ f[255 & j >>> 8] ^ g[255 & k] ^ c[n++], s = d[m >>> 24] ^ e[255 & j >>> 16] ^ f[255 & k >>> 8] ^ g[255 & l] ^ c[n++], j = p, k = q, l = r, m = s;}p = (h[j >>> 24] << 24 | h[255 & k >>> 16] << 16 | h[255 & l >>> 8] << 8 | h[255 & m]) ^ c[n++], q = (h[k >>> 24] << 24 | h[255 & l >>> 16] << 16 | h[255 & m >>> 8] << 8 | h[255 & j]) ^ c[n++], r = (h[l >>> 24] << 24 | h[255 & m >>> 16] << 16 | h[255 & j >>> 8] << 8 | h[255 & k]) ^ c[n++], s = (h[m >>> 24] << 24 | h[255 & j >>> 16] << 16 | h[255 & k >>> 8] << 8 | h[255 & l]) ^ c[n++], a[b] = p, a[b + 1] = q, a[b + 2] = r, a[b + 3] = s;
  10262. }, keySize: 8 }), a.AES = c._createHelper(p);}(), function () {function l(a, b) {var c = (this._lBlock >>> a ^ this._rBlock) & b;this._rBlock ^= c, this._lBlock ^= c << a;}function m(a, b) {var c = (this._rBlock >>> a ^ this._lBlock) & b;this._lBlock ^= c, this._rBlock ^= c << a;}var n,a = CryptoJS,b = a.lib,c = b.WordArray,d = b.BlockCipher,e = a.algo,f = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],g = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],h = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],i = [{ 0: 8421888, 268435456: 32768, 536870912: 8421378, 805306368: 2, 1073741824: 512, 1342177280: 8421890, 1610612736: 8389122, 1879048192: 8388608, 2147483648: 514, 2415919104: 8389120, 2684354560: 33280, 2952790016: 8421376, 3221225472: 32770, 3489660928: 8388610, 3758096384: 0, 4026531840: 33282, 134217728: 0, 402653184: 8421890, 671088640: 33282, 939524096: 32768, 1207959552: 8421888, 1476395008: 512, 1744830464: 8421378, 2013265920: 2, 2281701376: 8389120, 2550136832: 33280, 2818572288: 8421376, 3087007744: 8389122, 3355443200: 8388610, 3623878656: 32770, 3892314112: 514, 4160749568: 8388608, 1: 32768, 268435457: 2, 536870913: 8421888, 805306369: 8388608, 1073741825: 8421378, 1342177281: 33280, 1610612737: 512, 1879048193: 8389122, 2147483649: 8421890, 2415919105: 8421376, 2684354561: 8388610, 2952790017: 33282, 3221225473: 514, 3489660929: 8389120, 3758096385: 32770, 4026531841: 0, 134217729: 8421890, 402653185: 8421376, 671088641: 8388608, 939524097: 512, 1207959553: 32768, 1476395009: 8388610, 1744830465: 2, 2013265921: 33282, 2281701377: 32770, 2550136833: 8389122, 2818572289: 514, 3087007745: 8421888, 3355443201: 8389120, 3623878657: 0, 3892314113: 33280, 4160749569: 8421378 }, { 0: 1074282512, 16777216: 16384, 33554432: 524288, 50331648: 1074266128, 67108864: 1073741840, 83886080: 1074282496, 100663296: 1073758208, 117440512: 16, 134217728: 540672, 150994944: 1073758224, 167772160: 1073741824, 184549376: 540688, 201326592: 524304, 218103808: 0, 234881024: 16400, 251658240: 1074266112, 8388608: 1073758208, 25165824: 540688, 41943040: 16, 58720256: 1073758224, 75497472: 1074282512, 92274688: 1073741824, 109051904: 524288, 125829120: 1074266128, 142606336: 524304, 159383552: 0, 176160768: 16384, 192937984: 1074266112, 209715200: 1073741840, 226492416: 540672, 243269632: 1074282496, 260046848: 16400, 268435456: 0, 285212672: 1074266128, 301989888: 1073758224, 318767104: 1074282496, 335544320: 1074266112, 352321536: 16, 369098752: 540688, 385875968: 16384, 402653184: 16400, 419430400: 524288, 436207616: 524304, 452984832: 1073741840, 469762048: 540672, 486539264: 1073758208, 503316480: 1073741824, 520093696: 1074282512, 276824064: 540688, 293601280: 524288, 310378496: 1074266112, 327155712: 16384, 343932928: 1073758208, 360710144: 1074282512, 377487360: 16, 394264576: 1073741824, 411041792: 1074282496, 427819008: 1073741840, 444596224: 1073758224, 461373440: 524304, 478150656: 0, 494927872: 16400, 511705088: 1074266128, 528482304: 540672 }, { 0: 260, 1048576: 0, 2097152: 67109120, 3145728: 65796, 4194304: 65540, 5242880: 67108868, 6291456: 67174660, 7340032: 67174400, 8388608: 67108864, 9437184: 67174656, 10485760: 65792, 11534336: 67174404, 12582912: 67109124, 13631488: 65536, 14680064: 4, 15728640: 256, 524288: 67174656, 1572864: 67174404, 2621440: 0, 3670016: 67109120, 4718592: 67108868, 5767168: 65536, 6815744: 65540, 7864320: 260, 8912896: 4, 9961472: 256, 11010048: 67174400, 12058624: 65796, 13107200: 65792, 14155776: 67109124, 15204352: 67174660, 16252928: 67108864, 16777216: 67174656, 17825792: 65540, 18874368: 65536, 19922944: 67109120, 20971520: 256, 22020096: 67174660, 23068672: 67108868, 24117248: 0, 25165824: 67109124, 26214400: 67108864, 27262976: 4, 28311552: 65792, 29360128: 67174400, 30408704: 260, 31457280: 65796, 32505856: 67174404, 17301504: 67108864, 18350080: 260, 19398656: 67174656, 20447232: 0, 21495808: 65540, 22544384: 67109120, 23592960: 256, 24641536: 67174404, 25690112: 65536, 26738688: 67174660, 27787264: 65796, 28835840: 67108868, 29884416: 67109124, 30932992: 67174400, 31981568: 4, 33030144: 65792 }, { 0: 2151682048, 65536: 2147487808, 131072: 4198464, 196608: 2151677952, 262144: 0, 327680: 4198400, 393216: 2147483712, 458752: 4194368, 524288: 2147483648, 589824: 4194304, 655360: 64, 720896: 2147487744, 786432: 2151678016, 851968: 4160, 917504: 4096, 983040: 2151682112, 32768: 2147487808, 98304: 64, 163840: 2151678016, 229376: 2147487744, 294912: 4198400, 360448: 2151682112, 425984: 0, 491520: 2151677952, 557056: 4096, 622592: 2151682048, 688128: 4194304, 753664: 4160, 819200: 2147483648, 884736: 4194368, 950272: 4198464, 1015808: 2147483712, 1048576: 4194368, 1114112: 4198400, 1179648: 2147483712, 1245184: 0, 1310720: 4160, 1376256: 2151678016, 1441792: 2151682048, 1507328: 2147487808, 1572864: 2151682112, 1638400: 2147483648, 1703936: 2151677952, 1769472: 4198464, 1835008: 2147487744, 1900544: 4194304, 1966080: 64, 2031616: 4096, 1081344: 2151677952, 1146880: 2151682112, 1212416: 0, 1277952: 4198400, 1343488: 4194368, 1409024: 2147483648, 1474560: 2147487808, 1540096: 64, 1605632: 2147483712, 1671168: 4096, 1736704: 2147487744, 1802240: 2151678016, 1867776: 4160, 1933312: 2151682048, 1998848: 4194304, 2064384: 4198464 }, { 0: 128, 4096: 17039360, 8192: 262144, 12288: 536870912, 16384: 537133184, 20480: 16777344, 24576: 553648256, 28672: 262272, 32768: 16777216, 36864: 537133056, 40960: 536871040, 45056: 553910400, 49152: 553910272, 53248: 0, 57344: 17039488, 61440: 553648128, 2048: 17039488, 6144: 553648256, 10240: 128, 14336: 17039360, 18432: 262144, 22528: 537133184, 26624: 553910272, 30720: 536870912, 34816: 537133056, 38912: 0, 43008: 553910400, 47104: 16777344, 51200: 536871040, 55296: 553648128, 59392: 16777216, 63488: 262272, 65536: 262144, 69632: 128, 73728: 536870912, 77824: 553648256, 81920: 16777344, 86016: 553910272, 90112: 537133184, 94208: 16777216, 98304: 553910400, 102400: 553648128, 106496: 17039360, 110592: 537133056, 114688: 262272, 118784: 536871040, 122880: 0, 126976: 17039488, 67584: 553648256, 71680: 16777216, 75776: 17039360, 79872: 537133184, 83968: 536870912, 88064: 17039488, 92160: 128, 96256: 553910272, 100352: 262272, 104448: 553910400, 108544: 0, 112640: 553648128, 116736: 16777344, 120832: 262144, 124928: 537133056, 129024: 536871040 }, { 0: 268435464, 256: 8192, 512: 270532608, 768: 270540808, 1024: 268443648, 1280: 2097152, 1536: 2097160, 1792: 268435456, 2048: 0, 2304: 268443656, 2560: 2105344, 2816: 8, 3072: 270532616, 3328: 2105352, 3584: 8200, 3840: 270540800, 128: 270532608, 384: 270540808, 640: 8, 896: 2097152, 1152: 2105352, 1408: 268435464, 1664: 268443648, 1920: 8200, 2176: 2097160, 2432: 8192, 2688: 268443656, 2944: 270532616, 3200: 0, 3456: 270540800, 3712: 2105344, 3968: 268435456, 4096: 268443648, 4352: 270532616, 4608: 270540808, 4864: 8200, 5120: 2097152, 5376: 268435456, 5632: 268435464, 5888: 2105344, 6144: 2105352, 6400: 0, 6656: 8, 6912: 270532608, 7168: 8192, 7424: 268443656, 7680: 270540800, 7936: 2097160, 4224: 8, 4480: 2105344, 4736: 2097152, 4992: 268435464, 5248: 268443648, 5504: 8200, 5760: 270540808, 6016: 270532608, 6272: 270540800, 6528: 270532616, 6784: 8192, 7040: 2105352, 7296: 2097160, 7552: 0, 7808: 268435456, 8064: 268443656 }, { 0: 1048576, 16: 33555457, 32: 1024, 48: 1049601, 64: 34604033, 80: 0, 96: 1, 112: 34603009, 128: 33555456, 144: 1048577, 160: 33554433, 176: 34604032, 192: 34603008, 208: 1025, 224: 1049600, 240: 33554432, 8: 34603009, 24: 0, 40: 33555457, 56: 34604032, 72: 1048576, 88: 33554433, 104: 33554432, 120: 1025, 136: 1049601, 152: 33555456, 168: 34603008, 184: 1048577, 200: 1024, 216: 34604033, 232: 1, 248: 1049600, 256: 33554432, 272: 1048576, 288: 33555457, 304: 34603009, 320: 1048577, 336: 33555456, 352: 34604032, 368: 1049601, 384: 1025, 400: 34604033, 416: 1049600, 432: 1, 448: 0, 464: 34603008, 480: 33554433, 496: 1024, 264: 1049600, 280: 33555457, 296: 34603009, 312: 1, 328: 33554432, 344: 1048576, 360: 1025, 376: 34604032, 392: 33554433, 408: 34603008, 424: 0, 440: 34604033, 456: 1049601, 472: 1024, 488: 33555456, 504: 1048577 }, { 0: 134219808, 1: 131072, 2: 134217728, 3: 32, 4: 131104, 5: 134350880, 6: 134350848, 7: 2048, 8: 134348800, 9: 134219776, 10: 133120, 11: 134348832, 12: 2080, 13: 0, 14: 134217760, 15: 133152, 2147483648: 2048, 2147483649: 134350880, 2147483650: 134219808, 2147483651: 134217728, 2147483652: 134348800, 2147483653: 133120, 2147483654: 133152, 2147483655: 32, 2147483656: 134217760, 2147483657: 2080, 2147483658: 131104, 2147483659: 134350848, 2147483660: 0, 2147483661: 134348832, 2147483662: 134219776, 2147483663: 131072, 16: 133152, 17: 134350848, 18: 32, 19: 2048, 20: 134219776, 21: 134217760, 22: 134348832, 23: 131072, 24: 0, 25: 131104, 26: 134348800, 27: 134219808, 28: 134350880, 29: 133120, 30: 2080, 31: 134217728, 2147483664: 131072, 2147483665: 2048, 2147483666: 134348832, 2147483667: 133152, 2147483668: 32, 2147483669: 134348800, 2147483670: 134217728, 2147483671: 134219808, 2147483672: 134350880, 2147483673: 134217760, 2147483674: 134219776, 2147483675: 0, 2147483676: 133120, 2147483677: 2080, 2147483678: 131104, 2147483679: 134350848 }],j = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],k = e.DES = d.extend({ _doReset: function _doReset() {var d,e,i,j,k,l,m,a = this._key,b = a.words,c = [];for (d = 0; 56 > d; d++) {e = f[d] - 1, c[d] = 1 & b[e >>> 5] >>> 31 - e % 32;}for (i = this._subKeys = [], j = 0; 16 > j; j++) {for (k = i[j] = [], l = h[j], d = 0; 24 > d; d++) {k[0 | d / 6] |= c[(g[d] - 1 + l) % 28] << 31 - d % 6, k[4 + (0 | d / 6)] |= c[28 + (g[d + 24] - 1 + l) % 28] << 31 - d % 6;}for (k[0] = k[0] << 1 | k[0] >>> 31, d = 1; 7 > d; d++) {k[d] = k[d] >>> 4 * (d - 1) + 3;}k[7] = k[7] << 5 | k[7] >>> 27;}for (m = this._invSubKeys = [], d = 0; 16 > d; d++) {m[d] = i[15 - d];}}, encryptBlock: function encryptBlock(a, b) {this._doCryptBlock(a, b, this._subKeys);}, decryptBlock: function decryptBlock(a, b) {this._doCryptBlock(a, b, this._invSubKeys);}, _doCryptBlock: function _doCryptBlock(a, b, c) {var d, e, f, g, h, k, n;for (this._lBlock = a[b], this._rBlock = a[b + 1], l.call(this, 4, 252645135), l.call(this, 16, 65535), m.call(this, 2, 858993459), m.call(this, 8, 16711935), l.call(this, 1, 1431655765), d = 0; 16 > d; d++) {for (e = c[d], f = this._lBlock, g = this._rBlock, h = 0, k = 0; 8 > k; k++) {h |= i[k][((g ^ e[k]) & j[k]) >>> 0];}this._lBlock = g, this._rBlock = f ^ h;}n = this._lBlock, this._lBlock = this._rBlock, this._rBlock = n, l.call(this, 1, 1431655765), m.call(this, 8, 16711935), m.call(this, 2, 858993459), l.call(this, 16, 65535), l.call(this, 4, 252645135), a[b] = this._lBlock, a[b + 1] = this._rBlock;}, keySize: 2, ivSize: 2, blockSize: 2 });a.DES = d._createHelper(k), n = e.TripleDES = d.extend({ _doReset: function _doReset() {var d,e,f,a = this._key,b = a.words;if (2 !== b.length && 4 !== b.length && b.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");d = b.slice(0, 2), e = b.length < 4 ? b.slice(0, 2) : b.slice(2, 4), f = b.length < 6 ? b.slice(0, 2) : b.slice(4, 6), this._des1 = k.createEncryptor(c.create(d)), this._des2 = k.createEncryptor(c.create(e)), this._des3 = k.createEncryptor(c.create(f));}, encryptBlock: function encryptBlock(a, b) {this._des1.encryptBlock(a, b), this._des2.decryptBlock(a, b), this._des3.encryptBlock(a, b);}, decryptBlock: function decryptBlock(a, b) {this._des3.decryptBlock(a, b), this._des2.encryptBlock(a, b), this._des1.decryptBlock(a, b);}, keySize: 6, ivSize: 2, blockSize: 2 }), a.TripleDES = d._createHelper(n);}(), function () {function f() {var e,f,a = this._S,b = this._i,c = this._j,d = 0;for (e = 0; 4 > e; e++) {b = (b + 1) % 256, c = (c + a[b]) % 256, f = a[b], a[b] = a[c], a[c] = f, d |= a[(a[b] + a[c]) % 256] << 24 - 8 * e;}return this._i = b, this._j = c, d;}var g,a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = d.RC4 = c.extend({ _doReset: function _doReset() {var e,f,g,h,i,a = this._key,b = a.words,c = a.sigBytes,d = this._S = [];for (e = 0; 256 > e; e++) {d[e] = e;}for (e = 0, f = 0; 256 > e; e++) {g = e % c, h = 255 & b[g >>> 2] >>> 24 - 8 * (g % 4), f = (f + d[e] + h) % 256, i = d[e], d[e] = d[f], d[f] = i;}this._i = this._j = 0;}, _doProcessBlock: function _doProcessBlock(a, b) {a[b] ^= f.call(this);}, keySize: 8, ivSize: 0 });a.RC4 = c._createHelper(e), g = d.RC4Drop = e.extend({ cfg: e.cfg.extend({ drop: 192 }), _doReset: function _doReset() {e._doReset.call(this);for (var a = this.cfg.drop; a > 0; a--) {f.call(this);}} }), a.RC4Drop = c._createHelper(g);}(), CryptoJS.mode.CTRGladman = function () {function b(a) {var b, c, d;return 255 === (255 & a >> 24) ? (b = 255 & a >> 16, c = 255 & a >> 8, d = 255 & a, 255 === b ? (b = 0, 255 === c ? (c = 0, 255 === d ? d = 0 : ++d) : ++c) : ++b, a = 0, a += b << 16, a += c << 8, a += d) : a += 1 << 24, a;}function c(a) {return 0 === (a[0] = b(a[0])) && (a[1] = b(a[1])), a;}var a = CryptoJS.lib.BlockCipherMode.extend(),d = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var h,i,d = this._cipher,e = d.blockSize,f = this._iv,g = this._counter;for (f && (g = this._counter = f.slice(0), this._iv = void 0), c(g), h = g.slice(0), d.encryptBlock(h, 0), i = 0; e > i; i++) {a[b + i] ^= h[i];}} });return a.Decryptor = d, a;}(), function () {function i() {var c,d,e,h,i,j,a = this._X,b = this._C;for (c = 0; 8 > c; c++) {f[c] = b[c];}for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;}a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];}var a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = [],f = [],g = [],h = d.Rabbit = c.extend({ _doReset: function _doReset() {var c,d,e,f,g,h,j,k,l,m,a = this._key.words,b = this.cfg.iv;for (c = 0; 4 > c; c++) {a[c] = 16711935 & (a[c] << 8 | a[c] >>> 24) | 4278255360 & (a[c] << 24 | a[c] >>> 8);}for (d = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16], e = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]], this._b = 0, c = 0; 4 > c; c++) {i.call(this);}for (c = 0; 8 > c; c++) {e[c] ^= d[7 & c + 4];}if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, e[0] ^= j, e[1] ^= l, e[2] ^= k, e[3] ^= m, e[4] ^= j, e[5] ^= l, e[6] ^= k, e[7] ^= m, c = 0; 4 > c; c++) {i.call(this);}}, _doProcessBlock: function _doProcessBlock(a, b) {var d,c = this._X;for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];}}, blockSize: 4, ivSize: 2 });a.Rabbit = c._createHelper(h);}(), CryptoJS.mode.CTR = function () {var a = CryptoJS.lib.BlockCipherMode.extend(),b = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var g,h,c = this._cipher,d = c.blockSize,e = this._iv,f = this._counter;for (e && (f = this._counter = e.slice(0), this._iv = void 0), g = f.slice(0), c.encryptBlock(g, 0), f[d - 1] = 0 | f[d - 1] + 1, h = 0; d > h; h++) {a[b + h] ^= g[h];}} });return a.Decryptor = b, a;}(), function () {function i() {var c,d,e,h,i,j,a = this._X,b = this._C;for (c = 0; 8 > c; c++) {f[c] = b[c];}for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;}a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];}var a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = [],f = [],g = [],h = d.RabbitLegacy = c.extend({ _doReset: function _doReset() {var e,f,g,h,j,k,l,m,a = this._key.words,b = this.cfg.iv,c = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16],d = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]];for (this._b = 0, e = 0; 4 > e; e++) {i.call(this);}for (e = 0; 8 > e; e++) {d[e] ^= c[7 & e + 4];}if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, d[0] ^= j, d[1] ^= l, d[2] ^= k, d[3] ^= m, d[4] ^= j, d[5] ^= l, d[6] ^= k, d[7] ^= m, e = 0; 4 > e; e++) {i.call(this);}}, _doProcessBlock: function _doProcessBlock(a, b) {var d,c = this._X;for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];}}, blockSize: 4, ivSize: 2 });a.RabbitLegacy = c._createHelper(h);}(), CryptoJS.pad.ZeroPadding = { pad: function pad(a, b) {var c = 4 * b;a.clamp(), a.sigBytes += c - (a.sigBytes % c || c);}, unpad: function unpad(a) {var b = a.words,c = a.sigBytes - 1;for (c = a.sigBytes - 1; c >= 0; c--) {if (255 & b[c >>> 2] >>> 24 - 8 * (c % 4)) {a.sigBytes = c + 1;break;}}} };try {} catch (e) {}!function (a, b) { true ? b(exports) : undefined;}(this, function (a) {"use strict";function c(a) {return b.charAt(a);}function d(a, b) {return a & b;}function e(a, b) {return a | b;}function f(a, b) {return a ^ b;}function g(a, b) {return a & ~b;}function h(a) {if (0 == a) return -1;var b = 0;return 0 == (65535 & a) && (a >>= 16, b += 16), 0 == (255 & a) && (a >>= 8, b += 8), 0 == (15 & a) && (a >>= 4, b += 4), 0 == (3 & a) && (a >>= 2, b += 2), 0 == (1 & a) && ++b, b;}function i(a) {for (var b = 0; 0 != a;) {a &= a - 1, ++b;}return b;}function l(a) {var b,c,d = "";for (b = 0; b + 3 <= a.length; b += 3) {c = parseInt(a.substring(b, b + 3), 16), d += j.charAt(c >> 6) + j.charAt(63 & c);}for (b + 1 == a.length ? (c = parseInt(a.substring(b, b + 1), 16), d += j.charAt(c << 2)) : b + 2 == a.length && (c = parseInt(a.substring(b, b + 2), 16), d += j.charAt(c >> 2) + j.charAt((3 & c) << 4)); (3 & d.length) > 0;) {d += k;}return d;}function m(a) {var d,g,b = "",e = 0,f = 0;for (d = 0; d < a.length && a.charAt(d) != k; ++d) {g = j.indexOf(a.charAt(d)), 0 > g || (0 == e ? (b += c(g >> 2), f = 3 & g, e = 1) : 1 == e ? (b += c(f << 2 | g >> 4), f = 15 & g, e = 2) : 2 == e ? (b += c(f), b += c(g >> 2), f = 3 & g, e = 3) : (b += c(f << 2 | g >> 4), b += c(15 & g), e = 0));}return 1 == e && (b += c(f << 2)), b;}function o(a, b) {function c() {this.constructor = a;}_n(a, b), a.prototype = null === b ? Object.create(b) : (c.prototype = b.prototype, new c());}function y(a, b) {return a.length > b && (a = a.substring(0, b) + v), a;}function M() {return new H(null);}function N(a, b) {return new H(a, b);}function Q(a, b, c, d, e, f) {for (var i, j, k, g = 16383 & b, h = b >> 14; --f >= 0;) {i = 16383 & this[a], j = this[a++] >> 14, k = h * i + j * g, i = g * i + ((16383 & k) << 14) + c[d] + e, e = (i >> 28) + (k >> 14) + h * j, c[d++] = 268435455 & i;}return e;}function V(a, b) {var c = S[a.charCodeAt(b)];return null == c ? -1 : c;}function W(a) {var b = M();return b.fromInt(a), b;}function X(a) {var c,b = 1;return 0 != (c = a >>> 16) && (a = c, b += 16), 0 != (c = a >> 8) && (a = c, b += 8), 0 != (c = a >> 4) && (a = c, b += 4), 0 != (c = a >> 2) && (a = c, b += 2), 0 != (c = a >> 1) && (a = c, b += 1), b;}function Z() {return new Y();}function fb() {if (null == _) {for (_ = Z(); $ > bb;) {var a = Math.floor(65536 * Math.random());ab[bb++] = 255 & a;}for (_.init(ab), bb = 0; bb < ab.length; ++bb) {ab[bb] = 0;}bb = 0;}return _.next();}function hb(a, b) {var c, d, e, f;if (b < a.length + 22) return console.error("Message too long for RSA"), null;for (c = b - a.length - 6, d = "", e = 0; c > e; e += 2) {d += "ff";}return f = "0001" + d + "00" + a, N(f, 16);}function ib(a, b) {var c, d, e, f, g;if (b < a.length + 11) return console.error("Message too long for RSA"), null;for (c = [], d = a.length - 1; d >= 0 && b > 0;) {e = a.charCodeAt(d--), 128 > e ? c[--b] = e : e > 127 && 2048 > e ? (c[--b] = 128 | 63 & e, c[--b] = 192 | e >> 6) : (c[--b] = 128 | 63 & e, c[--b] = 128 | 63 & e >> 6, c[--b] = 224 | e >> 12);}for (c[--b] = 0, f = new gb(), g = []; b > 2;) {for (g[0] = 0; 0 == g[0];) {f.nextBytes(g);}c[--b] = g[0];}return c[--b] = 2, c[--b] = 0, new H(c);}function kb(a, b) {for (var e, f, c = a.toByteArray(), d = 0; d < c.length && 0 == c[d];) {++d;}if (c.length - d != b - 1 || 2 != c[d]) return null;for (++d; 0 != c[d];) {if (++d >= c.length) return null;}for (e = ""; ++d < c.length;) {f = 255 & c[d], 128 > f ? e += String.fromCharCode(f) : f > 191 && 224 > f ? (e += String.fromCharCode((31 & f) << 6 | 63 & c[d + 1]), ++d) : (e += String.fromCharCode((15 & f) << 12 | (63 & c[d + 1]) << 6 | 63 & c[d + 2]), d += 2);}return e;}function mb(a) {return lb[a] || "";}function nb(a) {var b, c, d;for (b in lb) {if (lb.hasOwnProperty(b) && (c = lb[b], d = c.length, a.substr(0, d) == c)) return a.substr(d);}return a;}var p,r,C,R,S,T,U,Y,$,_,ab,bb,cb,db,gb,jb,lb,ob,pb,qb,rb,b = "0123456789abcdefghijklmnopqrstuvwxyz",j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k = "=",_n = function n(a, b) {return _n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (a, b) {a.__proto__ = b;} || function (a, b) {for (var c in b) {b.hasOwnProperty(c) && (a[c] = b[c]);}}, _n(a, b);},q = { decode: function decode(a) {var b, c, d, e, f, g, h;if (void 0 === p) {for (c = "0123456789ABCDEF", d = " \f\n\r\t\xA0\u2028\u2029", p = {}, b = 0; 16 > b; ++b) {p[c.charAt(b)] = b;}for (c = c.toLowerCase(), b = 10; 16 > b; ++b) {p[c.charAt(b)] = b;}for (b = 0; b < d.length; ++b) {p[d.charAt(b)] = -1;}}for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {if (h = p[h], -1 != h) {if (void 0 === h) throw new Error("Illegal character at offset " + b);f |= h, ++g >= 2 ? (e[e.length] = f, f = 0, g = 0) : f <<= 4;}}if (g) throw new Error("Hex encoding incomplete: 4 bits missing");return e;} },s = { decode: function decode(a) {var b, c, d, e, f, g, h;if (void 0 === r) {for (c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = "= \f\n\r\t\xA0\u2028\u2029", r = Object.create(null), b = 0; 64 > b; ++b) {r[c.charAt(b)] = b;}for (b = 0; b < d.length; ++b) {r[d.charAt(b)] = -1;}}for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {if (h = r[h], -1 != h) {if (void 0 === h) throw new Error("Illegal character at offset " + b);f |= h, ++g >= 4 ? (e[e.length] = f >> 16, e[e.length] = 255 & f >> 8, e[e.length] = 255 & f, f = 0, g = 0) : f <<= 6;}}switch (g) {case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:e[e.length] = f >> 10;break;case 3:e[e.length] = f >> 16, e[e.length] = 255 & f >> 8;}return e;}, re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/, unarmor: function unarmor(a) {var b = s.re.exec(a);if (b) if (b[1]) a = b[1];else {if (!b[2]) throw new Error("RegExp out of sync");a = b[2];}return s.decode(a);} },t = 1e13,u = function () {function a(a) {this.buf = [+a || 0];}return a.prototype.mulAdd = function (a, b) {var e,f,c = this.buf,d = c.length;for (e = 0; d > e; ++e) {f = c[e] * a + b, t > f ? b = 0 : (b = 0 | f / t, f -= b * t), c[e] = f;}b > 0 && (c[e] = b);}, a.prototype.sub = function (a) {var d,e,b = this.buf,c = b.length;for (d = 0; c > d; ++d) {e = b[d] - a, 0 > e ? (e += t, a = 1) : a = 0, b[d] = e;}for (; 0 === b[b.length - 1];) {b.pop();}}, a.prototype.toString = function (a) {var b, c, d;if (10 != (a || 10)) throw new Error("only base 10 is supported");for (b = this.buf, c = b[b.length - 1].toString(), d = b.length - 2; d >= 0; --d) {c += (t + b[d]).toString().substring(1);}return c;}, a.prototype.valueOf = function () {var c,a = this.buf,b = 0;for (c = a.length - 1; c >= 0; --c) {b = b * t + a[c];}return b;}, a.prototype.simplify = function () {var a = this.buf;return 1 == a.length ? a[0] : this;}, a;}(),v = "…",w = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,x = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,z = function () {function a(b, c) {this.hexDigits = "0123456789ABCDEF", b instanceof a ? (this.enc = b.enc, this.pos = b.pos) : (this.enc = b, this.pos = c);}return a.prototype.get = function (a) {if (void 0 === a && (a = this.pos++), a >= this.enc.length) throw new Error("Requesting byte offset " + a + " on a stream of length " + this.enc.length);return "string" == typeof this.enc ? this.enc.charCodeAt(a) : this.enc[a];}, a.prototype.hexByte = function (a) {return this.hexDigits.charAt(15 & a >> 4) + this.hexDigits.charAt(15 & a);}, a.prototype.hexDump = function (a, b, c) {var e,d = "";for (e = a; b > e; ++e) {if (d += this.hexByte(this.get(e)), c !== !0) switch (15 & e) {case 7:d += " ";break;case 15:d += "\n";break;default:d += " ";}}return d;}, a.prototype.isASCII = function (a, b) {var c, d;for (c = a; b > c; ++c) {if (d = this.get(c), 32 > d || d > 176) return !1;}return !0;}, a.prototype.parseStringISO = function (a, b) {var d,c = "";for (d = a; b > d; ++d) {c += String.fromCharCode(this.get(d));}return c;}, a.prototype.parseStringUTF = function (a, b) {var d,e,c = "";for (d = a; b > d;) {e = this.get(d++), c += 128 > e ? String.fromCharCode(e) : e > 191 && 224 > e ? String.fromCharCode((31 & e) << 6 | 63 & this.get(d++)) : String.fromCharCode((15 & e) << 12 | (63 & this.get(d++)) << 6 | 63 & this.get(d++));}return c;}, a.prototype.parseStringBMP = function (a, b) {var d,e,f,c = "";for (f = a; b > f;) {d = this.get(f++), e = this.get(f++), c += String.fromCharCode(d << 8 | e);}return c;}, a.prototype.parseTime = function (a, b, c) {var d = this.parseStringISO(a, b),e = (c ? w : x).exec(d);return e ? (c && (e[1] = +e[1], e[1] += +e[1] < 70 ? 2e3 : 1900), d = e[1] + "-" + e[2] + "-" + e[3] + " " + e[4], e[5] && (d += ":" + e[5], e[6] && (d += ":" + e[6], e[7] && (d += "." + e[7]))), e[8] && (d += " UTC", "Z" != e[8] && (d += e[8], e[9] && (d += ":" + e[9]))), d) : "Unrecognized time: " + d;}, a.prototype.parseInteger = function (a, b) {for (var f, h, i, c = this.get(a), d = c > 127, e = d ? 255 : 0, g = ""; c == e && ++a < b;) {c = this.get(a);}if (f = b - a, 0 === f) return d ? -1 : 0;if (f > 4) {for (g = c, f <<= 3; 0 == (128 & (+g ^ e));) {g = +g << 1, --f;}g = "(" + f + " bit)\n";}for (d && (c -= 256), h = new u(c), i = a + 1; b > i; ++i) {h.mulAdd(256, this.get(i));}return g + h.toString();}, a.prototype.parseBitString = function (a, b, c) {var h,i,j,k,d = this.get(a),e = (b - a - 1 << 3) - d,f = "(" + e + " bit)\n",g = "";for (h = a + 1; b > h; ++h) {for (i = this.get(h), j = h == b - 1 ? d : 0, k = 7; k >= j; --k) {g += 1 & i >> k ? "1" : "0";}if (g.length > c) return f + y(g, c);}return f + g;}, a.prototype.parseOctetString = function (a, b, c) {var d, e, f;if (this.isASCII(a, b)) return y(this.parseStringISO(a, b), c);for (d = b - a, e = "(" + d + " byte)\n", c /= 2, d > c && (b = a + c), f = a; b > f; ++f) {e += this.hexByte(this.get(f));}return d > c && (e += v), e;}, a.prototype.parseOID = function (a, b, c) {var g,h,i,d = "",e = new u(),f = 0;for (g = a; b > g; ++g) {if (h = this.get(g), e.mulAdd(128, 127 & h), f += 7, !(128 & h)) {if ("" === d ? (e = e.simplify(), e instanceof u ? (e.sub(80), d = "2." + e.toString()) : (i = 80 > e ? 40 > e ? 0 : 1 : 2, d = i + "." + (e - 40 * i))) : d += "." + e.toString(), d.length > c) return y(d, c);e = new u(), f = 0;}}return f > 0 && (d += ".incomplete"), d;}, a;}(),A = function () {function a(a, b, c, d, e) {if (!(d instanceof B)) throw new Error("Invalid tag value.");this.stream = a, this.header = b, this.length = c, this.tag = d, this.sub = e;}return a.prototype.typeName = function () {switch (this.tag.tagClass) {case 0:switch (this.tag.tagNumber) {case 0:return "EOC";case 1:return "BOOLEAN";case 2:return "INTEGER";case 3:return "BIT_STRING";case 4:return "OCTET_STRING";case 5:return "NULL";case 6:return "OBJECT_IDENTIFIER";case 7:return "ObjectDescriptor";case 8:return "EXTERNAL";case 9:return "REAL";case 10:return "ENUMERATED";case 11:return "EMBEDDED_PDV";case 12:return "UTF8String";case 16:return "SEQUENCE";case 17:return "SET";case 18:return "NumericString";case 19:return "PrintableString";case 20:return "TeletexString";case 21:return "VideotexString";case 22:return "IA5String";case 23:return "UTCTime";case 24:return "GeneralizedTime";case 25:return "GraphicString";case 26:return "VisibleString";case 27:return "GeneralString";case 28:return "UniversalString";case 30:return "BMPString";}return "Universal_" + this.tag.tagNumber.toString();case 1:return "Application_" + this.tag.tagNumber.toString();case 2:return "[" + this.tag.tagNumber.toString() + "]";case 3:return "Private_" + this.tag.tagNumber.toString();}}, a.prototype.content = function (a) {var b, c;if (void 0 === this.tag) return null;if (void 0 === a && (a = 1 / 0), b = this.posContent(), c = Math.abs(this.length), !this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);switch (this.tag.tagNumber) {case 1:return 0 === this.stream.get(b) ? "false" : "true";case 2:return this.stream.parseInteger(b, b + c);case 3:return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(b, b + c, a);case 4:return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);case 6:return this.stream.parseOID(b, b + c, a);case 16:case 17:return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";case 12:return y(this.stream.parseStringUTF(b, b + c), a);case 18:case 19:case 20:case 21:case 22:case 26:return y(this.stream.parseStringISO(b, b + c), a);case 30:return y(this.stream.parseStringBMP(b, b + c), a);case 23:case 24:return this.stream.parseTime(b, b + c, 23 == this.tag.tagNumber);}return null;}, a.prototype.toString = function () {return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]";}, a.prototype.toPrettyString = function (a) {var b, c, d;if (void 0 === a && (a = ""), b = a + this.typeName() + " @" + this.stream.pos, this.length >= 0 && (b += "+"), b += this.length, this.tag.tagConstructed ? b += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (b += " (encapsulates)"), b += "\n", null !== this.sub) for (a += " ", c = 0, d = this.sub.length; d > c; ++c) {b += this.sub[c].toPrettyString(a);}return b;}, a.prototype.posStart = function () {return this.stream.pos;}, a.prototype.posContent = function () {return this.stream.pos + this.header;}, a.prototype.posEnd = function () {return this.stream.pos + this.header + Math.abs(this.length);}, a.prototype.toHexString = function () {return this.stream.hexDump(this.posStart(), this.posEnd(), !0);}, a.decodeLength = function (a) {var d,b = a.get(),c = 127 & b;if (c == b) return c;if (c > 6) throw new Error("Length over 48 bits not supported at position " + (a.pos - 1));if (0 === c) return null;for (b = 0, d = 0; c > d; ++d) {b = 256 * b + a.get();}return b;}, a.prototype.getHexStringValue = function () {var a = this.toHexString(),b = 2 * this.header,c = 2 * this.length;return a.substr(b, c);}, a.decode = function (b) {var c, d, e, f, g, h, i, j, k;if (c = b instanceof z ? b : new z(b, 0), d = new z(c), e = new B(c), f = a.decodeLength(c), g = c.pos, h = g - d.pos, i = null, j = function j() {var d,e,b = [];if (null !== f) {for (d = g + f; c.pos < d;) {b[b.length] = a.decode(c);}if (c.pos != d) throw new Error("Content size is not correct for container starting at offset " + g);} else try {for (; e = a.decode(c), !e.tag.isEOC();) {b[b.length] = e;}f = g - c.pos;} catch (h) {throw new Error("Exception while decoding undefined length content: " + h);}return b;}, e.tagConstructed) i = j();else if (e.isUniversal() && (3 == e.tagNumber || 4 == e.tagNumber)) try {if (3 == e.tagNumber && 0 != c.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");for (i = j(), k = 0; k < i.length; ++k) {if (i[k].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.");}} catch (l) {i = null;}if (null === i) {if (null === f) throw new Error("We can't skip over an invalid tag with undefined length at offset " + g);c.pos = g + Math.abs(f);}return new a(d, h, f, e, i);}, a;}(),B = function () {function a(a) {var c,b = a.get();if (this.tagClass = b >> 6, this.tagConstructed = 0 !== (32 & b), this.tagNumber = 31 & b, 31 == this.tagNumber) {c = new u();do {b = a.get(), c.mulAdd(128, 127 & b);} while (128 & b);this.tagNumber = c.simplify();}}return a.prototype.isUniversal = function () {return 0 === this.tagClass;}, a.prototype.isEOC = function () {return 0 === this.tagClass && 0 === this.tagNumber;}, a;}(),F = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],G = (1 << 26) / F[F.length - 1],H = function () {function a(a, b, c) {null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b));}return a.prototype.toString = function (a) {var b, d, e, f, g, h, i;if (this.s < 0) return "-" + this.negate().toString(a);if (16 == a) b = 4;else if (8 == a) b = 3;else if (2 == a) b = 1;else if (32 == a) b = 5;else {if (4 != a) return this.toRadix(a);b = 2;}if (d = (1 << b) - 1, f = !1, g = "", h = this.t, i = this.DB - h * this.DB % b, h-- > 0) for (i < this.DB && (e = this[h] >> i) > 0 && (f = !0, g = c(e)); h >= 0;) {b > i ? (e = (this[h] & (1 << i) - 1) << b - i, e |= this[--h] >> (i += this.DB - b)) : (e = this[h] >> (i -= b) & d, 0 >= i && (i += this.DB, --h)), e > 0 && (f = !0), f && (g += c(e));}return f ? g : "0";}, a.prototype.negate = function () {var b = M();return a.ZERO.subTo(this, b), b;}, a.prototype.abs = function () {return this.s < 0 ? this.negate() : this;}, a.prototype.compareTo = function (a) {var c,b = this.s - a.s;if (0 != b) return b;if (c = this.t, b = c - a.t, 0 != b) return this.s < 0 ? -b : b;for (; --c >= 0;) {if (0 != (b = this[c] - a[c])) return b;}return 0;}, a.prototype.bitLength = function () {return this.t <= 0 ? 0 : this.DB * (this.t - 1) + X(this[this.t - 1] ^ this.s & this.DM);}, a.prototype.mod = function (b) {var c = M();return this.abs().divRemTo(b, null, c), this.s < 0 && c.compareTo(a.ZERO) > 0 && b.subTo(c, c), c;}, a.prototype.modPowInt = function (a, b) {var c;return c = 256 > a || b.isEven() ? new J(b) : new K(b), this.exp(a, c);}, a.prototype.clone = function () {var a = M();return this.copyTo(a), a;}, a.prototype.intValue = function () {if (this.s < 0) {if (1 == this.t) return this[0] - this.DV;if (0 == this.t) return -1;} else {if (1 == this.t) return this[0];if (0 == this.t) return 0;}return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];}, a.prototype.byteValue = function () {return 0 == this.t ? this.s : this[0] << 24 >> 24;
  10263. }, a.prototype.shortValue = function () {return 0 == this.t ? this.s : this[0] << 16 >> 16;}, a.prototype.signum = function () {return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1;}, a.prototype.toByteArray = function () {var c,d,e,a = this.t,b = [];if (b[0] = this.s, c = this.DB - a * this.DB % 8, e = 0, a-- > 0) for (c < this.DB && (d = this[a] >> c) != (this.s & this.DM) >> c && (b[e++] = d | this.s << this.DB - c); a >= 0;) {8 > c ? (d = (this[a] & (1 << c) - 1) << 8 - c, d |= this[--a] >> (c += this.DB - 8)) : (d = 255 & this[a] >> (c -= 8), 0 >= c && (c += this.DB, --a)), 0 != (128 & d) && (d |= -256), 0 == e && (128 & this.s) != (128 & d) && ++e, (e > 0 || d != this.s) && (b[e++] = d);}return b;}, a.prototype.equals = function (a) {return 0 == this.compareTo(a);}, a.prototype.min = function (a) {return this.compareTo(a) < 0 ? this : a;}, a.prototype.max = function (a) {return this.compareTo(a) > 0 ? this : a;}, a.prototype.and = function (a) {var b = M();return this.bitwiseTo(a, d, b), b;}, a.prototype.or = function (a) {var b = M();return this.bitwiseTo(a, e, b), b;}, a.prototype.xor = function (a) {var b = M();return this.bitwiseTo(a, f, b), b;}, a.prototype.andNot = function (a) {var b = M();return this.bitwiseTo(a, g, b), b;}, a.prototype.not = function () {var b,a = M();for (b = 0; b < this.t; ++b) {a[b] = this.DM & ~this[b];}return a.t = this.t, a.s = ~this.s, a;}, a.prototype.shiftLeft = function (a) {var b = M();return 0 > a ? this.rShiftTo(-a, b) : this.lShiftTo(a, b), b;}, a.prototype.shiftRight = function (a) {var b = M();return 0 > a ? this.lShiftTo(-a, b) : this.rShiftTo(a, b), b;}, a.prototype.getLowestSetBit = function () {for (var a = 0; a < this.t; ++a) {if (0 != this[a]) return a * this.DB + h(this[a]);}return this.s < 0 ? this.t * this.DB : -1;}, a.prototype.bitCount = function () {var c,a = 0,b = this.s & this.DM;for (c = 0; c < this.t; ++c) {a += i(this[c] ^ b);}return a;}, a.prototype.testBit = function (a) {var b = Math.floor(a / this.DB);return b >= this.t ? 0 != this.s : 0 != (this[b] & 1 << a % this.DB);}, a.prototype.setBit = function (a) {return this.changeBit(a, e);}, a.prototype.clearBit = function (a) {return this.changeBit(a, g);}, a.prototype.flipBit = function (a) {return this.changeBit(a, f);}, a.prototype.add = function (a) {var b = M();return this.addTo(a, b), b;}, a.prototype.subtract = function (a) {var b = M();return this.subTo(a, b), b;}, a.prototype.multiply = function (a) {var b = M();return this.multiplyTo(a, b), b;}, a.prototype.divide = function (a) {var b = M();return this.divRemTo(a, b, null), b;}, a.prototype.remainder = function (a) {var b = M();return this.divRemTo(a, null, b), b;}, a.prototype.divideAndRemainder = function (a) {var b = M(),c = M();return this.divRemTo(a, b, c), [b, c];}, a.prototype.modPow = function (a, b) {var d,f,g,h,i,j,k,l,m,n,o,p,c = a.bitLength(),e = W(1);if (0 >= c) return e;if (d = 18 > c ? 1 : 48 > c ? 3 : 144 > c ? 4 : 768 > c ? 5 : 6, f = 8 > c ? new J(b) : b.isEven() ? new L(b) : new K(b), g = [], h = 3, i = d - 1, j = (1 << d) - 1, g[1] = f.convert(this), d > 1) for (k = M(), f.sqrTo(g[1], k); j >= h;) {g[h] = M(), f.mulTo(k, g[h - 2], g[h]), h += 2;}for (l = a.t - 1, n = !0, o = M(), c = X(a[l]) - 1; l >= 0;) {for (c >= i ? m = a[l] >> c - i & j : (m = (a[l] & (1 << c + 1) - 1) << i - c, l > 0 && (m |= a[l - 1] >> this.DB + c - i)), h = d; 0 == (1 & m);) {m >>= 1, --h;}if ((c -= h) < 0 && (c += this.DB, --l), n) g[m].copyTo(e), n = !1;else {for (; h > 1;) {f.sqrTo(e, o), f.sqrTo(o, e), h -= 2;}h > 0 ? f.sqrTo(e, o) : (p = e, e = o, o = p), f.mulTo(o, g[m], e);}for (; l >= 0 && 0 == (a[l] & 1 << c);) {f.sqrTo(e, o), p = e, e = o, o = p, --c < 0 && (c = this.DB - 1, --l);}}return f.revert(e);}, a.prototype.modInverse = function (b) {var d,e,f,g,h,i,c = b.isEven();if (this.isEven() && c || 0 == b.signum()) return a.ZERO;for (d = b.clone(), e = this.clone(), f = W(1), g = W(0), h = W(0), i = W(1); 0 != d.signum();) {for (; d.isEven();) {d.rShiftTo(1, d), c ? (f.isEven() && g.isEven() || (f.addTo(this, f), g.subTo(b, g)), f.rShiftTo(1, f)) : g.isEven() || g.subTo(b, g), g.rShiftTo(1, g);}for (; e.isEven();) {e.rShiftTo(1, e), c ? (h.isEven() && i.isEven() || (h.addTo(this, h), i.subTo(b, i)), h.rShiftTo(1, h)) : i.isEven() || i.subTo(b, i), i.rShiftTo(1, i);}d.compareTo(e) >= 0 ? (d.subTo(e, d), c && f.subTo(h, f), g.subTo(i, g)) : (e.subTo(d, e), c && h.subTo(f, h), i.subTo(g, i));}return 0 != e.compareTo(a.ONE) ? a.ZERO : i.compareTo(b) >= 0 ? i.subtract(b) : i.signum() < 0 ? (i.addTo(b, i), i.signum() < 0 ? i.add(b) : i) : i;}, a.prototype.pow = function (a) {return this.exp(a, new I());}, a.prototype.gcd = function (a) {var d,e,f,b = this.s < 0 ? this.negate() : this.clone(),c = a.s < 0 ? a.negate() : a.clone();if (b.compareTo(c) < 0 && (d = b, b = c, c = d), e = b.getLowestSetBit(), f = c.getLowestSetBit(), 0 > f) return b;for (f > e && (f = e), f > 0 && (b.rShiftTo(f, b), c.rShiftTo(f, c)); b.signum() > 0;) {(e = b.getLowestSetBit()) > 0 && b.rShiftTo(e, b), (e = c.getLowestSetBit()) > 0 && c.rShiftTo(e, c), b.compareTo(c) >= 0 ? (b.subTo(c, b), b.rShiftTo(1, b)) : (c.subTo(b, c), c.rShiftTo(1, c));}return f > 0 && c.lShiftTo(f, c), c;}, a.prototype.isProbablePrime = function (a) {var b,d,e,c = this.abs();if (1 == c.t && c[0] <= F[F.length - 1]) {for (b = 0; b < F.length; ++b) {if (c[0] == F[b]) return !0;}return !1;}if (c.isEven()) return !1;for (b = 1; b < F.length;) {for (d = F[b], e = b + 1; e < F.length && G > d;) {d *= F[e++];}for (d = c.modInt(d); e > b;) {if (0 == d % F[b++]) return !1;}}return c.millerRabin(a);}, a.prototype.copyTo = function (a) {for (var b = this.t - 1; b >= 0; --b) {a[b] = this[b];}a.t = this.t, a.s = this.s;}, a.prototype.fromInt = function (a) {this.t = 1, this.s = 0 > a ? -1 : 0, a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0;}, a.prototype.fromString = function (b, c) {var d, e, f, g, h;if (16 == c) d = 4;else if (8 == c) d = 3;else if (256 == c) d = 8;else if (2 == c) d = 1;else if (32 == c) d = 5;else {if (4 != c) return this.fromRadix(b, c), void 0;d = 2;}for (this.t = 0, this.s = 0, e = b.length, f = !1, g = 0; --e >= 0;) {h = 8 == d ? 255 & +b[e] : V(b, e), 0 > h ? "-" == b.charAt(e) && (f = !0) : (f = !1, 0 == g ? this[this.t++] = h : g + d > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - g) - 1) << g, this[this.t++] = h >> this.DB - g) : this[this.t - 1] |= h << g, g += d, g >= this.DB && (g -= this.DB));}8 == d && 0 != (128 & +b[0]) && (this.s = -1, g > 0 && (this[this.t - 1] |= (1 << this.DB - g) - 1 << g)), this.clamp(), f && a.ZERO.subTo(this, this);}, a.prototype.clamp = function () {for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;) {--this.t;}}, a.prototype.dlShiftTo = function (a, b) {var c;for (c = this.t - 1; c >= 0; --c) {b[c + a] = this[c];}for (c = a - 1; c >= 0; --c) {b[c] = 0;}b.t = this.t + a, b.s = this.s;}, a.prototype.drShiftTo = function (a, b) {for (var c = a; c < this.t; ++c) {b[c - a] = this[c];}b.t = Math.max(this.t - a, 0), b.s = this.s;}, a.prototype.lShiftTo = function (a, b) {var h,c = a % this.DB,d = this.DB - c,e = (1 << d) - 1,f = Math.floor(a / this.DB),g = this.s << c & this.DM;for (h = this.t - 1; h >= 0; --h) {b[h + f + 1] = this[h] >> d | g, g = (this[h] & e) << c;}for (h = f - 1; h >= 0; --h) {b[h] = 0;}b[f] = g, b.t = this.t + f + 1, b.s = this.s, b.clamp();}, a.prototype.rShiftTo = function (a, b) {var c, d, e, f, g;if (b.s = this.s, c = Math.floor(a / this.DB), c >= this.t) return b.t = 0, void 0;for (d = a % this.DB, e = this.DB - d, f = (1 << d) - 1, b[0] = this[c] >> d, g = c + 1; g < this.t; ++g) {b[g - c - 1] |= (this[g] & f) << e, b[g - c] = this[g] >> d;}d > 0 && (b[this.t - c - 1] |= (this.s & f) << e), b.t = this.t - c, b.clamp();}, a.prototype.subTo = function (a, b) {for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {d += this[c] - a[c], b[c++] = d & this.DM, d >>= this.DB;}if (a.t < this.t) {for (d -= a.s; c < this.t;) {d += this[c], b[c++] = d & this.DM, d >>= this.DB;}d += this.s;} else {for (d += this.s; c < a.t;) {d -= a[c], b[c++] = d & this.DM, d >>= this.DB;}d -= a.s;}b.s = 0 > d ? -1 : 0, -1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d), b.t = c, b.clamp();}, a.prototype.multiplyTo = function (b, c) {var d = this.abs(),e = b.abs(),f = d.t;for (c.t = f + e.t; --f >= 0;) {c[f] = 0;}for (f = 0; f < e.t; ++f) {c[f + d.t] = d.am(0, e[f], c, f, 0, d.t);}c.s = 0, c.clamp(), this.s != b.s && a.ZERO.subTo(c, c);}, a.prototype.squareTo = function (a) {for (var d, b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) {a[c] = 0;}for (c = 0; c < b.t - 1; ++c) {d = b.am(c, b[c], a, 2 * c, 0, 1), (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1);}a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)), a.s = 0, a.clamp();}, a.prototype.divRemTo = function (b, c, d) {var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,e = b.abs();if (!(e.t <= 0)) {if (f = this.abs(), f.t < e.t) return null != c && c.fromInt(0), null != d && this.copyTo(d), void 0;if (null == d && (d = M()), g = M(), h = this.s, i = b.s, j = this.DB - X(e[e.t - 1]), j > 0 ? (e.lShiftTo(j, g), f.lShiftTo(j, d)) : (e.copyTo(g), f.copyTo(d)), k = g.t, l = g[k - 1], 0 != l) {for (m = l * (1 << this.F1) + (k > 1 ? g[k - 2] >> this.F2 : 0), n = this.FV / m, o = (1 << this.F1) / m, p = 1 << this.F2, q = d.t, r = q - k, s = null == c ? M() : c, g.dlShiftTo(r, s), d.compareTo(s) >= 0 && (d[d.t++] = 1, d.subTo(s, d)), a.ONE.dlShiftTo(k, s), s.subTo(g, g); g.t < k;) {g[g.t++] = 0;}for (; --r >= 0;) {if (t = d[--q] == l ? this.DM : Math.floor(d[q] * n + (d[q - 1] + p) * o), (d[q] += g.am(0, t, d, r, 0, k)) < t) for (g.dlShiftTo(r, s), d.subTo(s, d); d[q] < --t;) {d.subTo(s, d);}}null != c && (d.drShiftTo(k, c), h != i && a.ZERO.subTo(c, c)), d.t = k, d.clamp(), j > 0 && d.rShiftTo(j, d), 0 > h && a.ZERO.subTo(d, d);}}}, a.prototype.invDigit = function () {var a, b;return this.t < 1 ? 0 : (a = this[0], 0 == (1 & a) ? 0 : (b = 3 & a, b = 15 & b * (2 - (15 & a) * b), b = 255 & b * (2 - (255 & a) * b), b = 65535 & b * (2 - (65535 & (65535 & a) * b)), b = b * (2 - a * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b));}, a.prototype.isEven = function () {return 0 == (this.t > 0 ? 1 & this[0] : this.s);}, a.prototype.exp = function (b, c) {var d, e, f, g, h;if (b > 4294967295 || 1 > b) return a.ONE;for (d = M(), e = M(), f = c.convert(this), g = X(b) - 1, f.copyTo(d); --g >= 0;) {c.sqrTo(d, e), (b & 1 << g) > 0 ? c.mulTo(e, f, d) : (h = d, d = e, e = h);}return c.revert(d);}, a.prototype.chunkSize = function (a) {return Math.floor(Math.LN2 * this.DB / Math.log(a));}, a.prototype.toRadix = function (a) {var b, c, d, e, f, g;if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0";for (b = this.chunkSize(a), c = Math.pow(a, b), d = W(c), e = M(), f = M(), g = "", this.divRemTo(d, e, f); e.signum() > 0;) {g = (c + f.intValue()).toString(a).substr(1) + g, e.divRemTo(d, e, f);}return f.intValue().toString(a) + g;}, a.prototype.fromRadix = function (b, c) {var d, e, f, g, h, i, j;for (this.fromInt(0), null == c && (c = 10), d = this.chunkSize(c), e = Math.pow(c, d), f = !1, g = 0, h = 0, i = 0; i < b.length; ++i) {j = V(b, i), 0 > j ? "-" == b.charAt(i) && 0 == this.signum() && (f = !0) : (h = c * h + j, ++g >= d && (this.dMultiply(e), this.dAddOffset(h, 0), g = 0, h = 0));}g > 0 && (this.dMultiply(Math.pow(c, g)), this.dAddOffset(h, 0)), f && a.ZERO.subTo(this, this);}, a.prototype.fromNumber = function (b, c, d) {var f, g;if ("number" == typeof c) {if (2 > b) this.fromInt(1);else for (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(c);) {this.dAddOffset(2, 0), this.bitLength() > b && this.subTo(a.ONE.shiftLeft(b - 1), this);}} else f = [], g = 7 & b, f.length = (b >> 3) + 1, c.nextBytes(f), g > 0 ? f[0] &= (1 << g) - 1 : f[0] = 0, this.fromString(f, 256);}, a.prototype.bitwiseTo = function (a, b, c) {var d,e,f = Math.min(a.t, this.t);for (d = 0; f > d; ++d) {c[d] = b(this[d], a[d]);}if (a.t < this.t) {for (e = a.s & this.DM, d = f; d < this.t; ++d) {c[d] = b(this[d], e);}c.t = this.t;} else {for (e = this.s & this.DM, d = f; d < a.t; ++d) {c[d] = b(e, a[d]);}c.t = a.t;}c.s = b(this.s, a.s), c.clamp();}, a.prototype.changeBit = function (b, c) {var d = a.ONE.shiftLeft(b);return this.bitwiseTo(d, c, d), d;}, a.prototype.addTo = function (a, b) {for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {d += this[c] + a[c], b[c++] = d & this.DM, d >>= this.DB;}if (a.t < this.t) {for (d += a.s; c < this.t;) {d += this[c], b[c++] = d & this.DM, d >>= this.DB;}d += this.s;} else {for (d += this.s; c < a.t;) {d += a[c], b[c++] = d & this.DM, d >>= this.DB;}d += a.s;}b.s = 0 > d ? -1 : 0, d > 0 ? b[c++] = d : -1 > d && (b[c++] = this.DV + d), b.t = c, b.clamp();}, a.prototype.dMultiply = function (a) {this[this.t] = this.am(0, a - 1, this, 0, 0, this.t), ++this.t, this.clamp();}, a.prototype.dAddOffset = function (a, b) {if (0 != a) {for (; this.t <= b;) {this[this.t++] = 0;}for (this[b] += a; this[b] >= this.DV;) {this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b];}}}, a.prototype.multiplyLowerTo = function (a, b, c) {var e,d = Math.min(this.t + a.t, b);for (c.s = 0, c.t = d; d > 0;) {c[--d] = 0;}for (e = c.t - this.t; e > d; ++d) {c[d + this.t] = this.am(0, a[d], c, d, 0, this.t);}for (e = Math.min(a.t, b); e > d; ++d) {this.am(0, a[d], c, d, 0, b - d);}c.clamp();}, a.prototype.multiplyUpperTo = function (a, b, c) {--b;var d = c.t = this.t + a.t - b;for (c.s = 0; --d >= 0;) {c[d] = 0;}for (d = Math.max(b - this.t, 0); d < a.t; ++d) {c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b);}c.clamp(), c.drShiftTo(1, c);}, a.prototype.modInt = function (a) {var b, c, d;if (0 >= a) return 0;if (b = this.DV % a, c = this.s < 0 ? a - 1 : 0, this.t > 0) if (0 == b) c = this[0] % a;else for (d = this.t - 1; d >= 0; --d) {c = (b * c + this[d]) % a;}return c;}, a.prototype.millerRabin = function (b) {var e,f,g,h,i,c = this.subtract(a.ONE),d = c.getLowestSetBit();if (0 >= d) return !1;for (e = c.shiftRight(d), b = b + 1 >> 1, b > F.length && (b = F.length), f = M(), g = 0; b > g; ++g) {if (f.fromInt(F[Math.floor(Math.random() * F.length)]), h = f.modPow(e, this), 0 != h.compareTo(a.ONE) && 0 != h.compareTo(c)) {for (i = 1; i++ < d && 0 != h.compareTo(c);) {if (h = h.modPowInt(2, this), 0 == h.compareTo(a.ONE)) return !1;}if (0 != h.compareTo(c)) return !1;}}return !0;}, a.prototype.square = function () {var a = M();return this.squareTo(a), a;}, a.prototype.gcda = function (a, b) {var e,f,g,_h,c = this.s < 0 ? this.negate() : this.clone(),d = a.s < 0 ? a.negate() : a.clone();return c.compareTo(d) < 0 && (e = c, c = d, d = e), f = c.getLowestSetBit(), g = d.getLowestSetBit(), 0 > g ? (b(c), void 0) : (g > f && (g = f), g > 0 && (c.rShiftTo(g, c), d.rShiftTo(g, d)), _h = function h() {(f = c.getLowestSetBit()) > 0 && c.rShiftTo(f, c), (f = d.getLowestSetBit()) > 0 && d.rShiftTo(f, d), c.compareTo(d) >= 0 ? (c.subTo(d, c), c.rShiftTo(1, c)) : (d.subTo(c, d), d.rShiftTo(1, d)), c.signum() > 0 ? setTimeout(_h, 0) : (g > 0 && d.lShiftTo(g, d), setTimeout(function () {b(d);}, 0));}, setTimeout(_h, 10), void 0);}, a.prototype.fromNumberAsync = function (b, c, d, f) {var g, _h2, i, j;"number" == typeof c ? 2 > b ? this.fromInt(1) : (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0), g = this, _h2 = function h() {g.dAddOffset(2, 0), g.bitLength() > b && g.subTo(a.ONE.shiftLeft(b - 1), g), g.isProbablePrime(c) ? setTimeout(function () {f();}, 0) : setTimeout(_h2, 0);}, setTimeout(_h2, 0)) : (i = [], j = 7 & b, i.length = (b >> 3) + 1, c.nextBytes(i), j > 0 ? i[0] &= (1 << j) - 1 : i[0] = 0, this.fromString(i, 256));}, a;}(),I = function () {function a() {}return a.prototype.convert = function (a) {return a;}, a.prototype.revert = function (a) {return a;}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b);}, a;}(),J = function () {function a(a) {this.m = a;}return a.prototype.convert = function (a) {return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a;}, a.prototype.revert = function (a) {return a;}, a.prototype.reduce = function (a) {a.divRemTo(this.m, null, a);}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}(),K = function () {function a(a) {this.m = a, this.mp = a.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a.DB - 15) - 1, this.mt2 = 2 * a.t;}return a.prototype.convert = function (a) {var b = M();return a.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), a.s < 0 && b.compareTo(H.ZERO) > 0 && this.m.subTo(b, b), b;}, a.prototype.revert = function (a) {var b = M();return a.copyTo(b), this.reduce(b), b;}, a.prototype.reduce = function (a) {for (var b, c, d; a.t <= this.mt2;) {a[a.t++] = 0;}for (b = 0; b < this.m.t; ++b) {for (c = 32767 & a[b], d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM, c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) {a[c] -= a.DV, a[++c]++;}}a.clamp(), a.drShiftTo(this.m.t, a), a.compareTo(this.m) >= 0 && a.subTo(this.m, a);}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}(),L = function () {function a(a) {this.m = a, this.r2 = M(), this.q3 = M(), H.ONE.dlShiftTo(2 * a.t, this.r2), this.mu = this.r2.divide(a);}return a.prototype.convert = function (a) {if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m);if (a.compareTo(this.m) < 0) return a;var b = M();return a.copyTo(b), this.reduce(b), b;}, a.prototype.revert = function (a) {return a;}, a.prototype.reduce = function (a) {for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) {a.dAddOffset(1, this.m.t + 1);}for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) {a.subTo(this.m, a);}}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}();for (H.prototype.am = Q, C = 28, H.prototype.DB = C, H.prototype.DM = (1 << C) - 1, H.prototype.DV = 1 << C, R = 52, H.prototype.FV = Math.pow(2, R), H.prototype.F1 = R - C, H.prototype.F2 = 2 * C - R, S = [], T = "0".charCodeAt(0), U = 0; 9 >= U; ++U) {S[T++] = U;}for (T = "a".charCodeAt(0), U = 10; 36 > U; ++U) {S[T++] = U;}for (T = "A".charCodeAt(0), U = 10; 36 > U; ++U) {S[T++] = U;}if (H.ZERO = W(0), H.ONE = W(1), Y = function () {function a() {this.i = 0, this.j = 0, this.S = [];}return a.prototype.init = function (a) {var b, c, d;for (b = 0; 256 > b; ++b) {this.S[b] = b;}for (c = 0, b = 0; 256 > b; ++b) {c = 255 & c + this.S[b] + a[b % a.length], d = this.S[b], this.S[b] = this.S[c], this.S[c] = d;}this.i = 0, this.j = 0;}, a.prototype.next = function () {var a;return this.i = 255 & this.i + 1, this.j = 255 & this.j + this.S[this.i], a = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a, this.S[255 & a + this.S[this.i]];}, a;}(), $ = 256, ab = null, null == ab && (ab = [], bb = 0, cb = void 0, CryptoJS && CryptoJS.getRandomValues)) for (db = new Uint32Array(256), CryptoJS.getRandomValues(db), cb = 0; cb < db.length; ++cb) {ab[bb++] = 255 & db[cb];}gb = function () {function a() {}return a.prototype.nextBytes = function (a) {for (var b = 0; b < a.length; ++b) {a[b] = fb();}}, a;}(), jb = function () {function a() {this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;}return a.prototype.doPublic = function (a) {return a.modPowInt(this.e, this.n);}, a.prototype.doPrivate = function (a) {var b, c;if (null == this.p || null == this.q) return a.modPow(this.d, this.n);for (b = a.mod(this.p).modPow(this.dmp1, this.p), c = a.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(c) < 0;) {b = b.add(this.p);}return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c);}, a.prototype.setPublic = function (a, b) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key");}, a.prototype.encrypt = function (a) {var c,d,b = ib(a, this.n.bitLength() + 7 >> 3);return null == b ? null : (c = this.doPublic(b), null == c ? null : (d = c.toString(16), 0 == (1 & d.length) ? d : "0" + d));}, a.prototype.setPrivate = function (a, b, c) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16)) : console.error("Invalid RSA private key");}, a.prototype.setPrivateEx = function (a, b, c, d, e, f, g, h) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16), this.p = N(d, 16), this.q = N(e, 16), this.dmp1 = N(f, 16), this.dmq1 = N(g, 16), this.coeff = N(h, 16)) : console.error("Invalid RSA private key");}, a.prototype.generate = function (a, b) {var e,f,g,h,i,c = new gb(),d = a >> 1;for (this.e = parseInt(b, 16), e = new H(b, 16);;) {for (; this.p = new H(a - d, 1, c), 0 != this.p.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.p.isProbablePrime(10);) {;}for (; this.q = new H(d, 1, c), 0 != this.q.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.q.isProbablePrime(10);) {;}if (this.p.compareTo(this.q) <= 0 && (f = this.p, this.p = this.q, this.q = f), g = this.p.subtract(H.ONE), h = this.q.subtract(H.ONE), i = g.multiply(h), 0 == i.gcd(e).compareTo(H.ONE)) {this.n = this.p.multiply(this.q), this.d = e.modInverse(i), this.dmp1 = this.d.mod(g), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p);break;}}}, a.prototype.decrypt = function (a) {var b = N(a, 16),c = this.doPrivate(b);return null == c ? null : kb(c, this.n.bitLength() + 7 >> 3);}, a.prototype.generateAsync = function (a, b, c) {var f,g,_h3,d = new gb(),e = a >> 1;this.e = parseInt(b, 16), f = new H(b, 16), g = this, _h3 = function h() {var b = function b() {var a, b, d, e;g.p.compareTo(g.q) <= 0 && (a = g.p, g.p = g.q, g.q = a), b = g.p.subtract(H.ONE), d = g.q.subtract(H.ONE), e = b.multiply(d), 0 == e.gcd(f).compareTo(H.ONE) ? (g.n = g.p.multiply(g.q), g.d = f.modInverse(e), g.dmp1 = g.d.mod(b), g.dmq1 = g.d.mod(d), g.coeff = g.q.modInverse(g.p), setTimeout(function () {c();}, 0)) : setTimeout(_h3, 0);},i = function i() {g.q = M(), g.q.fromNumberAsync(e, 1, d, function () {g.q.subtract(H.ONE).gcda(f, function (a) {0 == a.compareTo(H.ONE) && g.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(i, 0);});});},j = function j() {g.p = M(), g.p.fromNumberAsync(a - e, 1, d, function () {g.p.subtract(H.ONE).gcda(f, function (a) {0 == a.compareTo(H.ONE) && g.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(j, 0);});});};setTimeout(j, 0);}, setTimeout(_h3, 0);}, a.prototype.sign = function (a, b, c) {var g,h,d = mb(c),e = d + b(a).toString(),f = hb(e, this.n.bitLength() / 4);return null == f ? null : (g = this.doPrivate(f), null == g ? null : (h = g.toString(16), 0 == (1 & h.length) ? h : "0" + h));}, a.prototype.verify = function (a, b, c) {var f,g,d = N(b, 16),e = this.doPublic(d);return null == e ? null : (f = e.toString(16).replace(/^1f+00/, ""), g = nb(f), g == c(a).toString());}, a;}(), lb = { md2: "3020300c06082a864886f70d020205000410", md5: "3020300c06082a864886f70d020505000410", sha1: "3021300906052b0e03021a05000414", sha224: "302d300d06096086480165030402040500041c", sha256: "3031300d060960864801650304020105000420", sha384: "3041300d060960864801650304020205000430", sha512: "3051300d060960864801650304020305000440", ripemd160: "3021300906052b2403020105000414" }, ob = {}, ob.lang = { extend: function extend(a, b, c) {var d, e, f, g;if (!b || !a) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");if (d = function d() {}, d.prototype = b.prototype, a.prototype = new d(), a.prototype.constructor = a, a.superclass = b.prototype, b.prototype.constructor == Object.prototype.constructor && (b.prototype.constructor = b), c) {for (e in c) {a.prototype[e] = c[e];}f = function f() {}, g = ["toString", "valueOf"];try {/MSIE/.test(navigator.userAgent) && (f = function f(a, b) {for (e = 0; e < g.length; e += 1) {var c = g[e],d = b[c];"function" == typeof d && d != Object.prototype[c] && (a[c] = d);}});} catch (h) {}f(a.prototype, c);}} }, pb = {}, "undefined" != typeof pb.asn1 && pb.asn1 || (pb.asn1 = {}), pb.asn1.ASN1Util = new function () {this.integerToByteHex = function (a) {var b = a.toString(16);return 1 == b.length % 2 && (b = "0" + b), b;}, this.bigIntToMinTwosComplementsHex = function (a) {var c,d,e,f,g,h,b = a.toString(16);if ("-" != b.substr(0, 1)) 1 == b.length % 2 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b);else {for (c = b.substr(1), d = c.length, 1 == d % 2 ? d += 1 : b.match(/^[0-7]/) || (d += 2), e = "", f = 0; d > f; f++) {e += "f";}g = new H(e, 16), h = g.xor(a).add(H.ONE), b = h.toString(16).replace(/^-/, "");}return b;}, this.getPEMStringFromHex = function (a, b) {return hextopem(a, b);}, this.newObject = function (a) {var w,x,y,z,A,B,C,D,b = pb,c = b.asn1,d = c.DERBoolean,e = c.DERInteger,f = c.DERBitString,g = c.DEROctetString,h = c.DERNull,i = c.DERObjectIdentifier,j = c.DEREnumerated,k = c.DERUTF8String,l = c.DERNumericString,m = c.DERPrintableString,n = c.DERTeletexString,o = c.DERIA5String,p = c.DERUTCTime,q = c.DERGeneralizedTime,r = c.DERSequence,s = c.DERSet,t = c.DERTaggedObject,u = c.ASN1Util.newObject,v = Object.keys(a);if (1 != v.length) throw "key of param shall be only one.";if (w = v[0], -1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + w + ":")) throw "undefined key: " + w;if ("bool" == w) return new d(a[w]);if ("int" == w) return new e(a[w]);if ("bitstr" == w) return new f(a[w]);if ("octstr" == w) return new g(a[w]);if ("null" == w) return new h(a[w]);if ("oid" == w) return new i(a[w]);if ("enum" == w) return new j(a[w]);if ("utf8str" == w) return new k(a[w]);if ("numstr" == w) return new l(a[w]);if ("prnstr" == w) return new m(a[w]);if ("telstr" == w) return new n(a[w]);if ("ia5str" == w) return new o(a[w]);if ("utctime" == w) return new p(a[w]);if ("gentime" == w) return new q(a[w]);if ("seq" == w) {for (x = a[w], y = [], z = 0; z < x.length; z++) {A = u(x[z]), y.push(A);}return new r({ array: y });}if ("set" == w) {for (x = a[w], y = [], z = 0; z < x.length; z++) {A = u(x[z]), y.push(A);}return new s({ array: y });}if ("tag" == w) {if (B = a[w], "[object Array]" === Object.prototype.toString.call(B) && 3 == B.length) return C = u(B[2]), new t({ tag: B[0], explicit: B[1], obj: C });if (D = {}, void 0 !== B.explicit && (D.explicit = B.explicit), void 0 !== B.tag && (D.tag = B.tag), void 0 === B.obj) throw "obj shall be specified for 'tag'.";return D.obj = u(B.obj), new t(D);}}, this.jsonToASN1HEX = function (a) {var b = this.newObject(a);return b.getEncodedHex();};}(), pb.asn1.ASN1Util.oidHexToInt = function (a) {var f,g,h,i,j,b = "",c = parseInt(a.substr(0, 2), 16),d = Math.floor(c / 40),e = c % 40;for (b = d + "." + e, f = "", g = 2; g < a.length; g += 2) {h = parseInt(a.substr(g, 2), 16), i = ("00000000" + h.toString(2)).slice(-8), f += i.substr(1, 7), "0" == i.substr(0, 1) && (j = new H(f, 2), b = b + "." + j.toString(10), f = "");}return b;}, pb.asn1.ASN1Util.oidIntToHex = function (a) {var d,e,f,g,b = function b(a) {var b = a.toString(16);return 1 == b.length && (b = "0" + b), b;},c = function c(a) {var g,h,i,c = "",d = new H(a, 10),e = d.toString(2),f = 7 - e.length % 7;for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {g += "0";}for (e = g + e, h = 0; h < e.length - 1; h += 7) {i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));}return c;};if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {d += c(e[g]);}return d;}, pb.asn1.ASN1Object = function () {var a = "";this.getLengthHexFromValue = function () {var b, c, d, e;if ("undefined" == typeof this.hV || null == this.hV) throw "this.hV is null or undefined.";if (1 == this.hV.length % 2) throw "value hex must be even length: n=" + a.length + ",v=" + this.hV;if (b = this.hV.length / 2, c = b.toString(16), 1 == c.length % 2 && (c = "0" + c), 128 > b) return c;if (d = c.length / 2, d > 15) throw "ASN.1 length too long to represent by 8x: n = " + b.toString(16);return e = 128 + d, e.toString(16) + c;}, this.getEncodedHex = function () {return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;}, this.getValueHex = function () {return this.getEncodedHex(), this.hV;}, this.getFreshValueHex = function () {return "";};}, pb.asn1.DERAbstractString = function (a) {pb.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function () {return this.s;}, this.setString = function (a) {this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s);}, this.setStringHex = function (a) {this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("string" == typeof a ? this.setString(a) : "undefined" != typeof a["str"] ? this.setString(a["str"]) : "undefined" != typeof a["hex"] && this.setStringHex(a["hex"]));}, ob.lang.extend(pb.asn1.DERAbstractString, pb.asn1.ASN1Object), pb.asn1.DERAbstractTime = function () {pb.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function (a) {utc = a.getTime() + 6e4 * a.getTimezoneOffset();var b = new Date(utc);return b;}, this.formatDate = function (a, b, c) {var g,h,i,j,k,l,m,n,d = this.zeroPadding,e = this.localDateToUTC(a),f = String(e.getFullYear());return "utc" == b && (f = f.substr(2, 2)), g = d(String(e.getMonth() + 1), 2), h = d(String(e.getDate()), 2), i = d(String(e.getHours()), 2), j = d(String(e.getMinutes()), 2), k = d(String(e.getSeconds()), 2), l = f + g + h + i + j + k, c === !0 && (m = e.getMilliseconds(), 0 != m && (n = d(String(m), 3), n = n.replace(/[0]+$/, ""), l = l + "." + n)), l + "Z";}, this.zeroPadding = function (a, b) {return a.length >= b ? a : new Array(b - a.length + 1).join("0") + a;}, this.getString = function () {return this.s;}, this.setString = function (a) {this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(a);}, this.setByDateValue = function (a, b, c, d, e, f) {var g = new Date(Date.UTC(a, b - 1, c, d, e, f, 0));this.setByDate(g);}, this.getFreshValueHex = function () {return this.hV;};}, ob.lang.extend(pb.asn1.DERAbstractTime, pb.asn1.ASN1Object), pb.asn1.DERAbstractStructured = function (a) {pb.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function (a) {this.hTLV = null, this.isModified = !0, this.asn1Array = a;}, this.appendASN1Object = function (a) {this.hTLV = null, this.isModified = !0, this.asn1Array.push(a);}, this.asn1Array = new Array(), "undefined" != typeof a && "undefined" != typeof a["array"] && (this.asn1Array = a["array"]);}, ob.lang.extend(pb.asn1.DERAbstractStructured, pb.asn1.ASN1Object), pb.asn1.DERBoolean = function () {pb.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";}, ob.lang.extend(pb.asn1.DERBoolean, pb.asn1.ASN1Object), pb.asn1.DERInteger = function (a) {pb.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function (a) {this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);}, this.setByInteger = function (a) {var b = new H(String(a), 10);this.setByBigInteger(b);}, this.setValueHex = function (a) {this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["bigint"] ? this.setByBigInteger(a["bigint"]) : "undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));}, ob.lang.extend(pb.asn1.DERInteger, pb.asn1.ASN1Object), pb.asn1.DERBitString = function (a) {if (void 0 !== a && "undefined" != typeof a.obj) {var b = pb.asn1.ASN1Util.newObject(a.obj);a.hex = "00" + b.getEncodedHex();}pb.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function (a) {this.hTLV = null, this.isModified = !0, this.hV = a;}, this.setUnusedBitsAndHexValue = function (a, b) {if (0 > a || a > 7) throw "unused bits shall be from 0 to 7: u = " + a;var c = "0" + a;this.hTLV = null, this.isModified = !0, this.hV = c + b;}, this.setByBinaryString = function (a) {var b, c, d, e, f;for (a = a.replace(/0+$/, ""), b = 8 - a.length % 8, 8 == b && (b = 0), c = 0; b >= c; c++) {a += "0";}for (d = "", c = 0; c < a.length - 1; c += 8) {e = a.substr(c, 8), f = parseInt(e, 2).toString(16), 1 == f.length && (f = "0" + f), d += f;}this.hTLV = null, this.isModified = !0, this.hV = "0" + b + d;}, this.setByBooleanArray = function (a) {var c,b = "";for (c = 0; c < a.length; c++) {b += 1 == a[c] ? "1" : "0";}this.setByBinaryString(b);}, this.newFalseArray = function (a) {var c,b = new Array(a);for (c = 0; a > c; c++) {b[c] = !1;}return b;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("string" == typeof a && a.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(a) : "undefined" != typeof a["hex"] ? this.setHexValueIncludingUnusedBits(a["hex"]) : "undefined" != typeof a["bin"] ? this.setByBinaryString(a["bin"]) : "undefined" != typeof a["array"] && this.setByBooleanArray(a["array"]));}, ob.lang.extend(pb.asn1.DERBitString, pb.asn1.ASN1Object), pb.asn1.DEROctetString = function (a) {if (void 0 !== a && "undefined" != typeof a.obj) {var b = pb.asn1.ASN1Util.newObject(a.obj);a.hex = b.getEncodedHex();}pb.asn1.DEROctetString.superclass.constructor.call(this, a), this.hT = "04";}, ob.lang.extend(pb.asn1.DEROctetString, pb.asn1.DERAbstractString), pb.asn1.DERNull = function () {pb.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";}, ob.lang.extend(pb.asn1.DERNull, pb.asn1.ASN1Object), pb.asn1.DERObjectIdentifier = function (a) {var b = function b(a) {var b = a.toString(16);return 1 == b.length && (b = "0" + b), b;},c = function c(a) {var g,h,i,c = "",d = new H(a, 10),e = d.toString(2),f = 7 - e.length % 7;for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {g += "0";}for (e = g + e, h = 0; h < e.length - 1; h += 7) {i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));}return c;};pb.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function (a) {this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;}, this.setValueOidString = function (a) {var d, e, f, g;if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {d += c(e[g]);}this.hTLV = null, this.isModified = !0, this.s = null, this.hV = d;}, this.setValueName = function (a) {var b = pb.asn1.x509.OID.name2oid(a);if ("" === b) throw "DERObjectIdentifier oidName undefined: " + a;this.setValueOidString(b);}, this.getFreshValueHex = function () {return this.hV;}, void 0 !== a && ("string" == typeof a ? a.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(a) : this.setValueName(a) : void 0 !== a.oid ? this.setValueOidString(a.oid) : void 0 !== a.hex ? this.setValueHex(a.hex) : void 0 !== a.name && this.setValueName(a.name));}, ob.lang.extend(pb.asn1.DERObjectIdentifier, pb.asn1.ASN1Object), pb.asn1.DEREnumerated = function (a) {pb.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function (a) {this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);}, this.setByInteger = function (a) {var b = new H(String(a), 10);this.setByBigInteger(b);}, this.setValueHex = function (a) {this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));}, ob.lang.extend(pb.asn1.DEREnumerated, pb.asn1.ASN1Object), pb.asn1.DERUTF8String = function (a) {pb.asn1.DERUTF8String.superclass.constructor.call(this, a), this.hT = "0c";}, ob.lang.extend(pb.asn1.DERUTF8String, pb.asn1.DERAbstractString), pb.asn1.DERNumericString = function (a) {pb.asn1.DERNumericString.superclass.constructor.call(this, a), this.hT = "12";}, ob.lang.extend(pb.asn1.DERNumericString, pb.asn1.DERAbstractString), pb.asn1.DERPrintableString = function (a) {pb.asn1.DERPrintableString.superclass.constructor.call(this, a), this.hT = "13";}, ob.lang.extend(pb.asn1.DERPrintableString, pb.asn1.DERAbstractString), pb.asn1.DERTeletexString = function (a) {pb.asn1.DERTeletexString.superclass.constructor.call(this, a), this.hT = "14";}, ob.lang.extend(pb.asn1.DERTeletexString, pb.asn1.DERAbstractString), pb.asn1.DERIA5String = function (a) {pb.asn1.DERIA5String.superclass.constructor.call(this, a), this.hT = "16";}, ob.lang.extend(pb.asn1.DERIA5String, pb.asn1.DERAbstractString), pb.asn1.DERUTCTime = function (a) {pb.asn1.DERUTCTime.superclass.constructor.call(this, a), this.hT = "17", this.setByDate = function (a) {this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);}, this.getFreshValueHex = function () {return "undefined" == typeof this.date && "undefined" == typeof this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{12}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date));
  10264. }, ob.lang.extend(pb.asn1.DERUTCTime, pb.asn1.DERAbstractTime), pb.asn1.DERGeneralizedTime = function (a) {pb.asn1.DERGeneralizedTime.superclass.constructor.call(this, a), this.hT = "18", this.withMillis = !1, this.setByDate = function (a) {this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);}, this.getFreshValueHex = function () {return void 0 === this.date && void 0 === this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{14}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date), a.millis === !0 && (this.withMillis = !0));}, ob.lang.extend(pb.asn1.DERGeneralizedTime, pb.asn1.DERAbstractTime), pb.asn1.DERSequence = function (a) {pb.asn1.DERSequence.superclass.constructor.call(this, a), this.hT = "30", this.getFreshValueHex = function () {var b,c,a = "";for (b = 0; b < this.asn1Array.length; b++) {c = this.asn1Array[b], a += c.getEncodedHex();}return this.hV = a, this.hV;};}, ob.lang.extend(pb.asn1.DERSequence, pb.asn1.DERAbstractStructured), pb.asn1.DERSet = function (a) {pb.asn1.DERSet.superclass.constructor.call(this, a), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function () {var b,c,a = new Array();for (b = 0; b < this.asn1Array.length; b++) {c = this.asn1Array[b], a.push(c.getEncodedHex());}return 1 == this.sortFlag && a.sort(), this.hV = a.join(""), this.hV;}, "undefined" != typeof a && "undefined" != typeof a.sortflag && 0 == a.sortflag && (this.sortFlag = !1);}, ob.lang.extend(pb.asn1.DERSet, pb.asn1.DERAbstractStructured), pb.asn1.DERTaggedObject = function (a) {pb.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function (a, b, c) {this.hT = b, this.isExplicit = a, this.asn1Object = c, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = c.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1);}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["tag"] && (this.hT = a["tag"]), "undefined" != typeof a["explicit"] && (this.isExplicit = a["explicit"]), "undefined" != typeof a["obj"] && (this.asn1Object = a["obj"], this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));}, ob.lang.extend(pb.asn1.DERTaggedObject, pb.asn1.ASN1Object), qb = function (a) {function b(c) {var d = a.call(this) || this;return c && ("string" == typeof c ? d.parseKey(c) : (b.hasPrivateKeyProperty(c) || b.hasPublicKeyProperty(c)) && d.parsePropertiesFrom(c)), d;}return o(b, a), b.prototype.parseKey = function (a) {var b, c, d, e, f, g, h, i, j, k, l, m, n;try {if (b = 0, c = 0, d = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, e = d.test(a) ? q.decode(a) : s.unarmor(a), f = A.decode(e), 3 === f.sub.length && (f = f.sub[2].sub[0]), 9 === f.sub.length) b = f.sub[1].getHexStringValue(), this.n = N(b, 16), c = f.sub[2].getHexStringValue(), this.e = parseInt(c, 16), g = f.sub[3].getHexStringValue(), this.d = N(g, 16), h = f.sub[4].getHexStringValue(), this.p = N(h, 16), i = f.sub[5].getHexStringValue(), this.q = N(i, 16), j = f.sub[6].getHexStringValue(), this.dmp1 = N(j, 16), k = f.sub[7].getHexStringValue(), this.dmq1 = N(k, 16), l = f.sub[8].getHexStringValue(), this.coeff = N(l, 16);else {if (2 !== f.sub.length) return !1;m = f.sub[1], n = m.sub[0], b = n.sub[0].getHexStringValue(), this.n = N(b, 16), c = n.sub[1].getHexStringValue(), this.e = parseInt(c, 16);}return !0;} catch (o) {return !1;}}, b.prototype.getPrivateBaseKey = function () {var a = { array: [new pb.asn1.DERInteger({ "int": 0 }), new pb.asn1.DERInteger({ bigint: this.n }), new pb.asn1.DERInteger({ "int": this.e }), new pb.asn1.DERInteger({ bigint: this.d }), new pb.asn1.DERInteger({ bigint: this.p }), new pb.asn1.DERInteger({ bigint: this.q }), new pb.asn1.DERInteger({ bigint: this.dmp1 }), new pb.asn1.DERInteger({ bigint: this.dmq1 }), new pb.asn1.DERInteger({ bigint: this.coeff })] },b = new pb.asn1.DERSequence(a);return b.getEncodedHex();}, b.prototype.getPrivateBaseKeyB64 = function () {return l(this.getPrivateBaseKey());}, b.prototype.getPublicBaseKey = function () {var a = new pb.asn1.DERSequence({ array: [new pb.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }), new pb.asn1.DERNull()] }),b = new pb.asn1.DERSequence({ array: [new pb.asn1.DERInteger({ bigint: this.n }), new pb.asn1.DERInteger({ "int": this.e })] }),c = new pb.asn1.DERBitString({ hex: "00" + b.getEncodedHex() }),d = new pb.asn1.DERSequence({ array: [a, c] });return d.getEncodedHex();}, b.prototype.getPublicBaseKeyB64 = function () {return l(this.getPublicBaseKey());}, b.wordwrap = function (a, b) {if (b = b || 64, !a) return a;var c = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})";return a.match(RegExp(c, "g")).join("\n");}, b.prototype.getPrivateKey = function () {var a = "-----BEGIN RSA PRIVATE KEY-----\n";return a += b.wordwrap(this.getPrivateBaseKeyB64()) + "\n", a += "-----END RSA PRIVATE KEY-----";}, b.prototype.getPublicKey = function () {var a = "-----BEGIN PUBLIC KEY-----\n";return a += b.wordwrap(this.getPublicBaseKeyB64()) + "\n", a += "-----END PUBLIC KEY-----";}, b.hasPublicKeyProperty = function (a) {return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e");}, b.hasPrivateKeyProperty = function (a) {return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") && a.hasOwnProperty("d") && a.hasOwnProperty("p") && a.hasOwnProperty("q") && a.hasOwnProperty("dmp1") && a.hasOwnProperty("dmq1") && a.hasOwnProperty("coeff");}, b.prototype.parsePropertiesFrom = function (a) {this.n = a.n, this.e = a.e, a.hasOwnProperty("d") && (this.d = a.d, this.p = a.p, this.q = a.q, this.dmp1 = a.dmp1, this.dmq1 = a.dmq1, this.coeff = a.coeff);}, b;}(jb), rb = function () {function a(a) {a = a || {}, this.default_key_size = parseInt(a.default_key_size, 10) || 1024, this.default_public_exponent = a.default_public_exponent || "010001", this.log = a.log || !1, this.key = null;}return a.prototype.setKey = function (a) {this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new qb(a);}, a.prototype.setPrivateKey = function (a) {this.setKey(a);}, a.prototype.setPublicKey = function (a) {this.setKey(a);}, a.prototype.decrypt = function (a) {try {return this.getKey().decrypt(m(a));} catch (b) {return !1;}}, a.prototype.encrypt = function (a) {try {return l(this.getKey().encrypt(a));} catch (b) {return !1;}}, a.prototype.sign = function (a, b, c) {try {return l(this.getKey().sign(a, b, c));} catch (d) {return !1;}}, a.prototype.verify = function (a, b, c) {try {return this.getKey().verify(a, m(b), c);} catch (d) {return !1;}}, a.prototype.getKey = function (a) {if (!this.key) {if (this.key = new qb(), a && "[object Function]" === {}.toString.call(a)) return this.key.generateAsync(this.default_key_size, this.default_public_exponent, a), void 0;this.key.generate(this.default_key_size, this.default_public_exponent);}return this.key;}, a.prototype.getPrivateKey = function () {return this.getKey().getPrivateKey();}, a.prototype.getPrivateKeyB64 = function () {return this.getKey().getPrivateBaseKeyB64();}, a.prototype.getPublicKey = function () {return this.getKey().getPublicKey();}, a.prototype.getPublicKeyB64 = function () {return this.getKey().getPublicBaseKeyB64();}, a.version = "3.0.0-rc.1", a;}(), a.JSEncrypt = rb, a.default = rb, Object.defineProperty(a, "__esModule", { value: !0 });});
  10265. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 2)))
  10266. /***/ }),
  10267. /* 78 */
  10268. /*!*************************************************!*\
  10269. !*** ./node_modules/crypto-browserify/index.js ***!
  10270. \*************************************************/
  10271. /*! no static exports found */
  10272. /***/ (function(module, exports, __webpack_require__) {
  10273. "use strict";
  10274. exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 79)
  10275. exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 87)
  10276. exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 122)
  10277. var algos = __webpack_require__(/*! browserify-sign/algos */ 125)
  10278. var algoKeys = Object.keys(algos)
  10279. var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
  10280. exports.getHashes = function () {
  10281. return hashes
  10282. }
  10283. var p = __webpack_require__(/*! pbkdf2 */ 127)
  10284. exports.pbkdf2 = p.pbkdf2
  10285. exports.pbkdf2Sync = p.pbkdf2Sync
  10286. var aes = __webpack_require__(/*! browserify-cipher */ 133)
  10287. exports.Cipher = aes.Cipher
  10288. exports.createCipher = aes.createCipher
  10289. exports.Cipheriv = aes.Cipheriv
  10290. exports.createCipheriv = aes.createCipheriv
  10291. exports.Decipher = aes.Decipher
  10292. exports.createDecipher = aes.createDecipher
  10293. exports.Decipheriv = aes.Decipheriv
  10294. exports.createDecipheriv = aes.createDecipheriv
  10295. exports.getCiphers = aes.getCiphers
  10296. exports.listCiphers = aes.listCiphers
  10297. var dh = __webpack_require__(/*! diffie-hellman */ 162)
  10298. exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
  10299. exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
  10300. exports.getDiffieHellman = dh.getDiffieHellman
  10301. exports.createDiffieHellman = dh.createDiffieHellman
  10302. exports.DiffieHellman = dh.DiffieHellman
  10303. var sign = __webpack_require__(/*! browserify-sign */ 172)
  10304. exports.createSign = sign.createSign
  10305. exports.Sign = sign.Sign
  10306. exports.createVerify = sign.createVerify
  10307. exports.Verify = sign.Verify
  10308. exports.createECDH = __webpack_require__(/*! create-ecdh */ 227)
  10309. var publicEncrypt = __webpack_require__(/*! public-encrypt */ 228)
  10310. exports.publicEncrypt = publicEncrypt.publicEncrypt
  10311. exports.privateEncrypt = publicEncrypt.privateEncrypt
  10312. exports.publicDecrypt = publicEncrypt.publicDecrypt
  10313. exports.privateDecrypt = publicEncrypt.privateDecrypt
  10314. // the least I can do is make error messages for the rest of the node.js/crypto api.
  10315. // ;[
  10316. // 'createCredentials'
  10317. // ].forEach(function (name) {
  10318. // exports[name] = function () {
  10319. // throw new Error([
  10320. // 'sorry, ' + name + ' is not implemented yet',
  10321. // 'we accept pull requests',
  10322. // 'https://github.com/crypto-browserify/crypto-browserify'
  10323. // ].join('\n'))
  10324. // }
  10325. // })
  10326. var rf = __webpack_require__(/*! randomfill */ 234)
  10327. exports.randomFill = rf.randomFill
  10328. exports.randomFillSync = rf.randomFillSync
  10329. exports.createCredentials = function () {
  10330. throw new Error([
  10331. 'sorry, createCredentials is not implemented yet',
  10332. 'we accept pull requests',
  10333. 'https://github.com/crypto-browserify/crypto-browserify'
  10334. ].join('\n'))
  10335. }
  10336. exports.constants = {
  10337. 'DH_CHECK_P_NOT_SAFE_PRIME': 2,
  10338. 'DH_CHECK_P_NOT_PRIME': 1,
  10339. 'DH_UNABLE_TO_CHECK_GENERATOR': 4,
  10340. 'DH_NOT_SUITABLE_GENERATOR': 8,
  10341. 'NPN_ENABLED': 1,
  10342. 'ALPN_ENABLED': 1,
  10343. 'RSA_PKCS1_PADDING': 1,
  10344. 'RSA_SSLV23_PADDING': 2,
  10345. 'RSA_NO_PADDING': 3,
  10346. 'RSA_PKCS1_OAEP_PADDING': 4,
  10347. 'RSA_X931_PADDING': 5,
  10348. 'RSA_PKCS1_PSS_PADDING': 6,
  10349. 'POINT_CONVERSION_COMPRESSED': 2,
  10350. 'POINT_CONVERSION_UNCOMPRESSED': 4,
  10351. 'POINT_CONVERSION_HYBRID': 6
  10352. }
  10353. /***/ }),
  10354. /* 79 */
  10355. /*!*********************************************!*\
  10356. !*** ./node_modules/randombytes/browser.js ***!
  10357. \*********************************************/
  10358. /*! no static exports found */
  10359. /***/ (function(module, exports, __webpack_require__) {
  10360. "use strict";
  10361. /* WEBPACK VAR INJECTION */(function(global, process) {
  10362. // limit of Crypto.getRandomValues()
  10363. // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
  10364. var MAX_BYTES = 65536
  10365. // Node supports requesting up to this number of bytes
  10366. // https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
  10367. var MAX_UINT32 = 4294967295
  10368. function oldBrowser () {
  10369. throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
  10370. }
  10371. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  10372. var crypto = global.crypto || global.msCrypto
  10373. if (crypto && crypto.getRandomValues) {
  10374. module.exports = randomBytes
  10375. } else {
  10376. module.exports = oldBrowser
  10377. }
  10378. function randomBytes (size, cb) {
  10379. // phantomjs needs to throw
  10380. if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
  10381. var bytes = Buffer.allocUnsafe(size)
  10382. if (size > 0) { // getRandomValues fails on IE if size == 0
  10383. if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
  10384. // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
  10385. for (var generated = 0; generated < size; generated += MAX_BYTES) {
  10386. // buffer.slice automatically checks if the end is past the end of
  10387. // the buffer so we don't have to here
  10388. crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
  10389. }
  10390. } else {
  10391. crypto.getRandomValues(bytes)
  10392. }
  10393. }
  10394. if (typeof cb === 'function') {
  10395. return process.nextTick(function () {
  10396. cb(null, bytes)
  10397. })
  10398. }
  10399. return bytes
  10400. }
  10401. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 80)))
  10402. /***/ }),
  10403. /* 80 */
  10404. /*!********************************************************!*\
  10405. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  10406. \********************************************************/
  10407. /*! no static exports found */
  10408. /***/ (function(module, exports, __webpack_require__) {
  10409. exports.nextTick = function nextTick(fn) {
  10410. var args = Array.prototype.slice.call(arguments);
  10411. args.shift();
  10412. setTimeout(function () {
  10413. fn.apply(null, args);
  10414. }, 0);
  10415. };
  10416. exports.platform = exports.arch =
  10417. exports.execPath = exports.title = 'browser';
  10418. exports.pid = 1;
  10419. exports.browser = true;
  10420. exports.env = {};
  10421. exports.argv = [];
  10422. exports.binding = function (name) {
  10423. throw new Error('No such module. (Possibly not yet loaded)')
  10424. };
  10425. (function () {
  10426. var cwd = '/';
  10427. var path;
  10428. exports.cwd = function () { return cwd };
  10429. exports.chdir = function (dir) {
  10430. if (!path) path = __webpack_require__(/*! path */ 81);
  10431. cwd = path.resolve(dir, cwd);
  10432. };
  10433. })();
  10434. exports.exit = exports.kill =
  10435. exports.umask = exports.dlopen =
  10436. exports.uptime = exports.memoryUsage =
  10437. exports.uvCounters = function() {};
  10438. exports.features = {};
  10439. /***/ }),
  10440. /* 81 */
  10441. /*!***********************************************!*\
  10442. !*** ./node_modules/path-browserify/index.js ***!
  10443. \***********************************************/
  10444. /*! no static exports found */
  10445. /***/ (function(module, exports, __webpack_require__) {
  10446. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  10447. // backported and transplited with Babel, with backwards-compat fixes
  10448. // Copyright Joyent, Inc. and other Node contributors.
  10449. //
  10450. // Permission is hereby granted, free of charge, to any person obtaining a
  10451. // copy of this software and associated documentation files (the
  10452. // "Software"), to deal in the Software without restriction, including
  10453. // without limitation the rights to use, copy, modify, merge, publish,
  10454. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10455. // persons to whom the Software is furnished to do so, subject to the
  10456. // following conditions:
  10457. //
  10458. // The above copyright notice and this permission notice shall be included
  10459. // in all copies or substantial portions of the Software.
  10460. //
  10461. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10462. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10463. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10464. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10465. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10466. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10467. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10468. // resolves . and .. elements in a path array with directory names there
  10469. // must be no slashes, empty elements, or device names (c:\) in the array
  10470. // (so also no leading and trailing slashes - it does not distinguish
  10471. // relative and absolute paths)
  10472. function normalizeArray(parts, allowAboveRoot) {
  10473. // if the path tries to go above the root, `up` ends up > 0
  10474. var up = 0;
  10475. for (var i = parts.length - 1; i >= 0; i--) {
  10476. var last = parts[i];
  10477. if (last === '.') {
  10478. parts.splice(i, 1);
  10479. } else if (last === '..') {
  10480. parts.splice(i, 1);
  10481. up++;
  10482. } else if (up) {
  10483. parts.splice(i, 1);
  10484. up--;
  10485. }
  10486. }
  10487. // if the path is allowed to go above the root, restore leading ..s
  10488. if (allowAboveRoot) {
  10489. for (; up--; up) {
  10490. parts.unshift('..');
  10491. }
  10492. }
  10493. return parts;
  10494. }
  10495. // path.resolve([from ...], to)
  10496. // posix version
  10497. exports.resolve = function() {
  10498. var resolvedPath = '',
  10499. resolvedAbsolute = false;
  10500. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  10501. var path = (i >= 0) ? arguments[i] : process.cwd();
  10502. // Skip empty and invalid entries
  10503. if (typeof path !== 'string') {
  10504. throw new TypeError('Arguments to path.resolve must be strings');
  10505. } else if (!path) {
  10506. continue;
  10507. }
  10508. resolvedPath = path + '/' + resolvedPath;
  10509. resolvedAbsolute = path.charAt(0) === '/';
  10510. }
  10511. // At this point the path should be resolved to a full absolute path, but
  10512. // handle relative paths to be safe (might happen when process.cwd() fails)
  10513. // Normalize the path
  10514. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  10515. return !!p;
  10516. }), !resolvedAbsolute).join('/');
  10517. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  10518. };
  10519. // path.normalize(path)
  10520. // posix version
  10521. exports.normalize = function(path) {
  10522. var isAbsolute = exports.isAbsolute(path),
  10523. trailingSlash = substr(path, -1) === '/';
  10524. // Normalize the path
  10525. path = normalizeArray(filter(path.split('/'), function(p) {
  10526. return !!p;
  10527. }), !isAbsolute).join('/');
  10528. if (!path && !isAbsolute) {
  10529. path = '.';
  10530. }
  10531. if (path && trailingSlash) {
  10532. path += '/';
  10533. }
  10534. return (isAbsolute ? '/' : '') + path;
  10535. };
  10536. // posix version
  10537. exports.isAbsolute = function(path) {
  10538. return path.charAt(0) === '/';
  10539. };
  10540. // posix version
  10541. exports.join = function() {
  10542. var paths = Array.prototype.slice.call(arguments, 0);
  10543. return exports.normalize(filter(paths, function(p, index) {
  10544. if (typeof p !== 'string') {
  10545. throw new TypeError('Arguments to path.join must be strings');
  10546. }
  10547. return p;
  10548. }).join('/'));
  10549. };
  10550. // path.relative(from, to)
  10551. // posix version
  10552. exports.relative = function(from, to) {
  10553. from = exports.resolve(from).substr(1);
  10554. to = exports.resolve(to).substr(1);
  10555. function trim(arr) {
  10556. var start = 0;
  10557. for (; start < arr.length; start++) {
  10558. if (arr[start] !== '') break;
  10559. }
  10560. var end = arr.length - 1;
  10561. for (; end >= 0; end--) {
  10562. if (arr[end] !== '') break;
  10563. }
  10564. if (start > end) return [];
  10565. return arr.slice(start, end - start + 1);
  10566. }
  10567. var fromParts = trim(from.split('/'));
  10568. var toParts = trim(to.split('/'));
  10569. var length = Math.min(fromParts.length, toParts.length);
  10570. var samePartsLength = length;
  10571. for (var i = 0; i < length; i++) {
  10572. if (fromParts[i] !== toParts[i]) {
  10573. samePartsLength = i;
  10574. break;
  10575. }
  10576. }
  10577. var outputParts = [];
  10578. for (var i = samePartsLength; i < fromParts.length; i++) {
  10579. outputParts.push('..');
  10580. }
  10581. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  10582. return outputParts.join('/');
  10583. };
  10584. exports.sep = '/';
  10585. exports.delimiter = ':';
  10586. exports.dirname = function (path) {
  10587. if (typeof path !== 'string') path = path + '';
  10588. if (path.length === 0) return '.';
  10589. var code = path.charCodeAt(0);
  10590. var hasRoot = code === 47 /*/*/;
  10591. var end = -1;
  10592. var matchedSlash = true;
  10593. for (var i = path.length - 1; i >= 1; --i) {
  10594. code = path.charCodeAt(i);
  10595. if (code === 47 /*/*/) {
  10596. if (!matchedSlash) {
  10597. end = i;
  10598. break;
  10599. }
  10600. } else {
  10601. // We saw the first non-path separator
  10602. matchedSlash = false;
  10603. }
  10604. }
  10605. if (end === -1) return hasRoot ? '/' : '.';
  10606. if (hasRoot && end === 1) {
  10607. // return '//';
  10608. // Backwards-compat fix:
  10609. return '/';
  10610. }
  10611. return path.slice(0, end);
  10612. };
  10613. function basename(path) {
  10614. if (typeof path !== 'string') path = path + '';
  10615. var start = 0;
  10616. var end = -1;
  10617. var matchedSlash = true;
  10618. var i;
  10619. for (i = path.length - 1; i >= 0; --i) {
  10620. if (path.charCodeAt(i) === 47 /*/*/) {
  10621. // If we reached a path separator that was not part of a set of path
  10622. // separators at the end of the string, stop now
  10623. if (!matchedSlash) {
  10624. start = i + 1;
  10625. break;
  10626. }
  10627. } else if (end === -1) {
  10628. // We saw the first non-path separator, mark this as the end of our
  10629. // path component
  10630. matchedSlash = false;
  10631. end = i + 1;
  10632. }
  10633. }
  10634. if (end === -1) return '';
  10635. return path.slice(start, end);
  10636. }
  10637. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  10638. // in new Node.js versions, so only basename() above is backported here
  10639. exports.basename = function (path, ext) {
  10640. var f = basename(path);
  10641. if (ext && f.substr(-1 * ext.length) === ext) {
  10642. f = f.substr(0, f.length - ext.length);
  10643. }
  10644. return f;
  10645. };
  10646. exports.extname = function (path) {
  10647. if (typeof path !== 'string') path = path + '';
  10648. var startDot = -1;
  10649. var startPart = 0;
  10650. var end = -1;
  10651. var matchedSlash = true;
  10652. // Track the state of characters (if any) we see before our first dot and
  10653. // after any path separator we find
  10654. var preDotState = 0;
  10655. for (var i = path.length - 1; i >= 0; --i) {
  10656. var code = path.charCodeAt(i);
  10657. if (code === 47 /*/*/) {
  10658. // If we reached a path separator that was not part of a set of path
  10659. // separators at the end of the string, stop now
  10660. if (!matchedSlash) {
  10661. startPart = i + 1;
  10662. break;
  10663. }
  10664. continue;
  10665. }
  10666. if (end === -1) {
  10667. // We saw the first non-path separator, mark this as the end of our
  10668. // extension
  10669. matchedSlash = false;
  10670. end = i + 1;
  10671. }
  10672. if (code === 46 /*.*/) {
  10673. // If this is our first dot, mark it as the start of our extension
  10674. if (startDot === -1)
  10675. startDot = i;
  10676. else if (preDotState !== 1)
  10677. preDotState = 1;
  10678. } else if (startDot !== -1) {
  10679. // We saw a non-dot and non-path separator before our dot, so we should
  10680. // have a good chance at having a non-empty extension
  10681. preDotState = -1;
  10682. }
  10683. }
  10684. if (startDot === -1 || end === -1 ||
  10685. // We saw a non-dot character immediately before the dot
  10686. preDotState === 0 ||
  10687. // The (right-most) trimmed path component is exactly '..'
  10688. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10689. return '';
  10690. }
  10691. return path.slice(startDot, end);
  10692. };
  10693. function filter (xs, f) {
  10694. if (xs.filter) return xs.filter(f);
  10695. var res = [];
  10696. for (var i = 0; i < xs.length; i++) {
  10697. if (f(xs[i], i, xs)) res.push(xs[i]);
  10698. }
  10699. return res;
  10700. }
  10701. // String.prototype.substr - negative index don't work in IE8
  10702. var substr = 'ab'.substr(-1) === 'b'
  10703. ? function (str, start, len) { return str.substr(start, len) }
  10704. : function (str, start, len) {
  10705. if (start < 0) start = str.length + start;
  10706. return str.substr(start, len);
  10707. }
  10708. ;
  10709. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 80)))
  10710. /***/ }),
  10711. /* 82 */
  10712. /*!*******************************************!*\
  10713. !*** ./node_modules/safe-buffer/index.js ***!
  10714. \*******************************************/
  10715. /*! no static exports found */
  10716. /***/ (function(module, exports, __webpack_require__) {
  10717. /* eslint-disable node/no-deprecated-api */
  10718. var buffer = __webpack_require__(/*! buffer */ 83)
  10719. var Buffer = buffer.Buffer
  10720. // alternative to using Object.keys for old browsers
  10721. function copyProps (src, dst) {
  10722. for (var key in src) {
  10723. dst[key] = src[key]
  10724. }
  10725. }
  10726. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  10727. module.exports = buffer
  10728. } else {
  10729. // Copy properties from require('buffer')
  10730. copyProps(buffer, exports)
  10731. exports.Buffer = SafeBuffer
  10732. }
  10733. function SafeBuffer (arg, encodingOrOffset, length) {
  10734. return Buffer(arg, encodingOrOffset, length)
  10735. }
  10736. // Copy static methods from Buffer
  10737. copyProps(Buffer, SafeBuffer)
  10738. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  10739. if (typeof arg === 'number') {
  10740. throw new TypeError('Argument must not be a number')
  10741. }
  10742. return Buffer(arg, encodingOrOffset, length)
  10743. }
  10744. SafeBuffer.alloc = function (size, fill, encoding) {
  10745. if (typeof size !== 'number') {
  10746. throw new TypeError('Argument must be a number')
  10747. }
  10748. var buf = Buffer(size)
  10749. if (fill !== undefined) {
  10750. if (typeof encoding === 'string') {
  10751. buf.fill(fill, encoding)
  10752. } else {
  10753. buf.fill(fill)
  10754. }
  10755. } else {
  10756. buf.fill(0)
  10757. }
  10758. return buf
  10759. }
  10760. SafeBuffer.allocUnsafe = function (size) {
  10761. if (typeof size !== 'number') {
  10762. throw new TypeError('Argument must be a number')
  10763. }
  10764. return Buffer(size)
  10765. }
  10766. SafeBuffer.allocUnsafeSlow = function (size) {
  10767. if (typeof size !== 'number') {
  10768. throw new TypeError('Argument must be a number')
  10769. }
  10770. return buffer.SlowBuffer(size)
  10771. }
  10772. /***/ }),
  10773. /* 83 */
  10774. /*!**************************************!*\
  10775. !*** ./node_modules/buffer/index.js ***!
  10776. \**************************************/
  10777. /*! no static exports found */
  10778. /***/ (function(module, exports, __webpack_require__) {
  10779. "use strict";
  10780. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10781. * The buffer module from node.js, for the browser.
  10782. *
  10783. * @author Feross Aboukhadijeh <http://feross.org>
  10784. * @license MIT
  10785. */
  10786. /* eslint-disable no-proto */
  10787. var base64 = __webpack_require__(/*! base64-js */ 84)
  10788. var ieee754 = __webpack_require__(/*! ieee754 */ 85)
  10789. var isArray = __webpack_require__(/*! isarray */ 86)
  10790. exports.Buffer = Buffer
  10791. exports.SlowBuffer = SlowBuffer
  10792. exports.INSPECT_MAX_BYTES = 50
  10793. /**
  10794. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  10795. * === true Use Uint8Array implementation (fastest)
  10796. * === false Use Object implementation (most compatible, even IE6)
  10797. *
  10798. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  10799. * Opera 11.6+, iOS 4.2+.
  10800. *
  10801. * Due to various browser bugs, sometimes the Object implementation will be used even
  10802. * when the browser supports typed arrays.
  10803. *
  10804. * Note:
  10805. *
  10806. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  10807. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  10808. *
  10809. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  10810. *
  10811. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  10812. * incorrect length in some situations.
  10813. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  10814. * get the Object implementation, which is slower but behaves correctly.
  10815. */
  10816. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  10817. ? global.TYPED_ARRAY_SUPPORT
  10818. : typedArraySupport()
  10819. /*
  10820. * Export kMaxLength after typed array support is determined.
  10821. */
  10822. exports.kMaxLength = kMaxLength()
  10823. function typedArraySupport () {
  10824. try {
  10825. var arr = new Uint8Array(1)
  10826. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  10827. return arr.foo() === 42 && // typed array instances can be augmented
  10828. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  10829. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  10830. } catch (e) {
  10831. return false
  10832. }
  10833. }
  10834. function kMaxLength () {
  10835. return Buffer.TYPED_ARRAY_SUPPORT
  10836. ? 0x7fffffff
  10837. : 0x3fffffff
  10838. }
  10839. function createBuffer (that, length) {
  10840. if (kMaxLength() < length) {
  10841. throw new RangeError('Invalid typed array length')
  10842. }
  10843. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10844. // Return an augmented `Uint8Array` instance, for best performance
  10845. that = new Uint8Array(length)
  10846. that.__proto__ = Buffer.prototype
  10847. } else {
  10848. // Fallback: Return an object instance of the Buffer class
  10849. if (that === null) {
  10850. that = new Buffer(length)
  10851. }
  10852. that.length = length
  10853. }
  10854. return that
  10855. }
  10856. /**
  10857. * The Buffer constructor returns instances of `Uint8Array` that have their
  10858. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  10859. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  10860. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  10861. * returns a single octet.
  10862. *
  10863. * The `Uint8Array` prototype remains unmodified.
  10864. */
  10865. function Buffer (arg, encodingOrOffset, length) {
  10866. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  10867. return new Buffer(arg, encodingOrOffset, length)
  10868. }
  10869. // Common case.
  10870. if (typeof arg === 'number') {
  10871. if (typeof encodingOrOffset === 'string') {
  10872. throw new Error(
  10873. 'If encoding is specified then the first argument must be a string'
  10874. )
  10875. }
  10876. return allocUnsafe(this, arg)
  10877. }
  10878. return from(this, arg, encodingOrOffset, length)
  10879. }
  10880. Buffer.poolSize = 8192 // not used by this implementation
  10881. // TODO: Legacy, not needed anymore. Remove in next major version.
  10882. Buffer._augment = function (arr) {
  10883. arr.__proto__ = Buffer.prototype
  10884. return arr
  10885. }
  10886. function from (that, value, encodingOrOffset, length) {
  10887. if (typeof value === 'number') {
  10888. throw new TypeError('"value" argument must not be a number')
  10889. }
  10890. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  10891. return fromArrayBuffer(that, value, encodingOrOffset, length)
  10892. }
  10893. if (typeof value === 'string') {
  10894. return fromString(that, value, encodingOrOffset)
  10895. }
  10896. return fromObject(that, value)
  10897. }
  10898. /**
  10899. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  10900. * if value is a number.
  10901. * Buffer.from(str[, encoding])
  10902. * Buffer.from(array)
  10903. * Buffer.from(buffer)
  10904. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  10905. **/
  10906. Buffer.from = function (value, encodingOrOffset, length) {
  10907. return from(null, value, encodingOrOffset, length)
  10908. }
  10909. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10910. Buffer.prototype.__proto__ = Uint8Array.prototype
  10911. Buffer.__proto__ = Uint8Array
  10912. if (typeof Symbol !== 'undefined' && Symbol.species &&
  10913. Buffer[Symbol.species] === Buffer) {
  10914. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  10915. Object.defineProperty(Buffer, Symbol.species, {
  10916. value: null,
  10917. configurable: true
  10918. })
  10919. }
  10920. }
  10921. function assertSize (size) {
  10922. if (typeof size !== 'number') {
  10923. throw new TypeError('"size" argument must be a number')
  10924. } else if (size < 0) {
  10925. throw new RangeError('"size" argument must not be negative')
  10926. }
  10927. }
  10928. function alloc (that, size, fill, encoding) {
  10929. assertSize(size)
  10930. if (size <= 0) {
  10931. return createBuffer(that, size)
  10932. }
  10933. if (fill !== undefined) {
  10934. // Only pay attention to encoding if it's a string. This
  10935. // prevents accidentally sending in a number that would
  10936. // be interpretted as a start offset.
  10937. return typeof encoding === 'string'
  10938. ? createBuffer(that, size).fill(fill, encoding)
  10939. : createBuffer(that, size).fill(fill)
  10940. }
  10941. return createBuffer(that, size)
  10942. }
  10943. /**
  10944. * Creates a new filled Buffer instance.
  10945. * alloc(size[, fill[, encoding]])
  10946. **/
  10947. Buffer.alloc = function (size, fill, encoding) {
  10948. return alloc(null, size, fill, encoding)
  10949. }
  10950. function allocUnsafe (that, size) {
  10951. assertSize(size)
  10952. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  10953. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  10954. for (var i = 0; i < size; ++i) {
  10955. that[i] = 0
  10956. }
  10957. }
  10958. return that
  10959. }
  10960. /**
  10961. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10962. * */
  10963. Buffer.allocUnsafe = function (size) {
  10964. return allocUnsafe(null, size)
  10965. }
  10966. /**
  10967. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10968. */
  10969. Buffer.allocUnsafeSlow = function (size) {
  10970. return allocUnsafe(null, size)
  10971. }
  10972. function fromString (that, string, encoding) {
  10973. if (typeof encoding !== 'string' || encoding === '') {
  10974. encoding = 'utf8'
  10975. }
  10976. if (!Buffer.isEncoding(encoding)) {
  10977. throw new TypeError('"encoding" must be a valid string encoding')
  10978. }
  10979. var length = byteLength(string, encoding) | 0
  10980. that = createBuffer(that, length)
  10981. var actual = that.write(string, encoding)
  10982. if (actual !== length) {
  10983. // Writing a hex string, for example, that contains invalid characters will
  10984. // cause everything after the first invalid character to be ignored. (e.g.
  10985. // 'abxxcd' will be treated as 'ab')
  10986. that = that.slice(0, actual)
  10987. }
  10988. return that
  10989. }
  10990. function fromArrayLike (that, array) {
  10991. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10992. that = createBuffer(that, length)
  10993. for (var i = 0; i < length; i += 1) {
  10994. that[i] = array[i] & 255
  10995. }
  10996. return that
  10997. }
  10998. function fromArrayBuffer (that, array, byteOffset, length) {
  10999. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  11000. if (byteOffset < 0 || array.byteLength < byteOffset) {
  11001. throw new RangeError('\'offset\' is out of bounds')
  11002. }
  11003. if (array.byteLength < byteOffset + (length || 0)) {
  11004. throw new RangeError('\'length\' is out of bounds')
  11005. }
  11006. if (byteOffset === undefined && length === undefined) {
  11007. array = new Uint8Array(array)
  11008. } else if (length === undefined) {
  11009. array = new Uint8Array(array, byteOffset)
  11010. } else {
  11011. array = new Uint8Array(array, byteOffset, length)
  11012. }
  11013. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11014. // Return an augmented `Uint8Array` instance, for best performance
  11015. that = array
  11016. that.__proto__ = Buffer.prototype
  11017. } else {
  11018. // Fallback: Return an object instance of the Buffer class
  11019. that = fromArrayLike(that, array)
  11020. }
  11021. return that
  11022. }
  11023. function fromObject (that, obj) {
  11024. if (Buffer.isBuffer(obj)) {
  11025. var len = checked(obj.length) | 0
  11026. that = createBuffer(that, len)
  11027. if (that.length === 0) {
  11028. return that
  11029. }
  11030. obj.copy(that, 0, 0, len)
  11031. return that
  11032. }
  11033. if (obj) {
  11034. if ((typeof ArrayBuffer !== 'undefined' &&
  11035. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  11036. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  11037. return createBuffer(that, 0)
  11038. }
  11039. return fromArrayLike(that, obj)
  11040. }
  11041. if (obj.type === 'Buffer' && isArray(obj.data)) {
  11042. return fromArrayLike(that, obj.data)
  11043. }
  11044. }
  11045. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  11046. }
  11047. function checked (length) {
  11048. // Note: cannot use `length < kMaxLength()` here because that fails when
  11049. // length is NaN (which is otherwise coerced to zero.)
  11050. if (length >= kMaxLength()) {
  11051. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  11052. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  11053. }
  11054. return length | 0
  11055. }
  11056. function SlowBuffer (length) {
  11057. if (+length != length) { // eslint-disable-line eqeqeq
  11058. length = 0
  11059. }
  11060. return Buffer.alloc(+length)
  11061. }
  11062. Buffer.isBuffer = function isBuffer (b) {
  11063. return !!(b != null && b._isBuffer)
  11064. }
  11065. Buffer.compare = function compare (a, b) {
  11066. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  11067. throw new TypeError('Arguments must be Buffers')
  11068. }
  11069. if (a === b) return 0
  11070. var x = a.length
  11071. var y = b.length
  11072. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  11073. if (a[i] !== b[i]) {
  11074. x = a[i]
  11075. y = b[i]
  11076. break
  11077. }
  11078. }
  11079. if (x < y) return -1
  11080. if (y < x) return 1
  11081. return 0
  11082. }
  11083. Buffer.isEncoding = function isEncoding (encoding) {
  11084. switch (String(encoding).toLowerCase()) {
  11085. case 'hex':
  11086. case 'utf8':
  11087. case 'utf-8':
  11088. case 'ascii':
  11089. case 'latin1':
  11090. case 'binary':
  11091. case 'base64':
  11092. case 'ucs2':
  11093. case 'ucs-2':
  11094. case 'utf16le':
  11095. case 'utf-16le':
  11096. return true
  11097. default:
  11098. return false
  11099. }
  11100. }
  11101. Buffer.concat = function concat (list, length) {
  11102. if (!isArray(list)) {
  11103. throw new TypeError('"list" argument must be an Array of Buffers')
  11104. }
  11105. if (list.length === 0) {
  11106. return Buffer.alloc(0)
  11107. }
  11108. var i
  11109. if (length === undefined) {
  11110. length = 0
  11111. for (i = 0; i < list.length; ++i) {
  11112. length += list[i].length
  11113. }
  11114. }
  11115. var buffer = Buffer.allocUnsafe(length)
  11116. var pos = 0
  11117. for (i = 0; i < list.length; ++i) {
  11118. var buf = list[i]
  11119. if (!Buffer.isBuffer(buf)) {
  11120. throw new TypeError('"list" argument must be an Array of Buffers')
  11121. }
  11122. buf.copy(buffer, pos)
  11123. pos += buf.length
  11124. }
  11125. return buffer
  11126. }
  11127. function byteLength (string, encoding) {
  11128. if (Buffer.isBuffer(string)) {
  11129. return string.length
  11130. }
  11131. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  11132. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  11133. return string.byteLength
  11134. }
  11135. if (typeof string !== 'string') {
  11136. string = '' + string
  11137. }
  11138. var len = string.length
  11139. if (len === 0) return 0
  11140. // Use a for loop to avoid recursion
  11141. var loweredCase = false
  11142. for (;;) {
  11143. switch (encoding) {
  11144. case 'ascii':
  11145. case 'latin1':
  11146. case 'binary':
  11147. return len
  11148. case 'utf8':
  11149. case 'utf-8':
  11150. case undefined:
  11151. return utf8ToBytes(string).length
  11152. case 'ucs2':
  11153. case 'ucs-2':
  11154. case 'utf16le':
  11155. case 'utf-16le':
  11156. return len * 2
  11157. case 'hex':
  11158. return len >>> 1
  11159. case 'base64':
  11160. return base64ToBytes(string).length
  11161. default:
  11162. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  11163. encoding = ('' + encoding).toLowerCase()
  11164. loweredCase = true
  11165. }
  11166. }
  11167. }
  11168. Buffer.byteLength = byteLength
  11169. function slowToString (encoding, start, end) {
  11170. var loweredCase = false
  11171. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  11172. // property of a typed array.
  11173. // This behaves neither like String nor Uint8Array in that we set start/end
  11174. // to their upper/lower bounds if the value passed is out of range.
  11175. // undefined is handled specially as per ECMA-262 6th Edition,
  11176. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  11177. if (start === undefined || start < 0) {
  11178. start = 0
  11179. }
  11180. // Return early if start > this.length. Done here to prevent potential uint32
  11181. // coercion fail below.
  11182. if (start > this.length) {
  11183. return ''
  11184. }
  11185. if (end === undefined || end > this.length) {
  11186. end = this.length
  11187. }
  11188. if (end <= 0) {
  11189. return ''
  11190. }
  11191. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  11192. end >>>= 0
  11193. start >>>= 0
  11194. if (end <= start) {
  11195. return ''
  11196. }
  11197. if (!encoding) encoding = 'utf8'
  11198. while (true) {
  11199. switch (encoding) {
  11200. case 'hex':
  11201. return hexSlice(this, start, end)
  11202. case 'utf8':
  11203. case 'utf-8':
  11204. return utf8Slice(this, start, end)
  11205. case 'ascii':
  11206. return asciiSlice(this, start, end)
  11207. case 'latin1':
  11208. case 'binary':
  11209. return latin1Slice(this, start, end)
  11210. case 'base64':
  11211. return base64Slice(this, start, end)
  11212. case 'ucs2':
  11213. case 'ucs-2':
  11214. case 'utf16le':
  11215. case 'utf-16le':
  11216. return utf16leSlice(this, start, end)
  11217. default:
  11218. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11219. encoding = (encoding + '').toLowerCase()
  11220. loweredCase = true
  11221. }
  11222. }
  11223. }
  11224. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  11225. // Buffer instances.
  11226. Buffer.prototype._isBuffer = true
  11227. function swap (b, n, m) {
  11228. var i = b[n]
  11229. b[n] = b[m]
  11230. b[m] = i
  11231. }
  11232. Buffer.prototype.swap16 = function swap16 () {
  11233. var len = this.length
  11234. if (len % 2 !== 0) {
  11235. throw new RangeError('Buffer size must be a multiple of 16-bits')
  11236. }
  11237. for (var i = 0; i < len; i += 2) {
  11238. swap(this, i, i + 1)
  11239. }
  11240. return this
  11241. }
  11242. Buffer.prototype.swap32 = function swap32 () {
  11243. var len = this.length
  11244. if (len % 4 !== 0) {
  11245. throw new RangeError('Buffer size must be a multiple of 32-bits')
  11246. }
  11247. for (var i = 0; i < len; i += 4) {
  11248. swap(this, i, i + 3)
  11249. swap(this, i + 1, i + 2)
  11250. }
  11251. return this
  11252. }
  11253. Buffer.prototype.swap64 = function swap64 () {
  11254. var len = this.length
  11255. if (len % 8 !== 0) {
  11256. throw new RangeError('Buffer size must be a multiple of 64-bits')
  11257. }
  11258. for (var i = 0; i < len; i += 8) {
  11259. swap(this, i, i + 7)
  11260. swap(this, i + 1, i + 6)
  11261. swap(this, i + 2, i + 5)
  11262. swap(this, i + 3, i + 4)
  11263. }
  11264. return this
  11265. }
  11266. Buffer.prototype.toString = function toString () {
  11267. var length = this.length | 0
  11268. if (length === 0) return ''
  11269. if (arguments.length === 0) return utf8Slice(this, 0, length)
  11270. return slowToString.apply(this, arguments)
  11271. }
  11272. Buffer.prototype.equals = function equals (b) {
  11273. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  11274. if (this === b) return true
  11275. return Buffer.compare(this, b) === 0
  11276. }
  11277. Buffer.prototype.inspect = function inspect () {
  11278. var str = ''
  11279. var max = exports.INSPECT_MAX_BYTES
  11280. if (this.length > 0) {
  11281. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  11282. if (this.length > max) str += ' ... '
  11283. }
  11284. return '<Buffer ' + str + '>'
  11285. }
  11286. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  11287. if (!Buffer.isBuffer(target)) {
  11288. throw new TypeError('Argument must be a Buffer')
  11289. }
  11290. if (start === undefined) {
  11291. start = 0
  11292. }
  11293. if (end === undefined) {
  11294. end = target ? target.length : 0
  11295. }
  11296. if (thisStart === undefined) {
  11297. thisStart = 0
  11298. }
  11299. if (thisEnd === undefined) {
  11300. thisEnd = this.length
  11301. }
  11302. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  11303. throw new RangeError('out of range index')
  11304. }
  11305. if (thisStart >= thisEnd && start >= end) {
  11306. return 0
  11307. }
  11308. if (thisStart >= thisEnd) {
  11309. return -1
  11310. }
  11311. if (start >= end) {
  11312. return 1
  11313. }
  11314. start >>>= 0
  11315. end >>>= 0
  11316. thisStart >>>= 0
  11317. thisEnd >>>= 0
  11318. if (this === target) return 0
  11319. var x = thisEnd - thisStart
  11320. var y = end - start
  11321. var len = Math.min(x, y)
  11322. var thisCopy = this.slice(thisStart, thisEnd)
  11323. var targetCopy = target.slice(start, end)
  11324. for (var i = 0; i < len; ++i) {
  11325. if (thisCopy[i] !== targetCopy[i]) {
  11326. x = thisCopy[i]
  11327. y = targetCopy[i]
  11328. break
  11329. }
  11330. }
  11331. if (x < y) return -1
  11332. if (y < x) return 1
  11333. return 0
  11334. }
  11335. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  11336. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  11337. //
  11338. // Arguments:
  11339. // - buffer - a Buffer to search
  11340. // - val - a string, Buffer, or number
  11341. // - byteOffset - an index into `buffer`; will be clamped to an int32
  11342. // - encoding - an optional encoding, relevant is val is a string
  11343. // - dir - true for indexOf, false for lastIndexOf
  11344. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  11345. // Empty buffer means no match
  11346. if (buffer.length === 0) return -1
  11347. // Normalize byteOffset
  11348. if (typeof byteOffset === 'string') {
  11349. encoding = byteOffset
  11350. byteOffset = 0
  11351. } else if (byteOffset > 0x7fffffff) {
  11352. byteOffset = 0x7fffffff
  11353. } else if (byteOffset < -0x80000000) {
  11354. byteOffset = -0x80000000
  11355. }
  11356. byteOffset = +byteOffset // Coerce to Number.
  11357. if (isNaN(byteOffset)) {
  11358. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  11359. byteOffset = dir ? 0 : (buffer.length - 1)
  11360. }
  11361. // Normalize byteOffset: negative offsets start from the end of the buffer
  11362. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  11363. if (byteOffset >= buffer.length) {
  11364. if (dir) return -1
  11365. else byteOffset = buffer.length - 1
  11366. } else if (byteOffset < 0) {
  11367. if (dir) byteOffset = 0
  11368. else return -1
  11369. }
  11370. // Normalize val
  11371. if (typeof val === 'string') {
  11372. val = Buffer.from(val, encoding)
  11373. }
  11374. // Finally, search either indexOf (if dir is true) or lastIndexOf
  11375. if (Buffer.isBuffer(val)) {
  11376. // Special case: looking for empty string/buffer always fails
  11377. if (val.length === 0) {
  11378. return -1
  11379. }
  11380. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  11381. } else if (typeof val === 'number') {
  11382. val = val & 0xFF // Search for a byte value [0-255]
  11383. if (Buffer.TYPED_ARRAY_SUPPORT &&
  11384. typeof Uint8Array.prototype.indexOf === 'function') {
  11385. if (dir) {
  11386. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  11387. } else {
  11388. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  11389. }
  11390. }
  11391. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  11392. }
  11393. throw new TypeError('val must be string, number or Buffer')
  11394. }
  11395. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  11396. var indexSize = 1
  11397. var arrLength = arr.length
  11398. var valLength = val.length
  11399. if (encoding !== undefined) {
  11400. encoding = String(encoding).toLowerCase()
  11401. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  11402. encoding === 'utf16le' || encoding === 'utf-16le') {
  11403. if (arr.length < 2 || val.length < 2) {
  11404. return -1
  11405. }
  11406. indexSize = 2
  11407. arrLength /= 2
  11408. valLength /= 2
  11409. byteOffset /= 2
  11410. }
  11411. }
  11412. function read (buf, i) {
  11413. if (indexSize === 1) {
  11414. return buf[i]
  11415. } else {
  11416. return buf.readUInt16BE(i * indexSize)
  11417. }
  11418. }
  11419. var i
  11420. if (dir) {
  11421. var foundIndex = -1
  11422. for (i = byteOffset; i < arrLength; i++) {
  11423. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  11424. if (foundIndex === -1) foundIndex = i
  11425. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  11426. } else {
  11427. if (foundIndex !== -1) i -= i - foundIndex
  11428. foundIndex = -1
  11429. }
  11430. }
  11431. } else {
  11432. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  11433. for (i = byteOffset; i >= 0; i--) {
  11434. var found = true
  11435. for (var j = 0; j < valLength; j++) {
  11436. if (read(arr, i + j) !== read(val, j)) {
  11437. found = false
  11438. break
  11439. }
  11440. }
  11441. if (found) return i
  11442. }
  11443. }
  11444. return -1
  11445. }
  11446. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  11447. return this.indexOf(val, byteOffset, encoding) !== -1
  11448. }
  11449. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  11450. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  11451. }
  11452. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  11453. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  11454. }
  11455. function hexWrite (buf, string, offset, length) {
  11456. offset = Number(offset) || 0
  11457. var remaining = buf.length - offset
  11458. if (!length) {
  11459. length = remaining
  11460. } else {
  11461. length = Number(length)
  11462. if (length > remaining) {
  11463. length = remaining
  11464. }
  11465. }
  11466. // must be an even number of digits
  11467. var strLen = string.length
  11468. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  11469. if (length > strLen / 2) {
  11470. length = strLen / 2
  11471. }
  11472. for (var i = 0; i < length; ++i) {
  11473. var parsed = parseInt(string.substr(i * 2, 2), 16)
  11474. if (isNaN(parsed)) return i
  11475. buf[offset + i] = parsed
  11476. }
  11477. return i
  11478. }
  11479. function utf8Write (buf, string, offset, length) {
  11480. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  11481. }
  11482. function asciiWrite (buf, string, offset, length) {
  11483. return blitBuffer(asciiToBytes(string), buf, offset, length)
  11484. }
  11485. function latin1Write (buf, string, offset, length) {
  11486. return asciiWrite(buf, string, offset, length)
  11487. }
  11488. function base64Write (buf, string, offset, length) {
  11489. return blitBuffer(base64ToBytes(string), buf, offset, length)
  11490. }
  11491. function ucs2Write (buf, string, offset, length) {
  11492. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  11493. }
  11494. Buffer.prototype.write = function write (string, offset, length, encoding) {
  11495. // Buffer#write(string)
  11496. if (offset === undefined) {
  11497. encoding = 'utf8'
  11498. length = this.length
  11499. offset = 0
  11500. // Buffer#write(string, encoding)
  11501. } else if (length === undefined && typeof offset === 'string') {
  11502. encoding = offset
  11503. length = this.length
  11504. offset = 0
  11505. // Buffer#write(string, offset[, length][, encoding])
  11506. } else if (isFinite(offset)) {
  11507. offset = offset | 0
  11508. if (isFinite(length)) {
  11509. length = length | 0
  11510. if (encoding === undefined) encoding = 'utf8'
  11511. } else {
  11512. encoding = length
  11513. length = undefined
  11514. }
  11515. // legacy write(string, encoding, offset, length) - remove in v0.13
  11516. } else {
  11517. throw new Error(
  11518. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  11519. )
  11520. }
  11521. var remaining = this.length - offset
  11522. if (length === undefined || length > remaining) length = remaining
  11523. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  11524. throw new RangeError('Attempt to write outside buffer bounds')
  11525. }
  11526. if (!encoding) encoding = 'utf8'
  11527. var loweredCase = false
  11528. for (;;) {
  11529. switch (encoding) {
  11530. case 'hex':
  11531. return hexWrite(this, string, offset, length)
  11532. case 'utf8':
  11533. case 'utf-8':
  11534. return utf8Write(this, string, offset, length)
  11535. case 'ascii':
  11536. return asciiWrite(this, string, offset, length)
  11537. case 'latin1':
  11538. case 'binary':
  11539. return latin1Write(this, string, offset, length)
  11540. case 'base64':
  11541. // Warning: maxLength not taken into account in base64Write
  11542. return base64Write(this, string, offset, length)
  11543. case 'ucs2':
  11544. case 'ucs-2':
  11545. case 'utf16le':
  11546. case 'utf-16le':
  11547. return ucs2Write(this, string, offset, length)
  11548. default:
  11549. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11550. encoding = ('' + encoding).toLowerCase()
  11551. loweredCase = true
  11552. }
  11553. }
  11554. }
  11555. Buffer.prototype.toJSON = function toJSON () {
  11556. return {
  11557. type: 'Buffer',
  11558. data: Array.prototype.slice.call(this._arr || this, 0)
  11559. }
  11560. }
  11561. function base64Slice (buf, start, end) {
  11562. if (start === 0 && end === buf.length) {
  11563. return base64.fromByteArray(buf)
  11564. } else {
  11565. return base64.fromByteArray(buf.slice(start, end))
  11566. }
  11567. }
  11568. function utf8Slice (buf, start, end) {
  11569. end = Math.min(buf.length, end)
  11570. var res = []
  11571. var i = start
  11572. while (i < end) {
  11573. var firstByte = buf[i]
  11574. var codePoint = null
  11575. var bytesPerSequence = (firstByte > 0xEF) ? 4
  11576. : (firstByte > 0xDF) ? 3
  11577. : (firstByte > 0xBF) ? 2
  11578. : 1
  11579. if (i + bytesPerSequence <= end) {
  11580. var secondByte, thirdByte, fourthByte, tempCodePoint
  11581. switch (bytesPerSequence) {
  11582. case 1:
  11583. if (firstByte < 0x80) {
  11584. codePoint = firstByte
  11585. }
  11586. break
  11587. case 2:
  11588. secondByte = buf[i + 1]
  11589. if ((secondByte & 0xC0) === 0x80) {
  11590. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  11591. if (tempCodePoint > 0x7F) {
  11592. codePoint = tempCodePoint
  11593. }
  11594. }
  11595. break
  11596. case 3:
  11597. secondByte = buf[i + 1]
  11598. thirdByte = buf[i + 2]
  11599. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  11600. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  11601. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  11602. codePoint = tempCodePoint
  11603. }
  11604. }
  11605. break
  11606. case 4:
  11607. secondByte = buf[i + 1]
  11608. thirdByte = buf[i + 2]
  11609. fourthByte = buf[i + 3]
  11610. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  11611. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  11612. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  11613. codePoint = tempCodePoint
  11614. }
  11615. }
  11616. }
  11617. }
  11618. if (codePoint === null) {
  11619. // we did not generate a valid codePoint so insert a
  11620. // replacement char (U+FFFD) and advance only 1 byte
  11621. codePoint = 0xFFFD
  11622. bytesPerSequence = 1
  11623. } else if (codePoint > 0xFFFF) {
  11624. // encode to utf16 (surrogate pair dance)
  11625. codePoint -= 0x10000
  11626. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  11627. codePoint = 0xDC00 | codePoint & 0x3FF
  11628. }
  11629. res.push(codePoint)
  11630. i += bytesPerSequence
  11631. }
  11632. return decodeCodePointsArray(res)
  11633. }
  11634. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  11635. // the lowest limit is Chrome, with 0x10000 args.
  11636. // We go 1 magnitude less, for safety
  11637. var MAX_ARGUMENTS_LENGTH = 0x1000
  11638. function decodeCodePointsArray (codePoints) {
  11639. var len = codePoints.length
  11640. if (len <= MAX_ARGUMENTS_LENGTH) {
  11641. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  11642. }
  11643. // Decode in chunks to avoid "call stack size exceeded".
  11644. var res = ''
  11645. var i = 0
  11646. while (i < len) {
  11647. res += String.fromCharCode.apply(
  11648. String,
  11649. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  11650. )
  11651. }
  11652. return res
  11653. }
  11654. function asciiSlice (buf, start, end) {
  11655. var ret = ''
  11656. end = Math.min(buf.length, end)
  11657. for (var i = start; i < end; ++i) {
  11658. ret += String.fromCharCode(buf[i] & 0x7F)
  11659. }
  11660. return ret
  11661. }
  11662. function latin1Slice (buf, start, end) {
  11663. var ret = ''
  11664. end = Math.min(buf.length, end)
  11665. for (var i = start; i < end; ++i) {
  11666. ret += String.fromCharCode(buf[i])
  11667. }
  11668. return ret
  11669. }
  11670. function hexSlice (buf, start, end) {
  11671. var len = buf.length
  11672. if (!start || start < 0) start = 0
  11673. if (!end || end < 0 || end > len) end = len
  11674. var out = ''
  11675. for (var i = start; i < end; ++i) {
  11676. out += toHex(buf[i])
  11677. }
  11678. return out
  11679. }
  11680. function utf16leSlice (buf, start, end) {
  11681. var bytes = buf.slice(start, end)
  11682. var res = ''
  11683. for (var i = 0; i < bytes.length; i += 2) {
  11684. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  11685. }
  11686. return res
  11687. }
  11688. Buffer.prototype.slice = function slice (start, end) {
  11689. var len = this.length
  11690. start = ~~start
  11691. end = end === undefined ? len : ~~end
  11692. if (start < 0) {
  11693. start += len
  11694. if (start < 0) start = 0
  11695. } else if (start > len) {
  11696. start = len
  11697. }
  11698. if (end < 0) {
  11699. end += len
  11700. if (end < 0) end = 0
  11701. } else if (end > len) {
  11702. end = len
  11703. }
  11704. if (end < start) end = start
  11705. var newBuf
  11706. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11707. newBuf = this.subarray(start, end)
  11708. newBuf.__proto__ = Buffer.prototype
  11709. } else {
  11710. var sliceLen = end - start
  11711. newBuf = new Buffer(sliceLen, undefined)
  11712. for (var i = 0; i < sliceLen; ++i) {
  11713. newBuf[i] = this[i + start]
  11714. }
  11715. }
  11716. return newBuf
  11717. }
  11718. /*
  11719. * Need to make sure that buffer isn't trying to write out of bounds.
  11720. */
  11721. function checkOffset (offset, ext, length) {
  11722. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  11723. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  11724. }
  11725. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  11726. offset = offset | 0
  11727. byteLength = byteLength | 0
  11728. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11729. var val = this[offset]
  11730. var mul = 1
  11731. var i = 0
  11732. while (++i < byteLength && (mul *= 0x100)) {
  11733. val += this[offset + i] * mul
  11734. }
  11735. return val
  11736. }
  11737. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  11738. offset = offset | 0
  11739. byteLength = byteLength | 0
  11740. if (!noAssert) {
  11741. checkOffset(offset, byteLength, this.length)
  11742. }
  11743. var val = this[offset + --byteLength]
  11744. var mul = 1
  11745. while (byteLength > 0 && (mul *= 0x100)) {
  11746. val += this[offset + --byteLength] * mul
  11747. }
  11748. return val
  11749. }
  11750. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  11751. if (!noAssert) checkOffset(offset, 1, this.length)
  11752. return this[offset]
  11753. }
  11754. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  11755. if (!noAssert) checkOffset(offset, 2, this.length)
  11756. return this[offset] | (this[offset + 1] << 8)
  11757. }
  11758. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  11759. if (!noAssert) checkOffset(offset, 2, this.length)
  11760. return (this[offset] << 8) | this[offset + 1]
  11761. }
  11762. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  11763. if (!noAssert) checkOffset(offset, 4, this.length)
  11764. return ((this[offset]) |
  11765. (this[offset + 1] << 8) |
  11766. (this[offset + 2] << 16)) +
  11767. (this[offset + 3] * 0x1000000)
  11768. }
  11769. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  11770. if (!noAssert) checkOffset(offset, 4, this.length)
  11771. return (this[offset] * 0x1000000) +
  11772. ((this[offset + 1] << 16) |
  11773. (this[offset + 2] << 8) |
  11774. this[offset + 3])
  11775. }
  11776. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  11777. offset = offset | 0
  11778. byteLength = byteLength | 0
  11779. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11780. var val = this[offset]
  11781. var mul = 1
  11782. var i = 0
  11783. while (++i < byteLength && (mul *= 0x100)) {
  11784. val += this[offset + i] * mul
  11785. }
  11786. mul *= 0x80
  11787. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11788. return val
  11789. }
  11790. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  11791. offset = offset | 0
  11792. byteLength = byteLength | 0
  11793. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11794. var i = byteLength
  11795. var mul = 1
  11796. var val = this[offset + --i]
  11797. while (i > 0 && (mul *= 0x100)) {
  11798. val += this[offset + --i] * mul
  11799. }
  11800. mul *= 0x80
  11801. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11802. return val
  11803. }
  11804. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  11805. if (!noAssert) checkOffset(offset, 1, this.length)
  11806. if (!(this[offset] & 0x80)) return (this[offset])
  11807. return ((0xff - this[offset] + 1) * -1)
  11808. }
  11809. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  11810. if (!noAssert) checkOffset(offset, 2, this.length)
  11811. var val = this[offset] | (this[offset + 1] << 8)
  11812. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11813. }
  11814. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  11815. if (!noAssert) checkOffset(offset, 2, this.length)
  11816. var val = this[offset + 1] | (this[offset] << 8)
  11817. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11818. }
  11819. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  11820. if (!noAssert) checkOffset(offset, 4, this.length)
  11821. return (this[offset]) |
  11822. (this[offset + 1] << 8) |
  11823. (this[offset + 2] << 16) |
  11824. (this[offset + 3] << 24)
  11825. }
  11826. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  11827. if (!noAssert) checkOffset(offset, 4, this.length)
  11828. return (this[offset] << 24) |
  11829. (this[offset + 1] << 16) |
  11830. (this[offset + 2] << 8) |
  11831. (this[offset + 3])
  11832. }
  11833. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  11834. if (!noAssert) checkOffset(offset, 4, this.length)
  11835. return ieee754.read(this, offset, true, 23, 4)
  11836. }
  11837. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  11838. if (!noAssert) checkOffset(offset, 4, this.length)
  11839. return ieee754.read(this, offset, false, 23, 4)
  11840. }
  11841. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  11842. if (!noAssert) checkOffset(offset, 8, this.length)
  11843. return ieee754.read(this, offset, true, 52, 8)
  11844. }
  11845. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  11846. if (!noAssert) checkOffset(offset, 8, this.length)
  11847. return ieee754.read(this, offset, false, 52, 8)
  11848. }
  11849. function checkInt (buf, value, offset, ext, max, min) {
  11850. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  11851. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  11852. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11853. }
  11854. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  11855. value = +value
  11856. offset = offset | 0
  11857. byteLength = byteLength | 0
  11858. if (!noAssert) {
  11859. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11860. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11861. }
  11862. var mul = 1
  11863. var i = 0
  11864. this[offset] = value & 0xFF
  11865. while (++i < byteLength && (mul *= 0x100)) {
  11866. this[offset + i] = (value / mul) & 0xFF
  11867. }
  11868. return offset + byteLength
  11869. }
  11870. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  11871. value = +value
  11872. offset = offset | 0
  11873. byteLength = byteLength | 0
  11874. if (!noAssert) {
  11875. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11876. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11877. }
  11878. var i = byteLength - 1
  11879. var mul = 1
  11880. this[offset + i] = value & 0xFF
  11881. while (--i >= 0 && (mul *= 0x100)) {
  11882. this[offset + i] = (value / mul) & 0xFF
  11883. }
  11884. return offset + byteLength
  11885. }
  11886. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  11887. value = +value
  11888. offset = offset | 0
  11889. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  11890. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11891. this[offset] = (value & 0xff)
  11892. return offset + 1
  11893. }
  11894. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  11895. if (value < 0) value = 0xffff + value + 1
  11896. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  11897. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  11898. (littleEndian ? i : 1 - i) * 8
  11899. }
  11900. }
  11901. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  11902. value = +value
  11903. offset = offset | 0
  11904. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11905. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11906. this[offset] = (value & 0xff)
  11907. this[offset + 1] = (value >>> 8)
  11908. } else {
  11909. objectWriteUInt16(this, value, offset, true)
  11910. }
  11911. return offset + 2
  11912. }
  11913. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  11914. value = +value
  11915. offset = offset | 0
  11916. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11917. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11918. this[offset] = (value >>> 8)
  11919. this[offset + 1] = (value & 0xff)
  11920. } else {
  11921. objectWriteUInt16(this, value, offset, false)
  11922. }
  11923. return offset + 2
  11924. }
  11925. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  11926. if (value < 0) value = 0xffffffff + value + 1
  11927. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  11928. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  11929. }
  11930. }
  11931. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11932. value = +value
  11933. offset = offset | 0
  11934. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11935. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11936. this[offset + 3] = (value >>> 24)
  11937. this[offset + 2] = (value >>> 16)
  11938. this[offset + 1] = (value >>> 8)
  11939. this[offset] = (value & 0xff)
  11940. } else {
  11941. objectWriteUInt32(this, value, offset, true)
  11942. }
  11943. return offset + 4
  11944. }
  11945. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11946. value = +value
  11947. offset = offset | 0
  11948. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11949. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11950. this[offset] = (value >>> 24)
  11951. this[offset + 1] = (value >>> 16)
  11952. this[offset + 2] = (value >>> 8)
  11953. this[offset + 3] = (value & 0xff)
  11954. } else {
  11955. objectWriteUInt32(this, value, offset, false)
  11956. }
  11957. return offset + 4
  11958. }
  11959. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11960. value = +value
  11961. offset = offset | 0
  11962. if (!noAssert) {
  11963. var limit = Math.pow(2, 8 * byteLength - 1)
  11964. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11965. }
  11966. var i = 0
  11967. var mul = 1
  11968. var sub = 0
  11969. this[offset] = value & 0xFF
  11970. while (++i < byteLength && (mul *= 0x100)) {
  11971. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11972. sub = 1
  11973. }
  11974. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11975. }
  11976. return offset + byteLength
  11977. }
  11978. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11979. value = +value
  11980. offset = offset | 0
  11981. if (!noAssert) {
  11982. var limit = Math.pow(2, 8 * byteLength - 1)
  11983. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11984. }
  11985. var i = byteLength - 1
  11986. var mul = 1
  11987. var sub = 0
  11988. this[offset + i] = value & 0xFF
  11989. while (--i >= 0 && (mul *= 0x100)) {
  11990. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11991. sub = 1
  11992. }
  11993. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11994. }
  11995. return offset + byteLength
  11996. }
  11997. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11998. value = +value
  11999. offset = offset | 0
  12000. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  12001. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  12002. if (value < 0) value = 0xff + value + 1
  12003. this[offset] = (value & 0xff)
  12004. return offset + 1
  12005. }
  12006. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  12007. value = +value
  12008. offset = offset | 0
  12009. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  12010. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12011. this[offset] = (value & 0xff)
  12012. this[offset + 1] = (value >>> 8)
  12013. } else {
  12014. objectWriteUInt16(this, value, offset, true)
  12015. }
  12016. return offset + 2
  12017. }
  12018. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  12019. value = +value
  12020. offset = offset | 0
  12021. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  12022. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12023. this[offset] = (value >>> 8)
  12024. this[offset + 1] = (value & 0xff)
  12025. } else {
  12026. objectWriteUInt16(this, value, offset, false)
  12027. }
  12028. return offset + 2
  12029. }
  12030. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  12031. value = +value
  12032. offset = offset | 0
  12033. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  12034. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12035. this[offset] = (value & 0xff)
  12036. this[offset + 1] = (value >>> 8)
  12037. this[offset + 2] = (value >>> 16)
  12038. this[offset + 3] = (value >>> 24)
  12039. } else {
  12040. objectWriteUInt32(this, value, offset, true)
  12041. }
  12042. return offset + 4
  12043. }
  12044. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  12045. value = +value
  12046. offset = offset | 0
  12047. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  12048. if (value < 0) value = 0xffffffff + value + 1
  12049. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12050. this[offset] = (value >>> 24)
  12051. this[offset + 1] = (value >>> 16)
  12052. this[offset + 2] = (value >>> 8)
  12053. this[offset + 3] = (value & 0xff)
  12054. } else {
  12055. objectWriteUInt32(this, value, offset, false)
  12056. }
  12057. return offset + 4
  12058. }
  12059. function checkIEEE754 (buf, value, offset, ext, max, min) {
  12060. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  12061. if (offset < 0) throw new RangeError('Index out of range')
  12062. }
  12063. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  12064. if (!noAssert) {
  12065. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  12066. }
  12067. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  12068. return offset + 4
  12069. }
  12070. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  12071. return writeFloat(this, value, offset, true, noAssert)
  12072. }
  12073. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  12074. return writeFloat(this, value, offset, false, noAssert)
  12075. }
  12076. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  12077. if (!noAssert) {
  12078. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  12079. }
  12080. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  12081. return offset + 8
  12082. }
  12083. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  12084. return writeDouble(this, value, offset, true, noAssert)
  12085. }
  12086. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  12087. return writeDouble(this, value, offset, false, noAssert)
  12088. }
  12089. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  12090. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  12091. if (!start) start = 0
  12092. if (!end && end !== 0) end = this.length
  12093. if (targetStart >= target.length) targetStart = target.length
  12094. if (!targetStart) targetStart = 0
  12095. if (end > 0 && end < start) end = start
  12096. // Copy 0 bytes; we're done
  12097. if (end === start) return 0
  12098. if (target.length === 0 || this.length === 0) return 0
  12099. // Fatal error conditions
  12100. if (targetStart < 0) {
  12101. throw new RangeError('targetStart out of bounds')
  12102. }
  12103. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  12104. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  12105. // Are we oob?
  12106. if (end > this.length) end = this.length
  12107. if (target.length - targetStart < end - start) {
  12108. end = target.length - targetStart + start
  12109. }
  12110. var len = end - start
  12111. var i
  12112. if (this === target && start < targetStart && targetStart < end) {
  12113. // descending copy from end
  12114. for (i = len - 1; i >= 0; --i) {
  12115. target[i + targetStart] = this[i + start]
  12116. }
  12117. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  12118. // ascending copy from start
  12119. for (i = 0; i < len; ++i) {
  12120. target[i + targetStart] = this[i + start]
  12121. }
  12122. } else {
  12123. Uint8Array.prototype.set.call(
  12124. target,
  12125. this.subarray(start, start + len),
  12126. targetStart
  12127. )
  12128. }
  12129. return len
  12130. }
  12131. // Usage:
  12132. // buffer.fill(number[, offset[, end]])
  12133. // buffer.fill(buffer[, offset[, end]])
  12134. // buffer.fill(string[, offset[, end]][, encoding])
  12135. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  12136. // Handle string cases:
  12137. if (typeof val === 'string') {
  12138. if (typeof start === 'string') {
  12139. encoding = start
  12140. start = 0
  12141. end = this.length
  12142. } else if (typeof end === 'string') {
  12143. encoding = end
  12144. end = this.length
  12145. }
  12146. if (val.length === 1) {
  12147. var code = val.charCodeAt(0)
  12148. if (code < 256) {
  12149. val = code
  12150. }
  12151. }
  12152. if (encoding !== undefined && typeof encoding !== 'string') {
  12153. throw new TypeError('encoding must be a string')
  12154. }
  12155. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  12156. throw new TypeError('Unknown encoding: ' + encoding)
  12157. }
  12158. } else if (typeof val === 'number') {
  12159. val = val & 255
  12160. }
  12161. // Invalid ranges are not set to a default, so can range check early.
  12162. if (start < 0 || this.length < start || this.length < end) {
  12163. throw new RangeError('Out of range index')
  12164. }
  12165. if (end <= start) {
  12166. return this
  12167. }
  12168. start = start >>> 0
  12169. end = end === undefined ? this.length : end >>> 0
  12170. if (!val) val = 0
  12171. var i
  12172. if (typeof val === 'number') {
  12173. for (i = start; i < end; ++i) {
  12174. this[i] = val
  12175. }
  12176. } else {
  12177. var bytes = Buffer.isBuffer(val)
  12178. ? val
  12179. : utf8ToBytes(new Buffer(val, encoding).toString())
  12180. var len = bytes.length
  12181. for (i = 0; i < end - start; ++i) {
  12182. this[i + start] = bytes[i % len]
  12183. }
  12184. }
  12185. return this
  12186. }
  12187. // HELPER FUNCTIONS
  12188. // ================
  12189. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  12190. function base64clean (str) {
  12191. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  12192. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  12193. // Node converts strings with length < 2 to ''
  12194. if (str.length < 2) return ''
  12195. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  12196. while (str.length % 4 !== 0) {
  12197. str = str + '='
  12198. }
  12199. return str
  12200. }
  12201. function stringtrim (str) {
  12202. if (str.trim) return str.trim()
  12203. return str.replace(/^\s+|\s+$/g, '')
  12204. }
  12205. function toHex (n) {
  12206. if (n < 16) return '0' + n.toString(16)
  12207. return n.toString(16)
  12208. }
  12209. function utf8ToBytes (string, units) {
  12210. units = units || Infinity
  12211. var codePoint
  12212. var length = string.length
  12213. var leadSurrogate = null
  12214. var bytes = []
  12215. for (var i = 0; i < length; ++i) {
  12216. codePoint = string.charCodeAt(i)
  12217. // is surrogate component
  12218. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  12219. // last char was a lead
  12220. if (!leadSurrogate) {
  12221. // no lead yet
  12222. if (codePoint > 0xDBFF) {
  12223. // unexpected trail
  12224. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12225. continue
  12226. } else if (i + 1 === length) {
  12227. // unpaired lead
  12228. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12229. continue
  12230. }
  12231. // valid lead
  12232. leadSurrogate = codePoint
  12233. continue
  12234. }
  12235. // 2 leads in a row
  12236. if (codePoint < 0xDC00) {
  12237. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12238. leadSurrogate = codePoint
  12239. continue
  12240. }
  12241. // valid surrogate pair
  12242. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  12243. } else if (leadSurrogate) {
  12244. // valid bmp char, but last char was a lead
  12245. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12246. }
  12247. leadSurrogate = null
  12248. // encode utf8
  12249. if (codePoint < 0x80) {
  12250. if ((units -= 1) < 0) break
  12251. bytes.push(codePoint)
  12252. } else if (codePoint < 0x800) {
  12253. if ((units -= 2) < 0) break
  12254. bytes.push(
  12255. codePoint >> 0x6 | 0xC0,
  12256. codePoint & 0x3F | 0x80
  12257. )
  12258. } else if (codePoint < 0x10000) {
  12259. if ((units -= 3) < 0) break
  12260. bytes.push(
  12261. codePoint >> 0xC | 0xE0,
  12262. codePoint >> 0x6 & 0x3F | 0x80,
  12263. codePoint & 0x3F | 0x80
  12264. )
  12265. } else if (codePoint < 0x110000) {
  12266. if ((units -= 4) < 0) break
  12267. bytes.push(
  12268. codePoint >> 0x12 | 0xF0,
  12269. codePoint >> 0xC & 0x3F | 0x80,
  12270. codePoint >> 0x6 & 0x3F | 0x80,
  12271. codePoint & 0x3F | 0x80
  12272. )
  12273. } else {
  12274. throw new Error('Invalid code point')
  12275. }
  12276. }
  12277. return bytes
  12278. }
  12279. function asciiToBytes (str) {
  12280. var byteArray = []
  12281. for (var i = 0; i < str.length; ++i) {
  12282. // Node's code seems to be doing this and not & 0x7F..
  12283. byteArray.push(str.charCodeAt(i) & 0xFF)
  12284. }
  12285. return byteArray
  12286. }
  12287. function utf16leToBytes (str, units) {
  12288. var c, hi, lo
  12289. var byteArray = []
  12290. for (var i = 0; i < str.length; ++i) {
  12291. if ((units -= 2) < 0) break
  12292. c = str.charCodeAt(i)
  12293. hi = c >> 8
  12294. lo = c % 256
  12295. byteArray.push(lo)
  12296. byteArray.push(hi)
  12297. }
  12298. return byteArray
  12299. }
  12300. function base64ToBytes (str) {
  12301. return base64.toByteArray(base64clean(str))
  12302. }
  12303. function blitBuffer (src, dst, offset, length) {
  12304. for (var i = 0; i < length; ++i) {
  12305. if ((i + offset >= dst.length) || (i >= src.length)) break
  12306. dst[i + offset] = src[i]
  12307. }
  12308. return i
  12309. }
  12310. function isnan (val) {
  12311. return val !== val // eslint-disable-line no-self-compare
  12312. }
  12313. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  12314. /***/ }),
  12315. /* 84 */
  12316. /*!*****************************************!*\
  12317. !*** ./node_modules/base64-js/index.js ***!
  12318. \*****************************************/
  12319. /*! no static exports found */
  12320. /***/ (function(module, exports, __webpack_require__) {
  12321. "use strict";
  12322. exports.byteLength = byteLength
  12323. exports.toByteArray = toByteArray
  12324. exports.fromByteArray = fromByteArray
  12325. var lookup = []
  12326. var revLookup = []
  12327. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  12328. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  12329. for (var i = 0, len = code.length; i < len; ++i) {
  12330. lookup[i] = code[i]
  12331. revLookup[code.charCodeAt(i)] = i
  12332. }
  12333. // Support decoding URL-safe base64 strings, as Node.js does.
  12334. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  12335. revLookup['-'.charCodeAt(0)] = 62
  12336. revLookup['_'.charCodeAt(0)] = 63
  12337. function getLens (b64) {
  12338. var len = b64.length
  12339. if (len % 4 > 0) {
  12340. throw new Error('Invalid string. Length must be a multiple of 4')
  12341. }
  12342. // Trim off extra bytes after placeholder bytes are found
  12343. // See: https://github.com/beatgammit/base64-js/issues/42
  12344. var validLen = b64.indexOf('=')
  12345. if (validLen === -1) validLen = len
  12346. var placeHoldersLen = validLen === len
  12347. ? 0
  12348. : 4 - (validLen % 4)
  12349. return [validLen, placeHoldersLen]
  12350. }
  12351. // base64 is 4/3 + up to two characters of the original data
  12352. function byteLength (b64) {
  12353. var lens = getLens(b64)
  12354. var validLen = lens[0]
  12355. var placeHoldersLen = lens[1]
  12356. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12357. }
  12358. function _byteLength (b64, validLen, placeHoldersLen) {
  12359. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12360. }
  12361. function toByteArray (b64) {
  12362. var tmp
  12363. var lens = getLens(b64)
  12364. var validLen = lens[0]
  12365. var placeHoldersLen = lens[1]
  12366. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  12367. var curByte = 0
  12368. // if there are placeholders, only get up to the last complete 4 chars
  12369. var len = placeHoldersLen > 0
  12370. ? validLen - 4
  12371. : validLen
  12372. var i
  12373. for (i = 0; i < len; i += 4) {
  12374. tmp =
  12375. (revLookup[b64.charCodeAt(i)] << 18) |
  12376. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  12377. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  12378. revLookup[b64.charCodeAt(i + 3)]
  12379. arr[curByte++] = (tmp >> 16) & 0xFF
  12380. arr[curByte++] = (tmp >> 8) & 0xFF
  12381. arr[curByte++] = tmp & 0xFF
  12382. }
  12383. if (placeHoldersLen === 2) {
  12384. tmp =
  12385. (revLookup[b64.charCodeAt(i)] << 2) |
  12386. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  12387. arr[curByte++] = tmp & 0xFF
  12388. }
  12389. if (placeHoldersLen === 1) {
  12390. tmp =
  12391. (revLookup[b64.charCodeAt(i)] << 10) |
  12392. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  12393. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  12394. arr[curByte++] = (tmp >> 8) & 0xFF
  12395. arr[curByte++] = tmp & 0xFF
  12396. }
  12397. return arr
  12398. }
  12399. function tripletToBase64 (num) {
  12400. return lookup[num >> 18 & 0x3F] +
  12401. lookup[num >> 12 & 0x3F] +
  12402. lookup[num >> 6 & 0x3F] +
  12403. lookup[num & 0x3F]
  12404. }
  12405. function encodeChunk (uint8, start, end) {
  12406. var tmp
  12407. var output = []
  12408. for (var i = start; i < end; i += 3) {
  12409. tmp =
  12410. ((uint8[i] << 16) & 0xFF0000) +
  12411. ((uint8[i + 1] << 8) & 0xFF00) +
  12412. (uint8[i + 2] & 0xFF)
  12413. output.push(tripletToBase64(tmp))
  12414. }
  12415. return output.join('')
  12416. }
  12417. function fromByteArray (uint8) {
  12418. var tmp
  12419. var len = uint8.length
  12420. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  12421. var parts = []
  12422. var maxChunkLength = 16383 // must be multiple of 3
  12423. // go through the array every three bytes, we'll deal with trailing stuff later
  12424. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  12425. parts.push(encodeChunk(
  12426. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  12427. ))
  12428. }
  12429. // pad the end with zeros, but make sure to not forget the extra bytes
  12430. if (extraBytes === 1) {
  12431. tmp = uint8[len - 1]
  12432. parts.push(
  12433. lookup[tmp >> 2] +
  12434. lookup[(tmp << 4) & 0x3F] +
  12435. '=='
  12436. )
  12437. } else if (extraBytes === 2) {
  12438. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  12439. parts.push(
  12440. lookup[tmp >> 10] +
  12441. lookup[(tmp >> 4) & 0x3F] +
  12442. lookup[(tmp << 2) & 0x3F] +
  12443. '='
  12444. )
  12445. }
  12446. return parts.join('')
  12447. }
  12448. /***/ }),
  12449. /* 85 */
  12450. /*!***************************************!*\
  12451. !*** ./node_modules/ieee754/index.js ***!
  12452. \***************************************/
  12453. /*! no static exports found */
  12454. /***/ (function(module, exports) {
  12455. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  12456. var e, m
  12457. var eLen = (nBytes * 8) - mLen - 1
  12458. var eMax = (1 << eLen) - 1
  12459. var eBias = eMax >> 1
  12460. var nBits = -7
  12461. var i = isLE ? (nBytes - 1) : 0
  12462. var d = isLE ? -1 : 1
  12463. var s = buffer[offset + i]
  12464. i += d
  12465. e = s & ((1 << (-nBits)) - 1)
  12466. s >>= (-nBits)
  12467. nBits += eLen
  12468. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12469. m = e & ((1 << (-nBits)) - 1)
  12470. e >>= (-nBits)
  12471. nBits += mLen
  12472. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12473. if (e === 0) {
  12474. e = 1 - eBias
  12475. } else if (e === eMax) {
  12476. return m ? NaN : ((s ? -1 : 1) * Infinity)
  12477. } else {
  12478. m = m + Math.pow(2, mLen)
  12479. e = e - eBias
  12480. }
  12481. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  12482. }
  12483. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  12484. var e, m, c
  12485. var eLen = (nBytes * 8) - mLen - 1
  12486. var eMax = (1 << eLen) - 1
  12487. var eBias = eMax >> 1
  12488. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  12489. var i = isLE ? 0 : (nBytes - 1)
  12490. var d = isLE ? 1 : -1
  12491. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  12492. value = Math.abs(value)
  12493. if (isNaN(value) || value === Infinity) {
  12494. m = isNaN(value) ? 1 : 0
  12495. e = eMax
  12496. } else {
  12497. e = Math.floor(Math.log(value) / Math.LN2)
  12498. if (value * (c = Math.pow(2, -e)) < 1) {
  12499. e--
  12500. c *= 2
  12501. }
  12502. if (e + eBias >= 1) {
  12503. value += rt / c
  12504. } else {
  12505. value += rt * Math.pow(2, 1 - eBias)
  12506. }
  12507. if (value * c >= 2) {
  12508. e++
  12509. c /= 2
  12510. }
  12511. if (e + eBias >= eMax) {
  12512. m = 0
  12513. e = eMax
  12514. } else if (e + eBias >= 1) {
  12515. m = ((value * c) - 1) * Math.pow(2, mLen)
  12516. e = e + eBias
  12517. } else {
  12518. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  12519. e = 0
  12520. }
  12521. }
  12522. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  12523. e = (e << mLen) | m
  12524. eLen += mLen
  12525. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  12526. buffer[offset + i - d] |= s * 128
  12527. }
  12528. /***/ }),
  12529. /* 86 */
  12530. /*!***************************************!*\
  12531. !*** ./node_modules/isarray/index.js ***!
  12532. \***************************************/
  12533. /*! no static exports found */
  12534. /***/ (function(module, exports) {
  12535. var toString = {}.toString;
  12536. module.exports = Array.isArray || function (arr) {
  12537. return toString.call(arr) == '[object Array]';
  12538. };
  12539. /***/ }),
  12540. /* 87 */
  12541. /*!*********************************************!*\
  12542. !*** ./node_modules/create-hash/browser.js ***!
  12543. \*********************************************/
  12544. /*! no static exports found */
  12545. /***/ (function(module, exports, __webpack_require__) {
  12546. "use strict";
  12547. var inherits = __webpack_require__(/*! inherits */ 88)
  12548. var MD5 = __webpack_require__(/*! md5.js */ 89)
  12549. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 107)
  12550. var sha = __webpack_require__(/*! sha.js */ 108)
  12551. var Base = __webpack_require__(/*! cipher-base */ 116)
  12552. function Hash (hash) {
  12553. Base.call(this, 'digest')
  12554. this._hash = hash
  12555. }
  12556. inherits(Hash, Base)
  12557. Hash.prototype._update = function (data) {
  12558. this._hash.update(data)
  12559. }
  12560. Hash.prototype._final = function () {
  12561. return this._hash.digest()
  12562. }
  12563. module.exports = function createHash (alg) {
  12564. alg = alg.toLowerCase()
  12565. if (alg === 'md5') return new MD5()
  12566. if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
  12567. return new Hash(sha(alg))
  12568. }
  12569. /***/ }),
  12570. /* 88 */
  12571. /*!***************************************************!*\
  12572. !*** ./node_modules/inherits/inherits_browser.js ***!
  12573. \***************************************************/
  12574. /*! no static exports found */
  12575. /***/ (function(module, exports) {
  12576. if (typeof Object.create === 'function') {
  12577. // implementation from standard node.js 'util' module
  12578. module.exports = function inherits(ctor, superCtor) {
  12579. if (superCtor) {
  12580. ctor.super_ = superCtor
  12581. ctor.prototype = Object.create(superCtor.prototype, {
  12582. constructor: {
  12583. value: ctor,
  12584. enumerable: false,
  12585. writable: true,
  12586. configurable: true
  12587. }
  12588. })
  12589. }
  12590. };
  12591. } else {
  12592. // old school shim for old browsers
  12593. module.exports = function inherits(ctor, superCtor) {
  12594. if (superCtor) {
  12595. ctor.super_ = superCtor
  12596. var TempCtor = function () {}
  12597. TempCtor.prototype = superCtor.prototype
  12598. ctor.prototype = new TempCtor()
  12599. ctor.prototype.constructor = ctor
  12600. }
  12601. }
  12602. }
  12603. /***/ }),
  12604. /* 89 */
  12605. /*!**************************************!*\
  12606. !*** ./node_modules/md5.js/index.js ***!
  12607. \**************************************/
  12608. /*! no static exports found */
  12609. /***/ (function(module, exports, __webpack_require__) {
  12610. "use strict";
  12611. var inherits = __webpack_require__(/*! inherits */ 88)
  12612. var HashBase = __webpack_require__(/*! hash-base */ 90)
  12613. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  12614. var ARRAY16 = new Array(16)
  12615. function MD5 () {
  12616. HashBase.call(this, 64)
  12617. // state
  12618. this._a = 0x67452301
  12619. this._b = 0xefcdab89
  12620. this._c = 0x98badcfe
  12621. this._d = 0x10325476
  12622. }
  12623. inherits(MD5, HashBase)
  12624. MD5.prototype._update = function () {
  12625. var M = ARRAY16
  12626. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  12627. var a = this._a
  12628. var b = this._b
  12629. var c = this._c
  12630. var d = this._d
  12631. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  12632. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  12633. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  12634. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  12635. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  12636. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  12637. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  12638. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  12639. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  12640. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  12641. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  12642. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  12643. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  12644. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  12645. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  12646. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  12647. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  12648. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  12649. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  12650. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  12651. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  12652. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  12653. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  12654. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  12655. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  12656. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  12657. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  12658. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  12659. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  12660. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  12661. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  12662. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  12663. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  12664. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  12665. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  12666. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  12667. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  12668. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  12669. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  12670. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  12671. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  12672. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  12673. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  12674. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  12675. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  12676. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  12677. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  12678. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  12679. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  12680. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  12681. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  12682. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  12683. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  12684. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  12685. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  12686. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  12687. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  12688. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  12689. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  12690. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  12691. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  12692. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  12693. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  12694. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  12695. this._a = (this._a + a) | 0
  12696. this._b = (this._b + b) | 0
  12697. this._c = (this._c + c) | 0
  12698. this._d = (this._d + d) | 0
  12699. }
  12700. MD5.prototype._digest = function () {
  12701. // create padding and handle blocks
  12702. this._block[this._blockOffset++] = 0x80
  12703. if (this._blockOffset > 56) {
  12704. this._block.fill(0, this._blockOffset, 64)
  12705. this._update()
  12706. this._blockOffset = 0
  12707. }
  12708. this._block.fill(0, this._blockOffset, 56)
  12709. this._block.writeUInt32LE(this._length[0], 56)
  12710. this._block.writeUInt32LE(this._length[1], 60)
  12711. this._update()
  12712. // produce result
  12713. var buffer = Buffer.allocUnsafe(16)
  12714. buffer.writeInt32LE(this._a, 0)
  12715. buffer.writeInt32LE(this._b, 4)
  12716. buffer.writeInt32LE(this._c, 8)
  12717. buffer.writeInt32LE(this._d, 12)
  12718. return buffer
  12719. }
  12720. function rotl (x, n) {
  12721. return (x << n) | (x >>> (32 - n))
  12722. }
  12723. function fnF (a, b, c, d, m, k, s) {
  12724. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  12725. }
  12726. function fnG (a, b, c, d, m, k, s) {
  12727. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  12728. }
  12729. function fnH (a, b, c, d, m, k, s) {
  12730. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  12731. }
  12732. function fnI (a, b, c, d, m, k, s) {
  12733. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  12734. }
  12735. module.exports = MD5
  12736. /***/ }),
  12737. /* 90 */
  12738. /*!*****************************************!*\
  12739. !*** ./node_modules/hash-base/index.js ***!
  12740. \*****************************************/
  12741. /*! no static exports found */
  12742. /***/ (function(module, exports, __webpack_require__) {
  12743. "use strict";
  12744. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  12745. var Transform = __webpack_require__(/*! readable-stream */ 91).Transform
  12746. var inherits = __webpack_require__(/*! inherits */ 88)
  12747. function throwIfNotStringOrBuffer (val, prefix) {
  12748. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  12749. throw new TypeError(prefix + ' must be a string or a buffer')
  12750. }
  12751. }
  12752. function HashBase (blockSize) {
  12753. Transform.call(this)
  12754. this._block = Buffer.allocUnsafe(blockSize)
  12755. this._blockSize = blockSize
  12756. this._blockOffset = 0
  12757. this._length = [0, 0, 0, 0]
  12758. this._finalized = false
  12759. }
  12760. inherits(HashBase, Transform)
  12761. HashBase.prototype._transform = function (chunk, encoding, callback) {
  12762. var error = null
  12763. try {
  12764. this.update(chunk, encoding)
  12765. } catch (err) {
  12766. error = err
  12767. }
  12768. callback(error)
  12769. }
  12770. HashBase.prototype._flush = function (callback) {
  12771. var error = null
  12772. try {
  12773. this.push(this.digest())
  12774. } catch (err) {
  12775. error = err
  12776. }
  12777. callback(error)
  12778. }
  12779. HashBase.prototype.update = function (data, encoding) {
  12780. throwIfNotStringOrBuffer(data, 'Data')
  12781. if (this._finalized) throw new Error('Digest already called')
  12782. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  12783. // consume data
  12784. var block = this._block
  12785. var offset = 0
  12786. while (this._blockOffset + data.length - offset >= this._blockSize) {
  12787. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  12788. this._update()
  12789. this._blockOffset = 0
  12790. }
  12791. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  12792. // update length
  12793. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  12794. this._length[j] += carry
  12795. carry = (this._length[j] / 0x0100000000) | 0
  12796. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  12797. }
  12798. return this
  12799. }
  12800. HashBase.prototype._update = function () {
  12801. throw new Error('_update is not implemented')
  12802. }
  12803. HashBase.prototype.digest = function (encoding) {
  12804. if (this._finalized) throw new Error('Digest already called')
  12805. this._finalized = true
  12806. var digest = this._digest()
  12807. if (encoding !== undefined) digest = digest.toString(encoding)
  12808. // reset state
  12809. this._block.fill(0)
  12810. this._blockOffset = 0
  12811. for (var i = 0; i < 4; ++i) this._length[i] = 0
  12812. return digest
  12813. }
  12814. HashBase.prototype._digest = function () {
  12815. throw new Error('_digest is not implemented')
  12816. }
  12817. module.exports = HashBase
  12818. /***/ }),
  12819. /* 91 */
  12820. /*!**********************************************************!*\
  12821. !*** ./node_modules/readable-stream/readable-browser.js ***!
  12822. \**********************************************************/
  12823. /*! no static exports found */
  12824. /***/ (function(module, exports, __webpack_require__) {
  12825. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 92);
  12826. exports.Stream = exports;
  12827. exports.Readable = exports;
  12828. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 102);
  12829. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 101);
  12830. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 105);
  12831. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 106);
  12832. /***/ }),
  12833. /* 92 */
  12834. /*!**************************************************************!*\
  12835. !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
  12836. \**************************************************************/
  12837. /*! no static exports found */
  12838. /***/ (function(module, exports, __webpack_require__) {
  12839. "use strict";
  12840. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  12841. //
  12842. // Permission is hereby granted, free of charge, to any person obtaining a
  12843. // copy of this software and associated documentation files (the
  12844. // "Software"), to deal in the Software without restriction, including
  12845. // without limitation the rights to use, copy, modify, merge, publish,
  12846. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12847. // persons to whom the Software is furnished to do so, subject to the
  12848. // following conditions:
  12849. //
  12850. // The above copyright notice and this permission notice shall be included
  12851. // in all copies or substantial portions of the Software.
  12852. //
  12853. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12854. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12855. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12856. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12857. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12858. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12859. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12860. /*<replacement>*/
  12861. var pna = __webpack_require__(/*! process-nextick-args */ 93);
  12862. /*</replacement>*/
  12863. module.exports = Readable;
  12864. /*<replacement>*/
  12865. var isArray = __webpack_require__(/*! isarray */ 86);
  12866. /*</replacement>*/
  12867. /*<replacement>*/
  12868. var Duplex;
  12869. /*</replacement>*/
  12870. Readable.ReadableState = ReadableState;
  12871. /*<replacement>*/
  12872. var EE = __webpack_require__(/*! events */ 94).EventEmitter;
  12873. var EElistenerCount = function (emitter, type) {
  12874. return emitter.listeners(type).length;
  12875. };
  12876. /*</replacement>*/
  12877. /*<replacement>*/
  12878. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 95);
  12879. /*</replacement>*/
  12880. /*<replacement>*/
  12881. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer;
  12882. var OurUint8Array = global.Uint8Array || function () {};
  12883. function _uint8ArrayToBuffer(chunk) {
  12884. return Buffer.from(chunk);
  12885. }
  12886. function _isUint8Array(obj) {
  12887. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  12888. }
  12889. /*</replacement>*/
  12890. /*<replacement>*/
  12891. var util = Object.create(__webpack_require__(/*! core-util-is */ 96));
  12892. util.inherits = __webpack_require__(/*! inherits */ 88);
  12893. /*</replacement>*/
  12894. /*<replacement>*/
  12895. var debugUtil = __webpack_require__(/*! util */ 97);
  12896. var debug = void 0;
  12897. if (debugUtil && debugUtil.debuglog) {
  12898. debug = debugUtil.debuglog('stream');
  12899. } else {
  12900. debug = function () {};
  12901. }
  12902. /*</replacement>*/
  12903. var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 98);
  12904. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 100);
  12905. var StringDecoder;
  12906. util.inherits(Readable, Stream);
  12907. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  12908. function prependListener(emitter, event, fn) {
  12909. // Sadly this is not cacheable as some libraries bundle their own
  12910. // event emitter implementation with them.
  12911. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  12912. // This is a hack to make sure that our error handler is attached before any
  12913. // userland ones. NEVER DO THIS. This is here only because this code needs
  12914. // to continue to work with older versions of Node.js that do not include
  12915. // the prependListener() method. The goal is to eventually remove this hack.
  12916. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  12917. }
  12918. function ReadableState(options, stream) {
  12919. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 101);
  12920. options = options || {};
  12921. // Duplex streams are both readable and writable, but share
  12922. // the same options object.
  12923. // However, some cases require setting options to different
  12924. // values for the readable and the writable sides of the duplex stream.
  12925. // These options can be provided separately as readableXXX and writableXXX.
  12926. var isDuplex = stream instanceof Duplex;
  12927. // object stream flag. Used to make read(n) ignore n and to
  12928. // make all the buffer merging and length checks go away
  12929. this.objectMode = !!options.objectMode;
  12930. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  12931. // the point at which it stops calling _read() to fill the buffer
  12932. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  12933. var hwm = options.highWaterMark;
  12934. var readableHwm = options.readableHighWaterMark;
  12935. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  12936. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  12937. // cast to ints.
  12938. this.highWaterMark = Math.floor(this.highWaterMark);
  12939. // A linked list is used to store data chunks instead of an array because the
  12940. // linked list can remove elements from the beginning faster than
  12941. // array.shift()
  12942. this.buffer = new BufferList();
  12943. this.length = 0;
  12944. this.pipes = null;
  12945. this.pipesCount = 0;
  12946. this.flowing = null;
  12947. this.ended = false;
  12948. this.endEmitted = false;
  12949. this.reading = false;
  12950. // a flag to be able to tell if the event 'readable'/'data' is emitted
  12951. // immediately, or on a later tick. We set this to true at first, because
  12952. // any actions that shouldn't happen until "later" should generally also
  12953. // not happen before the first read call.
  12954. this.sync = true;
  12955. // whenever we return null, then we set a flag to say
  12956. // that we're awaiting a 'readable' event emission.
  12957. this.needReadable = false;
  12958. this.emittedReadable = false;
  12959. this.readableListening = false;
  12960. this.resumeScheduled = false;
  12961. // has it been destroyed
  12962. this.destroyed = false;
  12963. // Crypto is kind of old and crusty. Historically, its default string
  12964. // encoding is 'binary' so we have to make this configurable.
  12965. // Everything else in the universe uses 'utf8', though.
  12966. this.defaultEncoding = options.defaultEncoding || 'utf8';
  12967. // the number of writers that are awaiting a drain event in .pipe()s
  12968. this.awaitDrain = 0;
  12969. // if true, a maybeReadMore has been scheduled
  12970. this.readingMore = false;
  12971. this.decoder = null;
  12972. this.encoding = null;
  12973. if (options.encoding) {
  12974. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 104).StringDecoder;
  12975. this.decoder = new StringDecoder(options.encoding);
  12976. this.encoding = options.encoding;
  12977. }
  12978. }
  12979. function Readable(options) {
  12980. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 101);
  12981. if (!(this instanceof Readable)) return new Readable(options);
  12982. this._readableState = new ReadableState(options, this);
  12983. // legacy
  12984. this.readable = true;
  12985. if (options) {
  12986. if (typeof options.read === 'function') this._read = options.read;
  12987. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  12988. }
  12989. Stream.call(this);
  12990. }
  12991. Object.defineProperty(Readable.prototype, 'destroyed', {
  12992. get: function () {
  12993. if (this._readableState === undefined) {
  12994. return false;
  12995. }
  12996. return this._readableState.destroyed;
  12997. },
  12998. set: function (value) {
  12999. // we ignore the value if the stream
  13000. // has not been initialized yet
  13001. if (!this._readableState) {
  13002. return;
  13003. }
  13004. // backward compatibility, the user is explicitly
  13005. // managing destroyed
  13006. this._readableState.destroyed = value;
  13007. }
  13008. });
  13009. Readable.prototype.destroy = destroyImpl.destroy;
  13010. Readable.prototype._undestroy = destroyImpl.undestroy;
  13011. Readable.prototype._destroy = function (err, cb) {
  13012. this.push(null);
  13013. cb(err);
  13014. };
  13015. // Manually shove something into the read() buffer.
  13016. // This returns true if the highWaterMark has not been hit yet,
  13017. // similar to how Writable.write() returns true if you should
  13018. // write() some more.
  13019. Readable.prototype.push = function (chunk, encoding) {
  13020. var state = this._readableState;
  13021. var skipChunkCheck;
  13022. if (!state.objectMode) {
  13023. if (typeof chunk === 'string') {
  13024. encoding = encoding || state.defaultEncoding;
  13025. if (encoding !== state.encoding) {
  13026. chunk = Buffer.from(chunk, encoding);
  13027. encoding = '';
  13028. }
  13029. skipChunkCheck = true;
  13030. }
  13031. } else {
  13032. skipChunkCheck = true;
  13033. }
  13034. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  13035. };
  13036. // Unshift should *always* be something directly out of read()
  13037. Readable.prototype.unshift = function (chunk) {
  13038. return readableAddChunk(this, chunk, null, true, false);
  13039. };
  13040. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  13041. var state = stream._readableState;
  13042. if (chunk === null) {
  13043. state.reading = false;
  13044. onEofChunk(stream, state);
  13045. } else {
  13046. var er;
  13047. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  13048. if (er) {
  13049. stream.emit('error', er);
  13050. } else if (state.objectMode || chunk && chunk.length > 0) {
  13051. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  13052. chunk = _uint8ArrayToBuffer(chunk);
  13053. }
  13054. if (addToFront) {
  13055. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  13056. } else if (state.ended) {
  13057. stream.emit('error', new Error('stream.push() after EOF'));
  13058. } else {
  13059. state.reading = false;
  13060. if (state.decoder && !encoding) {
  13061. chunk = state.decoder.write(chunk);
  13062. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  13063. } else {
  13064. addChunk(stream, state, chunk, false);
  13065. }
  13066. }
  13067. } else if (!addToFront) {
  13068. state.reading = false;
  13069. }
  13070. }
  13071. return needMoreData(state);
  13072. }
  13073. function addChunk(stream, state, chunk, addToFront) {
  13074. if (state.flowing && state.length === 0 && !state.sync) {
  13075. stream.emit('data', chunk);
  13076. stream.read(0);
  13077. } else {
  13078. // update the buffer info.
  13079. state.length += state.objectMode ? 1 : chunk.length;
  13080. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  13081. if (state.needReadable) emitReadable(stream);
  13082. }
  13083. maybeReadMore(stream, state);
  13084. }
  13085. function chunkInvalid(state, chunk) {
  13086. var er;
  13087. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  13088. er = new TypeError('Invalid non-string/buffer chunk');
  13089. }
  13090. return er;
  13091. }
  13092. // if it's past the high water mark, we can push in some more.
  13093. // Also, if we have no data yet, we can stand some
  13094. // more bytes. This is to work around cases where hwm=0,
  13095. // such as the repl. Also, if the push() triggered a
  13096. // readable event, and the user called read(largeNumber) such that
  13097. // needReadable was set, then we ought to push more, so that another
  13098. // 'readable' event will be triggered.
  13099. function needMoreData(state) {
  13100. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  13101. }
  13102. Readable.prototype.isPaused = function () {
  13103. return this._readableState.flowing === false;
  13104. };
  13105. // backwards compatibility.
  13106. Readable.prototype.setEncoding = function (enc) {
  13107. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 104).StringDecoder;
  13108. this._readableState.decoder = new StringDecoder(enc);
  13109. this._readableState.encoding = enc;
  13110. return this;
  13111. };
  13112. // Don't raise the hwm > 8MB
  13113. var MAX_HWM = 0x800000;
  13114. function computeNewHighWaterMark(n) {
  13115. if (n >= MAX_HWM) {
  13116. n = MAX_HWM;
  13117. } else {
  13118. // Get the next highest power of 2 to prevent increasing hwm excessively in
  13119. // tiny amounts
  13120. n--;
  13121. n |= n >>> 1;
  13122. n |= n >>> 2;
  13123. n |= n >>> 4;
  13124. n |= n >>> 8;
  13125. n |= n >>> 16;
  13126. n++;
  13127. }
  13128. return n;
  13129. }
  13130. // This function is designed to be inlinable, so please take care when making
  13131. // changes to the function body.
  13132. function howMuchToRead(n, state) {
  13133. if (n <= 0 || state.length === 0 && state.ended) return 0;
  13134. if (state.objectMode) return 1;
  13135. if (n !== n) {
  13136. // Only flow one buffer at a time
  13137. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  13138. }
  13139. // If we're asking for more than the current hwm, then raise the hwm.
  13140. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  13141. if (n <= state.length) return n;
  13142. // Don't have enough
  13143. if (!state.ended) {
  13144. state.needReadable = true;
  13145. return 0;
  13146. }
  13147. return state.length;
  13148. }
  13149. // you can override either this method, or the async _read(n) below.
  13150. Readable.prototype.read = function (n) {
  13151. debug('read', n);
  13152. n = parseInt(n, 10);
  13153. var state = this._readableState;
  13154. var nOrig = n;
  13155. if (n !== 0) state.emittedReadable = false;
  13156. // if we're doing read(0) to trigger a readable event, but we
  13157. // already have a bunch of data in the buffer, then just trigger
  13158. // the 'readable' event and move on.
  13159. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  13160. debug('read: emitReadable', state.length, state.ended);
  13161. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  13162. return null;
  13163. }
  13164. n = howMuchToRead(n, state);
  13165. // if we've ended, and we're now clear, then finish it up.
  13166. if (n === 0 && state.ended) {
  13167. if (state.length === 0) endReadable(this);
  13168. return null;
  13169. }
  13170. // All the actual chunk generation logic needs to be
  13171. // *below* the call to _read. The reason is that in certain
  13172. // synthetic stream cases, such as passthrough streams, _read
  13173. // may be a completely synchronous operation which may change
  13174. // the state of the read buffer, providing enough data when
  13175. // before there was *not* enough.
  13176. //
  13177. // So, the steps are:
  13178. // 1. Figure out what the state of things will be after we do
  13179. // a read from the buffer.
  13180. //
  13181. // 2. If that resulting state will trigger a _read, then call _read.
  13182. // Note that this may be asynchronous, or synchronous. Yes, it is
  13183. // deeply ugly to write APIs this way, but that still doesn't mean
  13184. // that the Readable class should behave improperly, as streams are
  13185. // designed to be sync/async agnostic.
  13186. // Take note if the _read call is sync or async (ie, if the read call
  13187. // has returned yet), so that we know whether or not it's safe to emit
  13188. // 'readable' etc.
  13189. //
  13190. // 3. Actually pull the requested chunks out of the buffer and return.
  13191. // if we need a readable event, then we need to do some reading.
  13192. var doRead = state.needReadable;
  13193. debug('need readable', doRead);
  13194. // if we currently have less than the highWaterMark, then also read some
  13195. if (state.length === 0 || state.length - n < state.highWaterMark) {
  13196. doRead = true;
  13197. debug('length less than watermark', doRead);
  13198. }
  13199. // however, if we've ended, then there's no point, and if we're already
  13200. // reading, then it's unnecessary.
  13201. if (state.ended || state.reading) {
  13202. doRead = false;
  13203. debug('reading or ended', doRead);
  13204. } else if (doRead) {
  13205. debug('do read');
  13206. state.reading = true;
  13207. state.sync = true;
  13208. // if the length is currently zero, then we *need* a readable event.
  13209. if (state.length === 0) state.needReadable = true;
  13210. // call internal read method
  13211. this._read(state.highWaterMark);
  13212. state.sync = false;
  13213. // If _read pushed data synchronously, then `reading` will be false,
  13214. // and we need to re-evaluate how much data we can return to the user.
  13215. if (!state.reading) n = howMuchToRead(nOrig, state);
  13216. }
  13217. var ret;
  13218. if (n > 0) ret = fromList(n, state);else ret = null;
  13219. if (ret === null) {
  13220. state.needReadable = true;
  13221. n = 0;
  13222. } else {
  13223. state.length -= n;
  13224. }
  13225. if (state.length === 0) {
  13226. // If we have nothing in the buffer, then we want to know
  13227. // as soon as we *do* get something into the buffer.
  13228. if (!state.ended) state.needReadable = true;
  13229. // If we tried to read() past the EOF, then emit end on the next tick.
  13230. if (nOrig !== n && state.ended) endReadable(this);
  13231. }
  13232. if (ret !== null) this.emit('data', ret);
  13233. return ret;
  13234. };
  13235. function onEofChunk(stream, state) {
  13236. if (state.ended) return;
  13237. if (state.decoder) {
  13238. var chunk = state.decoder.end();
  13239. if (chunk && chunk.length) {
  13240. state.buffer.push(chunk);
  13241. state.length += state.objectMode ? 1 : chunk.length;
  13242. }
  13243. }
  13244. state.ended = true;
  13245. // emit 'readable' now to make sure it gets picked up.
  13246. emitReadable(stream);
  13247. }
  13248. // Don't emit readable right away in sync mode, because this can trigger
  13249. // another read() call => stack overflow. This way, it might trigger
  13250. // a nextTick recursion warning, but that's not so bad.
  13251. function emitReadable(stream) {
  13252. var state = stream._readableState;
  13253. state.needReadable = false;
  13254. if (!state.emittedReadable) {
  13255. debug('emitReadable', state.flowing);
  13256. state.emittedReadable = true;
  13257. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  13258. }
  13259. }
  13260. function emitReadable_(stream) {
  13261. debug('emit readable');
  13262. stream.emit('readable');
  13263. flow(stream);
  13264. }
  13265. // at this point, the user has presumably seen the 'readable' event,
  13266. // and called read() to consume some data. that may have triggered
  13267. // in turn another _read(n) call, in which case reading = true if
  13268. // it's in progress.
  13269. // However, if we're not ended, or reading, and the length < hwm,
  13270. // then go ahead and try to read some more preemptively.
  13271. function maybeReadMore(stream, state) {
  13272. if (!state.readingMore) {
  13273. state.readingMore = true;
  13274. pna.nextTick(maybeReadMore_, stream, state);
  13275. }
  13276. }
  13277. function maybeReadMore_(stream, state) {
  13278. var len = state.length;
  13279. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  13280. debug('maybeReadMore read 0');
  13281. stream.read(0);
  13282. if (len === state.length)
  13283. // didn't get any data, stop spinning.
  13284. break;else len = state.length;
  13285. }
  13286. state.readingMore = false;
  13287. }
  13288. // abstract method. to be overridden in specific implementation classes.
  13289. // call cb(er, data) where data is <= n in length.
  13290. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  13291. // arbitrary, and perhaps not very meaningful.
  13292. Readable.prototype._read = function (n) {
  13293. this.emit('error', new Error('_read() is not implemented'));
  13294. };
  13295. Readable.prototype.pipe = function (dest, pipeOpts) {
  13296. var src = this;
  13297. var state = this._readableState;
  13298. switch (state.pipesCount) {
  13299. case 0:
  13300. state.pipes = dest;
  13301. break;
  13302. case 1:
  13303. state.pipes = [state.pipes, dest];
  13304. break;
  13305. default:
  13306. state.pipes.push(dest);
  13307. break;
  13308. }
  13309. state.pipesCount += 1;
  13310. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  13311. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  13312. var endFn = doEnd ? onend : unpipe;
  13313. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  13314. dest.on('unpipe', onunpipe);
  13315. function onunpipe(readable, unpipeInfo) {
  13316. debug('onunpipe');
  13317. if (readable === src) {
  13318. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  13319. unpipeInfo.hasUnpiped = true;
  13320. cleanup();
  13321. }
  13322. }
  13323. }
  13324. function onend() {
  13325. debug('onend');
  13326. dest.end();
  13327. }
  13328. // when the dest drains, it reduces the awaitDrain counter
  13329. // on the source. This would be more elegant with a .once()
  13330. // handler in flow(), but adding and removing repeatedly is
  13331. // too slow.
  13332. var ondrain = pipeOnDrain(src);
  13333. dest.on('drain', ondrain);
  13334. var cleanedUp = false;
  13335. function cleanup() {
  13336. debug('cleanup');
  13337. // cleanup event handlers once the pipe is broken
  13338. dest.removeListener('close', onclose);
  13339. dest.removeListener('finish', onfinish);
  13340. dest.removeListener('drain', ondrain);
  13341. dest.removeListener('error', onerror);
  13342. dest.removeListener('unpipe', onunpipe);
  13343. src.removeListener('end', onend);
  13344. src.removeListener('end', unpipe);
  13345. src.removeListener('data', ondata);
  13346. cleanedUp = true;
  13347. // if the reader is waiting for a drain event from this
  13348. // specific writer, then it would cause it to never start
  13349. // flowing again.
  13350. // So, if this is awaiting a drain, then we just call it now.
  13351. // If we don't know, then assume that we are waiting for one.
  13352. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  13353. }
  13354. // If the user pushes more data while we're writing to dest then we'll end up
  13355. // in ondata again. However, we only want to increase awaitDrain once because
  13356. // dest will only emit one 'drain' event for the multiple writes.
  13357. // => Introduce a guard on increasing awaitDrain.
  13358. var increasedAwaitDrain = false;
  13359. src.on('data', ondata);
  13360. function ondata(chunk) {
  13361. debug('ondata');
  13362. increasedAwaitDrain = false;
  13363. var ret = dest.write(chunk);
  13364. if (false === ret && !increasedAwaitDrain) {
  13365. // If the user unpiped during `dest.write()`, it is possible
  13366. // to get stuck in a permanently paused state if that write
  13367. // also returned false.
  13368. // => Check whether `dest` is still a piping destination.
  13369. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  13370. debug('false write response, pause', src._readableState.awaitDrain);
  13371. src._readableState.awaitDrain++;
  13372. increasedAwaitDrain = true;
  13373. }
  13374. src.pause();
  13375. }
  13376. }
  13377. // if the dest has an error, then stop piping into it.
  13378. // however, don't suppress the throwing behavior for this.
  13379. function onerror(er) {
  13380. debug('onerror', er);
  13381. unpipe();
  13382. dest.removeListener('error', onerror);
  13383. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  13384. }
  13385. // Make sure our error handler is attached before userland ones.
  13386. prependListener(dest, 'error', onerror);
  13387. // Both close and finish should trigger unpipe, but only once.
  13388. function onclose() {
  13389. dest.removeListener('finish', onfinish);
  13390. unpipe();
  13391. }
  13392. dest.once('close', onclose);
  13393. function onfinish() {
  13394. debug('onfinish');
  13395. dest.removeListener('close', onclose);
  13396. unpipe();
  13397. }
  13398. dest.once('finish', onfinish);
  13399. function unpipe() {
  13400. debug('unpipe');
  13401. src.unpipe(dest);
  13402. }
  13403. // tell the dest that it's being piped to
  13404. dest.emit('pipe', src);
  13405. // start the flow if it hasn't been started already.
  13406. if (!state.flowing) {
  13407. debug('pipe resume');
  13408. src.resume();
  13409. }
  13410. return dest;
  13411. };
  13412. function pipeOnDrain(src) {
  13413. return function () {
  13414. var state = src._readableState;
  13415. debug('pipeOnDrain', state.awaitDrain);
  13416. if (state.awaitDrain) state.awaitDrain--;
  13417. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  13418. state.flowing = true;
  13419. flow(src);
  13420. }
  13421. };
  13422. }
  13423. Readable.prototype.unpipe = function (dest) {
  13424. var state = this._readableState;
  13425. var unpipeInfo = { hasUnpiped: false };
  13426. // if we're not piping anywhere, then do nothing.
  13427. if (state.pipesCount === 0) return this;
  13428. // just one destination. most common case.
  13429. if (state.pipesCount === 1) {
  13430. // passed in one, but it's not the right one.
  13431. if (dest && dest !== state.pipes) return this;
  13432. if (!dest) dest = state.pipes;
  13433. // got a match.
  13434. state.pipes = null;
  13435. state.pipesCount = 0;
  13436. state.flowing = false;
  13437. if (dest) dest.emit('unpipe', this, unpipeInfo);
  13438. return this;
  13439. }
  13440. // slow case. multiple pipe destinations.
  13441. if (!dest) {
  13442. // remove all.
  13443. var dests = state.pipes;
  13444. var len = state.pipesCount;
  13445. state.pipes = null;
  13446. state.pipesCount = 0;
  13447. state.flowing = false;
  13448. for (var i = 0; i < len; i++) {
  13449. dests[i].emit('unpipe', this, unpipeInfo);
  13450. }return this;
  13451. }
  13452. // try to find the right one.
  13453. var index = indexOf(state.pipes, dest);
  13454. if (index === -1) return this;
  13455. state.pipes.splice(index, 1);
  13456. state.pipesCount -= 1;
  13457. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  13458. dest.emit('unpipe', this, unpipeInfo);
  13459. return this;
  13460. };
  13461. // set up data events if they are asked for
  13462. // Ensure readable listeners eventually get something
  13463. Readable.prototype.on = function (ev, fn) {
  13464. var res = Stream.prototype.on.call(this, ev, fn);
  13465. if (ev === 'data') {
  13466. // Start flowing on next tick if stream isn't explicitly paused
  13467. if (this._readableState.flowing !== false) this.resume();
  13468. } else if (ev === 'readable') {
  13469. var state = this._readableState;
  13470. if (!state.endEmitted && !state.readableListening) {
  13471. state.readableListening = state.needReadable = true;
  13472. state.emittedReadable = false;
  13473. if (!state.reading) {
  13474. pna.nextTick(nReadingNextTick, this);
  13475. } else if (state.length) {
  13476. emitReadable(this);
  13477. }
  13478. }
  13479. }
  13480. return res;
  13481. };
  13482. Readable.prototype.addListener = Readable.prototype.on;
  13483. function nReadingNextTick(self) {
  13484. debug('readable nexttick read 0');
  13485. self.read(0);
  13486. }
  13487. // pause() and resume() are remnants of the legacy readable stream API
  13488. // If the user uses them, then switch into old mode.
  13489. Readable.prototype.resume = function () {
  13490. var state = this._readableState;
  13491. if (!state.flowing) {
  13492. debug('resume');
  13493. state.flowing = true;
  13494. resume(this, state);
  13495. }
  13496. return this;
  13497. };
  13498. function resume(stream, state) {
  13499. if (!state.resumeScheduled) {
  13500. state.resumeScheduled = true;
  13501. pna.nextTick(resume_, stream, state);
  13502. }
  13503. }
  13504. function resume_(stream, state) {
  13505. if (!state.reading) {
  13506. debug('resume read 0');
  13507. stream.read(0);
  13508. }
  13509. state.resumeScheduled = false;
  13510. state.awaitDrain = 0;
  13511. stream.emit('resume');
  13512. flow(stream);
  13513. if (state.flowing && !state.reading) stream.read(0);
  13514. }
  13515. Readable.prototype.pause = function () {
  13516. debug('call pause flowing=%j', this._readableState.flowing);
  13517. if (false !== this._readableState.flowing) {
  13518. debug('pause');
  13519. this._readableState.flowing = false;
  13520. this.emit('pause');
  13521. }
  13522. return this;
  13523. };
  13524. function flow(stream) {
  13525. var state = stream._readableState;
  13526. debug('flow', state.flowing);
  13527. while (state.flowing && stream.read() !== null) {}
  13528. }
  13529. // wrap an old-style stream as the async data source.
  13530. // This is *not* part of the readable stream interface.
  13531. // It is an ugly unfortunate mess of history.
  13532. Readable.prototype.wrap = function (stream) {
  13533. var _this = this;
  13534. var state = this._readableState;
  13535. var paused = false;
  13536. stream.on('end', function () {
  13537. debug('wrapped end');
  13538. if (state.decoder && !state.ended) {
  13539. var chunk = state.decoder.end();
  13540. if (chunk && chunk.length) _this.push(chunk);
  13541. }
  13542. _this.push(null);
  13543. });
  13544. stream.on('data', function (chunk) {
  13545. debug('wrapped data');
  13546. if (state.decoder) chunk = state.decoder.write(chunk);
  13547. // don't skip over falsy values in objectMode
  13548. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  13549. var ret = _this.push(chunk);
  13550. if (!ret) {
  13551. paused = true;
  13552. stream.pause();
  13553. }
  13554. });
  13555. // proxy all the other methods.
  13556. // important when wrapping filters and duplexes.
  13557. for (var i in stream) {
  13558. if (this[i] === undefined && typeof stream[i] === 'function') {
  13559. this[i] = function (method) {
  13560. return function () {
  13561. return stream[method].apply(stream, arguments);
  13562. };
  13563. }(i);
  13564. }
  13565. }
  13566. // proxy certain important events.
  13567. for (var n = 0; n < kProxyEvents.length; n++) {
  13568. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  13569. }
  13570. // when we try to consume some more bytes, simply unpause the
  13571. // underlying stream.
  13572. this._read = function (n) {
  13573. debug('wrapped _read', n);
  13574. if (paused) {
  13575. paused = false;
  13576. stream.resume();
  13577. }
  13578. };
  13579. return this;
  13580. };
  13581. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  13582. // making it explicit this property is not enumerable
  13583. // because otherwise some prototype manipulation in
  13584. // userland will fail
  13585. enumerable: false,
  13586. get: function () {
  13587. return this._readableState.highWaterMark;
  13588. }
  13589. });
  13590. // exposed for testing purposes only.
  13591. Readable._fromList = fromList;
  13592. // Pluck off n bytes from an array of buffers.
  13593. // Length is the combined lengths of all the buffers in the list.
  13594. // This function is designed to be inlinable, so please take care when making
  13595. // changes to the function body.
  13596. function fromList(n, state) {
  13597. // nothing buffered
  13598. if (state.length === 0) return null;
  13599. var ret;
  13600. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  13601. // read it all, truncate the list
  13602. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  13603. state.buffer.clear();
  13604. } else {
  13605. // read part of list
  13606. ret = fromListPartial(n, state.buffer, state.decoder);
  13607. }
  13608. return ret;
  13609. }
  13610. // Extracts only enough buffered data to satisfy the amount requested.
  13611. // This function is designed to be inlinable, so please take care when making
  13612. // changes to the function body.
  13613. function fromListPartial(n, list, hasStrings) {
  13614. var ret;
  13615. if (n < list.head.data.length) {
  13616. // slice is the same for buffers and strings
  13617. ret = list.head.data.slice(0, n);
  13618. list.head.data = list.head.data.slice(n);
  13619. } else if (n === list.head.data.length) {
  13620. // first chunk is a perfect match
  13621. ret = list.shift();
  13622. } else {
  13623. // result spans more than one buffer
  13624. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  13625. }
  13626. return ret;
  13627. }
  13628. // Copies a specified amount of characters from the list of buffered data
  13629. // chunks.
  13630. // This function is designed to be inlinable, so please take care when making
  13631. // changes to the function body.
  13632. function copyFromBufferString(n, list) {
  13633. var p = list.head;
  13634. var c = 1;
  13635. var ret = p.data;
  13636. n -= ret.length;
  13637. while (p = p.next) {
  13638. var str = p.data;
  13639. var nb = n > str.length ? str.length : n;
  13640. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  13641. n -= nb;
  13642. if (n === 0) {
  13643. if (nb === str.length) {
  13644. ++c;
  13645. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13646. } else {
  13647. list.head = p;
  13648. p.data = str.slice(nb);
  13649. }
  13650. break;
  13651. }
  13652. ++c;
  13653. }
  13654. list.length -= c;
  13655. return ret;
  13656. }
  13657. // Copies a specified amount of bytes from the list of buffered data chunks.
  13658. // This function is designed to be inlinable, so please take care when making
  13659. // changes to the function body.
  13660. function copyFromBuffer(n, list) {
  13661. var ret = Buffer.allocUnsafe(n);
  13662. var p = list.head;
  13663. var c = 1;
  13664. p.data.copy(ret);
  13665. n -= p.data.length;
  13666. while (p = p.next) {
  13667. var buf = p.data;
  13668. var nb = n > buf.length ? buf.length : n;
  13669. buf.copy(ret, ret.length - n, 0, nb);
  13670. n -= nb;
  13671. if (n === 0) {
  13672. if (nb === buf.length) {
  13673. ++c;
  13674. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13675. } else {
  13676. list.head = p;
  13677. p.data = buf.slice(nb);
  13678. }
  13679. break;
  13680. }
  13681. ++c;
  13682. }
  13683. list.length -= c;
  13684. return ret;
  13685. }
  13686. function endReadable(stream) {
  13687. var state = stream._readableState;
  13688. // If we get here before consuming all the bytes, then that is a
  13689. // bug in node. Should never happen.
  13690. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  13691. if (!state.endEmitted) {
  13692. state.ended = true;
  13693. pna.nextTick(endReadableNT, state, stream);
  13694. }
  13695. }
  13696. function endReadableNT(state, stream) {
  13697. // Check that we didn't get one last unshift.
  13698. if (!state.endEmitted && state.length === 0) {
  13699. state.endEmitted = true;
  13700. stream.readable = false;
  13701. stream.emit('end');
  13702. }
  13703. }
  13704. function indexOf(xs, x) {
  13705. for (var i = 0, l = xs.length; i < l; i++) {
  13706. if (xs[i] === x) return i;
  13707. }
  13708. return -1;
  13709. }
  13710. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 80)))
  13711. /***/ }),
  13712. /* 93 */
  13713. /*!****************************************************!*\
  13714. !*** ./node_modules/process-nextick-args/index.js ***!
  13715. \****************************************************/
  13716. /*! no static exports found */
  13717. /***/ (function(module, exports, __webpack_require__) {
  13718. "use strict";
  13719. /* WEBPACK VAR INJECTION */(function(process) {
  13720. if (typeof process === 'undefined' ||
  13721. !process.version ||
  13722. process.version.indexOf('v0.') === 0 ||
  13723. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  13724. module.exports = { nextTick: nextTick };
  13725. } else {
  13726. module.exports = process
  13727. }
  13728. function nextTick(fn, arg1, arg2, arg3) {
  13729. if (typeof fn !== 'function') {
  13730. throw new TypeError('"callback" argument must be a function');
  13731. }
  13732. var len = arguments.length;
  13733. var args, i;
  13734. switch (len) {
  13735. case 0:
  13736. case 1:
  13737. return process.nextTick(fn);
  13738. case 2:
  13739. return process.nextTick(function afterTickOne() {
  13740. fn.call(null, arg1);
  13741. });
  13742. case 3:
  13743. return process.nextTick(function afterTickTwo() {
  13744. fn.call(null, arg1, arg2);
  13745. });
  13746. case 4:
  13747. return process.nextTick(function afterTickThree() {
  13748. fn.call(null, arg1, arg2, arg3);
  13749. });
  13750. default:
  13751. args = new Array(len - 1);
  13752. i = 0;
  13753. while (i < args.length) {
  13754. args[i++] = arguments[i];
  13755. }
  13756. return process.nextTick(function afterTick() {
  13757. fn.apply(null, args);
  13758. });
  13759. }
  13760. }
  13761. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 80)))
  13762. /***/ }),
  13763. /* 94 */
  13764. /*!***************************************!*\
  13765. !*** ./node_modules/events/events.js ***!
  13766. \***************************************/
  13767. /*! no static exports found */
  13768. /***/ (function(module, exports, __webpack_require__) {
  13769. "use strict";
  13770. // Copyright Joyent, Inc. and other Node contributors.
  13771. //
  13772. // Permission is hereby granted, free of charge, to any person obtaining a
  13773. // copy of this software and associated documentation files (the
  13774. // "Software"), to deal in the Software without restriction, including
  13775. // without limitation the rights to use, copy, modify, merge, publish,
  13776. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13777. // persons to whom the Software is furnished to do so, subject to the
  13778. // following conditions:
  13779. //
  13780. // The above copyright notice and this permission notice shall be included
  13781. // in all copies or substantial portions of the Software.
  13782. //
  13783. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13784. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13785. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13786. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13787. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13788. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13789. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13790. var R = typeof Reflect === 'object' ? Reflect : null
  13791. var ReflectApply = R && typeof R.apply === 'function'
  13792. ? R.apply
  13793. : function ReflectApply(target, receiver, args) {
  13794. return Function.prototype.apply.call(target, receiver, args);
  13795. }
  13796. var ReflectOwnKeys
  13797. if (R && typeof R.ownKeys === 'function') {
  13798. ReflectOwnKeys = R.ownKeys
  13799. } else if (Object.getOwnPropertySymbols) {
  13800. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13801. return Object.getOwnPropertyNames(target)
  13802. .concat(Object.getOwnPropertySymbols(target));
  13803. };
  13804. } else {
  13805. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13806. return Object.getOwnPropertyNames(target);
  13807. };
  13808. }
  13809. function ProcessEmitWarning(warning) {
  13810. if (console && console.warn) console.warn(warning);
  13811. }
  13812. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  13813. return value !== value;
  13814. }
  13815. function EventEmitter() {
  13816. EventEmitter.init.call(this);
  13817. }
  13818. module.exports = EventEmitter;
  13819. // Backwards-compat with node 0.10.x
  13820. EventEmitter.EventEmitter = EventEmitter;
  13821. EventEmitter.prototype._events = undefined;
  13822. EventEmitter.prototype._eventsCount = 0;
  13823. EventEmitter.prototype._maxListeners = undefined;
  13824. // By default EventEmitters will print a warning if more than 10 listeners are
  13825. // added to it. This is a useful default which helps finding memory leaks.
  13826. var defaultMaxListeners = 10;
  13827. function checkListener(listener) {
  13828. if (typeof listener !== 'function') {
  13829. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  13830. }
  13831. }
  13832. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  13833. enumerable: true,
  13834. get: function() {
  13835. return defaultMaxListeners;
  13836. },
  13837. set: function(arg) {
  13838. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  13839. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  13840. }
  13841. defaultMaxListeners = arg;
  13842. }
  13843. });
  13844. EventEmitter.init = function() {
  13845. if (this._events === undefined ||
  13846. this._events === Object.getPrototypeOf(this)._events) {
  13847. this._events = Object.create(null);
  13848. this._eventsCount = 0;
  13849. }
  13850. this._maxListeners = this._maxListeners || undefined;
  13851. };
  13852. // Obviously not all Emitters should be limited to 10. This function allows
  13853. // that to be increased. Set to zero for unlimited.
  13854. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  13855. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  13856. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  13857. }
  13858. this._maxListeners = n;
  13859. return this;
  13860. };
  13861. function _getMaxListeners(that) {
  13862. if (that._maxListeners === undefined)
  13863. return EventEmitter.defaultMaxListeners;
  13864. return that._maxListeners;
  13865. }
  13866. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  13867. return _getMaxListeners(this);
  13868. };
  13869. EventEmitter.prototype.emit = function emit(type) {
  13870. var args = [];
  13871. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  13872. var doError = (type === 'error');
  13873. var events = this._events;
  13874. if (events !== undefined)
  13875. doError = (doError && events.error === undefined);
  13876. else if (!doError)
  13877. return false;
  13878. // If there is no 'error' event listener then throw.
  13879. if (doError) {
  13880. var er;
  13881. if (args.length > 0)
  13882. er = args[0];
  13883. if (er instanceof Error) {
  13884. // Note: The comments on the `throw` lines are intentional, they show
  13885. // up in Node's output if this results in an unhandled exception.
  13886. throw er; // Unhandled 'error' event
  13887. }
  13888. // At least give some kind of context to the user
  13889. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  13890. err.context = er;
  13891. throw err; // Unhandled 'error' event
  13892. }
  13893. var handler = events[type];
  13894. if (handler === undefined)
  13895. return false;
  13896. if (typeof handler === 'function') {
  13897. ReflectApply(handler, this, args);
  13898. } else {
  13899. var len = handler.length;
  13900. var listeners = arrayClone(handler, len);
  13901. for (var i = 0; i < len; ++i)
  13902. ReflectApply(listeners[i], this, args);
  13903. }
  13904. return true;
  13905. };
  13906. function _addListener(target, type, listener, prepend) {
  13907. var m;
  13908. var events;
  13909. var existing;
  13910. checkListener(listener);
  13911. events = target._events;
  13912. if (events === undefined) {
  13913. events = target._events = Object.create(null);
  13914. target._eventsCount = 0;
  13915. } else {
  13916. // To avoid recursion in the case that type === "newListener"! Before
  13917. // adding it to the listeners, first emit "newListener".
  13918. if (events.newListener !== undefined) {
  13919. target.emit('newListener', type,
  13920. listener.listener ? listener.listener : listener);
  13921. // Re-assign `events` because a newListener handler could have caused the
  13922. // this._events to be assigned to a new object
  13923. events = target._events;
  13924. }
  13925. existing = events[type];
  13926. }
  13927. if (existing === undefined) {
  13928. // Optimize the case of one listener. Don't need the extra array object.
  13929. existing = events[type] = listener;
  13930. ++target._eventsCount;
  13931. } else {
  13932. if (typeof existing === 'function') {
  13933. // Adding the second element, need to change to array.
  13934. existing = events[type] =
  13935. prepend ? [listener, existing] : [existing, listener];
  13936. // If we've already got an array, just append.
  13937. } else if (prepend) {
  13938. existing.unshift(listener);
  13939. } else {
  13940. existing.push(listener);
  13941. }
  13942. // Check for listener leak
  13943. m = _getMaxListeners(target);
  13944. if (m > 0 && existing.length > m && !existing.warned) {
  13945. existing.warned = true;
  13946. // No error code for this since it is a Warning
  13947. // eslint-disable-next-line no-restricted-syntax
  13948. var w = new Error('Possible EventEmitter memory leak detected. ' +
  13949. existing.length + ' ' + String(type) + ' listeners ' +
  13950. 'added. Use emitter.setMaxListeners() to ' +
  13951. 'increase limit');
  13952. w.name = 'MaxListenersExceededWarning';
  13953. w.emitter = target;
  13954. w.type = type;
  13955. w.count = existing.length;
  13956. ProcessEmitWarning(w);
  13957. }
  13958. }
  13959. return target;
  13960. }
  13961. EventEmitter.prototype.addListener = function addListener(type, listener) {
  13962. return _addListener(this, type, listener, false);
  13963. };
  13964. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  13965. EventEmitter.prototype.prependListener =
  13966. function prependListener(type, listener) {
  13967. return _addListener(this, type, listener, true);
  13968. };
  13969. function onceWrapper() {
  13970. if (!this.fired) {
  13971. this.target.removeListener(this.type, this.wrapFn);
  13972. this.fired = true;
  13973. if (arguments.length === 0)
  13974. return this.listener.call(this.target);
  13975. return this.listener.apply(this.target, arguments);
  13976. }
  13977. }
  13978. function _onceWrap(target, type, listener) {
  13979. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  13980. var wrapped = onceWrapper.bind(state);
  13981. wrapped.listener = listener;
  13982. state.wrapFn = wrapped;
  13983. return wrapped;
  13984. }
  13985. EventEmitter.prototype.once = function once(type, listener) {
  13986. checkListener(listener);
  13987. this.on(type, _onceWrap(this, type, listener));
  13988. return this;
  13989. };
  13990. EventEmitter.prototype.prependOnceListener =
  13991. function prependOnceListener(type, listener) {
  13992. checkListener(listener);
  13993. this.prependListener(type, _onceWrap(this, type, listener));
  13994. return this;
  13995. };
  13996. // Emits a 'removeListener' event if and only if the listener was removed.
  13997. EventEmitter.prototype.removeListener =
  13998. function removeListener(type, listener) {
  13999. var list, events, position, i, originalListener;
  14000. checkListener(listener);
  14001. events = this._events;
  14002. if (events === undefined)
  14003. return this;
  14004. list = events[type];
  14005. if (list === undefined)
  14006. return this;
  14007. if (list === listener || list.listener === listener) {
  14008. if (--this._eventsCount === 0)
  14009. this._events = Object.create(null);
  14010. else {
  14011. delete events[type];
  14012. if (events.removeListener)
  14013. this.emit('removeListener', type, list.listener || listener);
  14014. }
  14015. } else if (typeof list !== 'function') {
  14016. position = -1;
  14017. for (i = list.length - 1; i >= 0; i--) {
  14018. if (list[i] === listener || list[i].listener === listener) {
  14019. originalListener = list[i].listener;
  14020. position = i;
  14021. break;
  14022. }
  14023. }
  14024. if (position < 0)
  14025. return this;
  14026. if (position === 0)
  14027. list.shift();
  14028. else {
  14029. spliceOne(list, position);
  14030. }
  14031. if (list.length === 1)
  14032. events[type] = list[0];
  14033. if (events.removeListener !== undefined)
  14034. this.emit('removeListener', type, originalListener || listener);
  14035. }
  14036. return this;
  14037. };
  14038. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  14039. EventEmitter.prototype.removeAllListeners =
  14040. function removeAllListeners(type) {
  14041. var listeners, events, i;
  14042. events = this._events;
  14043. if (events === undefined)
  14044. return this;
  14045. // not listening for removeListener, no need to emit
  14046. if (events.removeListener === undefined) {
  14047. if (arguments.length === 0) {
  14048. this._events = Object.create(null);
  14049. this._eventsCount = 0;
  14050. } else if (events[type] !== undefined) {
  14051. if (--this._eventsCount === 0)
  14052. this._events = Object.create(null);
  14053. else
  14054. delete events[type];
  14055. }
  14056. return this;
  14057. }
  14058. // emit removeListener for all listeners on all events
  14059. if (arguments.length === 0) {
  14060. var keys = Object.keys(events);
  14061. var key;
  14062. for (i = 0; i < keys.length; ++i) {
  14063. key = keys[i];
  14064. if (key === 'removeListener') continue;
  14065. this.removeAllListeners(key);
  14066. }
  14067. this.removeAllListeners('removeListener');
  14068. this._events = Object.create(null);
  14069. this._eventsCount = 0;
  14070. return this;
  14071. }
  14072. listeners = events[type];
  14073. if (typeof listeners === 'function') {
  14074. this.removeListener(type, listeners);
  14075. } else if (listeners !== undefined) {
  14076. // LIFO order
  14077. for (i = listeners.length - 1; i >= 0; i--) {
  14078. this.removeListener(type, listeners[i]);
  14079. }
  14080. }
  14081. return this;
  14082. };
  14083. function _listeners(target, type, unwrap) {
  14084. var events = target._events;
  14085. if (events === undefined)
  14086. return [];
  14087. var evlistener = events[type];
  14088. if (evlistener === undefined)
  14089. return [];
  14090. if (typeof evlistener === 'function')
  14091. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  14092. return unwrap ?
  14093. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  14094. }
  14095. EventEmitter.prototype.listeners = function listeners(type) {
  14096. return _listeners(this, type, true);
  14097. };
  14098. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  14099. return _listeners(this, type, false);
  14100. };
  14101. EventEmitter.listenerCount = function(emitter, type) {
  14102. if (typeof emitter.listenerCount === 'function') {
  14103. return emitter.listenerCount(type);
  14104. } else {
  14105. return listenerCount.call(emitter, type);
  14106. }
  14107. };
  14108. EventEmitter.prototype.listenerCount = listenerCount;
  14109. function listenerCount(type) {
  14110. var events = this._events;
  14111. if (events !== undefined) {
  14112. var evlistener = events[type];
  14113. if (typeof evlistener === 'function') {
  14114. return 1;
  14115. } else if (evlistener !== undefined) {
  14116. return evlistener.length;
  14117. }
  14118. }
  14119. return 0;
  14120. }
  14121. EventEmitter.prototype.eventNames = function eventNames() {
  14122. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  14123. };
  14124. function arrayClone(arr, n) {
  14125. var copy = new Array(n);
  14126. for (var i = 0; i < n; ++i)
  14127. copy[i] = arr[i];
  14128. return copy;
  14129. }
  14130. function spliceOne(list, index) {
  14131. for (; index + 1 < list.length; index++)
  14132. list[index] = list[index + 1];
  14133. list.pop();
  14134. }
  14135. function unwrapListeners(arr) {
  14136. var ret = new Array(arr.length);
  14137. for (var i = 0; i < ret.length; ++i) {
  14138. ret[i] = arr[i].listener || arr[i];
  14139. }
  14140. return ret;
  14141. }
  14142. /***/ }),
  14143. /* 95 */
  14144. /*!*****************************************************************************!*\
  14145. !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  14146. \*****************************************************************************/
  14147. /*! no static exports found */
  14148. /***/ (function(module, exports, __webpack_require__) {
  14149. module.exports = __webpack_require__(/*! events */ 94).EventEmitter;
  14150. /***/ }),
  14151. /* 96 */
  14152. /*!***********************************************!*\
  14153. !*** ./node_modules/core-util-is/lib/util.js ***!
  14154. \***********************************************/
  14155. /*! no static exports found */
  14156. /***/ (function(module, exports, __webpack_require__) {
  14157. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  14158. //
  14159. // Permission is hereby granted, free of charge, to any person obtaining a
  14160. // copy of this software and associated documentation files (the
  14161. // "Software"), to deal in the Software without restriction, including
  14162. // without limitation the rights to use, copy, modify, merge, publish,
  14163. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14164. // persons to whom the Software is furnished to do so, subject to the
  14165. // following conditions:
  14166. //
  14167. // The above copyright notice and this permission notice shall be included
  14168. // in all copies or substantial portions of the Software.
  14169. //
  14170. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14171. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14172. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14173. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14174. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14175. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14176. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14177. // NOTE: These type checking functions intentionally don't use `instanceof`
  14178. // because it is fragile and can be easily faked with `Object.create()`.
  14179. function isArray(arg) {
  14180. if (Array.isArray) {
  14181. return Array.isArray(arg);
  14182. }
  14183. return objectToString(arg) === '[object Array]';
  14184. }
  14185. exports.isArray = isArray;
  14186. function isBoolean(arg) {
  14187. return typeof arg === 'boolean';
  14188. }
  14189. exports.isBoolean = isBoolean;
  14190. function isNull(arg) {
  14191. return arg === null;
  14192. }
  14193. exports.isNull = isNull;
  14194. function isNullOrUndefined(arg) {
  14195. return arg == null;
  14196. }
  14197. exports.isNullOrUndefined = isNullOrUndefined;
  14198. function isNumber(arg) {
  14199. return typeof arg === 'number';
  14200. }
  14201. exports.isNumber = isNumber;
  14202. function isString(arg) {
  14203. return typeof arg === 'string';
  14204. }
  14205. exports.isString = isString;
  14206. function isSymbol(arg) {
  14207. return typeof arg === 'symbol';
  14208. }
  14209. exports.isSymbol = isSymbol;
  14210. function isUndefined(arg) {
  14211. return arg === void 0;
  14212. }
  14213. exports.isUndefined = isUndefined;
  14214. function isRegExp(re) {
  14215. return objectToString(re) === '[object RegExp]';
  14216. }
  14217. exports.isRegExp = isRegExp;
  14218. function isObject(arg) {
  14219. return typeof arg === 'object' && arg !== null;
  14220. }
  14221. exports.isObject = isObject;
  14222. function isDate(d) {
  14223. return objectToString(d) === '[object Date]';
  14224. }
  14225. exports.isDate = isDate;
  14226. function isError(e) {
  14227. return (objectToString(e) === '[object Error]' || e instanceof Error);
  14228. }
  14229. exports.isError = isError;
  14230. function isFunction(arg) {
  14231. return typeof arg === 'function';
  14232. }
  14233. exports.isFunction = isFunction;
  14234. function isPrimitive(arg) {
  14235. return arg === null ||
  14236. typeof arg === 'boolean' ||
  14237. typeof arg === 'number' ||
  14238. typeof arg === 'string' ||
  14239. typeof arg === 'symbol' || // ES6 symbol
  14240. typeof arg === 'undefined';
  14241. }
  14242. exports.isPrimitive = isPrimitive;
  14243. exports.isBuffer = Buffer.isBuffer;
  14244. function objectToString(o) {
  14245. return Object.prototype.toString.call(o);
  14246. }
  14247. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 83).Buffer))
  14248. /***/ }),
  14249. /* 97 */
  14250. /*!**********************!*\
  14251. !*** util (ignored) ***!
  14252. \**********************/
  14253. /*! no static exports found */
  14254. /***/ (function(module, exports) {
  14255. /* (ignored) */
  14256. /***/ }),
  14257. /* 98 */
  14258. /*!*************************************************************************!*\
  14259. !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
  14260. \*************************************************************************/
  14261. /*! no static exports found */
  14262. /***/ (function(module, exports, __webpack_require__) {
  14263. "use strict";
  14264. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14265. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer;
  14266. var util = __webpack_require__(/*! util */ 99);
  14267. function copyBuffer(src, target, offset) {
  14268. src.copy(target, offset);
  14269. }
  14270. module.exports = function () {
  14271. function BufferList() {
  14272. _classCallCheck(this, BufferList);
  14273. this.head = null;
  14274. this.tail = null;
  14275. this.length = 0;
  14276. }
  14277. BufferList.prototype.push = function push(v) {
  14278. var entry = { data: v, next: null };
  14279. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  14280. this.tail = entry;
  14281. ++this.length;
  14282. };
  14283. BufferList.prototype.unshift = function unshift(v) {
  14284. var entry = { data: v, next: this.head };
  14285. if (this.length === 0) this.tail = entry;
  14286. this.head = entry;
  14287. ++this.length;
  14288. };
  14289. BufferList.prototype.shift = function shift() {
  14290. if (this.length === 0) return;
  14291. var ret = this.head.data;
  14292. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  14293. --this.length;
  14294. return ret;
  14295. };
  14296. BufferList.prototype.clear = function clear() {
  14297. this.head = this.tail = null;
  14298. this.length = 0;
  14299. };
  14300. BufferList.prototype.join = function join(s) {
  14301. if (this.length === 0) return '';
  14302. var p = this.head;
  14303. var ret = '' + p.data;
  14304. while (p = p.next) {
  14305. ret += s + p.data;
  14306. }return ret;
  14307. };
  14308. BufferList.prototype.concat = function concat(n) {
  14309. if (this.length === 0) return Buffer.alloc(0);
  14310. if (this.length === 1) return this.head.data;
  14311. var ret = Buffer.allocUnsafe(n >>> 0);
  14312. var p = this.head;
  14313. var i = 0;
  14314. while (p) {
  14315. copyBuffer(p.data, ret, i);
  14316. i += p.data.length;
  14317. p = p.next;
  14318. }
  14319. return ret;
  14320. };
  14321. return BufferList;
  14322. }();
  14323. if (util && util.inspect && util.inspect.custom) {
  14324. module.exports.prototype[util.inspect.custom] = function () {
  14325. var obj = util.inspect({ length: this.length });
  14326. return this.constructor.name + ' ' + obj;
  14327. };
  14328. }
  14329. /***/ }),
  14330. /* 99 */
  14331. /*!**********************!*\
  14332. !*** util (ignored) ***!
  14333. \**********************/
  14334. /*! no static exports found */
  14335. /***/ (function(module, exports) {
  14336. /* (ignored) */
  14337. /***/ }),
  14338. /* 100 */
  14339. /*!**********************************************************************!*\
  14340. !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  14341. \**********************************************************************/
  14342. /*! no static exports found */
  14343. /***/ (function(module, exports, __webpack_require__) {
  14344. "use strict";
  14345. /*<replacement>*/
  14346. var pna = __webpack_require__(/*! process-nextick-args */ 93);
  14347. /*</replacement>*/
  14348. // undocumented cb() API, needed for core, not for public API
  14349. function destroy(err, cb) {
  14350. var _this = this;
  14351. var readableDestroyed = this._readableState && this._readableState.destroyed;
  14352. var writableDestroyed = this._writableState && this._writableState.destroyed;
  14353. if (readableDestroyed || writableDestroyed) {
  14354. if (cb) {
  14355. cb(err);
  14356. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  14357. pna.nextTick(emitErrorNT, this, err);
  14358. }
  14359. return this;
  14360. }
  14361. // we set destroyed to true before firing error callbacks in order
  14362. // to make it re-entrance safe in case destroy() is called within callbacks
  14363. if (this._readableState) {
  14364. this._readableState.destroyed = true;
  14365. }
  14366. // if this is a duplex stream mark the writable part as destroyed as well
  14367. if (this._writableState) {
  14368. this._writableState.destroyed = true;
  14369. }
  14370. this._destroy(err || null, function (err) {
  14371. if (!cb && err) {
  14372. pna.nextTick(emitErrorNT, _this, err);
  14373. if (_this._writableState) {
  14374. _this._writableState.errorEmitted = true;
  14375. }
  14376. } else if (cb) {
  14377. cb(err);
  14378. }
  14379. });
  14380. return this;
  14381. }
  14382. function undestroy() {
  14383. if (this._readableState) {
  14384. this._readableState.destroyed = false;
  14385. this._readableState.reading = false;
  14386. this._readableState.ended = false;
  14387. this._readableState.endEmitted = false;
  14388. }
  14389. if (this._writableState) {
  14390. this._writableState.destroyed = false;
  14391. this._writableState.ended = false;
  14392. this._writableState.ending = false;
  14393. this._writableState.finished = false;
  14394. this._writableState.errorEmitted = false;
  14395. }
  14396. }
  14397. function emitErrorNT(self, err) {
  14398. self.emit('error', err);
  14399. }
  14400. module.exports = {
  14401. destroy: destroy,
  14402. undestroy: undestroy
  14403. };
  14404. /***/ }),
  14405. /* 101 */
  14406. /*!************************************************************!*\
  14407. !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
  14408. \************************************************************/
  14409. /*! no static exports found */
  14410. /***/ (function(module, exports, __webpack_require__) {
  14411. "use strict";
  14412. // Copyright Joyent, Inc. and other Node contributors.
  14413. //
  14414. // Permission is hereby granted, free of charge, to any person obtaining a
  14415. // copy of this software and associated documentation files (the
  14416. // "Software"), to deal in the Software without restriction, including
  14417. // without limitation the rights to use, copy, modify, merge, publish,
  14418. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14419. // persons to whom the Software is furnished to do so, subject to the
  14420. // following conditions:
  14421. //
  14422. // The above copyright notice and this permission notice shall be included
  14423. // in all copies or substantial portions of the Software.
  14424. //
  14425. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14426. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14427. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14428. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14429. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14430. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14431. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14432. // a duplex stream is just a stream that is both readable and writable.
  14433. // Since JS doesn't have multiple prototypal inheritance, this class
  14434. // prototypally inherits from Readable, and then parasitically from
  14435. // Writable.
  14436. /*<replacement>*/
  14437. var pna = __webpack_require__(/*! process-nextick-args */ 93);
  14438. /*</replacement>*/
  14439. /*<replacement>*/
  14440. var objectKeys = Object.keys || function (obj) {
  14441. var keys = [];
  14442. for (var key in obj) {
  14443. keys.push(key);
  14444. }return keys;
  14445. };
  14446. /*</replacement>*/
  14447. module.exports = Duplex;
  14448. /*<replacement>*/
  14449. var util = Object.create(__webpack_require__(/*! core-util-is */ 96));
  14450. util.inherits = __webpack_require__(/*! inherits */ 88);
  14451. /*</replacement>*/
  14452. var Readable = __webpack_require__(/*! ./_stream_readable */ 92);
  14453. var Writable = __webpack_require__(/*! ./_stream_writable */ 102);
  14454. util.inherits(Duplex, Readable);
  14455. {
  14456. // avoid scope creep, the keys array can then be collected
  14457. var keys = objectKeys(Writable.prototype);
  14458. for (var v = 0; v < keys.length; v++) {
  14459. var method = keys[v];
  14460. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  14461. }
  14462. }
  14463. function Duplex(options) {
  14464. if (!(this instanceof Duplex)) return new Duplex(options);
  14465. Readable.call(this, options);
  14466. Writable.call(this, options);
  14467. if (options && options.readable === false) this.readable = false;
  14468. if (options && options.writable === false) this.writable = false;
  14469. this.allowHalfOpen = true;
  14470. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  14471. this.once('end', onend);
  14472. }
  14473. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  14474. // making it explicit this property is not enumerable
  14475. // because otherwise some prototype manipulation in
  14476. // userland will fail
  14477. enumerable: false,
  14478. get: function () {
  14479. return this._writableState.highWaterMark;
  14480. }
  14481. });
  14482. // the no-half-open enforcer
  14483. function onend() {
  14484. // if we allow half-open state, or if the writable side ended,
  14485. // then we're ok.
  14486. if (this.allowHalfOpen || this._writableState.ended) return;
  14487. // no more data can be written.
  14488. // But allow more writes to happen in this tick.
  14489. pna.nextTick(onEndNT, this);
  14490. }
  14491. function onEndNT(self) {
  14492. self.end();
  14493. }
  14494. Object.defineProperty(Duplex.prototype, 'destroyed', {
  14495. get: function () {
  14496. if (this._readableState === undefined || this._writableState === undefined) {
  14497. return false;
  14498. }
  14499. return this._readableState.destroyed && this._writableState.destroyed;
  14500. },
  14501. set: function (value) {
  14502. // we ignore the value if the stream
  14503. // has not been initialized yet
  14504. if (this._readableState === undefined || this._writableState === undefined) {
  14505. return;
  14506. }
  14507. // backward compatibility, the user is explicitly
  14508. // managing destroyed
  14509. this._readableState.destroyed = value;
  14510. this._writableState.destroyed = value;
  14511. }
  14512. });
  14513. Duplex.prototype._destroy = function (err, cb) {
  14514. this.push(null);
  14515. this.end();
  14516. pna.nextTick(cb, err);
  14517. };
  14518. /***/ }),
  14519. /* 102 */
  14520. /*!**************************************************************!*\
  14521. !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
  14522. \**************************************************************/
  14523. /*! no static exports found */
  14524. /***/ (function(module, exports, __webpack_require__) {
  14525. "use strict";
  14526. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  14527. //
  14528. // Permission is hereby granted, free of charge, to any person obtaining a
  14529. // copy of this software and associated documentation files (the
  14530. // "Software"), to deal in the Software without restriction, including
  14531. // without limitation the rights to use, copy, modify, merge, publish,
  14532. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14533. // persons to whom the Software is furnished to do so, subject to the
  14534. // following conditions:
  14535. //
  14536. // The above copyright notice and this permission notice shall be included
  14537. // in all copies or substantial portions of the Software.
  14538. //
  14539. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14540. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14541. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14542. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14543. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14544. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14545. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14546. // A bit simpler than readable streams.
  14547. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  14548. // the drain event emission and buffering.
  14549. /*<replacement>*/
  14550. var pna = __webpack_require__(/*! process-nextick-args */ 93);
  14551. /*</replacement>*/
  14552. module.exports = Writable;
  14553. /* <replacement> */
  14554. function WriteReq(chunk, encoding, cb) {
  14555. this.chunk = chunk;
  14556. this.encoding = encoding;
  14557. this.callback = cb;
  14558. this.next = null;
  14559. }
  14560. // It seems a linked list but it is not
  14561. // there will be only 2 of these for each stream
  14562. function CorkedRequest(state) {
  14563. var _this = this;
  14564. this.next = null;
  14565. this.entry = null;
  14566. this.finish = function () {
  14567. onCorkedFinish(_this, state);
  14568. };
  14569. }
  14570. /* </replacement> */
  14571. /*<replacement>*/
  14572. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  14573. /*</replacement>*/
  14574. /*<replacement>*/
  14575. var Duplex;
  14576. /*</replacement>*/
  14577. Writable.WritableState = WritableState;
  14578. /*<replacement>*/
  14579. var util = Object.create(__webpack_require__(/*! core-util-is */ 96));
  14580. util.inherits = __webpack_require__(/*! inherits */ 88);
  14581. /*</replacement>*/
  14582. /*<replacement>*/
  14583. var internalUtil = {
  14584. deprecate: __webpack_require__(/*! util-deprecate */ 103)
  14585. };
  14586. /*</replacement>*/
  14587. /*<replacement>*/
  14588. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 95);
  14589. /*</replacement>*/
  14590. /*<replacement>*/
  14591. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer;
  14592. var OurUint8Array = global.Uint8Array || function () {};
  14593. function _uint8ArrayToBuffer(chunk) {
  14594. return Buffer.from(chunk);
  14595. }
  14596. function _isUint8Array(obj) {
  14597. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  14598. }
  14599. /*</replacement>*/
  14600. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 100);
  14601. util.inherits(Writable, Stream);
  14602. function nop() {}
  14603. function WritableState(options, stream) {
  14604. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 101);
  14605. options = options || {};
  14606. // Duplex streams are both readable and writable, but share
  14607. // the same options object.
  14608. // However, some cases require setting options to different
  14609. // values for the readable and the writable sides of the duplex stream.
  14610. // These options can be provided separately as readableXXX and writableXXX.
  14611. var isDuplex = stream instanceof Duplex;
  14612. // object stream flag to indicate whether or not this stream
  14613. // contains buffers or objects.
  14614. this.objectMode = !!options.objectMode;
  14615. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  14616. // the point at which write() starts returning false
  14617. // Note: 0 is a valid value, means that we always return false if
  14618. // the entire buffer is not flushed immediately on write()
  14619. var hwm = options.highWaterMark;
  14620. var writableHwm = options.writableHighWaterMark;
  14621. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  14622. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  14623. // cast to ints.
  14624. this.highWaterMark = Math.floor(this.highWaterMark);
  14625. // if _final has been called
  14626. this.finalCalled = false;
  14627. // drain event flag.
  14628. this.needDrain = false;
  14629. // at the start of calling end()
  14630. this.ending = false;
  14631. // when end() has been called, and returned
  14632. this.ended = false;
  14633. // when 'finish' is emitted
  14634. this.finished = false;
  14635. // has it been destroyed
  14636. this.destroyed = false;
  14637. // should we decode strings into buffers before passing to _write?
  14638. // this is here so that some node-core streams can optimize string
  14639. // handling at a lower level.
  14640. var noDecode = options.decodeStrings === false;
  14641. this.decodeStrings = !noDecode;
  14642. // Crypto is kind of old and crusty. Historically, its default string
  14643. // encoding is 'binary' so we have to make this configurable.
  14644. // Everything else in the universe uses 'utf8', though.
  14645. this.defaultEncoding = options.defaultEncoding || 'utf8';
  14646. // not an actual buffer we keep track of, but a measurement
  14647. // of how much we're waiting to get pushed to some underlying
  14648. // socket or file.
  14649. this.length = 0;
  14650. // a flag to see when we're in the middle of a write.
  14651. this.writing = false;
  14652. // when true all writes will be buffered until .uncork() call
  14653. this.corked = 0;
  14654. // a flag to be able to tell if the onwrite cb is called immediately,
  14655. // or on a later tick. We set this to true at first, because any
  14656. // actions that shouldn't happen until "later" should generally also
  14657. // not happen before the first write call.
  14658. this.sync = true;
  14659. // a flag to know if we're processing previously buffered items, which
  14660. // may call the _write() callback in the same tick, so that we don't
  14661. // end up in an overlapped onwrite situation.
  14662. this.bufferProcessing = false;
  14663. // the callback that's passed to _write(chunk,cb)
  14664. this.onwrite = function (er) {
  14665. onwrite(stream, er);
  14666. };
  14667. // the callback that the user supplies to write(chunk,encoding,cb)
  14668. this.writecb = null;
  14669. // the amount that is being written when _write is called.
  14670. this.writelen = 0;
  14671. this.bufferedRequest = null;
  14672. this.lastBufferedRequest = null;
  14673. // number of pending user-supplied write callbacks
  14674. // this must be 0 before 'finish' can be emitted
  14675. this.pendingcb = 0;
  14676. // emit prefinish if the only thing we're waiting for is _write cbs
  14677. // This is relevant for synchronous Transform streams
  14678. this.prefinished = false;
  14679. // True if the error was already emitted and should not be thrown again
  14680. this.errorEmitted = false;
  14681. // count buffered requests
  14682. this.bufferedRequestCount = 0;
  14683. // allocate the first CorkedRequest, there is always
  14684. // one allocated and free to use, and we maintain at most two
  14685. this.corkedRequestsFree = new CorkedRequest(this);
  14686. }
  14687. WritableState.prototype.getBuffer = function getBuffer() {
  14688. var current = this.bufferedRequest;
  14689. var out = [];
  14690. while (current) {
  14691. out.push(current);
  14692. current = current.next;
  14693. }
  14694. return out;
  14695. };
  14696. (function () {
  14697. try {
  14698. Object.defineProperty(WritableState.prototype, 'buffer', {
  14699. get: internalUtil.deprecate(function () {
  14700. return this.getBuffer();
  14701. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  14702. });
  14703. } catch (_) {}
  14704. })();
  14705. // Test _writableState for inheritance to account for Duplex streams,
  14706. // whose prototype chain only points to Readable.
  14707. var realHasInstance;
  14708. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  14709. realHasInstance = Function.prototype[Symbol.hasInstance];
  14710. Object.defineProperty(Writable, Symbol.hasInstance, {
  14711. value: function (object) {
  14712. if (realHasInstance.call(this, object)) return true;
  14713. if (this !== Writable) return false;
  14714. return object && object._writableState instanceof WritableState;
  14715. }
  14716. });
  14717. } else {
  14718. realHasInstance = function (object) {
  14719. return object instanceof this;
  14720. };
  14721. }
  14722. function Writable(options) {
  14723. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 101);
  14724. // Writable ctor is applied to Duplexes, too.
  14725. // `realHasInstance` is necessary because using plain `instanceof`
  14726. // would return false, as no `_writableState` property is attached.
  14727. // Trying to use the custom `instanceof` for Writable here will also break the
  14728. // Node.js LazyTransform implementation, which has a non-trivial getter for
  14729. // `_writableState` that would lead to infinite recursion.
  14730. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  14731. return new Writable(options);
  14732. }
  14733. this._writableState = new WritableState(options, this);
  14734. // legacy.
  14735. this.writable = true;
  14736. if (options) {
  14737. if (typeof options.write === 'function') this._write = options.write;
  14738. if (typeof options.writev === 'function') this._writev = options.writev;
  14739. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  14740. if (typeof options.final === 'function') this._final = options.final;
  14741. }
  14742. Stream.call(this);
  14743. }
  14744. // Otherwise people can pipe Writable streams, which is just wrong.
  14745. Writable.prototype.pipe = function () {
  14746. this.emit('error', new Error('Cannot pipe, not readable'));
  14747. };
  14748. function writeAfterEnd(stream, cb) {
  14749. var er = new Error('write after end');
  14750. // TODO: defer error events consistently everywhere, not just the cb
  14751. stream.emit('error', er);
  14752. pna.nextTick(cb, er);
  14753. }
  14754. // Checks that a user-supplied chunk is valid, especially for the particular
  14755. // mode the stream is in. Currently this means that `null` is never accepted
  14756. // and undefined/non-string values are only allowed in object mode.
  14757. function validChunk(stream, state, chunk, cb) {
  14758. var valid = true;
  14759. var er = false;
  14760. if (chunk === null) {
  14761. er = new TypeError('May not write null values to stream');
  14762. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  14763. er = new TypeError('Invalid non-string/buffer chunk');
  14764. }
  14765. if (er) {
  14766. stream.emit('error', er);
  14767. pna.nextTick(cb, er);
  14768. valid = false;
  14769. }
  14770. return valid;
  14771. }
  14772. Writable.prototype.write = function (chunk, encoding, cb) {
  14773. var state = this._writableState;
  14774. var ret = false;
  14775. var isBuf = !state.objectMode && _isUint8Array(chunk);
  14776. if (isBuf && !Buffer.isBuffer(chunk)) {
  14777. chunk = _uint8ArrayToBuffer(chunk);
  14778. }
  14779. if (typeof encoding === 'function') {
  14780. cb = encoding;
  14781. encoding = null;
  14782. }
  14783. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  14784. if (typeof cb !== 'function') cb = nop;
  14785. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  14786. state.pendingcb++;
  14787. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  14788. }
  14789. return ret;
  14790. };
  14791. Writable.prototype.cork = function () {
  14792. var state = this._writableState;
  14793. state.corked++;
  14794. };
  14795. Writable.prototype.uncork = function () {
  14796. var state = this._writableState;
  14797. if (state.corked) {
  14798. state.corked--;
  14799. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  14800. }
  14801. };
  14802. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  14803. // node::ParseEncoding() requires lower case.
  14804. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  14805. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  14806. this._writableState.defaultEncoding = encoding;
  14807. return this;
  14808. };
  14809. function decodeChunk(state, chunk, encoding) {
  14810. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  14811. chunk = Buffer.from(chunk, encoding);
  14812. }
  14813. return chunk;
  14814. }
  14815. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  14816. // making it explicit this property is not enumerable
  14817. // because otherwise some prototype manipulation in
  14818. // userland will fail
  14819. enumerable: false,
  14820. get: function () {
  14821. return this._writableState.highWaterMark;
  14822. }
  14823. });
  14824. // if we're already writing something, then just put this
  14825. // in the queue, and wait our turn. Otherwise, call _write
  14826. // If we return false, then we need a drain event, so set that flag.
  14827. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  14828. if (!isBuf) {
  14829. var newChunk = decodeChunk(state, chunk, encoding);
  14830. if (chunk !== newChunk) {
  14831. isBuf = true;
  14832. encoding = 'buffer';
  14833. chunk = newChunk;
  14834. }
  14835. }
  14836. var len = state.objectMode ? 1 : chunk.length;
  14837. state.length += len;
  14838. var ret = state.length < state.highWaterMark;
  14839. // we must ensure that previous needDrain will not be reset to false.
  14840. if (!ret) state.needDrain = true;
  14841. if (state.writing || state.corked) {
  14842. var last = state.lastBufferedRequest;
  14843. state.lastBufferedRequest = {
  14844. chunk: chunk,
  14845. encoding: encoding,
  14846. isBuf: isBuf,
  14847. callback: cb,
  14848. next: null
  14849. };
  14850. if (last) {
  14851. last.next = state.lastBufferedRequest;
  14852. } else {
  14853. state.bufferedRequest = state.lastBufferedRequest;
  14854. }
  14855. state.bufferedRequestCount += 1;
  14856. } else {
  14857. doWrite(stream, state, false, len, chunk, encoding, cb);
  14858. }
  14859. return ret;
  14860. }
  14861. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  14862. state.writelen = len;
  14863. state.writecb = cb;
  14864. state.writing = true;
  14865. state.sync = true;
  14866. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  14867. state.sync = false;
  14868. }
  14869. function onwriteError(stream, state, sync, er, cb) {
  14870. --state.pendingcb;
  14871. if (sync) {
  14872. // defer the callback if we are being called synchronously
  14873. // to avoid piling up things on the stack
  14874. pna.nextTick(cb, er);
  14875. // this can emit finish, and it will always happen
  14876. // after error
  14877. pna.nextTick(finishMaybe, stream, state);
  14878. stream._writableState.errorEmitted = true;
  14879. stream.emit('error', er);
  14880. } else {
  14881. // the caller expect this to happen before if
  14882. // it is async
  14883. cb(er);
  14884. stream._writableState.errorEmitted = true;
  14885. stream.emit('error', er);
  14886. // this can emit finish, but finish must
  14887. // always follow error
  14888. finishMaybe(stream, state);
  14889. }
  14890. }
  14891. function onwriteStateUpdate(state) {
  14892. state.writing = false;
  14893. state.writecb = null;
  14894. state.length -= state.writelen;
  14895. state.writelen = 0;
  14896. }
  14897. function onwrite(stream, er) {
  14898. var state = stream._writableState;
  14899. var sync = state.sync;
  14900. var cb = state.writecb;
  14901. onwriteStateUpdate(state);
  14902. if (er) onwriteError(stream, state, sync, er, cb);else {
  14903. // Check if we're actually ready to finish, but don't emit yet
  14904. var finished = needFinish(state);
  14905. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  14906. clearBuffer(stream, state);
  14907. }
  14908. if (sync) {
  14909. /*<replacement>*/
  14910. asyncWrite(afterWrite, stream, state, finished, cb);
  14911. /*</replacement>*/
  14912. } else {
  14913. afterWrite(stream, state, finished, cb);
  14914. }
  14915. }
  14916. }
  14917. function afterWrite(stream, state, finished, cb) {
  14918. if (!finished) onwriteDrain(stream, state);
  14919. state.pendingcb--;
  14920. cb();
  14921. finishMaybe(stream, state);
  14922. }
  14923. // Must force callback to be called on nextTick, so that we don't
  14924. // emit 'drain' before the write() consumer gets the 'false' return
  14925. // value, and has a chance to attach a 'drain' listener.
  14926. function onwriteDrain(stream, state) {
  14927. if (state.length === 0 && state.needDrain) {
  14928. state.needDrain = false;
  14929. stream.emit('drain');
  14930. }
  14931. }
  14932. // if there's something in the buffer waiting, then process it
  14933. function clearBuffer(stream, state) {
  14934. state.bufferProcessing = true;
  14935. var entry = state.bufferedRequest;
  14936. if (stream._writev && entry && entry.next) {
  14937. // Fast case, write everything using _writev()
  14938. var l = state.bufferedRequestCount;
  14939. var buffer = new Array(l);
  14940. var holder = state.corkedRequestsFree;
  14941. holder.entry = entry;
  14942. var count = 0;
  14943. var allBuffers = true;
  14944. while (entry) {
  14945. buffer[count] = entry;
  14946. if (!entry.isBuf) allBuffers = false;
  14947. entry = entry.next;
  14948. count += 1;
  14949. }
  14950. buffer.allBuffers = allBuffers;
  14951. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  14952. // doWrite is almost always async, defer these to save a bit of time
  14953. // as the hot path ends with doWrite
  14954. state.pendingcb++;
  14955. state.lastBufferedRequest = null;
  14956. if (holder.next) {
  14957. state.corkedRequestsFree = holder.next;
  14958. holder.next = null;
  14959. } else {
  14960. state.corkedRequestsFree = new CorkedRequest(state);
  14961. }
  14962. state.bufferedRequestCount = 0;
  14963. } else {
  14964. // Slow case, write chunks one-by-one
  14965. while (entry) {
  14966. var chunk = entry.chunk;
  14967. var encoding = entry.encoding;
  14968. var cb = entry.callback;
  14969. var len = state.objectMode ? 1 : chunk.length;
  14970. doWrite(stream, state, false, len, chunk, encoding, cb);
  14971. entry = entry.next;
  14972. state.bufferedRequestCount--;
  14973. // if we didn't call the onwrite immediately, then
  14974. // it means that we need to wait until it does.
  14975. // also, that means that the chunk and cb are currently
  14976. // being processed, so move the buffer counter past them.
  14977. if (state.writing) {
  14978. break;
  14979. }
  14980. }
  14981. if (entry === null) state.lastBufferedRequest = null;
  14982. }
  14983. state.bufferedRequest = entry;
  14984. state.bufferProcessing = false;
  14985. }
  14986. Writable.prototype._write = function (chunk, encoding, cb) {
  14987. cb(new Error('_write() is not implemented'));
  14988. };
  14989. Writable.prototype._writev = null;
  14990. Writable.prototype.end = function (chunk, encoding, cb) {
  14991. var state = this._writableState;
  14992. if (typeof chunk === 'function') {
  14993. cb = chunk;
  14994. chunk = null;
  14995. encoding = null;
  14996. } else if (typeof encoding === 'function') {
  14997. cb = encoding;
  14998. encoding = null;
  14999. }
  15000. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  15001. // .end() fully uncorks
  15002. if (state.corked) {
  15003. state.corked = 1;
  15004. this.uncork();
  15005. }
  15006. // ignore unnecessary end() calls.
  15007. if (!state.ending && !state.finished) endWritable(this, state, cb);
  15008. };
  15009. function needFinish(state) {
  15010. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  15011. }
  15012. function callFinal(stream, state) {
  15013. stream._final(function (err) {
  15014. state.pendingcb--;
  15015. if (err) {
  15016. stream.emit('error', err);
  15017. }
  15018. state.prefinished = true;
  15019. stream.emit('prefinish');
  15020. finishMaybe(stream, state);
  15021. });
  15022. }
  15023. function prefinish(stream, state) {
  15024. if (!state.prefinished && !state.finalCalled) {
  15025. if (typeof stream._final === 'function') {
  15026. state.pendingcb++;
  15027. state.finalCalled = true;
  15028. pna.nextTick(callFinal, stream, state);
  15029. } else {
  15030. state.prefinished = true;
  15031. stream.emit('prefinish');
  15032. }
  15033. }
  15034. }
  15035. function finishMaybe(stream, state) {
  15036. var need = needFinish(state);
  15037. if (need) {
  15038. prefinish(stream, state);
  15039. if (state.pendingcb === 0) {
  15040. state.finished = true;
  15041. stream.emit('finish');
  15042. }
  15043. }
  15044. return need;
  15045. }
  15046. function endWritable(stream, state, cb) {
  15047. state.ending = true;
  15048. finishMaybe(stream, state);
  15049. if (cb) {
  15050. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  15051. }
  15052. state.ended = true;
  15053. stream.writable = false;
  15054. }
  15055. function onCorkedFinish(corkReq, state, err) {
  15056. var entry = corkReq.entry;
  15057. corkReq.entry = null;
  15058. while (entry) {
  15059. var cb = entry.callback;
  15060. state.pendingcb--;
  15061. cb(err);
  15062. entry = entry.next;
  15063. }
  15064. if (state.corkedRequestsFree) {
  15065. state.corkedRequestsFree.next = corkReq;
  15066. } else {
  15067. state.corkedRequestsFree = corkReq;
  15068. }
  15069. }
  15070. Object.defineProperty(Writable.prototype, 'destroyed', {
  15071. get: function () {
  15072. if (this._writableState === undefined) {
  15073. return false;
  15074. }
  15075. return this._writableState.destroyed;
  15076. },
  15077. set: function (value) {
  15078. // we ignore the value if the stream
  15079. // has not been initialized yet
  15080. if (!this._writableState) {
  15081. return;
  15082. }
  15083. // backward compatibility, the user is explicitly
  15084. // managing destroyed
  15085. this._writableState.destroyed = value;
  15086. }
  15087. });
  15088. Writable.prototype.destroy = destroyImpl.destroy;
  15089. Writable.prototype._undestroy = destroyImpl.undestroy;
  15090. Writable.prototype._destroy = function (err, cb) {
  15091. this.end();
  15092. cb(err);
  15093. };
  15094. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 80), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2)))
  15095. /***/ }),
  15096. /* 103 */
  15097. /*!************************************************!*\
  15098. !*** ./node_modules/util-deprecate/browser.js ***!
  15099. \************************************************/
  15100. /*! no static exports found */
  15101. /***/ (function(module, exports, __webpack_require__) {
  15102. /* WEBPACK VAR INJECTION */(function(global) {
  15103. /**
  15104. * Module exports.
  15105. */
  15106. module.exports = deprecate;
  15107. /**
  15108. * Mark that a method should not be used.
  15109. * Returns a modified function which warns once by default.
  15110. *
  15111. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  15112. *
  15113. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  15114. * will throw an Error when invoked.
  15115. *
  15116. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  15117. * will invoke `console.trace()` instead of `console.error()`.
  15118. *
  15119. * @param {Function} fn - the function to deprecate
  15120. * @param {String} msg - the string to print to the console when `fn` is invoked
  15121. * @returns {Function} a new "deprecated" version of `fn`
  15122. * @api public
  15123. */
  15124. function deprecate (fn, msg) {
  15125. if (config('noDeprecation')) {
  15126. return fn;
  15127. }
  15128. var warned = false;
  15129. function deprecated() {
  15130. if (!warned) {
  15131. if (config('throwDeprecation')) {
  15132. throw new Error(msg);
  15133. } else if (config('traceDeprecation')) {
  15134. console.trace(msg);
  15135. } else {
  15136. console.warn(msg);
  15137. }
  15138. warned = true;
  15139. }
  15140. return fn.apply(this, arguments);
  15141. }
  15142. return deprecated;
  15143. }
  15144. /**
  15145. * Checks `localStorage` for boolean values for the given `name`.
  15146. *
  15147. * @param {String} name
  15148. * @returns {Boolean}
  15149. * @api private
  15150. */
  15151. function config (name) {
  15152. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  15153. try {
  15154. if (!global.localStorage) return false;
  15155. } catch (_) {
  15156. return false;
  15157. }
  15158. var val = global.localStorage[name];
  15159. if (null == val) return false;
  15160. return String(val).toLowerCase() === 'true';
  15161. }
  15162. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  15163. /***/ }),
  15164. /* 104 */
  15165. /*!***********************************************************!*\
  15166. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  15167. \***********************************************************/
  15168. /*! no static exports found */
  15169. /***/ (function(module, exports, __webpack_require__) {
  15170. "use strict";
  15171. // Copyright Joyent, Inc. and other Node contributors.
  15172. //
  15173. // Permission is hereby granted, free of charge, to any person obtaining a
  15174. // copy of this software and associated documentation files (the
  15175. // "Software"), to deal in the Software without restriction, including
  15176. // without limitation the rights to use, copy, modify, merge, publish,
  15177. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15178. // persons to whom the Software is furnished to do so, subject to the
  15179. // following conditions:
  15180. //
  15181. // The above copyright notice and this permission notice shall be included
  15182. // in all copies or substantial portions of the Software.
  15183. //
  15184. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15185. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15186. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15187. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15188. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15189. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15190. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15191. /*<replacement>*/
  15192. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer;
  15193. /*</replacement>*/
  15194. var isEncoding = Buffer.isEncoding || function (encoding) {
  15195. encoding = '' + encoding;
  15196. switch (encoding && encoding.toLowerCase()) {
  15197. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  15198. return true;
  15199. default:
  15200. return false;
  15201. }
  15202. };
  15203. function _normalizeEncoding(enc) {
  15204. if (!enc) return 'utf8';
  15205. var retried;
  15206. while (true) {
  15207. switch (enc) {
  15208. case 'utf8':
  15209. case 'utf-8':
  15210. return 'utf8';
  15211. case 'ucs2':
  15212. case 'ucs-2':
  15213. case 'utf16le':
  15214. case 'utf-16le':
  15215. return 'utf16le';
  15216. case 'latin1':
  15217. case 'binary':
  15218. return 'latin1';
  15219. case 'base64':
  15220. case 'ascii':
  15221. case 'hex':
  15222. return enc;
  15223. default:
  15224. if (retried) return; // undefined
  15225. enc = ('' + enc).toLowerCase();
  15226. retried = true;
  15227. }
  15228. }
  15229. };
  15230. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  15231. // modules monkey-patch it to support additional encodings
  15232. function normalizeEncoding(enc) {
  15233. var nenc = _normalizeEncoding(enc);
  15234. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  15235. return nenc || enc;
  15236. }
  15237. // StringDecoder provides an interface for efficiently splitting a series of
  15238. // buffers into a series of JS strings without breaking apart multi-byte
  15239. // characters.
  15240. exports.StringDecoder = StringDecoder;
  15241. function StringDecoder(encoding) {
  15242. this.encoding = normalizeEncoding(encoding);
  15243. var nb;
  15244. switch (this.encoding) {
  15245. case 'utf16le':
  15246. this.text = utf16Text;
  15247. this.end = utf16End;
  15248. nb = 4;
  15249. break;
  15250. case 'utf8':
  15251. this.fillLast = utf8FillLast;
  15252. nb = 4;
  15253. break;
  15254. case 'base64':
  15255. this.text = base64Text;
  15256. this.end = base64End;
  15257. nb = 3;
  15258. break;
  15259. default:
  15260. this.write = simpleWrite;
  15261. this.end = simpleEnd;
  15262. return;
  15263. }
  15264. this.lastNeed = 0;
  15265. this.lastTotal = 0;
  15266. this.lastChar = Buffer.allocUnsafe(nb);
  15267. }
  15268. StringDecoder.prototype.write = function (buf) {
  15269. if (buf.length === 0) return '';
  15270. var r;
  15271. var i;
  15272. if (this.lastNeed) {
  15273. r = this.fillLast(buf);
  15274. if (r === undefined) return '';
  15275. i = this.lastNeed;
  15276. this.lastNeed = 0;
  15277. } else {
  15278. i = 0;
  15279. }
  15280. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  15281. return r || '';
  15282. };
  15283. StringDecoder.prototype.end = utf8End;
  15284. // Returns only complete characters in a Buffer
  15285. StringDecoder.prototype.text = utf8Text;
  15286. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  15287. StringDecoder.prototype.fillLast = function (buf) {
  15288. if (this.lastNeed <= buf.length) {
  15289. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  15290. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15291. }
  15292. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  15293. this.lastNeed -= buf.length;
  15294. };
  15295. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  15296. // continuation byte. If an invalid byte is detected, -2 is returned.
  15297. function utf8CheckByte(byte) {
  15298. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  15299. return byte >> 6 === 0x02 ? -1 : -2;
  15300. }
  15301. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  15302. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  15303. // needed to complete the UTF-8 character (if applicable) are returned.
  15304. function utf8CheckIncomplete(self, buf, i) {
  15305. var j = buf.length - 1;
  15306. if (j < i) return 0;
  15307. var nb = utf8CheckByte(buf[j]);
  15308. if (nb >= 0) {
  15309. if (nb > 0) self.lastNeed = nb - 1;
  15310. return nb;
  15311. }
  15312. if (--j < i || nb === -2) return 0;
  15313. nb = utf8CheckByte(buf[j]);
  15314. if (nb >= 0) {
  15315. if (nb > 0) self.lastNeed = nb - 2;
  15316. return nb;
  15317. }
  15318. if (--j < i || nb === -2) return 0;
  15319. nb = utf8CheckByte(buf[j]);
  15320. if (nb >= 0) {
  15321. if (nb > 0) {
  15322. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  15323. }
  15324. return nb;
  15325. }
  15326. return 0;
  15327. }
  15328. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  15329. // needed or are available. If we see a non-continuation byte where we expect
  15330. // one, we "replace" the validated continuation bytes we've seen so far with
  15331. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  15332. // behavior. The continuation byte check is included three times in the case
  15333. // where all of the continuation bytes for a character exist in the same buffer.
  15334. // It is also done this way as a slight performance increase instead of using a
  15335. // loop.
  15336. function utf8CheckExtraBytes(self, buf, p) {
  15337. if ((buf[0] & 0xC0) !== 0x80) {
  15338. self.lastNeed = 0;
  15339. return '\ufffd';
  15340. }
  15341. if (self.lastNeed > 1 && buf.length > 1) {
  15342. if ((buf[1] & 0xC0) !== 0x80) {
  15343. self.lastNeed = 1;
  15344. return '\ufffd';
  15345. }
  15346. if (self.lastNeed > 2 && buf.length > 2) {
  15347. if ((buf[2] & 0xC0) !== 0x80) {
  15348. self.lastNeed = 2;
  15349. return '\ufffd';
  15350. }
  15351. }
  15352. }
  15353. }
  15354. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  15355. function utf8FillLast(buf) {
  15356. var p = this.lastTotal - this.lastNeed;
  15357. var r = utf8CheckExtraBytes(this, buf, p);
  15358. if (r !== undefined) return r;
  15359. if (this.lastNeed <= buf.length) {
  15360. buf.copy(this.lastChar, p, 0, this.lastNeed);
  15361. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15362. }
  15363. buf.copy(this.lastChar, p, 0, buf.length);
  15364. this.lastNeed -= buf.length;
  15365. }
  15366. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  15367. // partial character, the character's bytes are buffered until the required
  15368. // number of bytes are available.
  15369. function utf8Text(buf, i) {
  15370. var total = utf8CheckIncomplete(this, buf, i);
  15371. if (!this.lastNeed) return buf.toString('utf8', i);
  15372. this.lastTotal = total;
  15373. var end = buf.length - (total - this.lastNeed);
  15374. buf.copy(this.lastChar, 0, end);
  15375. return buf.toString('utf8', i, end);
  15376. }
  15377. // For UTF-8, a replacement character is added when ending on a partial
  15378. // character.
  15379. function utf8End(buf) {
  15380. var r = buf && buf.length ? this.write(buf) : '';
  15381. if (this.lastNeed) return r + '\ufffd';
  15382. return r;
  15383. }
  15384. // UTF-16LE typically needs two bytes per character, but even if we have an even
  15385. // number of bytes available, we need to check if we end on a leading/high
  15386. // surrogate. In that case, we need to wait for the next two bytes in order to
  15387. // decode the last character properly.
  15388. function utf16Text(buf, i) {
  15389. if ((buf.length - i) % 2 === 0) {
  15390. var r = buf.toString('utf16le', i);
  15391. if (r) {
  15392. var c = r.charCodeAt(r.length - 1);
  15393. if (c >= 0xD800 && c <= 0xDBFF) {
  15394. this.lastNeed = 2;
  15395. this.lastTotal = 4;
  15396. this.lastChar[0] = buf[buf.length - 2];
  15397. this.lastChar[1] = buf[buf.length - 1];
  15398. return r.slice(0, -1);
  15399. }
  15400. }
  15401. return r;
  15402. }
  15403. this.lastNeed = 1;
  15404. this.lastTotal = 2;
  15405. this.lastChar[0] = buf[buf.length - 1];
  15406. return buf.toString('utf16le', i, buf.length - 1);
  15407. }
  15408. // For UTF-16LE we do not explicitly append special replacement characters if we
  15409. // end on a partial character, we simply let v8 handle that.
  15410. function utf16End(buf) {
  15411. var r = buf && buf.length ? this.write(buf) : '';
  15412. if (this.lastNeed) {
  15413. var end = this.lastTotal - this.lastNeed;
  15414. return r + this.lastChar.toString('utf16le', 0, end);
  15415. }
  15416. return r;
  15417. }
  15418. function base64Text(buf, i) {
  15419. var n = (buf.length - i) % 3;
  15420. if (n === 0) return buf.toString('base64', i);
  15421. this.lastNeed = 3 - n;
  15422. this.lastTotal = 3;
  15423. if (n === 1) {
  15424. this.lastChar[0] = buf[buf.length - 1];
  15425. } else {
  15426. this.lastChar[0] = buf[buf.length - 2];
  15427. this.lastChar[1] = buf[buf.length - 1];
  15428. }
  15429. return buf.toString('base64', i, buf.length - n);
  15430. }
  15431. function base64End(buf) {
  15432. var r = buf && buf.length ? this.write(buf) : '';
  15433. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  15434. return r;
  15435. }
  15436. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  15437. function simpleWrite(buf) {
  15438. return buf.toString(this.encoding);
  15439. }
  15440. function simpleEnd(buf) {
  15441. return buf && buf.length ? this.write(buf) : '';
  15442. }
  15443. /***/ }),
  15444. /* 105 */
  15445. /*!***************************************************************!*\
  15446. !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
  15447. \***************************************************************/
  15448. /*! no static exports found */
  15449. /***/ (function(module, exports, __webpack_require__) {
  15450. "use strict";
  15451. // Copyright Joyent, Inc. and other Node contributors.
  15452. //
  15453. // Permission is hereby granted, free of charge, to any person obtaining a
  15454. // copy of this software and associated documentation files (the
  15455. // "Software"), to deal in the Software without restriction, including
  15456. // without limitation the rights to use, copy, modify, merge, publish,
  15457. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15458. // persons to whom the Software is furnished to do so, subject to the
  15459. // following conditions:
  15460. //
  15461. // The above copyright notice and this permission notice shall be included
  15462. // in all copies or substantial portions of the Software.
  15463. //
  15464. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15465. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15466. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15467. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15468. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15469. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15470. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15471. // a transform stream is a readable/writable stream where you do
  15472. // something with the data. Sometimes it's called a "filter",
  15473. // but that's not a great name for it, since that implies a thing where
  15474. // some bits pass through, and others are simply ignored. (That would
  15475. // be a valid example of a transform, of course.)
  15476. //
  15477. // While the output is causally related to the input, it's not a
  15478. // necessarily symmetric or synchronous transformation. For example,
  15479. // a zlib stream might take multiple plain-text writes(), and then
  15480. // emit a single compressed chunk some time in the future.
  15481. //
  15482. // Here's how this works:
  15483. //
  15484. // The Transform stream has all the aspects of the readable and writable
  15485. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  15486. // internally, and returns false if there's a lot of pending writes
  15487. // buffered up. When you call read(), that calls _read(n) until
  15488. // there's enough pending readable data buffered up.
  15489. //
  15490. // In a transform stream, the written data is placed in a buffer. When
  15491. // _read(n) is called, it transforms the queued up data, calling the
  15492. // buffered _write cb's as it consumes chunks. If consuming a single
  15493. // written chunk would result in multiple output chunks, then the first
  15494. // outputted bit calls the readcb, and subsequent chunks just go into
  15495. // the read buffer, and will cause it to emit 'readable' if necessary.
  15496. //
  15497. // This way, back-pressure is actually determined by the reading side,
  15498. // since _read has to be called to start processing a new chunk. However,
  15499. // a pathological inflate type of transform can cause excessive buffering
  15500. // here. For example, imagine a stream where every byte of input is
  15501. // interpreted as an integer from 0-255, and then results in that many
  15502. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  15503. // 1kb of data being output. In this case, you could write a very small
  15504. // amount of input, and end up with a very large amount of output. In
  15505. // such a pathological inflating mechanism, there'd be no way to tell
  15506. // the system to stop doing the transform. A single 4MB write could
  15507. // cause the system to run out of memory.
  15508. //
  15509. // However, even in such a pathological case, only a single written chunk
  15510. // would be consumed, and then the rest would wait (un-transformed) until
  15511. // the results of the previous transformed chunk were consumed.
  15512. module.exports = Transform;
  15513. var Duplex = __webpack_require__(/*! ./_stream_duplex */ 101);
  15514. /*<replacement>*/
  15515. var util = Object.create(__webpack_require__(/*! core-util-is */ 96));
  15516. util.inherits = __webpack_require__(/*! inherits */ 88);
  15517. /*</replacement>*/
  15518. util.inherits(Transform, Duplex);
  15519. function afterTransform(er, data) {
  15520. var ts = this._transformState;
  15521. ts.transforming = false;
  15522. var cb = ts.writecb;
  15523. if (!cb) {
  15524. return this.emit('error', new Error('write callback called multiple times'));
  15525. }
  15526. ts.writechunk = null;
  15527. ts.writecb = null;
  15528. if (data != null) // single equals check for both `null` and `undefined`
  15529. this.push(data);
  15530. cb(er);
  15531. var rs = this._readableState;
  15532. rs.reading = false;
  15533. if (rs.needReadable || rs.length < rs.highWaterMark) {
  15534. this._read(rs.highWaterMark);
  15535. }
  15536. }
  15537. function Transform(options) {
  15538. if (!(this instanceof Transform)) return new Transform(options);
  15539. Duplex.call(this, options);
  15540. this._transformState = {
  15541. afterTransform: afterTransform.bind(this),
  15542. needTransform: false,
  15543. transforming: false,
  15544. writecb: null,
  15545. writechunk: null,
  15546. writeencoding: null
  15547. };
  15548. // start out asking for a readable event once data is transformed.
  15549. this._readableState.needReadable = true;
  15550. // we have implemented the _read method, and done the other things
  15551. // that Readable wants before the first _read call, so unset the
  15552. // sync guard flag.
  15553. this._readableState.sync = false;
  15554. if (options) {
  15555. if (typeof options.transform === 'function') this._transform = options.transform;
  15556. if (typeof options.flush === 'function') this._flush = options.flush;
  15557. }
  15558. // When the writable side finishes, then flush out anything remaining.
  15559. this.on('prefinish', prefinish);
  15560. }
  15561. function prefinish() {
  15562. var _this = this;
  15563. if (typeof this._flush === 'function') {
  15564. this._flush(function (er, data) {
  15565. done(_this, er, data);
  15566. });
  15567. } else {
  15568. done(this, null, null);
  15569. }
  15570. }
  15571. Transform.prototype.push = function (chunk, encoding) {
  15572. this._transformState.needTransform = false;
  15573. return Duplex.prototype.push.call(this, chunk, encoding);
  15574. };
  15575. // This is the part where you do stuff!
  15576. // override this function in implementation classes.
  15577. // 'chunk' is an input chunk.
  15578. //
  15579. // Call `push(newChunk)` to pass along transformed output
  15580. // to the readable side. You may call 'push' zero or more times.
  15581. //
  15582. // Call `cb(err)` when you are done with this chunk. If you pass
  15583. // an error, then that'll put the hurt on the whole operation. If you
  15584. // never call cb(), then you'll never get another chunk.
  15585. Transform.prototype._transform = function (chunk, encoding, cb) {
  15586. throw new Error('_transform() is not implemented');
  15587. };
  15588. Transform.prototype._write = function (chunk, encoding, cb) {
  15589. var ts = this._transformState;
  15590. ts.writecb = cb;
  15591. ts.writechunk = chunk;
  15592. ts.writeencoding = encoding;
  15593. if (!ts.transforming) {
  15594. var rs = this._readableState;
  15595. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  15596. }
  15597. };
  15598. // Doesn't matter what the args are here.
  15599. // _transform does all the work.
  15600. // That we got here means that the readable side wants more data.
  15601. Transform.prototype._read = function (n) {
  15602. var ts = this._transformState;
  15603. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  15604. ts.transforming = true;
  15605. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  15606. } else {
  15607. // mark that we need a transform, so that any data that comes in
  15608. // will get processed, now that we've asked for it.
  15609. ts.needTransform = true;
  15610. }
  15611. };
  15612. Transform.prototype._destroy = function (err, cb) {
  15613. var _this2 = this;
  15614. Duplex.prototype._destroy.call(this, err, function (err2) {
  15615. cb(err2);
  15616. _this2.emit('close');
  15617. });
  15618. };
  15619. function done(stream, er, data) {
  15620. if (er) return stream.emit('error', er);
  15621. if (data != null) // single equals check for both `null` and `undefined`
  15622. stream.push(data);
  15623. // if there's nothing in the write buffer, then that means
  15624. // that nothing more will ever be provided
  15625. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  15626. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  15627. return stream.push(null);
  15628. }
  15629. /***/ }),
  15630. /* 106 */
  15631. /*!*****************************************************************!*\
  15632. !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
  15633. \*****************************************************************/
  15634. /*! no static exports found */
  15635. /***/ (function(module, exports, __webpack_require__) {
  15636. "use strict";
  15637. // Copyright Joyent, Inc. and other Node contributors.
  15638. //
  15639. // Permission is hereby granted, free of charge, to any person obtaining a
  15640. // copy of this software and associated documentation files (the
  15641. // "Software"), to deal in the Software without restriction, including
  15642. // without limitation the rights to use, copy, modify, merge, publish,
  15643. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15644. // persons to whom the Software is furnished to do so, subject to the
  15645. // following conditions:
  15646. //
  15647. // The above copyright notice and this permission notice shall be included
  15648. // in all copies or substantial portions of the Software.
  15649. //
  15650. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15651. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15652. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15653. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15654. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15655. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15656. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15657. // a passthrough stream.
  15658. // basically just the most minimal sort of Transform stream.
  15659. // Every written chunk gets output as-is.
  15660. module.exports = PassThrough;
  15661. var Transform = __webpack_require__(/*! ./_stream_transform */ 105);
  15662. /*<replacement>*/
  15663. var util = Object.create(__webpack_require__(/*! core-util-is */ 96));
  15664. util.inherits = __webpack_require__(/*! inherits */ 88);
  15665. /*</replacement>*/
  15666. util.inherits(PassThrough, Transform);
  15667. function PassThrough(options) {
  15668. if (!(this instanceof PassThrough)) return new PassThrough(options);
  15669. Transform.call(this, options);
  15670. }
  15671. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  15672. cb(null, chunk);
  15673. };
  15674. /***/ }),
  15675. /* 107 */
  15676. /*!*****************************************!*\
  15677. !*** ./node_modules/ripemd160/index.js ***!
  15678. \*****************************************/
  15679. /*! no static exports found */
  15680. /***/ (function(module, exports, __webpack_require__) {
  15681. "use strict";
  15682. var Buffer = __webpack_require__(/*! buffer */ 83).Buffer
  15683. var inherits = __webpack_require__(/*! inherits */ 88)
  15684. var HashBase = __webpack_require__(/*! hash-base */ 90)
  15685. var ARRAY16 = new Array(16)
  15686. var zl = [
  15687. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  15688. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  15689. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  15690. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  15691. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  15692. ]
  15693. var zr = [
  15694. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  15695. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  15696. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  15697. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  15698. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  15699. ]
  15700. var sl = [
  15701. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  15702. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  15703. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  15704. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  15705. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  15706. ]
  15707. var sr = [
  15708. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  15709. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  15710. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  15711. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  15712. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  15713. ]
  15714. var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
  15715. var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
  15716. function RIPEMD160 () {
  15717. HashBase.call(this, 64)
  15718. // state
  15719. this._a = 0x67452301
  15720. this._b = 0xefcdab89
  15721. this._c = 0x98badcfe
  15722. this._d = 0x10325476
  15723. this._e = 0xc3d2e1f0
  15724. }
  15725. inherits(RIPEMD160, HashBase)
  15726. RIPEMD160.prototype._update = function () {
  15727. var words = ARRAY16
  15728. for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
  15729. var al = this._a | 0
  15730. var bl = this._b | 0
  15731. var cl = this._c | 0
  15732. var dl = this._d | 0
  15733. var el = this._e | 0
  15734. var ar = this._a | 0
  15735. var br = this._b | 0
  15736. var cr = this._c | 0
  15737. var dr = this._d | 0
  15738. var er = this._e | 0
  15739. // computation
  15740. for (var i = 0; i < 80; i += 1) {
  15741. var tl
  15742. var tr
  15743. if (i < 16) {
  15744. tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
  15745. tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
  15746. } else if (i < 32) {
  15747. tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
  15748. tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
  15749. } else if (i < 48) {
  15750. tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
  15751. tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
  15752. } else if (i < 64) {
  15753. tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
  15754. tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
  15755. } else { // if (i<80) {
  15756. tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
  15757. tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])
  15758. }
  15759. al = el
  15760. el = dl
  15761. dl = rotl(cl, 10)
  15762. cl = bl
  15763. bl = tl
  15764. ar = er
  15765. er = dr
  15766. dr = rotl(cr, 10)
  15767. cr = br
  15768. br = tr
  15769. }
  15770. // update state
  15771. var t = (this._b + cl + dr) | 0
  15772. this._b = (this._c + dl + er) | 0
  15773. this._c = (this._d + el + ar) | 0
  15774. this._d = (this._e + al + br) | 0
  15775. this._e = (this._a + bl + cr) | 0
  15776. this._a = t
  15777. }
  15778. RIPEMD160.prototype._digest = function () {
  15779. // create padding and handle blocks
  15780. this._block[this._blockOffset++] = 0x80
  15781. if (this._blockOffset > 56) {
  15782. this._block.fill(0, this._blockOffset, 64)
  15783. this._update()
  15784. this._blockOffset = 0
  15785. }
  15786. this._block.fill(0, this._blockOffset, 56)
  15787. this._block.writeUInt32LE(this._length[0], 56)
  15788. this._block.writeUInt32LE(this._length[1], 60)
  15789. this._update()
  15790. // produce result
  15791. var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
  15792. buffer.writeInt32LE(this._a, 0)
  15793. buffer.writeInt32LE(this._b, 4)
  15794. buffer.writeInt32LE(this._c, 8)
  15795. buffer.writeInt32LE(this._d, 12)
  15796. buffer.writeInt32LE(this._e, 16)
  15797. return buffer
  15798. }
  15799. function rotl (x, n) {
  15800. return (x << n) | (x >>> (32 - n))
  15801. }
  15802. function fn1 (a, b, c, d, e, m, k, s) {
  15803. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
  15804. }
  15805. function fn2 (a, b, c, d, e, m, k, s) {
  15806. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
  15807. }
  15808. function fn3 (a, b, c, d, e, m, k, s) {
  15809. return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
  15810. }
  15811. function fn4 (a, b, c, d, e, m, k, s) {
  15812. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
  15813. }
  15814. function fn5 (a, b, c, d, e, m, k, s) {
  15815. return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
  15816. }
  15817. module.exports = RIPEMD160
  15818. /***/ }),
  15819. /* 108 */
  15820. /*!**************************************!*\
  15821. !*** ./node_modules/sha.js/index.js ***!
  15822. \**************************************/
  15823. /*! no static exports found */
  15824. /***/ (function(module, exports, __webpack_require__) {
  15825. var exports = module.exports = function SHA (algorithm) {
  15826. algorithm = algorithm.toLowerCase()
  15827. var Algorithm = exports[algorithm]
  15828. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  15829. return new Algorithm()
  15830. }
  15831. exports.sha = __webpack_require__(/*! ./sha */ 109)
  15832. exports.sha1 = __webpack_require__(/*! ./sha1 */ 111)
  15833. exports.sha224 = __webpack_require__(/*! ./sha224 */ 112)
  15834. exports.sha256 = __webpack_require__(/*! ./sha256 */ 113)
  15835. exports.sha384 = __webpack_require__(/*! ./sha384 */ 114)
  15836. exports.sha512 = __webpack_require__(/*! ./sha512 */ 115)
  15837. /***/ }),
  15838. /* 109 */
  15839. /*!************************************!*\
  15840. !*** ./node_modules/sha.js/sha.js ***!
  15841. \************************************/
  15842. /*! no static exports found */
  15843. /***/ (function(module, exports, __webpack_require__) {
  15844. /*
  15845. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  15846. * in FIPS PUB 180-1
  15847. * This source code is derived from sha1.js of the same repository.
  15848. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  15849. * operation was added.
  15850. */
  15851. var inherits = __webpack_require__(/*! inherits */ 88)
  15852. var Hash = __webpack_require__(/*! ./hash */ 110)
  15853. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  15854. var K = [
  15855. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  15856. ]
  15857. var W = new Array(80)
  15858. function Sha () {
  15859. this.init()
  15860. this._w = W
  15861. Hash.call(this, 64, 56)
  15862. }
  15863. inherits(Sha, Hash)
  15864. Sha.prototype.init = function () {
  15865. this._a = 0x67452301
  15866. this._b = 0xefcdab89
  15867. this._c = 0x98badcfe
  15868. this._d = 0x10325476
  15869. this._e = 0xc3d2e1f0
  15870. return this
  15871. }
  15872. function rotl5 (num) {
  15873. return (num << 5) | (num >>> 27)
  15874. }
  15875. function rotl30 (num) {
  15876. return (num << 30) | (num >>> 2)
  15877. }
  15878. function ft (s, b, c, d) {
  15879. if (s === 0) return (b & c) | ((~b) & d)
  15880. if (s === 2) return (b & c) | (b & d) | (c & d)
  15881. return b ^ c ^ d
  15882. }
  15883. Sha.prototype._update = function (M) {
  15884. var W = this._w
  15885. var a = this._a | 0
  15886. var b = this._b | 0
  15887. var c = this._c | 0
  15888. var d = this._d | 0
  15889. var e = this._e | 0
  15890. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  15891. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  15892. for (var j = 0; j < 80; ++j) {
  15893. var s = ~~(j / 20)
  15894. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  15895. e = d
  15896. d = c
  15897. c = rotl30(b)
  15898. b = a
  15899. a = t
  15900. }
  15901. this._a = (a + this._a) | 0
  15902. this._b = (b + this._b) | 0
  15903. this._c = (c + this._c) | 0
  15904. this._d = (d + this._d) | 0
  15905. this._e = (e + this._e) | 0
  15906. }
  15907. Sha.prototype._hash = function () {
  15908. var H = Buffer.allocUnsafe(20)
  15909. H.writeInt32BE(this._a | 0, 0)
  15910. H.writeInt32BE(this._b | 0, 4)
  15911. H.writeInt32BE(this._c | 0, 8)
  15912. H.writeInt32BE(this._d | 0, 12)
  15913. H.writeInt32BE(this._e | 0, 16)
  15914. return H
  15915. }
  15916. module.exports = Sha
  15917. /***/ }),
  15918. /* 110 */
  15919. /*!*************************************!*\
  15920. !*** ./node_modules/sha.js/hash.js ***!
  15921. \*************************************/
  15922. /*! no static exports found */
  15923. /***/ (function(module, exports, __webpack_require__) {
  15924. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  15925. // prototype class for hash functions
  15926. function Hash (blockSize, finalSize) {
  15927. this._block = Buffer.alloc(blockSize)
  15928. this._finalSize = finalSize
  15929. this._blockSize = blockSize
  15930. this._len = 0
  15931. }
  15932. Hash.prototype.update = function (data, enc) {
  15933. if (typeof data === 'string') {
  15934. enc = enc || 'utf8'
  15935. data = Buffer.from(data, enc)
  15936. }
  15937. var block = this._block
  15938. var blockSize = this._blockSize
  15939. var length = data.length
  15940. var accum = this._len
  15941. for (var offset = 0; offset < length;) {
  15942. var assigned = accum % blockSize
  15943. var remainder = Math.min(length - offset, blockSize - assigned)
  15944. for (var i = 0; i < remainder; i++) {
  15945. block[assigned + i] = data[offset + i]
  15946. }
  15947. accum += remainder
  15948. offset += remainder
  15949. if ((accum % blockSize) === 0) {
  15950. this._update(block)
  15951. }
  15952. }
  15953. this._len += length
  15954. return this
  15955. }
  15956. Hash.prototype.digest = function (enc) {
  15957. var rem = this._len % this._blockSize
  15958. this._block[rem] = 0x80
  15959. // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
  15960. // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
  15961. this._block.fill(0, rem + 1)
  15962. if (rem >= this._finalSize) {
  15963. this._update(this._block)
  15964. this._block.fill(0)
  15965. }
  15966. var bits = this._len * 8
  15967. // uint32
  15968. if (bits <= 0xffffffff) {
  15969. this._block.writeUInt32BE(bits, this._blockSize - 4)
  15970. // uint64
  15971. } else {
  15972. var lowBits = (bits & 0xffffffff) >>> 0
  15973. var highBits = (bits - lowBits) / 0x100000000
  15974. this._block.writeUInt32BE(highBits, this._blockSize - 8)
  15975. this._block.writeUInt32BE(lowBits, this._blockSize - 4)
  15976. }
  15977. this._update(this._block)
  15978. var hash = this._hash()
  15979. return enc ? hash.toString(enc) : hash
  15980. }
  15981. Hash.prototype._update = function () {
  15982. throw new Error('_update must be implemented by subclass')
  15983. }
  15984. module.exports = Hash
  15985. /***/ }),
  15986. /* 111 */
  15987. /*!*************************************!*\
  15988. !*** ./node_modules/sha.js/sha1.js ***!
  15989. \*************************************/
  15990. /*! no static exports found */
  15991. /***/ (function(module, exports, __webpack_require__) {
  15992. /*
  15993. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  15994. * in FIPS PUB 180-1
  15995. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  15996. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  15997. * Distributed under the BSD License
  15998. * See http://pajhome.org.uk/crypt/md5 for details.
  15999. */
  16000. var inherits = __webpack_require__(/*! inherits */ 88)
  16001. var Hash = __webpack_require__(/*! ./hash */ 110)
  16002. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16003. var K = [
  16004. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  16005. ]
  16006. var W = new Array(80)
  16007. function Sha1 () {
  16008. this.init()
  16009. this._w = W
  16010. Hash.call(this, 64, 56)
  16011. }
  16012. inherits(Sha1, Hash)
  16013. Sha1.prototype.init = function () {
  16014. this._a = 0x67452301
  16015. this._b = 0xefcdab89
  16016. this._c = 0x98badcfe
  16017. this._d = 0x10325476
  16018. this._e = 0xc3d2e1f0
  16019. return this
  16020. }
  16021. function rotl1 (num) {
  16022. return (num << 1) | (num >>> 31)
  16023. }
  16024. function rotl5 (num) {
  16025. return (num << 5) | (num >>> 27)
  16026. }
  16027. function rotl30 (num) {
  16028. return (num << 30) | (num >>> 2)
  16029. }
  16030. function ft (s, b, c, d) {
  16031. if (s === 0) return (b & c) | ((~b) & d)
  16032. if (s === 2) return (b & c) | (b & d) | (c & d)
  16033. return b ^ c ^ d
  16034. }
  16035. Sha1.prototype._update = function (M) {
  16036. var W = this._w
  16037. var a = this._a | 0
  16038. var b = this._b | 0
  16039. var c = this._c | 0
  16040. var d = this._d | 0
  16041. var e = this._e | 0
  16042. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  16043. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  16044. for (var j = 0; j < 80; ++j) {
  16045. var s = ~~(j / 20)
  16046. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  16047. e = d
  16048. d = c
  16049. c = rotl30(b)
  16050. b = a
  16051. a = t
  16052. }
  16053. this._a = (a + this._a) | 0
  16054. this._b = (b + this._b) | 0
  16055. this._c = (c + this._c) | 0
  16056. this._d = (d + this._d) | 0
  16057. this._e = (e + this._e) | 0
  16058. }
  16059. Sha1.prototype._hash = function () {
  16060. var H = Buffer.allocUnsafe(20)
  16061. H.writeInt32BE(this._a | 0, 0)
  16062. H.writeInt32BE(this._b | 0, 4)
  16063. H.writeInt32BE(this._c | 0, 8)
  16064. H.writeInt32BE(this._d | 0, 12)
  16065. H.writeInt32BE(this._e | 0, 16)
  16066. return H
  16067. }
  16068. module.exports = Sha1
  16069. /***/ }),
  16070. /* 112 */
  16071. /*!***************************************!*\
  16072. !*** ./node_modules/sha.js/sha224.js ***!
  16073. \***************************************/
  16074. /*! no static exports found */
  16075. /***/ (function(module, exports, __webpack_require__) {
  16076. /**
  16077. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  16078. * in FIPS 180-2
  16079. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  16080. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16081. *
  16082. */
  16083. var inherits = __webpack_require__(/*! inherits */ 88)
  16084. var Sha256 = __webpack_require__(/*! ./sha256 */ 113)
  16085. var Hash = __webpack_require__(/*! ./hash */ 110)
  16086. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16087. var W = new Array(64)
  16088. function Sha224 () {
  16089. this.init()
  16090. this._w = W // new Array(64)
  16091. Hash.call(this, 64, 56)
  16092. }
  16093. inherits(Sha224, Sha256)
  16094. Sha224.prototype.init = function () {
  16095. this._a = 0xc1059ed8
  16096. this._b = 0x367cd507
  16097. this._c = 0x3070dd17
  16098. this._d = 0xf70e5939
  16099. this._e = 0xffc00b31
  16100. this._f = 0x68581511
  16101. this._g = 0x64f98fa7
  16102. this._h = 0xbefa4fa4
  16103. return this
  16104. }
  16105. Sha224.prototype._hash = function () {
  16106. var H = Buffer.allocUnsafe(28)
  16107. H.writeInt32BE(this._a, 0)
  16108. H.writeInt32BE(this._b, 4)
  16109. H.writeInt32BE(this._c, 8)
  16110. H.writeInt32BE(this._d, 12)
  16111. H.writeInt32BE(this._e, 16)
  16112. H.writeInt32BE(this._f, 20)
  16113. H.writeInt32BE(this._g, 24)
  16114. return H
  16115. }
  16116. module.exports = Sha224
  16117. /***/ }),
  16118. /* 113 */
  16119. /*!***************************************!*\
  16120. !*** ./node_modules/sha.js/sha256.js ***!
  16121. \***************************************/
  16122. /*! no static exports found */
  16123. /***/ (function(module, exports, __webpack_require__) {
  16124. /**
  16125. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  16126. * in FIPS 180-2
  16127. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  16128. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16129. *
  16130. */
  16131. var inherits = __webpack_require__(/*! inherits */ 88)
  16132. var Hash = __webpack_require__(/*! ./hash */ 110)
  16133. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16134. var K = [
  16135. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  16136. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  16137. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  16138. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  16139. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  16140. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  16141. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  16142. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  16143. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  16144. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  16145. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  16146. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  16147. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  16148. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  16149. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  16150. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  16151. ]
  16152. var W = new Array(64)
  16153. function Sha256 () {
  16154. this.init()
  16155. this._w = W // new Array(64)
  16156. Hash.call(this, 64, 56)
  16157. }
  16158. inherits(Sha256, Hash)
  16159. Sha256.prototype.init = function () {
  16160. this._a = 0x6a09e667
  16161. this._b = 0xbb67ae85
  16162. this._c = 0x3c6ef372
  16163. this._d = 0xa54ff53a
  16164. this._e = 0x510e527f
  16165. this._f = 0x9b05688c
  16166. this._g = 0x1f83d9ab
  16167. this._h = 0x5be0cd19
  16168. return this
  16169. }
  16170. function ch (x, y, z) {
  16171. return z ^ (x & (y ^ z))
  16172. }
  16173. function maj (x, y, z) {
  16174. return (x & y) | (z & (x | y))
  16175. }
  16176. function sigma0 (x) {
  16177. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  16178. }
  16179. function sigma1 (x) {
  16180. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  16181. }
  16182. function gamma0 (x) {
  16183. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  16184. }
  16185. function gamma1 (x) {
  16186. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  16187. }
  16188. Sha256.prototype._update = function (M) {
  16189. var W = this._w
  16190. var a = this._a | 0
  16191. var b = this._b | 0
  16192. var c = this._c | 0
  16193. var d = this._d | 0
  16194. var e = this._e | 0
  16195. var f = this._f | 0
  16196. var g = this._g | 0
  16197. var h = this._h | 0
  16198. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  16199. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  16200. for (var j = 0; j < 64; ++j) {
  16201. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  16202. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  16203. h = g
  16204. g = f
  16205. f = e
  16206. e = (d + T1) | 0
  16207. d = c
  16208. c = b
  16209. b = a
  16210. a = (T1 + T2) | 0
  16211. }
  16212. this._a = (a + this._a) | 0
  16213. this._b = (b + this._b) | 0
  16214. this._c = (c + this._c) | 0
  16215. this._d = (d + this._d) | 0
  16216. this._e = (e + this._e) | 0
  16217. this._f = (f + this._f) | 0
  16218. this._g = (g + this._g) | 0
  16219. this._h = (h + this._h) | 0
  16220. }
  16221. Sha256.prototype._hash = function () {
  16222. var H = Buffer.allocUnsafe(32)
  16223. H.writeInt32BE(this._a, 0)
  16224. H.writeInt32BE(this._b, 4)
  16225. H.writeInt32BE(this._c, 8)
  16226. H.writeInt32BE(this._d, 12)
  16227. H.writeInt32BE(this._e, 16)
  16228. H.writeInt32BE(this._f, 20)
  16229. H.writeInt32BE(this._g, 24)
  16230. H.writeInt32BE(this._h, 28)
  16231. return H
  16232. }
  16233. module.exports = Sha256
  16234. /***/ }),
  16235. /* 114 */
  16236. /*!***************************************!*\
  16237. !*** ./node_modules/sha.js/sha384.js ***!
  16238. \***************************************/
  16239. /*! no static exports found */
  16240. /***/ (function(module, exports, __webpack_require__) {
  16241. var inherits = __webpack_require__(/*! inherits */ 88)
  16242. var SHA512 = __webpack_require__(/*! ./sha512 */ 115)
  16243. var Hash = __webpack_require__(/*! ./hash */ 110)
  16244. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16245. var W = new Array(160)
  16246. function Sha384 () {
  16247. this.init()
  16248. this._w = W
  16249. Hash.call(this, 128, 112)
  16250. }
  16251. inherits(Sha384, SHA512)
  16252. Sha384.prototype.init = function () {
  16253. this._ah = 0xcbbb9d5d
  16254. this._bh = 0x629a292a
  16255. this._ch = 0x9159015a
  16256. this._dh = 0x152fecd8
  16257. this._eh = 0x67332667
  16258. this._fh = 0x8eb44a87
  16259. this._gh = 0xdb0c2e0d
  16260. this._hh = 0x47b5481d
  16261. this._al = 0xc1059ed8
  16262. this._bl = 0x367cd507
  16263. this._cl = 0x3070dd17
  16264. this._dl = 0xf70e5939
  16265. this._el = 0xffc00b31
  16266. this._fl = 0x68581511
  16267. this._gl = 0x64f98fa7
  16268. this._hl = 0xbefa4fa4
  16269. return this
  16270. }
  16271. Sha384.prototype._hash = function () {
  16272. var H = Buffer.allocUnsafe(48)
  16273. function writeInt64BE (h, l, offset) {
  16274. H.writeInt32BE(h, offset)
  16275. H.writeInt32BE(l, offset + 4)
  16276. }
  16277. writeInt64BE(this._ah, this._al, 0)
  16278. writeInt64BE(this._bh, this._bl, 8)
  16279. writeInt64BE(this._ch, this._cl, 16)
  16280. writeInt64BE(this._dh, this._dl, 24)
  16281. writeInt64BE(this._eh, this._el, 32)
  16282. writeInt64BE(this._fh, this._fl, 40)
  16283. return H
  16284. }
  16285. module.exports = Sha384
  16286. /***/ }),
  16287. /* 115 */
  16288. /*!***************************************!*\
  16289. !*** ./node_modules/sha.js/sha512.js ***!
  16290. \***************************************/
  16291. /*! no static exports found */
  16292. /***/ (function(module, exports, __webpack_require__) {
  16293. var inherits = __webpack_require__(/*! inherits */ 88)
  16294. var Hash = __webpack_require__(/*! ./hash */ 110)
  16295. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16296. var K = [
  16297. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  16298. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  16299. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  16300. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  16301. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  16302. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  16303. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  16304. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  16305. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  16306. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  16307. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  16308. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  16309. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  16310. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  16311. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  16312. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  16313. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  16314. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  16315. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  16316. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  16317. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  16318. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  16319. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  16320. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  16321. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  16322. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  16323. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  16324. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  16325. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  16326. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  16327. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  16328. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  16329. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  16330. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  16331. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  16332. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  16333. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  16334. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  16335. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  16336. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  16337. ]
  16338. var W = new Array(160)
  16339. function Sha512 () {
  16340. this.init()
  16341. this._w = W
  16342. Hash.call(this, 128, 112)
  16343. }
  16344. inherits(Sha512, Hash)
  16345. Sha512.prototype.init = function () {
  16346. this._ah = 0x6a09e667
  16347. this._bh = 0xbb67ae85
  16348. this._ch = 0x3c6ef372
  16349. this._dh = 0xa54ff53a
  16350. this._eh = 0x510e527f
  16351. this._fh = 0x9b05688c
  16352. this._gh = 0x1f83d9ab
  16353. this._hh = 0x5be0cd19
  16354. this._al = 0xf3bcc908
  16355. this._bl = 0x84caa73b
  16356. this._cl = 0xfe94f82b
  16357. this._dl = 0x5f1d36f1
  16358. this._el = 0xade682d1
  16359. this._fl = 0x2b3e6c1f
  16360. this._gl = 0xfb41bd6b
  16361. this._hl = 0x137e2179
  16362. return this
  16363. }
  16364. function Ch (x, y, z) {
  16365. return z ^ (x & (y ^ z))
  16366. }
  16367. function maj (x, y, z) {
  16368. return (x & y) | (z & (x | y))
  16369. }
  16370. function sigma0 (x, xl) {
  16371. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  16372. }
  16373. function sigma1 (x, xl) {
  16374. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  16375. }
  16376. function Gamma0 (x, xl) {
  16377. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  16378. }
  16379. function Gamma0l (x, xl) {
  16380. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  16381. }
  16382. function Gamma1 (x, xl) {
  16383. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  16384. }
  16385. function Gamma1l (x, xl) {
  16386. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  16387. }
  16388. function getCarry (a, b) {
  16389. return (a >>> 0) < (b >>> 0) ? 1 : 0
  16390. }
  16391. Sha512.prototype._update = function (M) {
  16392. var W = this._w
  16393. var ah = this._ah | 0
  16394. var bh = this._bh | 0
  16395. var ch = this._ch | 0
  16396. var dh = this._dh | 0
  16397. var eh = this._eh | 0
  16398. var fh = this._fh | 0
  16399. var gh = this._gh | 0
  16400. var hh = this._hh | 0
  16401. var al = this._al | 0
  16402. var bl = this._bl | 0
  16403. var cl = this._cl | 0
  16404. var dl = this._dl | 0
  16405. var el = this._el | 0
  16406. var fl = this._fl | 0
  16407. var gl = this._gl | 0
  16408. var hl = this._hl | 0
  16409. for (var i = 0; i < 32; i += 2) {
  16410. W[i] = M.readInt32BE(i * 4)
  16411. W[i + 1] = M.readInt32BE(i * 4 + 4)
  16412. }
  16413. for (; i < 160; i += 2) {
  16414. var xh = W[i - 15 * 2]
  16415. var xl = W[i - 15 * 2 + 1]
  16416. var gamma0 = Gamma0(xh, xl)
  16417. var gamma0l = Gamma0l(xl, xh)
  16418. xh = W[i - 2 * 2]
  16419. xl = W[i - 2 * 2 + 1]
  16420. var gamma1 = Gamma1(xh, xl)
  16421. var gamma1l = Gamma1l(xl, xh)
  16422. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  16423. var Wi7h = W[i - 7 * 2]
  16424. var Wi7l = W[i - 7 * 2 + 1]
  16425. var Wi16h = W[i - 16 * 2]
  16426. var Wi16l = W[i - 16 * 2 + 1]
  16427. var Wil = (gamma0l + Wi7l) | 0
  16428. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  16429. Wil = (Wil + gamma1l) | 0
  16430. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  16431. Wil = (Wil + Wi16l) | 0
  16432. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  16433. W[i] = Wih
  16434. W[i + 1] = Wil
  16435. }
  16436. for (var j = 0; j < 160; j += 2) {
  16437. Wih = W[j]
  16438. Wil = W[j + 1]
  16439. var majh = maj(ah, bh, ch)
  16440. var majl = maj(al, bl, cl)
  16441. var sigma0h = sigma0(ah, al)
  16442. var sigma0l = sigma0(al, ah)
  16443. var sigma1h = sigma1(eh, el)
  16444. var sigma1l = sigma1(el, eh)
  16445. // t1 = h + sigma1 + ch + K[j] + W[j]
  16446. var Kih = K[j]
  16447. var Kil = K[j + 1]
  16448. var chh = Ch(eh, fh, gh)
  16449. var chl = Ch(el, fl, gl)
  16450. var t1l = (hl + sigma1l) | 0
  16451. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  16452. t1l = (t1l + chl) | 0
  16453. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  16454. t1l = (t1l + Kil) | 0
  16455. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  16456. t1l = (t1l + Wil) | 0
  16457. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  16458. // t2 = sigma0 + maj
  16459. var t2l = (sigma0l + majl) | 0
  16460. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  16461. hh = gh
  16462. hl = gl
  16463. gh = fh
  16464. gl = fl
  16465. fh = eh
  16466. fl = el
  16467. el = (dl + t1l) | 0
  16468. eh = (dh + t1h + getCarry(el, dl)) | 0
  16469. dh = ch
  16470. dl = cl
  16471. ch = bh
  16472. cl = bl
  16473. bh = ah
  16474. bl = al
  16475. al = (t1l + t2l) | 0
  16476. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  16477. }
  16478. this._al = (this._al + al) | 0
  16479. this._bl = (this._bl + bl) | 0
  16480. this._cl = (this._cl + cl) | 0
  16481. this._dl = (this._dl + dl) | 0
  16482. this._el = (this._el + el) | 0
  16483. this._fl = (this._fl + fl) | 0
  16484. this._gl = (this._gl + gl) | 0
  16485. this._hl = (this._hl + hl) | 0
  16486. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  16487. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  16488. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  16489. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  16490. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  16491. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  16492. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  16493. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  16494. }
  16495. Sha512.prototype._hash = function () {
  16496. var H = Buffer.allocUnsafe(64)
  16497. function writeInt64BE (h, l, offset) {
  16498. H.writeInt32BE(h, offset)
  16499. H.writeInt32BE(l, offset + 4)
  16500. }
  16501. writeInt64BE(this._ah, this._al, 0)
  16502. writeInt64BE(this._bh, this._bl, 8)
  16503. writeInt64BE(this._ch, this._cl, 16)
  16504. writeInt64BE(this._dh, this._dl, 24)
  16505. writeInt64BE(this._eh, this._el, 32)
  16506. writeInt64BE(this._fh, this._fl, 40)
  16507. writeInt64BE(this._gh, this._gl, 48)
  16508. writeInt64BE(this._hh, this._hl, 56)
  16509. return H
  16510. }
  16511. module.exports = Sha512
  16512. /***/ }),
  16513. /* 116 */
  16514. /*!*******************************************!*\
  16515. !*** ./node_modules/cipher-base/index.js ***!
  16516. \*******************************************/
  16517. /*! no static exports found */
  16518. /***/ (function(module, exports, __webpack_require__) {
  16519. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16520. var Transform = __webpack_require__(/*! stream */ 117).Transform
  16521. var StringDecoder = __webpack_require__(/*! string_decoder */ 104).StringDecoder
  16522. var inherits = __webpack_require__(/*! inherits */ 88)
  16523. function CipherBase (hashMode) {
  16524. Transform.call(this)
  16525. this.hashMode = typeof hashMode === 'string'
  16526. if (this.hashMode) {
  16527. this[hashMode] = this._finalOrDigest
  16528. } else {
  16529. this.final = this._finalOrDigest
  16530. }
  16531. if (this._final) {
  16532. this.__final = this._final
  16533. this._final = null
  16534. }
  16535. this._decoder = null
  16536. this._encoding = null
  16537. }
  16538. inherits(CipherBase, Transform)
  16539. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  16540. if (typeof data === 'string') {
  16541. data = Buffer.from(data, inputEnc)
  16542. }
  16543. var outData = this._update(data)
  16544. if (this.hashMode) return this
  16545. if (outputEnc) {
  16546. outData = this._toString(outData, outputEnc)
  16547. }
  16548. return outData
  16549. }
  16550. CipherBase.prototype.setAutoPadding = function () {}
  16551. CipherBase.prototype.getAuthTag = function () {
  16552. throw new Error('trying to get auth tag in unsupported state')
  16553. }
  16554. CipherBase.prototype.setAuthTag = function () {
  16555. throw new Error('trying to set auth tag in unsupported state')
  16556. }
  16557. CipherBase.prototype.setAAD = function () {
  16558. throw new Error('trying to set aad in unsupported state')
  16559. }
  16560. CipherBase.prototype._transform = function (data, _, next) {
  16561. var err
  16562. try {
  16563. if (this.hashMode) {
  16564. this._update(data)
  16565. } else {
  16566. this.push(this._update(data))
  16567. }
  16568. } catch (e) {
  16569. err = e
  16570. } finally {
  16571. next(err)
  16572. }
  16573. }
  16574. CipherBase.prototype._flush = function (done) {
  16575. var err
  16576. try {
  16577. this.push(this.__final())
  16578. } catch (e) {
  16579. err = e
  16580. }
  16581. done(err)
  16582. }
  16583. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  16584. var outData = this.__final() || Buffer.alloc(0)
  16585. if (outputEnc) {
  16586. outData = this._toString(outData, outputEnc, true)
  16587. }
  16588. return outData
  16589. }
  16590. CipherBase.prototype._toString = function (value, enc, fin) {
  16591. if (!this._decoder) {
  16592. this._decoder = new StringDecoder(enc)
  16593. this._encoding = enc
  16594. }
  16595. if (this._encoding !== enc) throw new Error('can\'t switch encodings')
  16596. var out = this._decoder.write(value)
  16597. if (fin) {
  16598. out += this._decoder.end()
  16599. }
  16600. return out
  16601. }
  16602. module.exports = CipherBase
  16603. /***/ }),
  16604. /* 117 */
  16605. /*!*************************************************!*\
  16606. !*** ./node_modules/stream-browserify/index.js ***!
  16607. \*************************************************/
  16608. /*! no static exports found */
  16609. /***/ (function(module, exports, __webpack_require__) {
  16610. // Copyright Joyent, Inc. and other Node contributors.
  16611. //
  16612. // Permission is hereby granted, free of charge, to any person obtaining a
  16613. // copy of this software and associated documentation files (the
  16614. // "Software"), to deal in the Software without restriction, including
  16615. // without limitation the rights to use, copy, modify, merge, publish,
  16616. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16617. // persons to whom the Software is furnished to do so, subject to the
  16618. // following conditions:
  16619. //
  16620. // The above copyright notice and this permission notice shall be included
  16621. // in all copies or substantial portions of the Software.
  16622. //
  16623. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16624. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16625. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16626. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16627. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16628. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16629. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16630. module.exports = Stream;
  16631. var EE = __webpack_require__(/*! events */ 94).EventEmitter;
  16632. var inherits = __webpack_require__(/*! inherits */ 88);
  16633. inherits(Stream, EE);
  16634. Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 91);
  16635. Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 118);
  16636. Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 119);
  16637. Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 120);
  16638. Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 121);
  16639. // Backwards-compat with node 0.4.x
  16640. Stream.Stream = Stream;
  16641. // old-style streams. Note that the pipe method (the only relevant
  16642. // part of this class) is overridden in the Readable class.
  16643. function Stream() {
  16644. EE.call(this);
  16645. }
  16646. Stream.prototype.pipe = function(dest, options) {
  16647. var source = this;
  16648. function ondata(chunk) {
  16649. if (dest.writable) {
  16650. if (false === dest.write(chunk) && source.pause) {
  16651. source.pause();
  16652. }
  16653. }
  16654. }
  16655. source.on('data', ondata);
  16656. function ondrain() {
  16657. if (source.readable && source.resume) {
  16658. source.resume();
  16659. }
  16660. }
  16661. dest.on('drain', ondrain);
  16662. // If the 'end' option is not supplied, dest.end() will be called when
  16663. // source gets the 'end' or 'close' events. Only dest.end() once.
  16664. if (!dest._isStdio && (!options || options.end !== false)) {
  16665. source.on('end', onend);
  16666. source.on('close', onclose);
  16667. }
  16668. var didOnEnd = false;
  16669. function onend() {
  16670. if (didOnEnd) return;
  16671. didOnEnd = true;
  16672. dest.end();
  16673. }
  16674. function onclose() {
  16675. if (didOnEnd) return;
  16676. didOnEnd = true;
  16677. if (typeof dest.destroy === 'function') dest.destroy();
  16678. }
  16679. // don't leave dangling pipes when there are errors.
  16680. function onerror(er) {
  16681. cleanup();
  16682. if (EE.listenerCount(this, 'error') === 0) {
  16683. throw er; // Unhandled stream error in pipe.
  16684. }
  16685. }
  16686. source.on('error', onerror);
  16687. dest.on('error', onerror);
  16688. // remove all the event listeners that were added.
  16689. function cleanup() {
  16690. source.removeListener('data', ondata);
  16691. dest.removeListener('drain', ondrain);
  16692. source.removeListener('end', onend);
  16693. source.removeListener('close', onclose);
  16694. source.removeListener('error', onerror);
  16695. dest.removeListener('error', onerror);
  16696. source.removeListener('end', cleanup);
  16697. source.removeListener('close', cleanup);
  16698. dest.removeListener('close', cleanup);
  16699. }
  16700. source.on('end', cleanup);
  16701. source.on('close', cleanup);
  16702. dest.on('close', cleanup);
  16703. dest.emit('pipe', source);
  16704. // Allow for unix-like usage: A.pipe(B).pipe(C)
  16705. return dest;
  16706. };
  16707. /***/ }),
  16708. /* 118 */
  16709. /*!**********************************************************!*\
  16710. !*** ./node_modules/readable-stream/writable-browser.js ***!
  16711. \**********************************************************/
  16712. /*! no static exports found */
  16713. /***/ (function(module, exports, __webpack_require__) {
  16714. module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 102);
  16715. /***/ }),
  16716. /* 119 */
  16717. /*!********************************************************!*\
  16718. !*** ./node_modules/readable-stream/duplex-browser.js ***!
  16719. \********************************************************/
  16720. /*! no static exports found */
  16721. /***/ (function(module, exports, __webpack_require__) {
  16722. module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 101);
  16723. /***/ }),
  16724. /* 120 */
  16725. /*!***************************************************!*\
  16726. !*** ./node_modules/readable-stream/transform.js ***!
  16727. \***************************************************/
  16728. /*! no static exports found */
  16729. /***/ (function(module, exports, __webpack_require__) {
  16730. module.exports = __webpack_require__(/*! ./readable */ 91).Transform
  16731. /***/ }),
  16732. /* 121 */
  16733. /*!*****************************************************!*\
  16734. !*** ./node_modules/readable-stream/passthrough.js ***!
  16735. \*****************************************************/
  16736. /*! no static exports found */
  16737. /***/ (function(module, exports, __webpack_require__) {
  16738. module.exports = __webpack_require__(/*! ./readable */ 91).PassThrough
  16739. /***/ }),
  16740. /* 122 */
  16741. /*!*********************************************!*\
  16742. !*** ./node_modules/create-hmac/browser.js ***!
  16743. \*********************************************/
  16744. /*! no static exports found */
  16745. /***/ (function(module, exports, __webpack_require__) {
  16746. "use strict";
  16747. var inherits = __webpack_require__(/*! inherits */ 88)
  16748. var Legacy = __webpack_require__(/*! ./legacy */ 123)
  16749. var Base = __webpack_require__(/*! cipher-base */ 116)
  16750. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16751. var md5 = __webpack_require__(/*! create-hash/md5 */ 124)
  16752. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 107)
  16753. var sha = __webpack_require__(/*! sha.js */ 108)
  16754. var ZEROS = Buffer.alloc(128)
  16755. function Hmac (alg, key) {
  16756. Base.call(this, 'digest')
  16757. if (typeof key === 'string') {
  16758. key = Buffer.from(key)
  16759. }
  16760. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  16761. this._alg = alg
  16762. this._key = key
  16763. if (key.length > blocksize) {
  16764. var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16765. key = hash.update(key).digest()
  16766. } else if (key.length < blocksize) {
  16767. key = Buffer.concat([key, ZEROS], blocksize)
  16768. }
  16769. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16770. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16771. for (var i = 0; i < blocksize; i++) {
  16772. ipad[i] = key[i] ^ 0x36
  16773. opad[i] = key[i] ^ 0x5C
  16774. }
  16775. this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16776. this._hash.update(ipad)
  16777. }
  16778. inherits(Hmac, Base)
  16779. Hmac.prototype._update = function (data) {
  16780. this._hash.update(data)
  16781. }
  16782. Hmac.prototype._final = function () {
  16783. var h = this._hash.digest()
  16784. var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
  16785. return hash.update(this._opad).update(h).digest()
  16786. }
  16787. module.exports = function createHmac (alg, key) {
  16788. alg = alg.toLowerCase()
  16789. if (alg === 'rmd160' || alg === 'ripemd160') {
  16790. return new Hmac('rmd160', key)
  16791. }
  16792. if (alg === 'md5') {
  16793. return new Legacy(md5, key)
  16794. }
  16795. return new Hmac(alg, key)
  16796. }
  16797. /***/ }),
  16798. /* 123 */
  16799. /*!********************************************!*\
  16800. !*** ./node_modules/create-hmac/legacy.js ***!
  16801. \********************************************/
  16802. /*! no static exports found */
  16803. /***/ (function(module, exports, __webpack_require__) {
  16804. "use strict";
  16805. var inherits = __webpack_require__(/*! inherits */ 88)
  16806. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16807. var Base = __webpack_require__(/*! cipher-base */ 116)
  16808. var ZEROS = Buffer.alloc(128)
  16809. var blocksize = 64
  16810. function Hmac (alg, key) {
  16811. Base.call(this, 'digest')
  16812. if (typeof key === 'string') {
  16813. key = Buffer.from(key)
  16814. }
  16815. this._alg = alg
  16816. this._key = key
  16817. if (key.length > blocksize) {
  16818. key = alg(key)
  16819. } else if (key.length < blocksize) {
  16820. key = Buffer.concat([key, ZEROS], blocksize)
  16821. }
  16822. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16823. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16824. for (var i = 0; i < blocksize; i++) {
  16825. ipad[i] = key[i] ^ 0x36
  16826. opad[i] = key[i] ^ 0x5C
  16827. }
  16828. this._hash = [ipad]
  16829. }
  16830. inherits(Hmac, Base)
  16831. Hmac.prototype._update = function (data) {
  16832. this._hash.push(data)
  16833. }
  16834. Hmac.prototype._final = function () {
  16835. var h = this._alg(Buffer.concat(this._hash))
  16836. return this._alg(Buffer.concat([this._opad, h]))
  16837. }
  16838. module.exports = Hmac
  16839. /***/ }),
  16840. /* 124 */
  16841. /*!*****************************************!*\
  16842. !*** ./node_modules/create-hash/md5.js ***!
  16843. \*****************************************/
  16844. /*! no static exports found */
  16845. /***/ (function(module, exports, __webpack_require__) {
  16846. var MD5 = __webpack_require__(/*! md5.js */ 89)
  16847. module.exports = function (buffer) {
  16848. return new MD5().update(buffer).digest()
  16849. }
  16850. /***/ }),
  16851. /* 125 */
  16852. /*!***********************************************!*\
  16853. !*** ./node_modules/browserify-sign/algos.js ***!
  16854. \***********************************************/
  16855. /*! no static exports found */
  16856. /***/ (function(module, exports, __webpack_require__) {
  16857. module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 126)
  16858. /***/ }),
  16859. /* 126 */
  16860. /*!**************************************************************!*\
  16861. !*** ./node_modules/browserify-sign/browser/algorithms.json ***!
  16862. \**************************************************************/
  16863. /*! exports provided: sha224WithRSAEncryption, RSA-SHA224, sha256WithRSAEncryption, RSA-SHA256, sha384WithRSAEncryption, RSA-SHA384, sha512WithRSAEncryption, RSA-SHA512, RSA-SHA1, ecdsa-with-SHA1, sha256, sha224, sha384, sha512, DSA-SHA, DSA-SHA1, DSA, DSA-WITH-SHA224, DSA-SHA224, DSA-WITH-SHA256, DSA-SHA256, DSA-WITH-SHA384, DSA-SHA384, DSA-WITH-SHA512, DSA-SHA512, DSA-RIPEMD160, ripemd160WithRSA, RSA-RIPEMD160, md5WithRSAEncryption, RSA-MD5, default */
  16864. /***/ (function(module) {
  16865. module.exports = JSON.parse("{\"sha224WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"RSA-SHA224\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"sha256WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"RSA-SHA256\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"sha384WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"RSA-SHA384\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"sha512WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA512\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA1\":{\"sign\":\"rsa\",\"hash\":\"sha1\",\"id\":\"3021300906052b0e03021a05000414\"},\"ecdsa-with-SHA1\":{\"sign\":\"ecdsa\",\"hash\":\"sha1\",\"id\":\"\"},\"sha256\":{\"sign\":\"ecdsa\",\"hash\":\"sha256\",\"id\":\"\"},\"sha224\":{\"sign\":\"ecdsa\",\"hash\":\"sha224\",\"id\":\"\"},\"sha384\":{\"sign\":\"ecdsa\",\"hash\":\"sha384\",\"id\":\"\"},\"sha512\":{\"sign\":\"ecdsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-SHA1\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-WITH-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-WITH-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-WITH-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-WITH-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-RIPEMD160\":{\"sign\":\"dsa\",\"hash\":\"rmd160\",\"id\":\"\"},\"ripemd160WithRSA\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"RSA-RIPEMD160\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"md5WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"},\"RSA-MD5\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"}}");
  16866. /***/ }),
  16867. /* 127 */
  16868. /*!****************************************!*\
  16869. !*** ./node_modules/pbkdf2/browser.js ***!
  16870. \****************************************/
  16871. /*! no static exports found */
  16872. /***/ (function(module, exports, __webpack_require__) {
  16873. exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 128)
  16874. exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 131)
  16875. /***/ }),
  16876. /* 128 */
  16877. /*!******************************************!*\
  16878. !*** ./node_modules/pbkdf2/lib/async.js ***!
  16879. \******************************************/
  16880. /*! no static exports found */
  16881. /***/ (function(module, exports, __webpack_require__) {
  16882. /* WEBPACK VAR INJECTION */(function(global, process) {var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  16883. var checkParameters = __webpack_require__(/*! ./precondition */ 129)
  16884. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 130)
  16885. var sync = __webpack_require__(/*! ./sync */ 131)
  16886. var toBuffer = __webpack_require__(/*! ./to-buffer */ 132)
  16887. var ZERO_BUF
  16888. var subtle = global.crypto && global.crypto.subtle
  16889. var toBrowser = {
  16890. sha: 'SHA-1',
  16891. 'sha-1': 'SHA-1',
  16892. sha1: 'SHA-1',
  16893. sha256: 'SHA-256',
  16894. 'sha-256': 'SHA-256',
  16895. sha384: 'SHA-384',
  16896. 'sha-384': 'SHA-384',
  16897. 'sha-512': 'SHA-512',
  16898. sha512: 'SHA-512'
  16899. }
  16900. var checks = []
  16901. function checkNative (algo) {
  16902. if (global.process && !global.process.browser) {
  16903. return Promise.resolve(false)
  16904. }
  16905. if (!subtle || !subtle.importKey || !subtle.deriveBits) {
  16906. return Promise.resolve(false)
  16907. }
  16908. if (checks[algo] !== undefined) {
  16909. return checks[algo]
  16910. }
  16911. ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
  16912. var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
  16913. .then(function () {
  16914. return true
  16915. }).catch(function () {
  16916. return false
  16917. })
  16918. checks[algo] = prom
  16919. return prom
  16920. }
  16921. function browserPbkdf2 (password, salt, iterations, length, algo) {
  16922. return subtle.importKey(
  16923. 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']
  16924. ).then(function (key) {
  16925. return subtle.deriveBits({
  16926. name: 'PBKDF2',
  16927. salt: salt,
  16928. iterations: iterations,
  16929. hash: {
  16930. name: algo
  16931. }
  16932. }, key, length << 3)
  16933. }).then(function (res) {
  16934. return Buffer.from(res)
  16935. })
  16936. }
  16937. function resolvePromise (promise, callback) {
  16938. promise.then(function (out) {
  16939. process.nextTick(function () {
  16940. callback(null, out)
  16941. })
  16942. }, function (e) {
  16943. process.nextTick(function () {
  16944. callback(e)
  16945. })
  16946. })
  16947. }
  16948. module.exports = function (password, salt, iterations, keylen, digest, callback) {
  16949. if (typeof digest === 'function') {
  16950. callback = digest
  16951. digest = undefined
  16952. }
  16953. digest = digest || 'sha1'
  16954. var algo = toBrowser[digest.toLowerCase()]
  16955. if (!algo || typeof global.Promise !== 'function') {
  16956. return process.nextTick(function () {
  16957. var out
  16958. try {
  16959. out = sync(password, salt, iterations, keylen, digest)
  16960. } catch (e) {
  16961. return callback(e)
  16962. }
  16963. callback(null, out)
  16964. })
  16965. }
  16966. checkParameters(iterations, keylen)
  16967. password = toBuffer(password, defaultEncoding, 'Password')
  16968. salt = toBuffer(salt, defaultEncoding, 'Salt')
  16969. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  16970. resolvePromise(checkNative(algo).then(function (resp) {
  16971. if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
  16972. return sync(password, salt, iterations, keylen, digest)
  16973. }), callback)
  16974. }
  16975. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 80)))
  16976. /***/ }),
  16977. /* 129 */
  16978. /*!*************************************************!*\
  16979. !*** ./node_modules/pbkdf2/lib/precondition.js ***!
  16980. \*************************************************/
  16981. /*! no static exports found */
  16982. /***/ (function(module, exports) {
  16983. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  16984. module.exports = function (iterations, keylen) {
  16985. if (typeof iterations !== 'number') {
  16986. throw new TypeError('Iterations not a number')
  16987. }
  16988. if (iterations < 0) {
  16989. throw new TypeError('Bad iterations')
  16990. }
  16991. if (typeof keylen !== 'number') {
  16992. throw new TypeError('Key length not a number')
  16993. }
  16994. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  16995. throw new TypeError('Bad key length')
  16996. }
  16997. }
  16998. /***/ }),
  16999. /* 130 */
  17000. /*!*****************************************************!*\
  17001. !*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
  17002. \*****************************************************/
  17003. /*! no static exports found */
  17004. /***/ (function(module, exports, __webpack_require__) {
  17005. /* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding
  17006. /* istanbul ignore next */
  17007. if (process.browser) {
  17008. defaultEncoding = 'utf-8'
  17009. } else if (process.version) {
  17010. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  17011. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  17012. } else {
  17013. defaultEncoding = 'utf-8'
  17014. }
  17015. module.exports = defaultEncoding
  17016. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 80)))
  17017. /***/ }),
  17018. /* 131 */
  17019. /*!*************************************************!*\
  17020. !*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
  17021. \*************************************************/
  17022. /*! no static exports found */
  17023. /***/ (function(module, exports, __webpack_require__) {
  17024. var md5 = __webpack_require__(/*! create-hash/md5 */ 124)
  17025. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 107)
  17026. var sha = __webpack_require__(/*! sha.js */ 108)
  17027. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  17028. var checkParameters = __webpack_require__(/*! ./precondition */ 129)
  17029. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 130)
  17030. var toBuffer = __webpack_require__(/*! ./to-buffer */ 132)
  17031. var ZEROS = Buffer.alloc(128)
  17032. var sizes = {
  17033. md5: 16,
  17034. sha1: 20,
  17035. sha224: 28,
  17036. sha256: 32,
  17037. sha384: 48,
  17038. sha512: 64,
  17039. rmd160: 20,
  17040. ripemd160: 20
  17041. }
  17042. function Hmac (alg, key, saltLen) {
  17043. var hash = getDigest(alg)
  17044. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  17045. if (key.length > blocksize) {
  17046. key = hash(key)
  17047. } else if (key.length < blocksize) {
  17048. key = Buffer.concat([key, ZEROS], blocksize)
  17049. }
  17050. var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
  17051. var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
  17052. for (var i = 0; i < blocksize; i++) {
  17053. ipad[i] = key[i] ^ 0x36
  17054. opad[i] = key[i] ^ 0x5C
  17055. }
  17056. var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
  17057. ipad.copy(ipad1, 0, 0, blocksize)
  17058. this.ipad1 = ipad1
  17059. this.ipad2 = ipad
  17060. this.opad = opad
  17061. this.alg = alg
  17062. this.blocksize = blocksize
  17063. this.hash = hash
  17064. this.size = sizes[alg]
  17065. }
  17066. Hmac.prototype.run = function (data, ipad) {
  17067. data.copy(ipad, this.blocksize)
  17068. var h = this.hash(ipad)
  17069. h.copy(this.opad, this.blocksize)
  17070. return this.hash(this.opad)
  17071. }
  17072. function getDigest (alg) {
  17073. function shaFunc (data) {
  17074. return sha(alg).update(data).digest()
  17075. }
  17076. function rmd160Func (data) {
  17077. return new RIPEMD160().update(data).digest()
  17078. }
  17079. if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
  17080. if (alg === 'md5') return md5
  17081. return shaFunc
  17082. }
  17083. function pbkdf2 (password, salt, iterations, keylen, digest) {
  17084. checkParameters(iterations, keylen)
  17085. password = toBuffer(password, defaultEncoding, 'Password')
  17086. salt = toBuffer(salt, defaultEncoding, 'Salt')
  17087. digest = digest || 'sha1'
  17088. var hmac = new Hmac(digest, password, salt.length)
  17089. var DK = Buffer.allocUnsafe(keylen)
  17090. var block1 = Buffer.allocUnsafe(salt.length + 4)
  17091. salt.copy(block1, 0, 0, salt.length)
  17092. var destPos = 0
  17093. var hLen = sizes[digest]
  17094. var l = Math.ceil(keylen / hLen)
  17095. for (var i = 1; i <= l; i++) {
  17096. block1.writeUInt32BE(i, salt.length)
  17097. var T = hmac.run(block1, hmac.ipad1)
  17098. var U = T
  17099. for (var j = 1; j < iterations; j++) {
  17100. U = hmac.run(U, hmac.ipad2)
  17101. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  17102. }
  17103. T.copy(DK, destPos)
  17104. destPos += hLen
  17105. }
  17106. return DK
  17107. }
  17108. module.exports = pbkdf2
  17109. /***/ }),
  17110. /* 132 */
  17111. /*!**********************************************!*\
  17112. !*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
  17113. \**********************************************/
  17114. /*! no static exports found */
  17115. /***/ (function(module, exports, __webpack_require__) {
  17116. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  17117. module.exports = function (thing, encoding, name) {
  17118. if (Buffer.isBuffer(thing)) {
  17119. return thing
  17120. } else if (typeof thing === 'string') {
  17121. return Buffer.from(thing, encoding)
  17122. } else if (ArrayBuffer.isView(thing)) {
  17123. return Buffer.from(thing.buffer)
  17124. } else {
  17125. throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
  17126. }
  17127. }
  17128. /***/ }),
  17129. /* 133 */
  17130. /*!***************************************************!*\
  17131. !*** ./node_modules/browserify-cipher/browser.js ***!
  17132. \***************************************************/
  17133. /*! no static exports found */
  17134. /***/ (function(module, exports, __webpack_require__) {
  17135. var DES = __webpack_require__(/*! browserify-des */ 134)
  17136. var aes = __webpack_require__(/*! browserify-aes/browser */ 142)
  17137. var aesModes = __webpack_require__(/*! browserify-aes/modes */ 144)
  17138. var desModes = __webpack_require__(/*! browserify-des/modes */ 161)
  17139. var ebtk = __webpack_require__(/*! evp_bytestokey */ 159)
  17140. function createCipher (suite, password) {
  17141. suite = suite.toLowerCase()
  17142. var keyLen, ivLen
  17143. if (aesModes[suite]) {
  17144. keyLen = aesModes[suite].key
  17145. ivLen = aesModes[suite].iv
  17146. } else if (desModes[suite]) {
  17147. keyLen = desModes[suite].key * 8
  17148. ivLen = desModes[suite].iv
  17149. } else {
  17150. throw new TypeError('invalid suite type')
  17151. }
  17152. var keys = ebtk(password, false, keyLen, ivLen)
  17153. return createCipheriv(suite, keys.key, keys.iv)
  17154. }
  17155. function createDecipher (suite, password) {
  17156. suite = suite.toLowerCase()
  17157. var keyLen, ivLen
  17158. if (aesModes[suite]) {
  17159. keyLen = aesModes[suite].key
  17160. ivLen = aesModes[suite].iv
  17161. } else if (desModes[suite]) {
  17162. keyLen = desModes[suite].key * 8
  17163. ivLen = desModes[suite].iv
  17164. } else {
  17165. throw new TypeError('invalid suite type')
  17166. }
  17167. var keys = ebtk(password, false, keyLen, ivLen)
  17168. return createDecipheriv(suite, keys.key, keys.iv)
  17169. }
  17170. function createCipheriv (suite, key, iv) {
  17171. suite = suite.toLowerCase()
  17172. if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
  17173. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
  17174. throw new TypeError('invalid suite type')
  17175. }
  17176. function createDecipheriv (suite, key, iv) {
  17177. suite = suite.toLowerCase()
  17178. if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
  17179. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
  17180. throw new TypeError('invalid suite type')
  17181. }
  17182. function getCiphers () {
  17183. return Object.keys(desModes).concat(aes.getCiphers())
  17184. }
  17185. exports.createCipher = exports.Cipher = createCipher
  17186. exports.createCipheriv = exports.Cipheriv = createCipheriv
  17187. exports.createDecipher = exports.Decipher = createDecipher
  17188. exports.createDecipheriv = exports.Decipheriv = createDecipheriv
  17189. exports.listCiphers = exports.getCiphers = getCiphers
  17190. /***/ }),
  17191. /* 134 */
  17192. /*!**********************************************!*\
  17193. !*** ./node_modules/browserify-des/index.js ***!
  17194. \**********************************************/
  17195. /*! no static exports found */
  17196. /***/ (function(module, exports, __webpack_require__) {
  17197. var CipherBase = __webpack_require__(/*! cipher-base */ 116)
  17198. var des = __webpack_require__(/*! des.js */ 135)
  17199. var inherits = __webpack_require__(/*! inherits */ 88)
  17200. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  17201. var modes = {
  17202. 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
  17203. 'des-ede3': des.EDE,
  17204. 'des-ede-cbc': des.CBC.instantiate(des.EDE),
  17205. 'des-ede': des.EDE,
  17206. 'des-cbc': des.CBC.instantiate(des.DES),
  17207. 'des-ecb': des.DES
  17208. }
  17209. modes.des = modes['des-cbc']
  17210. modes.des3 = modes['des-ede3-cbc']
  17211. module.exports = DES
  17212. inherits(DES, CipherBase)
  17213. function DES (opts) {
  17214. CipherBase.call(this)
  17215. var modeName = opts.mode.toLowerCase()
  17216. var mode = modes[modeName]
  17217. var type
  17218. if (opts.decrypt) {
  17219. type = 'decrypt'
  17220. } else {
  17221. type = 'encrypt'
  17222. }
  17223. var key = opts.key
  17224. if (!Buffer.isBuffer(key)) {
  17225. key = Buffer.from(key)
  17226. }
  17227. if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
  17228. key = Buffer.concat([key, key.slice(0, 8)])
  17229. }
  17230. var iv = opts.iv
  17231. if (!Buffer.isBuffer(iv)) {
  17232. iv = Buffer.from(iv)
  17233. }
  17234. this._des = mode.create({
  17235. key: key,
  17236. iv: iv,
  17237. type: type
  17238. })
  17239. }
  17240. DES.prototype._update = function (data) {
  17241. return Buffer.from(this._des.update(data))
  17242. }
  17243. DES.prototype._final = function () {
  17244. return Buffer.from(this._des.final())
  17245. }
  17246. /***/ }),
  17247. /* 135 */
  17248. /*!****************************************!*\
  17249. !*** ./node_modules/des.js/lib/des.js ***!
  17250. \****************************************/
  17251. /*! no static exports found */
  17252. /***/ (function(module, exports, __webpack_require__) {
  17253. "use strict";
  17254. exports.utils = __webpack_require__(/*! ./des/utils */ 136);
  17255. exports.Cipher = __webpack_require__(/*! ./des/cipher */ 137);
  17256. exports.DES = __webpack_require__(/*! ./des/des */ 139);
  17257. exports.CBC = __webpack_require__(/*! ./des/cbc */ 140);
  17258. exports.EDE = __webpack_require__(/*! ./des/ede */ 141);
  17259. /***/ }),
  17260. /* 136 */
  17261. /*!**********************************************!*\
  17262. !*** ./node_modules/des.js/lib/des/utils.js ***!
  17263. \**********************************************/
  17264. /*! no static exports found */
  17265. /***/ (function(module, exports, __webpack_require__) {
  17266. "use strict";
  17267. exports.readUInt32BE = function readUInt32BE(bytes, off) {
  17268. var res = (bytes[0 + off] << 24) |
  17269. (bytes[1 + off] << 16) |
  17270. (bytes[2 + off] << 8) |
  17271. bytes[3 + off];
  17272. return res >>> 0;
  17273. };
  17274. exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
  17275. bytes[0 + off] = value >>> 24;
  17276. bytes[1 + off] = (value >>> 16) & 0xff;
  17277. bytes[2 + off] = (value >>> 8) & 0xff;
  17278. bytes[3 + off] = value & 0xff;
  17279. };
  17280. exports.ip = function ip(inL, inR, out, off) {
  17281. var outL = 0;
  17282. var outR = 0;
  17283. for (var i = 6; i >= 0; i -= 2) {
  17284. for (var j = 0; j <= 24; j += 8) {
  17285. outL <<= 1;
  17286. outL |= (inR >>> (j + i)) & 1;
  17287. }
  17288. for (var j = 0; j <= 24; j += 8) {
  17289. outL <<= 1;
  17290. outL |= (inL >>> (j + i)) & 1;
  17291. }
  17292. }
  17293. for (var i = 6; i >= 0; i -= 2) {
  17294. for (var j = 1; j <= 25; j += 8) {
  17295. outR <<= 1;
  17296. outR |= (inR >>> (j + i)) & 1;
  17297. }
  17298. for (var j = 1; j <= 25; j += 8) {
  17299. outR <<= 1;
  17300. outR |= (inL >>> (j + i)) & 1;
  17301. }
  17302. }
  17303. out[off + 0] = outL >>> 0;
  17304. out[off + 1] = outR >>> 0;
  17305. };
  17306. exports.rip = function rip(inL, inR, out, off) {
  17307. var outL = 0;
  17308. var outR = 0;
  17309. for (var i = 0; i < 4; i++) {
  17310. for (var j = 24; j >= 0; j -= 8) {
  17311. outL <<= 1;
  17312. outL |= (inR >>> (j + i)) & 1;
  17313. outL <<= 1;
  17314. outL |= (inL >>> (j + i)) & 1;
  17315. }
  17316. }
  17317. for (var i = 4; i < 8; i++) {
  17318. for (var j = 24; j >= 0; j -= 8) {
  17319. outR <<= 1;
  17320. outR |= (inR >>> (j + i)) & 1;
  17321. outR <<= 1;
  17322. outR |= (inL >>> (j + i)) & 1;
  17323. }
  17324. }
  17325. out[off + 0] = outL >>> 0;
  17326. out[off + 1] = outR >>> 0;
  17327. };
  17328. exports.pc1 = function pc1(inL, inR, out, off) {
  17329. var outL = 0;
  17330. var outR = 0;
  17331. // 7, 15, 23, 31, 39, 47, 55, 63
  17332. // 6, 14, 22, 30, 39, 47, 55, 63
  17333. // 5, 13, 21, 29, 39, 47, 55, 63
  17334. // 4, 12, 20, 28
  17335. for (var i = 7; i >= 5; i--) {
  17336. for (var j = 0; j <= 24; j += 8) {
  17337. outL <<= 1;
  17338. outL |= (inR >> (j + i)) & 1;
  17339. }
  17340. for (var j = 0; j <= 24; j += 8) {
  17341. outL <<= 1;
  17342. outL |= (inL >> (j + i)) & 1;
  17343. }
  17344. }
  17345. for (var j = 0; j <= 24; j += 8) {
  17346. outL <<= 1;
  17347. outL |= (inR >> (j + i)) & 1;
  17348. }
  17349. // 1, 9, 17, 25, 33, 41, 49, 57
  17350. // 2, 10, 18, 26, 34, 42, 50, 58
  17351. // 3, 11, 19, 27, 35, 43, 51, 59
  17352. // 36, 44, 52, 60
  17353. for (var i = 1; i <= 3; i++) {
  17354. for (var j = 0; j <= 24; j += 8) {
  17355. outR <<= 1;
  17356. outR |= (inR >> (j + i)) & 1;
  17357. }
  17358. for (var j = 0; j <= 24; j += 8) {
  17359. outR <<= 1;
  17360. outR |= (inL >> (j + i)) & 1;
  17361. }
  17362. }
  17363. for (var j = 0; j <= 24; j += 8) {
  17364. outR <<= 1;
  17365. outR |= (inL >> (j + i)) & 1;
  17366. }
  17367. out[off + 0] = outL >>> 0;
  17368. out[off + 1] = outR >>> 0;
  17369. };
  17370. exports.r28shl = function r28shl(num, shift) {
  17371. return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
  17372. };
  17373. var pc2table = [
  17374. // inL => outL
  17375. 14, 11, 17, 4, 27, 23, 25, 0,
  17376. 13, 22, 7, 18, 5, 9, 16, 24,
  17377. 2, 20, 12, 21, 1, 8, 15, 26,
  17378. // inR => outR
  17379. 15, 4, 25, 19, 9, 1, 26, 16,
  17380. 5, 11, 23, 8, 12, 7, 17, 0,
  17381. 22, 3, 10, 14, 6, 20, 27, 24
  17382. ];
  17383. exports.pc2 = function pc2(inL, inR, out, off) {
  17384. var outL = 0;
  17385. var outR = 0;
  17386. var len = pc2table.length >>> 1;
  17387. for (var i = 0; i < len; i++) {
  17388. outL <<= 1;
  17389. outL |= (inL >>> pc2table[i]) & 0x1;
  17390. }
  17391. for (var i = len; i < pc2table.length; i++) {
  17392. outR <<= 1;
  17393. outR |= (inR >>> pc2table[i]) & 0x1;
  17394. }
  17395. out[off + 0] = outL >>> 0;
  17396. out[off + 1] = outR >>> 0;
  17397. };
  17398. exports.expand = function expand(r, out, off) {
  17399. var outL = 0;
  17400. var outR = 0;
  17401. outL = ((r & 1) << 5) | (r >>> 27);
  17402. for (var i = 23; i >= 15; i -= 4) {
  17403. outL <<= 6;
  17404. outL |= (r >>> i) & 0x3f;
  17405. }
  17406. for (var i = 11; i >= 3; i -= 4) {
  17407. outR |= (r >>> i) & 0x3f;
  17408. outR <<= 6;
  17409. }
  17410. outR |= ((r & 0x1f) << 1) | (r >>> 31);
  17411. out[off + 0] = outL >>> 0;
  17412. out[off + 1] = outR >>> 0;
  17413. };
  17414. var sTable = [
  17415. 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
  17416. 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
  17417. 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
  17418. 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
  17419. 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
  17420. 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
  17421. 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
  17422. 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
  17423. 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
  17424. 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
  17425. 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
  17426. 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
  17427. 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
  17428. 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
  17429. 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
  17430. 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
  17431. 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
  17432. 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
  17433. 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
  17434. 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
  17435. 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
  17436. 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
  17437. 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
  17438. 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
  17439. 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
  17440. 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
  17441. 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
  17442. 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
  17443. 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
  17444. 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
  17445. 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
  17446. 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
  17447. ];
  17448. exports.substitute = function substitute(inL, inR) {
  17449. var out = 0;
  17450. for (var i = 0; i < 4; i++) {
  17451. var b = (inL >>> (18 - i * 6)) & 0x3f;
  17452. var sb = sTable[i * 0x40 + b];
  17453. out <<= 4;
  17454. out |= sb;
  17455. }
  17456. for (var i = 0; i < 4; i++) {
  17457. var b = (inR >>> (18 - i * 6)) & 0x3f;
  17458. var sb = sTable[4 * 0x40 + i * 0x40 + b];
  17459. out <<= 4;
  17460. out |= sb;
  17461. }
  17462. return out >>> 0;
  17463. };
  17464. var permuteTable = [
  17465. 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
  17466. 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
  17467. ];
  17468. exports.permute = function permute(num) {
  17469. var out = 0;
  17470. for (var i = 0; i < permuteTable.length; i++) {
  17471. out <<= 1;
  17472. out |= (num >>> permuteTable[i]) & 0x1;
  17473. }
  17474. return out >>> 0;
  17475. };
  17476. exports.padSplit = function padSplit(num, size, group) {
  17477. var str = num.toString(2);
  17478. while (str.length < size)
  17479. str = '0' + str;
  17480. var out = [];
  17481. for (var i = 0; i < size; i += group)
  17482. out.push(str.slice(i, i + group));
  17483. return out.join(' ');
  17484. };
  17485. /***/ }),
  17486. /* 137 */
  17487. /*!***********************************************!*\
  17488. !*** ./node_modules/des.js/lib/des/cipher.js ***!
  17489. \***********************************************/
  17490. /*! no static exports found */
  17491. /***/ (function(module, exports, __webpack_require__) {
  17492. "use strict";
  17493. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  17494. function Cipher(options) {
  17495. this.options = options;
  17496. this.type = this.options.type;
  17497. this.blockSize = 8;
  17498. this._init();
  17499. this.buffer = new Array(this.blockSize);
  17500. this.bufferOff = 0;
  17501. }
  17502. module.exports = Cipher;
  17503. Cipher.prototype._init = function _init() {
  17504. // Might be overrided
  17505. };
  17506. Cipher.prototype.update = function update(data) {
  17507. if (data.length === 0)
  17508. return [];
  17509. if (this.type === 'decrypt')
  17510. return this._updateDecrypt(data);
  17511. else
  17512. return this._updateEncrypt(data);
  17513. };
  17514. Cipher.prototype._buffer = function _buffer(data, off) {
  17515. // Append data to buffer
  17516. var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
  17517. for (var i = 0; i < min; i++)
  17518. this.buffer[this.bufferOff + i] = data[off + i];
  17519. this.bufferOff += min;
  17520. // Shift next
  17521. return min;
  17522. };
  17523. Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
  17524. this._update(this.buffer, 0, out, off);
  17525. this.bufferOff = 0;
  17526. return this.blockSize;
  17527. };
  17528. Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
  17529. var inputOff = 0;
  17530. var outputOff = 0;
  17531. var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
  17532. var out = new Array(count * this.blockSize);
  17533. if (this.bufferOff !== 0) {
  17534. inputOff += this._buffer(data, inputOff);
  17535. if (this.bufferOff === this.buffer.length)
  17536. outputOff += this._flushBuffer(out, outputOff);
  17537. }
  17538. // Write blocks
  17539. var max = data.length - ((data.length - inputOff) % this.blockSize);
  17540. for (; inputOff < max; inputOff += this.blockSize) {
  17541. this._update(data, inputOff, out, outputOff);
  17542. outputOff += this.blockSize;
  17543. }
  17544. // Queue rest
  17545. for (; inputOff < data.length; inputOff++, this.bufferOff++)
  17546. this.buffer[this.bufferOff] = data[inputOff];
  17547. return out;
  17548. };
  17549. Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
  17550. var inputOff = 0;
  17551. var outputOff = 0;
  17552. var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
  17553. var out = new Array(count * this.blockSize);
  17554. // TODO(indutny): optimize it, this is far from optimal
  17555. for (; count > 0; count--) {
  17556. inputOff += this._buffer(data, inputOff);
  17557. outputOff += this._flushBuffer(out, outputOff);
  17558. }
  17559. // Buffer rest of the input
  17560. inputOff += this._buffer(data, inputOff);
  17561. return out;
  17562. };
  17563. Cipher.prototype.final = function final(buffer) {
  17564. var first;
  17565. if (buffer)
  17566. first = this.update(buffer);
  17567. var last;
  17568. if (this.type === 'encrypt')
  17569. last = this._finalEncrypt();
  17570. else
  17571. last = this._finalDecrypt();
  17572. if (first)
  17573. return first.concat(last);
  17574. else
  17575. return last;
  17576. };
  17577. Cipher.prototype._pad = function _pad(buffer, off) {
  17578. if (off === 0)
  17579. return false;
  17580. while (off < buffer.length)
  17581. buffer[off++] = 0;
  17582. return true;
  17583. };
  17584. Cipher.prototype._finalEncrypt = function _finalEncrypt() {
  17585. if (!this._pad(this.buffer, this.bufferOff))
  17586. return [];
  17587. var out = new Array(this.blockSize);
  17588. this._update(this.buffer, 0, out, 0);
  17589. return out;
  17590. };
  17591. Cipher.prototype._unpad = function _unpad(buffer) {
  17592. return buffer;
  17593. };
  17594. Cipher.prototype._finalDecrypt = function _finalDecrypt() {
  17595. assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
  17596. var out = new Array(this.blockSize);
  17597. this._flushBuffer(out, 0);
  17598. return this._unpad(out);
  17599. };
  17600. /***/ }),
  17601. /* 138 */
  17602. /*!***************************************************!*\
  17603. !*** ./node_modules/minimalistic-assert/index.js ***!
  17604. \***************************************************/
  17605. /*! no static exports found */
  17606. /***/ (function(module, exports) {
  17607. module.exports = assert;
  17608. function assert(val, msg) {
  17609. if (!val)
  17610. throw new Error(msg || 'Assertion failed');
  17611. }
  17612. assert.equal = function assertEqual(l, r, msg) {
  17613. if (l != r)
  17614. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  17615. };
  17616. /***/ }),
  17617. /* 139 */
  17618. /*!********************************************!*\
  17619. !*** ./node_modules/des.js/lib/des/des.js ***!
  17620. \********************************************/
  17621. /*! no static exports found */
  17622. /***/ (function(module, exports, __webpack_require__) {
  17623. "use strict";
  17624. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  17625. var inherits = __webpack_require__(/*! inherits */ 88);
  17626. var utils = __webpack_require__(/*! ./utils */ 136);
  17627. var Cipher = __webpack_require__(/*! ./cipher */ 137);
  17628. function DESState() {
  17629. this.tmp = new Array(2);
  17630. this.keys = null;
  17631. }
  17632. function DES(options) {
  17633. Cipher.call(this, options);
  17634. var state = new DESState();
  17635. this._desState = state;
  17636. this.deriveKeys(state, options.key);
  17637. }
  17638. inherits(DES, Cipher);
  17639. module.exports = DES;
  17640. DES.create = function create(options) {
  17641. return new DES(options);
  17642. };
  17643. var shiftTable = [
  17644. 1, 1, 2, 2, 2, 2, 2, 2,
  17645. 1, 2, 2, 2, 2, 2, 2, 1
  17646. ];
  17647. DES.prototype.deriveKeys = function deriveKeys(state, key) {
  17648. state.keys = new Array(16 * 2);
  17649. assert.equal(key.length, this.blockSize, 'Invalid key length');
  17650. var kL = utils.readUInt32BE(key, 0);
  17651. var kR = utils.readUInt32BE(key, 4);
  17652. utils.pc1(kL, kR, state.tmp, 0);
  17653. kL = state.tmp[0];
  17654. kR = state.tmp[1];
  17655. for (var i = 0; i < state.keys.length; i += 2) {
  17656. var shift = shiftTable[i >>> 1];
  17657. kL = utils.r28shl(kL, shift);
  17658. kR = utils.r28shl(kR, shift);
  17659. utils.pc2(kL, kR, state.keys, i);
  17660. }
  17661. };
  17662. DES.prototype._update = function _update(inp, inOff, out, outOff) {
  17663. var state = this._desState;
  17664. var l = utils.readUInt32BE(inp, inOff);
  17665. var r = utils.readUInt32BE(inp, inOff + 4);
  17666. // Initial Permutation
  17667. utils.ip(l, r, state.tmp, 0);
  17668. l = state.tmp[0];
  17669. r = state.tmp[1];
  17670. if (this.type === 'encrypt')
  17671. this._encrypt(state, l, r, state.tmp, 0);
  17672. else
  17673. this._decrypt(state, l, r, state.tmp, 0);
  17674. l = state.tmp[0];
  17675. r = state.tmp[1];
  17676. utils.writeUInt32BE(out, l, outOff);
  17677. utils.writeUInt32BE(out, r, outOff + 4);
  17678. };
  17679. DES.prototype._pad = function _pad(buffer, off) {
  17680. var value = buffer.length - off;
  17681. for (var i = off; i < buffer.length; i++)
  17682. buffer[i] = value;
  17683. return true;
  17684. };
  17685. DES.prototype._unpad = function _unpad(buffer) {
  17686. var pad = buffer[buffer.length - 1];
  17687. for (var i = buffer.length - pad; i < buffer.length; i++)
  17688. assert.equal(buffer[i], pad);
  17689. return buffer.slice(0, buffer.length - pad);
  17690. };
  17691. DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
  17692. var l = lStart;
  17693. var r = rStart;
  17694. // Apply f() x16 times
  17695. for (var i = 0; i < state.keys.length; i += 2) {
  17696. var keyL = state.keys[i];
  17697. var keyR = state.keys[i + 1];
  17698. // f(r, k)
  17699. utils.expand(r, state.tmp, 0);
  17700. keyL ^= state.tmp[0];
  17701. keyR ^= state.tmp[1];
  17702. var s = utils.substitute(keyL, keyR);
  17703. var f = utils.permute(s);
  17704. var t = r;
  17705. r = (l ^ f) >>> 0;
  17706. l = t;
  17707. }
  17708. // Reverse Initial Permutation
  17709. utils.rip(r, l, out, off);
  17710. };
  17711. DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
  17712. var l = rStart;
  17713. var r = lStart;
  17714. // Apply f() x16 times
  17715. for (var i = state.keys.length - 2; i >= 0; i -= 2) {
  17716. var keyL = state.keys[i];
  17717. var keyR = state.keys[i + 1];
  17718. // f(r, k)
  17719. utils.expand(l, state.tmp, 0);
  17720. keyL ^= state.tmp[0];
  17721. keyR ^= state.tmp[1];
  17722. var s = utils.substitute(keyL, keyR);
  17723. var f = utils.permute(s);
  17724. var t = l;
  17725. l = (r ^ f) >>> 0;
  17726. r = t;
  17727. }
  17728. // Reverse Initial Permutation
  17729. utils.rip(l, r, out, off);
  17730. };
  17731. /***/ }),
  17732. /* 140 */
  17733. /*!********************************************!*\
  17734. !*** ./node_modules/des.js/lib/des/cbc.js ***!
  17735. \********************************************/
  17736. /*! no static exports found */
  17737. /***/ (function(module, exports, __webpack_require__) {
  17738. "use strict";
  17739. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  17740. var inherits = __webpack_require__(/*! inherits */ 88);
  17741. var proto = {};
  17742. function CBCState(iv) {
  17743. assert.equal(iv.length, 8, 'Invalid IV length');
  17744. this.iv = new Array(8);
  17745. for (var i = 0; i < this.iv.length; i++)
  17746. this.iv[i] = iv[i];
  17747. }
  17748. function instantiate(Base) {
  17749. function CBC(options) {
  17750. Base.call(this, options);
  17751. this._cbcInit();
  17752. }
  17753. inherits(CBC, Base);
  17754. var keys = Object.keys(proto);
  17755. for (var i = 0; i < keys.length; i++) {
  17756. var key = keys[i];
  17757. CBC.prototype[key] = proto[key];
  17758. }
  17759. CBC.create = function create(options) {
  17760. return new CBC(options);
  17761. };
  17762. return CBC;
  17763. }
  17764. exports.instantiate = instantiate;
  17765. proto._cbcInit = function _cbcInit() {
  17766. var state = new CBCState(this.options.iv);
  17767. this._cbcState = state;
  17768. };
  17769. proto._update = function _update(inp, inOff, out, outOff) {
  17770. var state = this._cbcState;
  17771. var superProto = this.constructor.super_.prototype;
  17772. var iv = state.iv;
  17773. if (this.type === 'encrypt') {
  17774. for (var i = 0; i < this.blockSize; i++)
  17775. iv[i] ^= inp[inOff + i];
  17776. superProto._update.call(this, iv, 0, out, outOff);
  17777. for (var i = 0; i < this.blockSize; i++)
  17778. iv[i] = out[outOff + i];
  17779. } else {
  17780. superProto._update.call(this, inp, inOff, out, outOff);
  17781. for (var i = 0; i < this.blockSize; i++)
  17782. out[outOff + i] ^= iv[i];
  17783. for (var i = 0; i < this.blockSize; i++)
  17784. iv[i] = inp[inOff + i];
  17785. }
  17786. };
  17787. /***/ }),
  17788. /* 141 */
  17789. /*!********************************************!*\
  17790. !*** ./node_modules/des.js/lib/des/ede.js ***!
  17791. \********************************************/
  17792. /*! no static exports found */
  17793. /***/ (function(module, exports, __webpack_require__) {
  17794. "use strict";
  17795. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  17796. var inherits = __webpack_require__(/*! inherits */ 88);
  17797. var Cipher = __webpack_require__(/*! ./cipher */ 137);
  17798. var DES = __webpack_require__(/*! ./des */ 139);
  17799. function EDEState(type, key) {
  17800. assert.equal(key.length, 24, 'Invalid key length');
  17801. var k1 = key.slice(0, 8);
  17802. var k2 = key.slice(8, 16);
  17803. var k3 = key.slice(16, 24);
  17804. if (type === 'encrypt') {
  17805. this.ciphers = [
  17806. DES.create({ type: 'encrypt', key: k1 }),
  17807. DES.create({ type: 'decrypt', key: k2 }),
  17808. DES.create({ type: 'encrypt', key: k3 })
  17809. ];
  17810. } else {
  17811. this.ciphers = [
  17812. DES.create({ type: 'decrypt', key: k3 }),
  17813. DES.create({ type: 'encrypt', key: k2 }),
  17814. DES.create({ type: 'decrypt', key: k1 })
  17815. ];
  17816. }
  17817. }
  17818. function EDE(options) {
  17819. Cipher.call(this, options);
  17820. var state = new EDEState(this.type, this.options.key);
  17821. this._edeState = state;
  17822. }
  17823. inherits(EDE, Cipher);
  17824. module.exports = EDE;
  17825. EDE.create = function create(options) {
  17826. return new EDE(options);
  17827. };
  17828. EDE.prototype._update = function _update(inp, inOff, out, outOff) {
  17829. var state = this._edeState;
  17830. state.ciphers[0]._update(inp, inOff, out, outOff);
  17831. state.ciphers[1]._update(out, outOff, out, outOff);
  17832. state.ciphers[2]._update(out, outOff, out, outOff);
  17833. };
  17834. EDE.prototype._pad = DES.prototype._pad;
  17835. EDE.prototype._unpad = DES.prototype._unpad;
  17836. /***/ }),
  17837. /* 142 */
  17838. /*!************************************************!*\
  17839. !*** ./node_modules/browserify-aes/browser.js ***!
  17840. \************************************************/
  17841. /*! no static exports found */
  17842. /***/ (function(module, exports, __webpack_require__) {
  17843. var ciphers = __webpack_require__(/*! ./encrypter */ 143)
  17844. var deciphers = __webpack_require__(/*! ./decrypter */ 160)
  17845. var modes = __webpack_require__(/*! ./modes/list.json */ 154)
  17846. function getCiphers () {
  17847. return Object.keys(modes)
  17848. }
  17849. exports.createCipher = exports.Cipher = ciphers.createCipher
  17850. exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
  17851. exports.createDecipher = exports.Decipher = deciphers.createDecipher
  17852. exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
  17853. exports.listCiphers = exports.getCiphers = getCiphers
  17854. /***/ }),
  17855. /* 143 */
  17856. /*!**************************************************!*\
  17857. !*** ./node_modules/browserify-aes/encrypter.js ***!
  17858. \**************************************************/
  17859. /*! no static exports found */
  17860. /***/ (function(module, exports, __webpack_require__) {
  17861. var MODES = __webpack_require__(/*! ./modes */ 144)
  17862. var AuthCipher = __webpack_require__(/*! ./authCipher */ 155)
  17863. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  17864. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 158)
  17865. var Transform = __webpack_require__(/*! cipher-base */ 116)
  17866. var aes = __webpack_require__(/*! ./aes */ 156)
  17867. var ebtk = __webpack_require__(/*! evp_bytestokey */ 159)
  17868. var inherits = __webpack_require__(/*! inherits */ 88)
  17869. function Cipher (mode, key, iv) {
  17870. Transform.call(this)
  17871. this._cache = new Splitter()
  17872. this._cipher = new aes.AES(key)
  17873. this._prev = Buffer.from(iv)
  17874. this._mode = mode
  17875. this._autopadding = true
  17876. }
  17877. inherits(Cipher, Transform)
  17878. Cipher.prototype._update = function (data) {
  17879. this._cache.add(data)
  17880. var chunk
  17881. var thing
  17882. var out = []
  17883. while ((chunk = this._cache.get())) {
  17884. thing = this._mode.encrypt(this, chunk)
  17885. out.push(thing)
  17886. }
  17887. return Buffer.concat(out)
  17888. }
  17889. var PADDING = Buffer.alloc(16, 0x10)
  17890. Cipher.prototype._final = function () {
  17891. var chunk = this._cache.flush()
  17892. if (this._autopadding) {
  17893. chunk = this._mode.encrypt(this, chunk)
  17894. this._cipher.scrub()
  17895. return chunk
  17896. }
  17897. if (!chunk.equals(PADDING)) {
  17898. this._cipher.scrub()
  17899. throw new Error('data not multiple of block length')
  17900. }
  17901. }
  17902. Cipher.prototype.setAutoPadding = function (setTo) {
  17903. this._autopadding = !!setTo
  17904. return this
  17905. }
  17906. function Splitter () {
  17907. this.cache = Buffer.allocUnsafe(0)
  17908. }
  17909. Splitter.prototype.add = function (data) {
  17910. this.cache = Buffer.concat([this.cache, data])
  17911. }
  17912. Splitter.prototype.get = function () {
  17913. if (this.cache.length > 15) {
  17914. var out = this.cache.slice(0, 16)
  17915. this.cache = this.cache.slice(16)
  17916. return out
  17917. }
  17918. return null
  17919. }
  17920. Splitter.prototype.flush = function () {
  17921. var len = 16 - this.cache.length
  17922. var padBuff = Buffer.allocUnsafe(len)
  17923. var i = -1
  17924. while (++i < len) {
  17925. padBuff.writeUInt8(len, i)
  17926. }
  17927. return Buffer.concat([this.cache, padBuff])
  17928. }
  17929. function createCipheriv (suite, password, iv) {
  17930. var config = MODES[suite.toLowerCase()]
  17931. if (!config) throw new TypeError('invalid suite type')
  17932. if (typeof password === 'string') password = Buffer.from(password)
  17933. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  17934. if (typeof iv === 'string') iv = Buffer.from(iv)
  17935. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  17936. if (config.type === 'stream') {
  17937. return new StreamCipher(config.module, password, iv)
  17938. } else if (config.type === 'auth') {
  17939. return new AuthCipher(config.module, password, iv)
  17940. }
  17941. return new Cipher(config.module, password, iv)
  17942. }
  17943. function createCipher (suite, password) {
  17944. var config = MODES[suite.toLowerCase()]
  17945. if (!config) throw new TypeError('invalid suite type')
  17946. var keys = ebtk(password, false, config.key, config.iv)
  17947. return createCipheriv(suite, keys.key, keys.iv)
  17948. }
  17949. exports.createCipheriv = createCipheriv
  17950. exports.createCipher = createCipher
  17951. /***/ }),
  17952. /* 144 */
  17953. /*!****************************************************!*\
  17954. !*** ./node_modules/browserify-aes/modes/index.js ***!
  17955. \****************************************************/
  17956. /*! no static exports found */
  17957. /***/ (function(module, exports, __webpack_require__) {
  17958. var modeModules = {
  17959. ECB: __webpack_require__(/*! ./ecb */ 145),
  17960. CBC: __webpack_require__(/*! ./cbc */ 146),
  17961. CFB: __webpack_require__(/*! ./cfb */ 148),
  17962. CFB8: __webpack_require__(/*! ./cfb8 */ 149),
  17963. CFB1: __webpack_require__(/*! ./cfb1 */ 150),
  17964. OFB: __webpack_require__(/*! ./ofb */ 151),
  17965. CTR: __webpack_require__(/*! ./ctr */ 152),
  17966. GCM: __webpack_require__(/*! ./ctr */ 152)
  17967. }
  17968. var modes = __webpack_require__(/*! ./list.json */ 154)
  17969. for (var key in modes) {
  17970. modes[key].module = modeModules[modes[key].mode]
  17971. }
  17972. module.exports = modes
  17973. /***/ }),
  17974. /* 145 */
  17975. /*!**************************************************!*\
  17976. !*** ./node_modules/browserify-aes/modes/ecb.js ***!
  17977. \**************************************************/
  17978. /*! no static exports found */
  17979. /***/ (function(module, exports) {
  17980. exports.encrypt = function (self, block) {
  17981. return self._cipher.encryptBlock(block)
  17982. }
  17983. exports.decrypt = function (self, block) {
  17984. return self._cipher.decryptBlock(block)
  17985. }
  17986. /***/ }),
  17987. /* 146 */
  17988. /*!**************************************************!*\
  17989. !*** ./node_modules/browserify-aes/modes/cbc.js ***!
  17990. \**************************************************/
  17991. /*! no static exports found */
  17992. /***/ (function(module, exports, __webpack_require__) {
  17993. var xor = __webpack_require__(/*! buffer-xor */ 147)
  17994. exports.encrypt = function (self, block) {
  17995. var data = xor(block, self._prev)
  17996. self._prev = self._cipher.encryptBlock(data)
  17997. return self._prev
  17998. }
  17999. exports.decrypt = function (self, block) {
  18000. var pad = self._prev
  18001. self._prev = block
  18002. var out = self._cipher.decryptBlock(block)
  18003. return xor(out, pad)
  18004. }
  18005. /***/ }),
  18006. /* 147 */
  18007. /*!******************************************!*\
  18008. !*** ./node_modules/buffer-xor/index.js ***!
  18009. \******************************************/
  18010. /*! no static exports found */
  18011. /***/ (function(module, exports, __webpack_require__) {
  18012. /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
  18013. var length = Math.min(a.length, b.length)
  18014. var buffer = new Buffer(length)
  18015. for (var i = 0; i < length; ++i) {
  18016. buffer[i] = a[i] ^ b[i]
  18017. }
  18018. return buffer
  18019. }
  18020. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 83).Buffer))
  18021. /***/ }),
  18022. /* 148 */
  18023. /*!**************************************************!*\
  18024. !*** ./node_modules/browserify-aes/modes/cfb.js ***!
  18025. \**************************************************/
  18026. /*! no static exports found */
  18027. /***/ (function(module, exports, __webpack_require__) {
  18028. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18029. var xor = __webpack_require__(/*! buffer-xor */ 147)
  18030. function encryptStart (self, data, decrypt) {
  18031. var len = data.length
  18032. var out = xor(data, self._cache)
  18033. self._cache = self._cache.slice(len)
  18034. self._prev = Buffer.concat([self._prev, decrypt ? data : out])
  18035. return out
  18036. }
  18037. exports.encrypt = function (self, data, decrypt) {
  18038. var out = Buffer.allocUnsafe(0)
  18039. var len
  18040. while (data.length) {
  18041. if (self._cache.length === 0) {
  18042. self._cache = self._cipher.encryptBlock(self._prev)
  18043. self._prev = Buffer.allocUnsafe(0)
  18044. }
  18045. if (self._cache.length <= data.length) {
  18046. len = self._cache.length
  18047. out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
  18048. data = data.slice(len)
  18049. } else {
  18050. out = Buffer.concat([out, encryptStart(self, data, decrypt)])
  18051. break
  18052. }
  18053. }
  18054. return out
  18055. }
  18056. /***/ }),
  18057. /* 149 */
  18058. /*!***************************************************!*\
  18059. !*** ./node_modules/browserify-aes/modes/cfb8.js ***!
  18060. \***************************************************/
  18061. /*! no static exports found */
  18062. /***/ (function(module, exports, __webpack_require__) {
  18063. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18064. function encryptByte (self, byteParam, decrypt) {
  18065. var pad = self._cipher.encryptBlock(self._prev)
  18066. var out = pad[0] ^ byteParam
  18067. self._prev = Buffer.concat([
  18068. self._prev.slice(1),
  18069. Buffer.from([decrypt ? byteParam : out])
  18070. ])
  18071. return out
  18072. }
  18073. exports.encrypt = function (self, chunk, decrypt) {
  18074. var len = chunk.length
  18075. var out = Buffer.allocUnsafe(len)
  18076. var i = -1
  18077. while (++i < len) {
  18078. out[i] = encryptByte(self, chunk[i], decrypt)
  18079. }
  18080. return out
  18081. }
  18082. /***/ }),
  18083. /* 150 */
  18084. /*!***************************************************!*\
  18085. !*** ./node_modules/browserify-aes/modes/cfb1.js ***!
  18086. \***************************************************/
  18087. /*! no static exports found */
  18088. /***/ (function(module, exports, __webpack_require__) {
  18089. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18090. function encryptByte (self, byteParam, decrypt) {
  18091. var pad
  18092. var i = -1
  18093. var len = 8
  18094. var out = 0
  18095. var bit, value
  18096. while (++i < len) {
  18097. pad = self._cipher.encryptBlock(self._prev)
  18098. bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
  18099. value = pad[0] ^ bit
  18100. out += ((value & 0x80) >> (i % 8))
  18101. self._prev = shiftIn(self._prev, decrypt ? bit : value)
  18102. }
  18103. return out
  18104. }
  18105. function shiftIn (buffer, value) {
  18106. var len = buffer.length
  18107. var i = -1
  18108. var out = Buffer.allocUnsafe(buffer.length)
  18109. buffer = Buffer.concat([buffer, Buffer.from([value])])
  18110. while (++i < len) {
  18111. out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
  18112. }
  18113. return out
  18114. }
  18115. exports.encrypt = function (self, chunk, decrypt) {
  18116. var len = chunk.length
  18117. var out = Buffer.allocUnsafe(len)
  18118. var i = -1
  18119. while (++i < len) {
  18120. out[i] = encryptByte(self, chunk[i], decrypt)
  18121. }
  18122. return out
  18123. }
  18124. /***/ }),
  18125. /* 151 */
  18126. /*!**************************************************!*\
  18127. !*** ./node_modules/browserify-aes/modes/ofb.js ***!
  18128. \**************************************************/
  18129. /*! no static exports found */
  18130. /***/ (function(module, exports, __webpack_require__) {
  18131. /* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 147)
  18132. function getBlock (self) {
  18133. self._prev = self._cipher.encryptBlock(self._prev)
  18134. return self._prev
  18135. }
  18136. exports.encrypt = function (self, chunk) {
  18137. while (self._cache.length < chunk.length) {
  18138. self._cache = Buffer.concat([self._cache, getBlock(self)])
  18139. }
  18140. var pad = self._cache.slice(0, chunk.length)
  18141. self._cache = self._cache.slice(chunk.length)
  18142. return xor(chunk, pad)
  18143. }
  18144. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 83).Buffer))
  18145. /***/ }),
  18146. /* 152 */
  18147. /*!**************************************************!*\
  18148. !*** ./node_modules/browserify-aes/modes/ctr.js ***!
  18149. \**************************************************/
  18150. /*! no static exports found */
  18151. /***/ (function(module, exports, __webpack_require__) {
  18152. var xor = __webpack_require__(/*! buffer-xor */ 147)
  18153. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18154. var incr32 = __webpack_require__(/*! ../incr32 */ 153)
  18155. function getBlock (self) {
  18156. var out = self._cipher.encryptBlockRaw(self._prev)
  18157. incr32(self._prev)
  18158. return out
  18159. }
  18160. var blockSize = 16
  18161. exports.encrypt = function (self, chunk) {
  18162. var chunkNum = Math.ceil(chunk.length / blockSize)
  18163. var start = self._cache.length
  18164. self._cache = Buffer.concat([
  18165. self._cache,
  18166. Buffer.allocUnsafe(chunkNum * blockSize)
  18167. ])
  18168. for (var i = 0; i < chunkNum; i++) {
  18169. var out = getBlock(self)
  18170. var offset = start + i * blockSize
  18171. self._cache.writeUInt32BE(out[0], offset + 0)
  18172. self._cache.writeUInt32BE(out[1], offset + 4)
  18173. self._cache.writeUInt32BE(out[2], offset + 8)
  18174. self._cache.writeUInt32BE(out[3], offset + 12)
  18175. }
  18176. var pad = self._cache.slice(0, chunk.length)
  18177. self._cache = self._cache.slice(chunk.length)
  18178. return xor(chunk, pad)
  18179. }
  18180. /***/ }),
  18181. /* 153 */
  18182. /*!***********************************************!*\
  18183. !*** ./node_modules/browserify-aes/incr32.js ***!
  18184. \***********************************************/
  18185. /*! no static exports found */
  18186. /***/ (function(module, exports) {
  18187. function incr32 (iv) {
  18188. var len = iv.length
  18189. var item
  18190. while (len--) {
  18191. item = iv.readUInt8(len)
  18192. if (item === 255) {
  18193. iv.writeUInt8(0, len)
  18194. } else {
  18195. item++
  18196. iv.writeUInt8(item, len)
  18197. break
  18198. }
  18199. }
  18200. }
  18201. module.exports = incr32
  18202. /***/ }),
  18203. /* 154 */
  18204. /*!*****************************************************!*\
  18205. !*** ./node_modules/browserify-aes/modes/list.json ***!
  18206. \*****************************************************/
  18207. /*! exports provided: aes-128-ecb, aes-192-ecb, aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc, aes128, aes192, aes256, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-cfb8, aes-192-cfb8, aes-256-cfb8, aes-128-cfb1, aes-192-cfb1, aes-256-cfb1, aes-128-ofb, aes-192-ofb, aes-256-ofb, aes-128-ctr, aes-192-ctr, aes-256-ctr, aes-128-gcm, aes-192-gcm, aes-256-gcm, default */
  18208. /***/ (function(module) {
  18209. module.exports = JSON.parse("{\"aes-128-ecb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-192-ecb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-256-ecb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-128-cbc\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-192-cbc\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-256-cbc\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes128\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes192\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes256\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-128-cfb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-192-cfb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-256-cfb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-128-cfb8\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-192-cfb8\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-256-cfb8\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-128-cfb1\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-192-cfb1\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-256-cfb1\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-128-ofb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-192-ofb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-256-ofb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-128-ctr\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-192-ctr\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-256-ctr\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-128-gcm\":{\"cipher\":\"AES\",\"key\":128,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-192-gcm\":{\"cipher\":\"AES\",\"key\":192,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-256-gcm\":{\"cipher\":\"AES\",\"key\":256,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"}}");
  18210. /***/ }),
  18211. /* 155 */
  18212. /*!***************************************************!*\
  18213. !*** ./node_modules/browserify-aes/authCipher.js ***!
  18214. \***************************************************/
  18215. /*! no static exports found */
  18216. /***/ (function(module, exports, __webpack_require__) {
  18217. var aes = __webpack_require__(/*! ./aes */ 156)
  18218. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18219. var Transform = __webpack_require__(/*! cipher-base */ 116)
  18220. var inherits = __webpack_require__(/*! inherits */ 88)
  18221. var GHASH = __webpack_require__(/*! ./ghash */ 157)
  18222. var xor = __webpack_require__(/*! buffer-xor */ 147)
  18223. var incr32 = __webpack_require__(/*! ./incr32 */ 153)
  18224. function xorTest (a, b) {
  18225. var out = 0
  18226. if (a.length !== b.length) out++
  18227. var len = Math.min(a.length, b.length)
  18228. for (var i = 0; i < len; ++i) {
  18229. out += (a[i] ^ b[i])
  18230. }
  18231. return out
  18232. }
  18233. function calcIv (self, iv, ck) {
  18234. if (iv.length === 12) {
  18235. self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
  18236. return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
  18237. }
  18238. var ghash = new GHASH(ck)
  18239. var len = iv.length
  18240. var toPad = len % 16
  18241. ghash.update(iv)
  18242. if (toPad) {
  18243. toPad = 16 - toPad
  18244. ghash.update(Buffer.alloc(toPad, 0))
  18245. }
  18246. ghash.update(Buffer.alloc(8, 0))
  18247. var ivBits = len * 8
  18248. var tail = Buffer.alloc(8)
  18249. tail.writeUIntBE(ivBits, 0, 8)
  18250. ghash.update(tail)
  18251. self._finID = ghash.state
  18252. var out = Buffer.from(self._finID)
  18253. incr32(out)
  18254. return out
  18255. }
  18256. function StreamCipher (mode, key, iv, decrypt) {
  18257. Transform.call(this)
  18258. var h = Buffer.alloc(4, 0)
  18259. this._cipher = new aes.AES(key)
  18260. var ck = this._cipher.encryptBlock(h)
  18261. this._ghash = new GHASH(ck)
  18262. iv = calcIv(this, iv, ck)
  18263. this._prev = Buffer.from(iv)
  18264. this._cache = Buffer.allocUnsafe(0)
  18265. this._secCache = Buffer.allocUnsafe(0)
  18266. this._decrypt = decrypt
  18267. this._alen = 0
  18268. this._len = 0
  18269. this._mode = mode
  18270. this._authTag = null
  18271. this._called = false
  18272. }
  18273. inherits(StreamCipher, Transform)
  18274. StreamCipher.prototype._update = function (chunk) {
  18275. if (!this._called && this._alen) {
  18276. var rump = 16 - (this._alen % 16)
  18277. if (rump < 16) {
  18278. rump = Buffer.alloc(rump, 0)
  18279. this._ghash.update(rump)
  18280. }
  18281. }
  18282. this._called = true
  18283. var out = this._mode.encrypt(this, chunk)
  18284. if (this._decrypt) {
  18285. this._ghash.update(chunk)
  18286. } else {
  18287. this._ghash.update(out)
  18288. }
  18289. this._len += chunk.length
  18290. return out
  18291. }
  18292. StreamCipher.prototype._final = function () {
  18293. if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
  18294. var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
  18295. if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
  18296. this._authTag = tag
  18297. this._cipher.scrub()
  18298. }
  18299. StreamCipher.prototype.getAuthTag = function getAuthTag () {
  18300. if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
  18301. return this._authTag
  18302. }
  18303. StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
  18304. if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
  18305. this._authTag = tag
  18306. }
  18307. StreamCipher.prototype.setAAD = function setAAD (buf) {
  18308. if (this._called) throw new Error('Attempting to set AAD in unsupported state')
  18309. this._ghash.update(buf)
  18310. this._alen += buf.length
  18311. }
  18312. module.exports = StreamCipher
  18313. /***/ }),
  18314. /* 156 */
  18315. /*!********************************************!*\
  18316. !*** ./node_modules/browserify-aes/aes.js ***!
  18317. \********************************************/
  18318. /*! no static exports found */
  18319. /***/ (function(module, exports, __webpack_require__) {
  18320. // based on the aes implimentation in triple sec
  18321. // https://github.com/keybase/triplesec
  18322. // which is in turn based on the one from crypto-js
  18323. // https://code.google.com/p/crypto-js/
  18324. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18325. function asUInt32Array (buf) {
  18326. if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
  18327. var len = (buf.length / 4) | 0
  18328. var out = new Array(len)
  18329. for (var i = 0; i < len; i++) {
  18330. out[i] = buf.readUInt32BE(i * 4)
  18331. }
  18332. return out
  18333. }
  18334. function scrubVec (v) {
  18335. for (var i = 0; i < v.length; v++) {
  18336. v[i] = 0
  18337. }
  18338. }
  18339. function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
  18340. var SUB_MIX0 = SUB_MIX[0]
  18341. var SUB_MIX1 = SUB_MIX[1]
  18342. var SUB_MIX2 = SUB_MIX[2]
  18343. var SUB_MIX3 = SUB_MIX[3]
  18344. var s0 = M[0] ^ keySchedule[0]
  18345. var s1 = M[1] ^ keySchedule[1]
  18346. var s2 = M[2] ^ keySchedule[2]
  18347. var s3 = M[3] ^ keySchedule[3]
  18348. var t0, t1, t2, t3
  18349. var ksRow = 4
  18350. for (var round = 1; round < nRounds; round++) {
  18351. t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
  18352. t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
  18353. t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
  18354. t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
  18355. s0 = t0
  18356. s1 = t1
  18357. s2 = t2
  18358. s3 = t3
  18359. }
  18360. t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
  18361. t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
  18362. t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
  18363. t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
  18364. t0 = t0 >>> 0
  18365. t1 = t1 >>> 0
  18366. t2 = t2 >>> 0
  18367. t3 = t3 >>> 0
  18368. return [t0, t1, t2, t3]
  18369. }
  18370. // AES constants
  18371. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
  18372. var G = (function () {
  18373. // Compute double table
  18374. var d = new Array(256)
  18375. for (var j = 0; j < 256; j++) {
  18376. if (j < 128) {
  18377. d[j] = j << 1
  18378. } else {
  18379. d[j] = (j << 1) ^ 0x11b
  18380. }
  18381. }
  18382. var SBOX = []
  18383. var INV_SBOX = []
  18384. var SUB_MIX = [[], [], [], []]
  18385. var INV_SUB_MIX = [[], [], [], []]
  18386. // Walk GF(2^8)
  18387. var x = 0
  18388. var xi = 0
  18389. for (var i = 0; i < 256; ++i) {
  18390. // Compute sbox
  18391. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
  18392. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
  18393. SBOX[x] = sx
  18394. INV_SBOX[sx] = x
  18395. // Compute multiplication
  18396. var x2 = d[x]
  18397. var x4 = d[x2]
  18398. var x8 = d[x4]
  18399. // Compute sub bytes, mix columns tables
  18400. var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
  18401. SUB_MIX[0][x] = (t << 24) | (t >>> 8)
  18402. SUB_MIX[1][x] = (t << 16) | (t >>> 16)
  18403. SUB_MIX[2][x] = (t << 8) | (t >>> 24)
  18404. SUB_MIX[3][x] = t
  18405. // Compute inv sub bytes, inv mix columns tables
  18406. t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
  18407. INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
  18408. INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
  18409. INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
  18410. INV_SUB_MIX[3][sx] = t
  18411. if (x === 0) {
  18412. x = xi = 1
  18413. } else {
  18414. x = x2 ^ d[d[d[x8 ^ x2]]]
  18415. xi ^= d[d[xi]]
  18416. }
  18417. }
  18418. return {
  18419. SBOX: SBOX,
  18420. INV_SBOX: INV_SBOX,
  18421. SUB_MIX: SUB_MIX,
  18422. INV_SUB_MIX: INV_SUB_MIX
  18423. }
  18424. })()
  18425. function AES (key) {
  18426. this._key = asUInt32Array(key)
  18427. this._reset()
  18428. }
  18429. AES.blockSize = 4 * 4
  18430. AES.keySize = 256 / 8
  18431. AES.prototype.blockSize = AES.blockSize
  18432. AES.prototype.keySize = AES.keySize
  18433. AES.prototype._reset = function () {
  18434. var keyWords = this._key
  18435. var keySize = keyWords.length
  18436. var nRounds = keySize + 6
  18437. var ksRows = (nRounds + 1) * 4
  18438. var keySchedule = []
  18439. for (var k = 0; k < keySize; k++) {
  18440. keySchedule[k] = keyWords[k]
  18441. }
  18442. for (k = keySize; k < ksRows; k++) {
  18443. var t = keySchedule[k - 1]
  18444. if (k % keySize === 0) {
  18445. t = (t << 8) | (t >>> 24)
  18446. t =
  18447. (G.SBOX[t >>> 24] << 24) |
  18448. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18449. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18450. (G.SBOX[t & 0xff])
  18451. t ^= RCON[(k / keySize) | 0] << 24
  18452. } else if (keySize > 6 && k % keySize === 4) {
  18453. t =
  18454. (G.SBOX[t >>> 24] << 24) |
  18455. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18456. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18457. (G.SBOX[t & 0xff])
  18458. }
  18459. keySchedule[k] = keySchedule[k - keySize] ^ t
  18460. }
  18461. var invKeySchedule = []
  18462. for (var ik = 0; ik < ksRows; ik++) {
  18463. var ksR = ksRows - ik
  18464. var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
  18465. if (ik < 4 || ksR <= 4) {
  18466. invKeySchedule[ik] = tt
  18467. } else {
  18468. invKeySchedule[ik] =
  18469. G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
  18470. G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
  18471. G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
  18472. G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
  18473. }
  18474. }
  18475. this._nRounds = nRounds
  18476. this._keySchedule = keySchedule
  18477. this._invKeySchedule = invKeySchedule
  18478. }
  18479. AES.prototype.encryptBlockRaw = function (M) {
  18480. M = asUInt32Array(M)
  18481. return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
  18482. }
  18483. AES.prototype.encryptBlock = function (M) {
  18484. var out = this.encryptBlockRaw(M)
  18485. var buf = Buffer.allocUnsafe(16)
  18486. buf.writeUInt32BE(out[0], 0)
  18487. buf.writeUInt32BE(out[1], 4)
  18488. buf.writeUInt32BE(out[2], 8)
  18489. buf.writeUInt32BE(out[3], 12)
  18490. return buf
  18491. }
  18492. AES.prototype.decryptBlock = function (M) {
  18493. M = asUInt32Array(M)
  18494. // swap
  18495. var m1 = M[1]
  18496. M[1] = M[3]
  18497. M[3] = m1
  18498. var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
  18499. var buf = Buffer.allocUnsafe(16)
  18500. buf.writeUInt32BE(out[0], 0)
  18501. buf.writeUInt32BE(out[3], 4)
  18502. buf.writeUInt32BE(out[2], 8)
  18503. buf.writeUInt32BE(out[1], 12)
  18504. return buf
  18505. }
  18506. AES.prototype.scrub = function () {
  18507. scrubVec(this._keySchedule)
  18508. scrubVec(this._invKeySchedule)
  18509. scrubVec(this._key)
  18510. }
  18511. module.exports.AES = AES
  18512. /***/ }),
  18513. /* 157 */
  18514. /*!**********************************************!*\
  18515. !*** ./node_modules/browserify-aes/ghash.js ***!
  18516. \**********************************************/
  18517. /*! no static exports found */
  18518. /***/ (function(module, exports, __webpack_require__) {
  18519. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18520. var ZEROES = Buffer.alloc(16, 0)
  18521. function toArray (buf) {
  18522. return [
  18523. buf.readUInt32BE(0),
  18524. buf.readUInt32BE(4),
  18525. buf.readUInt32BE(8),
  18526. buf.readUInt32BE(12)
  18527. ]
  18528. }
  18529. function fromArray (out) {
  18530. var buf = Buffer.allocUnsafe(16)
  18531. buf.writeUInt32BE(out[0] >>> 0, 0)
  18532. buf.writeUInt32BE(out[1] >>> 0, 4)
  18533. buf.writeUInt32BE(out[2] >>> 0, 8)
  18534. buf.writeUInt32BE(out[3] >>> 0, 12)
  18535. return buf
  18536. }
  18537. function GHASH (key) {
  18538. this.h = key
  18539. this.state = Buffer.alloc(16, 0)
  18540. this.cache = Buffer.allocUnsafe(0)
  18541. }
  18542. // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
  18543. // by Juho Vähä-Herttua
  18544. GHASH.prototype.ghash = function (block) {
  18545. var i = -1
  18546. while (++i < block.length) {
  18547. this.state[i] ^= block[i]
  18548. }
  18549. this._multiply()
  18550. }
  18551. GHASH.prototype._multiply = function () {
  18552. var Vi = toArray(this.h)
  18553. var Zi = [0, 0, 0, 0]
  18554. var j, xi, lsbVi
  18555. var i = -1
  18556. while (++i < 128) {
  18557. xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
  18558. if (xi) {
  18559. // Z_i+1 = Z_i ^ V_i
  18560. Zi[0] ^= Vi[0]
  18561. Zi[1] ^= Vi[1]
  18562. Zi[2] ^= Vi[2]
  18563. Zi[3] ^= Vi[3]
  18564. }
  18565. // Store the value of LSB(V_i)
  18566. lsbVi = (Vi[3] & 1) !== 0
  18567. // V_i+1 = V_i >> 1
  18568. for (j = 3; j > 0; j--) {
  18569. Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
  18570. }
  18571. Vi[0] = Vi[0] >>> 1
  18572. // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
  18573. if (lsbVi) {
  18574. Vi[0] = Vi[0] ^ (0xe1 << 24)
  18575. }
  18576. }
  18577. this.state = fromArray(Zi)
  18578. }
  18579. GHASH.prototype.update = function (buf) {
  18580. this.cache = Buffer.concat([this.cache, buf])
  18581. var chunk
  18582. while (this.cache.length >= 16) {
  18583. chunk = this.cache.slice(0, 16)
  18584. this.cache = this.cache.slice(16)
  18585. this.ghash(chunk)
  18586. }
  18587. }
  18588. GHASH.prototype.final = function (abl, bl) {
  18589. if (this.cache.length) {
  18590. this.ghash(Buffer.concat([this.cache, ZEROES], 16))
  18591. }
  18592. this.ghash(fromArray([0, abl, 0, bl]))
  18593. return this.state
  18594. }
  18595. module.exports = GHASH
  18596. /***/ }),
  18597. /* 158 */
  18598. /*!*****************************************************!*\
  18599. !*** ./node_modules/browserify-aes/streamCipher.js ***!
  18600. \*****************************************************/
  18601. /*! no static exports found */
  18602. /***/ (function(module, exports, __webpack_require__) {
  18603. var aes = __webpack_require__(/*! ./aes */ 156)
  18604. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18605. var Transform = __webpack_require__(/*! cipher-base */ 116)
  18606. var inherits = __webpack_require__(/*! inherits */ 88)
  18607. function StreamCipher (mode, key, iv, decrypt) {
  18608. Transform.call(this)
  18609. this._cipher = new aes.AES(key)
  18610. this._prev = Buffer.from(iv)
  18611. this._cache = Buffer.allocUnsafe(0)
  18612. this._secCache = Buffer.allocUnsafe(0)
  18613. this._decrypt = decrypt
  18614. this._mode = mode
  18615. }
  18616. inherits(StreamCipher, Transform)
  18617. StreamCipher.prototype._update = function (chunk) {
  18618. return this._mode.encrypt(this, chunk, this._decrypt)
  18619. }
  18620. StreamCipher.prototype._final = function () {
  18621. this._cipher.scrub()
  18622. }
  18623. module.exports = StreamCipher
  18624. /***/ }),
  18625. /* 159 */
  18626. /*!**********************************************!*\
  18627. !*** ./node_modules/evp_bytestokey/index.js ***!
  18628. \**********************************************/
  18629. /*! no static exports found */
  18630. /***/ (function(module, exports, __webpack_require__) {
  18631. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18632. var MD5 = __webpack_require__(/*! md5.js */ 89)
  18633. /* eslint-disable camelcase */
  18634. function EVP_BytesToKey (password, salt, keyBits, ivLen) {
  18635. if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
  18636. if (salt) {
  18637. if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
  18638. if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
  18639. }
  18640. var keyLen = keyBits / 8
  18641. var key = Buffer.alloc(keyLen)
  18642. var iv = Buffer.alloc(ivLen || 0)
  18643. var tmp = Buffer.alloc(0)
  18644. while (keyLen > 0 || ivLen > 0) {
  18645. var hash = new MD5()
  18646. hash.update(tmp)
  18647. hash.update(password)
  18648. if (salt) hash.update(salt)
  18649. tmp = hash.digest()
  18650. var used = 0
  18651. if (keyLen > 0) {
  18652. var keyStart = key.length - keyLen
  18653. used = Math.min(keyLen, tmp.length)
  18654. tmp.copy(key, keyStart, 0, used)
  18655. keyLen -= used
  18656. }
  18657. if (used < tmp.length && ivLen > 0) {
  18658. var ivStart = iv.length - ivLen
  18659. var length = Math.min(ivLen, tmp.length - used)
  18660. tmp.copy(iv, ivStart, used, used + length)
  18661. ivLen -= length
  18662. }
  18663. }
  18664. tmp.fill(0)
  18665. return { key: key, iv: iv }
  18666. }
  18667. module.exports = EVP_BytesToKey
  18668. /***/ }),
  18669. /* 160 */
  18670. /*!**************************************************!*\
  18671. !*** ./node_modules/browserify-aes/decrypter.js ***!
  18672. \**************************************************/
  18673. /*! no static exports found */
  18674. /***/ (function(module, exports, __webpack_require__) {
  18675. var AuthCipher = __webpack_require__(/*! ./authCipher */ 155)
  18676. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  18677. var MODES = __webpack_require__(/*! ./modes */ 144)
  18678. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 158)
  18679. var Transform = __webpack_require__(/*! cipher-base */ 116)
  18680. var aes = __webpack_require__(/*! ./aes */ 156)
  18681. var ebtk = __webpack_require__(/*! evp_bytestokey */ 159)
  18682. var inherits = __webpack_require__(/*! inherits */ 88)
  18683. function Decipher (mode, key, iv) {
  18684. Transform.call(this)
  18685. this._cache = new Splitter()
  18686. this._last = void 0
  18687. this._cipher = new aes.AES(key)
  18688. this._prev = Buffer.from(iv)
  18689. this._mode = mode
  18690. this._autopadding = true
  18691. }
  18692. inherits(Decipher, Transform)
  18693. Decipher.prototype._update = function (data) {
  18694. this._cache.add(data)
  18695. var chunk
  18696. var thing
  18697. var out = []
  18698. while ((chunk = this._cache.get(this._autopadding))) {
  18699. thing = this._mode.decrypt(this, chunk)
  18700. out.push(thing)
  18701. }
  18702. return Buffer.concat(out)
  18703. }
  18704. Decipher.prototype._final = function () {
  18705. var chunk = this._cache.flush()
  18706. if (this._autopadding) {
  18707. return unpad(this._mode.decrypt(this, chunk))
  18708. } else if (chunk) {
  18709. throw new Error('data not multiple of block length')
  18710. }
  18711. }
  18712. Decipher.prototype.setAutoPadding = function (setTo) {
  18713. this._autopadding = !!setTo
  18714. return this
  18715. }
  18716. function Splitter () {
  18717. this.cache = Buffer.allocUnsafe(0)
  18718. }
  18719. Splitter.prototype.add = function (data) {
  18720. this.cache = Buffer.concat([this.cache, data])
  18721. }
  18722. Splitter.prototype.get = function (autoPadding) {
  18723. var out
  18724. if (autoPadding) {
  18725. if (this.cache.length > 16) {
  18726. out = this.cache.slice(0, 16)
  18727. this.cache = this.cache.slice(16)
  18728. return out
  18729. }
  18730. } else {
  18731. if (this.cache.length >= 16) {
  18732. out = this.cache.slice(0, 16)
  18733. this.cache = this.cache.slice(16)
  18734. return out
  18735. }
  18736. }
  18737. return null
  18738. }
  18739. Splitter.prototype.flush = function () {
  18740. if (this.cache.length) return this.cache
  18741. }
  18742. function unpad (last) {
  18743. var padded = last[15]
  18744. if (padded < 1 || padded > 16) {
  18745. throw new Error('unable to decrypt data')
  18746. }
  18747. var i = -1
  18748. while (++i < padded) {
  18749. if (last[(i + (16 - padded))] !== padded) {
  18750. throw new Error('unable to decrypt data')
  18751. }
  18752. }
  18753. if (padded === 16) return
  18754. return last.slice(0, 16 - padded)
  18755. }
  18756. function createDecipheriv (suite, password, iv) {
  18757. var config = MODES[suite.toLowerCase()]
  18758. if (!config) throw new TypeError('invalid suite type')
  18759. if (typeof iv === 'string') iv = Buffer.from(iv)
  18760. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  18761. if (typeof password === 'string') password = Buffer.from(password)
  18762. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  18763. if (config.type === 'stream') {
  18764. return new StreamCipher(config.module, password, iv, true)
  18765. } else if (config.type === 'auth') {
  18766. return new AuthCipher(config.module, password, iv, true)
  18767. }
  18768. return new Decipher(config.module, password, iv)
  18769. }
  18770. function createDecipher (suite, password) {
  18771. var config = MODES[suite.toLowerCase()]
  18772. if (!config) throw new TypeError('invalid suite type')
  18773. var keys = ebtk(password, false, config.key, config.iv)
  18774. return createDecipheriv(suite, keys.key, keys.iv)
  18775. }
  18776. exports.createDecipher = createDecipher
  18777. exports.createDecipheriv = createDecipheriv
  18778. /***/ }),
  18779. /* 161 */
  18780. /*!**********************************************!*\
  18781. !*** ./node_modules/browserify-des/modes.js ***!
  18782. \**********************************************/
  18783. /*! no static exports found */
  18784. /***/ (function(module, exports) {
  18785. exports['des-ecb'] = {
  18786. key: 8,
  18787. iv: 0
  18788. }
  18789. exports['des-cbc'] = exports.des = {
  18790. key: 8,
  18791. iv: 8
  18792. }
  18793. exports['des-ede3-cbc'] = exports.des3 = {
  18794. key: 24,
  18795. iv: 8
  18796. }
  18797. exports['des-ede3'] = {
  18798. key: 24,
  18799. iv: 0
  18800. }
  18801. exports['des-ede-cbc'] = {
  18802. key: 16,
  18803. iv: 8
  18804. }
  18805. exports['des-ede'] = {
  18806. key: 16,
  18807. iv: 0
  18808. }
  18809. /***/ }),
  18810. /* 162 */
  18811. /*!************************************************!*\
  18812. !*** ./node_modules/diffie-hellman/browser.js ***!
  18813. \************************************************/
  18814. /*! no static exports found */
  18815. /***/ (function(module, exports, __webpack_require__) {
  18816. /* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 163)
  18817. var primes = __webpack_require__(/*! ./lib/primes.json */ 170)
  18818. var DH = __webpack_require__(/*! ./lib/dh */ 171)
  18819. function getDiffieHellman (mod) {
  18820. var prime = new Buffer(primes[mod].prime, 'hex')
  18821. var gen = new Buffer(primes[mod].gen, 'hex')
  18822. return new DH(prime, gen)
  18823. }
  18824. var ENCODINGS = {
  18825. 'binary': true, 'hex': true, 'base64': true
  18826. }
  18827. function createDiffieHellman (prime, enc, generator, genc) {
  18828. if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
  18829. return createDiffieHellman(prime, 'binary', enc, generator)
  18830. }
  18831. enc = enc || 'binary'
  18832. genc = genc || 'binary'
  18833. generator = generator || new Buffer([2])
  18834. if (!Buffer.isBuffer(generator)) {
  18835. generator = new Buffer(generator, genc)
  18836. }
  18837. if (typeof prime === 'number') {
  18838. return new DH(generatePrime(prime, generator), generator, true)
  18839. }
  18840. if (!Buffer.isBuffer(prime)) {
  18841. prime = new Buffer(prime, enc)
  18842. }
  18843. return new DH(prime, generator, true)
  18844. }
  18845. exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
  18846. exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
  18847. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 83).Buffer))
  18848. /***/ }),
  18849. /* 163 */
  18850. /*!**********************************************************!*\
  18851. !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
  18852. \**********************************************************/
  18853. /*! no static exports found */
  18854. /***/ (function(module, exports, __webpack_require__) {
  18855. var randomBytes = __webpack_require__(/*! randombytes */ 79);
  18856. module.exports = findPrime;
  18857. findPrime.simpleSieve = simpleSieve;
  18858. findPrime.fermatTest = fermatTest;
  18859. var BN = __webpack_require__(/*! bn.js */ 164);
  18860. var TWENTYFOUR = new BN(24);
  18861. var MillerRabin = __webpack_require__(/*! miller-rabin */ 167);
  18862. var millerRabin = new MillerRabin();
  18863. var ONE = new BN(1);
  18864. var TWO = new BN(2);
  18865. var FIVE = new BN(5);
  18866. var SIXTEEN = new BN(16);
  18867. var EIGHT = new BN(8);
  18868. var TEN = new BN(10);
  18869. var THREE = new BN(3);
  18870. var SEVEN = new BN(7);
  18871. var ELEVEN = new BN(11);
  18872. var FOUR = new BN(4);
  18873. var TWELVE = new BN(12);
  18874. var primes = null;
  18875. function _getPrimes() {
  18876. if (primes !== null)
  18877. return primes;
  18878. var limit = 0x100000;
  18879. var res = [];
  18880. res[0] = 2;
  18881. for (var i = 1, k = 3; k < limit; k += 2) {
  18882. var sqrt = Math.ceil(Math.sqrt(k));
  18883. for (var j = 0; j < i && res[j] <= sqrt; j++)
  18884. if (k % res[j] === 0)
  18885. break;
  18886. if (i !== j && res[j] <= sqrt)
  18887. continue;
  18888. res[i++] = k;
  18889. }
  18890. primes = res;
  18891. return res;
  18892. }
  18893. function simpleSieve(p) {
  18894. var primes = _getPrimes();
  18895. for (var i = 0; i < primes.length; i++)
  18896. if (p.modn(primes[i]) === 0) {
  18897. if (p.cmpn(primes[i]) === 0) {
  18898. return true;
  18899. } else {
  18900. return false;
  18901. }
  18902. }
  18903. return true;
  18904. }
  18905. function fermatTest(p) {
  18906. var red = BN.mont(p);
  18907. return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
  18908. }
  18909. function findPrime(bits, gen) {
  18910. if (bits < 16) {
  18911. // this is what openssl does
  18912. if (gen === 2 || gen === 5) {
  18913. return new BN([0x8c, 0x7b]);
  18914. } else {
  18915. return new BN([0x8c, 0x27]);
  18916. }
  18917. }
  18918. gen = new BN(gen);
  18919. var num, n2;
  18920. while (true) {
  18921. num = new BN(randomBytes(Math.ceil(bits / 8)));
  18922. while (num.bitLength() > bits) {
  18923. num.ishrn(1);
  18924. }
  18925. if (num.isEven()) {
  18926. num.iadd(ONE);
  18927. }
  18928. if (!num.testn(1)) {
  18929. num.iadd(TWO);
  18930. }
  18931. if (!gen.cmp(TWO)) {
  18932. while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
  18933. num.iadd(FOUR);
  18934. }
  18935. } else if (!gen.cmp(FIVE)) {
  18936. while (num.mod(TEN).cmp(THREE)) {
  18937. num.iadd(FOUR);
  18938. }
  18939. }
  18940. n2 = num.shrn(1);
  18941. if (simpleSieve(n2) && simpleSieve(num) &&
  18942. fermatTest(n2) && fermatTest(num) &&
  18943. millerRabin.test(n2) && millerRabin.test(num)) {
  18944. return num;
  18945. }
  18946. }
  18947. }
  18948. /***/ }),
  18949. /* 164 */
  18950. /*!**************************************!*\
  18951. !*** ./node_modules/bn.js/lib/bn.js ***!
  18952. \**************************************/
  18953. /*! no static exports found */
  18954. /***/ (function(module, exports, __webpack_require__) {
  18955. /* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
  18956. 'use strict';
  18957. // Utils
  18958. function assert (val, msg) {
  18959. if (!val) throw new Error(msg || 'Assertion failed');
  18960. }
  18961. // Could use `inherits` module, but don't want to move from single file
  18962. // architecture yet.
  18963. function inherits (ctor, superCtor) {
  18964. ctor.super_ = superCtor;
  18965. var TempCtor = function () {};
  18966. TempCtor.prototype = superCtor.prototype;
  18967. ctor.prototype = new TempCtor();
  18968. ctor.prototype.constructor = ctor;
  18969. }
  18970. // BN
  18971. function BN (number, base, endian) {
  18972. if (BN.isBN(number)) {
  18973. return number;
  18974. }
  18975. this.negative = 0;
  18976. this.words = null;
  18977. this.length = 0;
  18978. // Reduction context
  18979. this.red = null;
  18980. if (number !== null) {
  18981. if (base === 'le' || base === 'be') {
  18982. endian = base;
  18983. base = 10;
  18984. }
  18985. this._init(number || 0, base || 10, endian || 'be');
  18986. }
  18987. }
  18988. if (typeof module === 'object') {
  18989. module.exports = BN;
  18990. } else {
  18991. exports.BN = BN;
  18992. }
  18993. BN.BN = BN;
  18994. BN.wordSize = 26;
  18995. var Buffer;
  18996. try {
  18997. Buffer = __webpack_require__(/*! buffer */ 166).Buffer;
  18998. } catch (e) {
  18999. }
  19000. BN.isBN = function isBN (num) {
  19001. if (num instanceof BN) {
  19002. return true;
  19003. }
  19004. return num !== null && typeof num === 'object' &&
  19005. num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  19006. };
  19007. BN.max = function max (left, right) {
  19008. if (left.cmp(right) > 0) return left;
  19009. return right;
  19010. };
  19011. BN.min = function min (left, right) {
  19012. if (left.cmp(right) < 0) return left;
  19013. return right;
  19014. };
  19015. BN.prototype._init = function init (number, base, endian) {
  19016. if (typeof number === 'number') {
  19017. return this._initNumber(number, base, endian);
  19018. }
  19019. if (typeof number === 'object') {
  19020. return this._initArray(number, base, endian);
  19021. }
  19022. if (base === 'hex') {
  19023. base = 16;
  19024. }
  19025. assert(base === (base | 0) && base >= 2 && base <= 36);
  19026. number = number.toString().replace(/\s+/g, '');
  19027. var start = 0;
  19028. if (number[0] === '-') {
  19029. start++;
  19030. }
  19031. if (base === 16) {
  19032. this._parseHex(number, start);
  19033. } else {
  19034. this._parseBase(number, base, start);
  19035. }
  19036. if (number[0] === '-') {
  19037. this.negative = 1;
  19038. }
  19039. this._strip();
  19040. if (endian !== 'le') return;
  19041. this._initArray(this.toArray(), base, endian);
  19042. };
  19043. BN.prototype._initNumber = function _initNumber (number, base, endian) {
  19044. if (number < 0) {
  19045. this.negative = 1;
  19046. number = -number;
  19047. }
  19048. if (number < 0x4000000) {
  19049. this.words = [number & 0x3ffffff];
  19050. this.length = 1;
  19051. } else if (number < 0x10000000000000) {
  19052. this.words = [
  19053. number & 0x3ffffff,
  19054. (number / 0x4000000) & 0x3ffffff
  19055. ];
  19056. this.length = 2;
  19057. } else {
  19058. assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
  19059. this.words = [
  19060. number & 0x3ffffff,
  19061. (number / 0x4000000) & 0x3ffffff,
  19062. 1
  19063. ];
  19064. this.length = 3;
  19065. }
  19066. if (endian !== 'le') return;
  19067. // Reverse the bytes
  19068. this._initArray(this.toArray(), base, endian);
  19069. };
  19070. BN.prototype._initArray = function _initArray (number, base, endian) {
  19071. // Perhaps a Uint8Array
  19072. assert(typeof number.length === 'number');
  19073. if (number.length <= 0) {
  19074. this.words = [0];
  19075. this.length = 1;
  19076. return this;
  19077. }
  19078. this.length = Math.ceil(number.length / 3);
  19079. this.words = new Array(this.length);
  19080. for (var i = 0; i < this.length; i++) {
  19081. this.words[i] = 0;
  19082. }
  19083. var j, w;
  19084. var off = 0;
  19085. if (endian === 'be') {
  19086. for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
  19087. w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
  19088. this.words[j] |= (w << off) & 0x3ffffff;
  19089. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19090. off += 24;
  19091. if (off >= 26) {
  19092. off -= 26;
  19093. j++;
  19094. }
  19095. }
  19096. } else if (endian === 'le') {
  19097. for (i = 0, j = 0; i < number.length; i += 3) {
  19098. w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
  19099. this.words[j] |= (w << off) & 0x3ffffff;
  19100. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19101. off += 24;
  19102. if (off >= 26) {
  19103. off -= 26;
  19104. j++;
  19105. }
  19106. }
  19107. }
  19108. return this._strip();
  19109. };
  19110. function parseHex (str, start, end) {
  19111. var r = 0;
  19112. var len = Math.min(str.length, end);
  19113. var z = 0;
  19114. for (var i = start; i < len; i++) {
  19115. var c = str.charCodeAt(i) - 48;
  19116. r <<= 4;
  19117. var b;
  19118. // 'a' - 'f'
  19119. if (c >= 49 && c <= 54) {
  19120. b = c - 49 + 0xa;
  19121. // 'A' - 'F'
  19122. } else if (c >= 17 && c <= 22) {
  19123. b = c - 17 + 0xa;
  19124. // '0' - '9'
  19125. } else {
  19126. b = c;
  19127. }
  19128. r |= b;
  19129. z |= b;
  19130. }
  19131. assert(!(z & 0xf0), 'Invalid character in ' + str);
  19132. return r;
  19133. }
  19134. BN.prototype._parseHex = function _parseHex (number, start) {
  19135. // Create possibly bigger array to ensure that it fits the number
  19136. this.length = Math.ceil((number.length - start) / 6);
  19137. this.words = new Array(this.length);
  19138. for (var i = 0; i < this.length; i++) {
  19139. this.words[i] = 0;
  19140. }
  19141. var j, w;
  19142. // Scan 24-bit chunks and add them to the number
  19143. var off = 0;
  19144. for (i = number.length - 6, j = 0; i >= start; i -= 6) {
  19145. w = parseHex(number, i, i + 6);
  19146. this.words[j] |= (w << off) & 0x3ffffff;
  19147. // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
  19148. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19149. off += 24;
  19150. if (off >= 26) {
  19151. off -= 26;
  19152. j++;
  19153. }
  19154. }
  19155. if (i + 6 !== start) {
  19156. w = parseHex(number, start, i + 6);
  19157. this.words[j] |= (w << off) & 0x3ffffff;
  19158. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19159. }
  19160. this._strip();
  19161. };
  19162. function parseBase (str, start, end, mul) {
  19163. var r = 0;
  19164. var b = 0;
  19165. var len = Math.min(str.length, end);
  19166. for (var i = start; i < len; i++) {
  19167. var c = str.charCodeAt(i) - 48;
  19168. r *= mul;
  19169. // 'a'
  19170. if (c >= 49) {
  19171. b = c - 49 + 0xa;
  19172. // 'A'
  19173. } else if (c >= 17) {
  19174. b = c - 17 + 0xa;
  19175. // '0' - '9'
  19176. } else {
  19177. b = c;
  19178. }
  19179. assert(c >= 0 && b < mul, 'Invalid character');
  19180. r += b;
  19181. }
  19182. return r;
  19183. }
  19184. BN.prototype._parseBase = function _parseBase (number, base, start) {
  19185. // Initialize as zero
  19186. this.words = [0];
  19187. this.length = 1;
  19188. // Find length of limb in base
  19189. for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
  19190. limbLen++;
  19191. }
  19192. limbLen--;
  19193. limbPow = (limbPow / base) | 0;
  19194. var total = number.length - start;
  19195. var mod = total % limbLen;
  19196. var end = Math.min(total, total - mod) + start;
  19197. var word = 0;
  19198. for (var i = start; i < end; i += limbLen) {
  19199. word = parseBase(number, i, i + limbLen, base);
  19200. this.imuln(limbPow);
  19201. if (this.words[0] + word < 0x4000000) {
  19202. this.words[0] += word;
  19203. } else {
  19204. this._iaddn(word);
  19205. }
  19206. }
  19207. if (mod !== 0) {
  19208. var pow = 1;
  19209. word = parseBase(number, i, number.length, base);
  19210. for (i = 0; i < mod; i++) {
  19211. pow *= base;
  19212. }
  19213. this.imuln(pow);
  19214. if (this.words[0] + word < 0x4000000) {
  19215. this.words[0] += word;
  19216. } else {
  19217. this._iaddn(word);
  19218. }
  19219. }
  19220. };
  19221. BN.prototype.copy = function copy (dest) {
  19222. dest.words = new Array(this.length);
  19223. for (var i = 0; i < this.length; i++) {
  19224. dest.words[i] = this.words[i];
  19225. }
  19226. dest.length = this.length;
  19227. dest.negative = this.negative;
  19228. dest.red = this.red;
  19229. };
  19230. function move (dest, src) {
  19231. dest.words = src.words;
  19232. dest.length = src.length;
  19233. dest.negative = src.negative;
  19234. dest.red = src.red;
  19235. }
  19236. BN.prototype._move = function _move (dest) {
  19237. move(dest, this);
  19238. };
  19239. BN.prototype.clone = function clone () {
  19240. var r = new BN(null);
  19241. this.copy(r);
  19242. return r;
  19243. };
  19244. BN.prototype._expand = function _expand (size) {
  19245. while (this.length < size) {
  19246. this.words[this.length++] = 0;
  19247. }
  19248. return this;
  19249. };
  19250. // Remove leading `0` from `this`
  19251. BN.prototype._strip = function strip () {
  19252. while (this.length > 1 && this.words[this.length - 1] === 0) {
  19253. this.length--;
  19254. }
  19255. return this._normSign();
  19256. };
  19257. BN.prototype._normSign = function _normSign () {
  19258. // -0 = 0
  19259. if (this.length === 1 && this.words[0] === 0) {
  19260. this.negative = 0;
  19261. }
  19262. return this;
  19263. };
  19264. // Check Symbol.for because not everywhere where Symbol defined
  19265. // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility
  19266. if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {
  19267. BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
  19268. } else {
  19269. BN.prototype.inspect = inspect;
  19270. }
  19271. function inspect () {
  19272. return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  19273. }
  19274. /*
  19275. var zeros = [];
  19276. var groupSizes = [];
  19277. var groupBases = [];
  19278. var s = '';
  19279. var i = -1;
  19280. while (++i < BN.wordSize) {
  19281. zeros[i] = s;
  19282. s += '0';
  19283. }
  19284. groupSizes[0] = 0;
  19285. groupSizes[1] = 0;
  19286. groupBases[0] = 0;
  19287. groupBases[1] = 0;
  19288. var base = 2 - 1;
  19289. while (++base < 36 + 1) {
  19290. var groupSize = 0;
  19291. var groupBase = 1;
  19292. while (groupBase < (1 << BN.wordSize) / base) {
  19293. groupBase *= base;
  19294. groupSize += 1;
  19295. }
  19296. groupSizes[base] = groupSize;
  19297. groupBases[base] = groupBase;
  19298. }
  19299. */
  19300. var zeros = [
  19301. '',
  19302. '0',
  19303. '00',
  19304. '000',
  19305. '0000',
  19306. '00000',
  19307. '000000',
  19308. '0000000',
  19309. '00000000',
  19310. '000000000',
  19311. '0000000000',
  19312. '00000000000',
  19313. '000000000000',
  19314. '0000000000000',
  19315. '00000000000000',
  19316. '000000000000000',
  19317. '0000000000000000',
  19318. '00000000000000000',
  19319. '000000000000000000',
  19320. '0000000000000000000',
  19321. '00000000000000000000',
  19322. '000000000000000000000',
  19323. '0000000000000000000000',
  19324. '00000000000000000000000',
  19325. '000000000000000000000000',
  19326. '0000000000000000000000000'
  19327. ];
  19328. var groupSizes = [
  19329. 0, 0,
  19330. 25, 16, 12, 11, 10, 9, 8,
  19331. 8, 7, 7, 7, 7, 6, 6,
  19332. 6, 6, 6, 6, 6, 5, 5,
  19333. 5, 5, 5, 5, 5, 5, 5,
  19334. 5, 5, 5, 5, 5, 5, 5
  19335. ];
  19336. var groupBases = [
  19337. 0, 0,
  19338. 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
  19339. 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
  19340. 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
  19341. 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
  19342. 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
  19343. ];
  19344. BN.prototype.toString = function toString (base, padding) {
  19345. base = base || 10;
  19346. padding = padding | 0 || 1;
  19347. var out;
  19348. if (base === 16 || base === 'hex') {
  19349. out = '';
  19350. var off = 0;
  19351. var carry = 0;
  19352. for (var i = 0; i < this.length; i++) {
  19353. var w = this.words[i];
  19354. var word = (((w << off) | carry) & 0xffffff).toString(16);
  19355. carry = (w >>> (24 - off)) & 0xffffff;
  19356. if (carry !== 0 || i !== this.length - 1) {
  19357. out = zeros[6 - word.length] + word + out;
  19358. } else {
  19359. out = word + out;
  19360. }
  19361. off += 2;
  19362. if (off >= 26) {
  19363. off -= 26;
  19364. i--;
  19365. }
  19366. }
  19367. if (carry !== 0) {
  19368. out = carry.toString(16) + out;
  19369. }
  19370. while (out.length % padding !== 0) {
  19371. out = '0' + out;
  19372. }
  19373. if (this.negative !== 0) {
  19374. out = '-' + out;
  19375. }
  19376. return out;
  19377. }
  19378. if (base === (base | 0) && base >= 2 && base <= 36) {
  19379. // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
  19380. var groupSize = groupSizes[base];
  19381. // var groupBase = Math.pow(base, groupSize);
  19382. var groupBase = groupBases[base];
  19383. out = '';
  19384. var c = this.clone();
  19385. c.negative = 0;
  19386. while (!c.isZero()) {
  19387. var r = c.modrn(groupBase).toString(base);
  19388. c = c.idivn(groupBase);
  19389. if (!c.isZero()) {
  19390. out = zeros[groupSize - r.length] + r + out;
  19391. } else {
  19392. out = r + out;
  19393. }
  19394. }
  19395. if (this.isZero()) {
  19396. out = '0' + out;
  19397. }
  19398. while (out.length % padding !== 0) {
  19399. out = '0' + out;
  19400. }
  19401. if (this.negative !== 0) {
  19402. out = '-' + out;
  19403. }
  19404. return out;
  19405. }
  19406. assert(false, 'Base should be between 2 and 36');
  19407. };
  19408. BN.prototype.toNumber = function toNumber () {
  19409. var ret = this.words[0];
  19410. if (this.length === 2) {
  19411. ret += this.words[1] * 0x4000000;
  19412. } else if (this.length === 3 && this.words[2] === 0x01) {
  19413. // NOTE: at this stage it is known that the top bit is set
  19414. ret += 0x10000000000000 + (this.words[1] * 0x4000000);
  19415. } else if (this.length > 2) {
  19416. assert(false, 'Number can only safely store up to 53 bits');
  19417. }
  19418. return (this.negative !== 0) ? -ret : ret;
  19419. };
  19420. BN.prototype.toJSON = function toJSON () {
  19421. return this.toString(16, 2);
  19422. };
  19423. if (Buffer) {
  19424. BN.prototype.toBuffer = function toBuffer (endian, length) {
  19425. return this.toArrayLike(Buffer, endian, length);
  19426. };
  19427. }
  19428. BN.prototype.toArray = function toArray (endian, length) {
  19429. return this.toArrayLike(Array, endian, length);
  19430. };
  19431. var allocate = function allocate (ArrayType, size) {
  19432. if (ArrayType.allocUnsafe) {
  19433. return ArrayType.allocUnsafe(size);
  19434. }
  19435. return new ArrayType(size);
  19436. };
  19437. BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
  19438. this._strip();
  19439. var byteLength = this.byteLength();
  19440. var reqLength = length || Math.max(1, byteLength);
  19441. assert(byteLength <= reqLength, 'byte array longer than desired length');
  19442. assert(reqLength > 0, 'Requested array length <= 0');
  19443. var res = allocate(ArrayType, reqLength);
  19444. var postfix = endian === 'le' ? 'LE' : 'BE';
  19445. this['_toArrayLike' + postfix](res, byteLength);
  19446. return res;
  19447. };
  19448. BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {
  19449. var position = 0;
  19450. var carry = 0;
  19451. for (var i = 0, shift = 0; i < this.length; i++) {
  19452. var word = (this.words[i] << shift) | carry;
  19453. res[position++] = word & 0xff;
  19454. if (position < res.length) {
  19455. res[position++] = (word >> 8) & 0xff;
  19456. }
  19457. if (position < res.length) {
  19458. res[position++] = (word >> 16) & 0xff;
  19459. }
  19460. if (shift === 6) {
  19461. if (position < res.length) {
  19462. res[position++] = (word >> 24) & 0xff;
  19463. }
  19464. carry = 0;
  19465. shift = 0;
  19466. } else {
  19467. carry = word >>> 24;
  19468. shift += 2;
  19469. }
  19470. }
  19471. if (position < res.length) {
  19472. res[position++] = carry;
  19473. while (position < res.length) {
  19474. res[position++] = 0;
  19475. }
  19476. }
  19477. };
  19478. BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {
  19479. var position = res.length - 1;
  19480. var carry = 0;
  19481. for (var i = 0, shift = 0; i < this.length; i++) {
  19482. var word = (this.words[i] << shift) | carry;
  19483. res[position--] = word & 0xff;
  19484. if (position >= 0) {
  19485. res[position--] = (word >> 8) & 0xff;
  19486. }
  19487. if (position >= 0) {
  19488. res[position--] = (word >> 16) & 0xff;
  19489. }
  19490. if (shift === 6) {
  19491. if (position >= 0) {
  19492. res[position--] = (word >> 24) & 0xff;
  19493. }
  19494. carry = 0;
  19495. shift = 0;
  19496. } else {
  19497. carry = word >>> 24;
  19498. shift += 2;
  19499. }
  19500. }
  19501. if (position >= 0) {
  19502. res[position--] = carry;
  19503. while (position >= 0) {
  19504. res[position--] = 0;
  19505. }
  19506. }
  19507. };
  19508. if (Math.clz32) {
  19509. BN.prototype._countBits = function _countBits (w) {
  19510. return 32 - Math.clz32(w);
  19511. };
  19512. } else {
  19513. BN.prototype._countBits = function _countBits (w) {
  19514. var t = w;
  19515. var r = 0;
  19516. if (t >= 0x1000) {
  19517. r += 13;
  19518. t >>>= 13;
  19519. }
  19520. if (t >= 0x40) {
  19521. r += 7;
  19522. t >>>= 7;
  19523. }
  19524. if (t >= 0x8) {
  19525. r += 4;
  19526. t >>>= 4;
  19527. }
  19528. if (t >= 0x02) {
  19529. r += 2;
  19530. t >>>= 2;
  19531. }
  19532. return r + t;
  19533. };
  19534. }
  19535. BN.prototype._zeroBits = function _zeroBits (w) {
  19536. // Short-cut
  19537. if (w === 0) return 26;
  19538. var t = w;
  19539. var r = 0;
  19540. if ((t & 0x1fff) === 0) {
  19541. r += 13;
  19542. t >>>= 13;
  19543. }
  19544. if ((t & 0x7f) === 0) {
  19545. r += 7;
  19546. t >>>= 7;
  19547. }
  19548. if ((t & 0xf) === 0) {
  19549. r += 4;
  19550. t >>>= 4;
  19551. }
  19552. if ((t & 0x3) === 0) {
  19553. r += 2;
  19554. t >>>= 2;
  19555. }
  19556. if ((t & 0x1) === 0) {
  19557. r++;
  19558. }
  19559. return r;
  19560. };
  19561. // Return number of used bits in a BN
  19562. BN.prototype.bitLength = function bitLength () {
  19563. var w = this.words[this.length - 1];
  19564. var hi = this._countBits(w);
  19565. return (this.length - 1) * 26 + hi;
  19566. };
  19567. function toBitArray (num) {
  19568. var w = new Array(num.bitLength());
  19569. for (var bit = 0; bit < w.length; bit++) {
  19570. var off = (bit / 26) | 0;
  19571. var wbit = bit % 26;
  19572. w[bit] = (num.words[off] >>> wbit) & 0x01;
  19573. }
  19574. return w;
  19575. }
  19576. // Number of trailing zero bits
  19577. BN.prototype.zeroBits = function zeroBits () {
  19578. if (this.isZero()) return 0;
  19579. var r = 0;
  19580. for (var i = 0; i < this.length; i++) {
  19581. var b = this._zeroBits(this.words[i]);
  19582. r += b;
  19583. if (b !== 26) break;
  19584. }
  19585. return r;
  19586. };
  19587. BN.prototype.byteLength = function byteLength () {
  19588. return Math.ceil(this.bitLength() / 8);
  19589. };
  19590. BN.prototype.toTwos = function toTwos (width) {
  19591. if (this.negative !== 0) {
  19592. return this.abs().inotn(width).iaddn(1);
  19593. }
  19594. return this.clone();
  19595. };
  19596. BN.prototype.fromTwos = function fromTwos (width) {
  19597. if (this.testn(width - 1)) {
  19598. return this.notn(width).iaddn(1).ineg();
  19599. }
  19600. return this.clone();
  19601. };
  19602. BN.prototype.isNeg = function isNeg () {
  19603. return this.negative !== 0;
  19604. };
  19605. // Return negative clone of `this`
  19606. BN.prototype.neg = function neg () {
  19607. return this.clone().ineg();
  19608. };
  19609. BN.prototype.ineg = function ineg () {
  19610. if (!this.isZero()) {
  19611. this.negative ^= 1;
  19612. }
  19613. return this;
  19614. };
  19615. // Or `num` with `this` in-place
  19616. BN.prototype.iuor = function iuor (num) {
  19617. while (this.length < num.length) {
  19618. this.words[this.length++] = 0;
  19619. }
  19620. for (var i = 0; i < num.length; i++) {
  19621. this.words[i] = this.words[i] | num.words[i];
  19622. }
  19623. return this._strip();
  19624. };
  19625. BN.prototype.ior = function ior (num) {
  19626. assert((this.negative | num.negative) === 0);
  19627. return this.iuor(num);
  19628. };
  19629. // Or `num` with `this`
  19630. BN.prototype.or = function or (num) {
  19631. if (this.length > num.length) return this.clone().ior(num);
  19632. return num.clone().ior(this);
  19633. };
  19634. BN.prototype.uor = function uor (num) {
  19635. if (this.length > num.length) return this.clone().iuor(num);
  19636. return num.clone().iuor(this);
  19637. };
  19638. // And `num` with `this` in-place
  19639. BN.prototype.iuand = function iuand (num) {
  19640. // b = min-length(num, this)
  19641. var b;
  19642. if (this.length > num.length) {
  19643. b = num;
  19644. } else {
  19645. b = this;
  19646. }
  19647. for (var i = 0; i < b.length; i++) {
  19648. this.words[i] = this.words[i] & num.words[i];
  19649. }
  19650. this.length = b.length;
  19651. return this._strip();
  19652. };
  19653. BN.prototype.iand = function iand (num) {
  19654. assert((this.negative | num.negative) === 0);
  19655. return this.iuand(num);
  19656. };
  19657. // And `num` with `this`
  19658. BN.prototype.and = function and (num) {
  19659. if (this.length > num.length) return this.clone().iand(num);
  19660. return num.clone().iand(this);
  19661. };
  19662. BN.prototype.uand = function uand (num) {
  19663. if (this.length > num.length) return this.clone().iuand(num);
  19664. return num.clone().iuand(this);
  19665. };
  19666. // Xor `num` with `this` in-place
  19667. BN.prototype.iuxor = function iuxor (num) {
  19668. // a.length > b.length
  19669. var a;
  19670. var b;
  19671. if (this.length > num.length) {
  19672. a = this;
  19673. b = num;
  19674. } else {
  19675. a = num;
  19676. b = this;
  19677. }
  19678. for (var i = 0; i < b.length; i++) {
  19679. this.words[i] = a.words[i] ^ b.words[i];
  19680. }
  19681. if (this !== a) {
  19682. for (; i < a.length; i++) {
  19683. this.words[i] = a.words[i];
  19684. }
  19685. }
  19686. this.length = a.length;
  19687. return this._strip();
  19688. };
  19689. BN.prototype.ixor = function ixor (num) {
  19690. assert((this.negative | num.negative) === 0);
  19691. return this.iuxor(num);
  19692. };
  19693. // Xor `num` with `this`
  19694. BN.prototype.xor = function xor (num) {
  19695. if (this.length > num.length) return this.clone().ixor(num);
  19696. return num.clone().ixor(this);
  19697. };
  19698. BN.prototype.uxor = function uxor (num) {
  19699. if (this.length > num.length) return this.clone().iuxor(num);
  19700. return num.clone().iuxor(this);
  19701. };
  19702. // Not ``this`` with ``width`` bitwidth
  19703. BN.prototype.inotn = function inotn (width) {
  19704. assert(typeof width === 'number' && width >= 0);
  19705. var bytesNeeded = Math.ceil(width / 26) | 0;
  19706. var bitsLeft = width % 26;
  19707. // Extend the buffer with leading zeroes
  19708. this._expand(bytesNeeded);
  19709. if (bitsLeft > 0) {
  19710. bytesNeeded--;
  19711. }
  19712. // Handle complete words
  19713. for (var i = 0; i < bytesNeeded; i++) {
  19714. this.words[i] = ~this.words[i] & 0x3ffffff;
  19715. }
  19716. // Handle the residue
  19717. if (bitsLeft > 0) {
  19718. this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
  19719. }
  19720. // And remove leading zeroes
  19721. return this._strip();
  19722. };
  19723. BN.prototype.notn = function notn (width) {
  19724. return this.clone().inotn(width);
  19725. };
  19726. // Set `bit` of `this`
  19727. BN.prototype.setn = function setn (bit, val) {
  19728. assert(typeof bit === 'number' && bit >= 0);
  19729. var off = (bit / 26) | 0;
  19730. var wbit = bit % 26;
  19731. this._expand(off + 1);
  19732. if (val) {
  19733. this.words[off] = this.words[off] | (1 << wbit);
  19734. } else {
  19735. this.words[off] = this.words[off] & ~(1 << wbit);
  19736. }
  19737. return this._strip();
  19738. };
  19739. // Add `num` to `this` in-place
  19740. BN.prototype.iadd = function iadd (num) {
  19741. var r;
  19742. // negative + positive
  19743. if (this.negative !== 0 && num.negative === 0) {
  19744. this.negative = 0;
  19745. r = this.isub(num);
  19746. this.negative ^= 1;
  19747. return this._normSign();
  19748. // positive + negative
  19749. } else if (this.negative === 0 && num.negative !== 0) {
  19750. num.negative = 0;
  19751. r = this.isub(num);
  19752. num.negative = 1;
  19753. return r._normSign();
  19754. }
  19755. // a.length > b.length
  19756. var a, b;
  19757. if (this.length > num.length) {
  19758. a = this;
  19759. b = num;
  19760. } else {
  19761. a = num;
  19762. b = this;
  19763. }
  19764. var carry = 0;
  19765. for (var i = 0; i < b.length; i++) {
  19766. r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
  19767. this.words[i] = r & 0x3ffffff;
  19768. carry = r >>> 26;
  19769. }
  19770. for (; carry !== 0 && i < a.length; i++) {
  19771. r = (a.words[i] | 0) + carry;
  19772. this.words[i] = r & 0x3ffffff;
  19773. carry = r >>> 26;
  19774. }
  19775. this.length = a.length;
  19776. if (carry !== 0) {
  19777. this.words[this.length] = carry;
  19778. this.length++;
  19779. // Copy the rest of the words
  19780. } else if (a !== this) {
  19781. for (; i < a.length; i++) {
  19782. this.words[i] = a.words[i];
  19783. }
  19784. }
  19785. return this;
  19786. };
  19787. // Add `num` to `this`
  19788. BN.prototype.add = function add (num) {
  19789. var res;
  19790. if (num.negative !== 0 && this.negative === 0) {
  19791. num.negative = 0;
  19792. res = this.sub(num);
  19793. num.negative ^= 1;
  19794. return res;
  19795. } else if (num.negative === 0 && this.negative !== 0) {
  19796. this.negative = 0;
  19797. res = num.sub(this);
  19798. this.negative = 1;
  19799. return res;
  19800. }
  19801. if (this.length > num.length) return this.clone().iadd(num);
  19802. return num.clone().iadd(this);
  19803. };
  19804. // Subtract `num` from `this` in-place
  19805. BN.prototype.isub = function isub (num) {
  19806. // this - (-num) = this + num
  19807. if (num.negative !== 0) {
  19808. num.negative = 0;
  19809. var r = this.iadd(num);
  19810. num.negative = 1;
  19811. return r._normSign();
  19812. // -this - num = -(this + num)
  19813. } else if (this.negative !== 0) {
  19814. this.negative = 0;
  19815. this.iadd(num);
  19816. this.negative = 1;
  19817. return this._normSign();
  19818. }
  19819. // At this point both numbers are positive
  19820. var cmp = this.cmp(num);
  19821. // Optimization - zeroify
  19822. if (cmp === 0) {
  19823. this.negative = 0;
  19824. this.length = 1;
  19825. this.words[0] = 0;
  19826. return this;
  19827. }
  19828. // a > b
  19829. var a, b;
  19830. if (cmp > 0) {
  19831. a = this;
  19832. b = num;
  19833. } else {
  19834. a = num;
  19835. b = this;
  19836. }
  19837. var carry = 0;
  19838. for (var i = 0; i < b.length; i++) {
  19839. r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
  19840. carry = r >> 26;
  19841. this.words[i] = r & 0x3ffffff;
  19842. }
  19843. for (; carry !== 0 && i < a.length; i++) {
  19844. r = (a.words[i] | 0) + carry;
  19845. carry = r >> 26;
  19846. this.words[i] = r & 0x3ffffff;
  19847. }
  19848. // Copy rest of the words
  19849. if (carry === 0 && i < a.length && a !== this) {
  19850. for (; i < a.length; i++) {
  19851. this.words[i] = a.words[i];
  19852. }
  19853. }
  19854. this.length = Math.max(this.length, i);
  19855. if (a !== this) {
  19856. this.negative = 1;
  19857. }
  19858. return this._strip();
  19859. };
  19860. // Subtract `num` from `this`
  19861. BN.prototype.sub = function sub (num) {
  19862. return this.clone().isub(num);
  19863. };
  19864. function smallMulTo (self, num, out) {
  19865. out.negative = num.negative ^ self.negative;
  19866. var len = (self.length + num.length) | 0;
  19867. out.length = len;
  19868. len = (len - 1) | 0;
  19869. // Peel one iteration (compiler can't do it, because of code complexity)
  19870. var a = self.words[0] | 0;
  19871. var b = num.words[0] | 0;
  19872. var r = a * b;
  19873. var lo = r & 0x3ffffff;
  19874. var carry = (r / 0x4000000) | 0;
  19875. out.words[0] = lo;
  19876. for (var k = 1; k < len; k++) {
  19877. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  19878. // note that ncarry could be >= 0x3ffffff
  19879. var ncarry = carry >>> 26;
  19880. var rword = carry & 0x3ffffff;
  19881. var maxJ = Math.min(k, num.length - 1);
  19882. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  19883. var i = (k - j) | 0;
  19884. a = self.words[i] | 0;
  19885. b = num.words[j] | 0;
  19886. r = a * b + rword;
  19887. ncarry += (r / 0x4000000) | 0;
  19888. rword = r & 0x3ffffff;
  19889. }
  19890. out.words[k] = rword | 0;
  19891. carry = ncarry | 0;
  19892. }
  19893. if (carry !== 0) {
  19894. out.words[k] = carry | 0;
  19895. } else {
  19896. out.length--;
  19897. }
  19898. return out._strip();
  19899. }
  19900. // TODO(indutny): it may be reasonable to omit it for users who don't need
  19901. // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  19902. // multiplication (like elliptic secp256k1).
  19903. var comb10MulTo = function comb10MulTo (self, num, out) {
  19904. var a = self.words;
  19905. var b = num.words;
  19906. var o = out.words;
  19907. var c = 0;
  19908. var lo;
  19909. var mid;
  19910. var hi;
  19911. var a0 = a[0] | 0;
  19912. var al0 = a0 & 0x1fff;
  19913. var ah0 = a0 >>> 13;
  19914. var a1 = a[1] | 0;
  19915. var al1 = a1 & 0x1fff;
  19916. var ah1 = a1 >>> 13;
  19917. var a2 = a[2] | 0;
  19918. var al2 = a2 & 0x1fff;
  19919. var ah2 = a2 >>> 13;
  19920. var a3 = a[3] | 0;
  19921. var al3 = a3 & 0x1fff;
  19922. var ah3 = a3 >>> 13;
  19923. var a4 = a[4] | 0;
  19924. var al4 = a4 & 0x1fff;
  19925. var ah4 = a4 >>> 13;
  19926. var a5 = a[5] | 0;
  19927. var al5 = a5 & 0x1fff;
  19928. var ah5 = a5 >>> 13;
  19929. var a6 = a[6] | 0;
  19930. var al6 = a6 & 0x1fff;
  19931. var ah6 = a6 >>> 13;
  19932. var a7 = a[7] | 0;
  19933. var al7 = a7 & 0x1fff;
  19934. var ah7 = a7 >>> 13;
  19935. var a8 = a[8] | 0;
  19936. var al8 = a8 & 0x1fff;
  19937. var ah8 = a8 >>> 13;
  19938. var a9 = a[9] | 0;
  19939. var al9 = a9 & 0x1fff;
  19940. var ah9 = a9 >>> 13;
  19941. var b0 = b[0] | 0;
  19942. var bl0 = b0 & 0x1fff;
  19943. var bh0 = b0 >>> 13;
  19944. var b1 = b[1] | 0;
  19945. var bl1 = b1 & 0x1fff;
  19946. var bh1 = b1 >>> 13;
  19947. var b2 = b[2] | 0;
  19948. var bl2 = b2 & 0x1fff;
  19949. var bh2 = b2 >>> 13;
  19950. var b3 = b[3] | 0;
  19951. var bl3 = b3 & 0x1fff;
  19952. var bh3 = b3 >>> 13;
  19953. var b4 = b[4] | 0;
  19954. var bl4 = b4 & 0x1fff;
  19955. var bh4 = b4 >>> 13;
  19956. var b5 = b[5] | 0;
  19957. var bl5 = b5 & 0x1fff;
  19958. var bh5 = b5 >>> 13;
  19959. var b6 = b[6] | 0;
  19960. var bl6 = b6 & 0x1fff;
  19961. var bh6 = b6 >>> 13;
  19962. var b7 = b[7] | 0;
  19963. var bl7 = b7 & 0x1fff;
  19964. var bh7 = b7 >>> 13;
  19965. var b8 = b[8] | 0;
  19966. var bl8 = b8 & 0x1fff;
  19967. var bh8 = b8 >>> 13;
  19968. var b9 = b[9] | 0;
  19969. var bl9 = b9 & 0x1fff;
  19970. var bh9 = b9 >>> 13;
  19971. out.negative = self.negative ^ num.negative;
  19972. out.length = 19;
  19973. /* k = 0 */
  19974. lo = Math.imul(al0, bl0);
  19975. mid = Math.imul(al0, bh0);
  19976. mid = (mid + Math.imul(ah0, bl0)) | 0;
  19977. hi = Math.imul(ah0, bh0);
  19978. var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19979. c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
  19980. w0 &= 0x3ffffff;
  19981. /* k = 1 */
  19982. lo = Math.imul(al1, bl0);
  19983. mid = Math.imul(al1, bh0);
  19984. mid = (mid + Math.imul(ah1, bl0)) | 0;
  19985. hi = Math.imul(ah1, bh0);
  19986. lo = (lo + Math.imul(al0, bl1)) | 0;
  19987. mid = (mid + Math.imul(al0, bh1)) | 0;
  19988. mid = (mid + Math.imul(ah0, bl1)) | 0;
  19989. hi = (hi + Math.imul(ah0, bh1)) | 0;
  19990. var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19991. c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
  19992. w1 &= 0x3ffffff;
  19993. /* k = 2 */
  19994. lo = Math.imul(al2, bl0);
  19995. mid = Math.imul(al2, bh0);
  19996. mid = (mid + Math.imul(ah2, bl0)) | 0;
  19997. hi = Math.imul(ah2, bh0);
  19998. lo = (lo + Math.imul(al1, bl1)) | 0;
  19999. mid = (mid + Math.imul(al1, bh1)) | 0;
  20000. mid = (mid + Math.imul(ah1, bl1)) | 0;
  20001. hi = (hi + Math.imul(ah1, bh1)) | 0;
  20002. lo = (lo + Math.imul(al0, bl2)) | 0;
  20003. mid = (mid + Math.imul(al0, bh2)) | 0;
  20004. mid = (mid + Math.imul(ah0, bl2)) | 0;
  20005. hi = (hi + Math.imul(ah0, bh2)) | 0;
  20006. var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20007. c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
  20008. w2 &= 0x3ffffff;
  20009. /* k = 3 */
  20010. lo = Math.imul(al3, bl0);
  20011. mid = Math.imul(al3, bh0);
  20012. mid = (mid + Math.imul(ah3, bl0)) | 0;
  20013. hi = Math.imul(ah3, bh0);
  20014. lo = (lo + Math.imul(al2, bl1)) | 0;
  20015. mid = (mid + Math.imul(al2, bh1)) | 0;
  20016. mid = (mid + Math.imul(ah2, bl1)) | 0;
  20017. hi = (hi + Math.imul(ah2, bh1)) | 0;
  20018. lo = (lo + Math.imul(al1, bl2)) | 0;
  20019. mid = (mid + Math.imul(al1, bh2)) | 0;
  20020. mid = (mid + Math.imul(ah1, bl2)) | 0;
  20021. hi = (hi + Math.imul(ah1, bh2)) | 0;
  20022. lo = (lo + Math.imul(al0, bl3)) | 0;
  20023. mid = (mid + Math.imul(al0, bh3)) | 0;
  20024. mid = (mid + Math.imul(ah0, bl3)) | 0;
  20025. hi = (hi + Math.imul(ah0, bh3)) | 0;
  20026. var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20027. c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
  20028. w3 &= 0x3ffffff;
  20029. /* k = 4 */
  20030. lo = Math.imul(al4, bl0);
  20031. mid = Math.imul(al4, bh0);
  20032. mid = (mid + Math.imul(ah4, bl0)) | 0;
  20033. hi = Math.imul(ah4, bh0);
  20034. lo = (lo + Math.imul(al3, bl1)) | 0;
  20035. mid = (mid + Math.imul(al3, bh1)) | 0;
  20036. mid = (mid + Math.imul(ah3, bl1)) | 0;
  20037. hi = (hi + Math.imul(ah3, bh1)) | 0;
  20038. lo = (lo + Math.imul(al2, bl2)) | 0;
  20039. mid = (mid + Math.imul(al2, bh2)) | 0;
  20040. mid = (mid + Math.imul(ah2, bl2)) | 0;
  20041. hi = (hi + Math.imul(ah2, bh2)) | 0;
  20042. lo = (lo + Math.imul(al1, bl3)) | 0;
  20043. mid = (mid + Math.imul(al1, bh3)) | 0;
  20044. mid = (mid + Math.imul(ah1, bl3)) | 0;
  20045. hi = (hi + Math.imul(ah1, bh3)) | 0;
  20046. lo = (lo + Math.imul(al0, bl4)) | 0;
  20047. mid = (mid + Math.imul(al0, bh4)) | 0;
  20048. mid = (mid + Math.imul(ah0, bl4)) | 0;
  20049. hi = (hi + Math.imul(ah0, bh4)) | 0;
  20050. var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20051. c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
  20052. w4 &= 0x3ffffff;
  20053. /* k = 5 */
  20054. lo = Math.imul(al5, bl0);
  20055. mid = Math.imul(al5, bh0);
  20056. mid = (mid + Math.imul(ah5, bl0)) | 0;
  20057. hi = Math.imul(ah5, bh0);
  20058. lo = (lo + Math.imul(al4, bl1)) | 0;
  20059. mid = (mid + Math.imul(al4, bh1)) | 0;
  20060. mid = (mid + Math.imul(ah4, bl1)) | 0;
  20061. hi = (hi + Math.imul(ah4, bh1)) | 0;
  20062. lo = (lo + Math.imul(al3, bl2)) | 0;
  20063. mid = (mid + Math.imul(al3, bh2)) | 0;
  20064. mid = (mid + Math.imul(ah3, bl2)) | 0;
  20065. hi = (hi + Math.imul(ah3, bh2)) | 0;
  20066. lo = (lo + Math.imul(al2, bl3)) | 0;
  20067. mid = (mid + Math.imul(al2, bh3)) | 0;
  20068. mid = (mid + Math.imul(ah2, bl3)) | 0;
  20069. hi = (hi + Math.imul(ah2, bh3)) | 0;
  20070. lo = (lo + Math.imul(al1, bl4)) | 0;
  20071. mid = (mid + Math.imul(al1, bh4)) | 0;
  20072. mid = (mid + Math.imul(ah1, bl4)) | 0;
  20073. hi = (hi + Math.imul(ah1, bh4)) | 0;
  20074. lo = (lo + Math.imul(al0, bl5)) | 0;
  20075. mid = (mid + Math.imul(al0, bh5)) | 0;
  20076. mid = (mid + Math.imul(ah0, bl5)) | 0;
  20077. hi = (hi + Math.imul(ah0, bh5)) | 0;
  20078. var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20079. c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
  20080. w5 &= 0x3ffffff;
  20081. /* k = 6 */
  20082. lo = Math.imul(al6, bl0);
  20083. mid = Math.imul(al6, bh0);
  20084. mid = (mid + Math.imul(ah6, bl0)) | 0;
  20085. hi = Math.imul(ah6, bh0);
  20086. lo = (lo + Math.imul(al5, bl1)) | 0;
  20087. mid = (mid + Math.imul(al5, bh1)) | 0;
  20088. mid = (mid + Math.imul(ah5, bl1)) | 0;
  20089. hi = (hi + Math.imul(ah5, bh1)) | 0;
  20090. lo = (lo + Math.imul(al4, bl2)) | 0;
  20091. mid = (mid + Math.imul(al4, bh2)) | 0;
  20092. mid = (mid + Math.imul(ah4, bl2)) | 0;
  20093. hi = (hi + Math.imul(ah4, bh2)) | 0;
  20094. lo = (lo + Math.imul(al3, bl3)) | 0;
  20095. mid = (mid + Math.imul(al3, bh3)) | 0;
  20096. mid = (mid + Math.imul(ah3, bl3)) | 0;
  20097. hi = (hi + Math.imul(ah3, bh3)) | 0;
  20098. lo = (lo + Math.imul(al2, bl4)) | 0;
  20099. mid = (mid + Math.imul(al2, bh4)) | 0;
  20100. mid = (mid + Math.imul(ah2, bl4)) | 0;
  20101. hi = (hi + Math.imul(ah2, bh4)) | 0;
  20102. lo = (lo + Math.imul(al1, bl5)) | 0;
  20103. mid = (mid + Math.imul(al1, bh5)) | 0;
  20104. mid = (mid + Math.imul(ah1, bl5)) | 0;
  20105. hi = (hi + Math.imul(ah1, bh5)) | 0;
  20106. lo = (lo + Math.imul(al0, bl6)) | 0;
  20107. mid = (mid + Math.imul(al0, bh6)) | 0;
  20108. mid = (mid + Math.imul(ah0, bl6)) | 0;
  20109. hi = (hi + Math.imul(ah0, bh6)) | 0;
  20110. var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20111. c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
  20112. w6 &= 0x3ffffff;
  20113. /* k = 7 */
  20114. lo = Math.imul(al7, bl0);
  20115. mid = Math.imul(al7, bh0);
  20116. mid = (mid + Math.imul(ah7, bl0)) | 0;
  20117. hi = Math.imul(ah7, bh0);
  20118. lo = (lo + Math.imul(al6, bl1)) | 0;
  20119. mid = (mid + Math.imul(al6, bh1)) | 0;
  20120. mid = (mid + Math.imul(ah6, bl1)) | 0;
  20121. hi = (hi + Math.imul(ah6, bh1)) | 0;
  20122. lo = (lo + Math.imul(al5, bl2)) | 0;
  20123. mid = (mid + Math.imul(al5, bh2)) | 0;
  20124. mid = (mid + Math.imul(ah5, bl2)) | 0;
  20125. hi = (hi + Math.imul(ah5, bh2)) | 0;
  20126. lo = (lo + Math.imul(al4, bl3)) | 0;
  20127. mid = (mid + Math.imul(al4, bh3)) | 0;
  20128. mid = (mid + Math.imul(ah4, bl3)) | 0;
  20129. hi = (hi + Math.imul(ah4, bh3)) | 0;
  20130. lo = (lo + Math.imul(al3, bl4)) | 0;
  20131. mid = (mid + Math.imul(al3, bh4)) | 0;
  20132. mid = (mid + Math.imul(ah3, bl4)) | 0;
  20133. hi = (hi + Math.imul(ah3, bh4)) | 0;
  20134. lo = (lo + Math.imul(al2, bl5)) | 0;
  20135. mid = (mid + Math.imul(al2, bh5)) | 0;
  20136. mid = (mid + Math.imul(ah2, bl5)) | 0;
  20137. hi = (hi + Math.imul(ah2, bh5)) | 0;
  20138. lo = (lo + Math.imul(al1, bl6)) | 0;
  20139. mid = (mid + Math.imul(al1, bh6)) | 0;
  20140. mid = (mid + Math.imul(ah1, bl6)) | 0;
  20141. hi = (hi + Math.imul(ah1, bh6)) | 0;
  20142. lo = (lo + Math.imul(al0, bl7)) | 0;
  20143. mid = (mid + Math.imul(al0, bh7)) | 0;
  20144. mid = (mid + Math.imul(ah0, bl7)) | 0;
  20145. hi = (hi + Math.imul(ah0, bh7)) | 0;
  20146. var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20147. c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
  20148. w7 &= 0x3ffffff;
  20149. /* k = 8 */
  20150. lo = Math.imul(al8, bl0);
  20151. mid = Math.imul(al8, bh0);
  20152. mid = (mid + Math.imul(ah8, bl0)) | 0;
  20153. hi = Math.imul(ah8, bh0);
  20154. lo = (lo + Math.imul(al7, bl1)) | 0;
  20155. mid = (mid + Math.imul(al7, bh1)) | 0;
  20156. mid = (mid + Math.imul(ah7, bl1)) | 0;
  20157. hi = (hi + Math.imul(ah7, bh1)) | 0;
  20158. lo = (lo + Math.imul(al6, bl2)) | 0;
  20159. mid = (mid + Math.imul(al6, bh2)) | 0;
  20160. mid = (mid + Math.imul(ah6, bl2)) | 0;
  20161. hi = (hi + Math.imul(ah6, bh2)) | 0;
  20162. lo = (lo + Math.imul(al5, bl3)) | 0;
  20163. mid = (mid + Math.imul(al5, bh3)) | 0;
  20164. mid = (mid + Math.imul(ah5, bl3)) | 0;
  20165. hi = (hi + Math.imul(ah5, bh3)) | 0;
  20166. lo = (lo + Math.imul(al4, bl4)) | 0;
  20167. mid = (mid + Math.imul(al4, bh4)) | 0;
  20168. mid = (mid + Math.imul(ah4, bl4)) | 0;
  20169. hi = (hi + Math.imul(ah4, bh4)) | 0;
  20170. lo = (lo + Math.imul(al3, bl5)) | 0;
  20171. mid = (mid + Math.imul(al3, bh5)) | 0;
  20172. mid = (mid + Math.imul(ah3, bl5)) | 0;
  20173. hi = (hi + Math.imul(ah3, bh5)) | 0;
  20174. lo = (lo + Math.imul(al2, bl6)) | 0;
  20175. mid = (mid + Math.imul(al2, bh6)) | 0;
  20176. mid = (mid + Math.imul(ah2, bl6)) | 0;
  20177. hi = (hi + Math.imul(ah2, bh6)) | 0;
  20178. lo = (lo + Math.imul(al1, bl7)) | 0;
  20179. mid = (mid + Math.imul(al1, bh7)) | 0;
  20180. mid = (mid + Math.imul(ah1, bl7)) | 0;
  20181. hi = (hi + Math.imul(ah1, bh7)) | 0;
  20182. lo = (lo + Math.imul(al0, bl8)) | 0;
  20183. mid = (mid + Math.imul(al0, bh8)) | 0;
  20184. mid = (mid + Math.imul(ah0, bl8)) | 0;
  20185. hi = (hi + Math.imul(ah0, bh8)) | 0;
  20186. var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20187. c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
  20188. w8 &= 0x3ffffff;
  20189. /* k = 9 */
  20190. lo = Math.imul(al9, bl0);
  20191. mid = Math.imul(al9, bh0);
  20192. mid = (mid + Math.imul(ah9, bl0)) | 0;
  20193. hi = Math.imul(ah9, bh0);
  20194. lo = (lo + Math.imul(al8, bl1)) | 0;
  20195. mid = (mid + Math.imul(al8, bh1)) | 0;
  20196. mid = (mid + Math.imul(ah8, bl1)) | 0;
  20197. hi = (hi + Math.imul(ah8, bh1)) | 0;
  20198. lo = (lo + Math.imul(al7, bl2)) | 0;
  20199. mid = (mid + Math.imul(al7, bh2)) | 0;
  20200. mid = (mid + Math.imul(ah7, bl2)) | 0;
  20201. hi = (hi + Math.imul(ah7, bh2)) | 0;
  20202. lo = (lo + Math.imul(al6, bl3)) | 0;
  20203. mid = (mid + Math.imul(al6, bh3)) | 0;
  20204. mid = (mid + Math.imul(ah6, bl3)) | 0;
  20205. hi = (hi + Math.imul(ah6, bh3)) | 0;
  20206. lo = (lo + Math.imul(al5, bl4)) | 0;
  20207. mid = (mid + Math.imul(al5, bh4)) | 0;
  20208. mid = (mid + Math.imul(ah5, bl4)) | 0;
  20209. hi = (hi + Math.imul(ah5, bh4)) | 0;
  20210. lo = (lo + Math.imul(al4, bl5)) | 0;
  20211. mid = (mid + Math.imul(al4, bh5)) | 0;
  20212. mid = (mid + Math.imul(ah4, bl5)) | 0;
  20213. hi = (hi + Math.imul(ah4, bh5)) | 0;
  20214. lo = (lo + Math.imul(al3, bl6)) | 0;
  20215. mid = (mid + Math.imul(al3, bh6)) | 0;
  20216. mid = (mid + Math.imul(ah3, bl6)) | 0;
  20217. hi = (hi + Math.imul(ah3, bh6)) | 0;
  20218. lo = (lo + Math.imul(al2, bl7)) | 0;
  20219. mid = (mid + Math.imul(al2, bh7)) | 0;
  20220. mid = (mid + Math.imul(ah2, bl7)) | 0;
  20221. hi = (hi + Math.imul(ah2, bh7)) | 0;
  20222. lo = (lo + Math.imul(al1, bl8)) | 0;
  20223. mid = (mid + Math.imul(al1, bh8)) | 0;
  20224. mid = (mid + Math.imul(ah1, bl8)) | 0;
  20225. hi = (hi + Math.imul(ah1, bh8)) | 0;
  20226. lo = (lo + Math.imul(al0, bl9)) | 0;
  20227. mid = (mid + Math.imul(al0, bh9)) | 0;
  20228. mid = (mid + Math.imul(ah0, bl9)) | 0;
  20229. hi = (hi + Math.imul(ah0, bh9)) | 0;
  20230. var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20231. c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
  20232. w9 &= 0x3ffffff;
  20233. /* k = 10 */
  20234. lo = Math.imul(al9, bl1);
  20235. mid = Math.imul(al9, bh1);
  20236. mid = (mid + Math.imul(ah9, bl1)) | 0;
  20237. hi = Math.imul(ah9, bh1);
  20238. lo = (lo + Math.imul(al8, bl2)) | 0;
  20239. mid = (mid + Math.imul(al8, bh2)) | 0;
  20240. mid = (mid + Math.imul(ah8, bl2)) | 0;
  20241. hi = (hi + Math.imul(ah8, bh2)) | 0;
  20242. lo = (lo + Math.imul(al7, bl3)) | 0;
  20243. mid = (mid + Math.imul(al7, bh3)) | 0;
  20244. mid = (mid + Math.imul(ah7, bl3)) | 0;
  20245. hi = (hi + Math.imul(ah7, bh3)) | 0;
  20246. lo = (lo + Math.imul(al6, bl4)) | 0;
  20247. mid = (mid + Math.imul(al6, bh4)) | 0;
  20248. mid = (mid + Math.imul(ah6, bl4)) | 0;
  20249. hi = (hi + Math.imul(ah6, bh4)) | 0;
  20250. lo = (lo + Math.imul(al5, bl5)) | 0;
  20251. mid = (mid + Math.imul(al5, bh5)) | 0;
  20252. mid = (mid + Math.imul(ah5, bl5)) | 0;
  20253. hi = (hi + Math.imul(ah5, bh5)) | 0;
  20254. lo = (lo + Math.imul(al4, bl6)) | 0;
  20255. mid = (mid + Math.imul(al4, bh6)) | 0;
  20256. mid = (mid + Math.imul(ah4, bl6)) | 0;
  20257. hi = (hi + Math.imul(ah4, bh6)) | 0;
  20258. lo = (lo + Math.imul(al3, bl7)) | 0;
  20259. mid = (mid + Math.imul(al3, bh7)) | 0;
  20260. mid = (mid + Math.imul(ah3, bl7)) | 0;
  20261. hi = (hi + Math.imul(ah3, bh7)) | 0;
  20262. lo = (lo + Math.imul(al2, bl8)) | 0;
  20263. mid = (mid + Math.imul(al2, bh8)) | 0;
  20264. mid = (mid + Math.imul(ah2, bl8)) | 0;
  20265. hi = (hi + Math.imul(ah2, bh8)) | 0;
  20266. lo = (lo + Math.imul(al1, bl9)) | 0;
  20267. mid = (mid + Math.imul(al1, bh9)) | 0;
  20268. mid = (mid + Math.imul(ah1, bl9)) | 0;
  20269. hi = (hi + Math.imul(ah1, bh9)) | 0;
  20270. var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20271. c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
  20272. w10 &= 0x3ffffff;
  20273. /* k = 11 */
  20274. lo = Math.imul(al9, bl2);
  20275. mid = Math.imul(al9, bh2);
  20276. mid = (mid + Math.imul(ah9, bl2)) | 0;
  20277. hi = Math.imul(ah9, bh2);
  20278. lo = (lo + Math.imul(al8, bl3)) | 0;
  20279. mid = (mid + Math.imul(al8, bh3)) | 0;
  20280. mid = (mid + Math.imul(ah8, bl3)) | 0;
  20281. hi = (hi + Math.imul(ah8, bh3)) | 0;
  20282. lo = (lo + Math.imul(al7, bl4)) | 0;
  20283. mid = (mid + Math.imul(al7, bh4)) | 0;
  20284. mid = (mid + Math.imul(ah7, bl4)) | 0;
  20285. hi = (hi + Math.imul(ah7, bh4)) | 0;
  20286. lo = (lo + Math.imul(al6, bl5)) | 0;
  20287. mid = (mid + Math.imul(al6, bh5)) | 0;
  20288. mid = (mid + Math.imul(ah6, bl5)) | 0;
  20289. hi = (hi + Math.imul(ah6, bh5)) | 0;
  20290. lo = (lo + Math.imul(al5, bl6)) | 0;
  20291. mid = (mid + Math.imul(al5, bh6)) | 0;
  20292. mid = (mid + Math.imul(ah5, bl6)) | 0;
  20293. hi = (hi + Math.imul(ah5, bh6)) | 0;
  20294. lo = (lo + Math.imul(al4, bl7)) | 0;
  20295. mid = (mid + Math.imul(al4, bh7)) | 0;
  20296. mid = (mid + Math.imul(ah4, bl7)) | 0;
  20297. hi = (hi + Math.imul(ah4, bh7)) | 0;
  20298. lo = (lo + Math.imul(al3, bl8)) | 0;
  20299. mid = (mid + Math.imul(al3, bh8)) | 0;
  20300. mid = (mid + Math.imul(ah3, bl8)) | 0;
  20301. hi = (hi + Math.imul(ah3, bh8)) | 0;
  20302. lo = (lo + Math.imul(al2, bl9)) | 0;
  20303. mid = (mid + Math.imul(al2, bh9)) | 0;
  20304. mid = (mid + Math.imul(ah2, bl9)) | 0;
  20305. hi = (hi + Math.imul(ah2, bh9)) | 0;
  20306. var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20307. c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
  20308. w11 &= 0x3ffffff;
  20309. /* k = 12 */
  20310. lo = Math.imul(al9, bl3);
  20311. mid = Math.imul(al9, bh3);
  20312. mid = (mid + Math.imul(ah9, bl3)) | 0;
  20313. hi = Math.imul(ah9, bh3);
  20314. lo = (lo + Math.imul(al8, bl4)) | 0;
  20315. mid = (mid + Math.imul(al8, bh4)) | 0;
  20316. mid = (mid + Math.imul(ah8, bl4)) | 0;
  20317. hi = (hi + Math.imul(ah8, bh4)) | 0;
  20318. lo = (lo + Math.imul(al7, bl5)) | 0;
  20319. mid = (mid + Math.imul(al7, bh5)) | 0;
  20320. mid = (mid + Math.imul(ah7, bl5)) | 0;
  20321. hi = (hi + Math.imul(ah7, bh5)) | 0;
  20322. lo = (lo + Math.imul(al6, bl6)) | 0;
  20323. mid = (mid + Math.imul(al6, bh6)) | 0;
  20324. mid = (mid + Math.imul(ah6, bl6)) | 0;
  20325. hi = (hi + Math.imul(ah6, bh6)) | 0;
  20326. lo = (lo + Math.imul(al5, bl7)) | 0;
  20327. mid = (mid + Math.imul(al5, bh7)) | 0;
  20328. mid = (mid + Math.imul(ah5, bl7)) | 0;
  20329. hi = (hi + Math.imul(ah5, bh7)) | 0;
  20330. lo = (lo + Math.imul(al4, bl8)) | 0;
  20331. mid = (mid + Math.imul(al4, bh8)) | 0;
  20332. mid = (mid + Math.imul(ah4, bl8)) | 0;
  20333. hi = (hi + Math.imul(ah4, bh8)) | 0;
  20334. lo = (lo + Math.imul(al3, bl9)) | 0;
  20335. mid = (mid + Math.imul(al3, bh9)) | 0;
  20336. mid = (mid + Math.imul(ah3, bl9)) | 0;
  20337. hi = (hi + Math.imul(ah3, bh9)) | 0;
  20338. var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20339. c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
  20340. w12 &= 0x3ffffff;
  20341. /* k = 13 */
  20342. lo = Math.imul(al9, bl4);
  20343. mid = Math.imul(al9, bh4);
  20344. mid = (mid + Math.imul(ah9, bl4)) | 0;
  20345. hi = Math.imul(ah9, bh4);
  20346. lo = (lo + Math.imul(al8, bl5)) | 0;
  20347. mid = (mid + Math.imul(al8, bh5)) | 0;
  20348. mid = (mid + Math.imul(ah8, bl5)) | 0;
  20349. hi = (hi + Math.imul(ah8, bh5)) | 0;
  20350. lo = (lo + Math.imul(al7, bl6)) | 0;
  20351. mid = (mid + Math.imul(al7, bh6)) | 0;
  20352. mid = (mid + Math.imul(ah7, bl6)) | 0;
  20353. hi = (hi + Math.imul(ah7, bh6)) | 0;
  20354. lo = (lo + Math.imul(al6, bl7)) | 0;
  20355. mid = (mid + Math.imul(al6, bh7)) | 0;
  20356. mid = (mid + Math.imul(ah6, bl7)) | 0;
  20357. hi = (hi + Math.imul(ah6, bh7)) | 0;
  20358. lo = (lo + Math.imul(al5, bl8)) | 0;
  20359. mid = (mid + Math.imul(al5, bh8)) | 0;
  20360. mid = (mid + Math.imul(ah5, bl8)) | 0;
  20361. hi = (hi + Math.imul(ah5, bh8)) | 0;
  20362. lo = (lo + Math.imul(al4, bl9)) | 0;
  20363. mid = (mid + Math.imul(al4, bh9)) | 0;
  20364. mid = (mid + Math.imul(ah4, bl9)) | 0;
  20365. hi = (hi + Math.imul(ah4, bh9)) | 0;
  20366. var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20367. c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
  20368. w13 &= 0x3ffffff;
  20369. /* k = 14 */
  20370. lo = Math.imul(al9, bl5);
  20371. mid = Math.imul(al9, bh5);
  20372. mid = (mid + Math.imul(ah9, bl5)) | 0;
  20373. hi = Math.imul(ah9, bh5);
  20374. lo = (lo + Math.imul(al8, bl6)) | 0;
  20375. mid = (mid + Math.imul(al8, bh6)) | 0;
  20376. mid = (mid + Math.imul(ah8, bl6)) | 0;
  20377. hi = (hi + Math.imul(ah8, bh6)) | 0;
  20378. lo = (lo + Math.imul(al7, bl7)) | 0;
  20379. mid = (mid + Math.imul(al7, bh7)) | 0;
  20380. mid = (mid + Math.imul(ah7, bl7)) | 0;
  20381. hi = (hi + Math.imul(ah7, bh7)) | 0;
  20382. lo = (lo + Math.imul(al6, bl8)) | 0;
  20383. mid = (mid + Math.imul(al6, bh8)) | 0;
  20384. mid = (mid + Math.imul(ah6, bl8)) | 0;
  20385. hi = (hi + Math.imul(ah6, bh8)) | 0;
  20386. lo = (lo + Math.imul(al5, bl9)) | 0;
  20387. mid = (mid + Math.imul(al5, bh9)) | 0;
  20388. mid = (mid + Math.imul(ah5, bl9)) | 0;
  20389. hi = (hi + Math.imul(ah5, bh9)) | 0;
  20390. var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20391. c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
  20392. w14 &= 0x3ffffff;
  20393. /* k = 15 */
  20394. lo = Math.imul(al9, bl6);
  20395. mid = Math.imul(al9, bh6);
  20396. mid = (mid + Math.imul(ah9, bl6)) | 0;
  20397. hi = Math.imul(ah9, bh6);
  20398. lo = (lo + Math.imul(al8, bl7)) | 0;
  20399. mid = (mid + Math.imul(al8, bh7)) | 0;
  20400. mid = (mid + Math.imul(ah8, bl7)) | 0;
  20401. hi = (hi + Math.imul(ah8, bh7)) | 0;
  20402. lo = (lo + Math.imul(al7, bl8)) | 0;
  20403. mid = (mid + Math.imul(al7, bh8)) | 0;
  20404. mid = (mid + Math.imul(ah7, bl8)) | 0;
  20405. hi = (hi + Math.imul(ah7, bh8)) | 0;
  20406. lo = (lo + Math.imul(al6, bl9)) | 0;
  20407. mid = (mid + Math.imul(al6, bh9)) | 0;
  20408. mid = (mid + Math.imul(ah6, bl9)) | 0;
  20409. hi = (hi + Math.imul(ah6, bh9)) | 0;
  20410. var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20411. c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
  20412. w15 &= 0x3ffffff;
  20413. /* k = 16 */
  20414. lo = Math.imul(al9, bl7);
  20415. mid = Math.imul(al9, bh7);
  20416. mid = (mid + Math.imul(ah9, bl7)) | 0;
  20417. hi = Math.imul(ah9, bh7);
  20418. lo = (lo + Math.imul(al8, bl8)) | 0;
  20419. mid = (mid + Math.imul(al8, bh8)) | 0;
  20420. mid = (mid + Math.imul(ah8, bl8)) | 0;
  20421. hi = (hi + Math.imul(ah8, bh8)) | 0;
  20422. lo = (lo + Math.imul(al7, bl9)) | 0;
  20423. mid = (mid + Math.imul(al7, bh9)) | 0;
  20424. mid = (mid + Math.imul(ah7, bl9)) | 0;
  20425. hi = (hi + Math.imul(ah7, bh9)) | 0;
  20426. var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20427. c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
  20428. w16 &= 0x3ffffff;
  20429. /* k = 17 */
  20430. lo = Math.imul(al9, bl8);
  20431. mid = Math.imul(al9, bh8);
  20432. mid = (mid + Math.imul(ah9, bl8)) | 0;
  20433. hi = Math.imul(ah9, bh8);
  20434. lo = (lo + Math.imul(al8, bl9)) | 0;
  20435. mid = (mid + Math.imul(al8, bh9)) | 0;
  20436. mid = (mid + Math.imul(ah8, bl9)) | 0;
  20437. hi = (hi + Math.imul(ah8, bh9)) | 0;
  20438. var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20439. c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
  20440. w17 &= 0x3ffffff;
  20441. /* k = 18 */
  20442. lo = Math.imul(al9, bl9);
  20443. mid = Math.imul(al9, bh9);
  20444. mid = (mid + Math.imul(ah9, bl9)) | 0;
  20445. hi = Math.imul(ah9, bh9);
  20446. var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20447. c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
  20448. w18 &= 0x3ffffff;
  20449. o[0] = w0;
  20450. o[1] = w1;
  20451. o[2] = w2;
  20452. o[3] = w3;
  20453. o[4] = w4;
  20454. o[5] = w5;
  20455. o[6] = w6;
  20456. o[7] = w7;
  20457. o[8] = w8;
  20458. o[9] = w9;
  20459. o[10] = w10;
  20460. o[11] = w11;
  20461. o[12] = w12;
  20462. o[13] = w13;
  20463. o[14] = w14;
  20464. o[15] = w15;
  20465. o[16] = w16;
  20466. o[17] = w17;
  20467. o[18] = w18;
  20468. if (c !== 0) {
  20469. o[19] = c;
  20470. out.length++;
  20471. }
  20472. return out;
  20473. };
  20474. // Polyfill comb
  20475. if (!Math.imul) {
  20476. comb10MulTo = smallMulTo;
  20477. }
  20478. function bigMulTo (self, num, out) {
  20479. out.negative = num.negative ^ self.negative;
  20480. out.length = self.length + num.length;
  20481. var carry = 0;
  20482. var hncarry = 0;
  20483. for (var k = 0; k < out.length - 1; k++) {
  20484. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  20485. // note that ncarry could be >= 0x3ffffff
  20486. var ncarry = hncarry;
  20487. hncarry = 0;
  20488. var rword = carry & 0x3ffffff;
  20489. var maxJ = Math.min(k, num.length - 1);
  20490. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  20491. var i = k - j;
  20492. var a = self.words[i] | 0;
  20493. var b = num.words[j] | 0;
  20494. var r = a * b;
  20495. var lo = r & 0x3ffffff;
  20496. ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
  20497. lo = (lo + rword) | 0;
  20498. rword = lo & 0x3ffffff;
  20499. ncarry = (ncarry + (lo >>> 26)) | 0;
  20500. hncarry += ncarry >>> 26;
  20501. ncarry &= 0x3ffffff;
  20502. }
  20503. out.words[k] = rword;
  20504. carry = ncarry;
  20505. ncarry = hncarry;
  20506. }
  20507. if (carry !== 0) {
  20508. out.words[k] = carry;
  20509. } else {
  20510. out.length--;
  20511. }
  20512. return out._strip();
  20513. }
  20514. function jumboMulTo (self, num, out) {
  20515. // Temporary disable, see https://github.com/indutny/bn.js/issues/211
  20516. // var fftm = new FFTM();
  20517. // return fftm.mulp(self, num, out);
  20518. return bigMulTo(self, num, out);
  20519. }
  20520. BN.prototype.mulTo = function mulTo (num, out) {
  20521. var res;
  20522. var len = this.length + num.length;
  20523. if (this.length === 10 && num.length === 10) {
  20524. res = comb10MulTo(this, num, out);
  20525. } else if (len < 63) {
  20526. res = smallMulTo(this, num, out);
  20527. } else if (len < 1024) {
  20528. res = bigMulTo(this, num, out);
  20529. } else {
  20530. res = jumboMulTo(this, num, out);
  20531. }
  20532. return res;
  20533. };
  20534. // Cooley-Tukey algorithm for FFT
  20535. // slightly revisited to rely on looping instead of recursion
  20536. function FFTM (x, y) {
  20537. this.x = x;
  20538. this.y = y;
  20539. }
  20540. FFTM.prototype.makeRBT = function makeRBT (N) {
  20541. var t = new Array(N);
  20542. var l = BN.prototype._countBits(N) - 1;
  20543. for (var i = 0; i < N; i++) {
  20544. t[i] = this.revBin(i, l, N);
  20545. }
  20546. return t;
  20547. };
  20548. // Returns binary-reversed representation of `x`
  20549. FFTM.prototype.revBin = function revBin (x, l, N) {
  20550. if (x === 0 || x === N - 1) return x;
  20551. var rb = 0;
  20552. for (var i = 0; i < l; i++) {
  20553. rb |= (x & 1) << (l - i - 1);
  20554. x >>= 1;
  20555. }
  20556. return rb;
  20557. };
  20558. // Performs "tweedling" phase, therefore 'emulating'
  20559. // behaviour of the recursive algorithm
  20560. FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
  20561. for (var i = 0; i < N; i++) {
  20562. rtws[i] = rws[rbt[i]];
  20563. itws[i] = iws[rbt[i]];
  20564. }
  20565. };
  20566. FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
  20567. this.permute(rbt, rws, iws, rtws, itws, N);
  20568. for (var s = 1; s < N; s <<= 1) {
  20569. var l = s << 1;
  20570. var rtwdf = Math.cos(2 * Math.PI / l);
  20571. var itwdf = Math.sin(2 * Math.PI / l);
  20572. for (var p = 0; p < N; p += l) {
  20573. var rtwdf_ = rtwdf;
  20574. var itwdf_ = itwdf;
  20575. for (var j = 0; j < s; j++) {
  20576. var re = rtws[p + j];
  20577. var ie = itws[p + j];
  20578. var ro = rtws[p + j + s];
  20579. var io = itws[p + j + s];
  20580. var rx = rtwdf_ * ro - itwdf_ * io;
  20581. io = rtwdf_ * io + itwdf_ * ro;
  20582. ro = rx;
  20583. rtws[p + j] = re + ro;
  20584. itws[p + j] = ie + io;
  20585. rtws[p + j + s] = re - ro;
  20586. itws[p + j + s] = ie - io;
  20587. /* jshint maxdepth : false */
  20588. if (j !== l) {
  20589. rx = rtwdf * rtwdf_ - itwdf * itwdf_;
  20590. itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
  20591. rtwdf_ = rx;
  20592. }
  20593. }
  20594. }
  20595. }
  20596. };
  20597. FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
  20598. var N = Math.max(m, n) | 1;
  20599. var odd = N & 1;
  20600. var i = 0;
  20601. for (N = N / 2 | 0; N; N = N >>> 1) {
  20602. i++;
  20603. }
  20604. return 1 << i + 1 + odd;
  20605. };
  20606. FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
  20607. if (N <= 1) return;
  20608. for (var i = 0; i < N / 2; i++) {
  20609. var t = rws[i];
  20610. rws[i] = rws[N - i - 1];
  20611. rws[N - i - 1] = t;
  20612. t = iws[i];
  20613. iws[i] = -iws[N - i - 1];
  20614. iws[N - i - 1] = -t;
  20615. }
  20616. };
  20617. FFTM.prototype.normalize13b = function normalize13b (ws, N) {
  20618. var carry = 0;
  20619. for (var i = 0; i < N / 2; i++) {
  20620. var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
  20621. Math.round(ws[2 * i] / N) +
  20622. carry;
  20623. ws[i] = w & 0x3ffffff;
  20624. if (w < 0x4000000) {
  20625. carry = 0;
  20626. } else {
  20627. carry = w / 0x4000000 | 0;
  20628. }
  20629. }
  20630. return ws;
  20631. };
  20632. FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
  20633. var carry = 0;
  20634. for (var i = 0; i < len; i++) {
  20635. carry = carry + (ws[i] | 0);
  20636. rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
  20637. rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
  20638. }
  20639. // Pad with zeroes
  20640. for (i = 2 * len; i < N; ++i) {
  20641. rws[i] = 0;
  20642. }
  20643. assert(carry === 0);
  20644. assert((carry & ~0x1fff) === 0);
  20645. };
  20646. FFTM.prototype.stub = function stub (N) {
  20647. var ph = new Array(N);
  20648. for (var i = 0; i < N; i++) {
  20649. ph[i] = 0;
  20650. }
  20651. return ph;
  20652. };
  20653. FFTM.prototype.mulp = function mulp (x, y, out) {
  20654. var N = 2 * this.guessLen13b(x.length, y.length);
  20655. var rbt = this.makeRBT(N);
  20656. var _ = this.stub(N);
  20657. var rws = new Array(N);
  20658. var rwst = new Array(N);
  20659. var iwst = new Array(N);
  20660. var nrws = new Array(N);
  20661. var nrwst = new Array(N);
  20662. var niwst = new Array(N);
  20663. var rmws = out.words;
  20664. rmws.length = N;
  20665. this.convert13b(x.words, x.length, rws, N);
  20666. this.convert13b(y.words, y.length, nrws, N);
  20667. this.transform(rws, _, rwst, iwst, N, rbt);
  20668. this.transform(nrws, _, nrwst, niwst, N, rbt);
  20669. for (var i = 0; i < N; i++) {
  20670. var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
  20671. iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
  20672. rwst[i] = rx;
  20673. }
  20674. this.conjugate(rwst, iwst, N);
  20675. this.transform(rwst, iwst, rmws, _, N, rbt);
  20676. this.conjugate(rmws, _, N);
  20677. this.normalize13b(rmws, N);
  20678. out.negative = x.negative ^ y.negative;
  20679. out.length = x.length + y.length;
  20680. return out._strip();
  20681. };
  20682. // Multiply `this` by `num`
  20683. BN.prototype.mul = function mul (num) {
  20684. var out = new BN(null);
  20685. out.words = new Array(this.length + num.length);
  20686. return this.mulTo(num, out);
  20687. };
  20688. // Multiply employing FFT
  20689. BN.prototype.mulf = function mulf (num) {
  20690. var out = new BN(null);
  20691. out.words = new Array(this.length + num.length);
  20692. return jumboMulTo(this, num, out);
  20693. };
  20694. // In-place Multiplication
  20695. BN.prototype.imul = function imul (num) {
  20696. return this.clone().mulTo(num, this);
  20697. };
  20698. BN.prototype.imuln = function imuln (num) {
  20699. var isNegNum = num < 0;
  20700. if (isNegNum) num = -num;
  20701. assert(typeof num === 'number');
  20702. assert(num < 0x4000000);
  20703. // Carry
  20704. var carry = 0;
  20705. for (var i = 0; i < this.length; i++) {
  20706. var w = (this.words[i] | 0) * num;
  20707. var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
  20708. carry >>= 26;
  20709. carry += (w / 0x4000000) | 0;
  20710. // NOTE: lo is 27bit maximum
  20711. carry += lo >>> 26;
  20712. this.words[i] = lo & 0x3ffffff;
  20713. }
  20714. if (carry !== 0) {
  20715. this.words[i] = carry;
  20716. this.length++;
  20717. }
  20718. return isNegNum ? this.ineg() : this;
  20719. };
  20720. BN.prototype.muln = function muln (num) {
  20721. return this.clone().imuln(num);
  20722. };
  20723. // `this` * `this`
  20724. BN.prototype.sqr = function sqr () {
  20725. return this.mul(this);
  20726. };
  20727. // `this` * `this` in-place
  20728. BN.prototype.isqr = function isqr () {
  20729. return this.imul(this.clone());
  20730. };
  20731. // Math.pow(`this`, `num`)
  20732. BN.prototype.pow = function pow (num) {
  20733. var w = toBitArray(num);
  20734. if (w.length === 0) return new BN(1);
  20735. // Skip leading zeroes
  20736. var res = this;
  20737. for (var i = 0; i < w.length; i++, res = res.sqr()) {
  20738. if (w[i] !== 0) break;
  20739. }
  20740. if (++i < w.length) {
  20741. for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
  20742. if (w[i] === 0) continue;
  20743. res = res.mul(q);
  20744. }
  20745. }
  20746. return res;
  20747. };
  20748. // Shift-left in-place
  20749. BN.prototype.iushln = function iushln (bits) {
  20750. assert(typeof bits === 'number' && bits >= 0);
  20751. var r = bits % 26;
  20752. var s = (bits - r) / 26;
  20753. var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
  20754. var i;
  20755. if (r !== 0) {
  20756. var carry = 0;
  20757. for (i = 0; i < this.length; i++) {
  20758. var newCarry = this.words[i] & carryMask;
  20759. var c = ((this.words[i] | 0) - newCarry) << r;
  20760. this.words[i] = c | carry;
  20761. carry = newCarry >>> (26 - r);
  20762. }
  20763. if (carry) {
  20764. this.words[i] = carry;
  20765. this.length++;
  20766. }
  20767. }
  20768. if (s !== 0) {
  20769. for (i = this.length - 1; i >= 0; i--) {
  20770. this.words[i + s] = this.words[i];
  20771. }
  20772. for (i = 0; i < s; i++) {
  20773. this.words[i] = 0;
  20774. }
  20775. this.length += s;
  20776. }
  20777. return this._strip();
  20778. };
  20779. BN.prototype.ishln = function ishln (bits) {
  20780. // TODO(indutny): implement me
  20781. assert(this.negative === 0);
  20782. return this.iushln(bits);
  20783. };
  20784. // Shift-right in-place
  20785. // NOTE: `hint` is a lowest bit before trailing zeroes
  20786. // NOTE: if `extended` is present - it will be filled with destroyed bits
  20787. BN.prototype.iushrn = function iushrn (bits, hint, extended) {
  20788. assert(typeof bits === 'number' && bits >= 0);
  20789. var h;
  20790. if (hint) {
  20791. h = (hint - (hint % 26)) / 26;
  20792. } else {
  20793. h = 0;
  20794. }
  20795. var r = bits % 26;
  20796. var s = Math.min((bits - r) / 26, this.length);
  20797. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20798. var maskedWords = extended;
  20799. h -= s;
  20800. h = Math.max(0, h);
  20801. // Extended mode, copy masked part
  20802. if (maskedWords) {
  20803. for (var i = 0; i < s; i++) {
  20804. maskedWords.words[i] = this.words[i];
  20805. }
  20806. maskedWords.length = s;
  20807. }
  20808. if (s === 0) {
  20809. // No-op, we should not move anything at all
  20810. } else if (this.length > s) {
  20811. this.length -= s;
  20812. for (i = 0; i < this.length; i++) {
  20813. this.words[i] = this.words[i + s];
  20814. }
  20815. } else {
  20816. this.words[0] = 0;
  20817. this.length = 1;
  20818. }
  20819. var carry = 0;
  20820. for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
  20821. var word = this.words[i] | 0;
  20822. this.words[i] = (carry << (26 - r)) | (word >>> r);
  20823. carry = word & mask;
  20824. }
  20825. // Push carried bits as a mask
  20826. if (maskedWords && carry !== 0) {
  20827. maskedWords.words[maskedWords.length++] = carry;
  20828. }
  20829. if (this.length === 0) {
  20830. this.words[0] = 0;
  20831. this.length = 1;
  20832. }
  20833. return this._strip();
  20834. };
  20835. BN.prototype.ishrn = function ishrn (bits, hint, extended) {
  20836. // TODO(indutny): implement me
  20837. assert(this.negative === 0);
  20838. return this.iushrn(bits, hint, extended);
  20839. };
  20840. // Shift-left
  20841. BN.prototype.shln = function shln (bits) {
  20842. return this.clone().ishln(bits);
  20843. };
  20844. BN.prototype.ushln = function ushln (bits) {
  20845. return this.clone().iushln(bits);
  20846. };
  20847. // Shift-right
  20848. BN.prototype.shrn = function shrn (bits) {
  20849. return this.clone().ishrn(bits);
  20850. };
  20851. BN.prototype.ushrn = function ushrn (bits) {
  20852. return this.clone().iushrn(bits);
  20853. };
  20854. // Test if n bit is set
  20855. BN.prototype.testn = function testn (bit) {
  20856. assert(typeof bit === 'number' && bit >= 0);
  20857. var r = bit % 26;
  20858. var s = (bit - r) / 26;
  20859. var q = 1 << r;
  20860. // Fast case: bit is much higher than all existing words
  20861. if (this.length <= s) return false;
  20862. // Check bit and return
  20863. var w = this.words[s];
  20864. return !!(w & q);
  20865. };
  20866. // Return only lowers bits of number (in-place)
  20867. BN.prototype.imaskn = function imaskn (bits) {
  20868. assert(typeof bits === 'number' && bits >= 0);
  20869. var r = bits % 26;
  20870. var s = (bits - r) / 26;
  20871. assert(this.negative === 0, 'imaskn works only with positive numbers');
  20872. if (this.length <= s) {
  20873. return this;
  20874. }
  20875. if (r !== 0) {
  20876. s++;
  20877. }
  20878. this.length = Math.min(s, this.length);
  20879. if (r !== 0) {
  20880. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20881. this.words[this.length - 1] &= mask;
  20882. }
  20883. return this._strip();
  20884. };
  20885. // Return only lowers bits of number
  20886. BN.prototype.maskn = function maskn (bits) {
  20887. return this.clone().imaskn(bits);
  20888. };
  20889. // Add plain number `num` to `this`
  20890. BN.prototype.iaddn = function iaddn (num) {
  20891. assert(typeof num === 'number');
  20892. assert(num < 0x4000000);
  20893. if (num < 0) return this.isubn(-num);
  20894. // Possible sign change
  20895. if (this.negative !== 0) {
  20896. if (this.length === 1 && (this.words[0] | 0) <= num) {
  20897. this.words[0] = num - (this.words[0] | 0);
  20898. this.negative = 0;
  20899. return this;
  20900. }
  20901. this.negative = 0;
  20902. this.isubn(num);
  20903. this.negative = 1;
  20904. return this;
  20905. }
  20906. // Add without checks
  20907. return this._iaddn(num);
  20908. };
  20909. BN.prototype._iaddn = function _iaddn (num) {
  20910. this.words[0] += num;
  20911. // Carry
  20912. for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
  20913. this.words[i] -= 0x4000000;
  20914. if (i === this.length - 1) {
  20915. this.words[i + 1] = 1;
  20916. } else {
  20917. this.words[i + 1]++;
  20918. }
  20919. }
  20920. this.length = Math.max(this.length, i + 1);
  20921. return this;
  20922. };
  20923. // Subtract plain number `num` from `this`
  20924. BN.prototype.isubn = function isubn (num) {
  20925. assert(typeof num === 'number');
  20926. assert(num < 0x4000000);
  20927. if (num < 0) return this.iaddn(-num);
  20928. if (this.negative !== 0) {
  20929. this.negative = 0;
  20930. this.iaddn(num);
  20931. this.negative = 1;
  20932. return this;
  20933. }
  20934. this.words[0] -= num;
  20935. if (this.length === 1 && this.words[0] < 0) {
  20936. this.words[0] = -this.words[0];
  20937. this.negative = 1;
  20938. } else {
  20939. // Carry
  20940. for (var i = 0; i < this.length && this.words[i] < 0; i++) {
  20941. this.words[i] += 0x4000000;
  20942. this.words[i + 1] -= 1;
  20943. }
  20944. }
  20945. return this._strip();
  20946. };
  20947. BN.prototype.addn = function addn (num) {
  20948. return this.clone().iaddn(num);
  20949. };
  20950. BN.prototype.subn = function subn (num) {
  20951. return this.clone().isubn(num);
  20952. };
  20953. BN.prototype.iabs = function iabs () {
  20954. this.negative = 0;
  20955. return this;
  20956. };
  20957. BN.prototype.abs = function abs () {
  20958. return this.clone().iabs();
  20959. };
  20960. BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
  20961. var len = num.length + shift;
  20962. var i;
  20963. this._expand(len);
  20964. var w;
  20965. var carry = 0;
  20966. for (i = 0; i < num.length; i++) {
  20967. w = (this.words[i + shift] | 0) + carry;
  20968. var right = (num.words[i] | 0) * mul;
  20969. w -= right & 0x3ffffff;
  20970. carry = (w >> 26) - ((right / 0x4000000) | 0);
  20971. this.words[i + shift] = w & 0x3ffffff;
  20972. }
  20973. for (; i < this.length - shift; i++) {
  20974. w = (this.words[i + shift] | 0) + carry;
  20975. carry = w >> 26;
  20976. this.words[i + shift] = w & 0x3ffffff;
  20977. }
  20978. if (carry === 0) return this._strip();
  20979. // Subtraction overflow
  20980. assert(carry === -1);
  20981. carry = 0;
  20982. for (i = 0; i < this.length; i++) {
  20983. w = -(this.words[i] | 0) + carry;
  20984. carry = w >> 26;
  20985. this.words[i] = w & 0x3ffffff;
  20986. }
  20987. this.negative = 1;
  20988. return this._strip();
  20989. };
  20990. BN.prototype._wordDiv = function _wordDiv (num, mode) {
  20991. var shift = this.length - num.length;
  20992. var a = this.clone();
  20993. var b = num;
  20994. // Normalize
  20995. var bhi = b.words[b.length - 1] | 0;
  20996. var bhiBits = this._countBits(bhi);
  20997. shift = 26 - bhiBits;
  20998. if (shift !== 0) {
  20999. b = b.ushln(shift);
  21000. a.iushln(shift);
  21001. bhi = b.words[b.length - 1] | 0;
  21002. }
  21003. // Initialize quotient
  21004. var m = a.length - b.length;
  21005. var q;
  21006. if (mode !== 'mod') {
  21007. q = new BN(null);
  21008. q.length = m + 1;
  21009. q.words = new Array(q.length);
  21010. for (var i = 0; i < q.length; i++) {
  21011. q.words[i] = 0;
  21012. }
  21013. }
  21014. var diff = a.clone()._ishlnsubmul(b, 1, m);
  21015. if (diff.negative === 0) {
  21016. a = diff;
  21017. if (q) {
  21018. q.words[m] = 1;
  21019. }
  21020. }
  21021. for (var j = m - 1; j >= 0; j--) {
  21022. var qj = (a.words[b.length + j] | 0) * 0x4000000 +
  21023. (a.words[b.length + j - 1] | 0);
  21024. // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
  21025. // (0x7ffffff)
  21026. qj = Math.min((qj / bhi) | 0, 0x3ffffff);
  21027. a._ishlnsubmul(b, qj, j);
  21028. while (a.negative !== 0) {
  21029. qj--;
  21030. a.negative = 0;
  21031. a._ishlnsubmul(b, 1, j);
  21032. if (!a.isZero()) {
  21033. a.negative ^= 1;
  21034. }
  21035. }
  21036. if (q) {
  21037. q.words[j] = qj;
  21038. }
  21039. }
  21040. if (q) {
  21041. q._strip();
  21042. }
  21043. a._strip();
  21044. // Denormalize
  21045. if (mode !== 'div' && shift !== 0) {
  21046. a.iushrn(shift);
  21047. }
  21048. return {
  21049. div: q || null,
  21050. mod: a
  21051. };
  21052. };
  21053. // NOTE: 1) `mode` can be set to `mod` to request mod only,
  21054. // to `div` to request div only, or be absent to
  21055. // request both div & mod
  21056. // 2) `positive` is true if unsigned mod is requested
  21057. BN.prototype.divmod = function divmod (num, mode, positive) {
  21058. assert(!num.isZero());
  21059. if (this.isZero()) {
  21060. return {
  21061. div: new BN(0),
  21062. mod: new BN(0)
  21063. };
  21064. }
  21065. var div, mod, res;
  21066. if (this.negative !== 0 && num.negative === 0) {
  21067. res = this.neg().divmod(num, mode);
  21068. if (mode !== 'mod') {
  21069. div = res.div.neg();
  21070. }
  21071. if (mode !== 'div') {
  21072. mod = res.mod.neg();
  21073. if (positive && mod.negative !== 0) {
  21074. mod.iadd(num);
  21075. }
  21076. }
  21077. return {
  21078. div: div,
  21079. mod: mod
  21080. };
  21081. }
  21082. if (this.negative === 0 && num.negative !== 0) {
  21083. res = this.divmod(num.neg(), mode);
  21084. if (mode !== 'mod') {
  21085. div = res.div.neg();
  21086. }
  21087. return {
  21088. div: div,
  21089. mod: res.mod
  21090. };
  21091. }
  21092. if ((this.negative & num.negative) !== 0) {
  21093. res = this.neg().divmod(num.neg(), mode);
  21094. if (mode !== 'div') {
  21095. mod = res.mod.neg();
  21096. if (positive && mod.negative !== 0) {
  21097. mod.isub(num);
  21098. }
  21099. }
  21100. return {
  21101. div: res.div,
  21102. mod: mod
  21103. };
  21104. }
  21105. // Both numbers are positive at this point
  21106. // Strip both numbers to approximate shift value
  21107. if (num.length > this.length || this.cmp(num) < 0) {
  21108. return {
  21109. div: new BN(0),
  21110. mod: this
  21111. };
  21112. }
  21113. // Very short reduction
  21114. if (num.length === 1) {
  21115. if (mode === 'div') {
  21116. return {
  21117. div: this.divn(num.words[0]),
  21118. mod: null
  21119. };
  21120. }
  21121. if (mode === 'mod') {
  21122. return {
  21123. div: null,
  21124. mod: new BN(this.modrn(num.words[0]))
  21125. };
  21126. }
  21127. return {
  21128. div: this.divn(num.words[0]),
  21129. mod: new BN(this.modrn(num.words[0]))
  21130. };
  21131. }
  21132. return this._wordDiv(num, mode);
  21133. };
  21134. // Find `this` / `num`
  21135. BN.prototype.div = function div (num) {
  21136. return this.divmod(num, 'div', false).div;
  21137. };
  21138. // Find `this` % `num`
  21139. BN.prototype.mod = function mod (num) {
  21140. return this.divmod(num, 'mod', false).mod;
  21141. };
  21142. BN.prototype.umod = function umod (num) {
  21143. return this.divmod(num, 'mod', true).mod;
  21144. };
  21145. // Find Round(`this` / `num`)
  21146. BN.prototype.divRound = function divRound (num) {
  21147. var dm = this.divmod(num);
  21148. // Fast case - exact division
  21149. if (dm.mod.isZero()) return dm.div;
  21150. var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
  21151. var half = num.ushrn(1);
  21152. var r2 = num.andln(1);
  21153. var cmp = mod.cmp(half);
  21154. // Round down
  21155. if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;
  21156. // Round up
  21157. return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  21158. };
  21159. BN.prototype.modrn = function modrn (num) {
  21160. var isNegNum = num < 0;
  21161. if (isNegNum) num = -num;
  21162. assert(num <= 0x3ffffff);
  21163. var p = (1 << 26) % num;
  21164. var acc = 0;
  21165. for (var i = this.length - 1; i >= 0; i--) {
  21166. acc = (p * acc + (this.words[i] | 0)) % num;
  21167. }
  21168. return isNegNum ? -acc : acc;
  21169. };
  21170. // WARNING: DEPRECATED
  21171. BN.prototype.modn = function modn (num) {
  21172. return this.modrn(num);
  21173. };
  21174. // In-place division by number
  21175. BN.prototype.idivn = function idivn (num) {
  21176. var isNegNum = num < 0;
  21177. if (isNegNum) num = -num;
  21178. assert(num <= 0x3ffffff);
  21179. var carry = 0;
  21180. for (var i = this.length - 1; i >= 0; i--) {
  21181. var w = (this.words[i] | 0) + carry * 0x4000000;
  21182. this.words[i] = (w / num) | 0;
  21183. carry = w % num;
  21184. }
  21185. this._strip();
  21186. return isNegNum ? this.ineg() : this;
  21187. };
  21188. BN.prototype.divn = function divn (num) {
  21189. return this.clone().idivn(num);
  21190. };
  21191. BN.prototype.egcd = function egcd (p) {
  21192. assert(p.negative === 0);
  21193. assert(!p.isZero());
  21194. var x = this;
  21195. var y = p.clone();
  21196. if (x.negative !== 0) {
  21197. x = x.umod(p);
  21198. } else {
  21199. x = x.clone();
  21200. }
  21201. // A * x + B * y = x
  21202. var A = new BN(1);
  21203. var B = new BN(0);
  21204. // C * x + D * y = y
  21205. var C = new BN(0);
  21206. var D = new BN(1);
  21207. var g = 0;
  21208. while (x.isEven() && y.isEven()) {
  21209. x.iushrn(1);
  21210. y.iushrn(1);
  21211. ++g;
  21212. }
  21213. var yp = y.clone();
  21214. var xp = x.clone();
  21215. while (!x.isZero()) {
  21216. for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21217. if (i > 0) {
  21218. x.iushrn(i);
  21219. while (i-- > 0) {
  21220. if (A.isOdd() || B.isOdd()) {
  21221. A.iadd(yp);
  21222. B.isub(xp);
  21223. }
  21224. A.iushrn(1);
  21225. B.iushrn(1);
  21226. }
  21227. }
  21228. for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21229. if (j > 0) {
  21230. y.iushrn(j);
  21231. while (j-- > 0) {
  21232. if (C.isOdd() || D.isOdd()) {
  21233. C.iadd(yp);
  21234. D.isub(xp);
  21235. }
  21236. C.iushrn(1);
  21237. D.iushrn(1);
  21238. }
  21239. }
  21240. if (x.cmp(y) >= 0) {
  21241. x.isub(y);
  21242. A.isub(C);
  21243. B.isub(D);
  21244. } else {
  21245. y.isub(x);
  21246. C.isub(A);
  21247. D.isub(B);
  21248. }
  21249. }
  21250. return {
  21251. a: C,
  21252. b: D,
  21253. gcd: y.iushln(g)
  21254. };
  21255. };
  21256. // This is reduced incarnation of the binary EEA
  21257. // above, designated to invert members of the
  21258. // _prime_ fields F(p) at a maximal speed
  21259. BN.prototype._invmp = function _invmp (p) {
  21260. assert(p.negative === 0);
  21261. assert(!p.isZero());
  21262. var a = this;
  21263. var b = p.clone();
  21264. if (a.negative !== 0) {
  21265. a = a.umod(p);
  21266. } else {
  21267. a = a.clone();
  21268. }
  21269. var x1 = new BN(1);
  21270. var x2 = new BN(0);
  21271. var delta = b.clone();
  21272. while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
  21273. for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21274. if (i > 0) {
  21275. a.iushrn(i);
  21276. while (i-- > 0) {
  21277. if (x1.isOdd()) {
  21278. x1.iadd(delta);
  21279. }
  21280. x1.iushrn(1);
  21281. }
  21282. }
  21283. for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21284. if (j > 0) {
  21285. b.iushrn(j);
  21286. while (j-- > 0) {
  21287. if (x2.isOdd()) {
  21288. x2.iadd(delta);
  21289. }
  21290. x2.iushrn(1);
  21291. }
  21292. }
  21293. if (a.cmp(b) >= 0) {
  21294. a.isub(b);
  21295. x1.isub(x2);
  21296. } else {
  21297. b.isub(a);
  21298. x2.isub(x1);
  21299. }
  21300. }
  21301. var res;
  21302. if (a.cmpn(1) === 0) {
  21303. res = x1;
  21304. } else {
  21305. res = x2;
  21306. }
  21307. if (res.cmpn(0) < 0) {
  21308. res.iadd(p);
  21309. }
  21310. return res;
  21311. };
  21312. BN.prototype.gcd = function gcd (num) {
  21313. if (this.isZero()) return num.abs();
  21314. if (num.isZero()) return this.abs();
  21315. var a = this.clone();
  21316. var b = num.clone();
  21317. a.negative = 0;
  21318. b.negative = 0;
  21319. // Remove common factor of two
  21320. for (var shift = 0; a.isEven() && b.isEven(); shift++) {
  21321. a.iushrn(1);
  21322. b.iushrn(1);
  21323. }
  21324. do {
  21325. while (a.isEven()) {
  21326. a.iushrn(1);
  21327. }
  21328. while (b.isEven()) {
  21329. b.iushrn(1);
  21330. }
  21331. var r = a.cmp(b);
  21332. if (r < 0) {
  21333. // Swap `a` and `b` to make `a` always bigger than `b`
  21334. var t = a;
  21335. a = b;
  21336. b = t;
  21337. } else if (r === 0 || b.cmpn(1) === 0) {
  21338. break;
  21339. }
  21340. a.isub(b);
  21341. } while (true);
  21342. return b.iushln(shift);
  21343. };
  21344. // Invert number in the field F(num)
  21345. BN.prototype.invm = function invm (num) {
  21346. return this.egcd(num).a.umod(num);
  21347. };
  21348. BN.prototype.isEven = function isEven () {
  21349. return (this.words[0] & 1) === 0;
  21350. };
  21351. BN.prototype.isOdd = function isOdd () {
  21352. return (this.words[0] & 1) === 1;
  21353. };
  21354. // And first word and num
  21355. BN.prototype.andln = function andln (num) {
  21356. return this.words[0] & num;
  21357. };
  21358. // Increment at the bit position in-line
  21359. BN.prototype.bincn = function bincn (bit) {
  21360. assert(typeof bit === 'number');
  21361. var r = bit % 26;
  21362. var s = (bit - r) / 26;
  21363. var q = 1 << r;
  21364. // Fast case: bit is much higher than all existing words
  21365. if (this.length <= s) {
  21366. this._expand(s + 1);
  21367. this.words[s] |= q;
  21368. return this;
  21369. }
  21370. // Add bit and propagate, if needed
  21371. var carry = q;
  21372. for (var i = s; carry !== 0 && i < this.length; i++) {
  21373. var w = this.words[i] | 0;
  21374. w += carry;
  21375. carry = w >>> 26;
  21376. w &= 0x3ffffff;
  21377. this.words[i] = w;
  21378. }
  21379. if (carry !== 0) {
  21380. this.words[i] = carry;
  21381. this.length++;
  21382. }
  21383. return this;
  21384. };
  21385. BN.prototype.isZero = function isZero () {
  21386. return this.length === 1 && this.words[0] === 0;
  21387. };
  21388. BN.prototype.cmpn = function cmpn (num) {
  21389. var negative = num < 0;
  21390. if (this.negative !== 0 && !negative) return -1;
  21391. if (this.negative === 0 && negative) return 1;
  21392. this._strip();
  21393. var res;
  21394. if (this.length > 1) {
  21395. res = 1;
  21396. } else {
  21397. if (negative) {
  21398. num = -num;
  21399. }
  21400. assert(num <= 0x3ffffff, 'Number is too big');
  21401. var w = this.words[0] | 0;
  21402. res = w === num ? 0 : w < num ? -1 : 1;
  21403. }
  21404. if (this.negative !== 0) return -res | 0;
  21405. return res;
  21406. };
  21407. // Compare two numbers and return:
  21408. // 1 - if `this` > `num`
  21409. // 0 - if `this` == `num`
  21410. // -1 - if `this` < `num`
  21411. BN.prototype.cmp = function cmp (num) {
  21412. if (this.negative !== 0 && num.negative === 0) return -1;
  21413. if (this.negative === 0 && num.negative !== 0) return 1;
  21414. var res = this.ucmp(num);
  21415. if (this.negative !== 0) return -res | 0;
  21416. return res;
  21417. };
  21418. // Unsigned comparison
  21419. BN.prototype.ucmp = function ucmp (num) {
  21420. // At this point both numbers have the same sign
  21421. if (this.length > num.length) return 1;
  21422. if (this.length < num.length) return -1;
  21423. var res = 0;
  21424. for (var i = this.length - 1; i >= 0; i--) {
  21425. var a = this.words[i] | 0;
  21426. var b = num.words[i] | 0;
  21427. if (a === b) continue;
  21428. if (a < b) {
  21429. res = -1;
  21430. } else if (a > b) {
  21431. res = 1;
  21432. }
  21433. break;
  21434. }
  21435. return res;
  21436. };
  21437. BN.prototype.gtn = function gtn (num) {
  21438. return this.cmpn(num) === 1;
  21439. };
  21440. BN.prototype.gt = function gt (num) {
  21441. return this.cmp(num) === 1;
  21442. };
  21443. BN.prototype.gten = function gten (num) {
  21444. return this.cmpn(num) >= 0;
  21445. };
  21446. BN.prototype.gte = function gte (num) {
  21447. return this.cmp(num) >= 0;
  21448. };
  21449. BN.prototype.ltn = function ltn (num) {
  21450. return this.cmpn(num) === -1;
  21451. };
  21452. BN.prototype.lt = function lt (num) {
  21453. return this.cmp(num) === -1;
  21454. };
  21455. BN.prototype.lten = function lten (num) {
  21456. return this.cmpn(num) <= 0;
  21457. };
  21458. BN.prototype.lte = function lte (num) {
  21459. return this.cmp(num) <= 0;
  21460. };
  21461. BN.prototype.eqn = function eqn (num) {
  21462. return this.cmpn(num) === 0;
  21463. };
  21464. BN.prototype.eq = function eq (num) {
  21465. return this.cmp(num) === 0;
  21466. };
  21467. //
  21468. // A reduce context, could be using montgomery or something better, depending
  21469. // on the `m` itself.
  21470. //
  21471. BN.red = function red (num) {
  21472. return new Red(num);
  21473. };
  21474. BN.prototype.toRed = function toRed (ctx) {
  21475. assert(!this.red, 'Already a number in reduction context');
  21476. assert(this.negative === 0, 'red works only with positives');
  21477. return ctx.convertTo(this)._forceRed(ctx);
  21478. };
  21479. BN.prototype.fromRed = function fromRed () {
  21480. assert(this.red, 'fromRed works only with numbers in reduction context');
  21481. return this.red.convertFrom(this);
  21482. };
  21483. BN.prototype._forceRed = function _forceRed (ctx) {
  21484. this.red = ctx;
  21485. return this;
  21486. };
  21487. BN.prototype.forceRed = function forceRed (ctx) {
  21488. assert(!this.red, 'Already a number in reduction context');
  21489. return this._forceRed(ctx);
  21490. };
  21491. BN.prototype.redAdd = function redAdd (num) {
  21492. assert(this.red, 'redAdd works only with red numbers');
  21493. return this.red.add(this, num);
  21494. };
  21495. BN.prototype.redIAdd = function redIAdd (num) {
  21496. assert(this.red, 'redIAdd works only with red numbers');
  21497. return this.red.iadd(this, num);
  21498. };
  21499. BN.prototype.redSub = function redSub (num) {
  21500. assert(this.red, 'redSub works only with red numbers');
  21501. return this.red.sub(this, num);
  21502. };
  21503. BN.prototype.redISub = function redISub (num) {
  21504. assert(this.red, 'redISub works only with red numbers');
  21505. return this.red.isub(this, num);
  21506. };
  21507. BN.prototype.redShl = function redShl (num) {
  21508. assert(this.red, 'redShl works only with red numbers');
  21509. return this.red.shl(this, num);
  21510. };
  21511. BN.prototype.redMul = function redMul (num) {
  21512. assert(this.red, 'redMul works only with red numbers');
  21513. this.red._verify2(this, num);
  21514. return this.red.mul(this, num);
  21515. };
  21516. BN.prototype.redIMul = function redIMul (num) {
  21517. assert(this.red, 'redMul works only with red numbers');
  21518. this.red._verify2(this, num);
  21519. return this.red.imul(this, num);
  21520. };
  21521. BN.prototype.redSqr = function redSqr () {
  21522. assert(this.red, 'redSqr works only with red numbers');
  21523. this.red._verify1(this);
  21524. return this.red.sqr(this);
  21525. };
  21526. BN.prototype.redISqr = function redISqr () {
  21527. assert(this.red, 'redISqr works only with red numbers');
  21528. this.red._verify1(this);
  21529. return this.red.isqr(this);
  21530. };
  21531. // Square root over p
  21532. BN.prototype.redSqrt = function redSqrt () {
  21533. assert(this.red, 'redSqrt works only with red numbers');
  21534. this.red._verify1(this);
  21535. return this.red.sqrt(this);
  21536. };
  21537. BN.prototype.redInvm = function redInvm () {
  21538. assert(this.red, 'redInvm works only with red numbers');
  21539. this.red._verify1(this);
  21540. return this.red.invm(this);
  21541. };
  21542. // Return negative clone of `this` % `red modulo`
  21543. BN.prototype.redNeg = function redNeg () {
  21544. assert(this.red, 'redNeg works only with red numbers');
  21545. this.red._verify1(this);
  21546. return this.red.neg(this);
  21547. };
  21548. BN.prototype.redPow = function redPow (num) {
  21549. assert(this.red && !num.red, 'redPow(normalNum)');
  21550. this.red._verify1(this);
  21551. return this.red.pow(this, num);
  21552. };
  21553. // Prime numbers with efficient reduction
  21554. var primes = {
  21555. k256: null,
  21556. p224: null,
  21557. p192: null,
  21558. p25519: null
  21559. };
  21560. // Pseudo-Mersenne prime
  21561. function MPrime (name, p) {
  21562. // P = 2 ^ N - K
  21563. this.name = name;
  21564. this.p = new BN(p, 16);
  21565. this.n = this.p.bitLength();
  21566. this.k = new BN(1).iushln(this.n).isub(this.p);
  21567. this.tmp = this._tmp();
  21568. }
  21569. MPrime.prototype._tmp = function _tmp () {
  21570. var tmp = new BN(null);
  21571. tmp.words = new Array(Math.ceil(this.n / 13));
  21572. return tmp;
  21573. };
  21574. MPrime.prototype.ireduce = function ireduce (num) {
  21575. // Assumes that `num` is less than `P^2`
  21576. // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
  21577. var r = num;
  21578. var rlen;
  21579. do {
  21580. this.split(r, this.tmp);
  21581. r = this.imulK(r);
  21582. r = r.iadd(this.tmp);
  21583. rlen = r.bitLength();
  21584. } while (rlen > this.n);
  21585. var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
  21586. if (cmp === 0) {
  21587. r.words[0] = 0;
  21588. r.length = 1;
  21589. } else if (cmp > 0) {
  21590. r.isub(this.p);
  21591. } else {
  21592. if (r.strip !== undefined) {
  21593. // r is a BN v4 instance
  21594. r.strip();
  21595. } else {
  21596. // r is a BN v5 instance
  21597. r._strip();
  21598. }
  21599. }
  21600. return r;
  21601. };
  21602. MPrime.prototype.split = function split (input, out) {
  21603. input.iushrn(this.n, 0, out);
  21604. };
  21605. MPrime.prototype.imulK = function imulK (num) {
  21606. return num.imul(this.k);
  21607. };
  21608. function K256 () {
  21609. MPrime.call(
  21610. this,
  21611. 'k256',
  21612. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  21613. }
  21614. inherits(K256, MPrime);
  21615. K256.prototype.split = function split (input, output) {
  21616. // 256 = 9 * 26 + 22
  21617. var mask = 0x3fffff;
  21618. var outLen = Math.min(input.length, 9);
  21619. for (var i = 0; i < outLen; i++) {
  21620. output.words[i] = input.words[i];
  21621. }
  21622. output.length = outLen;
  21623. if (input.length <= 9) {
  21624. input.words[0] = 0;
  21625. input.length = 1;
  21626. return;
  21627. }
  21628. // Shift by 9 limbs
  21629. var prev = input.words[9];
  21630. output.words[output.length++] = prev & mask;
  21631. for (i = 10; i < input.length; i++) {
  21632. var next = input.words[i] | 0;
  21633. input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
  21634. prev = next;
  21635. }
  21636. prev >>>= 22;
  21637. input.words[i - 10] = prev;
  21638. if (prev === 0 && input.length > 10) {
  21639. input.length -= 10;
  21640. } else {
  21641. input.length -= 9;
  21642. }
  21643. };
  21644. K256.prototype.imulK = function imulK (num) {
  21645. // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
  21646. num.words[num.length] = 0;
  21647. num.words[num.length + 1] = 0;
  21648. num.length += 2;
  21649. // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
  21650. var lo = 0;
  21651. for (var i = 0; i < num.length; i++) {
  21652. var w = num.words[i] | 0;
  21653. lo += w * 0x3d1;
  21654. num.words[i] = lo & 0x3ffffff;
  21655. lo = w * 0x40 + ((lo / 0x4000000) | 0);
  21656. }
  21657. // Fast length reduction
  21658. if (num.words[num.length - 1] === 0) {
  21659. num.length--;
  21660. if (num.words[num.length - 1] === 0) {
  21661. num.length--;
  21662. }
  21663. }
  21664. return num;
  21665. };
  21666. function P224 () {
  21667. MPrime.call(
  21668. this,
  21669. 'p224',
  21670. 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  21671. }
  21672. inherits(P224, MPrime);
  21673. function P192 () {
  21674. MPrime.call(
  21675. this,
  21676. 'p192',
  21677. 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  21678. }
  21679. inherits(P192, MPrime);
  21680. function P25519 () {
  21681. // 2 ^ 255 - 19
  21682. MPrime.call(
  21683. this,
  21684. '25519',
  21685. '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  21686. }
  21687. inherits(P25519, MPrime);
  21688. P25519.prototype.imulK = function imulK (num) {
  21689. // K = 0x13
  21690. var carry = 0;
  21691. for (var i = 0; i < num.length; i++) {
  21692. var hi = (num.words[i] | 0) * 0x13 + carry;
  21693. var lo = hi & 0x3ffffff;
  21694. hi >>>= 26;
  21695. num.words[i] = lo;
  21696. carry = hi;
  21697. }
  21698. if (carry !== 0) {
  21699. num.words[num.length++] = carry;
  21700. }
  21701. return num;
  21702. };
  21703. // Exported mostly for testing purposes, use plain name instead
  21704. BN._prime = function prime (name) {
  21705. // Cached version of prime
  21706. if (primes[name]) return primes[name];
  21707. var prime;
  21708. if (name === 'k256') {
  21709. prime = new K256();
  21710. } else if (name === 'p224') {
  21711. prime = new P224();
  21712. } else if (name === 'p192') {
  21713. prime = new P192();
  21714. } else if (name === 'p25519') {
  21715. prime = new P25519();
  21716. } else {
  21717. throw new Error('Unknown prime ' + name);
  21718. }
  21719. primes[name] = prime;
  21720. return prime;
  21721. };
  21722. //
  21723. // Base reduction engine
  21724. //
  21725. function Red (m) {
  21726. if (typeof m === 'string') {
  21727. var prime = BN._prime(m);
  21728. this.m = prime.p;
  21729. this.prime = prime;
  21730. } else {
  21731. assert(m.gtn(1), 'modulus must be greater than 1');
  21732. this.m = m;
  21733. this.prime = null;
  21734. }
  21735. }
  21736. Red.prototype._verify1 = function _verify1 (a) {
  21737. assert(a.negative === 0, 'red works only with positives');
  21738. assert(a.red, 'red works only with red numbers');
  21739. };
  21740. Red.prototype._verify2 = function _verify2 (a, b) {
  21741. assert((a.negative | b.negative) === 0, 'red works only with positives');
  21742. assert(a.red && a.red === b.red,
  21743. 'red works only with red numbers');
  21744. };
  21745. Red.prototype.imod = function imod (a) {
  21746. if (this.prime) return this.prime.ireduce(a)._forceRed(this);
  21747. move(a, a.umod(this.m)._forceRed(this));
  21748. return a;
  21749. };
  21750. Red.prototype.neg = function neg (a) {
  21751. if (a.isZero()) {
  21752. return a.clone();
  21753. }
  21754. return this.m.sub(a)._forceRed(this);
  21755. };
  21756. Red.prototype.add = function add (a, b) {
  21757. this._verify2(a, b);
  21758. var res = a.add(b);
  21759. if (res.cmp(this.m) >= 0) {
  21760. res.isub(this.m);
  21761. }
  21762. return res._forceRed(this);
  21763. };
  21764. Red.prototype.iadd = function iadd (a, b) {
  21765. this._verify2(a, b);
  21766. var res = a.iadd(b);
  21767. if (res.cmp(this.m) >= 0) {
  21768. res.isub(this.m);
  21769. }
  21770. return res;
  21771. };
  21772. Red.prototype.sub = function sub (a, b) {
  21773. this._verify2(a, b);
  21774. var res = a.sub(b);
  21775. if (res.cmpn(0) < 0) {
  21776. res.iadd(this.m);
  21777. }
  21778. return res._forceRed(this);
  21779. };
  21780. Red.prototype.isub = function isub (a, b) {
  21781. this._verify2(a, b);
  21782. var res = a.isub(b);
  21783. if (res.cmpn(0) < 0) {
  21784. res.iadd(this.m);
  21785. }
  21786. return res;
  21787. };
  21788. Red.prototype.shl = function shl (a, num) {
  21789. this._verify1(a);
  21790. return this.imod(a.ushln(num));
  21791. };
  21792. Red.prototype.imul = function imul (a, b) {
  21793. this._verify2(a, b);
  21794. return this.imod(a.imul(b));
  21795. };
  21796. Red.prototype.mul = function mul (a, b) {
  21797. this._verify2(a, b);
  21798. return this.imod(a.mul(b));
  21799. };
  21800. Red.prototype.isqr = function isqr (a) {
  21801. return this.imul(a, a.clone());
  21802. };
  21803. Red.prototype.sqr = function sqr (a) {
  21804. return this.mul(a, a);
  21805. };
  21806. Red.prototype.sqrt = function sqrt (a) {
  21807. if (a.isZero()) return a.clone();
  21808. var mod3 = this.m.andln(3);
  21809. assert(mod3 % 2 === 1);
  21810. // Fast case
  21811. if (mod3 === 3) {
  21812. var pow = this.m.add(new BN(1)).iushrn(2);
  21813. return this.pow(a, pow);
  21814. }
  21815. // Tonelli-Shanks algorithm (Totally unoptimized and slow)
  21816. //
  21817. // Find Q and S, that Q * 2 ^ S = (P - 1)
  21818. var q = this.m.subn(1);
  21819. var s = 0;
  21820. while (!q.isZero() && q.andln(1) === 0) {
  21821. s++;
  21822. q.iushrn(1);
  21823. }
  21824. assert(!q.isZero());
  21825. var one = new BN(1).toRed(this);
  21826. var nOne = one.redNeg();
  21827. // Find quadratic non-residue
  21828. // NOTE: Max is such because of generalized Riemann hypothesis.
  21829. var lpow = this.m.subn(1).iushrn(1);
  21830. var z = this.m.bitLength();
  21831. z = new BN(2 * z * z).toRed(this);
  21832. while (this.pow(z, lpow).cmp(nOne) !== 0) {
  21833. z.redIAdd(nOne);
  21834. }
  21835. var c = this.pow(z, q);
  21836. var r = this.pow(a, q.addn(1).iushrn(1));
  21837. var t = this.pow(a, q);
  21838. var m = s;
  21839. while (t.cmp(one) !== 0) {
  21840. var tmp = t;
  21841. for (var i = 0; tmp.cmp(one) !== 0; i++) {
  21842. tmp = tmp.redSqr();
  21843. }
  21844. assert(i < m);
  21845. var b = this.pow(c, new BN(1).iushln(m - i - 1));
  21846. r = r.redMul(b);
  21847. c = b.redSqr();
  21848. t = t.redMul(c);
  21849. m = i;
  21850. }
  21851. return r;
  21852. };
  21853. Red.prototype.invm = function invm (a) {
  21854. var inv = a._invmp(this.m);
  21855. if (inv.negative !== 0) {
  21856. inv.negative = 0;
  21857. return this.imod(inv).redNeg();
  21858. } else {
  21859. return this.imod(inv);
  21860. }
  21861. };
  21862. Red.prototype.pow = function pow (a, num) {
  21863. if (num.isZero()) return new BN(1).toRed(this);
  21864. if (num.cmpn(1) === 0) return a.clone();
  21865. var windowSize = 4;
  21866. var wnd = new Array(1 << windowSize);
  21867. wnd[0] = new BN(1).toRed(this);
  21868. wnd[1] = a;
  21869. for (var i = 2; i < wnd.length; i++) {
  21870. wnd[i] = this.mul(wnd[i - 1], a);
  21871. }
  21872. var res = wnd[0];
  21873. var current = 0;
  21874. var currentLen = 0;
  21875. var start = num.bitLength() % 26;
  21876. if (start === 0) {
  21877. start = 26;
  21878. }
  21879. for (i = num.length - 1; i >= 0; i--) {
  21880. var word = num.words[i];
  21881. for (var j = start - 1; j >= 0; j--) {
  21882. var bit = (word >> j) & 1;
  21883. if (res !== wnd[0]) {
  21884. res = this.sqr(res);
  21885. }
  21886. if (bit === 0 && current === 0) {
  21887. currentLen = 0;
  21888. continue;
  21889. }
  21890. current <<= 1;
  21891. current |= bit;
  21892. currentLen++;
  21893. if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
  21894. res = this.mul(res, wnd[current]);
  21895. currentLen = 0;
  21896. current = 0;
  21897. }
  21898. start = 26;
  21899. }
  21900. return res;
  21901. };
  21902. Red.prototype.convertTo = function convertTo (num) {
  21903. var r = num.umod(this.m);
  21904. return r === num ? r.clone() : r;
  21905. };
  21906. Red.prototype.convertFrom = function convertFrom (num) {
  21907. var res = num.clone();
  21908. res.red = null;
  21909. return res;
  21910. };
  21911. //
  21912. // Montgomery method engine
  21913. //
  21914. BN.mont = function mont (num) {
  21915. return new Mont(num);
  21916. };
  21917. function Mont (m) {
  21918. Red.call(this, m);
  21919. this.shift = this.m.bitLength();
  21920. if (this.shift % 26 !== 0) {
  21921. this.shift += 26 - (this.shift % 26);
  21922. }
  21923. this.r = new BN(1).iushln(this.shift);
  21924. this.r2 = this.imod(this.r.sqr());
  21925. this.rinv = this.r._invmp(this.m);
  21926. this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
  21927. this.minv = this.minv.umod(this.r);
  21928. this.minv = this.r.sub(this.minv);
  21929. }
  21930. inherits(Mont, Red);
  21931. Mont.prototype.convertTo = function convertTo (num) {
  21932. return this.imod(num.ushln(this.shift));
  21933. };
  21934. Mont.prototype.convertFrom = function convertFrom (num) {
  21935. var r = this.imod(num.mul(this.rinv));
  21936. r.red = null;
  21937. return r;
  21938. };
  21939. Mont.prototype.imul = function imul (a, b) {
  21940. if (a.isZero() || b.isZero()) {
  21941. a.words[0] = 0;
  21942. a.length = 1;
  21943. return a;
  21944. }
  21945. var t = a.imul(b);
  21946. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21947. var u = t.isub(c).iushrn(this.shift);
  21948. var res = u;
  21949. if (u.cmp(this.m) >= 0) {
  21950. res = u.isub(this.m);
  21951. } else if (u.cmpn(0) < 0) {
  21952. res = u.iadd(this.m);
  21953. }
  21954. return res._forceRed(this);
  21955. };
  21956. Mont.prototype.mul = function mul (a, b) {
  21957. if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
  21958. var t = a.mul(b);
  21959. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21960. var u = t.isub(c).iushrn(this.shift);
  21961. var res = u;
  21962. if (u.cmp(this.m) >= 0) {
  21963. res = u.isub(this.m);
  21964. } else if (u.cmpn(0) < 0) {
  21965. res = u.iadd(this.m);
  21966. }
  21967. return res._forceRed(this);
  21968. };
  21969. Mont.prototype.invm = function invm (a) {
  21970. // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
  21971. var res = this.imod(a._invmp(this.m).mul(this.r2));
  21972. return res._forceRed(this);
  21973. };
  21974. })( false || module, this);
  21975. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 165)(module)))
  21976. /***/ }),
  21977. /* 165 */
  21978. /*!***********************************!*\
  21979. !*** (webpack)/buildin/module.js ***!
  21980. \***********************************/
  21981. /*! no static exports found */
  21982. /***/ (function(module, exports) {
  21983. module.exports = function(module) {
  21984. if (!module.webpackPolyfill) {
  21985. module.deprecate = function() {};
  21986. module.paths = [];
  21987. // module.parent = undefined by default
  21988. if (!module.children) module.children = [];
  21989. Object.defineProperty(module, "loaded", {
  21990. enumerable: true,
  21991. get: function() {
  21992. return module.l;
  21993. }
  21994. });
  21995. Object.defineProperty(module, "id", {
  21996. enumerable: true,
  21997. get: function() {
  21998. return module.i;
  21999. }
  22000. });
  22001. module.webpackPolyfill = 1;
  22002. }
  22003. return module;
  22004. };
  22005. /***/ }),
  22006. /* 166 */
  22007. /*!************************!*\
  22008. !*** buffer (ignored) ***!
  22009. \************************/
  22010. /*! no static exports found */
  22011. /***/ (function(module, exports) {
  22012. /* (ignored) */
  22013. /***/ }),
  22014. /* 167 */
  22015. /*!*********************************************!*\
  22016. !*** ./node_modules/miller-rabin/lib/mr.js ***!
  22017. \*********************************************/
  22018. /*! no static exports found */
  22019. /***/ (function(module, exports, __webpack_require__) {
  22020. var bn = __webpack_require__(/*! bn.js */ 164);
  22021. var brorand = __webpack_require__(/*! brorand */ 168);
  22022. function MillerRabin(rand) {
  22023. this.rand = rand || new brorand.Rand();
  22024. }
  22025. module.exports = MillerRabin;
  22026. MillerRabin.create = function create(rand) {
  22027. return new MillerRabin(rand);
  22028. };
  22029. MillerRabin.prototype._randbelow = function _randbelow(n) {
  22030. var len = n.bitLength();
  22031. var min_bytes = Math.ceil(len / 8);
  22032. // Generage random bytes until a number less than n is found.
  22033. // This ensures that 0..n-1 have an equal probability of being selected.
  22034. do
  22035. var a = new bn(this.rand.generate(min_bytes));
  22036. while (a.cmp(n) >= 0);
  22037. return a;
  22038. };
  22039. MillerRabin.prototype._randrange = function _randrange(start, stop) {
  22040. // Generate a random number greater than or equal to start and less than stop.
  22041. var size = stop.sub(start);
  22042. return start.add(this._randbelow(size));
  22043. };
  22044. MillerRabin.prototype.test = function test(n, k, cb) {
  22045. var len = n.bitLength();
  22046. var red = bn.mont(n);
  22047. var rone = new bn(1).toRed(red);
  22048. if (!k)
  22049. k = Math.max(1, (len / 48) | 0);
  22050. // Find d and s, (n - 1) = (2 ^ s) * d;
  22051. var n1 = n.subn(1);
  22052. for (var s = 0; !n1.testn(s); s++) {}
  22053. var d = n.shrn(s);
  22054. var rn1 = n1.toRed(red);
  22055. var prime = true;
  22056. for (; k > 0; k--) {
  22057. var a = this._randrange(new bn(2), n1);
  22058. if (cb)
  22059. cb(a);
  22060. var x = a.toRed(red).redPow(d);
  22061. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  22062. continue;
  22063. for (var i = 1; i < s; i++) {
  22064. x = x.redSqr();
  22065. if (x.cmp(rone) === 0)
  22066. return false;
  22067. if (x.cmp(rn1) === 0)
  22068. break;
  22069. }
  22070. if (i === s)
  22071. return false;
  22072. }
  22073. return prime;
  22074. };
  22075. MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
  22076. var len = n.bitLength();
  22077. var red = bn.mont(n);
  22078. var rone = new bn(1).toRed(red);
  22079. if (!k)
  22080. k = Math.max(1, (len / 48) | 0);
  22081. // Find d and s, (n - 1) = (2 ^ s) * d;
  22082. var n1 = n.subn(1);
  22083. for (var s = 0; !n1.testn(s); s++) {}
  22084. var d = n.shrn(s);
  22085. var rn1 = n1.toRed(red);
  22086. for (; k > 0; k--) {
  22087. var a = this._randrange(new bn(2), n1);
  22088. var g = n.gcd(a);
  22089. if (g.cmpn(1) !== 0)
  22090. return g;
  22091. var x = a.toRed(red).redPow(d);
  22092. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  22093. continue;
  22094. for (var i = 1; i < s; i++) {
  22095. x = x.redSqr();
  22096. if (x.cmp(rone) === 0)
  22097. return x.fromRed().subn(1).gcd(n);
  22098. if (x.cmp(rn1) === 0)
  22099. break;
  22100. }
  22101. if (i === s) {
  22102. x = x.redSqr();
  22103. return x.fromRed().subn(1).gcd(n);
  22104. }
  22105. }
  22106. return false;
  22107. };
  22108. /***/ }),
  22109. /* 168 */
  22110. /*!***************************************!*\
  22111. !*** ./node_modules/brorand/index.js ***!
  22112. \***************************************/
  22113. /*! no static exports found */
  22114. /***/ (function(module, exports, __webpack_require__) {
  22115. var r;
  22116. module.exports = function rand(len) {
  22117. if (!r)
  22118. r = new Rand(null);
  22119. return r.generate(len);
  22120. };
  22121. function Rand(rand) {
  22122. this.rand = rand;
  22123. }
  22124. module.exports.Rand = Rand;
  22125. Rand.prototype.generate = function generate(len) {
  22126. return this._rand(len);
  22127. };
  22128. // Emulate crypto API using randy
  22129. Rand.prototype._rand = function _rand(n) {
  22130. if (this.rand.getBytes)
  22131. return this.rand.getBytes(n);
  22132. var res = new Uint8Array(n);
  22133. for (var i = 0; i < res.length; i++)
  22134. res[i] = this.rand.getByte();
  22135. return res;
  22136. };
  22137. if (typeof self === 'object') {
  22138. if (self.crypto && self.crypto.getRandomValues) {
  22139. // Modern browsers
  22140. Rand.prototype._rand = function _rand(n) {
  22141. var arr = new Uint8Array(n);
  22142. self.crypto.getRandomValues(arr);
  22143. return arr;
  22144. };
  22145. } else if (self.msCrypto && self.msCrypto.getRandomValues) {
  22146. // IE
  22147. Rand.prototype._rand = function _rand(n) {
  22148. var arr = new Uint8Array(n);
  22149. self.msCrypto.getRandomValues(arr);
  22150. return arr;
  22151. };
  22152. // Safari's WebWorkers do not have `crypto`
  22153. } else if (typeof window === 'object') {
  22154. // Old junk
  22155. Rand.prototype._rand = function() {
  22156. throw new Error('Not implemented yet');
  22157. };
  22158. }
  22159. } else {
  22160. // Node.js or Web worker with no crypto support
  22161. try {
  22162. var crypto = __webpack_require__(/*! crypto */ 169);
  22163. if (typeof crypto.randomBytes !== 'function')
  22164. throw new Error('Not supported');
  22165. Rand.prototype._rand = function _rand(n) {
  22166. return crypto.randomBytes(n);
  22167. };
  22168. } catch (e) {
  22169. }
  22170. }
  22171. /***/ }),
  22172. /* 169 */
  22173. /*!************************!*\
  22174. !*** crypto (ignored) ***!
  22175. \************************/
  22176. /*! no static exports found */
  22177. /***/ (function(module, exports) {
  22178. /* (ignored) */
  22179. /***/ }),
  22180. /* 170 */
  22181. /*!*****************************************************!*\
  22182. !*** ./node_modules/diffie-hellman/lib/primes.json ***!
  22183. \*****************************************************/
  22184. /*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
  22185. /***/ (function(module) {
  22186. module.exports = JSON.parse("{\"modp1\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"},\"modp2\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"},\"modp5\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"},\"modp14\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"},\"modp15\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"},\"modp16\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"},\"modp17\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"},\"modp18\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"}}");
  22187. /***/ }),
  22188. /* 171 */
  22189. /*!***********************************************!*\
  22190. !*** ./node_modules/diffie-hellman/lib/dh.js ***!
  22191. \***********************************************/
  22192. /*! no static exports found */
  22193. /***/ (function(module, exports, __webpack_require__) {
  22194. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 164);
  22195. var MillerRabin = __webpack_require__(/*! miller-rabin */ 167);
  22196. var millerRabin = new MillerRabin();
  22197. var TWENTYFOUR = new BN(24);
  22198. var ELEVEN = new BN(11);
  22199. var TEN = new BN(10);
  22200. var THREE = new BN(3);
  22201. var SEVEN = new BN(7);
  22202. var primes = __webpack_require__(/*! ./generatePrime */ 163);
  22203. var randomBytes = __webpack_require__(/*! randombytes */ 79);
  22204. module.exports = DH;
  22205. function setPublicKey(pub, enc) {
  22206. enc = enc || 'utf8';
  22207. if (!Buffer.isBuffer(pub)) {
  22208. pub = new Buffer(pub, enc);
  22209. }
  22210. this._pub = new BN(pub);
  22211. return this;
  22212. }
  22213. function setPrivateKey(priv, enc) {
  22214. enc = enc || 'utf8';
  22215. if (!Buffer.isBuffer(priv)) {
  22216. priv = new Buffer(priv, enc);
  22217. }
  22218. this._priv = new BN(priv);
  22219. return this;
  22220. }
  22221. var primeCache = {};
  22222. function checkPrime(prime, generator) {
  22223. var gen = generator.toString('hex');
  22224. var hex = [gen, prime.toString(16)].join('_');
  22225. if (hex in primeCache) {
  22226. return primeCache[hex];
  22227. }
  22228. var error = 0;
  22229. if (prime.isEven() ||
  22230. !primes.simpleSieve ||
  22231. !primes.fermatTest(prime) ||
  22232. !millerRabin.test(prime)) {
  22233. //not a prime so +1
  22234. error += 1;
  22235. if (gen === '02' || gen === '05') {
  22236. // we'd be able to check the generator
  22237. // it would fail so +8
  22238. error += 8;
  22239. } else {
  22240. //we wouldn't be able to test the generator
  22241. // so +4
  22242. error += 4;
  22243. }
  22244. primeCache[hex] = error;
  22245. return error;
  22246. }
  22247. if (!millerRabin.test(prime.shrn(1))) {
  22248. //not a safe prime
  22249. error += 2;
  22250. }
  22251. var rem;
  22252. switch (gen) {
  22253. case '02':
  22254. if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
  22255. // unsuidable generator
  22256. error += 8;
  22257. }
  22258. break;
  22259. case '05':
  22260. rem = prime.mod(TEN);
  22261. if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
  22262. // prime mod 10 needs to equal 3 or 7
  22263. error += 8;
  22264. }
  22265. break;
  22266. default:
  22267. error += 4;
  22268. }
  22269. primeCache[hex] = error;
  22270. return error;
  22271. }
  22272. function DH(prime, generator, malleable) {
  22273. this.setGenerator(generator);
  22274. this.__prime = new BN(prime);
  22275. this._prime = BN.mont(this.__prime);
  22276. this._primeLen = prime.length;
  22277. this._pub = undefined;
  22278. this._priv = undefined;
  22279. this._primeCode = undefined;
  22280. if (malleable) {
  22281. this.setPublicKey = setPublicKey;
  22282. this.setPrivateKey = setPrivateKey;
  22283. } else {
  22284. this._primeCode = 8;
  22285. }
  22286. }
  22287. Object.defineProperty(DH.prototype, 'verifyError', {
  22288. enumerable: true,
  22289. get: function () {
  22290. if (typeof this._primeCode !== 'number') {
  22291. this._primeCode = checkPrime(this.__prime, this.__gen);
  22292. }
  22293. return this._primeCode;
  22294. }
  22295. });
  22296. DH.prototype.generateKeys = function () {
  22297. if (!this._priv) {
  22298. this._priv = new BN(randomBytes(this._primeLen));
  22299. }
  22300. this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
  22301. return this.getPublicKey();
  22302. };
  22303. DH.prototype.computeSecret = function (other) {
  22304. other = new BN(other);
  22305. other = other.toRed(this._prime);
  22306. var secret = other.redPow(this._priv).fromRed();
  22307. var out = new Buffer(secret.toArray());
  22308. var prime = this.getPrime();
  22309. if (out.length < prime.length) {
  22310. var front = new Buffer(prime.length - out.length);
  22311. front.fill(0);
  22312. out = Buffer.concat([front, out]);
  22313. }
  22314. return out;
  22315. };
  22316. DH.prototype.getPublicKey = function getPublicKey(enc) {
  22317. return formatReturnValue(this._pub, enc);
  22318. };
  22319. DH.prototype.getPrivateKey = function getPrivateKey(enc) {
  22320. return formatReturnValue(this._priv, enc);
  22321. };
  22322. DH.prototype.getPrime = function (enc) {
  22323. return formatReturnValue(this.__prime, enc);
  22324. };
  22325. DH.prototype.getGenerator = function (enc) {
  22326. return formatReturnValue(this._gen, enc);
  22327. };
  22328. DH.prototype.setGenerator = function (gen, enc) {
  22329. enc = enc || 'utf8';
  22330. if (!Buffer.isBuffer(gen)) {
  22331. gen = new Buffer(gen, enc);
  22332. }
  22333. this.__gen = gen;
  22334. this._gen = new BN(gen);
  22335. return this;
  22336. };
  22337. function formatReturnValue(bn, enc) {
  22338. var buf = new Buffer(bn.toArray());
  22339. if (!enc) {
  22340. return buf;
  22341. } else {
  22342. return buf.toString(enc);
  22343. }
  22344. }
  22345. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 83).Buffer))
  22346. /***/ }),
  22347. /* 172 */
  22348. /*!*******************************************************!*\
  22349. !*** ./node_modules/browserify-sign/browser/index.js ***!
  22350. \*******************************************************/
  22351. /*! no static exports found */
  22352. /***/ (function(module, exports, __webpack_require__) {
  22353. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  22354. var createHash = __webpack_require__(/*! create-hash */ 87)
  22355. var stream = __webpack_require__(/*! readable-stream */ 91)
  22356. var inherits = __webpack_require__(/*! inherits */ 88)
  22357. var sign = __webpack_require__(/*! ./sign */ 173)
  22358. var verify = __webpack_require__(/*! ./verify */ 226)
  22359. var algorithms = __webpack_require__(/*! ./algorithms.json */ 126)
  22360. Object.keys(algorithms).forEach(function (key) {
  22361. algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
  22362. algorithms[key.toLowerCase()] = algorithms[key]
  22363. })
  22364. function Sign (algorithm) {
  22365. stream.Writable.call(this)
  22366. var data = algorithms[algorithm]
  22367. if (!data) throw new Error('Unknown message digest')
  22368. this._hashType = data.hash
  22369. this._hash = createHash(data.hash)
  22370. this._tag = data.id
  22371. this._signType = data.sign
  22372. }
  22373. inherits(Sign, stream.Writable)
  22374. Sign.prototype._write = function _write (data, _, done) {
  22375. this._hash.update(data)
  22376. done()
  22377. }
  22378. Sign.prototype.update = function update (data, enc) {
  22379. if (typeof data === 'string') data = Buffer.from(data, enc)
  22380. this._hash.update(data)
  22381. return this
  22382. }
  22383. Sign.prototype.sign = function signMethod (key, enc) {
  22384. this.end()
  22385. var hash = this._hash.digest()
  22386. var sig = sign(hash, key, this._hashType, this._signType, this._tag)
  22387. return enc ? sig.toString(enc) : sig
  22388. }
  22389. function Verify (algorithm) {
  22390. stream.Writable.call(this)
  22391. var data = algorithms[algorithm]
  22392. if (!data) throw new Error('Unknown message digest')
  22393. this._hash = createHash(data.hash)
  22394. this._tag = data.id
  22395. this._signType = data.sign
  22396. }
  22397. inherits(Verify, stream.Writable)
  22398. Verify.prototype._write = function _write (data, _, done) {
  22399. this._hash.update(data)
  22400. done()
  22401. }
  22402. Verify.prototype.update = function update (data, enc) {
  22403. if (typeof data === 'string') data = Buffer.from(data, enc)
  22404. this._hash.update(data)
  22405. return this
  22406. }
  22407. Verify.prototype.verify = function verifyMethod (key, sig, enc) {
  22408. if (typeof sig === 'string') sig = Buffer.from(sig, enc)
  22409. this.end()
  22410. var hash = this._hash.digest()
  22411. return verify(sig, hash, key, this._signType, this._tag)
  22412. }
  22413. function createSign (algorithm) {
  22414. return new Sign(algorithm)
  22415. }
  22416. function createVerify (algorithm) {
  22417. return new Verify(algorithm)
  22418. }
  22419. module.exports = {
  22420. Sign: createSign,
  22421. Verify: createVerify,
  22422. createSign: createSign,
  22423. createVerify: createVerify
  22424. }
  22425. /***/ }),
  22426. /* 173 */
  22427. /*!******************************************************!*\
  22428. !*** ./node_modules/browserify-sign/browser/sign.js ***!
  22429. \******************************************************/
  22430. /*! no static exports found */
  22431. /***/ (function(module, exports, __webpack_require__) {
  22432. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  22433. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  22434. var createHmac = __webpack_require__(/*! create-hmac */ 122)
  22435. var crt = __webpack_require__(/*! browserify-rsa */ 174)
  22436. var EC = __webpack_require__(/*! elliptic */ 175).ec
  22437. var BN = __webpack_require__(/*! bn.js */ 164)
  22438. var parseKeys = __webpack_require__(/*! parse-asn1 */ 205)
  22439. var curves = __webpack_require__(/*! ./curves.json */ 225)
  22440. function sign (hash, key, hashType, signType, tag) {
  22441. var priv = parseKeys(key)
  22442. if (priv.curve) {
  22443. // rsa keys can be interpreted as ecdsa ones in openssl
  22444. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22445. return ecSign(hash, priv)
  22446. } else if (priv.type === 'dsa') {
  22447. if (signType !== 'dsa') throw new Error('wrong private key type')
  22448. return dsaSign(hash, priv, hashType)
  22449. } else {
  22450. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22451. }
  22452. hash = Buffer.concat([tag, hash])
  22453. var len = priv.modulus.byteLength()
  22454. var pad = [0, 1]
  22455. while (hash.length + pad.length + 1 < len) pad.push(0xff)
  22456. pad.push(0x00)
  22457. var i = -1
  22458. while (++i < hash.length) pad.push(hash[i])
  22459. var out = crt(pad, priv)
  22460. return out
  22461. }
  22462. function ecSign (hash, priv) {
  22463. var curveId = curves[priv.curve.join('.')]
  22464. if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
  22465. var curve = new EC(curveId)
  22466. var key = curve.keyFromPrivate(priv.privateKey)
  22467. var out = key.sign(hash)
  22468. return Buffer.from(out.toDER())
  22469. }
  22470. function dsaSign (hash, priv, algo) {
  22471. var x = priv.params.priv_key
  22472. var p = priv.params.p
  22473. var q = priv.params.q
  22474. var g = priv.params.g
  22475. var r = new BN(0)
  22476. var k
  22477. var H = bits2int(hash, q).mod(q)
  22478. var s = false
  22479. var kv = getKey(x, q, hash, algo)
  22480. while (s === false) {
  22481. k = makeKey(q, kv, algo)
  22482. r = makeR(g, k, p, q)
  22483. s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
  22484. if (s.cmpn(0) === 0) {
  22485. s = false
  22486. r = new BN(0)
  22487. }
  22488. }
  22489. return toDER(r, s)
  22490. }
  22491. function toDER (r, s) {
  22492. r = r.toArray()
  22493. s = s.toArray()
  22494. // Pad values
  22495. if (r[0] & 0x80) r = [0].concat(r)
  22496. if (s[0] & 0x80) s = [0].concat(s)
  22497. var total = r.length + s.length + 4
  22498. var res = [0x30, total, 0x02, r.length]
  22499. res = res.concat(r, [0x02, s.length], s)
  22500. return Buffer.from(res)
  22501. }
  22502. function getKey (x, q, hash, algo) {
  22503. x = Buffer.from(x.toArray())
  22504. if (x.length < q.byteLength()) {
  22505. var zeros = Buffer.alloc(q.byteLength() - x.length)
  22506. x = Buffer.concat([zeros, x])
  22507. }
  22508. var hlen = hash.length
  22509. var hbits = bits2octets(hash, q)
  22510. var v = Buffer.alloc(hlen)
  22511. v.fill(1)
  22512. var k = Buffer.alloc(hlen)
  22513. k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
  22514. v = createHmac(algo, k).update(v).digest()
  22515. k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
  22516. v = createHmac(algo, k).update(v).digest()
  22517. return { k: k, v: v }
  22518. }
  22519. function bits2int (obits, q) {
  22520. var bits = new BN(obits)
  22521. var shift = (obits.length << 3) - q.bitLength()
  22522. if (shift > 0) bits.ishrn(shift)
  22523. return bits
  22524. }
  22525. function bits2octets (bits, q) {
  22526. bits = bits2int(bits, q)
  22527. bits = bits.mod(q)
  22528. var out = Buffer.from(bits.toArray())
  22529. if (out.length < q.byteLength()) {
  22530. var zeros = Buffer.alloc(q.byteLength() - out.length)
  22531. out = Buffer.concat([zeros, out])
  22532. }
  22533. return out
  22534. }
  22535. function makeKey (q, kv, algo) {
  22536. var t
  22537. var k
  22538. do {
  22539. t = Buffer.alloc(0)
  22540. while (t.length * 8 < q.bitLength()) {
  22541. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22542. t = Buffer.concat([t, kv.v])
  22543. }
  22544. k = bits2int(t, q)
  22545. kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
  22546. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22547. } while (k.cmp(q) !== -1)
  22548. return k
  22549. }
  22550. function makeR (g, k, p, q) {
  22551. return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
  22552. }
  22553. module.exports = sign
  22554. module.exports.getKey = getKey
  22555. module.exports.makeKey = makeKey
  22556. /***/ }),
  22557. /* 174 */
  22558. /*!**********************************************!*\
  22559. !*** ./node_modules/browserify-rsa/index.js ***!
  22560. \**********************************************/
  22561. /*! no static exports found */
  22562. /***/ (function(module, exports, __webpack_require__) {
  22563. /* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ 164);
  22564. var randomBytes = __webpack_require__(/*! randombytes */ 79);
  22565. module.exports = crt;
  22566. function blind(priv) {
  22567. var r = getr(priv);
  22568. var blinder = r.toRed(bn.mont(priv.modulus))
  22569. .redPow(new bn(priv.publicExponent)).fromRed();
  22570. return {
  22571. blinder: blinder,
  22572. unblinder:r.invm(priv.modulus)
  22573. };
  22574. }
  22575. function crt(msg, priv) {
  22576. var blinds = blind(priv);
  22577. var len = priv.modulus.byteLength();
  22578. var mod = bn.mont(priv.modulus);
  22579. var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
  22580. var c1 = blinded.toRed(bn.mont(priv.prime1));
  22581. var c2 = blinded.toRed(bn.mont(priv.prime2));
  22582. var qinv = priv.coefficient;
  22583. var p = priv.prime1;
  22584. var q = priv.prime2;
  22585. var m1 = c1.redPow(priv.exponent1);
  22586. var m2 = c2.redPow(priv.exponent2);
  22587. m1 = m1.fromRed();
  22588. m2 = m2.fromRed();
  22589. var h = m1.isub(m2).imul(qinv).umod(p);
  22590. h.imul(q);
  22591. m2.iadd(h);
  22592. return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
  22593. }
  22594. crt.getr = getr;
  22595. function getr(priv) {
  22596. var len = priv.modulus.byteLength();
  22597. var r = new bn(randomBytes(len));
  22598. while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
  22599. r = new bn(randomBytes(len));
  22600. }
  22601. return r;
  22602. }
  22603. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 83).Buffer))
  22604. /***/ }),
  22605. /* 175 */
  22606. /*!***********************************************!*\
  22607. !*** ./node_modules/elliptic/lib/elliptic.js ***!
  22608. \***********************************************/
  22609. /*! no static exports found */
  22610. /***/ (function(module, exports, __webpack_require__) {
  22611. "use strict";
  22612. var elliptic = exports;
  22613. elliptic.version = __webpack_require__(/*! ../package.json */ 176).version;
  22614. elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 177);
  22615. elliptic.rand = __webpack_require__(/*! brorand */ 168);
  22616. elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 179);
  22617. elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 184);
  22618. // Protocols
  22619. elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 198);
  22620. elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 202);
  22621. /***/ }),
  22622. /* 176 */
  22623. /*!********************************************!*\
  22624. !*** ./node_modules/elliptic/package.json ***!
  22625. \********************************************/
  22626. /*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, bugs, dependencies, description, devDependencies, files, homepage, keywords, license, main, name, repository, scripts, version, default */
  22627. /***/ (function(module) {
  22628. module.exports = JSON.parse("{\"_args\":[[\"elliptic@6.5.2\",\"/Users/guoshengqiang/Documents/hbx-plugins/uniapp-cli\"]],\"_from\":\"elliptic@6.5.2\",\"_id\":\"elliptic@6.5.2\",\"_inBundle\":false,\"_integrity\":\"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==\",\"_location\":\"/elliptic\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"elliptic@6.5.2\",\"name\":\"elliptic\",\"escapedName\":\"elliptic\",\"rawSpec\":\"6.5.2\",\"saveSpec\":null,\"fetchSpec\":\"6.5.2\"},\"_requiredBy\":[\"/browserify-sign\",\"/create-ecdh\"],\"_resolved\":\"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz\",\"_spec\":\"6.5.2\",\"_where\":\"/Users/guoshengqiang/Documents/hbx-plugins/uniapp-cli\",\"author\":{\"name\":\"Fedor Indutny\",\"email\":\"fedor@indutny.com\"},\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"dependencies\":{\"bn.js\":\"^4.4.0\",\"brorand\":\"^1.0.1\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.0\",\"inherits\":\"^2.0.1\",\"minimalistic-assert\":\"^1.0.0\",\"minimalistic-crypto-utils\":\"^1.0.0\"},\"description\":\"EC cryptography\",\"devDependencies\":{\"brfs\":\"^1.4.3\",\"coveralls\":\"^3.0.8\",\"grunt\":\"^1.0.4\",\"grunt-browserify\":\"^5.0.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-connect\":\"^1.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^1.0.1\",\"grunt-mocha-istanbul\":\"^3.0.1\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.2\",\"jscs\":\"^3.0.7\",\"jshint\":\"^2.10.3\",\"mocha\":\"^6.2.2\"},\"files\":[\"lib\"],\"homepage\":\"https://github.com/indutny/elliptic\",\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"license\":\"MIT\",\"main\":\"lib/elliptic.js\",\"name\":\"elliptic\",\"repository\":{\"type\":\"git\",\"url\":\"git+ssh://git@github.com/indutny/elliptic.git\"},\"scripts\":{\"jscs\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"jshint\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"lint\":\"npm run jscs && npm run jshint\",\"test\":\"npm run lint && npm run unit\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"version\":\"grunt dist && git add dist/\"},\"version\":\"6.5.2\"}");
  22629. /***/ }),
  22630. /* 177 */
  22631. /*!*****************************************************!*\
  22632. !*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
  22633. \*****************************************************/
  22634. /*! no static exports found */
  22635. /***/ (function(module, exports, __webpack_require__) {
  22636. "use strict";
  22637. var utils = exports;
  22638. var BN = __webpack_require__(/*! bn.js */ 164);
  22639. var minAssert = __webpack_require__(/*! minimalistic-assert */ 138);
  22640. var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 178);
  22641. utils.assert = minAssert;
  22642. utils.toArray = minUtils.toArray;
  22643. utils.zero2 = minUtils.zero2;
  22644. utils.toHex = minUtils.toHex;
  22645. utils.encode = minUtils.encode;
  22646. // Represent num in a w-NAF form
  22647. function getNAF(num, w, bits) {
  22648. var naf = new Array(Math.max(num.bitLength(), bits) + 1);
  22649. naf.fill(0);
  22650. var ws = 1 << (w + 1);
  22651. var k = num.clone();
  22652. for (var i = 0; i < naf.length; i++) {
  22653. var z;
  22654. var mod = k.andln(ws - 1);
  22655. if (k.isOdd()) {
  22656. if (mod > (ws >> 1) - 1)
  22657. z = (ws >> 1) - mod;
  22658. else
  22659. z = mod;
  22660. k.isubn(z);
  22661. } else {
  22662. z = 0;
  22663. }
  22664. naf[i] = z;
  22665. k.iushrn(1);
  22666. }
  22667. return naf;
  22668. }
  22669. utils.getNAF = getNAF;
  22670. // Represent k1, k2 in a Joint Sparse Form
  22671. function getJSF(k1, k2) {
  22672. var jsf = [
  22673. [],
  22674. []
  22675. ];
  22676. k1 = k1.clone();
  22677. k2 = k2.clone();
  22678. var d1 = 0;
  22679. var d2 = 0;
  22680. while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
  22681. // First phase
  22682. var m14 = (k1.andln(3) + d1) & 3;
  22683. var m24 = (k2.andln(3) + d2) & 3;
  22684. if (m14 === 3)
  22685. m14 = -1;
  22686. if (m24 === 3)
  22687. m24 = -1;
  22688. var u1;
  22689. if ((m14 & 1) === 0) {
  22690. u1 = 0;
  22691. } else {
  22692. var m8 = (k1.andln(7) + d1) & 7;
  22693. if ((m8 === 3 || m8 === 5) && m24 === 2)
  22694. u1 = -m14;
  22695. else
  22696. u1 = m14;
  22697. }
  22698. jsf[0].push(u1);
  22699. var u2;
  22700. if ((m24 & 1) === 0) {
  22701. u2 = 0;
  22702. } else {
  22703. var m8 = (k2.andln(7) + d2) & 7;
  22704. if ((m8 === 3 || m8 === 5) && m14 === 2)
  22705. u2 = -m24;
  22706. else
  22707. u2 = m24;
  22708. }
  22709. jsf[1].push(u2);
  22710. // Second phase
  22711. if (2 * d1 === u1 + 1)
  22712. d1 = 1 - d1;
  22713. if (2 * d2 === u2 + 1)
  22714. d2 = 1 - d2;
  22715. k1.iushrn(1);
  22716. k2.iushrn(1);
  22717. }
  22718. return jsf;
  22719. }
  22720. utils.getJSF = getJSF;
  22721. function cachedProperty(obj, name, computer) {
  22722. var key = '_' + name;
  22723. obj.prototype[name] = function cachedProperty() {
  22724. return this[key] !== undefined ? this[key] :
  22725. this[key] = computer.call(this);
  22726. };
  22727. }
  22728. utils.cachedProperty = cachedProperty;
  22729. function parseBytes(bytes) {
  22730. return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
  22731. bytes;
  22732. }
  22733. utils.parseBytes = parseBytes;
  22734. function intFromLE(bytes) {
  22735. return new BN(bytes, 'hex', 'le');
  22736. }
  22737. utils.intFromLE = intFromLE;
  22738. /***/ }),
  22739. /* 178 */
  22740. /*!*************************************************************!*\
  22741. !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
  22742. \*************************************************************/
  22743. /*! no static exports found */
  22744. /***/ (function(module, exports, __webpack_require__) {
  22745. "use strict";
  22746. var utils = exports;
  22747. function toArray(msg, enc) {
  22748. if (Array.isArray(msg))
  22749. return msg.slice();
  22750. if (!msg)
  22751. return [];
  22752. var res = [];
  22753. if (typeof msg !== 'string') {
  22754. for (var i = 0; i < msg.length; i++)
  22755. res[i] = msg[i] | 0;
  22756. return res;
  22757. }
  22758. if (enc === 'hex') {
  22759. msg = msg.replace(/[^a-z0-9]+/ig, '');
  22760. if (msg.length % 2 !== 0)
  22761. msg = '0' + msg;
  22762. for (var i = 0; i < msg.length; i += 2)
  22763. res.push(parseInt(msg[i] + msg[i + 1], 16));
  22764. } else {
  22765. for (var i = 0; i < msg.length; i++) {
  22766. var c = msg.charCodeAt(i);
  22767. var hi = c >> 8;
  22768. var lo = c & 0xff;
  22769. if (hi)
  22770. res.push(hi, lo);
  22771. else
  22772. res.push(lo);
  22773. }
  22774. }
  22775. return res;
  22776. }
  22777. utils.toArray = toArray;
  22778. function zero2(word) {
  22779. if (word.length === 1)
  22780. return '0' + word;
  22781. else
  22782. return word;
  22783. }
  22784. utils.zero2 = zero2;
  22785. function toHex(msg) {
  22786. var res = '';
  22787. for (var i = 0; i < msg.length; i++)
  22788. res += zero2(msg[i].toString(16));
  22789. return res;
  22790. }
  22791. utils.toHex = toHex;
  22792. utils.encode = function encode(arr, enc) {
  22793. if (enc === 'hex')
  22794. return toHex(arr);
  22795. else
  22796. return arr;
  22797. };
  22798. /***/ }),
  22799. /* 179 */
  22800. /*!***********************************************************!*\
  22801. !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
  22802. \***********************************************************/
  22803. /*! no static exports found */
  22804. /***/ (function(module, exports, __webpack_require__) {
  22805. "use strict";
  22806. var curve = exports;
  22807. curve.base = __webpack_require__(/*! ./base */ 180);
  22808. curve.short = __webpack_require__(/*! ./short */ 181);
  22809. curve.mont = __webpack_require__(/*! ./mont */ 182);
  22810. curve.edwards = __webpack_require__(/*! ./edwards */ 183);
  22811. /***/ }),
  22812. /* 180 */
  22813. /*!**********************************************************!*\
  22814. !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
  22815. \**********************************************************/
  22816. /*! no static exports found */
  22817. /***/ (function(module, exports, __webpack_require__) {
  22818. "use strict";
  22819. var BN = __webpack_require__(/*! bn.js */ 164);
  22820. var utils = __webpack_require__(/*! ../utils */ 177);
  22821. var getNAF = utils.getNAF;
  22822. var getJSF = utils.getJSF;
  22823. var assert = utils.assert;
  22824. function BaseCurve(type, conf) {
  22825. this.type = type;
  22826. this.p = new BN(conf.p, 16);
  22827. // Use Montgomery, when there is no fast reduction for the prime
  22828. this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
  22829. // Useful for many curves
  22830. this.zero = new BN(0).toRed(this.red);
  22831. this.one = new BN(1).toRed(this.red);
  22832. this.two = new BN(2).toRed(this.red);
  22833. // Curve configuration, optional
  22834. this.n = conf.n && new BN(conf.n, 16);
  22835. this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
  22836. // Temporary arrays
  22837. this._wnafT1 = new Array(4);
  22838. this._wnafT2 = new Array(4);
  22839. this._wnafT3 = new Array(4);
  22840. this._wnafT4 = new Array(4);
  22841. this._bitLength = this.n ? this.n.bitLength() : 0;
  22842. // Generalized Greg Maxwell's trick
  22843. var adjustCount = this.n && this.p.div(this.n);
  22844. if (!adjustCount || adjustCount.cmpn(100) > 0) {
  22845. this.redN = null;
  22846. } else {
  22847. this._maxwellTrick = true;
  22848. this.redN = this.n.toRed(this.red);
  22849. }
  22850. }
  22851. module.exports = BaseCurve;
  22852. BaseCurve.prototype.point = function point() {
  22853. throw new Error('Not implemented');
  22854. };
  22855. BaseCurve.prototype.validate = function validate() {
  22856. throw new Error('Not implemented');
  22857. };
  22858. BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
  22859. assert(p.precomputed);
  22860. var doubles = p._getDoubles();
  22861. var naf = getNAF(k, 1, this._bitLength);
  22862. var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
  22863. I /= 3;
  22864. // Translate into more windowed form
  22865. var repr = [];
  22866. for (var j = 0; j < naf.length; j += doubles.step) {
  22867. var nafW = 0;
  22868. for (var k = j + doubles.step - 1; k >= j; k--)
  22869. nafW = (nafW << 1) + naf[k];
  22870. repr.push(nafW);
  22871. }
  22872. var a = this.jpoint(null, null, null);
  22873. var b = this.jpoint(null, null, null);
  22874. for (var i = I; i > 0; i--) {
  22875. for (var j = 0; j < repr.length; j++) {
  22876. var nafW = repr[j];
  22877. if (nafW === i)
  22878. b = b.mixedAdd(doubles.points[j]);
  22879. else if (nafW === -i)
  22880. b = b.mixedAdd(doubles.points[j].neg());
  22881. }
  22882. a = a.add(b);
  22883. }
  22884. return a.toP();
  22885. };
  22886. BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
  22887. var w = 4;
  22888. // Precompute window
  22889. var nafPoints = p._getNAFPoints(w);
  22890. w = nafPoints.wnd;
  22891. var wnd = nafPoints.points;
  22892. // Get NAF form
  22893. var naf = getNAF(k, w, this._bitLength);
  22894. // Add `this`*(N+1) for every w-NAF index
  22895. var acc = this.jpoint(null, null, null);
  22896. for (var i = naf.length - 1; i >= 0; i--) {
  22897. // Count zeroes
  22898. for (var k = 0; i >= 0 && naf[i] === 0; i--)
  22899. k++;
  22900. if (i >= 0)
  22901. k++;
  22902. acc = acc.dblp(k);
  22903. if (i < 0)
  22904. break;
  22905. var z = naf[i];
  22906. assert(z !== 0);
  22907. if (p.type === 'affine') {
  22908. // J +- P
  22909. if (z > 0)
  22910. acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
  22911. else
  22912. acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
  22913. } else {
  22914. // J +- J
  22915. if (z > 0)
  22916. acc = acc.add(wnd[(z - 1) >> 1]);
  22917. else
  22918. acc = acc.add(wnd[(-z - 1) >> 1].neg());
  22919. }
  22920. }
  22921. return p.type === 'affine' ? acc.toP() : acc;
  22922. };
  22923. BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
  22924. points,
  22925. coeffs,
  22926. len,
  22927. jacobianResult) {
  22928. var wndWidth = this._wnafT1;
  22929. var wnd = this._wnafT2;
  22930. var naf = this._wnafT3;
  22931. // Fill all arrays
  22932. var max = 0;
  22933. for (var i = 0; i < len; i++) {
  22934. var p = points[i];
  22935. var nafPoints = p._getNAFPoints(defW);
  22936. wndWidth[i] = nafPoints.wnd;
  22937. wnd[i] = nafPoints.points;
  22938. }
  22939. // Comb small window NAFs
  22940. for (var i = len - 1; i >= 1; i -= 2) {
  22941. var a = i - 1;
  22942. var b = i;
  22943. if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
  22944. naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
  22945. naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
  22946. max = Math.max(naf[a].length, max);
  22947. max = Math.max(naf[b].length, max);
  22948. continue;
  22949. }
  22950. var comb = [
  22951. points[a], /* 1 */
  22952. null, /* 3 */
  22953. null, /* 5 */
  22954. points[b] /* 7 */
  22955. ];
  22956. // Try to avoid Projective points, if possible
  22957. if (points[a].y.cmp(points[b].y) === 0) {
  22958. comb[1] = points[a].add(points[b]);
  22959. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22960. } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
  22961. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22962. comb[2] = points[a].add(points[b].neg());
  22963. } else {
  22964. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22965. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22966. }
  22967. var index = [
  22968. -3, /* -1 -1 */
  22969. -1, /* -1 0 */
  22970. -5, /* -1 1 */
  22971. -7, /* 0 -1 */
  22972. 0, /* 0 0 */
  22973. 7, /* 0 1 */
  22974. 5, /* 1 -1 */
  22975. 1, /* 1 0 */
  22976. 3 /* 1 1 */
  22977. ];
  22978. var jsf = getJSF(coeffs[a], coeffs[b]);
  22979. max = Math.max(jsf[0].length, max);
  22980. naf[a] = new Array(max);
  22981. naf[b] = new Array(max);
  22982. for (var j = 0; j < max; j++) {
  22983. var ja = jsf[0][j] | 0;
  22984. var jb = jsf[1][j] | 0;
  22985. naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
  22986. naf[b][j] = 0;
  22987. wnd[a] = comb;
  22988. }
  22989. }
  22990. var acc = this.jpoint(null, null, null);
  22991. var tmp = this._wnafT4;
  22992. for (var i = max; i >= 0; i--) {
  22993. var k = 0;
  22994. while (i >= 0) {
  22995. var zero = true;
  22996. for (var j = 0; j < len; j++) {
  22997. tmp[j] = naf[j][i] | 0;
  22998. if (tmp[j] !== 0)
  22999. zero = false;
  23000. }
  23001. if (!zero)
  23002. break;
  23003. k++;
  23004. i--;
  23005. }
  23006. if (i >= 0)
  23007. k++;
  23008. acc = acc.dblp(k);
  23009. if (i < 0)
  23010. break;
  23011. for (var j = 0; j < len; j++) {
  23012. var z = tmp[j];
  23013. var p;
  23014. if (z === 0)
  23015. continue;
  23016. else if (z > 0)
  23017. p = wnd[j][(z - 1) >> 1];
  23018. else if (z < 0)
  23019. p = wnd[j][(-z - 1) >> 1].neg();
  23020. if (p.type === 'affine')
  23021. acc = acc.mixedAdd(p);
  23022. else
  23023. acc = acc.add(p);
  23024. }
  23025. }
  23026. // Zeroify references
  23027. for (var i = 0; i < len; i++)
  23028. wnd[i] = null;
  23029. if (jacobianResult)
  23030. return acc;
  23031. else
  23032. return acc.toP();
  23033. };
  23034. function BasePoint(curve, type) {
  23035. this.curve = curve;
  23036. this.type = type;
  23037. this.precomputed = null;
  23038. }
  23039. BaseCurve.BasePoint = BasePoint;
  23040. BasePoint.prototype.eq = function eq(/*other*/) {
  23041. throw new Error('Not implemented');
  23042. };
  23043. BasePoint.prototype.validate = function validate() {
  23044. return this.curve.validate(this);
  23045. };
  23046. BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  23047. bytes = utils.toArray(bytes, enc);
  23048. var len = this.p.byteLength();
  23049. // uncompressed, hybrid-odd, hybrid-even
  23050. if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
  23051. bytes.length - 1 === 2 * len) {
  23052. if (bytes[0] === 0x06)
  23053. assert(bytes[bytes.length - 1] % 2 === 0);
  23054. else if (bytes[0] === 0x07)
  23055. assert(bytes[bytes.length - 1] % 2 === 1);
  23056. var res = this.point(bytes.slice(1, 1 + len),
  23057. bytes.slice(1 + len, 1 + 2 * len));
  23058. return res;
  23059. } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
  23060. bytes.length - 1 === len) {
  23061. return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
  23062. }
  23063. throw new Error('Unknown point format');
  23064. };
  23065. BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
  23066. return this.encode(enc, true);
  23067. };
  23068. BasePoint.prototype._encode = function _encode(compact) {
  23069. var len = this.curve.p.byteLength();
  23070. var x = this.getX().toArray('be', len);
  23071. if (compact)
  23072. return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  23073. return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
  23074. };
  23075. BasePoint.prototype.encode = function encode(enc, compact) {
  23076. return utils.encode(this._encode(compact), enc);
  23077. };
  23078. BasePoint.prototype.precompute = function precompute(power) {
  23079. if (this.precomputed)
  23080. return this;
  23081. var precomputed = {
  23082. doubles: null,
  23083. naf: null,
  23084. beta: null
  23085. };
  23086. precomputed.naf = this._getNAFPoints(8);
  23087. precomputed.doubles = this._getDoubles(4, power);
  23088. precomputed.beta = this._getBeta();
  23089. this.precomputed = precomputed;
  23090. return this;
  23091. };
  23092. BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
  23093. if (!this.precomputed)
  23094. return false;
  23095. var doubles = this.precomputed.doubles;
  23096. if (!doubles)
  23097. return false;
  23098. return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
  23099. };
  23100. BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
  23101. if (this.precomputed && this.precomputed.doubles)
  23102. return this.precomputed.doubles;
  23103. var doubles = [ this ];
  23104. var acc = this;
  23105. for (var i = 0; i < power; i += step) {
  23106. for (var j = 0; j < step; j++)
  23107. acc = acc.dbl();
  23108. doubles.push(acc);
  23109. }
  23110. return {
  23111. step: step,
  23112. points: doubles
  23113. };
  23114. };
  23115. BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
  23116. if (this.precomputed && this.precomputed.naf)
  23117. return this.precomputed.naf;
  23118. var res = [ this ];
  23119. var max = (1 << wnd) - 1;
  23120. var dbl = max === 1 ? null : this.dbl();
  23121. for (var i = 1; i < max; i++)
  23122. res[i] = res[i - 1].add(dbl);
  23123. return {
  23124. wnd: wnd,
  23125. points: res
  23126. };
  23127. };
  23128. BasePoint.prototype._getBeta = function _getBeta() {
  23129. return null;
  23130. };
  23131. BasePoint.prototype.dblp = function dblp(k) {
  23132. var r = this;
  23133. for (var i = 0; i < k; i++)
  23134. r = r.dbl();
  23135. return r;
  23136. };
  23137. /***/ }),
  23138. /* 181 */
  23139. /*!***********************************************************!*\
  23140. !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
  23141. \***********************************************************/
  23142. /*! no static exports found */
  23143. /***/ (function(module, exports, __webpack_require__) {
  23144. "use strict";
  23145. var utils = __webpack_require__(/*! ../utils */ 177);
  23146. var BN = __webpack_require__(/*! bn.js */ 164);
  23147. var inherits = __webpack_require__(/*! inherits */ 88);
  23148. var Base = __webpack_require__(/*! ./base */ 180);
  23149. var assert = utils.assert;
  23150. function ShortCurve(conf) {
  23151. Base.call(this, 'short', conf);
  23152. this.a = new BN(conf.a, 16).toRed(this.red);
  23153. this.b = new BN(conf.b, 16).toRed(this.red);
  23154. this.tinv = this.two.redInvm();
  23155. this.zeroA = this.a.fromRed().cmpn(0) === 0;
  23156. this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
  23157. // If the curve is endomorphic, precalculate beta and lambda
  23158. this.endo = this._getEndomorphism(conf);
  23159. this._endoWnafT1 = new Array(4);
  23160. this._endoWnafT2 = new Array(4);
  23161. }
  23162. inherits(ShortCurve, Base);
  23163. module.exports = ShortCurve;
  23164. ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
  23165. // No efficient endomorphism
  23166. if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
  23167. return;
  23168. // Compute beta and lambda, that lambda * P = (beta * Px; Py)
  23169. var beta;
  23170. var lambda;
  23171. if (conf.beta) {
  23172. beta = new BN(conf.beta, 16).toRed(this.red);
  23173. } else {
  23174. var betas = this._getEndoRoots(this.p);
  23175. // Choose the smallest beta
  23176. beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
  23177. beta = beta.toRed(this.red);
  23178. }
  23179. if (conf.lambda) {
  23180. lambda = new BN(conf.lambda, 16);
  23181. } else {
  23182. // Choose the lambda that is matching selected beta
  23183. var lambdas = this._getEndoRoots(this.n);
  23184. if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
  23185. lambda = lambdas[0];
  23186. } else {
  23187. lambda = lambdas[1];
  23188. assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
  23189. }
  23190. }
  23191. // Get basis vectors, used for balanced length-two representation
  23192. var basis;
  23193. if (conf.basis) {
  23194. basis = conf.basis.map(function(vec) {
  23195. return {
  23196. a: new BN(vec.a, 16),
  23197. b: new BN(vec.b, 16)
  23198. };
  23199. });
  23200. } else {
  23201. basis = this._getEndoBasis(lambda);
  23202. }
  23203. return {
  23204. beta: beta,
  23205. lambda: lambda,
  23206. basis: basis
  23207. };
  23208. };
  23209. ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
  23210. // Find roots of for x^2 + x + 1 in F
  23211. // Root = (-1 +- Sqrt(-3)) / 2
  23212. //
  23213. var red = num === this.p ? this.red : BN.mont(num);
  23214. var tinv = new BN(2).toRed(red).redInvm();
  23215. var ntinv = tinv.redNeg();
  23216. var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
  23217. var l1 = ntinv.redAdd(s).fromRed();
  23218. var l2 = ntinv.redSub(s).fromRed();
  23219. return [ l1, l2 ];
  23220. };
  23221. ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
  23222. // aprxSqrt >= sqrt(this.n)
  23223. var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
  23224. // 3.74
  23225. // Run EGCD, until r(L + 1) < aprxSqrt
  23226. var u = lambda;
  23227. var v = this.n.clone();
  23228. var x1 = new BN(1);
  23229. var y1 = new BN(0);
  23230. var x2 = new BN(0);
  23231. var y2 = new BN(1);
  23232. // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
  23233. var a0;
  23234. var b0;
  23235. // First vector
  23236. var a1;
  23237. var b1;
  23238. // Second vector
  23239. var a2;
  23240. var b2;
  23241. var prevR;
  23242. var i = 0;
  23243. var r;
  23244. var x;
  23245. while (u.cmpn(0) !== 0) {
  23246. var q = v.div(u);
  23247. r = v.sub(q.mul(u));
  23248. x = x2.sub(q.mul(x1));
  23249. var y = y2.sub(q.mul(y1));
  23250. if (!a1 && r.cmp(aprxSqrt) < 0) {
  23251. a0 = prevR.neg();
  23252. b0 = x1;
  23253. a1 = r.neg();
  23254. b1 = x;
  23255. } else if (a1 && ++i === 2) {
  23256. break;
  23257. }
  23258. prevR = r;
  23259. v = u;
  23260. u = r;
  23261. x2 = x1;
  23262. x1 = x;
  23263. y2 = y1;
  23264. y1 = y;
  23265. }
  23266. a2 = r.neg();
  23267. b2 = x;
  23268. var len1 = a1.sqr().add(b1.sqr());
  23269. var len2 = a2.sqr().add(b2.sqr());
  23270. if (len2.cmp(len1) >= 0) {
  23271. a2 = a0;
  23272. b2 = b0;
  23273. }
  23274. // Normalize signs
  23275. if (a1.negative) {
  23276. a1 = a1.neg();
  23277. b1 = b1.neg();
  23278. }
  23279. if (a2.negative) {
  23280. a2 = a2.neg();
  23281. b2 = b2.neg();
  23282. }
  23283. return [
  23284. { a: a1, b: b1 },
  23285. { a: a2, b: b2 }
  23286. ];
  23287. };
  23288. ShortCurve.prototype._endoSplit = function _endoSplit(k) {
  23289. var basis = this.endo.basis;
  23290. var v1 = basis[0];
  23291. var v2 = basis[1];
  23292. var c1 = v2.b.mul(k).divRound(this.n);
  23293. var c2 = v1.b.neg().mul(k).divRound(this.n);
  23294. var p1 = c1.mul(v1.a);
  23295. var p2 = c2.mul(v2.a);
  23296. var q1 = c1.mul(v1.b);
  23297. var q2 = c2.mul(v2.b);
  23298. // Calculate answer
  23299. var k1 = k.sub(p1).sub(p2);
  23300. var k2 = q1.add(q2).neg();
  23301. return { k1: k1, k2: k2 };
  23302. };
  23303. ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
  23304. x = new BN(x, 16);
  23305. if (!x.red)
  23306. x = x.toRed(this.red);
  23307. var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
  23308. var y = y2.redSqrt();
  23309. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  23310. throw new Error('invalid point');
  23311. // XXX Is there any way to tell if the number is odd without converting it
  23312. // to non-red form?
  23313. var isOdd = y.fromRed().isOdd();
  23314. if (odd && !isOdd || !odd && isOdd)
  23315. y = y.redNeg();
  23316. return this.point(x, y);
  23317. };
  23318. ShortCurve.prototype.validate = function validate(point) {
  23319. if (point.inf)
  23320. return true;
  23321. var x = point.x;
  23322. var y = point.y;
  23323. var ax = this.a.redMul(x);
  23324. var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
  23325. return y.redSqr().redISub(rhs).cmpn(0) === 0;
  23326. };
  23327. ShortCurve.prototype._endoWnafMulAdd =
  23328. function _endoWnafMulAdd(points, coeffs, jacobianResult) {
  23329. var npoints = this._endoWnafT1;
  23330. var ncoeffs = this._endoWnafT2;
  23331. for (var i = 0; i < points.length; i++) {
  23332. var split = this._endoSplit(coeffs[i]);
  23333. var p = points[i];
  23334. var beta = p._getBeta();
  23335. if (split.k1.negative) {
  23336. split.k1.ineg();
  23337. p = p.neg(true);
  23338. }
  23339. if (split.k2.negative) {
  23340. split.k2.ineg();
  23341. beta = beta.neg(true);
  23342. }
  23343. npoints[i * 2] = p;
  23344. npoints[i * 2 + 1] = beta;
  23345. ncoeffs[i * 2] = split.k1;
  23346. ncoeffs[i * 2 + 1] = split.k2;
  23347. }
  23348. var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
  23349. // Clean-up references to points and coefficients
  23350. for (var j = 0; j < i * 2; j++) {
  23351. npoints[j] = null;
  23352. ncoeffs[j] = null;
  23353. }
  23354. return res;
  23355. };
  23356. function Point(curve, x, y, isRed) {
  23357. Base.BasePoint.call(this, curve, 'affine');
  23358. if (x === null && y === null) {
  23359. this.x = null;
  23360. this.y = null;
  23361. this.inf = true;
  23362. } else {
  23363. this.x = new BN(x, 16);
  23364. this.y = new BN(y, 16);
  23365. // Force redgomery representation when loading from JSON
  23366. if (isRed) {
  23367. this.x.forceRed(this.curve.red);
  23368. this.y.forceRed(this.curve.red);
  23369. }
  23370. if (!this.x.red)
  23371. this.x = this.x.toRed(this.curve.red);
  23372. if (!this.y.red)
  23373. this.y = this.y.toRed(this.curve.red);
  23374. this.inf = false;
  23375. }
  23376. }
  23377. inherits(Point, Base.BasePoint);
  23378. ShortCurve.prototype.point = function point(x, y, isRed) {
  23379. return new Point(this, x, y, isRed);
  23380. };
  23381. ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
  23382. return Point.fromJSON(this, obj, red);
  23383. };
  23384. Point.prototype._getBeta = function _getBeta() {
  23385. if (!this.curve.endo)
  23386. return;
  23387. var pre = this.precomputed;
  23388. if (pre && pre.beta)
  23389. return pre.beta;
  23390. var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
  23391. if (pre) {
  23392. var curve = this.curve;
  23393. var endoMul = function(p) {
  23394. return curve.point(p.x.redMul(curve.endo.beta), p.y);
  23395. };
  23396. pre.beta = beta;
  23397. beta.precomputed = {
  23398. beta: null,
  23399. naf: pre.naf && {
  23400. wnd: pre.naf.wnd,
  23401. points: pre.naf.points.map(endoMul)
  23402. },
  23403. doubles: pre.doubles && {
  23404. step: pre.doubles.step,
  23405. points: pre.doubles.points.map(endoMul)
  23406. }
  23407. };
  23408. }
  23409. return beta;
  23410. };
  23411. Point.prototype.toJSON = function toJSON() {
  23412. if (!this.precomputed)
  23413. return [ this.x, this.y ];
  23414. return [ this.x, this.y, this.precomputed && {
  23415. doubles: this.precomputed.doubles && {
  23416. step: this.precomputed.doubles.step,
  23417. points: this.precomputed.doubles.points.slice(1)
  23418. },
  23419. naf: this.precomputed.naf && {
  23420. wnd: this.precomputed.naf.wnd,
  23421. points: this.precomputed.naf.points.slice(1)
  23422. }
  23423. } ];
  23424. };
  23425. Point.fromJSON = function fromJSON(curve, obj, red) {
  23426. if (typeof obj === 'string')
  23427. obj = JSON.parse(obj);
  23428. var res = curve.point(obj[0], obj[1], red);
  23429. if (!obj[2])
  23430. return res;
  23431. function obj2point(obj) {
  23432. return curve.point(obj[0], obj[1], red);
  23433. }
  23434. var pre = obj[2];
  23435. res.precomputed = {
  23436. beta: null,
  23437. doubles: pre.doubles && {
  23438. step: pre.doubles.step,
  23439. points: [ res ].concat(pre.doubles.points.map(obj2point))
  23440. },
  23441. naf: pre.naf && {
  23442. wnd: pre.naf.wnd,
  23443. points: [ res ].concat(pre.naf.points.map(obj2point))
  23444. }
  23445. };
  23446. return res;
  23447. };
  23448. Point.prototype.inspect = function inspect() {
  23449. if (this.isInfinity())
  23450. return '<EC Point Infinity>';
  23451. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  23452. ' y: ' + this.y.fromRed().toString(16, 2) + '>';
  23453. };
  23454. Point.prototype.isInfinity = function isInfinity() {
  23455. return this.inf;
  23456. };
  23457. Point.prototype.add = function add(p) {
  23458. // O + P = P
  23459. if (this.inf)
  23460. return p;
  23461. // P + O = P
  23462. if (p.inf)
  23463. return this;
  23464. // P + P = 2P
  23465. if (this.eq(p))
  23466. return this.dbl();
  23467. // P + (-P) = O
  23468. if (this.neg().eq(p))
  23469. return this.curve.point(null, null);
  23470. // P + Q = O
  23471. if (this.x.cmp(p.x) === 0)
  23472. return this.curve.point(null, null);
  23473. var c = this.y.redSub(p.y);
  23474. if (c.cmpn(0) !== 0)
  23475. c = c.redMul(this.x.redSub(p.x).redInvm());
  23476. var nx = c.redSqr().redISub(this.x).redISub(p.x);
  23477. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23478. return this.curve.point(nx, ny);
  23479. };
  23480. Point.prototype.dbl = function dbl() {
  23481. if (this.inf)
  23482. return this;
  23483. // 2P = O
  23484. var ys1 = this.y.redAdd(this.y);
  23485. if (ys1.cmpn(0) === 0)
  23486. return this.curve.point(null, null);
  23487. var a = this.curve.a;
  23488. var x2 = this.x.redSqr();
  23489. var dyinv = ys1.redInvm();
  23490. var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
  23491. var nx = c.redSqr().redISub(this.x.redAdd(this.x));
  23492. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23493. return this.curve.point(nx, ny);
  23494. };
  23495. Point.prototype.getX = function getX() {
  23496. return this.x.fromRed();
  23497. };
  23498. Point.prototype.getY = function getY() {
  23499. return this.y.fromRed();
  23500. };
  23501. Point.prototype.mul = function mul(k) {
  23502. k = new BN(k, 16);
  23503. if (this.isInfinity())
  23504. return this;
  23505. else if (this._hasDoubles(k))
  23506. return this.curve._fixedNafMul(this, k);
  23507. else if (this.curve.endo)
  23508. return this.curve._endoWnafMulAdd([ this ], [ k ]);
  23509. else
  23510. return this.curve._wnafMul(this, k);
  23511. };
  23512. Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
  23513. var points = [ this, p2 ];
  23514. var coeffs = [ k1, k2 ];
  23515. if (this.curve.endo)
  23516. return this.curve._endoWnafMulAdd(points, coeffs);
  23517. else
  23518. return this.curve._wnafMulAdd(1, points, coeffs, 2);
  23519. };
  23520. Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
  23521. var points = [ this, p2 ];
  23522. var coeffs = [ k1, k2 ];
  23523. if (this.curve.endo)
  23524. return this.curve._endoWnafMulAdd(points, coeffs, true);
  23525. else
  23526. return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
  23527. };
  23528. Point.prototype.eq = function eq(p) {
  23529. return this === p ||
  23530. this.inf === p.inf &&
  23531. (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
  23532. };
  23533. Point.prototype.neg = function neg(_precompute) {
  23534. if (this.inf)
  23535. return this;
  23536. var res = this.curve.point(this.x, this.y.redNeg());
  23537. if (_precompute && this.precomputed) {
  23538. var pre = this.precomputed;
  23539. var negate = function(p) {
  23540. return p.neg();
  23541. };
  23542. res.precomputed = {
  23543. naf: pre.naf && {
  23544. wnd: pre.naf.wnd,
  23545. points: pre.naf.points.map(negate)
  23546. },
  23547. doubles: pre.doubles && {
  23548. step: pre.doubles.step,
  23549. points: pre.doubles.points.map(negate)
  23550. }
  23551. };
  23552. }
  23553. return res;
  23554. };
  23555. Point.prototype.toJ = function toJ() {
  23556. if (this.inf)
  23557. return this.curve.jpoint(null, null, null);
  23558. var res = this.curve.jpoint(this.x, this.y, this.curve.one);
  23559. return res;
  23560. };
  23561. function JPoint(curve, x, y, z) {
  23562. Base.BasePoint.call(this, curve, 'jacobian');
  23563. if (x === null && y === null && z === null) {
  23564. this.x = this.curve.one;
  23565. this.y = this.curve.one;
  23566. this.z = new BN(0);
  23567. } else {
  23568. this.x = new BN(x, 16);
  23569. this.y = new BN(y, 16);
  23570. this.z = new BN(z, 16);
  23571. }
  23572. if (!this.x.red)
  23573. this.x = this.x.toRed(this.curve.red);
  23574. if (!this.y.red)
  23575. this.y = this.y.toRed(this.curve.red);
  23576. if (!this.z.red)
  23577. this.z = this.z.toRed(this.curve.red);
  23578. this.zOne = this.z === this.curve.one;
  23579. }
  23580. inherits(JPoint, Base.BasePoint);
  23581. ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
  23582. return new JPoint(this, x, y, z);
  23583. };
  23584. JPoint.prototype.toP = function toP() {
  23585. if (this.isInfinity())
  23586. return this.curve.point(null, null);
  23587. var zinv = this.z.redInvm();
  23588. var zinv2 = zinv.redSqr();
  23589. var ax = this.x.redMul(zinv2);
  23590. var ay = this.y.redMul(zinv2).redMul(zinv);
  23591. return this.curve.point(ax, ay);
  23592. };
  23593. JPoint.prototype.neg = function neg() {
  23594. return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
  23595. };
  23596. JPoint.prototype.add = function add(p) {
  23597. // O + P = P
  23598. if (this.isInfinity())
  23599. return p;
  23600. // P + O = P
  23601. if (p.isInfinity())
  23602. return this;
  23603. // 12M + 4S + 7A
  23604. var pz2 = p.z.redSqr();
  23605. var z2 = this.z.redSqr();
  23606. var u1 = this.x.redMul(pz2);
  23607. var u2 = p.x.redMul(z2);
  23608. var s1 = this.y.redMul(pz2.redMul(p.z));
  23609. var s2 = p.y.redMul(z2.redMul(this.z));
  23610. var h = u1.redSub(u2);
  23611. var r = s1.redSub(s2);
  23612. if (h.cmpn(0) === 0) {
  23613. if (r.cmpn(0) !== 0)
  23614. return this.curve.jpoint(null, null, null);
  23615. else
  23616. return this.dbl();
  23617. }
  23618. var h2 = h.redSqr();
  23619. var h3 = h2.redMul(h);
  23620. var v = u1.redMul(h2);
  23621. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23622. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23623. var nz = this.z.redMul(p.z).redMul(h);
  23624. return this.curve.jpoint(nx, ny, nz);
  23625. };
  23626. JPoint.prototype.mixedAdd = function mixedAdd(p) {
  23627. // O + P = P
  23628. if (this.isInfinity())
  23629. return p.toJ();
  23630. // P + O = P
  23631. if (p.isInfinity())
  23632. return this;
  23633. // 8M + 3S + 7A
  23634. var z2 = this.z.redSqr();
  23635. var u1 = this.x;
  23636. var u2 = p.x.redMul(z2);
  23637. var s1 = this.y;
  23638. var s2 = p.y.redMul(z2).redMul(this.z);
  23639. var h = u1.redSub(u2);
  23640. var r = s1.redSub(s2);
  23641. if (h.cmpn(0) === 0) {
  23642. if (r.cmpn(0) !== 0)
  23643. return this.curve.jpoint(null, null, null);
  23644. else
  23645. return this.dbl();
  23646. }
  23647. var h2 = h.redSqr();
  23648. var h3 = h2.redMul(h);
  23649. var v = u1.redMul(h2);
  23650. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23651. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23652. var nz = this.z.redMul(h);
  23653. return this.curve.jpoint(nx, ny, nz);
  23654. };
  23655. JPoint.prototype.dblp = function dblp(pow) {
  23656. if (pow === 0)
  23657. return this;
  23658. if (this.isInfinity())
  23659. return this;
  23660. if (!pow)
  23661. return this.dbl();
  23662. if (this.curve.zeroA || this.curve.threeA) {
  23663. var r = this;
  23664. for (var i = 0; i < pow; i++)
  23665. r = r.dbl();
  23666. return r;
  23667. }
  23668. // 1M + 2S + 1A + N * (4S + 5M + 8A)
  23669. // N = 1 => 6M + 6S + 9A
  23670. var a = this.curve.a;
  23671. var tinv = this.curve.tinv;
  23672. var jx = this.x;
  23673. var jy = this.y;
  23674. var jz = this.z;
  23675. var jz4 = jz.redSqr().redSqr();
  23676. // Reuse results
  23677. var jyd = jy.redAdd(jy);
  23678. for (var i = 0; i < pow; i++) {
  23679. var jx2 = jx.redSqr();
  23680. var jyd2 = jyd.redSqr();
  23681. var jyd4 = jyd2.redSqr();
  23682. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23683. var t1 = jx.redMul(jyd2);
  23684. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23685. var t2 = t1.redISub(nx);
  23686. var dny = c.redMul(t2);
  23687. dny = dny.redIAdd(dny).redISub(jyd4);
  23688. var nz = jyd.redMul(jz);
  23689. if (i + 1 < pow)
  23690. jz4 = jz4.redMul(jyd4);
  23691. jx = nx;
  23692. jz = nz;
  23693. jyd = dny;
  23694. }
  23695. return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
  23696. };
  23697. JPoint.prototype.dbl = function dbl() {
  23698. if (this.isInfinity())
  23699. return this;
  23700. if (this.curve.zeroA)
  23701. return this._zeroDbl();
  23702. else if (this.curve.threeA)
  23703. return this._threeDbl();
  23704. else
  23705. return this._dbl();
  23706. };
  23707. JPoint.prototype._zeroDbl = function _zeroDbl() {
  23708. var nx;
  23709. var ny;
  23710. var nz;
  23711. // Z = 1
  23712. if (this.zOne) {
  23713. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23714. // #doubling-mdbl-2007-bl
  23715. // 1M + 5S + 14A
  23716. // XX = X1^2
  23717. var xx = this.x.redSqr();
  23718. // YY = Y1^2
  23719. var yy = this.y.redSqr();
  23720. // YYYY = YY^2
  23721. var yyyy = yy.redSqr();
  23722. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23723. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23724. s = s.redIAdd(s);
  23725. // M = 3 * XX + a; a = 0
  23726. var m = xx.redAdd(xx).redIAdd(xx);
  23727. // T = M ^ 2 - 2*S
  23728. var t = m.redSqr().redISub(s).redISub(s);
  23729. // 8 * YYYY
  23730. var yyyy8 = yyyy.redIAdd(yyyy);
  23731. yyyy8 = yyyy8.redIAdd(yyyy8);
  23732. yyyy8 = yyyy8.redIAdd(yyyy8);
  23733. // X3 = T
  23734. nx = t;
  23735. // Y3 = M * (S - T) - 8 * YYYY
  23736. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23737. // Z3 = 2*Y1
  23738. nz = this.y.redAdd(this.y);
  23739. } else {
  23740. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23741. // #doubling-dbl-2009-l
  23742. // 2M + 5S + 13A
  23743. // A = X1^2
  23744. var a = this.x.redSqr();
  23745. // B = Y1^2
  23746. var b = this.y.redSqr();
  23747. // C = B^2
  23748. var c = b.redSqr();
  23749. // D = 2 * ((X1 + B)^2 - A - C)
  23750. var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
  23751. d = d.redIAdd(d);
  23752. // E = 3 * A
  23753. var e = a.redAdd(a).redIAdd(a);
  23754. // F = E^2
  23755. var f = e.redSqr();
  23756. // 8 * C
  23757. var c8 = c.redIAdd(c);
  23758. c8 = c8.redIAdd(c8);
  23759. c8 = c8.redIAdd(c8);
  23760. // X3 = F - 2 * D
  23761. nx = f.redISub(d).redISub(d);
  23762. // Y3 = E * (D - X3) - 8 * C
  23763. ny = e.redMul(d.redISub(nx)).redISub(c8);
  23764. // Z3 = 2 * Y1 * Z1
  23765. nz = this.y.redMul(this.z);
  23766. nz = nz.redIAdd(nz);
  23767. }
  23768. return this.curve.jpoint(nx, ny, nz);
  23769. };
  23770. JPoint.prototype._threeDbl = function _threeDbl() {
  23771. var nx;
  23772. var ny;
  23773. var nz;
  23774. // Z = 1
  23775. if (this.zOne) {
  23776. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
  23777. // #doubling-mdbl-2007-bl
  23778. // 1M + 5S + 15A
  23779. // XX = X1^2
  23780. var xx = this.x.redSqr();
  23781. // YY = Y1^2
  23782. var yy = this.y.redSqr();
  23783. // YYYY = YY^2
  23784. var yyyy = yy.redSqr();
  23785. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23786. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23787. s = s.redIAdd(s);
  23788. // M = 3 * XX + a
  23789. var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
  23790. // T = M^2 - 2 * S
  23791. var t = m.redSqr().redISub(s).redISub(s);
  23792. // X3 = T
  23793. nx = t;
  23794. // Y3 = M * (S - T) - 8 * YYYY
  23795. var yyyy8 = yyyy.redIAdd(yyyy);
  23796. yyyy8 = yyyy8.redIAdd(yyyy8);
  23797. yyyy8 = yyyy8.redIAdd(yyyy8);
  23798. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23799. // Z3 = 2 * Y1
  23800. nz = this.y.redAdd(this.y);
  23801. } else {
  23802. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
  23803. // 3M + 5S
  23804. // delta = Z1^2
  23805. var delta = this.z.redSqr();
  23806. // gamma = Y1^2
  23807. var gamma = this.y.redSqr();
  23808. // beta = X1 * gamma
  23809. var beta = this.x.redMul(gamma);
  23810. // alpha = 3 * (X1 - delta) * (X1 + delta)
  23811. var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
  23812. alpha = alpha.redAdd(alpha).redIAdd(alpha);
  23813. // X3 = alpha^2 - 8 * beta
  23814. var beta4 = beta.redIAdd(beta);
  23815. beta4 = beta4.redIAdd(beta4);
  23816. var beta8 = beta4.redAdd(beta4);
  23817. nx = alpha.redSqr().redISub(beta8);
  23818. // Z3 = (Y1 + Z1)^2 - gamma - delta
  23819. nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
  23820. // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
  23821. var ggamma8 = gamma.redSqr();
  23822. ggamma8 = ggamma8.redIAdd(ggamma8);
  23823. ggamma8 = ggamma8.redIAdd(ggamma8);
  23824. ggamma8 = ggamma8.redIAdd(ggamma8);
  23825. ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
  23826. }
  23827. return this.curve.jpoint(nx, ny, nz);
  23828. };
  23829. JPoint.prototype._dbl = function _dbl() {
  23830. var a = this.curve.a;
  23831. // 4M + 6S + 10A
  23832. var jx = this.x;
  23833. var jy = this.y;
  23834. var jz = this.z;
  23835. var jz4 = jz.redSqr().redSqr();
  23836. var jx2 = jx.redSqr();
  23837. var jy2 = jy.redSqr();
  23838. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23839. var jxd4 = jx.redAdd(jx);
  23840. jxd4 = jxd4.redIAdd(jxd4);
  23841. var t1 = jxd4.redMul(jy2);
  23842. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23843. var t2 = t1.redISub(nx);
  23844. var jyd8 = jy2.redSqr();
  23845. jyd8 = jyd8.redIAdd(jyd8);
  23846. jyd8 = jyd8.redIAdd(jyd8);
  23847. jyd8 = jyd8.redIAdd(jyd8);
  23848. var ny = c.redMul(t2).redISub(jyd8);
  23849. var nz = jy.redAdd(jy).redMul(jz);
  23850. return this.curve.jpoint(nx, ny, nz);
  23851. };
  23852. JPoint.prototype.trpl = function trpl() {
  23853. if (!this.curve.zeroA)
  23854. return this.dbl().add(this);
  23855. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
  23856. // 5M + 10S + ...
  23857. // XX = X1^2
  23858. var xx = this.x.redSqr();
  23859. // YY = Y1^2
  23860. var yy = this.y.redSqr();
  23861. // ZZ = Z1^2
  23862. var zz = this.z.redSqr();
  23863. // YYYY = YY^2
  23864. var yyyy = yy.redSqr();
  23865. // M = 3 * XX + a * ZZ2; a = 0
  23866. var m = xx.redAdd(xx).redIAdd(xx);
  23867. // MM = M^2
  23868. var mm = m.redSqr();
  23869. // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
  23870. var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23871. e = e.redIAdd(e);
  23872. e = e.redAdd(e).redIAdd(e);
  23873. e = e.redISub(mm);
  23874. // EE = E^2
  23875. var ee = e.redSqr();
  23876. // T = 16*YYYY
  23877. var t = yyyy.redIAdd(yyyy);
  23878. t = t.redIAdd(t);
  23879. t = t.redIAdd(t);
  23880. t = t.redIAdd(t);
  23881. // U = (M + E)^2 - MM - EE - T
  23882. var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
  23883. // X3 = 4 * (X1 * EE - 4 * YY * U)
  23884. var yyu4 = yy.redMul(u);
  23885. yyu4 = yyu4.redIAdd(yyu4);
  23886. yyu4 = yyu4.redIAdd(yyu4);
  23887. var nx = this.x.redMul(ee).redISub(yyu4);
  23888. nx = nx.redIAdd(nx);
  23889. nx = nx.redIAdd(nx);
  23890. // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
  23891. var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
  23892. ny = ny.redIAdd(ny);
  23893. ny = ny.redIAdd(ny);
  23894. ny = ny.redIAdd(ny);
  23895. // Z3 = (Z1 + E)^2 - ZZ - EE
  23896. var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
  23897. return this.curve.jpoint(nx, ny, nz);
  23898. };
  23899. JPoint.prototype.mul = function mul(k, kbase) {
  23900. k = new BN(k, kbase);
  23901. return this.curve._wnafMul(this, k);
  23902. };
  23903. JPoint.prototype.eq = function eq(p) {
  23904. if (p.type === 'affine')
  23905. return this.eq(p.toJ());
  23906. if (this === p)
  23907. return true;
  23908. // x1 * z2^2 == x2 * z1^2
  23909. var z2 = this.z.redSqr();
  23910. var pz2 = p.z.redSqr();
  23911. if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
  23912. return false;
  23913. // y1 * z2^3 == y2 * z1^3
  23914. var z3 = z2.redMul(this.z);
  23915. var pz3 = pz2.redMul(p.z);
  23916. return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
  23917. };
  23918. JPoint.prototype.eqXToP = function eqXToP(x) {
  23919. var zs = this.z.redSqr();
  23920. var rx = x.toRed(this.curve.red).redMul(zs);
  23921. if (this.x.cmp(rx) === 0)
  23922. return true;
  23923. var xc = x.clone();
  23924. var t = this.curve.redN.redMul(zs);
  23925. for (;;) {
  23926. xc.iadd(this.curve.n);
  23927. if (xc.cmp(this.curve.p) >= 0)
  23928. return false;
  23929. rx.redIAdd(t);
  23930. if (this.x.cmp(rx) === 0)
  23931. return true;
  23932. }
  23933. };
  23934. JPoint.prototype.inspect = function inspect() {
  23935. if (this.isInfinity())
  23936. return '<EC JPoint Infinity>';
  23937. return '<EC JPoint x: ' + this.x.toString(16, 2) +
  23938. ' y: ' + this.y.toString(16, 2) +
  23939. ' z: ' + this.z.toString(16, 2) + '>';
  23940. };
  23941. JPoint.prototype.isInfinity = function isInfinity() {
  23942. // XXX This code assumes that zero is always zero in red
  23943. return this.z.cmpn(0) === 0;
  23944. };
  23945. /***/ }),
  23946. /* 182 */
  23947. /*!**********************************************************!*\
  23948. !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
  23949. \**********************************************************/
  23950. /*! no static exports found */
  23951. /***/ (function(module, exports, __webpack_require__) {
  23952. "use strict";
  23953. var BN = __webpack_require__(/*! bn.js */ 164);
  23954. var inherits = __webpack_require__(/*! inherits */ 88);
  23955. var Base = __webpack_require__(/*! ./base */ 180);
  23956. var utils = __webpack_require__(/*! ../utils */ 177);
  23957. function MontCurve(conf) {
  23958. Base.call(this, 'mont', conf);
  23959. this.a = new BN(conf.a, 16).toRed(this.red);
  23960. this.b = new BN(conf.b, 16).toRed(this.red);
  23961. this.i4 = new BN(4).toRed(this.red).redInvm();
  23962. this.two = new BN(2).toRed(this.red);
  23963. this.a24 = this.i4.redMul(this.a.redAdd(this.two));
  23964. }
  23965. inherits(MontCurve, Base);
  23966. module.exports = MontCurve;
  23967. MontCurve.prototype.validate = function validate(point) {
  23968. var x = point.normalize().x;
  23969. var x2 = x.redSqr();
  23970. var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
  23971. var y = rhs.redSqrt();
  23972. return y.redSqr().cmp(rhs) === 0;
  23973. };
  23974. function Point(curve, x, z) {
  23975. Base.BasePoint.call(this, curve, 'projective');
  23976. if (x === null && z === null) {
  23977. this.x = this.curve.one;
  23978. this.z = this.curve.zero;
  23979. } else {
  23980. this.x = new BN(x, 16);
  23981. this.z = new BN(z, 16);
  23982. if (!this.x.red)
  23983. this.x = this.x.toRed(this.curve.red);
  23984. if (!this.z.red)
  23985. this.z = this.z.toRed(this.curve.red);
  23986. }
  23987. }
  23988. inherits(Point, Base.BasePoint);
  23989. MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  23990. return this.point(utils.toArray(bytes, enc), 1);
  23991. };
  23992. MontCurve.prototype.point = function point(x, z) {
  23993. return new Point(this, x, z);
  23994. };
  23995. MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  23996. return Point.fromJSON(this, obj);
  23997. };
  23998. Point.prototype.precompute = function precompute() {
  23999. // No-op
  24000. };
  24001. Point.prototype._encode = function _encode() {
  24002. return this.getX().toArray('be', this.curve.p.byteLength());
  24003. };
  24004. Point.fromJSON = function fromJSON(curve, obj) {
  24005. return new Point(curve, obj[0], obj[1] || curve.one);
  24006. };
  24007. Point.prototype.inspect = function inspect() {
  24008. if (this.isInfinity())
  24009. return '<EC Point Infinity>';
  24010. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  24011. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  24012. };
  24013. Point.prototype.isInfinity = function isInfinity() {
  24014. // XXX This code assumes that zero is always zero in red
  24015. return this.z.cmpn(0) === 0;
  24016. };
  24017. Point.prototype.dbl = function dbl() {
  24018. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
  24019. // 2M + 2S + 4A
  24020. // A = X1 + Z1
  24021. var a = this.x.redAdd(this.z);
  24022. // AA = A^2
  24023. var aa = a.redSqr();
  24024. // B = X1 - Z1
  24025. var b = this.x.redSub(this.z);
  24026. // BB = B^2
  24027. var bb = b.redSqr();
  24028. // C = AA - BB
  24029. var c = aa.redSub(bb);
  24030. // X3 = AA * BB
  24031. var nx = aa.redMul(bb);
  24032. // Z3 = C * (BB + A24 * C)
  24033. var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
  24034. return this.curve.point(nx, nz);
  24035. };
  24036. Point.prototype.add = function add() {
  24037. throw new Error('Not supported on Montgomery curve');
  24038. };
  24039. Point.prototype.diffAdd = function diffAdd(p, diff) {
  24040. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
  24041. // 4M + 2S + 6A
  24042. // A = X2 + Z2
  24043. var a = this.x.redAdd(this.z);
  24044. // B = X2 - Z2
  24045. var b = this.x.redSub(this.z);
  24046. // C = X3 + Z3
  24047. var c = p.x.redAdd(p.z);
  24048. // D = X3 - Z3
  24049. var d = p.x.redSub(p.z);
  24050. // DA = D * A
  24051. var da = d.redMul(a);
  24052. // CB = C * B
  24053. var cb = c.redMul(b);
  24054. // X5 = Z1 * (DA + CB)^2
  24055. var nx = diff.z.redMul(da.redAdd(cb).redSqr());
  24056. // Z5 = X1 * (DA - CB)^2
  24057. var nz = diff.x.redMul(da.redISub(cb).redSqr());
  24058. return this.curve.point(nx, nz);
  24059. };
  24060. Point.prototype.mul = function mul(k) {
  24061. var t = k.clone();
  24062. var a = this; // (N / 2) * Q + Q
  24063. var b = this.curve.point(null, null); // (N / 2) * Q
  24064. var c = this; // Q
  24065. for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
  24066. bits.push(t.andln(1));
  24067. for (var i = bits.length - 1; i >= 0; i--) {
  24068. if (bits[i] === 0) {
  24069. // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
  24070. a = a.diffAdd(b, c);
  24071. // N * Q = 2 * ((N / 2) * Q + Q))
  24072. b = b.dbl();
  24073. } else {
  24074. // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
  24075. b = a.diffAdd(b, c);
  24076. // N * Q + Q = 2 * ((N / 2) * Q + Q)
  24077. a = a.dbl();
  24078. }
  24079. }
  24080. return b;
  24081. };
  24082. Point.prototype.mulAdd = function mulAdd() {
  24083. throw new Error('Not supported on Montgomery curve');
  24084. };
  24085. Point.prototype.jumlAdd = function jumlAdd() {
  24086. throw new Error('Not supported on Montgomery curve');
  24087. };
  24088. Point.prototype.eq = function eq(other) {
  24089. return this.getX().cmp(other.getX()) === 0;
  24090. };
  24091. Point.prototype.normalize = function normalize() {
  24092. this.x = this.x.redMul(this.z.redInvm());
  24093. this.z = this.curve.one;
  24094. return this;
  24095. };
  24096. Point.prototype.getX = function getX() {
  24097. // Normalize coordinates
  24098. this.normalize();
  24099. return this.x.fromRed();
  24100. };
  24101. /***/ }),
  24102. /* 183 */
  24103. /*!*************************************************************!*\
  24104. !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
  24105. \*************************************************************/
  24106. /*! no static exports found */
  24107. /***/ (function(module, exports, __webpack_require__) {
  24108. "use strict";
  24109. var utils = __webpack_require__(/*! ../utils */ 177);
  24110. var BN = __webpack_require__(/*! bn.js */ 164);
  24111. var inherits = __webpack_require__(/*! inherits */ 88);
  24112. var Base = __webpack_require__(/*! ./base */ 180);
  24113. var assert = utils.assert;
  24114. function EdwardsCurve(conf) {
  24115. // NOTE: Important as we are creating point in Base.call()
  24116. this.twisted = (conf.a | 0) !== 1;
  24117. this.mOneA = this.twisted && (conf.a | 0) === -1;
  24118. this.extended = this.mOneA;
  24119. Base.call(this, 'edwards', conf);
  24120. this.a = new BN(conf.a, 16).umod(this.red.m);
  24121. this.a = this.a.toRed(this.red);
  24122. this.c = new BN(conf.c, 16).toRed(this.red);
  24123. this.c2 = this.c.redSqr();
  24124. this.d = new BN(conf.d, 16).toRed(this.red);
  24125. this.dd = this.d.redAdd(this.d);
  24126. assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
  24127. this.oneC = (conf.c | 0) === 1;
  24128. }
  24129. inherits(EdwardsCurve, Base);
  24130. module.exports = EdwardsCurve;
  24131. EdwardsCurve.prototype._mulA = function _mulA(num) {
  24132. if (this.mOneA)
  24133. return num.redNeg();
  24134. else
  24135. return this.a.redMul(num);
  24136. };
  24137. EdwardsCurve.prototype._mulC = function _mulC(num) {
  24138. if (this.oneC)
  24139. return num;
  24140. else
  24141. return this.c.redMul(num);
  24142. };
  24143. // Just for compatibility with Short curve
  24144. EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
  24145. return this.point(x, y, z, t);
  24146. };
  24147. EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
  24148. x = new BN(x, 16);
  24149. if (!x.red)
  24150. x = x.toRed(this.red);
  24151. var x2 = x.redSqr();
  24152. var rhs = this.c2.redSub(this.a.redMul(x2));
  24153. var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
  24154. var y2 = rhs.redMul(lhs.redInvm());
  24155. var y = y2.redSqrt();
  24156. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  24157. throw new Error('invalid point');
  24158. var isOdd = y.fromRed().isOdd();
  24159. if (odd && !isOdd || !odd && isOdd)
  24160. y = y.redNeg();
  24161. return this.point(x, y);
  24162. };
  24163. EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
  24164. y = new BN(y, 16);
  24165. if (!y.red)
  24166. y = y.toRed(this.red);
  24167. // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
  24168. var y2 = y.redSqr();
  24169. var lhs = y2.redSub(this.c2);
  24170. var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
  24171. var x2 = lhs.redMul(rhs.redInvm());
  24172. if (x2.cmp(this.zero) === 0) {
  24173. if (odd)
  24174. throw new Error('invalid point');
  24175. else
  24176. return this.point(this.zero, y);
  24177. }
  24178. var x = x2.redSqrt();
  24179. if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
  24180. throw new Error('invalid point');
  24181. if (x.fromRed().isOdd() !== odd)
  24182. x = x.redNeg();
  24183. return this.point(x, y);
  24184. };
  24185. EdwardsCurve.prototype.validate = function validate(point) {
  24186. if (point.isInfinity())
  24187. return true;
  24188. // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
  24189. point.normalize();
  24190. var x2 = point.x.redSqr();
  24191. var y2 = point.y.redSqr();
  24192. var lhs = x2.redMul(this.a).redAdd(y2);
  24193. var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
  24194. return lhs.cmp(rhs) === 0;
  24195. };
  24196. function Point(curve, x, y, z, t) {
  24197. Base.BasePoint.call(this, curve, 'projective');
  24198. if (x === null && y === null && z === null) {
  24199. this.x = this.curve.zero;
  24200. this.y = this.curve.one;
  24201. this.z = this.curve.one;
  24202. this.t = this.curve.zero;
  24203. this.zOne = true;
  24204. } else {
  24205. this.x = new BN(x, 16);
  24206. this.y = new BN(y, 16);
  24207. this.z = z ? new BN(z, 16) : this.curve.one;
  24208. this.t = t && new BN(t, 16);
  24209. if (!this.x.red)
  24210. this.x = this.x.toRed(this.curve.red);
  24211. if (!this.y.red)
  24212. this.y = this.y.toRed(this.curve.red);
  24213. if (!this.z.red)
  24214. this.z = this.z.toRed(this.curve.red);
  24215. if (this.t && !this.t.red)
  24216. this.t = this.t.toRed(this.curve.red);
  24217. this.zOne = this.z === this.curve.one;
  24218. // Use extended coordinates
  24219. if (this.curve.extended && !this.t) {
  24220. this.t = this.x.redMul(this.y);
  24221. if (!this.zOne)
  24222. this.t = this.t.redMul(this.z.redInvm());
  24223. }
  24224. }
  24225. }
  24226. inherits(Point, Base.BasePoint);
  24227. EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  24228. return Point.fromJSON(this, obj);
  24229. };
  24230. EdwardsCurve.prototype.point = function point(x, y, z, t) {
  24231. return new Point(this, x, y, z, t);
  24232. };
  24233. Point.fromJSON = function fromJSON(curve, obj) {
  24234. return new Point(curve, obj[0], obj[1], obj[2]);
  24235. };
  24236. Point.prototype.inspect = function inspect() {
  24237. if (this.isInfinity())
  24238. return '<EC Point Infinity>';
  24239. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  24240. ' y: ' + this.y.fromRed().toString(16, 2) +
  24241. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  24242. };
  24243. Point.prototype.isInfinity = function isInfinity() {
  24244. // XXX This code assumes that zero is always zero in red
  24245. return this.x.cmpn(0) === 0 &&
  24246. (this.y.cmp(this.z) === 0 ||
  24247. (this.zOne && this.y.cmp(this.curve.c) === 0));
  24248. };
  24249. Point.prototype._extDbl = function _extDbl() {
  24250. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24251. // #doubling-dbl-2008-hwcd
  24252. // 4M + 4S
  24253. // A = X1^2
  24254. var a = this.x.redSqr();
  24255. // B = Y1^2
  24256. var b = this.y.redSqr();
  24257. // C = 2 * Z1^2
  24258. var c = this.z.redSqr();
  24259. c = c.redIAdd(c);
  24260. // D = a * A
  24261. var d = this.curve._mulA(a);
  24262. // E = (X1 + Y1)^2 - A - B
  24263. var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
  24264. // G = D + B
  24265. var g = d.redAdd(b);
  24266. // F = G - C
  24267. var f = g.redSub(c);
  24268. // H = D - B
  24269. var h = d.redSub(b);
  24270. // X3 = E * F
  24271. var nx = e.redMul(f);
  24272. // Y3 = G * H
  24273. var ny = g.redMul(h);
  24274. // T3 = E * H
  24275. var nt = e.redMul(h);
  24276. // Z3 = F * G
  24277. var nz = f.redMul(g);
  24278. return this.curve.point(nx, ny, nz, nt);
  24279. };
  24280. Point.prototype._projDbl = function _projDbl() {
  24281. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24282. // #doubling-dbl-2008-bbjlp
  24283. // #doubling-dbl-2007-bl
  24284. // and others
  24285. // Generally 3M + 4S or 2M + 4S
  24286. // B = (X1 + Y1)^2
  24287. var b = this.x.redAdd(this.y).redSqr();
  24288. // C = X1^2
  24289. var c = this.x.redSqr();
  24290. // D = Y1^2
  24291. var d = this.y.redSqr();
  24292. var nx;
  24293. var ny;
  24294. var nz;
  24295. if (this.curve.twisted) {
  24296. // E = a * C
  24297. var e = this.curve._mulA(c);
  24298. // F = E + D
  24299. var f = e.redAdd(d);
  24300. if (this.zOne) {
  24301. // X3 = (B - C - D) * (F - 2)
  24302. nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
  24303. // Y3 = F * (E - D)
  24304. ny = f.redMul(e.redSub(d));
  24305. // Z3 = F^2 - 2 * F
  24306. nz = f.redSqr().redSub(f).redSub(f);
  24307. } else {
  24308. // H = Z1^2
  24309. var h = this.z.redSqr();
  24310. // J = F - 2 * H
  24311. var j = f.redSub(h).redISub(h);
  24312. // X3 = (B-C-D)*J
  24313. nx = b.redSub(c).redISub(d).redMul(j);
  24314. // Y3 = F * (E - D)
  24315. ny = f.redMul(e.redSub(d));
  24316. // Z3 = F * J
  24317. nz = f.redMul(j);
  24318. }
  24319. } else {
  24320. // E = C + D
  24321. var e = c.redAdd(d);
  24322. // H = (c * Z1)^2
  24323. var h = this.curve._mulC(this.z).redSqr();
  24324. // J = E - 2 * H
  24325. var j = e.redSub(h).redSub(h);
  24326. // X3 = c * (B - E) * J
  24327. nx = this.curve._mulC(b.redISub(e)).redMul(j);
  24328. // Y3 = c * E * (C - D)
  24329. ny = this.curve._mulC(e).redMul(c.redISub(d));
  24330. // Z3 = E * J
  24331. nz = e.redMul(j);
  24332. }
  24333. return this.curve.point(nx, ny, nz);
  24334. };
  24335. Point.prototype.dbl = function dbl() {
  24336. if (this.isInfinity())
  24337. return this;
  24338. // Double in extended coordinates
  24339. if (this.curve.extended)
  24340. return this._extDbl();
  24341. else
  24342. return this._projDbl();
  24343. };
  24344. Point.prototype._extAdd = function _extAdd(p) {
  24345. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24346. // #addition-add-2008-hwcd-3
  24347. // 8M
  24348. // A = (Y1 - X1) * (Y2 - X2)
  24349. var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
  24350. // B = (Y1 + X1) * (Y2 + X2)
  24351. var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
  24352. // C = T1 * k * T2
  24353. var c = this.t.redMul(this.curve.dd).redMul(p.t);
  24354. // D = Z1 * 2 * Z2
  24355. var d = this.z.redMul(p.z.redAdd(p.z));
  24356. // E = B - A
  24357. var e = b.redSub(a);
  24358. // F = D - C
  24359. var f = d.redSub(c);
  24360. // G = D + C
  24361. var g = d.redAdd(c);
  24362. // H = B + A
  24363. var h = b.redAdd(a);
  24364. // X3 = E * F
  24365. var nx = e.redMul(f);
  24366. // Y3 = G * H
  24367. var ny = g.redMul(h);
  24368. // T3 = E * H
  24369. var nt = e.redMul(h);
  24370. // Z3 = F * G
  24371. var nz = f.redMul(g);
  24372. return this.curve.point(nx, ny, nz, nt);
  24373. };
  24374. Point.prototype._projAdd = function _projAdd(p) {
  24375. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24376. // #addition-add-2008-bbjlp
  24377. // #addition-add-2007-bl
  24378. // 10M + 1S
  24379. // A = Z1 * Z2
  24380. var a = this.z.redMul(p.z);
  24381. // B = A^2
  24382. var b = a.redSqr();
  24383. // C = X1 * X2
  24384. var c = this.x.redMul(p.x);
  24385. // D = Y1 * Y2
  24386. var d = this.y.redMul(p.y);
  24387. // E = d * C * D
  24388. var e = this.curve.d.redMul(c).redMul(d);
  24389. // F = B - E
  24390. var f = b.redSub(e);
  24391. // G = B + E
  24392. var g = b.redAdd(e);
  24393. // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
  24394. var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
  24395. var nx = a.redMul(f).redMul(tmp);
  24396. var ny;
  24397. var nz;
  24398. if (this.curve.twisted) {
  24399. // Y3 = A * G * (D - a * C)
  24400. ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
  24401. // Z3 = F * G
  24402. nz = f.redMul(g);
  24403. } else {
  24404. // Y3 = A * G * (D - C)
  24405. ny = a.redMul(g).redMul(d.redSub(c));
  24406. // Z3 = c * F * G
  24407. nz = this.curve._mulC(f).redMul(g);
  24408. }
  24409. return this.curve.point(nx, ny, nz);
  24410. };
  24411. Point.prototype.add = function add(p) {
  24412. if (this.isInfinity())
  24413. return p;
  24414. if (p.isInfinity())
  24415. return this;
  24416. if (this.curve.extended)
  24417. return this._extAdd(p);
  24418. else
  24419. return this._projAdd(p);
  24420. };
  24421. Point.prototype.mul = function mul(k) {
  24422. if (this._hasDoubles(k))
  24423. return this.curve._fixedNafMul(this, k);
  24424. else
  24425. return this.curve._wnafMul(this, k);
  24426. };
  24427. Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
  24428. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
  24429. };
  24430. Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
  24431. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
  24432. };
  24433. Point.prototype.normalize = function normalize() {
  24434. if (this.zOne)
  24435. return this;
  24436. // Normalize coordinates
  24437. var zi = this.z.redInvm();
  24438. this.x = this.x.redMul(zi);
  24439. this.y = this.y.redMul(zi);
  24440. if (this.t)
  24441. this.t = this.t.redMul(zi);
  24442. this.z = this.curve.one;
  24443. this.zOne = true;
  24444. return this;
  24445. };
  24446. Point.prototype.neg = function neg() {
  24447. return this.curve.point(this.x.redNeg(),
  24448. this.y,
  24449. this.z,
  24450. this.t && this.t.redNeg());
  24451. };
  24452. Point.prototype.getX = function getX() {
  24453. this.normalize();
  24454. return this.x.fromRed();
  24455. };
  24456. Point.prototype.getY = function getY() {
  24457. this.normalize();
  24458. return this.y.fromRed();
  24459. };
  24460. Point.prototype.eq = function eq(other) {
  24461. return this === other ||
  24462. this.getX().cmp(other.getX()) === 0 &&
  24463. this.getY().cmp(other.getY()) === 0;
  24464. };
  24465. Point.prototype.eqXToP = function eqXToP(x) {
  24466. var rx = x.toRed(this.curve.red).redMul(this.z);
  24467. if (this.x.cmp(rx) === 0)
  24468. return true;
  24469. var xc = x.clone();
  24470. var t = this.curve.redN.redMul(this.z);
  24471. for (;;) {
  24472. xc.iadd(this.curve.n);
  24473. if (xc.cmp(this.curve.p) >= 0)
  24474. return false;
  24475. rx.redIAdd(t);
  24476. if (this.x.cmp(rx) === 0)
  24477. return true;
  24478. }
  24479. };
  24480. // Compatibility with BaseCurve
  24481. Point.prototype.toP = Point.prototype.normalize;
  24482. Point.prototype.mixedAdd = Point.prototype.add;
  24483. /***/ }),
  24484. /* 184 */
  24485. /*!******************************************************!*\
  24486. !*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
  24487. \******************************************************/
  24488. /*! no static exports found */
  24489. /***/ (function(module, exports, __webpack_require__) {
  24490. "use strict";
  24491. var curves = exports;
  24492. var hash = __webpack_require__(/*! hash.js */ 185);
  24493. var curve = __webpack_require__(/*! ./curve */ 179);
  24494. var utils = __webpack_require__(/*! ./utils */ 177);
  24495. var assert = utils.assert;
  24496. function PresetCurve(options) {
  24497. if (options.type === 'short')
  24498. this.curve = new curve.short(options);
  24499. else if (options.type === 'edwards')
  24500. this.curve = new curve.edwards(options);
  24501. else
  24502. this.curve = new curve.mont(options);
  24503. this.g = this.curve.g;
  24504. this.n = this.curve.n;
  24505. this.hash = options.hash;
  24506. assert(this.g.validate(), 'Invalid curve');
  24507. assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
  24508. }
  24509. curves.PresetCurve = PresetCurve;
  24510. function defineCurve(name, options) {
  24511. Object.defineProperty(curves, name, {
  24512. configurable: true,
  24513. enumerable: true,
  24514. get: function() {
  24515. var curve = new PresetCurve(options);
  24516. Object.defineProperty(curves, name, {
  24517. configurable: true,
  24518. enumerable: true,
  24519. value: curve
  24520. });
  24521. return curve;
  24522. }
  24523. });
  24524. }
  24525. defineCurve('p192', {
  24526. type: 'short',
  24527. prime: 'p192',
  24528. p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
  24529. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
  24530. b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
  24531. n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
  24532. hash: hash.sha256,
  24533. gRed: false,
  24534. g: [
  24535. '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
  24536. '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
  24537. ]
  24538. });
  24539. defineCurve('p224', {
  24540. type: 'short',
  24541. prime: 'p224',
  24542. p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
  24543. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
  24544. b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
  24545. n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
  24546. hash: hash.sha256,
  24547. gRed: false,
  24548. g: [
  24549. 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
  24550. 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
  24551. ]
  24552. });
  24553. defineCurve('p256', {
  24554. type: 'short',
  24555. prime: null,
  24556. p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
  24557. a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
  24558. b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
  24559. n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
  24560. hash: hash.sha256,
  24561. gRed: false,
  24562. g: [
  24563. '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
  24564. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
  24565. ]
  24566. });
  24567. defineCurve('p384', {
  24568. type: 'short',
  24569. prime: null,
  24570. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24571. 'fffffffe ffffffff 00000000 00000000 ffffffff',
  24572. a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24573. 'fffffffe ffffffff 00000000 00000000 fffffffc',
  24574. b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
  24575. '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
  24576. n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
  24577. 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
  24578. hash: hash.sha384,
  24579. gRed: false,
  24580. g: [
  24581. 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
  24582. '5502f25d bf55296c 3a545e38 72760ab7',
  24583. '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
  24584. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
  24585. ]
  24586. });
  24587. defineCurve('p521', {
  24588. type: 'short',
  24589. prime: null,
  24590. p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24591. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24592. 'ffffffff ffffffff ffffffff ffffffff ffffffff',
  24593. a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24594. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24595. 'ffffffff ffffffff ffffffff ffffffff fffffffc',
  24596. b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
  24597. '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
  24598. '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
  24599. n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24600. 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
  24601. 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
  24602. hash: hash.sha512,
  24603. gRed: false,
  24604. g: [
  24605. '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
  24606. '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
  24607. 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
  24608. '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
  24609. '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
  24610. '3fad0761 353c7086 a272c240 88be9476 9fd16650'
  24611. ]
  24612. });
  24613. defineCurve('curve25519', {
  24614. type: 'mont',
  24615. prime: 'p25519',
  24616. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24617. a: '76d06',
  24618. b: '1',
  24619. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24620. hash: hash.sha256,
  24621. gRed: false,
  24622. g: [
  24623. '9'
  24624. ]
  24625. });
  24626. defineCurve('ed25519', {
  24627. type: 'edwards',
  24628. prime: 'p25519',
  24629. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24630. a: '-1',
  24631. c: '1',
  24632. // -121665 * (121666^(-1)) (mod P)
  24633. d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
  24634. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24635. hash: hash.sha256,
  24636. gRed: false,
  24637. g: [
  24638. '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
  24639. // 4/5
  24640. '6666666666666666666666666666666666666666666666666666666666666658'
  24641. ]
  24642. });
  24643. var pre;
  24644. try {
  24645. pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 197);
  24646. } catch (e) {
  24647. pre = undefined;
  24648. }
  24649. defineCurve('secp256k1', {
  24650. type: 'short',
  24651. prime: 'k256',
  24652. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
  24653. a: '0',
  24654. b: '7',
  24655. n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
  24656. h: '1',
  24657. hash: hash.sha256,
  24658. // Precomputed endomorphism
  24659. beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
  24660. lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
  24661. basis: [
  24662. {
  24663. a: '3086d221a7d46bcde86c90e49284eb15',
  24664. b: '-e4437ed6010e88286f547fa90abfe4c3'
  24665. },
  24666. {
  24667. a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
  24668. b: '3086d221a7d46bcde86c90e49284eb15'
  24669. }
  24670. ],
  24671. gRed: false,
  24672. g: [
  24673. '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  24674. '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
  24675. pre
  24676. ]
  24677. });
  24678. /***/ }),
  24679. /* 185 */
  24680. /*!******************************************!*\
  24681. !*** ./node_modules/hash.js/lib/hash.js ***!
  24682. \******************************************/
  24683. /*! no static exports found */
  24684. /***/ (function(module, exports, __webpack_require__) {
  24685. var hash = exports;
  24686. hash.utils = __webpack_require__(/*! ./hash/utils */ 186);
  24687. hash.common = __webpack_require__(/*! ./hash/common */ 187);
  24688. hash.sha = __webpack_require__(/*! ./hash/sha */ 188);
  24689. hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 195);
  24690. hash.hmac = __webpack_require__(/*! ./hash/hmac */ 196);
  24691. // Proxy hash functions to the main object
  24692. hash.sha1 = hash.sha.sha1;
  24693. hash.sha256 = hash.sha.sha256;
  24694. hash.sha224 = hash.sha.sha224;
  24695. hash.sha384 = hash.sha.sha384;
  24696. hash.sha512 = hash.sha.sha512;
  24697. hash.ripemd160 = hash.ripemd.ripemd160;
  24698. /***/ }),
  24699. /* 186 */
  24700. /*!************************************************!*\
  24701. !*** ./node_modules/hash.js/lib/hash/utils.js ***!
  24702. \************************************************/
  24703. /*! no static exports found */
  24704. /***/ (function(module, exports, __webpack_require__) {
  24705. "use strict";
  24706. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  24707. var inherits = __webpack_require__(/*! inherits */ 88);
  24708. exports.inherits = inherits;
  24709. function isSurrogatePair(msg, i) {
  24710. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  24711. return false;
  24712. }
  24713. if (i < 0 || i + 1 >= msg.length) {
  24714. return false;
  24715. }
  24716. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  24717. }
  24718. function toArray(msg, enc) {
  24719. if (Array.isArray(msg))
  24720. return msg.slice();
  24721. if (!msg)
  24722. return [];
  24723. var res = [];
  24724. if (typeof msg === 'string') {
  24725. if (!enc) {
  24726. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  24727. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  24728. // Apache License 2.0
  24729. // https://github.com/google/closure-library/blob/master/LICENSE
  24730. var p = 0;
  24731. for (var i = 0; i < msg.length; i++) {
  24732. var c = msg.charCodeAt(i);
  24733. if (c < 128) {
  24734. res[p++] = c;
  24735. } else if (c < 2048) {
  24736. res[p++] = (c >> 6) | 192;
  24737. res[p++] = (c & 63) | 128;
  24738. } else if (isSurrogatePair(msg, i)) {
  24739. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  24740. res[p++] = (c >> 18) | 240;
  24741. res[p++] = ((c >> 12) & 63) | 128;
  24742. res[p++] = ((c >> 6) & 63) | 128;
  24743. res[p++] = (c & 63) | 128;
  24744. } else {
  24745. res[p++] = (c >> 12) | 224;
  24746. res[p++] = ((c >> 6) & 63) | 128;
  24747. res[p++] = (c & 63) | 128;
  24748. }
  24749. }
  24750. } else if (enc === 'hex') {
  24751. msg = msg.replace(/[^a-z0-9]+/ig, '');
  24752. if (msg.length % 2 !== 0)
  24753. msg = '0' + msg;
  24754. for (i = 0; i < msg.length; i += 2)
  24755. res.push(parseInt(msg[i] + msg[i + 1], 16));
  24756. }
  24757. } else {
  24758. for (i = 0; i < msg.length; i++)
  24759. res[i] = msg[i] | 0;
  24760. }
  24761. return res;
  24762. }
  24763. exports.toArray = toArray;
  24764. function toHex(msg) {
  24765. var res = '';
  24766. for (var i = 0; i < msg.length; i++)
  24767. res += zero2(msg[i].toString(16));
  24768. return res;
  24769. }
  24770. exports.toHex = toHex;
  24771. function htonl(w) {
  24772. var res = (w >>> 24) |
  24773. ((w >>> 8) & 0xff00) |
  24774. ((w << 8) & 0xff0000) |
  24775. ((w & 0xff) << 24);
  24776. return res >>> 0;
  24777. }
  24778. exports.htonl = htonl;
  24779. function toHex32(msg, endian) {
  24780. var res = '';
  24781. for (var i = 0; i < msg.length; i++) {
  24782. var w = msg[i];
  24783. if (endian === 'little')
  24784. w = htonl(w);
  24785. res += zero8(w.toString(16));
  24786. }
  24787. return res;
  24788. }
  24789. exports.toHex32 = toHex32;
  24790. function zero2(word) {
  24791. if (word.length === 1)
  24792. return '0' + word;
  24793. else
  24794. return word;
  24795. }
  24796. exports.zero2 = zero2;
  24797. function zero8(word) {
  24798. if (word.length === 7)
  24799. return '0' + word;
  24800. else if (word.length === 6)
  24801. return '00' + word;
  24802. else if (word.length === 5)
  24803. return '000' + word;
  24804. else if (word.length === 4)
  24805. return '0000' + word;
  24806. else if (word.length === 3)
  24807. return '00000' + word;
  24808. else if (word.length === 2)
  24809. return '000000' + word;
  24810. else if (word.length === 1)
  24811. return '0000000' + word;
  24812. else
  24813. return word;
  24814. }
  24815. exports.zero8 = zero8;
  24816. function join32(msg, start, end, endian) {
  24817. var len = end - start;
  24818. assert(len % 4 === 0);
  24819. var res = new Array(len / 4);
  24820. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  24821. var w;
  24822. if (endian === 'big')
  24823. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  24824. else
  24825. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  24826. res[i] = w >>> 0;
  24827. }
  24828. return res;
  24829. }
  24830. exports.join32 = join32;
  24831. function split32(msg, endian) {
  24832. var res = new Array(msg.length * 4);
  24833. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  24834. var m = msg[i];
  24835. if (endian === 'big') {
  24836. res[k] = m >>> 24;
  24837. res[k + 1] = (m >>> 16) & 0xff;
  24838. res[k + 2] = (m >>> 8) & 0xff;
  24839. res[k + 3] = m & 0xff;
  24840. } else {
  24841. res[k + 3] = m >>> 24;
  24842. res[k + 2] = (m >>> 16) & 0xff;
  24843. res[k + 1] = (m >>> 8) & 0xff;
  24844. res[k] = m & 0xff;
  24845. }
  24846. }
  24847. return res;
  24848. }
  24849. exports.split32 = split32;
  24850. function rotr32(w, b) {
  24851. return (w >>> b) | (w << (32 - b));
  24852. }
  24853. exports.rotr32 = rotr32;
  24854. function rotl32(w, b) {
  24855. return (w << b) | (w >>> (32 - b));
  24856. }
  24857. exports.rotl32 = rotl32;
  24858. function sum32(a, b) {
  24859. return (a + b) >>> 0;
  24860. }
  24861. exports.sum32 = sum32;
  24862. function sum32_3(a, b, c) {
  24863. return (a + b + c) >>> 0;
  24864. }
  24865. exports.sum32_3 = sum32_3;
  24866. function sum32_4(a, b, c, d) {
  24867. return (a + b + c + d) >>> 0;
  24868. }
  24869. exports.sum32_4 = sum32_4;
  24870. function sum32_5(a, b, c, d, e) {
  24871. return (a + b + c + d + e) >>> 0;
  24872. }
  24873. exports.sum32_5 = sum32_5;
  24874. function sum64(buf, pos, ah, al) {
  24875. var bh = buf[pos];
  24876. var bl = buf[pos + 1];
  24877. var lo = (al + bl) >>> 0;
  24878. var hi = (lo < al ? 1 : 0) + ah + bh;
  24879. buf[pos] = hi >>> 0;
  24880. buf[pos + 1] = lo;
  24881. }
  24882. exports.sum64 = sum64;
  24883. function sum64_hi(ah, al, bh, bl) {
  24884. var lo = (al + bl) >>> 0;
  24885. var hi = (lo < al ? 1 : 0) + ah + bh;
  24886. return hi >>> 0;
  24887. }
  24888. exports.sum64_hi = sum64_hi;
  24889. function sum64_lo(ah, al, bh, bl) {
  24890. var lo = al + bl;
  24891. return lo >>> 0;
  24892. }
  24893. exports.sum64_lo = sum64_lo;
  24894. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  24895. var carry = 0;
  24896. var lo = al;
  24897. lo = (lo + bl) >>> 0;
  24898. carry += lo < al ? 1 : 0;
  24899. lo = (lo + cl) >>> 0;
  24900. carry += lo < cl ? 1 : 0;
  24901. lo = (lo + dl) >>> 0;
  24902. carry += lo < dl ? 1 : 0;
  24903. var hi = ah + bh + ch + dh + carry;
  24904. return hi >>> 0;
  24905. }
  24906. exports.sum64_4_hi = sum64_4_hi;
  24907. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  24908. var lo = al + bl + cl + dl;
  24909. return lo >>> 0;
  24910. }
  24911. exports.sum64_4_lo = sum64_4_lo;
  24912. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24913. var carry = 0;
  24914. var lo = al;
  24915. lo = (lo + bl) >>> 0;
  24916. carry += lo < al ? 1 : 0;
  24917. lo = (lo + cl) >>> 0;
  24918. carry += lo < cl ? 1 : 0;
  24919. lo = (lo + dl) >>> 0;
  24920. carry += lo < dl ? 1 : 0;
  24921. lo = (lo + el) >>> 0;
  24922. carry += lo < el ? 1 : 0;
  24923. var hi = ah + bh + ch + dh + eh + carry;
  24924. return hi >>> 0;
  24925. }
  24926. exports.sum64_5_hi = sum64_5_hi;
  24927. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24928. var lo = al + bl + cl + dl + el;
  24929. return lo >>> 0;
  24930. }
  24931. exports.sum64_5_lo = sum64_5_lo;
  24932. function rotr64_hi(ah, al, num) {
  24933. var r = (al << (32 - num)) | (ah >>> num);
  24934. return r >>> 0;
  24935. }
  24936. exports.rotr64_hi = rotr64_hi;
  24937. function rotr64_lo(ah, al, num) {
  24938. var r = (ah << (32 - num)) | (al >>> num);
  24939. return r >>> 0;
  24940. }
  24941. exports.rotr64_lo = rotr64_lo;
  24942. function shr64_hi(ah, al, num) {
  24943. return ah >>> num;
  24944. }
  24945. exports.shr64_hi = shr64_hi;
  24946. function shr64_lo(ah, al, num) {
  24947. var r = (ah << (32 - num)) | (al >>> num);
  24948. return r >>> 0;
  24949. }
  24950. exports.shr64_lo = shr64_lo;
  24951. /***/ }),
  24952. /* 187 */
  24953. /*!*************************************************!*\
  24954. !*** ./node_modules/hash.js/lib/hash/common.js ***!
  24955. \*************************************************/
  24956. /*! no static exports found */
  24957. /***/ (function(module, exports, __webpack_require__) {
  24958. "use strict";
  24959. var utils = __webpack_require__(/*! ./utils */ 186);
  24960. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  24961. function BlockHash() {
  24962. this.pending = null;
  24963. this.pendingTotal = 0;
  24964. this.blockSize = this.constructor.blockSize;
  24965. this.outSize = this.constructor.outSize;
  24966. this.hmacStrength = this.constructor.hmacStrength;
  24967. this.padLength = this.constructor.padLength / 8;
  24968. this.endian = 'big';
  24969. this._delta8 = this.blockSize / 8;
  24970. this._delta32 = this.blockSize / 32;
  24971. }
  24972. exports.BlockHash = BlockHash;
  24973. BlockHash.prototype.update = function update(msg, enc) {
  24974. // Convert message to array, pad it, and join into 32bit blocks
  24975. msg = utils.toArray(msg, enc);
  24976. if (!this.pending)
  24977. this.pending = msg;
  24978. else
  24979. this.pending = this.pending.concat(msg);
  24980. this.pendingTotal += msg.length;
  24981. // Enough data, try updating
  24982. if (this.pending.length >= this._delta8) {
  24983. msg = this.pending;
  24984. // Process pending data in blocks
  24985. var r = msg.length % this._delta8;
  24986. this.pending = msg.slice(msg.length - r, msg.length);
  24987. if (this.pending.length === 0)
  24988. this.pending = null;
  24989. msg = utils.join32(msg, 0, msg.length - r, this.endian);
  24990. for (var i = 0; i < msg.length; i += this._delta32)
  24991. this._update(msg, i, i + this._delta32);
  24992. }
  24993. return this;
  24994. };
  24995. BlockHash.prototype.digest = function digest(enc) {
  24996. this.update(this._pad());
  24997. assert(this.pending === null);
  24998. return this._digest(enc);
  24999. };
  25000. BlockHash.prototype._pad = function pad() {
  25001. var len = this.pendingTotal;
  25002. var bytes = this._delta8;
  25003. var k = bytes - ((len + this.padLength) % bytes);
  25004. var res = new Array(k + this.padLength);
  25005. res[0] = 0x80;
  25006. for (var i = 1; i < k; i++)
  25007. res[i] = 0;
  25008. // Append length
  25009. len <<= 3;
  25010. if (this.endian === 'big') {
  25011. for (var t = 8; t < this.padLength; t++)
  25012. res[i++] = 0;
  25013. res[i++] = 0;
  25014. res[i++] = 0;
  25015. res[i++] = 0;
  25016. res[i++] = 0;
  25017. res[i++] = (len >>> 24) & 0xff;
  25018. res[i++] = (len >>> 16) & 0xff;
  25019. res[i++] = (len >>> 8) & 0xff;
  25020. res[i++] = len & 0xff;
  25021. } else {
  25022. res[i++] = len & 0xff;
  25023. res[i++] = (len >>> 8) & 0xff;
  25024. res[i++] = (len >>> 16) & 0xff;
  25025. res[i++] = (len >>> 24) & 0xff;
  25026. res[i++] = 0;
  25027. res[i++] = 0;
  25028. res[i++] = 0;
  25029. res[i++] = 0;
  25030. for (t = 8; t < this.padLength; t++)
  25031. res[i++] = 0;
  25032. }
  25033. return res;
  25034. };
  25035. /***/ }),
  25036. /* 188 */
  25037. /*!**********************************************!*\
  25038. !*** ./node_modules/hash.js/lib/hash/sha.js ***!
  25039. \**********************************************/
  25040. /*! no static exports found */
  25041. /***/ (function(module, exports, __webpack_require__) {
  25042. "use strict";
  25043. exports.sha1 = __webpack_require__(/*! ./sha/1 */ 189);
  25044. exports.sha224 = __webpack_require__(/*! ./sha/224 */ 191);
  25045. exports.sha256 = __webpack_require__(/*! ./sha/256 */ 192);
  25046. exports.sha384 = __webpack_require__(/*! ./sha/384 */ 193);
  25047. exports.sha512 = __webpack_require__(/*! ./sha/512 */ 194);
  25048. /***/ }),
  25049. /* 189 */
  25050. /*!************************************************!*\
  25051. !*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
  25052. \************************************************/
  25053. /*! no static exports found */
  25054. /***/ (function(module, exports, __webpack_require__) {
  25055. "use strict";
  25056. var utils = __webpack_require__(/*! ../utils */ 186);
  25057. var common = __webpack_require__(/*! ../common */ 187);
  25058. var shaCommon = __webpack_require__(/*! ./common */ 190);
  25059. var rotl32 = utils.rotl32;
  25060. var sum32 = utils.sum32;
  25061. var sum32_5 = utils.sum32_5;
  25062. var ft_1 = shaCommon.ft_1;
  25063. var BlockHash = common.BlockHash;
  25064. var sha1_K = [
  25065. 0x5A827999, 0x6ED9EBA1,
  25066. 0x8F1BBCDC, 0xCA62C1D6
  25067. ];
  25068. function SHA1() {
  25069. if (!(this instanceof SHA1))
  25070. return new SHA1();
  25071. BlockHash.call(this);
  25072. this.h = [
  25073. 0x67452301, 0xefcdab89, 0x98badcfe,
  25074. 0x10325476, 0xc3d2e1f0 ];
  25075. this.W = new Array(80);
  25076. }
  25077. utils.inherits(SHA1, BlockHash);
  25078. module.exports = SHA1;
  25079. SHA1.blockSize = 512;
  25080. SHA1.outSize = 160;
  25081. SHA1.hmacStrength = 80;
  25082. SHA1.padLength = 64;
  25083. SHA1.prototype._update = function _update(msg, start) {
  25084. var W = this.W;
  25085. for (var i = 0; i < 16; i++)
  25086. W[i] = msg[start + i];
  25087. for(; i < W.length; i++)
  25088. W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
  25089. var a = this.h[0];
  25090. var b = this.h[1];
  25091. var c = this.h[2];
  25092. var d = this.h[3];
  25093. var e = this.h[4];
  25094. for (i = 0; i < W.length; i++) {
  25095. var s = ~~(i / 20);
  25096. var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
  25097. e = d;
  25098. d = c;
  25099. c = rotl32(b, 30);
  25100. b = a;
  25101. a = t;
  25102. }
  25103. this.h[0] = sum32(this.h[0], a);
  25104. this.h[1] = sum32(this.h[1], b);
  25105. this.h[2] = sum32(this.h[2], c);
  25106. this.h[3] = sum32(this.h[3], d);
  25107. this.h[4] = sum32(this.h[4], e);
  25108. };
  25109. SHA1.prototype._digest = function digest(enc) {
  25110. if (enc === 'hex')
  25111. return utils.toHex32(this.h, 'big');
  25112. else
  25113. return utils.split32(this.h, 'big');
  25114. };
  25115. /***/ }),
  25116. /* 190 */
  25117. /*!*****************************************************!*\
  25118. !*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
  25119. \*****************************************************/
  25120. /*! no static exports found */
  25121. /***/ (function(module, exports, __webpack_require__) {
  25122. "use strict";
  25123. var utils = __webpack_require__(/*! ../utils */ 186);
  25124. var rotr32 = utils.rotr32;
  25125. function ft_1(s, x, y, z) {
  25126. if (s === 0)
  25127. return ch32(x, y, z);
  25128. if (s === 1 || s === 3)
  25129. return p32(x, y, z);
  25130. if (s === 2)
  25131. return maj32(x, y, z);
  25132. }
  25133. exports.ft_1 = ft_1;
  25134. function ch32(x, y, z) {
  25135. return (x & y) ^ ((~x) & z);
  25136. }
  25137. exports.ch32 = ch32;
  25138. function maj32(x, y, z) {
  25139. return (x & y) ^ (x & z) ^ (y & z);
  25140. }
  25141. exports.maj32 = maj32;
  25142. function p32(x, y, z) {
  25143. return x ^ y ^ z;
  25144. }
  25145. exports.p32 = p32;
  25146. function s0_256(x) {
  25147. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  25148. }
  25149. exports.s0_256 = s0_256;
  25150. function s1_256(x) {
  25151. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  25152. }
  25153. exports.s1_256 = s1_256;
  25154. function g0_256(x) {
  25155. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  25156. }
  25157. exports.g0_256 = g0_256;
  25158. function g1_256(x) {
  25159. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  25160. }
  25161. exports.g1_256 = g1_256;
  25162. /***/ }),
  25163. /* 191 */
  25164. /*!**************************************************!*\
  25165. !*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
  25166. \**************************************************/
  25167. /*! no static exports found */
  25168. /***/ (function(module, exports, __webpack_require__) {
  25169. "use strict";
  25170. var utils = __webpack_require__(/*! ../utils */ 186);
  25171. var SHA256 = __webpack_require__(/*! ./256 */ 192);
  25172. function SHA224() {
  25173. if (!(this instanceof SHA224))
  25174. return new SHA224();
  25175. SHA256.call(this);
  25176. this.h = [
  25177. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  25178. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
  25179. }
  25180. utils.inherits(SHA224, SHA256);
  25181. module.exports = SHA224;
  25182. SHA224.blockSize = 512;
  25183. SHA224.outSize = 224;
  25184. SHA224.hmacStrength = 192;
  25185. SHA224.padLength = 64;
  25186. SHA224.prototype._digest = function digest(enc) {
  25187. // Just truncate output
  25188. if (enc === 'hex')
  25189. return utils.toHex32(this.h.slice(0, 7), 'big');
  25190. else
  25191. return utils.split32(this.h.slice(0, 7), 'big');
  25192. };
  25193. /***/ }),
  25194. /* 192 */
  25195. /*!**************************************************!*\
  25196. !*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
  25197. \**************************************************/
  25198. /*! no static exports found */
  25199. /***/ (function(module, exports, __webpack_require__) {
  25200. "use strict";
  25201. var utils = __webpack_require__(/*! ../utils */ 186);
  25202. var common = __webpack_require__(/*! ../common */ 187);
  25203. var shaCommon = __webpack_require__(/*! ./common */ 190);
  25204. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  25205. var sum32 = utils.sum32;
  25206. var sum32_4 = utils.sum32_4;
  25207. var sum32_5 = utils.sum32_5;
  25208. var ch32 = shaCommon.ch32;
  25209. var maj32 = shaCommon.maj32;
  25210. var s0_256 = shaCommon.s0_256;
  25211. var s1_256 = shaCommon.s1_256;
  25212. var g0_256 = shaCommon.g0_256;
  25213. var g1_256 = shaCommon.g1_256;
  25214. var BlockHash = common.BlockHash;
  25215. var sha256_K = [
  25216. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  25217. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  25218. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  25219. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  25220. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  25221. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  25222. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  25223. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  25224. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  25225. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  25226. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  25227. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  25228. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  25229. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  25230. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  25231. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  25232. ];
  25233. function SHA256() {
  25234. if (!(this instanceof SHA256))
  25235. return new SHA256();
  25236. BlockHash.call(this);
  25237. this.h = [
  25238. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  25239. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  25240. ];
  25241. this.k = sha256_K;
  25242. this.W = new Array(64);
  25243. }
  25244. utils.inherits(SHA256, BlockHash);
  25245. module.exports = SHA256;
  25246. SHA256.blockSize = 512;
  25247. SHA256.outSize = 256;
  25248. SHA256.hmacStrength = 192;
  25249. SHA256.padLength = 64;
  25250. SHA256.prototype._update = function _update(msg, start) {
  25251. var W = this.W;
  25252. for (var i = 0; i < 16; i++)
  25253. W[i] = msg[start + i];
  25254. for (; i < W.length; i++)
  25255. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  25256. var a = this.h[0];
  25257. var b = this.h[1];
  25258. var c = this.h[2];
  25259. var d = this.h[3];
  25260. var e = this.h[4];
  25261. var f = this.h[5];
  25262. var g = this.h[6];
  25263. var h = this.h[7];
  25264. assert(this.k.length === W.length);
  25265. for (i = 0; i < W.length; i++) {
  25266. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  25267. var T2 = sum32(s0_256(a), maj32(a, b, c));
  25268. h = g;
  25269. g = f;
  25270. f = e;
  25271. e = sum32(d, T1);
  25272. d = c;
  25273. c = b;
  25274. b = a;
  25275. a = sum32(T1, T2);
  25276. }
  25277. this.h[0] = sum32(this.h[0], a);
  25278. this.h[1] = sum32(this.h[1], b);
  25279. this.h[2] = sum32(this.h[2], c);
  25280. this.h[3] = sum32(this.h[3], d);
  25281. this.h[4] = sum32(this.h[4], e);
  25282. this.h[5] = sum32(this.h[5], f);
  25283. this.h[6] = sum32(this.h[6], g);
  25284. this.h[7] = sum32(this.h[7], h);
  25285. };
  25286. SHA256.prototype._digest = function digest(enc) {
  25287. if (enc === 'hex')
  25288. return utils.toHex32(this.h, 'big');
  25289. else
  25290. return utils.split32(this.h, 'big');
  25291. };
  25292. /***/ }),
  25293. /* 193 */
  25294. /*!**************************************************!*\
  25295. !*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
  25296. \**************************************************/
  25297. /*! no static exports found */
  25298. /***/ (function(module, exports, __webpack_require__) {
  25299. "use strict";
  25300. var utils = __webpack_require__(/*! ../utils */ 186);
  25301. var SHA512 = __webpack_require__(/*! ./512 */ 194);
  25302. function SHA384() {
  25303. if (!(this instanceof SHA384))
  25304. return new SHA384();
  25305. SHA512.call(this);
  25306. this.h = [
  25307. 0xcbbb9d5d, 0xc1059ed8,
  25308. 0x629a292a, 0x367cd507,
  25309. 0x9159015a, 0x3070dd17,
  25310. 0x152fecd8, 0xf70e5939,
  25311. 0x67332667, 0xffc00b31,
  25312. 0x8eb44a87, 0x68581511,
  25313. 0xdb0c2e0d, 0x64f98fa7,
  25314. 0x47b5481d, 0xbefa4fa4 ];
  25315. }
  25316. utils.inherits(SHA384, SHA512);
  25317. module.exports = SHA384;
  25318. SHA384.blockSize = 1024;
  25319. SHA384.outSize = 384;
  25320. SHA384.hmacStrength = 192;
  25321. SHA384.padLength = 128;
  25322. SHA384.prototype._digest = function digest(enc) {
  25323. if (enc === 'hex')
  25324. return utils.toHex32(this.h.slice(0, 12), 'big');
  25325. else
  25326. return utils.split32(this.h.slice(0, 12), 'big');
  25327. };
  25328. /***/ }),
  25329. /* 194 */
  25330. /*!**************************************************!*\
  25331. !*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
  25332. \**************************************************/
  25333. /*! no static exports found */
  25334. /***/ (function(module, exports, __webpack_require__) {
  25335. "use strict";
  25336. var utils = __webpack_require__(/*! ../utils */ 186);
  25337. var common = __webpack_require__(/*! ../common */ 187);
  25338. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  25339. var rotr64_hi = utils.rotr64_hi;
  25340. var rotr64_lo = utils.rotr64_lo;
  25341. var shr64_hi = utils.shr64_hi;
  25342. var shr64_lo = utils.shr64_lo;
  25343. var sum64 = utils.sum64;
  25344. var sum64_hi = utils.sum64_hi;
  25345. var sum64_lo = utils.sum64_lo;
  25346. var sum64_4_hi = utils.sum64_4_hi;
  25347. var sum64_4_lo = utils.sum64_4_lo;
  25348. var sum64_5_hi = utils.sum64_5_hi;
  25349. var sum64_5_lo = utils.sum64_5_lo;
  25350. var BlockHash = common.BlockHash;
  25351. var sha512_K = [
  25352. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  25353. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  25354. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  25355. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  25356. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  25357. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  25358. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  25359. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  25360. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  25361. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  25362. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  25363. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  25364. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  25365. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  25366. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  25367. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  25368. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  25369. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  25370. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  25371. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  25372. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  25373. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  25374. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  25375. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  25376. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  25377. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  25378. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  25379. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  25380. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  25381. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  25382. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  25383. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  25384. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  25385. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  25386. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  25387. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  25388. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  25389. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  25390. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  25391. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  25392. ];
  25393. function SHA512() {
  25394. if (!(this instanceof SHA512))
  25395. return new SHA512();
  25396. BlockHash.call(this);
  25397. this.h = [
  25398. 0x6a09e667, 0xf3bcc908,
  25399. 0xbb67ae85, 0x84caa73b,
  25400. 0x3c6ef372, 0xfe94f82b,
  25401. 0xa54ff53a, 0x5f1d36f1,
  25402. 0x510e527f, 0xade682d1,
  25403. 0x9b05688c, 0x2b3e6c1f,
  25404. 0x1f83d9ab, 0xfb41bd6b,
  25405. 0x5be0cd19, 0x137e2179 ];
  25406. this.k = sha512_K;
  25407. this.W = new Array(160);
  25408. }
  25409. utils.inherits(SHA512, BlockHash);
  25410. module.exports = SHA512;
  25411. SHA512.blockSize = 1024;
  25412. SHA512.outSize = 512;
  25413. SHA512.hmacStrength = 192;
  25414. SHA512.padLength = 128;
  25415. SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
  25416. var W = this.W;
  25417. // 32 x 32bit words
  25418. for (var i = 0; i < 32; i++)
  25419. W[i] = msg[start + i];
  25420. for (; i < W.length; i += 2) {
  25421. var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
  25422. var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
  25423. var c1_hi = W[i - 14]; // i - 7
  25424. var c1_lo = W[i - 13];
  25425. var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
  25426. var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
  25427. var c3_hi = W[i - 32]; // i - 16
  25428. var c3_lo = W[i - 31];
  25429. W[i] = sum64_4_hi(
  25430. c0_hi, c0_lo,
  25431. c1_hi, c1_lo,
  25432. c2_hi, c2_lo,
  25433. c3_hi, c3_lo);
  25434. W[i + 1] = sum64_4_lo(
  25435. c0_hi, c0_lo,
  25436. c1_hi, c1_lo,
  25437. c2_hi, c2_lo,
  25438. c3_hi, c3_lo);
  25439. }
  25440. };
  25441. SHA512.prototype._update = function _update(msg, start) {
  25442. this._prepareBlock(msg, start);
  25443. var W = this.W;
  25444. var ah = this.h[0];
  25445. var al = this.h[1];
  25446. var bh = this.h[2];
  25447. var bl = this.h[3];
  25448. var ch = this.h[4];
  25449. var cl = this.h[5];
  25450. var dh = this.h[6];
  25451. var dl = this.h[7];
  25452. var eh = this.h[8];
  25453. var el = this.h[9];
  25454. var fh = this.h[10];
  25455. var fl = this.h[11];
  25456. var gh = this.h[12];
  25457. var gl = this.h[13];
  25458. var hh = this.h[14];
  25459. var hl = this.h[15];
  25460. assert(this.k.length === W.length);
  25461. for (var i = 0; i < W.length; i += 2) {
  25462. var c0_hi = hh;
  25463. var c0_lo = hl;
  25464. var c1_hi = s1_512_hi(eh, el);
  25465. var c1_lo = s1_512_lo(eh, el);
  25466. var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
  25467. var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
  25468. var c3_hi = this.k[i];
  25469. var c3_lo = this.k[i + 1];
  25470. var c4_hi = W[i];
  25471. var c4_lo = W[i + 1];
  25472. var T1_hi = sum64_5_hi(
  25473. c0_hi, c0_lo,
  25474. c1_hi, c1_lo,
  25475. c2_hi, c2_lo,
  25476. c3_hi, c3_lo,
  25477. c4_hi, c4_lo);
  25478. var T1_lo = sum64_5_lo(
  25479. c0_hi, c0_lo,
  25480. c1_hi, c1_lo,
  25481. c2_hi, c2_lo,
  25482. c3_hi, c3_lo,
  25483. c4_hi, c4_lo);
  25484. c0_hi = s0_512_hi(ah, al);
  25485. c0_lo = s0_512_lo(ah, al);
  25486. c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
  25487. c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
  25488. var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
  25489. var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
  25490. hh = gh;
  25491. hl = gl;
  25492. gh = fh;
  25493. gl = fl;
  25494. fh = eh;
  25495. fl = el;
  25496. eh = sum64_hi(dh, dl, T1_hi, T1_lo);
  25497. el = sum64_lo(dl, dl, T1_hi, T1_lo);
  25498. dh = ch;
  25499. dl = cl;
  25500. ch = bh;
  25501. cl = bl;
  25502. bh = ah;
  25503. bl = al;
  25504. ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
  25505. al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
  25506. }
  25507. sum64(this.h, 0, ah, al);
  25508. sum64(this.h, 2, bh, bl);
  25509. sum64(this.h, 4, ch, cl);
  25510. sum64(this.h, 6, dh, dl);
  25511. sum64(this.h, 8, eh, el);
  25512. sum64(this.h, 10, fh, fl);
  25513. sum64(this.h, 12, gh, gl);
  25514. sum64(this.h, 14, hh, hl);
  25515. };
  25516. SHA512.prototype._digest = function digest(enc) {
  25517. if (enc === 'hex')
  25518. return utils.toHex32(this.h, 'big');
  25519. else
  25520. return utils.split32(this.h, 'big');
  25521. };
  25522. function ch64_hi(xh, xl, yh, yl, zh) {
  25523. var r = (xh & yh) ^ ((~xh) & zh);
  25524. if (r < 0)
  25525. r += 0x100000000;
  25526. return r;
  25527. }
  25528. function ch64_lo(xh, xl, yh, yl, zh, zl) {
  25529. var r = (xl & yl) ^ ((~xl) & zl);
  25530. if (r < 0)
  25531. r += 0x100000000;
  25532. return r;
  25533. }
  25534. function maj64_hi(xh, xl, yh, yl, zh) {
  25535. var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
  25536. if (r < 0)
  25537. r += 0x100000000;
  25538. return r;
  25539. }
  25540. function maj64_lo(xh, xl, yh, yl, zh, zl) {
  25541. var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
  25542. if (r < 0)
  25543. r += 0x100000000;
  25544. return r;
  25545. }
  25546. function s0_512_hi(xh, xl) {
  25547. var c0_hi = rotr64_hi(xh, xl, 28);
  25548. var c1_hi = rotr64_hi(xl, xh, 2); // 34
  25549. var c2_hi = rotr64_hi(xl, xh, 7); // 39
  25550. var r = c0_hi ^ c1_hi ^ c2_hi;
  25551. if (r < 0)
  25552. r += 0x100000000;
  25553. return r;
  25554. }
  25555. function s0_512_lo(xh, xl) {
  25556. var c0_lo = rotr64_lo(xh, xl, 28);
  25557. var c1_lo = rotr64_lo(xl, xh, 2); // 34
  25558. var c2_lo = rotr64_lo(xl, xh, 7); // 39
  25559. var r = c0_lo ^ c1_lo ^ c2_lo;
  25560. if (r < 0)
  25561. r += 0x100000000;
  25562. return r;
  25563. }
  25564. function s1_512_hi(xh, xl) {
  25565. var c0_hi = rotr64_hi(xh, xl, 14);
  25566. var c1_hi = rotr64_hi(xh, xl, 18);
  25567. var c2_hi = rotr64_hi(xl, xh, 9); // 41
  25568. var r = c0_hi ^ c1_hi ^ c2_hi;
  25569. if (r < 0)
  25570. r += 0x100000000;
  25571. return r;
  25572. }
  25573. function s1_512_lo(xh, xl) {
  25574. var c0_lo = rotr64_lo(xh, xl, 14);
  25575. var c1_lo = rotr64_lo(xh, xl, 18);
  25576. var c2_lo = rotr64_lo(xl, xh, 9); // 41
  25577. var r = c0_lo ^ c1_lo ^ c2_lo;
  25578. if (r < 0)
  25579. r += 0x100000000;
  25580. return r;
  25581. }
  25582. function g0_512_hi(xh, xl) {
  25583. var c0_hi = rotr64_hi(xh, xl, 1);
  25584. var c1_hi = rotr64_hi(xh, xl, 8);
  25585. var c2_hi = shr64_hi(xh, xl, 7);
  25586. var r = c0_hi ^ c1_hi ^ c2_hi;
  25587. if (r < 0)
  25588. r += 0x100000000;
  25589. return r;
  25590. }
  25591. function g0_512_lo(xh, xl) {
  25592. var c0_lo = rotr64_lo(xh, xl, 1);
  25593. var c1_lo = rotr64_lo(xh, xl, 8);
  25594. var c2_lo = shr64_lo(xh, xl, 7);
  25595. var r = c0_lo ^ c1_lo ^ c2_lo;
  25596. if (r < 0)
  25597. r += 0x100000000;
  25598. return r;
  25599. }
  25600. function g1_512_hi(xh, xl) {
  25601. var c0_hi = rotr64_hi(xh, xl, 19);
  25602. var c1_hi = rotr64_hi(xl, xh, 29); // 61
  25603. var c2_hi = shr64_hi(xh, xl, 6);
  25604. var r = c0_hi ^ c1_hi ^ c2_hi;
  25605. if (r < 0)
  25606. r += 0x100000000;
  25607. return r;
  25608. }
  25609. function g1_512_lo(xh, xl) {
  25610. var c0_lo = rotr64_lo(xh, xl, 19);
  25611. var c1_lo = rotr64_lo(xl, xh, 29); // 61
  25612. var c2_lo = shr64_lo(xh, xl, 6);
  25613. var r = c0_lo ^ c1_lo ^ c2_lo;
  25614. if (r < 0)
  25615. r += 0x100000000;
  25616. return r;
  25617. }
  25618. /***/ }),
  25619. /* 195 */
  25620. /*!*************************************************!*\
  25621. !*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
  25622. \*************************************************/
  25623. /*! no static exports found */
  25624. /***/ (function(module, exports, __webpack_require__) {
  25625. "use strict";
  25626. var utils = __webpack_require__(/*! ./utils */ 186);
  25627. var common = __webpack_require__(/*! ./common */ 187);
  25628. var rotl32 = utils.rotl32;
  25629. var sum32 = utils.sum32;
  25630. var sum32_3 = utils.sum32_3;
  25631. var sum32_4 = utils.sum32_4;
  25632. var BlockHash = common.BlockHash;
  25633. function RIPEMD160() {
  25634. if (!(this instanceof RIPEMD160))
  25635. return new RIPEMD160();
  25636. BlockHash.call(this);
  25637. this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
  25638. this.endian = 'little';
  25639. }
  25640. utils.inherits(RIPEMD160, BlockHash);
  25641. exports.ripemd160 = RIPEMD160;
  25642. RIPEMD160.blockSize = 512;
  25643. RIPEMD160.outSize = 160;
  25644. RIPEMD160.hmacStrength = 192;
  25645. RIPEMD160.padLength = 64;
  25646. RIPEMD160.prototype._update = function update(msg, start) {
  25647. var A = this.h[0];
  25648. var B = this.h[1];
  25649. var C = this.h[2];
  25650. var D = this.h[3];
  25651. var E = this.h[4];
  25652. var Ah = A;
  25653. var Bh = B;
  25654. var Ch = C;
  25655. var Dh = D;
  25656. var Eh = E;
  25657. for (var j = 0; j < 80; j++) {
  25658. var T = sum32(
  25659. rotl32(
  25660. sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
  25661. s[j]),
  25662. E);
  25663. A = E;
  25664. E = D;
  25665. D = rotl32(C, 10);
  25666. C = B;
  25667. B = T;
  25668. T = sum32(
  25669. rotl32(
  25670. sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
  25671. sh[j]),
  25672. Eh);
  25673. Ah = Eh;
  25674. Eh = Dh;
  25675. Dh = rotl32(Ch, 10);
  25676. Ch = Bh;
  25677. Bh = T;
  25678. }
  25679. T = sum32_3(this.h[1], C, Dh);
  25680. this.h[1] = sum32_3(this.h[2], D, Eh);
  25681. this.h[2] = sum32_3(this.h[3], E, Ah);
  25682. this.h[3] = sum32_3(this.h[4], A, Bh);
  25683. this.h[4] = sum32_3(this.h[0], B, Ch);
  25684. this.h[0] = T;
  25685. };
  25686. RIPEMD160.prototype._digest = function digest(enc) {
  25687. if (enc === 'hex')
  25688. return utils.toHex32(this.h, 'little');
  25689. else
  25690. return utils.split32(this.h, 'little');
  25691. };
  25692. function f(j, x, y, z) {
  25693. if (j <= 15)
  25694. return x ^ y ^ z;
  25695. else if (j <= 31)
  25696. return (x & y) | ((~x) & z);
  25697. else if (j <= 47)
  25698. return (x | (~y)) ^ z;
  25699. else if (j <= 63)
  25700. return (x & z) | (y & (~z));
  25701. else
  25702. return x ^ (y | (~z));
  25703. }
  25704. function K(j) {
  25705. if (j <= 15)
  25706. return 0x00000000;
  25707. else if (j <= 31)
  25708. return 0x5a827999;
  25709. else if (j <= 47)
  25710. return 0x6ed9eba1;
  25711. else if (j <= 63)
  25712. return 0x8f1bbcdc;
  25713. else
  25714. return 0xa953fd4e;
  25715. }
  25716. function Kh(j) {
  25717. if (j <= 15)
  25718. return 0x50a28be6;
  25719. else if (j <= 31)
  25720. return 0x5c4dd124;
  25721. else if (j <= 47)
  25722. return 0x6d703ef3;
  25723. else if (j <= 63)
  25724. return 0x7a6d76e9;
  25725. else
  25726. return 0x00000000;
  25727. }
  25728. var r = [
  25729. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  25730. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  25731. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  25732. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  25733. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  25734. ];
  25735. var rh = [
  25736. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  25737. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  25738. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  25739. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  25740. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  25741. ];
  25742. var s = [
  25743. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  25744. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  25745. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  25746. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  25747. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  25748. ];
  25749. var sh = [
  25750. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  25751. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  25752. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  25753. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  25754. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  25755. ];
  25756. /***/ }),
  25757. /* 196 */
  25758. /*!***********************************************!*\
  25759. !*** ./node_modules/hash.js/lib/hash/hmac.js ***!
  25760. \***********************************************/
  25761. /*! no static exports found */
  25762. /***/ (function(module, exports, __webpack_require__) {
  25763. "use strict";
  25764. var utils = __webpack_require__(/*! ./utils */ 186);
  25765. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  25766. function Hmac(hash, key, enc) {
  25767. if (!(this instanceof Hmac))
  25768. return new Hmac(hash, key, enc);
  25769. this.Hash = hash;
  25770. this.blockSize = hash.blockSize / 8;
  25771. this.outSize = hash.outSize / 8;
  25772. this.inner = null;
  25773. this.outer = null;
  25774. this._init(utils.toArray(key, enc));
  25775. }
  25776. module.exports = Hmac;
  25777. Hmac.prototype._init = function init(key) {
  25778. // Shorten key, if needed
  25779. if (key.length > this.blockSize)
  25780. key = new this.Hash().update(key).digest();
  25781. assert(key.length <= this.blockSize);
  25782. // Add padding to key
  25783. for (var i = key.length; i < this.blockSize; i++)
  25784. key.push(0);
  25785. for (i = 0; i < key.length; i++)
  25786. key[i] ^= 0x36;
  25787. this.inner = new this.Hash().update(key);
  25788. // 0x36 ^ 0x5c = 0x6a
  25789. for (i = 0; i < key.length; i++)
  25790. key[i] ^= 0x6a;
  25791. this.outer = new this.Hash().update(key);
  25792. };
  25793. Hmac.prototype.update = function update(msg, enc) {
  25794. this.inner.update(msg, enc);
  25795. return this;
  25796. };
  25797. Hmac.prototype.digest = function digest(enc) {
  25798. this.outer.update(this.inner.digest());
  25799. return this.outer.digest(enc);
  25800. };
  25801. /***/ }),
  25802. /* 197 */
  25803. /*!*********************************************************************!*\
  25804. !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
  25805. \*********************************************************************/
  25806. /*! no static exports found */
  25807. /***/ (function(module, exports) {
  25808. module.exports = {
  25809. doubles: {
  25810. step: 4,
  25811. points: [
  25812. [
  25813. 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
  25814. 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
  25815. ],
  25816. [
  25817. '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
  25818. '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
  25819. ],
  25820. [
  25821. '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
  25822. 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
  25823. ],
  25824. [
  25825. '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
  25826. '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
  25827. ],
  25828. [
  25829. '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
  25830. '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
  25831. ],
  25832. [
  25833. '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
  25834. '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
  25835. ],
  25836. [
  25837. 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
  25838. '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
  25839. ],
  25840. [
  25841. '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
  25842. 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
  25843. ],
  25844. [
  25845. 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
  25846. '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
  25847. ],
  25848. [
  25849. 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
  25850. 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
  25851. ],
  25852. [
  25853. 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
  25854. '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
  25855. ],
  25856. [
  25857. '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
  25858. '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
  25859. ],
  25860. [
  25861. '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
  25862. '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
  25863. ],
  25864. [
  25865. '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
  25866. '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
  25867. ],
  25868. [
  25869. '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
  25870. '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
  25871. ],
  25872. [
  25873. '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
  25874. '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
  25875. ],
  25876. [
  25877. '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
  25878. '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
  25879. ],
  25880. [
  25881. '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
  25882. '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
  25883. ],
  25884. [
  25885. '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
  25886. 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
  25887. ],
  25888. [
  25889. 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
  25890. '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
  25891. ],
  25892. [
  25893. 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
  25894. '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
  25895. ],
  25896. [
  25897. '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
  25898. '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
  25899. ],
  25900. [
  25901. '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
  25902. '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
  25903. ],
  25904. [
  25905. 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
  25906. '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
  25907. ],
  25908. [
  25909. '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
  25910. 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
  25911. ],
  25912. [
  25913. 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
  25914. '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
  25915. ],
  25916. [
  25917. 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
  25918. 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
  25919. ],
  25920. [
  25921. 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
  25922. '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
  25923. ],
  25924. [
  25925. 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
  25926. 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
  25927. ],
  25928. [
  25929. 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
  25930. '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
  25931. ],
  25932. [
  25933. '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
  25934. 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
  25935. ],
  25936. [
  25937. '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
  25938. '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
  25939. ],
  25940. [
  25941. 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
  25942. '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
  25943. ],
  25944. [
  25945. '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
  25946. 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
  25947. ],
  25948. [
  25949. 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
  25950. '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
  25951. ],
  25952. [
  25953. 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
  25954. '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
  25955. ],
  25956. [
  25957. 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
  25958. 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
  25959. ],
  25960. [
  25961. '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
  25962. '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
  25963. ],
  25964. [
  25965. '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
  25966. '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
  25967. ],
  25968. [
  25969. '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
  25970. 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
  25971. ],
  25972. [
  25973. '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
  25974. '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
  25975. ],
  25976. [
  25977. 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
  25978. '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
  25979. ],
  25980. [
  25981. '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
  25982. '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
  25983. ],
  25984. [
  25985. '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
  25986. 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
  25987. ],
  25988. [
  25989. '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
  25990. '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
  25991. ],
  25992. [
  25993. 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
  25994. '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
  25995. ],
  25996. [
  25997. '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
  25998. 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
  25999. ],
  26000. [
  26001. 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
  26002. 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
  26003. ],
  26004. [
  26005. 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
  26006. '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
  26007. ],
  26008. [
  26009. '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
  26010. 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
  26011. ],
  26012. [
  26013. '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
  26014. 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
  26015. ],
  26016. [
  26017. 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
  26018. '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
  26019. ],
  26020. [
  26021. 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
  26022. '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
  26023. ],
  26024. [
  26025. 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
  26026. '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
  26027. ],
  26028. [
  26029. '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
  26030. 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
  26031. ],
  26032. [
  26033. '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
  26034. '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
  26035. ],
  26036. [
  26037. 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
  26038. 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
  26039. ],
  26040. [
  26041. '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
  26042. 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
  26043. ],
  26044. [
  26045. '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
  26046. '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
  26047. ],
  26048. [
  26049. '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
  26050. '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
  26051. ],
  26052. [
  26053. 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
  26054. 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
  26055. ],
  26056. [
  26057. '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
  26058. '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
  26059. ],
  26060. [
  26061. '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
  26062. '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
  26063. ],
  26064. [
  26065. 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
  26066. '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
  26067. ],
  26068. [
  26069. 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
  26070. 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
  26071. ]
  26072. ]
  26073. },
  26074. naf: {
  26075. wnd: 7,
  26076. points: [
  26077. [
  26078. 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
  26079. '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
  26080. ],
  26081. [
  26082. '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
  26083. 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
  26084. ],
  26085. [
  26086. '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
  26087. '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
  26088. ],
  26089. [
  26090. 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
  26091. 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
  26092. ],
  26093. [
  26094. '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
  26095. 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
  26096. ],
  26097. [
  26098. 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
  26099. 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
  26100. ],
  26101. [
  26102. 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
  26103. '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
  26104. ],
  26105. [
  26106. 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
  26107. '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
  26108. ],
  26109. [
  26110. '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
  26111. '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
  26112. ],
  26113. [
  26114. '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
  26115. '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
  26116. ],
  26117. [
  26118. '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
  26119. '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
  26120. ],
  26121. [
  26122. '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
  26123. '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
  26124. ],
  26125. [
  26126. 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
  26127. 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
  26128. ],
  26129. [
  26130. 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
  26131. '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
  26132. ],
  26133. [
  26134. '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
  26135. 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
  26136. ],
  26137. [
  26138. '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
  26139. 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
  26140. ],
  26141. [
  26142. '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
  26143. '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
  26144. ],
  26145. [
  26146. '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
  26147. '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
  26148. ],
  26149. [
  26150. '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
  26151. '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
  26152. ],
  26153. [
  26154. '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
  26155. 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
  26156. ],
  26157. [
  26158. 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
  26159. 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
  26160. ],
  26161. [
  26162. '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
  26163. '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
  26164. ],
  26165. [
  26166. '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
  26167. '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
  26168. ],
  26169. [
  26170. 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
  26171. 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
  26172. ],
  26173. [
  26174. '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
  26175. '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
  26176. ],
  26177. [
  26178. 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
  26179. 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
  26180. ],
  26181. [
  26182. 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
  26183. 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
  26184. ],
  26185. [
  26186. '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
  26187. '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
  26188. ],
  26189. [
  26190. '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
  26191. '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
  26192. ],
  26193. [
  26194. '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
  26195. '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
  26196. ],
  26197. [
  26198. 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
  26199. '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
  26200. ],
  26201. [
  26202. '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
  26203. '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
  26204. ],
  26205. [
  26206. 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
  26207. '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
  26208. ],
  26209. [
  26210. '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
  26211. 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
  26212. ],
  26213. [
  26214. '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
  26215. 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
  26216. ],
  26217. [
  26218. 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
  26219. 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
  26220. ],
  26221. [
  26222. '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
  26223. '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
  26224. ],
  26225. [
  26226. '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
  26227. 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
  26228. ],
  26229. [
  26230. 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
  26231. 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
  26232. ],
  26233. [
  26234. '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
  26235. '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
  26236. ],
  26237. [
  26238. '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
  26239. 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
  26240. ],
  26241. [
  26242. '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
  26243. '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
  26244. ],
  26245. [
  26246. '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
  26247. 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
  26248. ],
  26249. [
  26250. 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
  26251. '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
  26252. ],
  26253. [
  26254. '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
  26255. '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
  26256. ],
  26257. [
  26258. '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
  26259. 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
  26260. ],
  26261. [
  26262. '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
  26263. 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
  26264. ],
  26265. [
  26266. 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
  26267. 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
  26268. ],
  26269. [
  26270. 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
  26271. 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
  26272. ],
  26273. [
  26274. '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
  26275. '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
  26276. ],
  26277. [
  26278. '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
  26279. '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
  26280. ],
  26281. [
  26282. 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
  26283. '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
  26284. ],
  26285. [
  26286. 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
  26287. 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
  26288. ],
  26289. [
  26290. '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
  26291. '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
  26292. ],
  26293. [
  26294. '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
  26295. '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
  26296. ],
  26297. [
  26298. 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
  26299. '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
  26300. ],
  26301. [
  26302. '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
  26303. '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
  26304. ],
  26305. [
  26306. 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
  26307. 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
  26308. ],
  26309. [
  26310. '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
  26311. 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
  26312. ],
  26313. [
  26314. '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
  26315. '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
  26316. ],
  26317. [
  26318. 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
  26319. '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
  26320. ],
  26321. [
  26322. 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
  26323. '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
  26324. ],
  26325. [
  26326. '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
  26327. '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
  26328. ],
  26329. [
  26330. '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
  26331. '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
  26332. ],
  26333. [
  26334. '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
  26335. 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
  26336. ],
  26337. [
  26338. '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
  26339. 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
  26340. ],
  26341. [
  26342. '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
  26343. '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
  26344. ],
  26345. [
  26346. '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
  26347. '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
  26348. ],
  26349. [
  26350. '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
  26351. '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
  26352. ],
  26353. [
  26354. '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
  26355. 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
  26356. ],
  26357. [
  26358. 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
  26359. 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
  26360. ],
  26361. [
  26362. '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
  26363. 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
  26364. ],
  26365. [
  26366. 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
  26367. '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
  26368. ],
  26369. [
  26370. 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
  26371. '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
  26372. ],
  26373. [
  26374. 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
  26375. '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
  26376. ],
  26377. [
  26378. 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
  26379. '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
  26380. ],
  26381. [
  26382. '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
  26383. 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
  26384. ],
  26385. [
  26386. '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
  26387. '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
  26388. ],
  26389. [
  26390. '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
  26391. 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
  26392. ],
  26393. [
  26394. 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
  26395. 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
  26396. ],
  26397. [
  26398. 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
  26399. '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
  26400. ],
  26401. [
  26402. 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
  26403. 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
  26404. ],
  26405. [
  26406. 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
  26407. '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
  26408. ],
  26409. [
  26410. '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
  26411. '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
  26412. ],
  26413. [
  26414. 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
  26415. '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
  26416. ],
  26417. [
  26418. 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
  26419. '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
  26420. ],
  26421. [
  26422. '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
  26423. '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
  26424. ],
  26425. [
  26426. '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
  26427. 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
  26428. ],
  26429. [
  26430. 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
  26431. '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
  26432. ],
  26433. [
  26434. 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
  26435. '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
  26436. ],
  26437. [
  26438. 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
  26439. '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
  26440. ],
  26441. [
  26442. '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
  26443. '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
  26444. ],
  26445. [
  26446. 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
  26447. 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
  26448. ],
  26449. [
  26450. '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
  26451. 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
  26452. ],
  26453. [
  26454. 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
  26455. 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
  26456. ],
  26457. [
  26458. 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
  26459. '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
  26460. ],
  26461. [
  26462. '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
  26463. 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
  26464. ],
  26465. [
  26466. 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
  26467. '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
  26468. ],
  26469. [
  26470. 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
  26471. '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
  26472. ],
  26473. [
  26474. 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
  26475. '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
  26476. ],
  26477. [
  26478. '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
  26479. 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
  26480. ],
  26481. [
  26482. '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
  26483. 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
  26484. ],
  26485. [
  26486. 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
  26487. '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
  26488. ],
  26489. [
  26490. '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
  26491. 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
  26492. ],
  26493. [
  26494. '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
  26495. '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
  26496. ],
  26497. [
  26498. '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
  26499. 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
  26500. ],
  26501. [
  26502. 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
  26503. 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
  26504. ],
  26505. [
  26506. '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
  26507. 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
  26508. ],
  26509. [
  26510. '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
  26511. '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
  26512. ],
  26513. [
  26514. '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
  26515. 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
  26516. ],
  26517. [
  26518. '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
  26519. '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
  26520. ],
  26521. [
  26522. 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
  26523. 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
  26524. ],
  26525. [
  26526. '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
  26527. '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
  26528. ],
  26529. [
  26530. 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
  26531. '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
  26532. ],
  26533. [
  26534. '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
  26535. '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
  26536. ],
  26537. [
  26538. 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
  26539. 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
  26540. ],
  26541. [
  26542. 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
  26543. '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
  26544. ],
  26545. [
  26546. 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
  26547. 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
  26548. ],
  26549. [
  26550. '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
  26551. 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
  26552. ],
  26553. [
  26554. '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
  26555. '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
  26556. ],
  26557. [
  26558. '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
  26559. 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
  26560. ],
  26561. [
  26562. '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
  26563. '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
  26564. ],
  26565. [
  26566. '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
  26567. '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
  26568. ],
  26569. [
  26570. '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
  26571. 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
  26572. ],
  26573. [
  26574. '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
  26575. '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
  26576. ],
  26577. [
  26578. '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
  26579. '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
  26580. ],
  26581. [
  26582. '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
  26583. '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
  26584. ]
  26585. ]
  26586. }
  26587. };
  26588. /***/ }),
  26589. /* 198 */
  26590. /*!********************************************************!*\
  26591. !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
  26592. \********************************************************/
  26593. /*! no static exports found */
  26594. /***/ (function(module, exports, __webpack_require__) {
  26595. "use strict";
  26596. var BN = __webpack_require__(/*! bn.js */ 164);
  26597. var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 199);
  26598. var utils = __webpack_require__(/*! ../utils */ 177);
  26599. var curves = __webpack_require__(/*! ../curves */ 184);
  26600. var rand = __webpack_require__(/*! brorand */ 168);
  26601. var assert = utils.assert;
  26602. var KeyPair = __webpack_require__(/*! ./key */ 200);
  26603. var Signature = __webpack_require__(/*! ./signature */ 201);
  26604. function EC(options) {
  26605. if (!(this instanceof EC))
  26606. return new EC(options);
  26607. // Shortcut `elliptic.ec(curve-name)`
  26608. if (typeof options === 'string') {
  26609. assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);
  26610. options = curves[options];
  26611. }
  26612. // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  26613. if (options instanceof curves.PresetCurve)
  26614. options = { curve: options };
  26615. this.curve = options.curve.curve;
  26616. this.n = this.curve.n;
  26617. this.nh = this.n.ushrn(1);
  26618. this.g = this.curve.g;
  26619. // Point on curve
  26620. this.g = options.curve.g;
  26621. this.g.precompute(options.curve.n.bitLength() + 1);
  26622. // Hash for function for DRBG
  26623. this.hash = options.hash || options.curve.hash;
  26624. }
  26625. module.exports = EC;
  26626. EC.prototype.keyPair = function keyPair(options) {
  26627. return new KeyPair(this, options);
  26628. };
  26629. EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
  26630. return KeyPair.fromPrivate(this, priv, enc);
  26631. };
  26632. EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
  26633. return KeyPair.fromPublic(this, pub, enc);
  26634. };
  26635. EC.prototype.genKeyPair = function genKeyPair(options) {
  26636. if (!options)
  26637. options = {};
  26638. // Instantiate Hmac_DRBG
  26639. var drbg = new HmacDRBG({
  26640. hash: this.hash,
  26641. pers: options.pers,
  26642. persEnc: options.persEnc || 'utf8',
  26643. entropy: options.entropy || rand(this.hash.hmacStrength),
  26644. entropyEnc: options.entropy && options.entropyEnc || 'utf8',
  26645. nonce: this.n.toArray()
  26646. });
  26647. var bytes = this.n.byteLength();
  26648. var ns2 = this.n.sub(new BN(2));
  26649. do {
  26650. var priv = new BN(drbg.generate(bytes));
  26651. if (priv.cmp(ns2) > 0)
  26652. continue;
  26653. priv.iaddn(1);
  26654. return this.keyFromPrivate(priv);
  26655. } while (true);
  26656. };
  26657. EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
  26658. var delta = msg.byteLength() * 8 - this.n.bitLength();
  26659. if (delta > 0)
  26660. msg = msg.ushrn(delta);
  26661. if (!truncOnly && msg.cmp(this.n) >= 0)
  26662. return msg.sub(this.n);
  26663. else
  26664. return msg;
  26665. };
  26666. EC.prototype.sign = function sign(msg, key, enc, options) {
  26667. if (typeof enc === 'object') {
  26668. options = enc;
  26669. enc = null;
  26670. }
  26671. if (!options)
  26672. options = {};
  26673. key = this.keyFromPrivate(key, enc);
  26674. msg = this._truncateToN(new BN(msg, 16));
  26675. // Zero-extend key to provide enough entropy
  26676. var bytes = this.n.byteLength();
  26677. var bkey = key.getPrivate().toArray('be', bytes);
  26678. // Zero-extend nonce to have the same byte size as N
  26679. var nonce = msg.toArray('be', bytes);
  26680. // Instantiate Hmac_DRBG
  26681. var drbg = new HmacDRBG({
  26682. hash: this.hash,
  26683. entropy: bkey,
  26684. nonce: nonce,
  26685. pers: options.pers,
  26686. persEnc: options.persEnc || 'utf8'
  26687. });
  26688. // Number of bytes to generate
  26689. var ns1 = this.n.sub(new BN(1));
  26690. for (var iter = 0; true; iter++) {
  26691. var k = options.k ?
  26692. options.k(iter) :
  26693. new BN(drbg.generate(this.n.byteLength()));
  26694. k = this._truncateToN(k, true);
  26695. if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
  26696. continue;
  26697. var kp = this.g.mul(k);
  26698. if (kp.isInfinity())
  26699. continue;
  26700. var kpX = kp.getX();
  26701. var r = kpX.umod(this.n);
  26702. if (r.cmpn(0) === 0)
  26703. continue;
  26704. var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
  26705. s = s.umod(this.n);
  26706. if (s.cmpn(0) === 0)
  26707. continue;
  26708. var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
  26709. (kpX.cmp(r) !== 0 ? 2 : 0);
  26710. // Use complement of `s`, if it is > `n / 2`
  26711. if (options.canonical && s.cmp(this.nh) > 0) {
  26712. s = this.n.sub(s);
  26713. recoveryParam ^= 1;
  26714. }
  26715. return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
  26716. }
  26717. };
  26718. EC.prototype.verify = function verify(msg, signature, key, enc) {
  26719. msg = this._truncateToN(new BN(msg, 16));
  26720. key = this.keyFromPublic(key, enc);
  26721. signature = new Signature(signature, 'hex');
  26722. // Perform primitive values validation
  26723. var r = signature.r;
  26724. var s = signature.s;
  26725. if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
  26726. return false;
  26727. if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
  26728. return false;
  26729. // Validate signature
  26730. var sinv = s.invm(this.n);
  26731. var u1 = sinv.mul(msg).umod(this.n);
  26732. var u2 = sinv.mul(r).umod(this.n);
  26733. if (!this.curve._maxwellTrick) {
  26734. var p = this.g.mulAdd(u1, key.getPublic(), u2);
  26735. if (p.isInfinity())
  26736. return false;
  26737. return p.getX().umod(this.n).cmp(r) === 0;
  26738. }
  26739. // NOTE: Greg Maxwell's trick, inspired by:
  26740. // https://git.io/vad3K
  26741. var p = this.g.jmulAdd(u1, key.getPublic(), u2);
  26742. if (p.isInfinity())
  26743. return false;
  26744. // Compare `p.x` of Jacobian point with `r`,
  26745. // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
  26746. // inverse of `p.z^2`
  26747. return p.eqXToP(r);
  26748. };
  26749. EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
  26750. assert((3 & j) === j, 'The recovery param is more than two bits');
  26751. signature = new Signature(signature, enc);
  26752. var n = this.n;
  26753. var e = new BN(msg);
  26754. var r = signature.r;
  26755. var s = signature.s;
  26756. // A set LSB signifies that the y-coordinate is odd
  26757. var isYOdd = j & 1;
  26758. var isSecondKey = j >> 1;
  26759. if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
  26760. throw new Error('Unable to find sencond key candinate');
  26761. // 1.1. Let x = r + jn.
  26762. if (isSecondKey)
  26763. r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
  26764. else
  26765. r = this.curve.pointFromX(r, isYOdd);
  26766. var rInv = signature.r.invm(n);
  26767. var s1 = n.sub(e).mul(rInv).umod(n);
  26768. var s2 = s.mul(rInv).umod(n);
  26769. // 1.6.1 Compute Q = r^-1 (sR - eG)
  26770. // Q = r^-1 (sR + -eG)
  26771. return this.g.mulAdd(s1, r, s2);
  26772. };
  26773. EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
  26774. signature = new Signature(signature, enc);
  26775. if (signature.recoveryParam !== null)
  26776. return signature.recoveryParam;
  26777. for (var i = 0; i < 4; i++) {
  26778. var Qprime;
  26779. try {
  26780. Qprime = this.recoverPubKey(e, signature, i);
  26781. } catch (e) {
  26782. continue;
  26783. }
  26784. if (Qprime.eq(Q))
  26785. return i;
  26786. }
  26787. throw new Error('Unable to find valid recovery factor');
  26788. };
  26789. /***/ }),
  26790. /* 199 */
  26791. /*!*************************************************!*\
  26792. !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
  26793. \*************************************************/
  26794. /*! no static exports found */
  26795. /***/ (function(module, exports, __webpack_require__) {
  26796. "use strict";
  26797. var hash = __webpack_require__(/*! hash.js */ 185);
  26798. var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 178);
  26799. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  26800. function HmacDRBG(options) {
  26801. if (!(this instanceof HmacDRBG))
  26802. return new HmacDRBG(options);
  26803. this.hash = options.hash;
  26804. this.predResist = !!options.predResist;
  26805. this.outLen = this.hash.outSize;
  26806. this.minEntropy = options.minEntropy || this.hash.hmacStrength;
  26807. this._reseed = null;
  26808. this.reseedInterval = null;
  26809. this.K = null;
  26810. this.V = null;
  26811. var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
  26812. var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
  26813. var pers = utils.toArray(options.pers, options.persEnc || 'hex');
  26814. assert(entropy.length >= (this.minEntropy / 8),
  26815. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26816. this._init(entropy, nonce, pers);
  26817. }
  26818. module.exports = HmacDRBG;
  26819. HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
  26820. var seed = entropy.concat(nonce).concat(pers);
  26821. this.K = new Array(this.outLen / 8);
  26822. this.V = new Array(this.outLen / 8);
  26823. for (var i = 0; i < this.V.length; i++) {
  26824. this.K[i] = 0x00;
  26825. this.V[i] = 0x01;
  26826. }
  26827. this._update(seed);
  26828. this._reseed = 1;
  26829. this.reseedInterval = 0x1000000000000; // 2^48
  26830. };
  26831. HmacDRBG.prototype._hmac = function hmac() {
  26832. return new hash.hmac(this.hash, this.K);
  26833. };
  26834. HmacDRBG.prototype._update = function update(seed) {
  26835. var kmac = this._hmac()
  26836. .update(this.V)
  26837. .update([ 0x00 ]);
  26838. if (seed)
  26839. kmac = kmac.update(seed);
  26840. this.K = kmac.digest();
  26841. this.V = this._hmac().update(this.V).digest();
  26842. if (!seed)
  26843. return;
  26844. this.K = this._hmac()
  26845. .update(this.V)
  26846. .update([ 0x01 ])
  26847. .update(seed)
  26848. .digest();
  26849. this.V = this._hmac().update(this.V).digest();
  26850. };
  26851. HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
  26852. // Optional entropy enc
  26853. if (typeof entropyEnc !== 'string') {
  26854. addEnc = add;
  26855. add = entropyEnc;
  26856. entropyEnc = null;
  26857. }
  26858. entropy = utils.toArray(entropy, entropyEnc);
  26859. add = utils.toArray(add, addEnc);
  26860. assert(entropy.length >= (this.minEntropy / 8),
  26861. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26862. this._update(entropy.concat(add || []));
  26863. this._reseed = 1;
  26864. };
  26865. HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
  26866. if (this._reseed > this.reseedInterval)
  26867. throw new Error('Reseed is required');
  26868. // Optional encoding
  26869. if (typeof enc !== 'string') {
  26870. addEnc = add;
  26871. add = enc;
  26872. enc = null;
  26873. }
  26874. // Optional additional data
  26875. if (add) {
  26876. add = utils.toArray(add, addEnc || 'hex');
  26877. this._update(add);
  26878. }
  26879. var temp = [];
  26880. while (temp.length < len) {
  26881. this.V = this._hmac().update(this.V).digest();
  26882. temp = temp.concat(this.V);
  26883. }
  26884. var res = temp.slice(0, len);
  26885. this._update(add);
  26886. this._reseed++;
  26887. return utils.encode(res, enc);
  26888. };
  26889. /***/ }),
  26890. /* 200 */
  26891. /*!******************************************************!*\
  26892. !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
  26893. \******************************************************/
  26894. /*! no static exports found */
  26895. /***/ (function(module, exports, __webpack_require__) {
  26896. "use strict";
  26897. var BN = __webpack_require__(/*! bn.js */ 164);
  26898. var utils = __webpack_require__(/*! ../utils */ 177);
  26899. var assert = utils.assert;
  26900. function KeyPair(ec, options) {
  26901. this.ec = ec;
  26902. this.priv = null;
  26903. this.pub = null;
  26904. // KeyPair(ec, { priv: ..., pub: ... })
  26905. if (options.priv)
  26906. this._importPrivate(options.priv, options.privEnc);
  26907. if (options.pub)
  26908. this._importPublic(options.pub, options.pubEnc);
  26909. }
  26910. module.exports = KeyPair;
  26911. KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
  26912. if (pub instanceof KeyPair)
  26913. return pub;
  26914. return new KeyPair(ec, {
  26915. pub: pub,
  26916. pubEnc: enc
  26917. });
  26918. };
  26919. KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
  26920. if (priv instanceof KeyPair)
  26921. return priv;
  26922. return new KeyPair(ec, {
  26923. priv: priv,
  26924. privEnc: enc
  26925. });
  26926. };
  26927. KeyPair.prototype.validate = function validate() {
  26928. var pub = this.getPublic();
  26929. if (pub.isInfinity())
  26930. return { result: false, reason: 'Invalid public key' };
  26931. if (!pub.validate())
  26932. return { result: false, reason: 'Public key is not a point' };
  26933. if (!pub.mul(this.ec.curve.n).isInfinity())
  26934. return { result: false, reason: 'Public key * N != O' };
  26935. return { result: true, reason: null };
  26936. };
  26937. KeyPair.prototype.getPublic = function getPublic(compact, enc) {
  26938. // compact is optional argument
  26939. if (typeof compact === 'string') {
  26940. enc = compact;
  26941. compact = null;
  26942. }
  26943. if (!this.pub)
  26944. this.pub = this.ec.g.mul(this.priv);
  26945. if (!enc)
  26946. return this.pub;
  26947. return this.pub.encode(enc, compact);
  26948. };
  26949. KeyPair.prototype.getPrivate = function getPrivate(enc) {
  26950. if (enc === 'hex')
  26951. return this.priv.toString(16, 2);
  26952. else
  26953. return this.priv;
  26954. };
  26955. KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
  26956. this.priv = new BN(key, enc || 16);
  26957. // Ensure that the priv won't be bigger than n, otherwise we may fail
  26958. // in fixed multiplication method
  26959. this.priv = this.priv.umod(this.ec.curve.n);
  26960. };
  26961. KeyPair.prototype._importPublic = function _importPublic(key, enc) {
  26962. if (key.x || key.y) {
  26963. // Montgomery points only have an `x` coordinate.
  26964. // Weierstrass/Edwards points on the other hand have both `x` and
  26965. // `y` coordinates.
  26966. if (this.ec.curve.type === 'mont') {
  26967. assert(key.x, 'Need x coordinate');
  26968. } else if (this.ec.curve.type === 'short' ||
  26969. this.ec.curve.type === 'edwards') {
  26970. assert(key.x && key.y, 'Need both x and y coordinate');
  26971. }
  26972. this.pub = this.ec.curve.point(key.x, key.y);
  26973. return;
  26974. }
  26975. this.pub = this.ec.curve.decodePoint(key, enc);
  26976. };
  26977. // ECDH
  26978. KeyPair.prototype.derive = function derive(pub) {
  26979. return pub.mul(this.priv).getX();
  26980. };
  26981. // ECDSA
  26982. KeyPair.prototype.sign = function sign(msg, enc, options) {
  26983. return this.ec.sign(msg, this, enc, options);
  26984. };
  26985. KeyPair.prototype.verify = function verify(msg, signature) {
  26986. return this.ec.verify(msg, signature, this);
  26987. };
  26988. KeyPair.prototype.inspect = function inspect() {
  26989. return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
  26990. ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
  26991. };
  26992. /***/ }),
  26993. /* 201 */
  26994. /*!************************************************************!*\
  26995. !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
  26996. \************************************************************/
  26997. /*! no static exports found */
  26998. /***/ (function(module, exports, __webpack_require__) {
  26999. "use strict";
  27000. var BN = __webpack_require__(/*! bn.js */ 164);
  27001. var utils = __webpack_require__(/*! ../utils */ 177);
  27002. var assert = utils.assert;
  27003. function Signature(options, enc) {
  27004. if (options instanceof Signature)
  27005. return options;
  27006. if (this._importDER(options, enc))
  27007. return;
  27008. assert(options.r && options.s, 'Signature without r or s');
  27009. this.r = new BN(options.r, 16);
  27010. this.s = new BN(options.s, 16);
  27011. if (options.recoveryParam === undefined)
  27012. this.recoveryParam = null;
  27013. else
  27014. this.recoveryParam = options.recoveryParam;
  27015. }
  27016. module.exports = Signature;
  27017. function Position() {
  27018. this.place = 0;
  27019. }
  27020. function getLength(buf, p) {
  27021. var initial = buf[p.place++];
  27022. if (!(initial & 0x80)) {
  27023. return initial;
  27024. }
  27025. var octetLen = initial & 0xf;
  27026. var val = 0;
  27027. for (var i = 0, off = p.place; i < octetLen; i++, off++) {
  27028. val <<= 8;
  27029. val |= buf[off];
  27030. }
  27031. p.place = off;
  27032. return val;
  27033. }
  27034. function rmPadding(buf) {
  27035. var i = 0;
  27036. var len = buf.length - 1;
  27037. while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
  27038. i++;
  27039. }
  27040. if (i === 0) {
  27041. return buf;
  27042. }
  27043. return buf.slice(i);
  27044. }
  27045. Signature.prototype._importDER = function _importDER(data, enc) {
  27046. data = utils.toArray(data, enc);
  27047. var p = new Position();
  27048. if (data[p.place++] !== 0x30) {
  27049. return false;
  27050. }
  27051. var len = getLength(data, p);
  27052. if ((len + p.place) !== data.length) {
  27053. return false;
  27054. }
  27055. if (data[p.place++] !== 0x02) {
  27056. return false;
  27057. }
  27058. var rlen = getLength(data, p);
  27059. var r = data.slice(p.place, rlen + p.place);
  27060. p.place += rlen;
  27061. if (data[p.place++] !== 0x02) {
  27062. return false;
  27063. }
  27064. var slen = getLength(data, p);
  27065. if (data.length !== slen + p.place) {
  27066. return false;
  27067. }
  27068. var s = data.slice(p.place, slen + p.place);
  27069. if (r[0] === 0 && (r[1] & 0x80)) {
  27070. r = r.slice(1);
  27071. }
  27072. if (s[0] === 0 && (s[1] & 0x80)) {
  27073. s = s.slice(1);
  27074. }
  27075. this.r = new BN(r);
  27076. this.s = new BN(s);
  27077. this.recoveryParam = null;
  27078. return true;
  27079. };
  27080. function constructLength(arr, len) {
  27081. if (len < 0x80) {
  27082. arr.push(len);
  27083. return;
  27084. }
  27085. var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
  27086. arr.push(octets | 0x80);
  27087. while (--octets) {
  27088. arr.push((len >>> (octets << 3)) & 0xff);
  27089. }
  27090. arr.push(len);
  27091. }
  27092. Signature.prototype.toDER = function toDER(enc) {
  27093. var r = this.r.toArray();
  27094. var s = this.s.toArray();
  27095. // Pad values
  27096. if (r[0] & 0x80)
  27097. r = [ 0 ].concat(r);
  27098. // Pad values
  27099. if (s[0] & 0x80)
  27100. s = [ 0 ].concat(s);
  27101. r = rmPadding(r);
  27102. s = rmPadding(s);
  27103. while (!s[0] && !(s[1] & 0x80)) {
  27104. s = s.slice(1);
  27105. }
  27106. var arr = [ 0x02 ];
  27107. constructLength(arr, r.length);
  27108. arr = arr.concat(r);
  27109. arr.push(0x02);
  27110. constructLength(arr, s.length);
  27111. var backHalf = arr.concat(s);
  27112. var res = [ 0x30 ];
  27113. constructLength(res, backHalf.length);
  27114. res = res.concat(backHalf);
  27115. return utils.encode(res, enc);
  27116. };
  27117. /***/ }),
  27118. /* 202 */
  27119. /*!***********************************************************!*\
  27120. !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
  27121. \***********************************************************/
  27122. /*! no static exports found */
  27123. /***/ (function(module, exports, __webpack_require__) {
  27124. "use strict";
  27125. var hash = __webpack_require__(/*! hash.js */ 185);
  27126. var curves = __webpack_require__(/*! ../curves */ 184);
  27127. var utils = __webpack_require__(/*! ../utils */ 177);
  27128. var assert = utils.assert;
  27129. var parseBytes = utils.parseBytes;
  27130. var KeyPair = __webpack_require__(/*! ./key */ 203);
  27131. var Signature = __webpack_require__(/*! ./signature */ 204);
  27132. function EDDSA(curve) {
  27133. assert(curve === 'ed25519', 'only tested with ed25519 so far');
  27134. if (!(this instanceof EDDSA))
  27135. return new EDDSA(curve);
  27136. var curve = curves[curve].curve;
  27137. this.curve = curve;
  27138. this.g = curve.g;
  27139. this.g.precompute(curve.n.bitLength() + 1);
  27140. this.pointClass = curve.point().constructor;
  27141. this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
  27142. this.hash = hash.sha512;
  27143. }
  27144. module.exports = EDDSA;
  27145. /**
  27146. * @param {Array|String} message - message bytes
  27147. * @param {Array|String|KeyPair} secret - secret bytes or a keypair
  27148. * @returns {Signature} - signature
  27149. */
  27150. EDDSA.prototype.sign = function sign(message, secret) {
  27151. message = parseBytes(message);
  27152. var key = this.keyFromSecret(secret);
  27153. var r = this.hashInt(key.messagePrefix(), message);
  27154. var R = this.g.mul(r);
  27155. var Rencoded = this.encodePoint(R);
  27156. var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
  27157. .mul(key.priv());
  27158. var S = r.add(s_).umod(this.curve.n);
  27159. return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
  27160. };
  27161. /**
  27162. * @param {Array} message - message bytes
  27163. * @param {Array|String|Signature} sig - sig bytes
  27164. * @param {Array|String|Point|KeyPair} pub - public key
  27165. * @returns {Boolean} - true if public key matches sig of message
  27166. */
  27167. EDDSA.prototype.verify = function verify(message, sig, pub) {
  27168. message = parseBytes(message);
  27169. sig = this.makeSignature(sig);
  27170. var key = this.keyFromPublic(pub);
  27171. var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
  27172. var SG = this.g.mul(sig.S());
  27173. var RplusAh = sig.R().add(key.pub().mul(h));
  27174. return RplusAh.eq(SG);
  27175. };
  27176. EDDSA.prototype.hashInt = function hashInt() {
  27177. var hash = this.hash();
  27178. for (var i = 0; i < arguments.length; i++)
  27179. hash.update(arguments[i]);
  27180. return utils.intFromLE(hash.digest()).umod(this.curve.n);
  27181. };
  27182. EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
  27183. return KeyPair.fromPublic(this, pub);
  27184. };
  27185. EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
  27186. return KeyPair.fromSecret(this, secret);
  27187. };
  27188. EDDSA.prototype.makeSignature = function makeSignature(sig) {
  27189. if (sig instanceof Signature)
  27190. return sig;
  27191. return new Signature(this, sig);
  27192. };
  27193. /**
  27194. * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
  27195. *
  27196. * EDDSA defines methods for encoding and decoding points and integers. These are
  27197. * helper convenience methods, that pass along to utility functions implied
  27198. * parameters.
  27199. *
  27200. */
  27201. EDDSA.prototype.encodePoint = function encodePoint(point) {
  27202. var enc = point.getY().toArray('le', this.encodingLength);
  27203. enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
  27204. return enc;
  27205. };
  27206. EDDSA.prototype.decodePoint = function decodePoint(bytes) {
  27207. bytes = utils.parseBytes(bytes);
  27208. var lastIx = bytes.length - 1;
  27209. var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
  27210. var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
  27211. var y = utils.intFromLE(normed);
  27212. return this.curve.pointFromY(y, xIsOdd);
  27213. };
  27214. EDDSA.prototype.encodeInt = function encodeInt(num) {
  27215. return num.toArray('le', this.encodingLength);
  27216. };
  27217. EDDSA.prototype.decodeInt = function decodeInt(bytes) {
  27218. return utils.intFromLE(bytes);
  27219. };
  27220. EDDSA.prototype.isPoint = function isPoint(val) {
  27221. return val instanceof this.pointClass;
  27222. };
  27223. /***/ }),
  27224. /* 203 */
  27225. /*!*********************************************************!*\
  27226. !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
  27227. \*********************************************************/
  27228. /*! no static exports found */
  27229. /***/ (function(module, exports, __webpack_require__) {
  27230. "use strict";
  27231. var utils = __webpack_require__(/*! ../utils */ 177);
  27232. var assert = utils.assert;
  27233. var parseBytes = utils.parseBytes;
  27234. var cachedProperty = utils.cachedProperty;
  27235. /**
  27236. * @param {EDDSA} eddsa - instance
  27237. * @param {Object} params - public/private key parameters
  27238. *
  27239. * @param {Array<Byte>} [params.secret] - secret seed bytes
  27240. * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
  27241. * @param {Array<Byte>} [params.pub] - public key point encoded as bytes
  27242. *
  27243. */
  27244. function KeyPair(eddsa, params) {
  27245. this.eddsa = eddsa;
  27246. this._secret = parseBytes(params.secret);
  27247. if (eddsa.isPoint(params.pub))
  27248. this._pub = params.pub;
  27249. else
  27250. this._pubBytes = parseBytes(params.pub);
  27251. }
  27252. KeyPair.fromPublic = function fromPublic(eddsa, pub) {
  27253. if (pub instanceof KeyPair)
  27254. return pub;
  27255. return new KeyPair(eddsa, { pub: pub });
  27256. };
  27257. KeyPair.fromSecret = function fromSecret(eddsa, secret) {
  27258. if (secret instanceof KeyPair)
  27259. return secret;
  27260. return new KeyPair(eddsa, { secret: secret });
  27261. };
  27262. KeyPair.prototype.secret = function secret() {
  27263. return this._secret;
  27264. };
  27265. cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
  27266. return this.eddsa.encodePoint(this.pub());
  27267. });
  27268. cachedProperty(KeyPair, 'pub', function pub() {
  27269. if (this._pubBytes)
  27270. return this.eddsa.decodePoint(this._pubBytes);
  27271. return this.eddsa.g.mul(this.priv());
  27272. });
  27273. cachedProperty(KeyPair, 'privBytes', function privBytes() {
  27274. var eddsa = this.eddsa;
  27275. var hash = this.hash();
  27276. var lastIx = eddsa.encodingLength - 1;
  27277. var a = hash.slice(0, eddsa.encodingLength);
  27278. a[0] &= 248;
  27279. a[lastIx] &= 127;
  27280. a[lastIx] |= 64;
  27281. return a;
  27282. });
  27283. cachedProperty(KeyPair, 'priv', function priv() {
  27284. return this.eddsa.decodeInt(this.privBytes());
  27285. });
  27286. cachedProperty(KeyPair, 'hash', function hash() {
  27287. return this.eddsa.hash().update(this.secret()).digest();
  27288. });
  27289. cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
  27290. return this.hash().slice(this.eddsa.encodingLength);
  27291. });
  27292. KeyPair.prototype.sign = function sign(message) {
  27293. assert(this._secret, 'KeyPair can only verify');
  27294. return this.eddsa.sign(message, this);
  27295. };
  27296. KeyPair.prototype.verify = function verify(message, sig) {
  27297. return this.eddsa.verify(message, sig, this);
  27298. };
  27299. KeyPair.prototype.getSecret = function getSecret(enc) {
  27300. assert(this._secret, 'KeyPair is public only');
  27301. return utils.encode(this.secret(), enc);
  27302. };
  27303. KeyPair.prototype.getPublic = function getPublic(enc) {
  27304. return utils.encode(this.pubBytes(), enc);
  27305. };
  27306. module.exports = KeyPair;
  27307. /***/ }),
  27308. /* 204 */
  27309. /*!***************************************************************!*\
  27310. !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
  27311. \***************************************************************/
  27312. /*! no static exports found */
  27313. /***/ (function(module, exports, __webpack_require__) {
  27314. "use strict";
  27315. var BN = __webpack_require__(/*! bn.js */ 164);
  27316. var utils = __webpack_require__(/*! ../utils */ 177);
  27317. var assert = utils.assert;
  27318. var cachedProperty = utils.cachedProperty;
  27319. var parseBytes = utils.parseBytes;
  27320. /**
  27321. * @param {EDDSA} eddsa - eddsa instance
  27322. * @param {Array<Bytes>|Object} sig -
  27323. * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
  27324. * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
  27325. * @param {Array<Bytes>} [sig.Rencoded] - R point encoded
  27326. * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
  27327. */
  27328. function Signature(eddsa, sig) {
  27329. this.eddsa = eddsa;
  27330. if (typeof sig !== 'object')
  27331. sig = parseBytes(sig);
  27332. if (Array.isArray(sig)) {
  27333. sig = {
  27334. R: sig.slice(0, eddsa.encodingLength),
  27335. S: sig.slice(eddsa.encodingLength)
  27336. };
  27337. }
  27338. assert(sig.R && sig.S, 'Signature without R or S');
  27339. if (eddsa.isPoint(sig.R))
  27340. this._R = sig.R;
  27341. if (sig.S instanceof BN)
  27342. this._S = sig.S;
  27343. this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
  27344. this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
  27345. }
  27346. cachedProperty(Signature, 'S', function S() {
  27347. return this.eddsa.decodeInt(this.Sencoded());
  27348. });
  27349. cachedProperty(Signature, 'R', function R() {
  27350. return this.eddsa.decodePoint(this.Rencoded());
  27351. });
  27352. cachedProperty(Signature, 'Rencoded', function Rencoded() {
  27353. return this.eddsa.encodePoint(this.R());
  27354. });
  27355. cachedProperty(Signature, 'Sencoded', function Sencoded() {
  27356. return this.eddsa.encodeInt(this.S());
  27357. });
  27358. Signature.prototype.toBytes = function toBytes() {
  27359. return this.Rencoded().concat(this.Sencoded());
  27360. };
  27361. Signature.prototype.toHex = function toHex() {
  27362. return utils.encode(this.toBytes(), 'hex').toUpperCase();
  27363. };
  27364. module.exports = Signature;
  27365. /***/ }),
  27366. /* 205 */
  27367. /*!******************************************!*\
  27368. !*** ./node_modules/parse-asn1/index.js ***!
  27369. \******************************************/
  27370. /*! no static exports found */
  27371. /***/ (function(module, exports, __webpack_require__) {
  27372. var asn1 = __webpack_require__(/*! ./asn1 */ 206)
  27373. var aesid = __webpack_require__(/*! ./aesid.json */ 223)
  27374. var fixProc = __webpack_require__(/*! ./fixProc */ 224)
  27375. var ciphers = __webpack_require__(/*! browserify-aes */ 142)
  27376. var compat = __webpack_require__(/*! pbkdf2 */ 127)
  27377. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  27378. module.exports = parseKeys
  27379. function parseKeys (buffer) {
  27380. var password
  27381. if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
  27382. password = buffer.passphrase
  27383. buffer = buffer.key
  27384. }
  27385. if (typeof buffer === 'string') {
  27386. buffer = Buffer.from(buffer)
  27387. }
  27388. var stripped = fixProc(buffer, password)
  27389. var type = stripped.tag
  27390. var data = stripped.data
  27391. var subtype, ndata
  27392. switch (type) {
  27393. case 'CERTIFICATE':
  27394. ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
  27395. // falls through
  27396. case 'PUBLIC KEY':
  27397. if (!ndata) {
  27398. ndata = asn1.PublicKey.decode(data, 'der')
  27399. }
  27400. subtype = ndata.algorithm.algorithm.join('.')
  27401. switch (subtype) {
  27402. case '1.2.840.113549.1.1.1':
  27403. return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
  27404. case '1.2.840.10045.2.1':
  27405. ndata.subjectPrivateKey = ndata.subjectPublicKey
  27406. return {
  27407. type: 'ec',
  27408. data: ndata
  27409. }
  27410. case '1.2.840.10040.4.1':
  27411. ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
  27412. return {
  27413. type: 'dsa',
  27414. data: ndata.algorithm.params
  27415. }
  27416. default: throw new Error('unknown key id ' + subtype)
  27417. }
  27418. throw new Error('unknown key type ' + type)
  27419. case 'ENCRYPTED PRIVATE KEY':
  27420. data = asn1.EncryptedPrivateKey.decode(data, 'der')
  27421. data = decrypt(data, password)
  27422. // falls through
  27423. case 'PRIVATE KEY':
  27424. ndata = asn1.PrivateKey.decode(data, 'der')
  27425. subtype = ndata.algorithm.algorithm.join('.')
  27426. switch (subtype) {
  27427. case '1.2.840.113549.1.1.1':
  27428. return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
  27429. case '1.2.840.10045.2.1':
  27430. return {
  27431. curve: ndata.algorithm.curve,
  27432. privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
  27433. }
  27434. case '1.2.840.10040.4.1':
  27435. ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
  27436. return {
  27437. type: 'dsa',
  27438. params: ndata.algorithm.params
  27439. }
  27440. default: throw new Error('unknown key id ' + subtype)
  27441. }
  27442. throw new Error('unknown key type ' + type)
  27443. case 'RSA PUBLIC KEY':
  27444. return asn1.RSAPublicKey.decode(data, 'der')
  27445. case 'RSA PRIVATE KEY':
  27446. return asn1.RSAPrivateKey.decode(data, 'der')
  27447. case 'DSA PRIVATE KEY':
  27448. return {
  27449. type: 'dsa',
  27450. params: asn1.DSAPrivateKey.decode(data, 'der')
  27451. }
  27452. case 'EC PRIVATE KEY':
  27453. data = asn1.ECPrivateKey.decode(data, 'der')
  27454. return {
  27455. curve: data.parameters.value,
  27456. privateKey: data.privateKey
  27457. }
  27458. default: throw new Error('unknown key type ' + type)
  27459. }
  27460. }
  27461. parseKeys.signature = asn1.signature
  27462. function decrypt (data, password) {
  27463. var salt = data.algorithm.decrypt.kde.kdeparams.salt
  27464. var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
  27465. var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
  27466. var iv = data.algorithm.decrypt.cipher.iv
  27467. var cipherText = data.subjectPrivateKey
  27468. var keylen = parseInt(algo.split('-')[1], 10) / 8
  27469. var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
  27470. var cipher = ciphers.createDecipheriv(algo, key, iv)
  27471. var out = []
  27472. out.push(cipher.update(cipherText))
  27473. out.push(cipher.final())
  27474. return Buffer.concat(out)
  27475. }
  27476. /***/ }),
  27477. /* 206 */
  27478. /*!*****************************************!*\
  27479. !*** ./node_modules/parse-asn1/asn1.js ***!
  27480. \*****************************************/
  27481. /*! no static exports found */
  27482. /***/ (function(module, exports, __webpack_require__) {
  27483. "use strict";
  27484. // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
  27485. // Fedor, you are amazing.
  27486. var asn1 = __webpack_require__(/*! asn1.js */ 207)
  27487. exports.certificate = __webpack_require__(/*! ./certificate */ 222)
  27488. var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
  27489. this.seq().obj(
  27490. this.key('version').int(),
  27491. this.key('modulus').int(),
  27492. this.key('publicExponent').int(),
  27493. this.key('privateExponent').int(),
  27494. this.key('prime1').int(),
  27495. this.key('prime2').int(),
  27496. this.key('exponent1').int(),
  27497. this.key('exponent2').int(),
  27498. this.key('coefficient').int()
  27499. )
  27500. })
  27501. exports.RSAPrivateKey = RSAPrivateKey
  27502. var RSAPublicKey = asn1.define('RSAPublicKey', function () {
  27503. this.seq().obj(
  27504. this.key('modulus').int(),
  27505. this.key('publicExponent').int()
  27506. )
  27507. })
  27508. exports.RSAPublicKey = RSAPublicKey
  27509. var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
  27510. this.seq().obj(
  27511. this.key('algorithm').use(AlgorithmIdentifier),
  27512. this.key('subjectPublicKey').bitstr()
  27513. )
  27514. })
  27515. exports.PublicKey = PublicKey
  27516. var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
  27517. this.seq().obj(
  27518. this.key('algorithm').objid(),
  27519. this.key('none').null_().optional(),
  27520. this.key('curve').objid().optional(),
  27521. this.key('params').seq().obj(
  27522. this.key('p').int(),
  27523. this.key('q').int(),
  27524. this.key('g').int()
  27525. ).optional()
  27526. )
  27527. })
  27528. var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
  27529. this.seq().obj(
  27530. this.key('version').int(),
  27531. this.key('algorithm').use(AlgorithmIdentifier),
  27532. this.key('subjectPrivateKey').octstr()
  27533. )
  27534. })
  27535. exports.PrivateKey = PrivateKeyInfo
  27536. var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
  27537. this.seq().obj(
  27538. this.key('algorithm').seq().obj(
  27539. this.key('id').objid(),
  27540. this.key('decrypt').seq().obj(
  27541. this.key('kde').seq().obj(
  27542. this.key('id').objid(),
  27543. this.key('kdeparams').seq().obj(
  27544. this.key('salt').octstr(),
  27545. this.key('iters').int()
  27546. )
  27547. ),
  27548. this.key('cipher').seq().obj(
  27549. this.key('algo').objid(),
  27550. this.key('iv').octstr()
  27551. )
  27552. )
  27553. ),
  27554. this.key('subjectPrivateKey').octstr()
  27555. )
  27556. })
  27557. exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
  27558. var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
  27559. this.seq().obj(
  27560. this.key('version').int(),
  27561. this.key('p').int(),
  27562. this.key('q').int(),
  27563. this.key('g').int(),
  27564. this.key('pub_key').int(),
  27565. this.key('priv_key').int()
  27566. )
  27567. })
  27568. exports.DSAPrivateKey = DSAPrivateKey
  27569. exports.DSAparam = asn1.define('DSAparam', function () {
  27570. this.int()
  27571. })
  27572. var ECPrivateKey = asn1.define('ECPrivateKey', function () {
  27573. this.seq().obj(
  27574. this.key('version').int(),
  27575. this.key('privateKey').octstr(),
  27576. this.key('parameters').optional().explicit(0).use(ECParameters),
  27577. this.key('publicKey').optional().explicit(1).bitstr()
  27578. )
  27579. })
  27580. exports.ECPrivateKey = ECPrivateKey
  27581. var ECParameters = asn1.define('ECParameters', function () {
  27582. this.choice({
  27583. namedCurve: this.objid()
  27584. })
  27585. })
  27586. exports.signature = asn1.define('signature', function () {
  27587. this.seq().obj(
  27588. this.key('r').int(),
  27589. this.key('s').int()
  27590. )
  27591. })
  27592. /***/ }),
  27593. /* 207 */
  27594. /*!******************************************!*\
  27595. !*** ./node_modules/asn1.js/lib/asn1.js ***!
  27596. \******************************************/
  27597. /*! no static exports found */
  27598. /***/ (function(module, exports, __webpack_require__) {
  27599. var asn1 = exports;
  27600. asn1.bignum = __webpack_require__(/*! bn.js */ 164);
  27601. asn1.define = __webpack_require__(/*! ./asn1/api */ 208).define;
  27602. asn1.base = __webpack_require__(/*! ./asn1/base */ 210);
  27603. asn1.constants = __webpack_require__(/*! ./asn1/constants */ 214);
  27604. asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 216);
  27605. asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 219);
  27606. /***/ }),
  27607. /* 208 */
  27608. /*!**********************************************!*\
  27609. !*** ./node_modules/asn1.js/lib/asn1/api.js ***!
  27610. \**********************************************/
  27611. /*! no static exports found */
  27612. /***/ (function(module, exports, __webpack_require__) {
  27613. var asn1 = __webpack_require__(/*! ../asn1 */ 207);
  27614. var inherits = __webpack_require__(/*! inherits */ 88);
  27615. var api = exports;
  27616. api.define = function define(name, body) {
  27617. return new Entity(name, body);
  27618. };
  27619. function Entity(name, body) {
  27620. this.name = name;
  27621. this.body = body;
  27622. this.decoders = {};
  27623. this.encoders = {};
  27624. };
  27625. Entity.prototype._createNamed = function createNamed(base) {
  27626. var named;
  27627. try {
  27628. named = __webpack_require__(/*! vm */ 209).runInThisContext(
  27629. '(function ' + this.name + '(entity) {\n' +
  27630. ' this._initNamed(entity);\n' +
  27631. '})'
  27632. );
  27633. } catch (e) {
  27634. named = function (entity) {
  27635. this._initNamed(entity);
  27636. };
  27637. }
  27638. inherits(named, base);
  27639. named.prototype._initNamed = function initnamed(entity) {
  27640. base.call(this, entity);
  27641. };
  27642. return new named(this);
  27643. };
  27644. Entity.prototype._getDecoder = function _getDecoder(enc) {
  27645. enc = enc || 'der';
  27646. // Lazily create decoder
  27647. if (!this.decoders.hasOwnProperty(enc))
  27648. this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
  27649. return this.decoders[enc];
  27650. };
  27651. Entity.prototype.decode = function decode(data, enc, options) {
  27652. return this._getDecoder(enc).decode(data, options);
  27653. };
  27654. Entity.prototype._getEncoder = function _getEncoder(enc) {
  27655. enc = enc || 'der';
  27656. // Lazily create encoder
  27657. if (!this.encoders.hasOwnProperty(enc))
  27658. this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
  27659. return this.encoders[enc];
  27660. };
  27661. Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
  27662. return this._getEncoder(enc).encode(data, reporter);
  27663. };
  27664. /***/ }),
  27665. /* 209 */
  27666. /*!*********************************************!*\
  27667. !*** ./node_modules/vm-browserify/index.js ***!
  27668. \*********************************************/
  27669. /*! no static exports found */
  27670. /***/ (function(module, exports) {
  27671. var indexOf = function (xs, item) {
  27672. if (xs.indexOf) return xs.indexOf(item);
  27673. else for (var i = 0; i < xs.length; i++) {
  27674. if (xs[i] === item) return i;
  27675. }
  27676. return -1;
  27677. };
  27678. var Object_keys = function (obj) {
  27679. if (Object.keys) return Object.keys(obj)
  27680. else {
  27681. var res = [];
  27682. for (var key in obj) res.push(key)
  27683. return res;
  27684. }
  27685. };
  27686. var forEach = function (xs, fn) {
  27687. if (xs.forEach) return xs.forEach(fn)
  27688. else for (var i = 0; i < xs.length; i++) {
  27689. fn(xs[i], i, xs);
  27690. }
  27691. };
  27692. var defineProp = (function() {
  27693. try {
  27694. Object.defineProperty({}, '_', {});
  27695. return function(obj, name, value) {
  27696. Object.defineProperty(obj, name, {
  27697. writable: true,
  27698. enumerable: false,
  27699. configurable: true,
  27700. value: value
  27701. })
  27702. };
  27703. } catch(e) {
  27704. return function(obj, name, value) {
  27705. obj[name] = value;
  27706. };
  27707. }
  27708. }());
  27709. var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
  27710. 'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
  27711. 'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
  27712. 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
  27713. 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
  27714. function Context() {}
  27715. Context.prototype = {};
  27716. var Script = exports.Script = function NodeScript (code) {
  27717. if (!(this instanceof Script)) return new Script(code);
  27718. this.code = code;
  27719. };
  27720. Script.prototype.runInContext = function (context) {
  27721. if (!(context instanceof Context)) {
  27722. throw new TypeError("needs a 'context' argument.");
  27723. }
  27724. var iframe = document.createElement('iframe');
  27725. if (!iframe.style) iframe.style = {};
  27726. iframe.style.display = 'none';
  27727. document.body.appendChild(iframe);
  27728. var win = iframe.contentWindow;
  27729. var wEval = win.eval, wExecScript = win.execScript;
  27730. if (!wEval && wExecScript) {
  27731. // win.eval() magically appears when this is called in IE:
  27732. wExecScript.call(win, 'null');
  27733. wEval = win.eval;
  27734. }
  27735. forEach(Object_keys(context), function (key) {
  27736. win[key] = context[key];
  27737. });
  27738. forEach(globals, function (key) {
  27739. if (context[key]) {
  27740. win[key] = context[key];
  27741. }
  27742. });
  27743. var winKeys = Object_keys(win);
  27744. var res = wEval.call(win, this.code);
  27745. forEach(Object_keys(win), function (key) {
  27746. // Avoid copying circular objects like `top` and `window` by only
  27747. // updating existing context properties or new properties in the `win`
  27748. // that was only introduced after the eval.
  27749. if (key in context || indexOf(winKeys, key) === -1) {
  27750. context[key] = win[key];
  27751. }
  27752. });
  27753. forEach(globals, function (key) {
  27754. if (!(key in context)) {
  27755. defineProp(context, key, win[key]);
  27756. }
  27757. });
  27758. document.body.removeChild(iframe);
  27759. return res;
  27760. };
  27761. Script.prototype.runInThisContext = function () {
  27762. return eval(this.code); // maybe...
  27763. };
  27764. Script.prototype.runInNewContext = function (context) {
  27765. var ctx = Script.createContext(context);
  27766. var res = this.runInContext(ctx);
  27767. if (context) {
  27768. forEach(Object_keys(ctx), function (key) {
  27769. context[key] = ctx[key];
  27770. });
  27771. }
  27772. return res;
  27773. };
  27774. forEach(Object_keys(Script.prototype), function (name) {
  27775. exports[name] = Script[name] = function (code) {
  27776. var s = Script(code);
  27777. return s[name].apply(s, [].slice.call(arguments, 1));
  27778. };
  27779. });
  27780. exports.isContext = function (context) {
  27781. return context instanceof Context;
  27782. };
  27783. exports.createScript = function (code) {
  27784. return exports.Script(code);
  27785. };
  27786. exports.createContext = Script.createContext = function (context) {
  27787. var copy = new Context();
  27788. if(typeof context === 'object') {
  27789. forEach(Object_keys(context), function (key) {
  27790. copy[key] = context[key];
  27791. });
  27792. }
  27793. return copy;
  27794. };
  27795. /***/ }),
  27796. /* 210 */
  27797. /*!*****************************************************!*\
  27798. !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
  27799. \*****************************************************/
  27800. /*! no static exports found */
  27801. /***/ (function(module, exports, __webpack_require__) {
  27802. var base = exports;
  27803. base.Reporter = __webpack_require__(/*! ./reporter */ 211).Reporter;
  27804. base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 212).DecoderBuffer;
  27805. base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 212).EncoderBuffer;
  27806. base.Node = __webpack_require__(/*! ./node */ 213);
  27807. /***/ }),
  27808. /* 211 */
  27809. /*!********************************************************!*\
  27810. !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
  27811. \********************************************************/
  27812. /*! no static exports found */
  27813. /***/ (function(module, exports, __webpack_require__) {
  27814. var inherits = __webpack_require__(/*! inherits */ 88);
  27815. function Reporter(options) {
  27816. this._reporterState = {
  27817. obj: null,
  27818. path: [],
  27819. options: options || {},
  27820. errors: []
  27821. };
  27822. }
  27823. exports.Reporter = Reporter;
  27824. Reporter.prototype.isError = function isError(obj) {
  27825. return obj instanceof ReporterError;
  27826. };
  27827. Reporter.prototype.save = function save() {
  27828. var state = this._reporterState;
  27829. return { obj: state.obj, pathLen: state.path.length };
  27830. };
  27831. Reporter.prototype.restore = function restore(data) {
  27832. var state = this._reporterState;
  27833. state.obj = data.obj;
  27834. state.path = state.path.slice(0, data.pathLen);
  27835. };
  27836. Reporter.prototype.enterKey = function enterKey(key) {
  27837. return this._reporterState.path.push(key);
  27838. };
  27839. Reporter.prototype.exitKey = function exitKey(index) {
  27840. var state = this._reporterState;
  27841. state.path = state.path.slice(0, index - 1);
  27842. };
  27843. Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
  27844. var state = this._reporterState;
  27845. this.exitKey(index);
  27846. if (state.obj !== null)
  27847. state.obj[key] = value;
  27848. };
  27849. Reporter.prototype.path = function path() {
  27850. return this._reporterState.path.join('/');
  27851. };
  27852. Reporter.prototype.enterObject = function enterObject() {
  27853. var state = this._reporterState;
  27854. var prev = state.obj;
  27855. state.obj = {};
  27856. return prev;
  27857. };
  27858. Reporter.prototype.leaveObject = function leaveObject(prev) {
  27859. var state = this._reporterState;
  27860. var now = state.obj;
  27861. state.obj = prev;
  27862. return now;
  27863. };
  27864. Reporter.prototype.error = function error(msg) {
  27865. var err;
  27866. var state = this._reporterState;
  27867. var inherited = msg instanceof ReporterError;
  27868. if (inherited) {
  27869. err = msg;
  27870. } else {
  27871. err = new ReporterError(state.path.map(function(elem) {
  27872. return '[' + JSON.stringify(elem) + ']';
  27873. }).join(''), msg.message || msg, msg.stack);
  27874. }
  27875. if (!state.options.partial)
  27876. throw err;
  27877. if (!inherited)
  27878. state.errors.push(err);
  27879. return err;
  27880. };
  27881. Reporter.prototype.wrapResult = function wrapResult(result) {
  27882. var state = this._reporterState;
  27883. if (!state.options.partial)
  27884. return result;
  27885. return {
  27886. result: this.isError(result) ? null : result,
  27887. errors: state.errors
  27888. };
  27889. };
  27890. function ReporterError(path, msg) {
  27891. this.path = path;
  27892. this.rethrow(msg);
  27893. };
  27894. inherits(ReporterError, Error);
  27895. ReporterError.prototype.rethrow = function rethrow(msg) {
  27896. this.message = msg + ' at: ' + (this.path || '(shallow)');
  27897. if (Error.captureStackTrace)
  27898. Error.captureStackTrace(this, ReporterError);
  27899. if (!this.stack) {
  27900. try {
  27901. // IE only adds stack when thrown
  27902. throw new Error(this.message);
  27903. } catch (e) {
  27904. this.stack = e.stack;
  27905. }
  27906. }
  27907. return this;
  27908. };
  27909. /***/ }),
  27910. /* 212 */
  27911. /*!******************************************************!*\
  27912. !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
  27913. \******************************************************/
  27914. /*! no static exports found */
  27915. /***/ (function(module, exports, __webpack_require__) {
  27916. var inherits = __webpack_require__(/*! inherits */ 88);
  27917. var Reporter = __webpack_require__(/*! ../base */ 210).Reporter;
  27918. var Buffer = __webpack_require__(/*! buffer */ 83).Buffer;
  27919. function DecoderBuffer(base, options) {
  27920. Reporter.call(this, options);
  27921. if (!Buffer.isBuffer(base)) {
  27922. this.error('Input not Buffer');
  27923. return;
  27924. }
  27925. this.base = base;
  27926. this.offset = 0;
  27927. this.length = base.length;
  27928. }
  27929. inherits(DecoderBuffer, Reporter);
  27930. exports.DecoderBuffer = DecoderBuffer;
  27931. DecoderBuffer.prototype.save = function save() {
  27932. return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
  27933. };
  27934. DecoderBuffer.prototype.restore = function restore(save) {
  27935. // Return skipped data
  27936. var res = new DecoderBuffer(this.base);
  27937. res.offset = save.offset;
  27938. res.length = this.offset;
  27939. this.offset = save.offset;
  27940. Reporter.prototype.restore.call(this, save.reporter);
  27941. return res;
  27942. };
  27943. DecoderBuffer.prototype.isEmpty = function isEmpty() {
  27944. return this.offset === this.length;
  27945. };
  27946. DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
  27947. if (this.offset + 1 <= this.length)
  27948. return this.base.readUInt8(this.offset++, true);
  27949. else
  27950. return this.error(fail || 'DecoderBuffer overrun');
  27951. }
  27952. DecoderBuffer.prototype.skip = function skip(bytes, fail) {
  27953. if (!(this.offset + bytes <= this.length))
  27954. return this.error(fail || 'DecoderBuffer overrun');
  27955. var res = new DecoderBuffer(this.base);
  27956. // Share reporter state
  27957. res._reporterState = this._reporterState;
  27958. res.offset = this.offset;
  27959. res.length = this.offset + bytes;
  27960. this.offset += bytes;
  27961. return res;
  27962. }
  27963. DecoderBuffer.prototype.raw = function raw(save) {
  27964. return this.base.slice(save ? save.offset : this.offset, this.length);
  27965. }
  27966. function EncoderBuffer(value, reporter) {
  27967. if (Array.isArray(value)) {
  27968. this.length = 0;
  27969. this.value = value.map(function(item) {
  27970. if (!(item instanceof EncoderBuffer))
  27971. item = new EncoderBuffer(item, reporter);
  27972. this.length += item.length;
  27973. return item;
  27974. }, this);
  27975. } else if (typeof value === 'number') {
  27976. if (!(0 <= value && value <= 0xff))
  27977. return reporter.error('non-byte EncoderBuffer value');
  27978. this.value = value;
  27979. this.length = 1;
  27980. } else if (typeof value === 'string') {
  27981. this.value = value;
  27982. this.length = Buffer.byteLength(value);
  27983. } else if (Buffer.isBuffer(value)) {
  27984. this.value = value;
  27985. this.length = value.length;
  27986. } else {
  27987. return reporter.error('Unsupported type: ' + typeof value);
  27988. }
  27989. }
  27990. exports.EncoderBuffer = EncoderBuffer;
  27991. EncoderBuffer.prototype.join = function join(out, offset) {
  27992. if (!out)
  27993. out = new Buffer(this.length);
  27994. if (!offset)
  27995. offset = 0;
  27996. if (this.length === 0)
  27997. return out;
  27998. if (Array.isArray(this.value)) {
  27999. this.value.forEach(function(item) {
  28000. item.join(out, offset);
  28001. offset += item.length;
  28002. });
  28003. } else {
  28004. if (typeof this.value === 'number')
  28005. out[offset] = this.value;
  28006. else if (typeof this.value === 'string')
  28007. out.write(this.value, offset);
  28008. else if (Buffer.isBuffer(this.value))
  28009. this.value.copy(out, offset);
  28010. offset += this.length;
  28011. }
  28012. return out;
  28013. };
  28014. /***/ }),
  28015. /* 213 */
  28016. /*!****************************************************!*\
  28017. !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
  28018. \****************************************************/
  28019. /*! no static exports found */
  28020. /***/ (function(module, exports, __webpack_require__) {
  28021. var Reporter = __webpack_require__(/*! ../base */ 210).Reporter;
  28022. var EncoderBuffer = __webpack_require__(/*! ../base */ 210).EncoderBuffer;
  28023. var DecoderBuffer = __webpack_require__(/*! ../base */ 210).DecoderBuffer;
  28024. var assert = __webpack_require__(/*! minimalistic-assert */ 138);
  28025. // Supported tags
  28026. var tags = [
  28027. 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
  28028. 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
  28029. 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
  28030. 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
  28031. ];
  28032. // Public methods list
  28033. var methods = [
  28034. 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
  28035. 'any', 'contains'
  28036. ].concat(tags);
  28037. // Overrided methods list
  28038. var overrided = [
  28039. '_peekTag', '_decodeTag', '_use',
  28040. '_decodeStr', '_decodeObjid', '_decodeTime',
  28041. '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
  28042. '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
  28043. '_encodeNull', '_encodeInt', '_encodeBool'
  28044. ];
  28045. function Node(enc, parent) {
  28046. var state = {};
  28047. this._baseState = state;
  28048. state.enc = enc;
  28049. state.parent = parent || null;
  28050. state.children = null;
  28051. // State
  28052. state.tag = null;
  28053. state.args = null;
  28054. state.reverseArgs = null;
  28055. state.choice = null;
  28056. state.optional = false;
  28057. state.any = false;
  28058. state.obj = false;
  28059. state.use = null;
  28060. state.useDecoder = null;
  28061. state.key = null;
  28062. state['default'] = null;
  28063. state.explicit = null;
  28064. state.implicit = null;
  28065. state.contains = null;
  28066. // Should create new instance on each method
  28067. if (!state.parent) {
  28068. state.children = [];
  28069. this._wrap();
  28070. }
  28071. }
  28072. module.exports = Node;
  28073. var stateProps = [
  28074. 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
  28075. 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
  28076. 'implicit', 'contains'
  28077. ];
  28078. Node.prototype.clone = function clone() {
  28079. var state = this._baseState;
  28080. var cstate = {};
  28081. stateProps.forEach(function(prop) {
  28082. cstate[prop] = state[prop];
  28083. });
  28084. var res = new this.constructor(cstate.parent);
  28085. res._baseState = cstate;
  28086. return res;
  28087. };
  28088. Node.prototype._wrap = function wrap() {
  28089. var state = this._baseState;
  28090. methods.forEach(function(method) {
  28091. this[method] = function _wrappedMethod() {
  28092. var clone = new this.constructor(this);
  28093. state.children.push(clone);
  28094. return clone[method].apply(clone, arguments);
  28095. };
  28096. }, this);
  28097. };
  28098. Node.prototype._init = function init(body) {
  28099. var state = this._baseState;
  28100. assert(state.parent === null);
  28101. body.call(this);
  28102. // Filter children
  28103. state.children = state.children.filter(function(child) {
  28104. return child._baseState.parent === this;
  28105. }, this);
  28106. assert.equal(state.children.length, 1, 'Root node can have only one child');
  28107. };
  28108. Node.prototype._useArgs = function useArgs(args) {
  28109. var state = this._baseState;
  28110. // Filter children and args
  28111. var children = args.filter(function(arg) {
  28112. return arg instanceof this.constructor;
  28113. }, this);
  28114. args = args.filter(function(arg) {
  28115. return !(arg instanceof this.constructor);
  28116. }, this);
  28117. if (children.length !== 0) {
  28118. assert(state.children === null);
  28119. state.children = children;
  28120. // Replace parent to maintain backward link
  28121. children.forEach(function(child) {
  28122. child._baseState.parent = this;
  28123. }, this);
  28124. }
  28125. if (args.length !== 0) {
  28126. assert(state.args === null);
  28127. state.args = args;
  28128. state.reverseArgs = args.map(function(arg) {
  28129. if (typeof arg !== 'object' || arg.constructor !== Object)
  28130. return arg;
  28131. var res = {};
  28132. Object.keys(arg).forEach(function(key) {
  28133. if (key == (key | 0))
  28134. key |= 0;
  28135. var value = arg[key];
  28136. res[value] = key;
  28137. });
  28138. return res;
  28139. });
  28140. }
  28141. };
  28142. //
  28143. // Overrided methods
  28144. //
  28145. overrided.forEach(function(method) {
  28146. Node.prototype[method] = function _overrided() {
  28147. var state = this._baseState;
  28148. throw new Error(method + ' not implemented for encoding: ' + state.enc);
  28149. };
  28150. });
  28151. //
  28152. // Public methods
  28153. //
  28154. tags.forEach(function(tag) {
  28155. Node.prototype[tag] = function _tagMethod() {
  28156. var state = this._baseState;
  28157. var args = Array.prototype.slice.call(arguments);
  28158. assert(state.tag === null);
  28159. state.tag = tag;
  28160. this._useArgs(args);
  28161. return this;
  28162. };
  28163. });
  28164. Node.prototype.use = function use(item) {
  28165. assert(item);
  28166. var state = this._baseState;
  28167. assert(state.use === null);
  28168. state.use = item;
  28169. return this;
  28170. };
  28171. Node.prototype.optional = function optional() {
  28172. var state = this._baseState;
  28173. state.optional = true;
  28174. return this;
  28175. };
  28176. Node.prototype.def = function def(val) {
  28177. var state = this._baseState;
  28178. assert(state['default'] === null);
  28179. state['default'] = val;
  28180. state.optional = true;
  28181. return this;
  28182. };
  28183. Node.prototype.explicit = function explicit(num) {
  28184. var state = this._baseState;
  28185. assert(state.explicit === null && state.implicit === null);
  28186. state.explicit = num;
  28187. return this;
  28188. };
  28189. Node.prototype.implicit = function implicit(num) {
  28190. var state = this._baseState;
  28191. assert(state.explicit === null && state.implicit === null);
  28192. state.implicit = num;
  28193. return this;
  28194. };
  28195. Node.prototype.obj = function obj() {
  28196. var state = this._baseState;
  28197. var args = Array.prototype.slice.call(arguments);
  28198. state.obj = true;
  28199. if (args.length !== 0)
  28200. this._useArgs(args);
  28201. return this;
  28202. };
  28203. Node.prototype.key = function key(newKey) {
  28204. var state = this._baseState;
  28205. assert(state.key === null);
  28206. state.key = newKey;
  28207. return this;
  28208. };
  28209. Node.prototype.any = function any() {
  28210. var state = this._baseState;
  28211. state.any = true;
  28212. return this;
  28213. };
  28214. Node.prototype.choice = function choice(obj) {
  28215. var state = this._baseState;
  28216. assert(state.choice === null);
  28217. state.choice = obj;
  28218. this._useArgs(Object.keys(obj).map(function(key) {
  28219. return obj[key];
  28220. }));
  28221. return this;
  28222. };
  28223. Node.prototype.contains = function contains(item) {
  28224. var state = this._baseState;
  28225. assert(state.use === null);
  28226. state.contains = item;
  28227. return this;
  28228. };
  28229. //
  28230. // Decoding
  28231. //
  28232. Node.prototype._decode = function decode(input, options) {
  28233. var state = this._baseState;
  28234. // Decode root node
  28235. if (state.parent === null)
  28236. return input.wrapResult(state.children[0]._decode(input, options));
  28237. var result = state['default'];
  28238. var present = true;
  28239. var prevKey = null;
  28240. if (state.key !== null)
  28241. prevKey = input.enterKey(state.key);
  28242. // Check if tag is there
  28243. if (state.optional) {
  28244. var tag = null;
  28245. if (state.explicit !== null)
  28246. tag = state.explicit;
  28247. else if (state.implicit !== null)
  28248. tag = state.implicit;
  28249. else if (state.tag !== null)
  28250. tag = state.tag;
  28251. if (tag === null && !state.any) {
  28252. // Trial and Error
  28253. var save = input.save();
  28254. try {
  28255. if (state.choice === null)
  28256. this._decodeGeneric(state.tag, input, options);
  28257. else
  28258. this._decodeChoice(input, options);
  28259. present = true;
  28260. } catch (e) {
  28261. present = false;
  28262. }
  28263. input.restore(save);
  28264. } else {
  28265. present = this._peekTag(input, tag, state.any);
  28266. if (input.isError(present))
  28267. return present;
  28268. }
  28269. }
  28270. // Push object on stack
  28271. var prevObj;
  28272. if (state.obj && present)
  28273. prevObj = input.enterObject();
  28274. if (present) {
  28275. // Unwrap explicit values
  28276. if (state.explicit !== null) {
  28277. var explicit = this._decodeTag(input, state.explicit);
  28278. if (input.isError(explicit))
  28279. return explicit;
  28280. input = explicit;
  28281. }
  28282. var start = input.offset;
  28283. // Unwrap implicit and normal values
  28284. if (state.use === null && state.choice === null) {
  28285. if (state.any)
  28286. var save = input.save();
  28287. var body = this._decodeTag(
  28288. input,
  28289. state.implicit !== null ? state.implicit : state.tag,
  28290. state.any
  28291. );
  28292. if (input.isError(body))
  28293. return body;
  28294. if (state.any)
  28295. result = input.raw(save);
  28296. else
  28297. input = body;
  28298. }
  28299. if (options && options.track && state.tag !== null)
  28300. options.track(input.path(), start, input.length, 'tagged');
  28301. if (options && options.track && state.tag !== null)
  28302. options.track(input.path(), input.offset, input.length, 'content');
  28303. // Select proper method for tag
  28304. if (state.any)
  28305. result = result;
  28306. else if (state.choice === null)
  28307. result = this._decodeGeneric(state.tag, input, options);
  28308. else
  28309. result = this._decodeChoice(input, options);
  28310. if (input.isError(result))
  28311. return result;
  28312. // Decode children
  28313. if (!state.any && state.choice === null && state.children !== null) {
  28314. state.children.forEach(function decodeChildren(child) {
  28315. // NOTE: We are ignoring errors here, to let parser continue with other
  28316. // parts of encoded data
  28317. child._decode(input, options);
  28318. });
  28319. }
  28320. // Decode contained/encoded by schema, only in bit or octet strings
  28321. if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
  28322. var data = new DecoderBuffer(result);
  28323. result = this._getUse(state.contains, input._reporterState.obj)
  28324. ._decode(data, options);
  28325. }
  28326. }
  28327. // Pop object
  28328. if (state.obj && present)
  28329. result = input.leaveObject(prevObj);
  28330. // Set key
  28331. if (state.key !== null && (result !== null || present === true))
  28332. input.leaveKey(prevKey, state.key, result);
  28333. else if (prevKey !== null)
  28334. input.exitKey(prevKey);
  28335. return result;
  28336. };
  28337. Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
  28338. var state = this._baseState;
  28339. if (tag === 'seq' || tag === 'set')
  28340. return null;
  28341. if (tag === 'seqof' || tag === 'setof')
  28342. return this._decodeList(input, tag, state.args[0], options);
  28343. else if (/str$/.test(tag))
  28344. return this._decodeStr(input, tag, options);
  28345. else if (tag === 'objid' && state.args)
  28346. return this._decodeObjid(input, state.args[0], state.args[1], options);
  28347. else if (tag === 'objid')
  28348. return this._decodeObjid(input, null, null, options);
  28349. else if (tag === 'gentime' || tag === 'utctime')
  28350. return this._decodeTime(input, tag, options);
  28351. else if (tag === 'null_')
  28352. return this._decodeNull(input, options);
  28353. else if (tag === 'bool')
  28354. return this._decodeBool(input, options);
  28355. else if (tag === 'objDesc')
  28356. return this._decodeStr(input, tag, options);
  28357. else if (tag === 'int' || tag === 'enum')
  28358. return this._decodeInt(input, state.args && state.args[0], options);
  28359. if (state.use !== null) {
  28360. return this._getUse(state.use, input._reporterState.obj)
  28361. ._decode(input, options);
  28362. } else {
  28363. return input.error('unknown tag: ' + tag);
  28364. }
  28365. };
  28366. Node.prototype._getUse = function _getUse(entity, obj) {
  28367. var state = this._baseState;
  28368. // Create altered use decoder if implicit is set
  28369. state.useDecoder = this._use(entity, obj);
  28370. assert(state.useDecoder._baseState.parent === null);
  28371. state.useDecoder = state.useDecoder._baseState.children[0];
  28372. if (state.implicit !== state.useDecoder._baseState.implicit) {
  28373. state.useDecoder = state.useDecoder.clone();
  28374. state.useDecoder._baseState.implicit = state.implicit;
  28375. }
  28376. return state.useDecoder;
  28377. };
  28378. Node.prototype._decodeChoice = function decodeChoice(input, options) {
  28379. var state = this._baseState;
  28380. var result = null;
  28381. var match = false;
  28382. Object.keys(state.choice).some(function(key) {
  28383. var save = input.save();
  28384. var node = state.choice[key];
  28385. try {
  28386. var value = node._decode(input, options);
  28387. if (input.isError(value))
  28388. return false;
  28389. result = { type: key, value: value };
  28390. match = true;
  28391. } catch (e) {
  28392. input.restore(save);
  28393. return false;
  28394. }
  28395. return true;
  28396. }, this);
  28397. if (!match)
  28398. return input.error('Choice not matched');
  28399. return result;
  28400. };
  28401. //
  28402. // Encoding
  28403. //
  28404. Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
  28405. return new EncoderBuffer(data, this.reporter);
  28406. };
  28407. Node.prototype._encode = function encode(data, reporter, parent) {
  28408. var state = this._baseState;
  28409. if (state['default'] !== null && state['default'] === data)
  28410. return;
  28411. var result = this._encodeValue(data, reporter, parent);
  28412. if (result === undefined)
  28413. return;
  28414. if (this._skipDefault(result, reporter, parent))
  28415. return;
  28416. return result;
  28417. };
  28418. Node.prototype._encodeValue = function encode(data, reporter, parent) {
  28419. var state = this._baseState;
  28420. // Decode root node
  28421. if (state.parent === null)
  28422. return state.children[0]._encode(data, reporter || new Reporter());
  28423. var result = null;
  28424. // Set reporter to share it with a child class
  28425. this.reporter = reporter;
  28426. // Check if data is there
  28427. if (state.optional && data === undefined) {
  28428. if (state['default'] !== null)
  28429. data = state['default']
  28430. else
  28431. return;
  28432. }
  28433. // Encode children first
  28434. var content = null;
  28435. var primitive = false;
  28436. if (state.any) {
  28437. // Anything that was given is translated to buffer
  28438. result = this._createEncoderBuffer(data);
  28439. } else if (state.choice) {
  28440. result = this._encodeChoice(data, reporter);
  28441. } else if (state.contains) {
  28442. content = this._getUse(state.contains, parent)._encode(data, reporter);
  28443. primitive = true;
  28444. } else if (state.children) {
  28445. content = state.children.map(function(child) {
  28446. if (child._baseState.tag === 'null_')
  28447. return child._encode(null, reporter, data);
  28448. if (child._baseState.key === null)
  28449. return reporter.error('Child should have a key');
  28450. var prevKey = reporter.enterKey(child._baseState.key);
  28451. if (typeof data !== 'object')
  28452. return reporter.error('Child expected, but input is not object');
  28453. var res = child._encode(data[child._baseState.key], reporter, data);
  28454. reporter.leaveKey(prevKey);
  28455. return res;
  28456. }, this).filter(function(child) {
  28457. return child;
  28458. });
  28459. content = this._createEncoderBuffer(content);
  28460. } else {
  28461. if (state.tag === 'seqof' || state.tag === 'setof') {
  28462. // TODO(indutny): this should be thrown on DSL level
  28463. if (!(state.args && state.args.length === 1))
  28464. return reporter.error('Too many args for : ' + state.tag);
  28465. if (!Array.isArray(data))
  28466. return reporter.error('seqof/setof, but data is not Array');
  28467. var child = this.clone();
  28468. child._baseState.implicit = null;
  28469. content = this._createEncoderBuffer(data.map(function(item) {
  28470. var state = this._baseState;
  28471. return this._getUse(state.args[0], data)._encode(item, reporter);
  28472. }, child));
  28473. } else if (state.use !== null) {
  28474. result = this._getUse(state.use, parent)._encode(data, reporter);
  28475. } else {
  28476. content = this._encodePrimitive(state.tag, data);
  28477. primitive = true;
  28478. }
  28479. }
  28480. // Encode data itself
  28481. var result;
  28482. if (!state.any && state.choice === null) {
  28483. var tag = state.implicit !== null ? state.implicit : state.tag;
  28484. var cls = state.implicit === null ? 'universal' : 'context';
  28485. if (tag === null) {
  28486. if (state.use === null)
  28487. reporter.error('Tag could be omitted only for .use()');
  28488. } else {
  28489. if (state.use === null)
  28490. result = this._encodeComposite(tag, primitive, cls, content);
  28491. }
  28492. }
  28493. // Wrap in explicit
  28494. if (state.explicit !== null)
  28495. result = this._encodeComposite(state.explicit, false, 'context', result);
  28496. return result;
  28497. };
  28498. Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
  28499. var state = this._baseState;
  28500. var node = state.choice[data.type];
  28501. if (!node) {
  28502. assert(
  28503. false,
  28504. data.type + ' not found in ' +
  28505. JSON.stringify(Object.keys(state.choice)));
  28506. }
  28507. return node._encode(data.value, reporter);
  28508. };
  28509. Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
  28510. var state = this._baseState;
  28511. if (/str$/.test(tag))
  28512. return this._encodeStr(data, tag);
  28513. else if (tag === 'objid' && state.args)
  28514. return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
  28515. else if (tag === 'objid')
  28516. return this._encodeObjid(data, null, null);
  28517. else if (tag === 'gentime' || tag === 'utctime')
  28518. return this._encodeTime(data, tag);
  28519. else if (tag === 'null_')
  28520. return this._encodeNull();
  28521. else if (tag === 'int' || tag === 'enum')
  28522. return this._encodeInt(data, state.args && state.reverseArgs[0]);
  28523. else if (tag === 'bool')
  28524. return this._encodeBool(data);
  28525. else if (tag === 'objDesc')
  28526. return this._encodeStr(data, tag);
  28527. else
  28528. throw new Error('Unsupported tag: ' + tag);
  28529. };
  28530. Node.prototype._isNumstr = function isNumstr(str) {
  28531. return /^[0-9 ]*$/.test(str);
  28532. };
  28533. Node.prototype._isPrintstr = function isPrintstr(str) {
  28534. return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
  28535. };
  28536. /***/ }),
  28537. /* 214 */
  28538. /*!**********************************************************!*\
  28539. !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
  28540. \**********************************************************/
  28541. /*! no static exports found */
  28542. /***/ (function(module, exports, __webpack_require__) {
  28543. var constants = exports;
  28544. // Helper
  28545. constants._reverse = function reverse(map) {
  28546. var res = {};
  28547. Object.keys(map).forEach(function(key) {
  28548. // Convert key to integer if it is stringified
  28549. if ((key | 0) == key)
  28550. key = key | 0;
  28551. var value = map[key];
  28552. res[value] = key;
  28553. });
  28554. return res;
  28555. };
  28556. constants.der = __webpack_require__(/*! ./der */ 215);
  28557. /***/ }),
  28558. /* 215 */
  28559. /*!********************************************************!*\
  28560. !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
  28561. \********************************************************/
  28562. /*! no static exports found */
  28563. /***/ (function(module, exports, __webpack_require__) {
  28564. var constants = __webpack_require__(/*! ../constants */ 214);
  28565. exports.tagClass = {
  28566. 0: 'universal',
  28567. 1: 'application',
  28568. 2: 'context',
  28569. 3: 'private'
  28570. };
  28571. exports.tagClassByName = constants._reverse(exports.tagClass);
  28572. exports.tag = {
  28573. 0x00: 'end',
  28574. 0x01: 'bool',
  28575. 0x02: 'int',
  28576. 0x03: 'bitstr',
  28577. 0x04: 'octstr',
  28578. 0x05: 'null_',
  28579. 0x06: 'objid',
  28580. 0x07: 'objDesc',
  28581. 0x08: 'external',
  28582. 0x09: 'real',
  28583. 0x0a: 'enum',
  28584. 0x0b: 'embed',
  28585. 0x0c: 'utf8str',
  28586. 0x0d: 'relativeOid',
  28587. 0x10: 'seq',
  28588. 0x11: 'set',
  28589. 0x12: 'numstr',
  28590. 0x13: 'printstr',
  28591. 0x14: 't61str',
  28592. 0x15: 'videostr',
  28593. 0x16: 'ia5str',
  28594. 0x17: 'utctime',
  28595. 0x18: 'gentime',
  28596. 0x19: 'graphstr',
  28597. 0x1a: 'iso646str',
  28598. 0x1b: 'genstr',
  28599. 0x1c: 'unistr',
  28600. 0x1d: 'charstr',
  28601. 0x1e: 'bmpstr'
  28602. };
  28603. exports.tagByName = constants._reverse(exports.tag);
  28604. /***/ }),
  28605. /* 216 */
  28606. /*!*********************************************************!*\
  28607. !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
  28608. \*********************************************************/
  28609. /*! no static exports found */
  28610. /***/ (function(module, exports, __webpack_require__) {
  28611. var decoders = exports;
  28612. decoders.der = __webpack_require__(/*! ./der */ 217);
  28613. decoders.pem = __webpack_require__(/*! ./pem */ 218);
  28614. /***/ }),
  28615. /* 217 */
  28616. /*!*******************************************************!*\
  28617. !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
  28618. \*******************************************************/
  28619. /*! no static exports found */
  28620. /***/ (function(module, exports, __webpack_require__) {
  28621. var inherits = __webpack_require__(/*! inherits */ 88);
  28622. var asn1 = __webpack_require__(/*! ../../asn1 */ 207);
  28623. var base = asn1.base;
  28624. var bignum = asn1.bignum;
  28625. // Import DER constants
  28626. var der = asn1.constants.der;
  28627. function DERDecoder(entity) {
  28628. this.enc = 'der';
  28629. this.name = entity.name;
  28630. this.entity = entity;
  28631. // Construct base tree
  28632. this.tree = new DERNode();
  28633. this.tree._init(entity.body);
  28634. };
  28635. module.exports = DERDecoder;
  28636. DERDecoder.prototype.decode = function decode(data, options) {
  28637. if (!(data instanceof base.DecoderBuffer))
  28638. data = new base.DecoderBuffer(data, options);
  28639. return this.tree._decode(data, options);
  28640. };
  28641. // Tree methods
  28642. function DERNode(parent) {
  28643. base.Node.call(this, 'der', parent);
  28644. }
  28645. inherits(DERNode, base.Node);
  28646. DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
  28647. if (buffer.isEmpty())
  28648. return false;
  28649. var state = buffer.save();
  28650. var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
  28651. if (buffer.isError(decodedTag))
  28652. return decodedTag;
  28653. buffer.restore(state);
  28654. return decodedTag.tag === tag || decodedTag.tagStr === tag ||
  28655. (decodedTag.tagStr + 'of') === tag || any;
  28656. };
  28657. DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
  28658. var decodedTag = derDecodeTag(buffer,
  28659. 'Failed to decode tag of "' + tag + '"');
  28660. if (buffer.isError(decodedTag))
  28661. return decodedTag;
  28662. var len = derDecodeLen(buffer,
  28663. decodedTag.primitive,
  28664. 'Failed to get length of "' + tag + '"');
  28665. // Failure
  28666. if (buffer.isError(len))
  28667. return len;
  28668. if (!any &&
  28669. decodedTag.tag !== tag &&
  28670. decodedTag.tagStr !== tag &&
  28671. decodedTag.tagStr + 'of' !== tag) {
  28672. return buffer.error('Failed to match tag: "' + tag + '"');
  28673. }
  28674. if (decodedTag.primitive || len !== null)
  28675. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28676. // Indefinite length... find END tag
  28677. var state = buffer.save();
  28678. var res = this._skipUntilEnd(
  28679. buffer,
  28680. 'Failed to skip indefinite length body: "' + this.tag + '"');
  28681. if (buffer.isError(res))
  28682. return res;
  28683. len = buffer.offset - state.offset;
  28684. buffer.restore(state);
  28685. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28686. };
  28687. DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
  28688. while (true) {
  28689. var tag = derDecodeTag(buffer, fail);
  28690. if (buffer.isError(tag))
  28691. return tag;
  28692. var len = derDecodeLen(buffer, tag.primitive, fail);
  28693. if (buffer.isError(len))
  28694. return len;
  28695. var res;
  28696. if (tag.primitive || len !== null)
  28697. res = buffer.skip(len)
  28698. else
  28699. res = this._skipUntilEnd(buffer, fail);
  28700. // Failure
  28701. if (buffer.isError(res))
  28702. return res;
  28703. if (tag.tagStr === 'end')
  28704. break;
  28705. }
  28706. };
  28707. DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
  28708. options) {
  28709. var result = [];
  28710. while (!buffer.isEmpty()) {
  28711. var possibleEnd = this._peekTag(buffer, 'end');
  28712. if (buffer.isError(possibleEnd))
  28713. return possibleEnd;
  28714. var res = decoder.decode(buffer, 'der', options);
  28715. if (buffer.isError(res) && possibleEnd)
  28716. break;
  28717. result.push(res);
  28718. }
  28719. return result;
  28720. };
  28721. DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
  28722. if (tag === 'bitstr') {
  28723. var unused = buffer.readUInt8();
  28724. if (buffer.isError(unused))
  28725. return unused;
  28726. return { unused: unused, data: buffer.raw() };
  28727. } else if (tag === 'bmpstr') {
  28728. var raw = buffer.raw();
  28729. if (raw.length % 2 === 1)
  28730. return buffer.error('Decoding of string type: bmpstr length mismatch');
  28731. var str = '';
  28732. for (var i = 0; i < raw.length / 2; i++) {
  28733. str += String.fromCharCode(raw.readUInt16BE(i * 2));
  28734. }
  28735. return str;
  28736. } else if (tag === 'numstr') {
  28737. var numstr = buffer.raw().toString('ascii');
  28738. if (!this._isNumstr(numstr)) {
  28739. return buffer.error('Decoding of string type: ' +
  28740. 'numstr unsupported characters');
  28741. }
  28742. return numstr;
  28743. } else if (tag === 'octstr') {
  28744. return buffer.raw();
  28745. } else if (tag === 'objDesc') {
  28746. return buffer.raw();
  28747. } else if (tag === 'printstr') {
  28748. var printstr = buffer.raw().toString('ascii');
  28749. if (!this._isPrintstr(printstr)) {
  28750. return buffer.error('Decoding of string type: ' +
  28751. 'printstr unsupported characters');
  28752. }
  28753. return printstr;
  28754. } else if (/str$/.test(tag)) {
  28755. return buffer.raw().toString();
  28756. } else {
  28757. return buffer.error('Decoding of string type: ' + tag + ' unsupported');
  28758. }
  28759. };
  28760. DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
  28761. var result;
  28762. var identifiers = [];
  28763. var ident = 0;
  28764. while (!buffer.isEmpty()) {
  28765. var subident = buffer.readUInt8();
  28766. ident <<= 7;
  28767. ident |= subident & 0x7f;
  28768. if ((subident & 0x80) === 0) {
  28769. identifiers.push(ident);
  28770. ident = 0;
  28771. }
  28772. }
  28773. if (subident & 0x80)
  28774. identifiers.push(ident);
  28775. var first = (identifiers[0] / 40) | 0;
  28776. var second = identifiers[0] % 40;
  28777. if (relative)
  28778. result = identifiers;
  28779. else
  28780. result = [first, second].concat(identifiers.slice(1));
  28781. if (values) {
  28782. var tmp = values[result.join(' ')];
  28783. if (tmp === undefined)
  28784. tmp = values[result.join('.')];
  28785. if (tmp !== undefined)
  28786. result = tmp;
  28787. }
  28788. return result;
  28789. };
  28790. DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
  28791. var str = buffer.raw().toString();
  28792. if (tag === 'gentime') {
  28793. var year = str.slice(0, 4) | 0;
  28794. var mon = str.slice(4, 6) | 0;
  28795. var day = str.slice(6, 8) | 0;
  28796. var hour = str.slice(8, 10) | 0;
  28797. var min = str.slice(10, 12) | 0;
  28798. var sec = str.slice(12, 14) | 0;
  28799. } else if (tag === 'utctime') {
  28800. var year = str.slice(0, 2) | 0;
  28801. var mon = str.slice(2, 4) | 0;
  28802. var day = str.slice(4, 6) | 0;
  28803. var hour = str.slice(6, 8) | 0;
  28804. var min = str.slice(8, 10) | 0;
  28805. var sec = str.slice(10, 12) | 0;
  28806. if (year < 70)
  28807. year = 2000 + year;
  28808. else
  28809. year = 1900 + year;
  28810. } else {
  28811. return buffer.error('Decoding ' + tag + ' time is not supported yet');
  28812. }
  28813. return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
  28814. };
  28815. DERNode.prototype._decodeNull = function decodeNull(buffer) {
  28816. return null;
  28817. };
  28818. DERNode.prototype._decodeBool = function decodeBool(buffer) {
  28819. var res = buffer.readUInt8();
  28820. if (buffer.isError(res))
  28821. return res;
  28822. else
  28823. return res !== 0;
  28824. };
  28825. DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
  28826. // Bigint, return as it is (assume big endian)
  28827. var raw = buffer.raw();
  28828. var res = new bignum(raw);
  28829. if (values)
  28830. res = values[res.toString(10)] || res;
  28831. return res;
  28832. };
  28833. DERNode.prototype._use = function use(entity, obj) {
  28834. if (typeof entity === 'function')
  28835. entity = entity(obj);
  28836. return entity._getDecoder('der').tree;
  28837. };
  28838. // Utility methods
  28839. function derDecodeTag(buf, fail) {
  28840. var tag = buf.readUInt8(fail);
  28841. if (buf.isError(tag))
  28842. return tag;
  28843. var cls = der.tagClass[tag >> 6];
  28844. var primitive = (tag & 0x20) === 0;
  28845. // Multi-octet tag - load
  28846. if ((tag & 0x1f) === 0x1f) {
  28847. var oct = tag;
  28848. tag = 0;
  28849. while ((oct & 0x80) === 0x80) {
  28850. oct = buf.readUInt8(fail);
  28851. if (buf.isError(oct))
  28852. return oct;
  28853. tag <<= 7;
  28854. tag |= oct & 0x7f;
  28855. }
  28856. } else {
  28857. tag &= 0x1f;
  28858. }
  28859. var tagStr = der.tag[tag];
  28860. return {
  28861. cls: cls,
  28862. primitive: primitive,
  28863. tag: tag,
  28864. tagStr: tagStr
  28865. };
  28866. }
  28867. function derDecodeLen(buf, primitive, fail) {
  28868. var len = buf.readUInt8(fail);
  28869. if (buf.isError(len))
  28870. return len;
  28871. // Indefinite form
  28872. if (!primitive && len === 0x80)
  28873. return null;
  28874. // Definite form
  28875. if ((len & 0x80) === 0) {
  28876. // Short form
  28877. return len;
  28878. }
  28879. // Long form
  28880. var num = len & 0x7f;
  28881. if (num > 4)
  28882. return buf.error('length octect is too long');
  28883. len = 0;
  28884. for (var i = 0; i < num; i++) {
  28885. len <<= 8;
  28886. var j = buf.readUInt8(fail);
  28887. if (buf.isError(j))
  28888. return j;
  28889. len |= j;
  28890. }
  28891. return len;
  28892. }
  28893. /***/ }),
  28894. /* 218 */
  28895. /*!*******************************************************!*\
  28896. !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
  28897. \*******************************************************/
  28898. /*! no static exports found */
  28899. /***/ (function(module, exports, __webpack_require__) {
  28900. var inherits = __webpack_require__(/*! inherits */ 88);
  28901. var Buffer = __webpack_require__(/*! buffer */ 83).Buffer;
  28902. var DERDecoder = __webpack_require__(/*! ./der */ 217);
  28903. function PEMDecoder(entity) {
  28904. DERDecoder.call(this, entity);
  28905. this.enc = 'pem';
  28906. };
  28907. inherits(PEMDecoder, DERDecoder);
  28908. module.exports = PEMDecoder;
  28909. PEMDecoder.prototype.decode = function decode(data, options) {
  28910. var lines = data.toString().split(/[\r\n]+/g);
  28911. var label = options.label.toUpperCase();
  28912. var re = /^-----(BEGIN|END) ([^-]+)-----$/;
  28913. var start = -1;
  28914. var end = -1;
  28915. for (var i = 0; i < lines.length; i++) {
  28916. var match = lines[i].match(re);
  28917. if (match === null)
  28918. continue;
  28919. if (match[2] !== label)
  28920. continue;
  28921. if (start === -1) {
  28922. if (match[1] !== 'BEGIN')
  28923. break;
  28924. start = i;
  28925. } else {
  28926. if (match[1] !== 'END')
  28927. break;
  28928. end = i;
  28929. break;
  28930. }
  28931. }
  28932. if (start === -1 || end === -1)
  28933. throw new Error('PEM section not found for: ' + label);
  28934. var base64 = lines.slice(start + 1, end).join('');
  28935. // Remove excessive symbols
  28936. base64.replace(/[^a-z0-9\+\/=]+/gi, '');
  28937. var input = new Buffer(base64, 'base64');
  28938. return DERDecoder.prototype.decode.call(this, input, options);
  28939. };
  28940. /***/ }),
  28941. /* 219 */
  28942. /*!*********************************************************!*\
  28943. !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
  28944. \*********************************************************/
  28945. /*! no static exports found */
  28946. /***/ (function(module, exports, __webpack_require__) {
  28947. var encoders = exports;
  28948. encoders.der = __webpack_require__(/*! ./der */ 220);
  28949. encoders.pem = __webpack_require__(/*! ./pem */ 221);
  28950. /***/ }),
  28951. /* 220 */
  28952. /*!*******************************************************!*\
  28953. !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
  28954. \*******************************************************/
  28955. /*! no static exports found */
  28956. /***/ (function(module, exports, __webpack_require__) {
  28957. var inherits = __webpack_require__(/*! inherits */ 88);
  28958. var Buffer = __webpack_require__(/*! buffer */ 83).Buffer;
  28959. var asn1 = __webpack_require__(/*! ../../asn1 */ 207);
  28960. var base = asn1.base;
  28961. // Import DER constants
  28962. var der = asn1.constants.der;
  28963. function DEREncoder(entity) {
  28964. this.enc = 'der';
  28965. this.name = entity.name;
  28966. this.entity = entity;
  28967. // Construct base tree
  28968. this.tree = new DERNode();
  28969. this.tree._init(entity.body);
  28970. };
  28971. module.exports = DEREncoder;
  28972. DEREncoder.prototype.encode = function encode(data, reporter) {
  28973. return this.tree._encode(data, reporter).join();
  28974. };
  28975. // Tree methods
  28976. function DERNode(parent) {
  28977. base.Node.call(this, 'der', parent);
  28978. }
  28979. inherits(DERNode, base.Node);
  28980. DERNode.prototype._encodeComposite = function encodeComposite(tag,
  28981. primitive,
  28982. cls,
  28983. content) {
  28984. var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
  28985. // Short form
  28986. if (content.length < 0x80) {
  28987. var header = new Buffer(2);
  28988. header[0] = encodedTag;
  28989. header[1] = content.length;
  28990. return this._createEncoderBuffer([ header, content ]);
  28991. }
  28992. // Long form
  28993. // Count octets required to store length
  28994. var lenOctets = 1;
  28995. for (var i = content.length; i >= 0x100; i >>= 8)
  28996. lenOctets++;
  28997. var header = new Buffer(1 + 1 + lenOctets);
  28998. header[0] = encodedTag;
  28999. header[1] = 0x80 | lenOctets;
  29000. for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
  29001. header[i] = j & 0xff;
  29002. return this._createEncoderBuffer([ header, content ]);
  29003. };
  29004. DERNode.prototype._encodeStr = function encodeStr(str, tag) {
  29005. if (tag === 'bitstr') {
  29006. return this._createEncoderBuffer([ str.unused | 0, str.data ]);
  29007. } else if (tag === 'bmpstr') {
  29008. var buf = new Buffer(str.length * 2);
  29009. for (var i = 0; i < str.length; i++) {
  29010. buf.writeUInt16BE(str.charCodeAt(i), i * 2);
  29011. }
  29012. return this._createEncoderBuffer(buf);
  29013. } else if (tag === 'numstr') {
  29014. if (!this._isNumstr(str)) {
  29015. return this.reporter.error('Encoding of string type: numstr supports ' +
  29016. 'only digits and space');
  29017. }
  29018. return this._createEncoderBuffer(str);
  29019. } else if (tag === 'printstr') {
  29020. if (!this._isPrintstr(str)) {
  29021. return this.reporter.error('Encoding of string type: printstr supports ' +
  29022. 'only latin upper and lower case letters, ' +
  29023. 'digits, space, apostrophe, left and rigth ' +
  29024. 'parenthesis, plus sign, comma, hyphen, ' +
  29025. 'dot, slash, colon, equal sign, ' +
  29026. 'question mark');
  29027. }
  29028. return this._createEncoderBuffer(str);
  29029. } else if (/str$/.test(tag)) {
  29030. return this._createEncoderBuffer(str);
  29031. } else if (tag === 'objDesc') {
  29032. return this._createEncoderBuffer(str);
  29033. } else {
  29034. return this.reporter.error('Encoding of string type: ' + tag +
  29035. ' unsupported');
  29036. }
  29037. };
  29038. DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
  29039. if (typeof id === 'string') {
  29040. if (!values)
  29041. return this.reporter.error('string objid given, but no values map found');
  29042. if (!values.hasOwnProperty(id))
  29043. return this.reporter.error('objid not found in values map');
  29044. id = values[id].split(/[\s\.]+/g);
  29045. for (var i = 0; i < id.length; i++)
  29046. id[i] |= 0;
  29047. } else if (Array.isArray(id)) {
  29048. id = id.slice();
  29049. for (var i = 0; i < id.length; i++)
  29050. id[i] |= 0;
  29051. }
  29052. if (!Array.isArray(id)) {
  29053. return this.reporter.error('objid() should be either array or string, ' +
  29054. 'got: ' + JSON.stringify(id));
  29055. }
  29056. if (!relative) {
  29057. if (id[1] >= 40)
  29058. return this.reporter.error('Second objid identifier OOB');
  29059. id.splice(0, 2, id[0] * 40 + id[1]);
  29060. }
  29061. // Count number of octets
  29062. var size = 0;
  29063. for (var i = 0; i < id.length; i++) {
  29064. var ident = id[i];
  29065. for (size++; ident >= 0x80; ident >>= 7)
  29066. size++;
  29067. }
  29068. var objid = new Buffer(size);
  29069. var offset = objid.length - 1;
  29070. for (var i = id.length - 1; i >= 0; i--) {
  29071. var ident = id[i];
  29072. objid[offset--] = ident & 0x7f;
  29073. while ((ident >>= 7) > 0)
  29074. objid[offset--] = 0x80 | (ident & 0x7f);
  29075. }
  29076. return this._createEncoderBuffer(objid);
  29077. };
  29078. function two(num) {
  29079. if (num < 10)
  29080. return '0' + num;
  29081. else
  29082. return num;
  29083. }
  29084. DERNode.prototype._encodeTime = function encodeTime(time, tag) {
  29085. var str;
  29086. var date = new Date(time);
  29087. if (tag === 'gentime') {
  29088. str = [
  29089. two(date.getFullYear()),
  29090. two(date.getUTCMonth() + 1),
  29091. two(date.getUTCDate()),
  29092. two(date.getUTCHours()),
  29093. two(date.getUTCMinutes()),
  29094. two(date.getUTCSeconds()),
  29095. 'Z'
  29096. ].join('');
  29097. } else if (tag === 'utctime') {
  29098. str = [
  29099. two(date.getFullYear() % 100),
  29100. two(date.getUTCMonth() + 1),
  29101. two(date.getUTCDate()),
  29102. two(date.getUTCHours()),
  29103. two(date.getUTCMinutes()),
  29104. two(date.getUTCSeconds()),
  29105. 'Z'
  29106. ].join('');
  29107. } else {
  29108. this.reporter.error('Encoding ' + tag + ' time is not supported yet');
  29109. }
  29110. return this._encodeStr(str, 'octstr');
  29111. };
  29112. DERNode.prototype._encodeNull = function encodeNull() {
  29113. return this._createEncoderBuffer('');
  29114. };
  29115. DERNode.prototype._encodeInt = function encodeInt(num, values) {
  29116. if (typeof num === 'string') {
  29117. if (!values)
  29118. return this.reporter.error('String int or enum given, but no values map');
  29119. if (!values.hasOwnProperty(num)) {
  29120. return this.reporter.error('Values map doesn\'t contain: ' +
  29121. JSON.stringify(num));
  29122. }
  29123. num = values[num];
  29124. }
  29125. // Bignum, assume big endian
  29126. if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
  29127. var numArray = num.toArray();
  29128. if (!num.sign && numArray[0] & 0x80) {
  29129. numArray.unshift(0);
  29130. }
  29131. num = new Buffer(numArray);
  29132. }
  29133. if (Buffer.isBuffer(num)) {
  29134. var size = num.length;
  29135. if (num.length === 0)
  29136. size++;
  29137. var out = new Buffer(size);
  29138. num.copy(out);
  29139. if (num.length === 0)
  29140. out[0] = 0
  29141. return this._createEncoderBuffer(out);
  29142. }
  29143. if (num < 0x80)
  29144. return this._createEncoderBuffer(num);
  29145. if (num < 0x100)
  29146. return this._createEncoderBuffer([0, num]);
  29147. var size = 1;
  29148. for (var i = num; i >= 0x100; i >>= 8)
  29149. size++;
  29150. var out = new Array(size);
  29151. for (var i = out.length - 1; i >= 0; i--) {
  29152. out[i] = num & 0xff;
  29153. num >>= 8;
  29154. }
  29155. if(out[0] & 0x80) {
  29156. out.unshift(0);
  29157. }
  29158. return this._createEncoderBuffer(new Buffer(out));
  29159. };
  29160. DERNode.prototype._encodeBool = function encodeBool(value) {
  29161. return this._createEncoderBuffer(value ? 0xff : 0);
  29162. };
  29163. DERNode.prototype._use = function use(entity, obj) {
  29164. if (typeof entity === 'function')
  29165. entity = entity(obj);
  29166. return entity._getEncoder('der').tree;
  29167. };
  29168. DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
  29169. var state = this._baseState;
  29170. var i;
  29171. if (state['default'] === null)
  29172. return false;
  29173. var data = dataBuffer.join();
  29174. if (state.defaultBuffer === undefined)
  29175. state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
  29176. if (data.length !== state.defaultBuffer.length)
  29177. return false;
  29178. for (i=0; i < data.length; i++)
  29179. if (data[i] !== state.defaultBuffer[i])
  29180. return false;
  29181. return true;
  29182. };
  29183. // Utility methods
  29184. function encodeTag(tag, primitive, cls, reporter) {
  29185. var res;
  29186. if (tag === 'seqof')
  29187. tag = 'seq';
  29188. else if (tag === 'setof')
  29189. tag = 'set';
  29190. if (der.tagByName.hasOwnProperty(tag))
  29191. res = der.tagByName[tag];
  29192. else if (typeof tag === 'number' && (tag | 0) === tag)
  29193. res = tag;
  29194. else
  29195. return reporter.error('Unknown tag: ' + tag);
  29196. if (res >= 0x1f)
  29197. return reporter.error('Multi-octet tag encoding unsupported');
  29198. if (!primitive)
  29199. res |= 0x20;
  29200. res |= (der.tagClassByName[cls || 'universal'] << 6);
  29201. return res;
  29202. }
  29203. /***/ }),
  29204. /* 221 */
  29205. /*!*******************************************************!*\
  29206. !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
  29207. \*******************************************************/
  29208. /*! no static exports found */
  29209. /***/ (function(module, exports, __webpack_require__) {
  29210. var inherits = __webpack_require__(/*! inherits */ 88);
  29211. var DEREncoder = __webpack_require__(/*! ./der */ 220);
  29212. function PEMEncoder(entity) {
  29213. DEREncoder.call(this, entity);
  29214. this.enc = 'pem';
  29215. };
  29216. inherits(PEMEncoder, DEREncoder);
  29217. module.exports = PEMEncoder;
  29218. PEMEncoder.prototype.encode = function encode(data, options) {
  29219. var buf = DEREncoder.prototype.encode.call(this, data);
  29220. var p = buf.toString('base64');
  29221. var out = [ '-----BEGIN ' + options.label + '-----' ];
  29222. for (var i = 0; i < p.length; i += 64)
  29223. out.push(p.slice(i, i + 64));
  29224. out.push('-----END ' + options.label + '-----');
  29225. return out.join('\n');
  29226. };
  29227. /***/ }),
  29228. /* 222 */
  29229. /*!************************************************!*\
  29230. !*** ./node_modules/parse-asn1/certificate.js ***!
  29231. \************************************************/
  29232. /*! no static exports found */
  29233. /***/ (function(module, exports, __webpack_require__) {
  29234. "use strict";
  29235. // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
  29236. // thanks to @Rantanen
  29237. var asn = __webpack_require__(/*! asn1.js */ 207)
  29238. var Time = asn.define('Time', function () {
  29239. this.choice({
  29240. utcTime: this.utctime(),
  29241. generalTime: this.gentime()
  29242. })
  29243. })
  29244. var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
  29245. this.seq().obj(
  29246. this.key('type').objid(),
  29247. this.key('value').any()
  29248. )
  29249. })
  29250. var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
  29251. this.seq().obj(
  29252. this.key('algorithm').objid(),
  29253. this.key('parameters').optional(),
  29254. this.key('curve').objid().optional()
  29255. )
  29256. })
  29257. var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
  29258. this.seq().obj(
  29259. this.key('algorithm').use(AlgorithmIdentifier),
  29260. this.key('subjectPublicKey').bitstr()
  29261. )
  29262. })
  29263. var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
  29264. this.setof(AttributeTypeValue)
  29265. })
  29266. var RDNSequence = asn.define('RDNSequence', function () {
  29267. this.seqof(RelativeDistinguishedName)
  29268. })
  29269. var Name = asn.define('Name', function () {
  29270. this.choice({
  29271. rdnSequence: this.use(RDNSequence)
  29272. })
  29273. })
  29274. var Validity = asn.define('Validity', function () {
  29275. this.seq().obj(
  29276. this.key('notBefore').use(Time),
  29277. this.key('notAfter').use(Time)
  29278. )
  29279. })
  29280. var Extension = asn.define('Extension', function () {
  29281. this.seq().obj(
  29282. this.key('extnID').objid(),
  29283. this.key('critical').bool().def(false),
  29284. this.key('extnValue').octstr()
  29285. )
  29286. })
  29287. var TBSCertificate = asn.define('TBSCertificate', function () {
  29288. this.seq().obj(
  29289. this.key('version').explicit(0).int().optional(),
  29290. this.key('serialNumber').int(),
  29291. this.key('signature').use(AlgorithmIdentifier),
  29292. this.key('issuer').use(Name),
  29293. this.key('validity').use(Validity),
  29294. this.key('subject').use(Name),
  29295. this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
  29296. this.key('issuerUniqueID').implicit(1).bitstr().optional(),
  29297. this.key('subjectUniqueID').implicit(2).bitstr().optional(),
  29298. this.key('extensions').explicit(3).seqof(Extension).optional()
  29299. )
  29300. })
  29301. var X509Certificate = asn.define('X509Certificate', function () {
  29302. this.seq().obj(
  29303. this.key('tbsCertificate').use(TBSCertificate),
  29304. this.key('signatureAlgorithm').use(AlgorithmIdentifier),
  29305. this.key('signatureValue').bitstr()
  29306. )
  29307. })
  29308. module.exports = X509Certificate
  29309. /***/ }),
  29310. /* 223 */
  29311. /*!********************************************!*\
  29312. !*** ./node_modules/parse-asn1/aesid.json ***!
  29313. \********************************************/
  29314. /*! exports provided: 2.16.840.1.101.3.4.1.1, 2.16.840.1.101.3.4.1.2, 2.16.840.1.101.3.4.1.3, 2.16.840.1.101.3.4.1.4, 2.16.840.1.101.3.4.1.21, 2.16.840.1.101.3.4.1.22, 2.16.840.1.101.3.4.1.23, 2.16.840.1.101.3.4.1.24, 2.16.840.1.101.3.4.1.41, 2.16.840.1.101.3.4.1.42, 2.16.840.1.101.3.4.1.43, 2.16.840.1.101.3.4.1.44, default */
  29315. /***/ (function(module) {
  29316. module.exports = JSON.parse("{\"2.16.840.1.101.3.4.1.1\":\"aes-128-ecb\",\"2.16.840.1.101.3.4.1.2\":\"aes-128-cbc\",\"2.16.840.1.101.3.4.1.3\":\"aes-128-ofb\",\"2.16.840.1.101.3.4.1.4\":\"aes-128-cfb\",\"2.16.840.1.101.3.4.1.21\":\"aes-192-ecb\",\"2.16.840.1.101.3.4.1.22\":\"aes-192-cbc\",\"2.16.840.1.101.3.4.1.23\":\"aes-192-ofb\",\"2.16.840.1.101.3.4.1.24\":\"aes-192-cfb\",\"2.16.840.1.101.3.4.1.41\":\"aes-256-ecb\",\"2.16.840.1.101.3.4.1.42\":\"aes-256-cbc\",\"2.16.840.1.101.3.4.1.43\":\"aes-256-ofb\",\"2.16.840.1.101.3.4.1.44\":\"aes-256-cfb\"}");
  29317. /***/ }),
  29318. /* 224 */
  29319. /*!********************************************!*\
  29320. !*** ./node_modules/parse-asn1/fixProc.js ***!
  29321. \********************************************/
  29322. /*! no static exports found */
  29323. /***/ (function(module, exports, __webpack_require__) {
  29324. // adapted from https://github.com/apatil/pemstrip
  29325. var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m
  29326. var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
  29327. var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m
  29328. var evp = __webpack_require__(/*! evp_bytestokey */ 159)
  29329. var ciphers = __webpack_require__(/*! browserify-aes */ 142)
  29330. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29331. module.exports = function (okey, password) {
  29332. var key = okey.toString()
  29333. var match = key.match(findProc)
  29334. var decrypted
  29335. if (!match) {
  29336. var match2 = key.match(fullRegex)
  29337. decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64')
  29338. } else {
  29339. var suite = 'aes' + match[1]
  29340. var iv = Buffer.from(match[2], 'hex')
  29341. var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
  29342. var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
  29343. var out = []
  29344. var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
  29345. out.push(cipher.update(cipherText))
  29346. out.push(cipher.final())
  29347. decrypted = Buffer.concat(out)
  29348. }
  29349. var tag = key.match(startRegex)[1]
  29350. return {
  29351. tag: tag,
  29352. data: decrypted
  29353. }
  29354. }
  29355. /***/ }),
  29356. /* 225 */
  29357. /*!**********************************************************!*\
  29358. !*** ./node_modules/browserify-sign/browser/curves.json ***!
  29359. \**********************************************************/
  29360. /*! exports provided: 1.3.132.0.10, 1.3.132.0.33, 1.2.840.10045.3.1.1, 1.2.840.10045.3.1.7, 1.3.132.0.34, 1.3.132.0.35, default */
  29361. /***/ (function(module) {
  29362. module.exports = JSON.parse("{\"1.3.132.0.10\":\"secp256k1\",\"1.3.132.0.33\":\"p224\",\"1.2.840.10045.3.1.1\":\"p192\",\"1.2.840.10045.3.1.7\":\"p256\",\"1.3.132.0.34\":\"p384\",\"1.3.132.0.35\":\"p521\"}");
  29363. /***/ }),
  29364. /* 226 */
  29365. /*!********************************************************!*\
  29366. !*** ./node_modules/browserify-sign/browser/verify.js ***!
  29367. \********************************************************/
  29368. /*! no static exports found */
  29369. /***/ (function(module, exports, __webpack_require__) {
  29370. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  29371. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29372. var BN = __webpack_require__(/*! bn.js */ 164)
  29373. var EC = __webpack_require__(/*! elliptic */ 175).ec
  29374. var parseKeys = __webpack_require__(/*! parse-asn1 */ 205)
  29375. var curves = __webpack_require__(/*! ./curves.json */ 225)
  29376. function verify (sig, hash, key, signType, tag) {
  29377. var pub = parseKeys(key)
  29378. if (pub.type === 'ec') {
  29379. // rsa keys can be interpreted as ecdsa ones in openssl
  29380. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29381. return ecVerify(sig, hash, pub)
  29382. } else if (pub.type === 'dsa') {
  29383. if (signType !== 'dsa') throw new Error('wrong public key type')
  29384. return dsaVerify(sig, hash, pub)
  29385. } else {
  29386. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29387. }
  29388. hash = Buffer.concat([tag, hash])
  29389. var len = pub.modulus.byteLength()
  29390. var pad = [1]
  29391. var padNum = 0
  29392. while (hash.length + pad.length + 2 < len) {
  29393. pad.push(0xff)
  29394. padNum++
  29395. }
  29396. pad.push(0x00)
  29397. var i = -1
  29398. while (++i < hash.length) {
  29399. pad.push(hash[i])
  29400. }
  29401. pad = Buffer.from(pad)
  29402. var red = BN.mont(pub.modulus)
  29403. sig = new BN(sig).toRed(red)
  29404. sig = sig.redPow(new BN(pub.publicExponent))
  29405. sig = Buffer.from(sig.fromRed().toArray())
  29406. var out = padNum < 8 ? 1 : 0
  29407. len = Math.min(sig.length, pad.length)
  29408. if (sig.length !== pad.length) out = 1
  29409. i = -1
  29410. while (++i < len) out |= sig[i] ^ pad[i]
  29411. return out === 0
  29412. }
  29413. function ecVerify (sig, hash, pub) {
  29414. var curveId = curves[pub.data.algorithm.curve.join('.')]
  29415. if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
  29416. var curve = new EC(curveId)
  29417. var pubkey = pub.data.subjectPrivateKey.data
  29418. return curve.verify(hash, sig, pubkey)
  29419. }
  29420. function dsaVerify (sig, hash, pub) {
  29421. var p = pub.data.p
  29422. var q = pub.data.q
  29423. var g = pub.data.g
  29424. var y = pub.data.pub_key
  29425. var unpacked = parseKeys.signature.decode(sig, 'der')
  29426. var s = unpacked.s
  29427. var r = unpacked.r
  29428. checkValue(s, q)
  29429. checkValue(r, q)
  29430. var montp = BN.mont(p)
  29431. var w = s.invm(q)
  29432. var v = g.toRed(montp)
  29433. .redPow(new BN(hash).mul(w).mod(q))
  29434. .fromRed()
  29435. .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
  29436. .mod(p)
  29437. .mod(q)
  29438. return v.cmp(r) === 0
  29439. }
  29440. function checkValue (b, q) {
  29441. if (b.cmpn(0) <= 0) throw new Error('invalid sig')
  29442. if (b.cmp(q) >= q) throw new Error('invalid sig')
  29443. }
  29444. module.exports = verify
  29445. /***/ }),
  29446. /* 227 */
  29447. /*!*********************************************!*\
  29448. !*** ./node_modules/create-ecdh/browser.js ***!
  29449. \*********************************************/
  29450. /*! no static exports found */
  29451. /***/ (function(module, exports, __webpack_require__) {
  29452. /* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 175)
  29453. var BN = __webpack_require__(/*! bn.js */ 164)
  29454. module.exports = function createECDH (curve) {
  29455. return new ECDH(curve)
  29456. }
  29457. var aliases = {
  29458. secp256k1: {
  29459. name: 'secp256k1',
  29460. byteLength: 32
  29461. },
  29462. secp224r1: {
  29463. name: 'p224',
  29464. byteLength: 28
  29465. },
  29466. prime256v1: {
  29467. name: 'p256',
  29468. byteLength: 32
  29469. },
  29470. prime192v1: {
  29471. name: 'p192',
  29472. byteLength: 24
  29473. },
  29474. ed25519: {
  29475. name: 'ed25519',
  29476. byteLength: 32
  29477. },
  29478. secp384r1: {
  29479. name: 'p384',
  29480. byteLength: 48
  29481. },
  29482. secp521r1: {
  29483. name: 'p521',
  29484. byteLength: 66
  29485. }
  29486. }
  29487. aliases.p224 = aliases.secp224r1
  29488. aliases.p256 = aliases.secp256r1 = aliases.prime256v1
  29489. aliases.p192 = aliases.secp192r1 = aliases.prime192v1
  29490. aliases.p384 = aliases.secp384r1
  29491. aliases.p521 = aliases.secp521r1
  29492. function ECDH (curve) {
  29493. this.curveType = aliases[curve]
  29494. if (!this.curveType) {
  29495. this.curveType = {
  29496. name: curve
  29497. }
  29498. }
  29499. this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
  29500. this.keys = void 0
  29501. }
  29502. ECDH.prototype.generateKeys = function (enc, format) {
  29503. this.keys = this.curve.genKeyPair()
  29504. return this.getPublicKey(enc, format)
  29505. }
  29506. ECDH.prototype.computeSecret = function (other, inenc, enc) {
  29507. inenc = inenc || 'utf8'
  29508. if (!Buffer.isBuffer(other)) {
  29509. other = new Buffer(other, inenc)
  29510. }
  29511. var otherPub = this.curve.keyFromPublic(other).getPublic()
  29512. var out = otherPub.mul(this.keys.getPrivate()).getX()
  29513. return formatReturnValue(out, enc, this.curveType.byteLength)
  29514. }
  29515. ECDH.prototype.getPublicKey = function (enc, format) {
  29516. var key = this.keys.getPublic(format === 'compressed', true)
  29517. if (format === 'hybrid') {
  29518. if (key[key.length - 1] % 2) {
  29519. key[0] = 7
  29520. } else {
  29521. key[0] = 6
  29522. }
  29523. }
  29524. return formatReturnValue(key, enc)
  29525. }
  29526. ECDH.prototype.getPrivateKey = function (enc) {
  29527. return formatReturnValue(this.keys.getPrivate(), enc)
  29528. }
  29529. ECDH.prototype.setPublicKey = function (pub, enc) {
  29530. enc = enc || 'utf8'
  29531. if (!Buffer.isBuffer(pub)) {
  29532. pub = new Buffer(pub, enc)
  29533. }
  29534. this.keys._importPublic(pub)
  29535. return this
  29536. }
  29537. ECDH.prototype.setPrivateKey = function (priv, enc) {
  29538. enc = enc || 'utf8'
  29539. if (!Buffer.isBuffer(priv)) {
  29540. priv = new Buffer(priv, enc)
  29541. }
  29542. var _priv = new BN(priv)
  29543. _priv = _priv.toString(16)
  29544. this.keys = this.curve.genKeyPair()
  29545. this.keys._importPrivate(_priv)
  29546. return this
  29547. }
  29548. function formatReturnValue (bn, enc, len) {
  29549. if (!Array.isArray(bn)) {
  29550. bn = bn.toArray()
  29551. }
  29552. var buf = new Buffer(bn)
  29553. if (len && buf.length < len) {
  29554. var zeros = new Buffer(len - buf.length)
  29555. zeros.fill(0)
  29556. buf = Buffer.concat([zeros, buf])
  29557. }
  29558. if (!enc) {
  29559. return buf
  29560. } else {
  29561. return buf.toString(enc)
  29562. }
  29563. }
  29564. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 83).Buffer))
  29565. /***/ }),
  29566. /* 228 */
  29567. /*!************************************************!*\
  29568. !*** ./node_modules/public-encrypt/browser.js ***!
  29569. \************************************************/
  29570. /*! no static exports found */
  29571. /***/ (function(module, exports, __webpack_require__) {
  29572. exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 229)
  29573. exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 233)
  29574. exports.privateEncrypt = function privateEncrypt (key, buf) {
  29575. return exports.publicEncrypt(key, buf, true)
  29576. }
  29577. exports.publicDecrypt = function publicDecrypt (key, buf) {
  29578. return exports.privateDecrypt(key, buf, true)
  29579. }
  29580. /***/ }),
  29581. /* 229 */
  29582. /*!******************************************************!*\
  29583. !*** ./node_modules/public-encrypt/publicEncrypt.js ***!
  29584. \******************************************************/
  29585. /*! no static exports found */
  29586. /***/ (function(module, exports, __webpack_require__) {
  29587. var parseKeys = __webpack_require__(/*! parse-asn1 */ 205)
  29588. var randomBytes = __webpack_require__(/*! randombytes */ 79)
  29589. var createHash = __webpack_require__(/*! create-hash */ 87)
  29590. var mgf = __webpack_require__(/*! ./mgf */ 230)
  29591. var xor = __webpack_require__(/*! ./xor */ 231)
  29592. var BN = __webpack_require__(/*! bn.js */ 164)
  29593. var withPublic = __webpack_require__(/*! ./withPublic */ 232)
  29594. var crt = __webpack_require__(/*! browserify-rsa */ 174)
  29595. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29596. module.exports = function publicEncrypt (publicKey, msg, reverse) {
  29597. var padding
  29598. if (publicKey.padding) {
  29599. padding = publicKey.padding
  29600. } else if (reverse) {
  29601. padding = 1
  29602. } else {
  29603. padding = 4
  29604. }
  29605. var key = parseKeys(publicKey)
  29606. var paddedMsg
  29607. if (padding === 4) {
  29608. paddedMsg = oaep(key, msg)
  29609. } else if (padding === 1) {
  29610. paddedMsg = pkcs1(key, msg, reverse)
  29611. } else if (padding === 3) {
  29612. paddedMsg = new BN(msg)
  29613. if (paddedMsg.cmp(key.modulus) >= 0) {
  29614. throw new Error('data too long for modulus')
  29615. }
  29616. } else {
  29617. throw new Error('unknown padding')
  29618. }
  29619. if (reverse) {
  29620. return crt(paddedMsg, key)
  29621. } else {
  29622. return withPublic(paddedMsg, key)
  29623. }
  29624. }
  29625. function oaep (key, msg) {
  29626. var k = key.modulus.byteLength()
  29627. var mLen = msg.length
  29628. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29629. var hLen = iHash.length
  29630. var hLen2 = 2 * hLen
  29631. if (mLen > k - hLen2 - 2) {
  29632. throw new Error('message too long')
  29633. }
  29634. var ps = Buffer.alloc(k - mLen - hLen2 - 2)
  29635. var dblen = k - hLen - 1
  29636. var seed = randomBytes(hLen)
  29637. var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
  29638. var maskedSeed = xor(seed, mgf(maskedDb, hLen))
  29639. return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
  29640. }
  29641. function pkcs1 (key, msg, reverse) {
  29642. var mLen = msg.length
  29643. var k = key.modulus.byteLength()
  29644. if (mLen > k - 11) {
  29645. throw new Error('message too long')
  29646. }
  29647. var ps
  29648. if (reverse) {
  29649. ps = Buffer.alloc(k - mLen - 3, 0xff)
  29650. } else {
  29651. ps = nonZero(k - mLen - 3)
  29652. }
  29653. return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
  29654. }
  29655. function nonZero (len) {
  29656. var out = Buffer.allocUnsafe(len)
  29657. var i = 0
  29658. var cache = randomBytes(len * 2)
  29659. var cur = 0
  29660. var num
  29661. while (i < len) {
  29662. if (cur === cache.length) {
  29663. cache = randomBytes(len * 2)
  29664. cur = 0
  29665. }
  29666. num = cache[cur++]
  29667. if (num) {
  29668. out[i++] = num
  29669. }
  29670. }
  29671. return out
  29672. }
  29673. /***/ }),
  29674. /* 230 */
  29675. /*!********************************************!*\
  29676. !*** ./node_modules/public-encrypt/mgf.js ***!
  29677. \********************************************/
  29678. /*! no static exports found */
  29679. /***/ (function(module, exports, __webpack_require__) {
  29680. var createHash = __webpack_require__(/*! create-hash */ 87)
  29681. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29682. module.exports = function (seed, len) {
  29683. var t = Buffer.alloc(0)
  29684. var i = 0
  29685. var c
  29686. while (t.length < len) {
  29687. c = i2ops(i++)
  29688. t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
  29689. }
  29690. return t.slice(0, len)
  29691. }
  29692. function i2ops (c) {
  29693. var out = Buffer.allocUnsafe(4)
  29694. out.writeUInt32BE(c, 0)
  29695. return out
  29696. }
  29697. /***/ }),
  29698. /* 231 */
  29699. /*!********************************************!*\
  29700. !*** ./node_modules/public-encrypt/xor.js ***!
  29701. \********************************************/
  29702. /*! no static exports found */
  29703. /***/ (function(module, exports) {
  29704. module.exports = function xor (a, b) {
  29705. var len = a.length
  29706. var i = -1
  29707. while (++i < len) {
  29708. a[i] ^= b[i]
  29709. }
  29710. return a
  29711. }
  29712. /***/ }),
  29713. /* 232 */
  29714. /*!***************************************************!*\
  29715. !*** ./node_modules/public-encrypt/withPublic.js ***!
  29716. \***************************************************/
  29717. /*! no static exports found */
  29718. /***/ (function(module, exports, __webpack_require__) {
  29719. var BN = __webpack_require__(/*! bn.js */ 164)
  29720. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29721. function withPublic (paddedMsg, key) {
  29722. return Buffer.from(paddedMsg
  29723. .toRed(BN.mont(key.modulus))
  29724. .redPow(new BN(key.publicExponent))
  29725. .fromRed()
  29726. .toArray())
  29727. }
  29728. module.exports = withPublic
  29729. /***/ }),
  29730. /* 233 */
  29731. /*!*******************************************************!*\
  29732. !*** ./node_modules/public-encrypt/privateDecrypt.js ***!
  29733. \*******************************************************/
  29734. /*! no static exports found */
  29735. /***/ (function(module, exports, __webpack_require__) {
  29736. var parseKeys = __webpack_require__(/*! parse-asn1 */ 205)
  29737. var mgf = __webpack_require__(/*! ./mgf */ 230)
  29738. var xor = __webpack_require__(/*! ./xor */ 231)
  29739. var BN = __webpack_require__(/*! bn.js */ 164)
  29740. var crt = __webpack_require__(/*! browserify-rsa */ 174)
  29741. var createHash = __webpack_require__(/*! create-hash */ 87)
  29742. var withPublic = __webpack_require__(/*! ./withPublic */ 232)
  29743. var Buffer = __webpack_require__(/*! safe-buffer */ 82).Buffer
  29744. module.exports = function privateDecrypt (privateKey, enc, reverse) {
  29745. var padding
  29746. if (privateKey.padding) {
  29747. padding = privateKey.padding
  29748. } else if (reverse) {
  29749. padding = 1
  29750. } else {
  29751. padding = 4
  29752. }
  29753. var key = parseKeys(privateKey)
  29754. var k = key.modulus.byteLength()
  29755. if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
  29756. throw new Error('decryption error')
  29757. }
  29758. var msg
  29759. if (reverse) {
  29760. msg = withPublic(new BN(enc), key)
  29761. } else {
  29762. msg = crt(enc, key)
  29763. }
  29764. var zBuffer = Buffer.alloc(k - msg.length)
  29765. msg = Buffer.concat([zBuffer, msg], k)
  29766. if (padding === 4) {
  29767. return oaep(key, msg)
  29768. } else if (padding === 1) {
  29769. return pkcs1(key, msg, reverse)
  29770. } else if (padding === 3) {
  29771. return msg
  29772. } else {
  29773. throw new Error('unknown padding')
  29774. }
  29775. }
  29776. function oaep (key, msg) {
  29777. var k = key.modulus.byteLength()
  29778. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29779. var hLen = iHash.length
  29780. if (msg[0] !== 0) {
  29781. throw new Error('decryption error')
  29782. }
  29783. var maskedSeed = msg.slice(1, hLen + 1)
  29784. var maskedDb = msg.slice(hLen + 1)
  29785. var seed = xor(maskedSeed, mgf(maskedDb, hLen))
  29786. var db = xor(maskedDb, mgf(seed, k - hLen - 1))
  29787. if (compare(iHash, db.slice(0, hLen))) {
  29788. throw new Error('decryption error')
  29789. }
  29790. var i = hLen
  29791. while (db[i] === 0) {
  29792. i++
  29793. }
  29794. if (db[i++] !== 1) {
  29795. throw new Error('decryption error')
  29796. }
  29797. return db.slice(i)
  29798. }
  29799. function pkcs1 (key, msg, reverse) {
  29800. var p1 = msg.slice(0, 2)
  29801. var i = 2
  29802. var status = 0
  29803. while (msg[i++] !== 0) {
  29804. if (i >= msg.length) {
  29805. status++
  29806. break
  29807. }
  29808. }
  29809. var ps = msg.slice(2, i - 1)
  29810. if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
  29811. status++
  29812. }
  29813. if (ps.length < 8) {
  29814. status++
  29815. }
  29816. if (status) {
  29817. throw new Error('decryption error')
  29818. }
  29819. return msg.slice(i)
  29820. }
  29821. function compare (a, b) {
  29822. a = Buffer.from(a)
  29823. b = Buffer.from(b)
  29824. var dif = 0
  29825. var len = a.length
  29826. if (a.length !== b.length) {
  29827. dif++
  29828. len = Math.min(a.length, b.length)
  29829. }
  29830. var i = -1
  29831. while (++i < len) {
  29832. dif += (a[i] ^ b[i])
  29833. }
  29834. return dif
  29835. }
  29836. /***/ }),
  29837. /* 234 */
  29838. /*!********************************************!*\
  29839. !*** ./node_modules/randomfill/browser.js ***!
  29840. \********************************************/
  29841. /*! no static exports found */
  29842. /***/ (function(module, exports, __webpack_require__) {
  29843. "use strict";
  29844. /* WEBPACK VAR INJECTION */(function(global, process) {
  29845. function oldBrowser () {
  29846. throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
  29847. }
  29848. var safeBuffer = __webpack_require__(/*! safe-buffer */ 82)
  29849. var randombytes = __webpack_require__(/*! randombytes */ 79)
  29850. var Buffer = safeBuffer.Buffer
  29851. var kBufferMaxLength = safeBuffer.kMaxLength
  29852. var crypto = global.crypto || global.msCrypto
  29853. var kMaxUint32 = Math.pow(2, 32) - 1
  29854. function assertOffset (offset, length) {
  29855. if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
  29856. throw new TypeError('offset must be a number')
  29857. }
  29858. if (offset > kMaxUint32 || offset < 0) {
  29859. throw new TypeError('offset must be a uint32')
  29860. }
  29861. if (offset > kBufferMaxLength || offset > length) {
  29862. throw new RangeError('offset out of range')
  29863. }
  29864. }
  29865. function assertSize (size, offset, length) {
  29866. if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
  29867. throw new TypeError('size must be a number')
  29868. }
  29869. if (size > kMaxUint32 || size < 0) {
  29870. throw new TypeError('size must be a uint32')
  29871. }
  29872. if (size + offset > length || size > kBufferMaxLength) {
  29873. throw new RangeError('buffer too small')
  29874. }
  29875. }
  29876. if ((crypto && crypto.getRandomValues) || !process.browser) {
  29877. exports.randomFill = randomFill
  29878. exports.randomFillSync = randomFillSync
  29879. } else {
  29880. exports.randomFill = oldBrowser
  29881. exports.randomFillSync = oldBrowser
  29882. }
  29883. function randomFill (buf, offset, size, cb) {
  29884. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29885. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29886. }
  29887. if (typeof offset === 'function') {
  29888. cb = offset
  29889. offset = 0
  29890. size = buf.length
  29891. } else if (typeof size === 'function') {
  29892. cb = size
  29893. size = buf.length - offset
  29894. } else if (typeof cb !== 'function') {
  29895. throw new TypeError('"cb" argument must be a function')
  29896. }
  29897. assertOffset(offset, buf.length)
  29898. assertSize(size, offset, buf.length)
  29899. return actualFill(buf, offset, size, cb)
  29900. }
  29901. function actualFill (buf, offset, size, cb) {
  29902. if (process.browser) {
  29903. var ourBuf = buf.buffer
  29904. var uint = new Uint8Array(ourBuf, offset, size)
  29905. crypto.getRandomValues(uint)
  29906. if (cb) {
  29907. process.nextTick(function () {
  29908. cb(null, buf)
  29909. })
  29910. return
  29911. }
  29912. return buf
  29913. }
  29914. if (cb) {
  29915. randombytes(size, function (err, bytes) {
  29916. if (err) {
  29917. return cb(err)
  29918. }
  29919. bytes.copy(buf, offset)
  29920. cb(null, buf)
  29921. })
  29922. return
  29923. }
  29924. var bytes = randombytes(size)
  29925. bytes.copy(buf, offset)
  29926. return buf
  29927. }
  29928. function randomFillSync (buf, offset, size) {
  29929. if (typeof offset === 'undefined') {
  29930. offset = 0
  29931. }
  29932. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29933. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29934. }
  29935. assertOffset(offset, buf.length)
  29936. if (size === undefined) size = buf.length - offset
  29937. assertSize(size, offset, buf.length)
  29938. return actualFill(buf, offset, size)
  29939. }
  29940. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 80)))
  29941. /***/ }),
  29942. /* 235 */,
  29943. /* 236 */,
  29944. /* 237 */,
  29945. /* 238 */,
  29946. /* 239 */,
  29947. /* 240 */,
  29948. /* 241 */,
  29949. /* 242 */,
  29950. /* 243 */,
  29951. /* 244 */,
  29952. /* 245 */,
  29953. /* 246 */,
  29954. /* 247 */,
  29955. /* 248 */,
  29956. /* 249 */,
  29957. /* 250 */,
  29958. /* 251 */,
  29959. /* 252 */,
  29960. /* 253 */,
  29961. /* 254 */,
  29962. /* 255 */,
  29963. /* 256 */,
  29964. /* 257 */,
  29965. /* 258 */,
  29966. /* 259 */,
  29967. /* 260 */,
  29968. /* 261 */,
  29969. /* 262 */,
  29970. /* 263 */,
  29971. /* 264 */,
  29972. /* 265 */,
  29973. /* 266 */,
  29974. /* 267 */,
  29975. /* 268 */,
  29976. /* 269 */,
  29977. /* 270 */
  29978. /*!************************************************************************************************************************!*\
  29979. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  29980. \************************************************************************************************************************/
  29981. /*! no static exports found */
  29982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29983. "use strict";
  29984. __webpack_require__.r(__webpack_exports__);
  29985. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./z-paging-main.js?vue&type=script&lang=js& */ 271);
  29986. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  29987. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  29988. /* harmony default export */ __webpack_exports__["default"] = (_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  29989. /***/ }),
  29990. /* 271 */
  29991. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  29992. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  29993. \***************************************************************************************************************************************************************************************************************************************************************************************************************/
  29994. /*! no static exports found */
  29995. /***/ (function(module, exports, __webpack_require__) {
  29996. "use strict";
  29997. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));
  29998. var _zPagingStatic = _interopRequireDefault(__webpack_require__(/*! ./z-paging-static */ 272));
  29999. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! ./z-paging-constant */ 273));
  30000. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! ./z-paging-utils */ 274));
  30001. var _dataHandle = _interopRequireDefault(__webpack_require__(/*! ./modules/data-handle */ 280));
  30002. var _i18n = _interopRequireDefault(__webpack_require__(/*! ./modules/i18n */ 282));
  30003. var _nvue = _interopRequireDefault(__webpack_require__(/*! ./modules/nvue */ 283));
  30004. var _empty = _interopRequireDefault(__webpack_require__(/*! ./modules/empty */ 284));
  30005. var _refresher = _interopRequireDefault(__webpack_require__(/*! ./modules/refresher */ 285));
  30006. var _loadMore = _interopRequireDefault(__webpack_require__(/*! ./modules/load-more */ 286));
  30007. var _scroller = _interopRequireDefault(__webpack_require__(/*! ./modules/scroller */ 287));
  30008. var _backToTop = _interopRequireDefault(__webpack_require__(/*! ./modules/back-to-top */ 288));
  30009. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! ./z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}var zPagingRefresh = function zPagingRefresh() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-refresh */ "uni_modules/z-paging/components/z-paging/components/z-paging-refresh").then((function () {return resolve(__webpack_require__(/*! ../components/z-paging-refresh */ 358));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var zPagingLoadMore = function zPagingLoadMore() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-load-more */ "uni_modules/z-paging/components/z-paging/components/z-paging-load-more").then((function () {return resolve(__webpack_require__(/*! ../components/z-paging-load-more */ 365));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var zPagingEmptyView = function zPagingEmptyView() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view */ "uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view").then((function () {return resolve(__webpack_require__(/*! ../../z-paging-empty-view/z-paging-empty-view */ 351));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};
  30010. var systemInfo = uni.getSystemInfoSync();var _default2 =
  30011. {
  30012. name: "z-paging",
  30013. components: {
  30014. zPagingRefresh: zPagingRefresh,
  30015. zPagingLoadMore: zPagingLoadMore,
  30016. zPagingEmptyView: zPagingEmptyView },
  30017. mixins: [
  30018. _dataHandle.default,
  30019. _i18n.default,
  30020. _nvue.default,
  30021. _empty.default,
  30022. _refresher.default,
  30023. _loadMore.default,
  30024. _scroller.default,
  30025. _backToTop.default],
  30026. data: function data() {
  30027. return {
  30028. //--------------静态资源---------------
  30029. base64Arrow: _zPagingStatic.default.base64Arrow,
  30030. base64Flower: _zPagingStatic.default.base64Flower,
  30031. base64BackToTop: _zPagingStatic.default.base64BackToTop,
  30032. //-------------全局数据相关--------------
  30033. //当前加载类型
  30034. loadingType: _zPagingEnum.default.LoadingType.Refresher,
  30035. requestTimeStamp: 0,
  30036. chatRecordLoadingMoreText: '',
  30037. wxsPropType: '',
  30038. renderPropScrollTop: -1,
  30039. renderPropUsePageScroll: -1,
  30040. checkScrolledToBottomTimeOut: null,
  30041. systemInfo: null,
  30042. cssSafeAreaInsetBottom: -1,
  30043. cacheTopHeight: 0,
  30044. //--------------状态&判断---------------
  30045. insideOfPaging: -1,
  30046. loading: false,
  30047. loadingForNow: false,
  30048. isLoadFailed: false,
  30049. isIos: systemInfo.platform === 'ios',
  30050. disabledBounce: false,
  30051. fromCompleteEmit: false,
  30052. disabledCompleteEmit: false,
  30053. //---------------wxs相关---------------
  30054. wxsIsScrollTopInTopRange: true,
  30055. wxsScrollTop: 0,
  30056. wxsPageScrollTop: 0,
  30057. wxsOnPullingDown: false };
  30058. },
  30059. props: {
  30060. //调用complete后延迟处理的时间,单位为毫秒,默认0毫秒,优先级高于minDelay
  30061. delay: {
  30062. type: [Number, String],
  30063. default: _zPagingUtils.default.gc('delay', 0) },
  30064. //触发@query后最小延迟处理的时间,单位为毫秒,默认0毫秒,优先级低于delay(假设设置为300毫秒,若分页请求时间小于300毫秒,则在调用complete后延迟[300毫秒-请求时长];若请求时长大于300毫秒,则不延迟),当show-refresher-when-reload为true或reload(true)时,其最小值为400
  30065. minDelay: {
  30066. type: [Number, String],
  30067. default: _zPagingUtils.default.gc('minDelay', 0) },
  30068. //设置z-paging的style,部分平台(如微信小程序)无法直接修改组件的style,可使用此属性代替
  30069. pagingStyle: {
  30070. type: Object,
  30071. default: function _default() {
  30072. return _zPagingUtils.default.gc('pagingStyle', {});
  30073. } },
  30074. //z-paging的高度,优先级低于pagingStyle中设置的height;传字符串,如100px、100rpx、100%
  30075. height: {
  30076. type: String,
  30077. default: _zPagingUtils.default.gc('height', '') },
  30078. //z-paging的宽度,优先级低于pagingStyle中设置的width;传字符串,如100px、100rpx、100%
  30079. width: {
  30080. type: String,
  30081. default: _zPagingUtils.default.gc('width', '') },
  30082. //z-paging的背景色,优先级低于pagingStyle中设置的background。传字符串,如"#ffffff"
  30083. bgColor: {
  30084. type: String,
  30085. default: _zPagingUtils.default.gc('bgColor', '') },
  30086. //设置z-paging的容器(插槽的父view)的style
  30087. pagingContentStyle: {
  30088. type: Object,
  30089. default: function _default() {
  30090. return _zPagingUtils.default.gc('pagingContentStyle', {});
  30091. } },
  30092. //z-paging是否自动高度,若自动高度则会自动铺满屏幕
  30093. autoHeight: {
  30094. type: Boolean,
  30095. default: _zPagingUtils.default.gc('autoHeight', false) },
  30096. //z-paging是否自动高度时,附加的高度,注意添加单位px或rpx,若需要减少高度,则传负数
  30097. autoHeightAddition: {
  30098. type: [Number, String],
  30099. default: _zPagingUtils.default.gc('autoHeightAddition', '0px') },
  30100. //loading(下拉刷新、上拉加载更多)的主题样式,支持black,white,默认black
  30101. defaultThemeStyle: {
  30102. type: String,
  30103. default: function _default() {
  30104. return _zPagingUtils.default.gc('defaultThemeStyle', 'black');
  30105. } },
  30106. //是否使用虚拟列表,默认为否
  30107. useVirtualList: {
  30108. type: Boolean,
  30109. default: _zPagingUtils.default.gc('useVirtualList', false) },
  30110. //z-paging是否使用fixed布局,若使用fixed布局,则z-paging的父view无需固定高度,z-paging高度默认为100%,默认为是(当使用内置scroll-view滚动时有效)
  30111. fixed: {
  30112. type: Boolean,
  30113. default: _zPagingUtils.default.gc('fixed', true) },
  30114. //是否开启底部安全区域适配
  30115. safeAreaInsetBottom: {
  30116. type: Boolean,
  30117. default: _zPagingUtils.default.gc('safeAreaInsetBottom', false) },
  30118. //第一次加载后自动隐藏loading slot,默认为是
  30119. autoHideLoadingAfterFirstLoaded: {
  30120. type: Boolean,
  30121. default: _zPagingUtils.default.gc('autoHideLoadingAfterFirstLoaded', true) },
  30122. //loading slot是否铺满屏幕并固定,默认为否
  30123. loadingFullFixed: {
  30124. type: Boolean,
  30125. default: _zPagingUtils.default.gc('loadingFullFixed', false) },
  30126. //slot="top"的view的z-index,默认为99,仅使用页面滚动时有效
  30127. topZIndex: {
  30128. type: Number,
  30129. default: _zPagingUtils.default.gc('topZIndex', 99) },
  30130. //z-paging内容容器父view的z-index,默认为1
  30131. superContentZIndex: {
  30132. type: Number,
  30133. default: _zPagingUtils.default.gc('superContentZIndex', 1) },
  30134. //z-paging内容容器部分的z-index,默认为10
  30135. contentZIndex: {
  30136. type: Number,
  30137. default: _zPagingUtils.default.gc('contentZIndex', 10) },
  30138. //使用页面滚动时,是否在不满屏时自动填充满屏幕,默认为是
  30139. autoFullHeight: {
  30140. type: Boolean,
  30141. default: _zPagingUtils.default.gc('autoFullHeight', true) },
  30142. //是否将错误信息打印至控制台,默认为是
  30143. showConsoleError: {
  30144. type: Boolean,
  30145. default: _zPagingUtils.default.gc('showConsoleError', true) } },
  30146. mounted: function mounted() {var _this = this;
  30147. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  30148. this.renderJsIgnore;
  30149. if (!this.refresherOnly && this.mountedAutoCallReload && this.auto) {
  30150. this.$nextTick(function () {
  30151. _this._preReload();
  30152. });
  30153. }
  30154. var delay = 0;
  30155. delay = 100;
  30156. this.$nextTick(function () {
  30157. _this.systemInfo = uni.getSystemInfoSync();
  30158. if (!_this.usePageScroll && _this.autoHeight) {
  30159. _this._setAutoHeight();
  30160. }
  30161. _this.loaded = true;
  30162. });
  30163. this.updatePageScrollTopHeight();
  30164. this.updatePageScrollBottomHeight();
  30165. if (this.finalRefresherEnabled && this.useCustomRefresher) {
  30166. this.$nextTick(function () {
  30167. _this.isTouchmoving = true;
  30168. });
  30169. }
  30170. this._onEmit();
  30171. this.$nextTick(function () {
  30172. setTimeout(function () {
  30173. _this._getCssSafeAreaInsetBottom();
  30174. }, delay);
  30175. });
  30176. },
  30177. destroyed: function destroyed() {
  30178. this._offEmit();
  30179. },
  30180. watch: {
  30181. loadingStatus: function loadingStatus(newVal, oldVal) {var _this2 = this;
  30182. this.$emit('loadingStatusChange', newVal);
  30183. this.$nextTick(function () {
  30184. _this2.loadingStatusAfterRender = newVal;
  30185. });
  30186. },
  30187. loading: function loading(newVal) {
  30188. if (newVal) {
  30189. this.loadingForNow = newVal;
  30190. }
  30191. },
  30192. defaultThemeStyle: {
  30193. handler: function handler(newVal) {
  30194. if (newVal.length) {
  30195. this.finalRefresherDefaultStyle = newVal;
  30196. }
  30197. },
  30198. immediate: true },
  30199. autoHeight: function autoHeight(newVal, oldVal) {
  30200. if (this.loaded && !this.usePageScroll) {
  30201. this._setAutoHeight(newVal);
  30202. }
  30203. },
  30204. autoHeightAddition: function autoHeightAddition(newVal, oldVal) {
  30205. if (this.loaded && !this.usePageScroll && this.autoHeight) {
  30206. this._setAutoHeight(newVal);
  30207. }
  30208. } },
  30209. computed: {
  30210. zScopedSlots: function zScopedSlots() {
  30211. return this.$scopedSlots;
  30212. },
  30213. finalPagingStyle: function finalPagingStyle() {
  30214. var pagingStyle = this.pagingStyle;
  30215. if (!this.systemInfo) return pagingStyle;
  30216. var windowTop = this.systemInfo.windowTop;
  30217. var windowBottom = this.systemInfo.windowBottom;
  30218. if (!this.usePageScroll && this.fixed) {
  30219. if (windowTop && !pagingStyle.top) {
  30220. pagingStyle.top = windowTop + 'px';
  30221. }
  30222. if (!pagingStyle.bottom) {
  30223. var bottom = windowBottom ? windowBottom : 0;
  30224. if (this.safeAreaInsetBottom) {
  30225. bottom += this.safeAreaBottom;
  30226. }
  30227. if (bottom > 0) {
  30228. pagingStyle.bottom = bottom + 'px';
  30229. }
  30230. }
  30231. }
  30232. if (this.bgColor.length && !pagingStyle['background']) {
  30233. pagingStyle['background'] = this.bgColor;
  30234. }
  30235. if (this.height.length && !pagingStyle['height']) {
  30236. pagingStyle['height'] = this.height;
  30237. }
  30238. if (this.width.length && !pagingStyle['width']) {
  30239. pagingStyle['width'] = this.width;
  30240. }
  30241. return pagingStyle;
  30242. },
  30243. finalLowerThreshold: function finalLowerThreshold() {
  30244. return _zPagingUtils.default.convertTextToPx(this.lowerThreshold);
  30245. },
  30246. finalPagingContentStyle: function finalPagingContentStyle() {
  30247. if (this.contentZIndex != 1) {
  30248. this.pagingContentStyle['z-index'] = this.contentZIndex;
  30249. this.pagingContentStyle['position'] = 'relative';
  30250. }
  30251. return this.pagingContentStyle;
  30252. },
  30253. showLoading: function showLoading() {
  30254. if (this.firstPageLoaded || !this.loading || !this.loadingForNow) return false;
  30255. if (this.autoHideLoadingAfterFirstLoaded) {
  30256. return this.fromEmptyViewReload ? true : !this.pagingLoaded;
  30257. } else {
  30258. return this.loadingType === _zPagingEnum.default.LoadingType.Refresher;
  30259. }
  30260. },
  30261. safeAreaBottom: function safeAreaBottom() {
  30262. if (!this.systemInfo) return 0;
  30263. var safeAreaBottom = 0;
  30264. safeAreaBottom = this.cssSafeAreaInsetBottom === -1 ? 0 : this.cssSafeAreaInsetBottom;
  30265. return safeAreaBottom;
  30266. },
  30267. renderJsIgnore: function renderJsIgnore() {var _this3 = this;
  30268. if (this.usePageScroll && this.useChatRecordMode || !this.refresherEnabled || !this.useCustomRefresher) {
  30269. this.$nextTick(function () {
  30270. _this3.renderPropScrollTop = 10;
  30271. });
  30272. }
  30273. return 0;
  30274. },
  30275. windowHeight: function windowHeight() {
  30276. return !this.systemInfo ? 0 : this.systemInfo.windowHeight || 0;
  30277. },
  30278. windowTop: function windowTop() {
  30279. return !this.systemInfo ? 0 : this.systemInfo.windowTop || 0;
  30280. },
  30281. windowBottom: function windowBottom() {
  30282. if (!this.systemInfo) return 0;
  30283. var windowBottom = this.systemInfo.windowBottom || 0;
  30284. if (this.safeAreaInsetBottom) {
  30285. windowBottom += this.safeAreaBottom;
  30286. }
  30287. return windowBottom;
  30288. } },
  30289. methods: {
  30290. //当前版本号
  30291. getVersion: function getVersion() {
  30292. return "z-paging v".concat(zConstant.version);
  30293. },
  30294. //设置nvue List的specialEffects
  30295. setSpecialEffects: function setSpecialEffects(args) {
  30296. this.setListSpecialEffects(args);
  30297. },
  30298. //与setSpecialEffects等效,兼容旧版本
  30299. setListSpecialEffects: function setListSpecialEffects(args) {
  30300. this.nFixFreezing = args !== {};
  30301. if (this.isIos) {
  30302. this.privateRefresherEnabled = 0;
  30303. }
  30304. if (!this.usePageScroll) {
  30305. this.$refs['n-list'].setSpecialEffects(args);
  30306. }
  30307. },
  30308. //处理开始加载更多状态
  30309. _startLoading: function _startLoading() {var isReload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  30310. if (this.showLoadingMoreWhenReload && !this.isUserPullDown || !isReload) {
  30311. this.loadingStatus = _zPagingEnum.default.More.Loading;
  30312. }
  30313. this.loading = true;
  30314. },
  30315. //检测scrollView是否要铺满屏幕
  30316. _doCheckScrollViewShouldFullHeight: function _doCheckScrollViewShouldFullHeight(totalData) {var _this4 = this;
  30317. if (this.autoFullHeight && this.usePageScroll && this.isTotalChangeFromAddData) {
  30318. this.$nextTick(function () {
  30319. _this4._checkScrollViewShouldFullHeight(function (scrollViewNode, pagingContainerNode) {
  30320. _this4._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, scrollViewNode, pagingContainerNode);
  30321. });
  30322. });
  30323. } else {
  30324. this._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData);
  30325. }
  30326. },
  30327. //检测z-paging是否要全屏覆盖(当使用页面滚动并且不满全屏时,默认z-paging需要铺满全屏,避免数据过少时内部的empty-view无法正确展示)
  30328. _checkScrollViewShouldFullHeight: function _checkScrollViewShouldFullHeight(callback) {var _this5 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var scrollViewNode, pagingContainerNode, scrollViewHeight, scrollViewTop;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.prev = 0;_context.next = 3;return (
  30329. _this5._getNodeClientRect('.zp-scroll-view'));case 3:scrollViewNode = _context.sent;_context.next = 6;return (
  30330. _this5._getNodeClientRect('.zp-paging-container-content'));case 6:pagingContainerNode = _context.sent;if (!(
  30331. !scrollViewNode || !pagingContainerNode)) {_context.next = 9;break;}return _context.abrupt("return");case 9:
  30332. scrollViewHeight = pagingContainerNode[0].height;
  30333. scrollViewTop = scrollViewNode[0].top;
  30334. if (_this5.isAddedData && scrollViewHeight + scrollViewTop <= _this5.windowHeight) {
  30335. _this5._setAutoHeight(true, scrollViewNode);
  30336. callback(scrollViewNode, pagingContainerNode);
  30337. } else {
  30338. _this5._setAutoHeight(false);
  30339. callback(null, null);
  30340. }_context.next = 17;break;case 14:_context.prev = 14;_context.t0 = _context["catch"](0);
  30341. callback(null, null);case 17:case "end":return _context.stop();}}}, _callee, null, [[0, 14]]);}))();
  30342. },
  30343. //设置z-paging高度
  30344. _setAutoHeight: function _setAutoHeight() {var _arguments = arguments,_this6 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var shouldFullHeight, scrollViewNode, heightKey, finalScrollViewNode, finalScrollBottomNode, scrollViewTop, scrollViewHeight, additionHeight;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:shouldFullHeight = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;scrollViewNode = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : null;
  30345. heightKey = 'height';
  30346. if (_this6.usePageScroll) {
  30347. heightKey = 'min-height';
  30348. }_context2.prev = 4;if (!
  30349. shouldFullHeight) {_context2.next = 20;break;}if (!
  30350. scrollViewNode) {_context2.next = 10;break;}_context2.t0 = scrollViewNode;_context2.next = 13;break;case 10:_context2.next = 12;return _this6._getNodeClientRect('.scroll-view');case 12:_context2.t0 = _context2.sent;case 13:finalScrollViewNode = _context2.t0;_context2.next = 16;return (
  30351. _this6._getNodeClientRect('.zp-page-scroll-bottom'));case 16:finalScrollBottomNode = _context2.sent;
  30352. if (finalScrollViewNode) {
  30353. scrollViewTop = finalScrollViewNode[0].top;
  30354. scrollViewHeight = _this6.windowHeight - scrollViewTop;
  30355. if (finalScrollBottomNode) {
  30356. scrollViewHeight -= finalScrollBottomNode[0].height;
  30357. }
  30358. additionHeight = _zPagingUtils.default.convertTextToPx(_this6.autoHeightAddition);
  30359. _this6.$set(_this6.scrollViewStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  30360. _this6.$set(_this6.scrollViewInStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  30361. }_context2.next = 22;break;case 20:
  30362. _this6.$delete(_this6.scrollViewStyle, heightKey);
  30363. _this6.$delete(_this6.scrollViewInStyle, heightKey);case 22:_context2.next = 26;break;case 24:_context2.prev = 24;_context2.t1 = _context2["catch"](4);case 26:case "end":return _context2.stop();}}}, _callee2, null, [[4, 24]]);}))();
  30364. },
  30365. //通过获取css设置的底部安全区域占位view高度设置bottom距离
  30366. _getCssSafeAreaInsetBottom: function _getCssSafeAreaInsetBottom() {var _this7 = this;
  30367. this._getNodeClientRect('.zp-safe-area-inset-bottom').then(function (res) {
  30368. if (res) {
  30369. _this7.cssSafeAreaInsetBottom = res[0].height;
  30370. if (_this7.safeAreaInsetBottom) {
  30371. _this7.updatePageScrollBottomHeight();
  30372. }
  30373. }
  30374. });
  30375. },
  30376. //触发更新是否超出页面状态
  30377. _updateInsideOfPaging: function _updateInsideOfPaging() {var _this8 = this;
  30378. if (this.insideMore && this.insideOfPaging === true) {
  30379. setTimeout(function () {
  30380. _this8.doLoadMore();
  30381. }, 200);
  30382. }
  30383. },
  30384. //获取节点尺寸
  30385. _getNodeClientRect: function _getNodeClientRect(select) {var inThis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var scrollOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  30386. var res = inThis ? uni.createSelectorQuery().in(this) : uni.createSelectorQuery();
  30387. if (scrollOffset) {
  30388. res.select(select).scrollOffset();
  30389. } else {
  30390. res.select(select).boundingClientRect();
  30391. }
  30392. return new Promise(function (resolve, reject) {
  30393. res.exec(function (data) {
  30394. resolve(data && data != '' && data != undefined && data.length ? data : false);
  30395. });
  30396. });
  30397. },
  30398. //清除timeout
  30399. _cleanTimeout: function _cleanTimeout(timeout) {
  30400. if (timeout) {
  30401. clearTimeout(timeout);
  30402. timeout = null;
  30403. }
  30404. return timeout;
  30405. },
  30406. //添加全局emit监听
  30407. _onEmit: function _onEmit() {var _this9 = this;
  30408. uni.$on(_zPagingConstant.default.i18nUpdateKey, function () {
  30409. _this9.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  30410. });
  30411. uni.$on(_zPagingConstant.default.errorUpdateKey, function () {
  30412. if (_this9.loading) {
  30413. _this9.complete(false);
  30414. }
  30415. });
  30416. uni.$on(_zPagingConstant.default.completeUpdateKey, function (data) {
  30417. setTimeout(function () {
  30418. if (_this9.loading) {
  30419. if (!_this9.disabledCompleteEmit) {
  30420. var type = data.type || 'normal';
  30421. var list = data.list || data;
  30422. var rule = data.rule;
  30423. _this9.fromCompleteEmit = true;
  30424. switch (type) {
  30425. case 'normal':
  30426. _this9.complete(list);
  30427. break;
  30428. case 'total':
  30429. _this9.completeByTotal(list, rule);
  30430. break;
  30431. case 'nomore':
  30432. _this9.completeByNoMore(list, rule);
  30433. break;
  30434. case 'key':
  30435. _this9.completeByKey(list, rule);
  30436. break;
  30437. default:
  30438. break;}
  30439. } else {
  30440. _this9.disabledCompleteEmit = false;
  30441. }
  30442. }
  30443. }, 1);
  30444. });
  30445. },
  30446. //销毁全局emit监听
  30447. _offEmit: function _offEmit() {
  30448. uni.$off(_zPagingConstant.default.i18nUpdateKey);
  30449. uni.$off(_zPagingConstant.default.errorUpdateKey);
  30450. uni.$off(_zPagingConstant.default.completeUpdateKey);
  30451. } } };exports.default = _default2;
  30452. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30453. /***/ }),
  30454. /* 272 */
  30455. /*!*************************************************************************************************!*\
  30456. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-static.js ***!
  30457. \*************************************************************************************************/
  30458. /*! no static exports found */
  30459. /***/ (function(module, exports, __webpack_require__) {
  30460. "use strict";
  30461. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]公用的静态图片资源
  30462. var base64Arrow = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAD1BMVEVHcExRUVFMTExRUVFRUVE9CdWsAAAABHRSTlMAjjrY9ZnUjwAAAQFJREFUWMPt2MsNgzAMgGEEE1B1gKJmAIRYoCH7z9RCXrabh33iYktcIv35EEg5ZBh07pvxJU6MFSPOSRnjnBUjUsaciRUjMsb4xIoRCWNiYsUInzE5sWKEyxiYWDbyefqHx1zIeiYTk7mQYziTYecxHvEJjwmIT3hMQELCYSISEg4TkZj0mYTEpM8kJCU9JiMp6TEZyUmbAUhO2gxAQNJiIAKSFgMRmNQZhMCkziAEJTUGIyipMRjBSZkhCE7KDEFIUmTeGCHJxWz0zXaE0GTCG8ZFtEaS347r/1fe11YyHYVfubxayfjoHmc0YYwmmmiiiSaaaKLJ7ckyz5ve+dw3Xw2emdwm9xSbAAAAAElFTkSuQmCC';
  30463. var base64ArrowWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVHcEz///////////////////+IGTx/AAAABnRSTlMA/dAkXZOhASU/AAABYElEQVRYw+2YwXLCIBCGsdAHWGbyAKZ4zxi9O017rxLf/1UaWFAgA1m8dcpedNSPf/l/Vh0Ya/Wn6hN0JcGvoCqRM4C8VBFiDwBqqNuJKV0rAnCgy3AUqZE57x0iqTL8Br4U3WBf/YWaIlTKfAcELU/h9w72CSVPa3C3OCDvhpHbRp/s2vq4fHhCeiCl2A3m4Qd71DQR257mFBlMcTlbFnFWzNtHxewYEfSiaLS4el8d8nyhmKJd1CF4eOS0keLMAuSxubLBIeIGQW8YHCFFo7EH9+YDcQt9FMZEswTheaNxTHwHT8SZorJjMrEVwo4Zo0U8HSEyZvJMOg4RjnmmRr8nDYeIz3OMkbfE/QhBo+U9RnZJxjGCRh/WKmHEMWLNkfPKsGh/CWJk1JjG0kcuJggTt34VDP8aWAFhp4nybVb5+9qQhjSkIQ1pSEMa8k+Q5U9rV3dF8MpFBK+/7miVq1/HZ2qmo9D+pAAAAABJRU5ErkJggg==';
  30464. var base64Flower = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAKlBMVEVHcEzDw8Ovr6+pqamUlJTCwsKenp61tbWxsbGysrLNzc2bm5u5ubmjo6MpovhuAAAACnRSTlMA/P79/sHDhiZS0DxZowAABBBJREFUWMPtl89rE0EUx7ctTXatB3MI1SWnDbUKPUgXqh4ED8Uf7KUVSm3ooVSpSii0Fn/gD4j4o+APiEoVmos9FO2celiqZVgwgaKHPQiCCkv+F99kM7Ozm5kxq1dfD91k9pPve9/3ZjbRNHHok/mKli4eIPNgSuRObuN9SqSEzM20iGnm0yIbqCuV7NSSSIV7uyPM6JMBYdeTOanh/QihJYZsUCSby+VkMj2AvOt0rAeQAwqE3lfKMZVlQCZk1QOCKkkVPadITCfIRNKxfoJI5+0OIFtJx14CMSg1mRSDko7VAfksRQzEbGYqxOJcVTWMCH2I1/IACNW0PWU2M8cmAVHtnH5mM1VRWtwKZjOd5JbF6s1IbaYqaotjNlPHgDAnlAizubTR6ovMYn052g/U5qcmOpi0WL8xTS/3IfSet5m8MEr5ajjF5le6dq/OJpobrdY0t3i9QgefWrxW9/1BLhk0E9m8FeUMhhXal499iD0eQRfDF+ts/tttORRerfp+oV7f4xJj82iUYm1Yzod+ZQEAlS/8mMBwKebVmCVp1f0JLS6zKd17+iwRKTARVg2SHtz3iEbBH+Q+U28zW2Jiza8Tjb1YFoYZMsJyjDqp3M9XBQdSdPLFdxEpvOB37JrHcmR/y9+LgoTlCFGZEa2sc6d4PGlweEa2JSVPoVm+IfGG3ZL037iV9oH+P+Jxc4HGVflNq1M0pivao/EopO4b/ojVCP9GjmiXOeS0DOn1o/iiccT4ORnyvBGF3yUywkQajW4Ti0SGuiy/wVSg/L8w+X/8Q+hvUx8Xd90z4oV5a1i88MbFWHz0WZZ1UrTwBGPX3Rat9AFiXRMRjoMdIdJLEOt2h7jrYOzgOamKZSWSNspOS0X8SAqRYmxRL7sg4eLzYmNehcxh3uoyud/BH2Udux4ywxFTc1xC7Mgf4vMhc5S+kSH3Y7yj+qpwIWSoPTVCOOPVthGx9FbGqrwFw6wSFxJr+17zeKcztt3u+2roAEVgUjDd+AHGuxHy2rZHaa8JMkTHEeyi85ANPO9j9BVuBRD2FY5LDMo/Sz/2hReqGIs/KiFin+CsPsYO/yvM3jL2vE8EbX7/Bf8ejtr2GLN65bioAdgLd8Bis/mD5GmP2qeqyo2ZwQEOtAjRIDH7mBKpUcMoApbZJ5UIxkEwxyMZyMxW/uKFvHCFR3SSmerHyDNQ2dF4JG6zIMpBgLfjSF9x1D6smFcYnGApjmSLICO3ecCDWrQ48geba9DI3STy2i7ax6WIB62fSyIZIiO3GFQqSURp8wCo7GhJBGwuSovJBNjb7kT6FPVnIa9qJ2Ko+l9mefGIdinaMp0yC1URYiwsdfNE45EuA5Cx9EhalfvN5s+UyItm81vaB3p4joniN+SCP7Qc1hblAAAAAElFTkSuQmCC';
  30465. var base64FlowerWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEX///9HcEz///////////////84chYNAAAABnRSTlP/AGzCOYZj5g1nAAACfklEQVRYw+2YTVPDIBCGtza9Jw25a0bvcax30o73OOr//yvma2F3YWlpPTijXNpAHrK8LLALVPFium2vNIFSbwGKTGQA2GUiHcD29yDNy3sMIdUBQl7r2H8mOEVqAHgPkYZUS6Qc2zYhQqtjyDZEximCZwWZLIBeIgYShs2NzxKpSUehYpMJhURGb+O+w5BpMCAREKPnCDHbIY20SzhM5yxziAXpOiBXydrekT9i5XDEq4NIIHHgyU5mRGqviII4mREJJA4QJzMiILwlRJzpKxJKvCBm8OsBBbLux0tsPl4RKYm5aPu6jw1U4mGxEUR9g8M1PcqBEp/WJliNgYOXueBzS4jZSIcgY5lCtevgDSgyzE+rAfuOTQMq0yzvoGH18qju27Mayzs4fPyMziCx81NJa5RNfW7vPYK9KOfDiVkBxFHG8hAj9txuoBuSWORsFfkpBf7xKFLSeaOefEojh5jz22DJEqMP8fUyaKdQx+RnG+yXMpe8Aars8ueR1pVH/bW3FyyvPRw90upLDHwpgBDtg4aUBNkxRLXMAi03IhcZtr1m+FeI/O/JNyDmmL1djLOauSlNflBpW18RQ2bPqXI22MXXEk75KRHTnkPkYbESbdKP2ZFk0r5sIwffAjy1lx+vx7NLjB6/E7Jfv5ERKhzpN0w8IDE8IGFDv5dhz10s7GFiXRZcUeLCEG5P5nDq9k4PFDcoMpE3GY4OuxuCXhmuyNB6k0RsLIAvqp9NE5r8ZCSS8gxnUp7ODdYhZTqxuiJ9uyJJtPmpqJ7wVj+XVieS903iViHziqAhchLEJAyb7jWU647EpUofQ0ziUuXXXhDddtlllSwjgSQu7r4BRWhQqfDPMVwAAAAASUVORK5CYII=';
  30466. var base64Success = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVRUVFHcExTU1NRUVFRUVFRUVFOSlSUAAAABnRSTlP/AI6+VySB3ZENAAACcElEQVRYw+2YyYKCMAyGI8hdpdxdZu7gcpdZ7jL6/s8yYheSNi0aPdqbwOffpGmaFOYPD3gj4bisN7vddv17N/JVgxn5x12IWgIaWTuO/IE3PseQbwjGPo2cgRmHFLJwdm/X643zwiqOKPPJ1nj3sjEP2iiifZWj5bhopSyGaEO2HX5fbQJzwJ+W7x/jw5ZFjsEU0PMph9xE8i5EqprKALW95eJQURkgzw98uJ/JvwGecR7bIjWWsUgVrrIfFZ2HlLy3sKETD1mmRLRMRhGVssRa0xJkdn3SpJBymBkM8+pSSDXMDNyDaToVHd2fgpNt0sjwiUZO19+jGQ+gQEg9Oq+bufmAVGihomNmjQG7UG3020vrlm7lkFnKFGU3kZ0KGAdmKe821pipQ+qEKcrZeTL2g5FsUks4cStjEZWwXg0b0n4GxmEpkWwIs5VBynjgK7xZaz1/0D7OxkVuLpsY5BQNFyLS84VBjjbg0iL2r2EQHBOxBhikuUOkdxODVF1cxHoWtPPsiyXO455Iv34hssCO8EV4ZIYTjS8SR4qYSHRiTiYQ4ZFbHi0iIhhBTi6dTCgSWRcnw4h4yGTuyTAiOGBIWGoZTgSHJQl+LcOJ4OCnW6yX2bMnJ9pidCOXtkTkTrIGpYuOynAiOF14SamMiOCk5Ke+mq8BcOrrvym8d0zKIQnWT+M1WwOQNO4fFiWb18hhERxJPx2fblbPHHyC41VyiAtKBUFBIih7JMWVoIQTFIr3lKPN80WvoLSWFPC653ioTZA0I0FrQ7qU6asaK0H7JmkSJa2ooOGVtNUsc3j9FYHkIkJy3SG6VHnfXKXGP9t4N9Q4Ye98AAAAAElFTkSuQmCC';
  30467. var base64SuccessWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAiVYk6KvDHLfaegAAAo1JREFUWMPtWEtzmzAQNhCTq910ytXpiyvxTNOr60zrayepx9d02gnX4sTm7xcEiJX2gdnkGJ1A4tOnfWqXyeR1vMRYzrcPD9v5h5MBl3/Ldvx4cxIg/FWC8X0xjLjalM54uhhCfCrRuJURX0pi3EmIqZV7O59vrRZmguStHL9b7S7ftfLwOtiZDw7AHMtmquAQ12b5Wwbnordm8g9zLLO49qc/m2n6aKnhwPOGZ08hAiNHhheiHae1lOUPGZpQkPKa3q0mOUjaRzSRaGUjpy/mmWSwySSpllcEteBKAT52KEnSbblA51pJEPxBQoiH1FP4E3s5+FJv07h6/ylD6ui7B+9fq/ehrFB98ghec9EoVtyjK8pqCHLmCBOwMWSCeWFNN4MbPAk55NhsvoFHSSVR0k5TCTTEzlUGcqV/nVp7n9oIVkmtaqbAEqEgfdgHJPwsEAyZ9r4VAZXFjpEwyaw3+H2v42KYxKhs1XvY/gSSGv+IHyUSuHXCeZhLAgVI3EjgSGo1Fb3xO0tGGU9S2/KAIbtjxpJASG73qox6w5LUq0cEOa+iIONIWIilQSQ0pPa2jgaRQAgQP7c0mITRWGxpMAmEQFN2NAQJNCV0mI6GIIEO47hlQ0ORQLd0nL+hoUjg1m6I1TRr8uYEAriBHLcVFQ5UEMiBe3XkTBEG04WXlGKGxPnMS305XQPA1Ocn2JiuAZwE66fxnKwBnDTuXxZTMq85lwW6kt5ndLqZPefiU1yvmktcUSooChJF2aMprhQlnKJQ5FxRKkcVRa+itNYU8Io2oVkY14w0NMWYlqft91Bj9VHq+ca3b43BxjWJmla0sfKohlfTVpPN+93L/yLQ/IjQ/O5Q/VR5HdL4D7mlxmjwVdELAAAAAElFTkSuQmCC';
  30468. var base64Empty = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURdvc3EdwTMLBwcjIyLSzs/Hx8ff39////19dXXz7IJEAAAAFdFJOU/4A6J9QDyyutAAAB5VJREFUeNrtnM1z4jYYxhUHkR4hdu9eU7Z75Ct7jgPbs9ZZmSuTrUWPmXTA186e+LMrf0uWLMtf2WkHXQgzln88et5XeiVMwPQdGrhCrpAr5Aq5Qv4TkJ07OGQFMLp1B4VYCz+kDblDQhJGeH4eEDLBYdLOHwaDWNBPIeHLYJAJ3meQ83IoCMTHDBKOBoKYGOeM8G0gyD0LObnDQB5ZSCtTNCBfsM9AboaBPLCQcDAIM1zht/dQEkMsd1DjI4hpw2YzMtBJeBbydWpCTJs3YDKGX62YgfGoVwi9KwtZJAzcYHHRm7sYCKD390nQSIoO5JGZIEOYxNoZ4+deISYLyeL5hLHbJ2QK98W0kudMgJe9Qh73odhO+KZHyNYGvgQS9gmJKhUigwSj3iBPUhXxePWmxBqHw0Mej9WQ3qILVjLC177yxNxXQ/7uK+Mn1aNVLsGsBTaWrSAPobYl0aUHt2fIs2Rgz7c9QYL0pSTkSzILLFtAJMH1cidN998T9E0/Sg73/pEEwrgkYRh86wlC949gJsR6EobBcz8hHOVgKYi2m6kZtodIkjEQvF3QjbGpmplB4/lRgJhxgRS2N15iijAvPmByDtCxfQhPJ8J4CR82rgCCBILarScw6X0OcMUyYrFVmbxErl0ZacFIoloOLdJAO42qY+NMDss2kKS8xmiZxcCpFKXWvpRGbQqJp5ixyRfJMmR6x0Fk+z29kmgWDYI5ziFbdug/84HxvduhWhLOJ2StPDQrMJPSjNANklh8QhB7dBO0yTGRwn1fkOk8rbQjiB8Ymww+JuiuN0icmSccK4naLMWYa/euL0+m23GyM8kgAc6sYeL4z04Qa4WjGepcKIliO8EUGSk7d9OGWOsoK31OSdy8TQZ59Y/hWbaV1IVs5/Ed6UzGK4nANAJiyGhRsZPUg2yzLe9hLyiJIyCaDU7udC2uy9pnkKvidlBUEltzFAqxRhBrBZm7HfZnjEQI3boqTsJq15PUDEaKZLgiJYc8OZtCtnM/4G93OFYooXpvdy0guwWWNQkEHl/j7Jw1XRmtlS9HYJkSPjk1IUnyyRqUKQn45NSDlP1mcg9i6En1ZU2IADnEtHF1Q+JwIcS/d5YakPuDUamEShGUHHikAz9oQCaE0CsrpYjDBVkEHQYdyK+EkKPhVErxqh1xbJ/oQf4gEeVsOIEc41WJNAwcd9GBfCZJezXsJhAvH+ImEEIOzlwXgpw5wQ0gH3MIOcsiQAahZuSD69/UQyxcQEggiQARQseVFO/ASAMCgM9gjkHZmhLENzi1AOhA7ullkMWUrfHKfpMiDBHtDIx6yCS6jseEnDUe7zcT6DGCtnrIY3olZw1hrPHkfucIAJa1EDu/lsVEyVmGGA67coKijeogFnMxlEaAV5ghRdDm1kDuuatZTJBGgJdOthIzsvZbDWRRuh6ScgR4EQLgagQvRQIxxQ4sxqcR4GE+c4CkjZQQW9YF89Y4OFAjOCki5KmiDxsBL3PlSJWlAFVogaoIePlYi2ClCJAHRa/cmre5eqTii4uvisqQJxqnip6pNd68DhEvyEs5xIyHBNdh4thCKhU++10kD7Gy1Up1A/o56FKuRJQWSFCuf8dpbisxhqHSKlSSgvG7VTaFKO5TzYD5VMPUxEB2YJNiqq3xYJ0KrroH8mq7xpoXqEZgfgNRUQsDtTVvUOk3sLUKbqrBr7YGvkCkQNC/9SA+vTYtvERrxiKEmcogk4ZqCLUd59MIEiFYHlIoxelCaJWDMmtOPIa80XVLbkb6hzaEwwTcPEmV4AIRlBGNIEmuJBFwLAZoHClJ36J8h+wxihpCqJosAnJrSKwEcQOFAFeWN4RQMYc0Ao4Jhg5gpASzyWcDvjpuDIlTkrGGJEro1rHIjHKR3wJCAj+z5oyi11gJBkXy9QFJIiAu78d+pgSjuWhGN0gUAZAcEncSJf4LRrZ8I94WEmcNCJJqBWYjVbE9bg2JxiyrViBWty6QvO56D8jPVWLA4ZX8dfkxvJJPl8t8aCX+pU/Iz1SCf7lc4OBK0OWfQaKLP0TKjj96VvIp+/BDZjwNKF2ItV2vN7sWStAl87oWkm3dZ+k3lEMoYXe8cT1eq2TOePJDD8KfQdxu6iEPxanUZa4HmZRq3dunGsj3BzFq6yD3wnZNX4n2emI2hXyXQpi6RRZdfSgxHNuxVZBFdyVeBPDmCsiksxKUiDAUEKuzkvRUEs0V08pjVyU2/yqFmF2VZGYop3peitdUiQd1pnrL7qTE01tPzE6eaEKm23dQwh2jNlbiay+/245zl94abw45CzNPyqYQ2++kxHGV1crWzg4A2yvR+BY7wziwnRLN7+O36aA54+ZKGjxZYK3txJpxQyUNn5GwtquII4+ACiWtnvawduu1A3SVtH5uhTvAVSpBG7fDYz6RQ+M6JWjmKm6g+RvTla9UMtspu+s+37VbVCupNqPx43CsNawSb1PbtcmDfQWmUILW7rRXSPHtSq5k5ur0a/hb7DQCUiW3G71ejX/wvV1kSoyNbp8Wvyqn1lCIKvl6gNDkNBYzt0GHdr+Pt9xGl1//ncAVcoVcIVfIFXKFXCFXyP8I8i8SyTW4yTz2lwAAAABJRU5ErkJggg==';
  30469. var base64Error = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAJFBMVEVHcEzo6Oibm5ukpKSbm5uampqbm5ubm5u5ubnn5+fm5ub6+vpGpDPdAAAAC3RSTlMA/v4hb+u20dq8aQhnHL4AAATwSURBVHja7ZvNb+JGGMbdjjdVe3NPodzeMhj1ZMUGujkh28B9wKR7iwwBqafWSbPqsbm0uTWtVlrTS9v0Et9yqLQS/1zHNiTZMMB4bO92d+dRUITt8c/PvPPx2h4URUpKSkpKSkpK6m3K6lFN73Q+S/+es3W3fzabTh2Dl0FAXEM+BgrgeXxRsdILTDU9n7J0vz/+EsCYC9KEiSFc06pf5zouqAkjkGWo0OG5Fq6j2IwZ6I4/4DhyTxc20oUjAj5PRTTrwvGAZ9p+ADzlD4RDctCoLhb7JUP87xeLxS3BZUIQ+YNCFi8wRwc4GIqGRK/GkM+5ILV8kFflOmkkkH/LddJ4c05eSSfSyTvrZPEmnCw+UCeuk84QvTSnUF0uCL68fBle/swF+RL1QZ/EpU6gHtOsAM64pnjPwxgTLsjoBM58ODNaAXYBT5QeGdr0KwcEA8He0TkPBLCjUDNHpG4qlg8eTCzXht1FVd1MxTPHj5LTtUiSrKK+7iDf8wBGxk4If3arLv/HF4Tox0A2nlFIGp+CIA+LzSamgbp4TNvZjECtDAjyMcB5HybLO6NxsRA1vmFCNjguNXDGWygbRPXh/B+zn9zPWK5RCkT18QxA57YgAqE+HGS6/tAoD4JO0ts+M2tbyQJpc95a5oI0xXNhCZGQ/x8E0VSCkUZY6Z6CIE/qdO5eL+yPlW6tMMgefPs3o7Bdt8iguJj4DThlZSY/rJ0yB+RraLDK2jAQCHyr4zIhT9mQ7vowygMZjpgQG+CYUV2E1EWqixyzICr8eFFnBB5ba1Y4IIfeKQvysW7ssZrwQLEFmvCBM2U6oRkdI5Wgm1QnO8RUTDlASoiESIiESMh7BDHKhlhu/LbSNUuEqL3lu1p945vO3BArADiaum7vBGDUKQfSIjBykooyrRPQnTIglHFfSagHeqd4iErwa9duEebpckGQjx/VT4v5fC0XhJHAd1mPRvJAVMZiAeQzTpgHYrPKqkGnUEiX+dCoNS4UgniHMTnUS4iESIiE7IS0x+mnVAidglDwVcmQJpy2WQ8VC4UgogfbA1RE4Nuw3UghEBV2rKl7V5ygAJPSY9KGQbP01mVjA5Fa2f1kQN2U3k+M9POWB8gnJUNMZJioWTMzKwOklyxgDrCXVcMMEF90tXM9C2TiCqmfCdIRi/jeewNpyerKok9WkGuzfCdYC+fXRsmBxxpVGG2zY0ZBbieJKvPrDQce3lxppBhIjGFWGkVoxUEoZt0Mukn2XBQH0bTHZpaMIp2sU/6qasU70W6/eHjM09VmYSc6C6Jpvz+orKvVxot8kL3HkMr9IZ9qeZ2o6RrO9mOI9ufdIR9peZ2gNIW31yC/MpyI9ngUDNIsezPks3vIsWDGdYA7cZa9pbqUVeCr/neiaR3U3R4BfXPg75vwb8I/b7HjxChobDZCO+Ny4wuxxaVxPPowcoNnrzPmzGFlX3RJHz2FafbhJ41n8PLx2DCM7KkwQgpqka1DVzKdJNHfJwBe9l/n0eSZFsIPjVSY8xZKZpSXnogwled98wAx3xRcdBNq1f1fhFVdIcL5tvaDolC7XaqaWStEtLOJHkbhlSauMLrma4yHEa03AVUoIUs/M2NQFkchBZiGUPeKonAnqhLOo4hrKf0WTyZ1FcU0Ki0hVrSr+Mucnvya7jYUKSkpKSkpKSmpD0f/AXq+Umj5XnXDAAAAAElFTkSuQmCC';
  30470. var base64BackToTop = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAElBMVEVRUVH+/v5HcEyZmZlRUVFRUVGm1ByOAAAABnRSTlPMzADMTZAJBBGsAAAEnElEQVR42t2cS27jMAyGf7/2U+QCQeDsbeQCgZDujaC5/1UmkzaJn+JDFGcw3LdfflKibJkkDnxrL7dbg7sNt6+L4O8OYBM+B0ys+QrGkHZG+OEEQ8g6go8Bx1GIGMdpNOQyIG6XdMgnSPtKhLQDGEZFBgYMkhKFtGBb0EIEjDgFRowoBVaMGAWpMedEfxMiZtwpUsgZCqtlkCNUdpVAWigtCCCDFtLwIWeoreZCWiRYYEKGFEjDg+yRZCUH0iLRAgNyToXUNCRZyMqWhGnUN2IPm3wSlwJ7IUspyCBkIQUZhCykIIeQuRTkEDKXAuM9srrtYbrZN7Y98giZSoFd+t1OxmMITG0dcrSFXFchZ1tIvQZpYWxhBbK3hpQrkMEa0iwh5t4a+QvZvDXyF7J5a+Qv5PPW21/I5623v5DPW29/IaO3Xv5Clrw1y1/Ikrdm+Qs5svw83yNnSJ5BQb4F/F7EIEJSnThGBAXxkFQfLOviQUE8JAUPsosHBfGQfDAtHhREQ1JxIV00KIgmrnRI84S0yAd5BAXxxJUck0f6Qnwr9qmr6xF5xLMjcwn/iudIEAdWnyjkEXlQKZiRVzoqRyLbgeUKKR8Q4alY7cSnoxzSf2ggsqehKr6YVpcXpOd7H93f60cKhOd7Re2LteUF4eLqiVS1mr0ge4io6C2+soaFkJ7MuuuQs1yITEp9hwwKISIpzR2iESKSIoT0rLNwuVHQqoSIpAQJpGce60vIUSdEIuUqgPTsJ5QFZK8UIpBS8iG94GFrDjlrhfCl8CG96Llxmle4kEr6vKWBPIVo9kqDQSRk9/3cWoikcCFPAd33v4dIChPyEvLzBA6RlEYWke4JEUnhKXkLeUEKxRHJFfKCQHGucIW8IdZSRkLeEGMpYyEjiK2UsZARxFTKRMgYYillImQMMZQyFTKB2EmZCplAuFLIHT8TMoWwpQwiIVMIUwqpZP5bp5CCvCTiQKr5f5lCQN+tPCBn2ZvVDFJwIDUP0m1BYAfZYRNSsCB7BqTbhoARePIxtZ9tgwWkoJcwCalmv3MBAemtO4R6dah2HaKQqj8Zvp9sQDjvJ21+SPCBHPJDDk6QITekEV7gqCC19CpKAym9IMfckKv4olMBCeIrWwVEfvkshzQekO9r9P1/ALk+IG1eSPCDiCJfyG+FyU+A6ZCa/piZDinpz7LpkCv5gdkAEshP5emQhv7onw6pGeULyZCSUYiRDAmMkpJkCKs4JhFSq8p8hJBSVbAkhARV6ZUQoisik0FqXTmcDHLVFfbJIEFXoiiCNMpiSxGkVJaNiiBBWQArgTTaUl4JpNQWJUsgQVteXQg+AKkLxQWFGKW+5J2+eVp4S168X3CF1CltCKdTJ8lb84YK2bUBO+wZW0Pqv9nk4tKu49N45NJC5dMM5tLW5tOg59Jq6NM06dL+abFXwr/RkuvTXJwae1abtE/Dt0/ruksTvs84AZ/BCC4jHnyGVfiM3VBQFANEXEah+Ax18RlP4zNox2dkkM/wI58xTn8yDCXGYCDV3W5RGSajtXyGhG1jbpbjzpwGt/0MJft8jqC7iUbQ/QZaxdnKqcIftwAAAABJRU5ErkJggg==';var _default =
  30471. {
  30472. base64Arrow: base64Arrow,
  30473. base64ArrowWhite: base64ArrowWhite,
  30474. base64Flower: base64Flower,
  30475. base64FlowerWhite: base64FlowerWhite,
  30476. base64Success: base64Success,
  30477. base64SuccessWhite: base64SuccessWhite,
  30478. base64Empty: base64Empty,
  30479. base64Error: base64Error,
  30480. base64BackToTop: base64BackToTop };exports.default = _default;
  30481. /***/ }),
  30482. /* 273 */
  30483. /*!***************************************************************************************************!*\
  30484. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js ***!
  30485. \***************************************************************************************************/
  30486. /*! no static exports found */
  30487. /***/ (function(module, exports, __webpack_require__) {
  30488. "use strict";
  30489. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]常量
  30490. var version = '2.2.1';
  30491. var delayTime = 100;
  30492. var i18nUpdateKey = 'z-paging-i18n-update';
  30493. var errorUpdateKey = 'z-paging-error-emit';
  30494. var completeUpdateKey = 'z-paging-complete-emit';var _default =
  30495. {
  30496. version: version,
  30497. delayTime: delayTime,
  30498. i18nUpdateKey: i18nUpdateKey,
  30499. errorUpdateKey: errorUpdateKey,
  30500. completeUpdateKey: completeUpdateKey };exports.default = _default;
  30501. /***/ }),
  30502. /* 274 */
  30503. /*!************************************************************************************************!*\
  30504. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-utils.js ***!
  30505. \************************************************************************************************/
  30506. /*! no static exports found */
  30507. /***/ (function(module, exports, __webpack_require__) {
  30508. "use strict";
  30509. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  30510. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! ./z-paging-i18n */ 275));
  30511. var _zPagingConfig = _interopRequireDefault(__webpack_require__(/*! ./z-paging-config */ 276));
  30512. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index */ 277));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]工具类
  30513. var storageKey = 'Z-PAGING-REFRESHER-TIME-STORAGE-KEY';
  30514. var config = null;
  30515. /*
  30516. 当z-paging未使用uni_modules管理时,控制台会有警告:WARNING: Module not found: Error: Can't resolve '@/uni_modules/z-paging'...
  30517. 此时注释下方try中的代码即可
  30518. */
  30519. try {
  30520. var contextKeys = __webpack_require__(278).keys();
  30521. if (contextKeys.length) {
  30522. var suffix = '.js';
  30523. config = __webpack_require__(279)("./z-paging-config" + suffix);
  30524. }
  30525. } catch (e) {}
  30526. //获取默认配置信息
  30527. function gc(key, defaultValue) {
  30528. if (!config) {
  30529. if (_index.default && Object.keys(_index.default).length) {
  30530. config = _index.default;
  30531. } else {
  30532. var temConfig = _zPagingConfig.default.getConfig();
  30533. if (_zPagingConfig.default && temConfig) {
  30534. config = temConfig;
  30535. }
  30536. }
  30537. }
  30538. if (!config) {
  30539. return defaultValue;
  30540. }
  30541. var value = config[_toKebab(key)];
  30542. if (value === undefined) {
  30543. value = config[key];
  30544. } else {
  30545. return value;
  30546. }
  30547. return defaultValue;
  30548. }
  30549. //判断两个数组是否相等
  30550. function arrayIsEqual(arr1, arr2) {
  30551. if (arr1 === arr2) return true;
  30552. if (arr1.length !== arr2.length) return false;
  30553. for (var i = 0; i < arr1.length; i++) {
  30554. if (arr1[i] !== arr2[i]) return false;
  30555. }
  30556. return true;
  30557. }
  30558. //获取最终的touch位置
  30559. function getTouch(e) {
  30560. var touch = null;
  30561. if (e.touches && e.touches.length) {
  30562. touch = e.touches[0];
  30563. } else if (e.changedTouches && e.changedTouches.length) {
  30564. touch = e.changedTouches[0];
  30565. } else if (e.datail && e.datail != {}) {
  30566. touch = e.datail;
  30567. } else {
  30568. return {
  30569. touchX: 0,
  30570. touchY: 0 };
  30571. }
  30572. return {
  30573. touchX: touch.clientX,
  30574. touchY: touch.clientY };
  30575. }
  30576. //判断当前手势是否在z-paging内触发
  30577. function getTouchFromZPaging(target) {
  30578. if (target && target.tagName && target.tagName !== 'BODY' && target.tagName !== 'UNI-PAGE-BODY') {
  30579. var classList = target.classList;
  30580. if (classList && classList.contains('zp-paging-touch-view')) {
  30581. return true;
  30582. } else {
  30583. return getTouchFromZPaging(target.parentNode);
  30584. }
  30585. } else {
  30586. return false;
  30587. }
  30588. }
  30589. //获取z-paging所在的parent
  30590. function getParent(parent) {
  30591. if (!parent) return null;
  30592. if (parent.$refs.paging) return parent;
  30593. return getParent(parent.$parent);
  30594. }
  30595. //打印错误信息
  30596. function consoleErr(err) {
  30597. console.error("[z-paging]".concat(err));
  30598. }
  30599. //打印警告信息
  30600. function consoleWarn(warn) {
  30601. console.warn("[z-paging]".concat(warn));
  30602. }
  30603. //设置下拉刷新时间
  30604. function setRefesrherTime(time, key) {
  30605. try {
  30606. var datas = getRefesrherTime();
  30607. if (!datas) {
  30608. datas = {};
  30609. }
  30610. datas[key] = time;
  30611. uni.setStorageSync(storageKey, datas);
  30612. } catch (e) {}
  30613. }
  30614. //获取下拉刷新时间
  30615. function getRefesrherTime() {
  30616. try {
  30617. var datas = uni.getStorageSync(storageKey);
  30618. return datas;
  30619. } catch (e) {
  30620. return null;
  30621. }
  30622. }
  30623. //通过下拉刷新标识key获取下拉刷新时间
  30624. function getRefesrherTimeByKey(key) {
  30625. var datas = getRefesrherTime();
  30626. if (datas) {
  30627. var data = datas[key];
  30628. if (data) return data;
  30629. }
  30630. return null;
  30631. }
  30632. //通过下拉刷新标识key获取下拉刷新时间(格式化之后)
  30633. function getRefesrherFormatTimeByKey(key) {
  30634. var time = getRefesrherTimeByKey(key);
  30635. var timeText = _zPagingI18n.default.t['refresherUpdateTimeNoneText'][_zPagingI18n.default.getLanguage()];
  30636. if (time) {
  30637. timeText = _timeFormat(time);
  30638. }
  30639. return "".concat(_zPagingI18n.default.t['refresherUpdateTimeText'][_zPagingI18n.default.getLanguage()]).concat(timeText);
  30640. }
  30641. //将文本的px或者rpx转为px的值
  30642. function convertTextToPx(text) {
  30643. var dataType = Object.prototype.toString.call(text);
  30644. if (dataType === '[object Number]') {
  30645. return text;
  30646. }
  30647. var isRpx = false;
  30648. if (text.indexOf('rpx') !== -1 || text.indexOf('upx') !== -1) {
  30649. text = text.replace('rpx', '').replace('upx', '');
  30650. isRpx = true;
  30651. } else if (text.indexOf('px') !== -1) {
  30652. text = text.replace('px', '');
  30653. }
  30654. if (!isNaN(text)) {
  30655. if (isRpx) return Number(uni.upx2px(text));
  30656. return Number(text);
  30657. }
  30658. return 0;
  30659. }
  30660. //获取当前时间
  30661. function getTime() {
  30662. return new Date().getTime();
  30663. }
  30664. //------------------ 私有方法 ------------------------
  30665. function _timeFormat(time) {
  30666. var date = new Date(time);
  30667. var currentDate = new Date();
  30668. var dateDay = new Date(time).setHours(0, 0, 0, 0);
  30669. var currentDateDay = new Date().setHours(0, 0, 0, 0);
  30670. var disTime = dateDay - currentDateDay;
  30671. var dayStr = '';
  30672. var timeStr = _dateTimeFormat(date);
  30673. if (disTime === 0) {
  30674. dayStr = _zPagingI18n.default.t['refresherUpdateTimeTodayText'][_zPagingI18n.default.getLanguage()];
  30675. } else if (disTime === -86400000) {
  30676. dayStr = _zPagingI18n.default.t['refresherUpdateTimeYesterdayText'][_zPagingI18n.default.getLanguage()];
  30677. } else {
  30678. dayStr = _dateDayFormat(date, date.getFullYear() !== currentDate.getFullYear());
  30679. }
  30680. return "".concat(dayStr, " ").concat(timeStr);
  30681. }
  30682. function _dateDayFormat(date) {var showYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30683. var year = date.getFullYear();
  30684. var month = date.getMonth() + 1;
  30685. var day = date.getDate();
  30686. if (showYear) {
  30687. return "".concat(year, "-").concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  30688. } else {
  30689. return "".concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  30690. }
  30691. }
  30692. function _dateTimeFormat(date) {
  30693. var hour = date.getHours();
  30694. var minute = date.getMinutes();
  30695. return "".concat(_fullZeroToTwo(hour), ":").concat(_fullZeroToTwo(minute));
  30696. }
  30697. function _fullZeroToTwo(str) {
  30698. str = str.toString();
  30699. if (str.length === 1) return '0' + str;
  30700. return str;
  30701. }
  30702. //驼峰转短横线
  30703. function _toKebab(value) {
  30704. return value.replace(/([A-Z])/g, "-$1").toLowerCase();
  30705. }var _default =
  30706. {
  30707. gc: gc,
  30708. setRefesrherTime: setRefesrherTime,
  30709. getRefesrherFormatTimeByKey: getRefesrherFormatTimeByKey,
  30710. arrayIsEqual: arrayIsEqual,
  30711. getTouch: getTouch,
  30712. getTouchFromZPaging: getTouchFromZPaging,
  30713. getParent: getParent,
  30714. convertTextToPx: convertTextToPx,
  30715. getTime: getTime,
  30716. consoleErr: consoleErr,
  30717. consoleWarn: consoleWarn };exports.default = _default;
  30718. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30719. /***/ }),
  30720. /* 275 */
  30721. /*!***********************************************************************************************!*\
  30722. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-i18n.js ***!
  30723. \***********************************************************************************************/
  30724. /*! no static exports found */
  30725. /***/ (function(module, exports, __webpack_require__) {
  30726. "use strict";
  30727. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // z-paging国际化(支持中文、中文繁体和英文)
  30728. var i18nUpdateKey = 'z-paging-i18n-update';
  30729. var t = {
  30730. refresherDefaultText: {
  30731. 'en': 'Pull down to refresh',
  30732. 'zh-cn': '继续下拉刷新',
  30733. 'zh-hant-cn': '繼續下拉重繪' },
  30734. refresherPullingText: {
  30735. 'en': 'Release to refresh',
  30736. 'zh-cn': '松开立即刷新',
  30737. 'zh-hant-cn': '鬆開立即重繪' },
  30738. refresherRefreshingText: {
  30739. 'en': 'Refreshing...',
  30740. 'zh-cn': '正在刷新...',
  30741. 'zh-hant-cn': '正在重繪...' },
  30742. refresherCompleteText: {
  30743. 'en': 'Refresh succeeded',
  30744. 'zh-cn': '刷新成功',
  30745. 'zh-hant-cn': '重繪成功' },
  30746. loadingMoreDefaultText: {
  30747. 'en': 'Click to load more',
  30748. 'zh-cn': '点击加载更多',
  30749. 'zh-hant-cn': '點擊加載更多' },
  30750. loadingMoreLoadingText: {
  30751. 'en': 'Loading...',
  30752. 'zh-cn': '正在加载...',
  30753. 'zh-hant-cn': '正在加載...' },
  30754. loadingMoreNoMoreText: {
  30755. 'en': 'No more data',
  30756. 'zh-cn': '没有更多了',
  30757. 'zh-hant-cn': '沒有更多了' },
  30758. loadingMoreFailText: {
  30759. 'en': 'Load failed,click to reload',
  30760. 'zh-cn': '加载失败,点击重新加载',
  30761. 'zh-hant-cn': '加載失敗,點擊重新加載' },
  30762. emptyViewText: {
  30763. 'en': 'No data',
  30764. 'zh-cn': '没有数据哦~',
  30765. 'zh-hant-cn': '沒有數據哦~' },
  30766. emptyViewReloadText: {
  30767. 'en': 'Reload',
  30768. 'zh-cn': '重新加载',
  30769. 'zh-hant-cn': '重新加載' },
  30770. emptyViewErrorText: {
  30771. 'en': 'Sorry,load failed',
  30772. 'zh-cn': '很抱歉,加载失败',
  30773. 'zh-hant-cn': '很抱歉,加載失敗' },
  30774. refresherUpdateTimeText: {
  30775. 'en': 'Last update: ',
  30776. 'zh-cn': '最后更新:',
  30777. 'zh-hant-cn': '最後更新:' },
  30778. refresherUpdateTimeNoneText: {
  30779. 'en': 'None',
  30780. 'zh-cn': '无',
  30781. 'zh-hant-cn': '無' },
  30782. refresherUpdateTimeTodayText: {
  30783. 'en': 'Today',
  30784. 'zh-cn': '今天',
  30785. 'zh-hant-cn': '今天' },
  30786. refresherUpdateTimeYesterdayText: {
  30787. 'en': 'Yesterday',
  30788. 'zh-cn': '昨天',
  30789. 'zh-hant-cn': '昨天' } };
  30790. // 获取当前语言,格式为:zh-cn、zh-hant-cn、en。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  30791. function getLanguage() {var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  30792. return _getPrivateLanguage(false, followSystemLanguage);
  30793. }
  30794. // 获取当前语言,格式为:简体中文、繁體中文、English。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  30795. function getLanguageName() {var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  30796. var language = getLanguage(followSystemLanguage);
  30797. var languageNameMap = {
  30798. 'zh-cn': '简体中文',
  30799. 'zh-hant-cn': '繁體中文',
  30800. 'en': 'English' };
  30801. return languageNameMap[language];
  30802. }
  30803. //设置当前语言,格式为:zh-cn、zh-hant-cn、en
  30804. function setLanguage(myLanguage) {
  30805. uni.setStorageSync(i18nUpdateKey, myLanguage);
  30806. uni.$emit(i18nUpdateKey, myLanguage);
  30807. }
  30808. // 插件内部使用,请勿直接调用
  30809. function _getPrivateLanguage(myLanguage) {var followSystemLanguage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30810. var systemLanguage = '';
  30811. if (followSystemLanguage) {
  30812. systemLanguage = uni.getSystemInfoSync().language;
  30813. }
  30814. var language = myLanguage || uni.getStorageSync(i18nUpdateKey) || systemLanguage;
  30815. language = language.toLowerCase();
  30816. var reg = new RegExp('_', '');
  30817. language = language.replace(reg, '-');
  30818. if (language.indexOf('zh') !== -1) {
  30819. if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) {
  30820. return 'zh-cn';
  30821. }
  30822. return 'zh-hant-cn';
  30823. }
  30824. if (language.indexOf('en') !== -1) {
  30825. return 'en';
  30826. }
  30827. return 'zh-cn';
  30828. }var _default =
  30829. {
  30830. t: t,
  30831. getLanguage: getLanguage,
  30832. getLanguageName: getLanguageName,
  30833. setLanguage: setLanguage,
  30834. _getPrivateLanguage: _getPrivateLanguage };exports.default = _default;
  30835. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30836. /***/ }),
  30837. /* 276 */
  30838. /*!*************************************************************************************************!*\
  30839. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-config.js ***!
  30840. \*************************************************************************************************/
  30841. /*! no static exports found */
  30842. /***/ (function(module, exports, __webpack_require__) {
  30843. "use strict";
  30844. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]处理main.js中的配置信息工具
  30845. var config = null;
  30846. var getedStorage = false;
  30847. var storageKey = 'Z-PAGING-CONFIG-STORAGE-KEY';
  30848. function setConfig(value) {
  30849. try {
  30850. uni.setStorageSync(storageKey, value);
  30851. } catch (e) {}
  30852. }
  30853. function getConfig() {
  30854. try {
  30855. if (getedStorage) return config;
  30856. config = uni.getStorageSync(storageKey);
  30857. getedStorage = true;
  30858. } catch (e) {
  30859. return null;
  30860. }
  30861. }var _default =
  30862. {
  30863. setConfig: setConfig,
  30864. getConfig: getConfig };exports.default = _default;
  30865. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30866. /***/ }),
  30867. /* 277 */
  30868. /*!*******************************************************************************************!*\
  30869. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/config/index.js ***!
  30870. \*******************************************************************************************/
  30871. /*! no static exports found */
  30872. /***/ (function(module, exports, __webpack_require__) {
  30873. "use strict";
  30874. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // z-paging全局配置文件,注意避免更新时此文件被覆盖,若被覆盖,可在此文件中右键->点击本地历史记录,找回覆盖前的配置
  30875. var _default =
  30876. {};exports.default = _default;
  30877. /***/ }),
  30878. /* 278 */
  30879. /*!*******************************************************************************************!*\
  30880. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync nonrecursive \z-paging-config$ ***!
  30881. \*******************************************************************************************/
  30882. /*! no static exports found */
  30883. /***/ (function(module, exports) {
  30884. function webpackEmptyContext(req) {
  30885. var e = new Error("Cannot find module '" + req + "'");
  30886. e.code = 'MODULE_NOT_FOUND';
  30887. throw e;
  30888. }
  30889. webpackEmptyContext.keys = function() { return []; };
  30890. webpackEmptyContext.resolve = webpackEmptyContext;
  30891. module.exports = webpackEmptyContext;
  30892. webpackEmptyContext.id = 278;
  30893. /***/ }),
  30894. /* 279 */
  30895. /*!**************************************************************************************!*\
  30896. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync ^\.\/z\-paging\-config.*$ ***!
  30897. \**************************************************************************************/
  30898. /*! no static exports found */
  30899. /***/ (function(module, exports) {
  30900. function webpackEmptyContext(req) {
  30901. var e = new Error("Cannot find module '" + req + "'");
  30902. e.code = 'MODULE_NOT_FOUND';
  30903. throw e;
  30904. }
  30905. webpackEmptyContext.keys = function() { return []; };
  30906. webpackEmptyContext.resolve = webpackEmptyContext;
  30907. module.exports = webpackEmptyContext;
  30908. webpackEmptyContext.id = 279;
  30909. /***/ }),
  30910. /* 280 */
  30911. /*!*****************************************************************************************************!*\
  30912. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/data-handle.js ***!
  30913. \*****************************************************************************************************/
  30914. /*! no static exports found */
  30915. /***/ (function(module, exports, __webpack_require__) {
  30916. "use strict";
  30917. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  30918. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  30919. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 273));
  30920. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  30921. var ZPData = {
  30922. props: {
  30923. //自定义初始的pageNo,默认为1
  30924. defaultPageNo: {
  30925. type: [Number, String],
  30926. default: _zPagingUtils.default.gc('defaultPageNo', 1),
  30927. observer: function observer(newVal, oldVal) {
  30928. this.pageNo = newVal;
  30929. } },
  30930. //自定义pageSize,默认为10
  30931. defaultPageSize: {
  30932. type: [Number, String],
  30933. default: _zPagingUtils.default.gc('defaultPageSize', 10) },
  30934. //为保证数据一致,设置当前tab切换时的标识key,并在complete中传递相同key,若二者不一致,则complete将不会生效
  30935. dataKey: {
  30936. type: [Number, String, Object],
  30937. default: function _default() {
  30938. return _zPagingUtils.default.gc('dataKey', null);
  30939. } },
  30940. //自动注入的list名,可自动修改父view(包含ref="paging")中对应name的list值
  30941. autowireListName: {
  30942. type: String,
  30943. default: function _default() {
  30944. return _zPagingUtils.default.gc('autowireListName', '');
  30945. } },
  30946. //自动注入的query名,可自动调用父view(包含ref="paging")中的query方法
  30947. autowireQueryName: {
  30948. type: String,
  30949. default: function _default() {
  30950. return _zPagingUtils.default.gc('autowireQueryName', '');
  30951. } },
  30952. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是。请使用简便写法:auto
  30953. mountedAutoCallReload: {
  30954. type: Boolean,
  30955. default: _zPagingUtils.default.gc('mountedAutoCallReload', true) },
  30956. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是
  30957. auto: {
  30958. type: Boolean,
  30959. default: _zPagingUtils.default.gc('auto', true) },
  30960. //用户下拉刷新时是否触发reload方法,默认为是
  30961. reloadWhenRefresh: {
  30962. type: Boolean,
  30963. default: _zPagingUtils.default.gc('reloadWhenRefresh', true) },
  30964. //reload时自动滚动到顶部,默认为是
  30965. autoScrollToTopWhenReload: {
  30966. type: Boolean,
  30967. default: _zPagingUtils.default.gc('autoScrollToTopWhenReload', true) },
  30968. //reload时立即自动清空原list,默认为是,若立即自动清空,则在reload之后、请求回调之前页面是空白的
  30969. autoCleanListWhenReload: {
  30970. type: Boolean,
  30971. default: _zPagingUtils.default.gc('autoCleanListWhenReload', true) },
  30972. //列表刷新时自动显示下拉刷新view,默认为否
  30973. showRefresherWhenReload: {
  30974. type: Boolean,
  30975. default: _zPagingUtils.default.gc('showRefresherWhenReload', false) },
  30976. //列表刷新时自动显示加载更多view,且为加载中状态,默认为否
  30977. showLoadingMoreWhenReload: {
  30978. type: Boolean,
  30979. default: _zPagingUtils.default.gc('showLoadingMoreWhenReload', false) },
  30980. //本地分页时上拉加载更多延迟时间,单位为毫秒,默认200毫秒
  30981. localPagingLoadingTime: {
  30982. type: [Number, String],
  30983. default: _zPagingUtils.default.gc('localPagingLoadingTime', 200) },
  30984. //当分页未满一屏时,是否自动加载更多,默认为否(nvue无效)
  30985. insideMore: {
  30986. type: Boolean,
  30987. default: _zPagingUtils.default.gc('insideMore', false) },
  30988. //使用聊天记录模式,默认为否
  30989. useChatRecordMode: {
  30990. type: Boolean,
  30991. default: _zPagingUtils.default.gc('useChatRecordMode', false) },
  30992. //自动拼接complete中传过来的数组(使用聊天记录模式时无效)
  30993. concat: {
  30994. type: Boolean,
  30995. default: _zPagingUtils.default.gc('concat', true) },
  30996. //父组件v-model所绑定的list的值
  30997. value: {
  30998. type: Array,
  30999. default: function _default() {
  31000. return [];
  31001. } } },
  31002. data: function data() {
  31003. return {
  31004. currentData: [],
  31005. totalData: [],
  31006. realTotalData: [],
  31007. totalLocalPagingList: [],
  31008. pageNo: 1,
  31009. isLocalPaging: false,
  31010. isAddedData: false,
  31011. isTotalChangeFromAddData: false,
  31012. privateConcat: true,
  31013. myParentQuery: -1,
  31014. firstPageLoaded: false,
  31015. pagingLoaded: false,
  31016. loaded: false,
  31017. isUserReload: true,
  31018. fromEmptyViewReload: false };
  31019. },
  31020. computed: {
  31021. pageSize: function pageSize() {
  31022. return this.defaultPageSize;
  31023. },
  31024. finalConcat: function finalConcat() {
  31025. return this.concat && this.privateConcat;
  31026. },
  31027. isFirstPage: function isFirstPage() {
  31028. return this.pageNo === this.defaultPageNo;
  31029. } },
  31030. watch: {
  31031. totalData: function totalData(newVal, oldVal) {
  31032. this._totalDataChange(newVal, oldVal);
  31033. },
  31034. currentData: function currentData(newVal, oldVal) {
  31035. this._currentDataChange(newVal, oldVal);
  31036. },
  31037. useChatRecordMode: function useChatRecordMode(newVal, oldVal) {
  31038. if (newVal) {
  31039. this.nLoadingMoreFixedHeight = false;
  31040. }
  31041. } },
  31042. methods: {
  31043. //请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否成功(默认是是)
  31044. complete: function complete(data) {var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31045. this.customNoMore = -1;
  31046. this.addData(data, success);
  31047. },
  31048. //简写,与complete完全相同
  31049. end: function end(data) {var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31050. this.complete(data, success);
  31051. },
  31052. //【保证数据一致】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为dataKey,需与:data-key绑定的一致,第三个参数为是否成功(默认为是)
  31053. completeByKey: function completeByKey(data) {var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31054. if (dataKey !== null && this.dataKey !== null && dataKey !== this.dataKey) {
  31055. if (this.isFirstPage) {
  31056. this.endRefresh();
  31057. }
  31058. return;
  31059. }
  31060. this.customNoMore = -1;
  31061. this.addData(data, success);
  31062. },
  31063. //简写,与completeByKey完全相同
  31064. endByKey: function endByKey(data) {var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31065. this.completeByKey(data, dataKey, success);
  31066. },
  31067. //【通过totalCount判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为totalCount(列表总数),第三个参数为是否成功(默认为是)
  31068. completeByTotalCount: function completeByTotalCount(data, totalCount) {var _this = this;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31069. if (totalCount == 'undefined') {
  31070. this.customNoMore = -1;
  31071. } else {
  31072. var dataTypeRes = this._checkDataType(data, success, false);
  31073. data = dataTypeRes.data;
  31074. success = dataTypeRes.success;
  31075. if (totalCount >= 0 && success) {
  31076. this.$nextTick(function () {
  31077. var nomore = true;
  31078. var realTotalDataCount = _this.realTotalData.length;
  31079. if (_this.pageNo == _this.defaultPageNo) {
  31080. realTotalDataCount = 0;
  31081. }
  31082. var exceedCount = realTotalDataCount + data.length - totalCount;
  31083. if (exceedCount >= 0) {
  31084. nomore = false;
  31085. exceedCount = _this.defaultPageSize - exceedCount;
  31086. if (exceedCount > 0 && exceedCount < data.length) {
  31087. data = data.splice(0, exceedCount);
  31088. }
  31089. }
  31090. _this.completeByNoMore(data, nomore, success);
  31091. });
  31092. return;
  31093. }
  31094. }
  31095. this.addData(data, success);
  31096. },
  31097. //简写,与completeByTotalCount完全相同
  31098. completeByTotal: function completeByTotal(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31099. this.completeByTotalCount(data, totalCount, success);
  31100. },
  31101. //简写,与completeByTotalCount完全相同
  31102. endByTotalCount: function endByTotalCount(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31103. this.completeByTotalCount(data, totalCount, success);
  31104. },
  31105. //简写,与completeByTotalCount完全相同
  31106. endByTotal: function endByTotal(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31107. this.completeByTotalCount(data, totalCount, success);
  31108. },
  31109. //【自行判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否有更多数据,第三个参数为是否成功(默认是是)
  31110. completeByNoMore: function completeByNoMore(data, nomore) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31111. if (nomore != 'undefined') {
  31112. this.customNoMore = nomore == true ? 1 : 0;
  31113. }
  31114. this.addData(data, success);
  31115. },
  31116. //简写,与completeByNoMore完全相同
  31117. endByNoMore: function endByNoMore(data, nomore) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31118. this.completeByNoMore(data, nomore, success);
  31119. },
  31120. //与上方complete方法功能一致,新版本中设置服务端回调数组请使用complete方法
  31121. addData: function addData(data) {var _this2 = this;var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31122. if (!this.fromCompleteEmit) {
  31123. this.disabledCompleteEmit = true;
  31124. this.fromCompleteEmit = false;
  31125. }
  31126. var currentTimeStamp = _zPagingUtils.default.getTime();
  31127. var addDataDalay = 0;
  31128. var disTime = currentTimeStamp - this.requestTimeStamp;
  31129. var minDelay = this.minDelay;
  31130. if (this.isFirstPage && this.finalShowRefresherWhenReload) {
  31131. minDelay = Math.max(400, minDelay);
  31132. }
  31133. if (this.requestTimeStamp > 0 && disTime < minDelay) {
  31134. addDataDalay = minDelay - disTime;
  31135. }
  31136. this.$nextTick(function () {
  31137. var delay = _this2.delay > 0 ? _this2.delay : addDataDalay;
  31138. setTimeout(function () {
  31139. _this2._addData(data, success, false);
  31140. }, delay);
  31141. });
  31142. },
  31143. //从顶部添加数据,不会影响分页的pageNo和pageSize
  31144. addDataFromTop: function addDataFromTop(data) {var _this3 = this;var toTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var toTopWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31145. var dataType = Object.prototype.toString.call(data);
  31146. if (dataType !== '[object Array]') {
  31147. data = [data];
  31148. }
  31149. this.totalData = [].concat(_toConsumableArray(data), _toConsumableArray(this.totalData));
  31150. if (toTop) {
  31151. setTimeout(function () {
  31152. _this3._scrollToTop(toTopWithAnimate);
  31153. }, _zPagingConstant.default.delayTime);
  31154. }
  31155. },
  31156. //重新设置列表数据,调用此方法不会影响pageNo和pageSize,也不会触发请求。适用场景:当需要删除列表中某一项时,将删除对应项后的数组通过此方法传递给z-paging。(当出现类似的需要修改列表数组的场景时,请使用此方法,请勿直接修改page中:list.sync绑定的数组)
  31157. resetTotalData: function resetTotalData(data) {
  31158. if (data == undefined) {
  31159. if (this.showConsoleError) {
  31160. _zPagingUtils.default.consoleErr('方法resetTotalData参数缺失!');
  31161. }
  31162. return;
  31163. }
  31164. this.isTotalChangeFromAddData = true;
  31165. var dataType = Object.prototype.toString.call(data);
  31166. if (dataType !== '[object Array]') {
  31167. data = [data];
  31168. }
  31169. this.totalData = data;
  31170. },
  31171. //添加聊天记录
  31172. addChatRecordData: function addChatRecordData(data) {var _this4 = this;var toBottom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var toBottomWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31173. var dataType = Object.prototype.toString.call(data);
  31174. if (dataType !== '[object Array]') {
  31175. data = [data];
  31176. }
  31177. if (!this.useChatRecordMode) return;
  31178. this.isTotalChangeFromAddData = true;
  31179. this.totalData = [].concat(_toConsumableArray(this.totalData), _toConsumableArray(data));
  31180. if (toBottom) {
  31181. setTimeout(function () {
  31182. _this4._scrollToBottom(toBottomWithAnimate);
  31183. }, _zPagingConstant.default.delayTime);
  31184. }
  31185. },
  31186. //设置本地分页数据,请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging作分页处理(若调用了此方法,则上拉加载更多时内部会自动分页,不会触发@query所绑定的事件)
  31187. setLocalPaging: function setLocalPaging(data) {var _this5 = this;var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31188. this.isLocalPaging = true;
  31189. this.$nextTick(function () {
  31190. _this5._addData(data, success, true);
  31191. });
  31192. },
  31193. //重新加载分页数据,pageNo会恢复为默认值,相当于下拉刷新的效果(animate为true时会展示下拉刷新动画,默认为false)
  31194. reload: function reload() {var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;
  31195. if (animate) {
  31196. this.privateShowRefresherWhenReload = animate;
  31197. this.isUserPullDown = true;
  31198. }
  31199. this._preReload(animate, false);
  31200. },
  31201. //刷新列表数据,pageNo和pageSize不会重置,列表数据会重新从服务端获取。必须保证@query绑定的方法中的pageNo和pageSize和传给服务端的一致
  31202. refresh: function refresh() {
  31203. if (!this.realTotalData.length) {
  31204. this.reload();
  31205. return;
  31206. }
  31207. var disPageNo = this.pageNo - this.defaultPageNo + 1;
  31208. if (disPageNo >= 1) {
  31209. this.loading = true;
  31210. this.privateConcat = false;
  31211. var totalPageSize = disPageNo * this.pageSize;
  31212. this._emitQuery(this.defaultPageNo, totalPageSize, _zPagingEnum.default.QueryFrom.Refresh);
  31213. this._callMyParentQuery(this.defaultPageNo, totalPageSize);
  31214. }
  31215. },
  31216. //清空分页数据
  31217. clean: function clean() {
  31218. this._reload(true);
  31219. this._addData([], true, false);
  31220. },
  31221. //清空分页数据
  31222. clear: function clear() {
  31223. this.clean();
  31224. },
  31225. //手动触发滚动到顶部加载更多,聊天记录模式时有效
  31226. doChatRecordLoadMore: function doChatRecordLoadMore() {
  31227. this.useChatRecordMode && this._onLoadingMore('click');
  31228. },
  31229. //reload之前的一些处理
  31230. _preReload: function _preReload() {var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31231. this.isUserReload = true;
  31232. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  31233. if (animate) {
  31234. this.privateShowRefresherWhenReload = animate;
  31235. if (this.useCustomRefresher) {
  31236. this._doRefresherRefreshAnimate();
  31237. } else {
  31238. this.refresherTriggered = true;
  31239. }
  31240. } else {
  31241. this._refresherEnd(false, false, false, false);
  31242. }
  31243. this._reload(false, isFromMounted);
  31244. },
  31245. //重新加载分页数据
  31246. _reload: function _reload() {var _this6 = this;var isClean = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  31247. this.isAddedData = false;
  31248. this.cacheScrollNodeHeight = -1;
  31249. this.insideOfPaging = -1;
  31250. this.pageNo = this.defaultPageNo;
  31251. this._cleanRefresherEndTimeout();
  31252. !this.privateShowRefresherWhenReload && !isClean && this._startLoading(true);
  31253. this.firstPageLoaded = true;
  31254. this.isTotalChangeFromAddData = false;
  31255. this.totalData = [];
  31256. if (!isClean) {
  31257. this._emitQuery(this.pageNo, this.defaultPageSize, isUserPullDown ? _zPagingEnum.default.QueryFrom.UserPullDown : _zPagingEnum.default.QueryFrom.Reload);
  31258. var delay = 0;
  31259. setTimeout(function () {
  31260. _this6._callMyParentQuery();
  31261. }, delay);
  31262. if (!isFromMounted && this.autoScrollToTopWhenReload) {
  31263. var checkedNRefresherLoading = true;
  31264. if (checkedNRefresherLoading) {
  31265. this._scrollToTop(false);
  31266. }
  31267. }
  31268. if (!this.usePageScroll && this.useChatRecordMode) {
  31269. if (this.showConsoleError) {
  31270. _zPagingUtils.default.consoleWarn('使用聊天记录模式时,建议使用页面滚动,可将usePageScroll设置为true以启用页面滚动!!');
  31271. }
  31272. }
  31273. }
  31274. this.$nextTick(function () {
  31275. });
  31276. },
  31277. //处理服务端返回的数组
  31278. _addData: function _addData(data, success, isLocal) {var _this7 = this;
  31279. this.isAddedData = true;
  31280. this.fromEmptyViewReload = false;
  31281. this.isTotalChangeFromAddData = true;
  31282. this.refresherTriggered = false;
  31283. !this.useCustomRefresher && uni.stopPullDownRefresh();
  31284. var tempIsUserPullDown = this.isUserPullDown;
  31285. if (this.showRefresherUpdateTime && this.isFirstPage) {
  31286. _zPagingUtils.default.setRefesrherTime(_zPagingUtils.default.getTime(), this.refresherUpdateTimeKey);
  31287. this.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  31288. this.$refs.refresh && this.$refs.refresh.updateTime();
  31289. }
  31290. if (tempIsUserPullDown && this.isFirstPage) {
  31291. this.isUserPullDown = false;
  31292. }
  31293. var dataTypeRes = this._checkDataType(data, success, isLocal);
  31294. data = dataTypeRes.data;
  31295. success = dataTypeRes.success;
  31296. var delayTime = _zPagingConstant.default.delayTime;
  31297. var shouldEndLoadingDelay = true;
  31298. this.loadingForNow = false;
  31299. setTimeout(function () {
  31300. _this7.pagingLoaded = true;
  31301. _this7.$nextTick(function () {
  31302. _this7._refresherEnd(shouldEndLoadingDelay, true, tempIsUserPullDown);
  31303. });
  31304. }, delayTime);
  31305. if (this.isFirstPage) {
  31306. this.isLoadFailed = !success;
  31307. }
  31308. if (success) {
  31309. if (!(this.privateConcat === false && this.loadingStatus === _zPagingEnum.default.More.NoMore)) {
  31310. this.loadingStatus = _zPagingEnum.default.More.Default;
  31311. }
  31312. if (isLocal) {
  31313. this.totalLocalPagingList = data;
  31314. this._localPagingQueryList(this.defaultPageNo, this.defaultPageSize, 0, function (res) {
  31315. _this7.complete(res);
  31316. });
  31317. } else {
  31318. var dataChangeDelayTime = 0;
  31319. setTimeout(function () {
  31320. _this7._currentDataChange(data, _this7.currentData);
  31321. }, dataChangeDelayTime);
  31322. }
  31323. } else {
  31324. this._currentDataChange(data, this.currentData);
  31325. this.loadingStatus = _zPagingEnum.default.More.Fail;
  31326. if (this.loadingType === _zPagingEnum.default.LoadingType.LoadingMore) {
  31327. this.pageNo--;
  31328. }
  31329. }
  31330. },
  31331. //所有数据改变时调用
  31332. _totalDataChange: function _totalDataChange(newVal, oldVal) {var _this8 = this;var eventThrow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31333. if ((!this.isUserReload || !this.autoCleanListWhenReload) && this.firstPageLoaded && !newVal.length && oldVal.length) {
  31334. return;
  31335. }
  31336. this._doCheckScrollViewShouldFullHeight(newVal);
  31337. if (!this.realTotalData.length && !newVal.length) {
  31338. eventThrow = false;
  31339. }
  31340. this.realTotalData = newVal;
  31341. if (eventThrow) {
  31342. this.$emit('input', newVal);
  31343. this.$emit('update:list', newVal);
  31344. this.$emit('listChange', newVal);
  31345. this._callMyParentList(newVal);
  31346. }
  31347. this.firstPageLoaded = false;
  31348. this.isTotalChangeFromAddData = false;
  31349. this.$nextTick(function () {
  31350. setTimeout(function () {
  31351. _this8._getNodeClientRect('.zp-paging-container-content').then(function (res) {
  31352. if (res) {
  31353. _this8.$emit('contentHeightChanged', res[0].height);
  31354. }
  31355. });
  31356. }, _this8.isIos ? 100 : 300);
  31357. });
  31358. },
  31359. //当前数据改变时调用
  31360. _currentDataChange: function _currentDataChange(newVal, oldVal) {var _this9 = this;
  31361. newVal = _toConsumableArray(newVal);
  31362. this.useChatRecordMode && newVal.reverse();
  31363. if (this.isFirstPage && this.finalConcat) {
  31364. this.totalData = [];
  31365. }
  31366. if (this.customNoMore !== -1) {
  31367. if (this.customNoMore === 0 || !newVal.length) {
  31368. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  31369. }
  31370. } else {
  31371. if (!newVal.length || newVal.length && newVal.length < this.defaultPageSize) {
  31372. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  31373. }
  31374. }
  31375. if (!this.totalData.length) {
  31376. if (this.finalConcat) {
  31377. this.totalData = newVal;
  31378. }
  31379. if (this.useChatRecordMode) {
  31380. this.$nextTick(function () {
  31381. _this9._scrollToBottom(false);
  31382. });
  31383. }
  31384. } else {
  31385. if (this.useChatRecordMode) {
  31386. var idIndex = newVal.length;
  31387. var idIndexStr = "z-paging-".concat(idIndex);
  31388. this.totalData = [].concat(_toConsumableArray(newVal), _toConsumableArray(this.totalData));
  31389. if (this.pageNo !== this.defaultPageNo) {
  31390. this.privateScrollWithAnimation = 0;
  31391. var delayTime = 200;
  31392. this.$emit('update:chatIndex', idIndex);
  31393. setTimeout(function () {
  31394. _this9._scrollIntoView(idIndexStr, 30 + _this9.cacheTopHeight, false, function () {
  31395. _this9.$emit('update:chatIndex', 0);
  31396. });
  31397. }, this.usePageScroll ? 0 : delayTime);
  31398. } else {
  31399. this.$nextTick(function () {
  31400. _this9._scrollToBottom(false);
  31401. });
  31402. }
  31403. } else {
  31404. if (this.finalConcat) {
  31405. this.totalData = [].concat(_toConsumableArray(this.totalData), _toConsumableArray(newVal));
  31406. if (!this.isIos && !this.refresherOnly && !this.usePageScroll && newVal.length) {
  31407. this.loadingMoreTimeStamp = _zPagingUtils.default.getTime();
  31408. var currentScrollTop = this.oldScrollTop;
  31409. this.scrollToY(currentScrollTop);
  31410. }
  31411. } else {
  31412. this.totalData = _toConsumableArray(newVal);
  31413. }
  31414. }
  31415. }
  31416. this.privateConcat = true;
  31417. },
  31418. //本地分页请求
  31419. _localPagingQueryList: function _localPagingQueryList(pageNo, pageSize, localPagingLoadingTime, callback) {
  31420. pageNo = parseInt(pageNo);
  31421. pageSize = parseInt(pageSize);
  31422. if (pageNo < 0 || pageSize <= 0) {
  31423. callQueryResult(callback, []);
  31424. return;
  31425. }
  31426. pageNo = Math.max(1, pageNo);
  31427. var totalPagingList = _toConsumableArray(this.totalLocalPagingList);
  31428. var pageNoIndex = (pageNo - 1) * pageSize;
  31429. if (pageNoIndex + pageSize <= totalPagingList.length) {
  31430. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, pageSize), localPagingLoadingTime);
  31431. } else if (pageNoIndex < totalPagingList.length) {
  31432. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, totalPagingList.length - pageNoIndex), localPagingLoadingTime);
  31433. } else {
  31434. this._localPagingQueryResult(callback, [], localPagingLoadingTime);
  31435. }
  31436. },
  31437. //本地分页请求回调
  31438. _localPagingQueryResult: function _localPagingQueryResult(callback, arg, localPagingLoadingTime) {
  31439. setTimeout(function () {
  31440. callback(arg);
  31441. }, localPagingLoadingTime);
  31442. },
  31443. //修改父view的list
  31444. _callMyParentList: function _callMyParentList(newVal) {
  31445. if (this.autowireListName.length) {
  31446. var myParent = _zPagingUtils.default.getParent(this.$parent);
  31447. if (myParent && myParent[this.autowireListName]) {
  31448. myParent[this.autowireListName] = newVal;
  31449. }
  31450. }
  31451. },
  31452. //调用父view的query
  31453. _callMyParentQuery: function _callMyParentQuery() {var customPageNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var customPageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  31454. if (this.autowireQueryName) {
  31455. if (this.myParentQuery === -1) {
  31456. var myParent = _zPagingUtils.default.getParent(this.$parent);
  31457. if (myParent && myParent[this.autowireQueryName]) {
  31458. this.myParentQuery = myParent[this.autowireQueryName];
  31459. }
  31460. }
  31461. if (this.myParentQuery !== -1) {
  31462. if (customPageSize > 0) {
  31463. this.myParentQuery(customPageNo, customPageSize);
  31464. } else {
  31465. this.myParentQuery(this.pageNo, this.defaultPageSize);
  31466. }
  31467. }
  31468. }
  31469. },
  31470. //发射query事件
  31471. _emitQuery: function _emitQuery(pageNo, pageSize, from) {
  31472. this.requestTimeStamp = _zPagingUtils.default.getTime();
  31473. this.$emit('query', pageNo, pageSize, from);
  31474. },
  31475. //检查complete data的类型
  31476. _checkDataType: function _checkDataType(data, success, isLocal) {
  31477. var dataType = Object.prototype.toString.call(data);
  31478. if (dataType === '[object Boolean]') {
  31479. success = data;
  31480. data = [];
  31481. } else if (dataType !== '[object Array]') {
  31482. data = [];
  31483. var methodStr = isLocal ? 'setLocalPaging' : 'complete';
  31484. if (dataType !== '[object Undefined]') {
  31485. if (this.showConsoleError) {
  31486. _zPagingUtils.default.consoleErr("".concat(methodStr, "\u53C2\u6570\u7C7B\u578B\u4E0D\u6B63\u786E\uFF0C\u7B2C\u4E00\u4E2A\u53C2\u6570\u7C7B\u578B\u5FC5\u987B\u4E3AArray!"));
  31487. }
  31488. }
  31489. }
  31490. return { data: data, success: success };
  31491. } } };var _default2 =
  31492. ZPData;exports.default = _default2;
  31493. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  31494. /***/ }),
  31495. /* 281 */
  31496. /*!***********************************************************************************************!*\
  31497. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-enum.js ***!
  31498. \***********************************************************************************************/
  31499. /*! no static exports found */
  31500. /***/ (function(module, exports, __webpack_require__) {
  31501. "use strict";
  31502. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]枚举
  31503. var Enum = {
  31504. //当前加载类型 0.下拉刷新 1.上拉加载更多
  31505. LoadingType: {
  31506. Refresher: 0,
  31507. LoadingMore: 1 },
  31508. //下拉刷新状态 0.默认状态 1.松手立即刷新 2.刷新中 3.刷新结束
  31509. Refresher: {
  31510. Default: 0,
  31511. ReleaseToRefresh: 1,
  31512. Loading: 2,
  31513. Complete: 3 },
  31514. //底部加载更多状态 0.默认状态 1.加载中 2.没有更多数据 3.加载失败
  31515. More: {
  31516. Default: 0,
  31517. Loading: 1,
  31518. NoMore: 2,
  31519. Fail: 3 },
  31520. //@query触发来源 0.用户主动下拉刷新 1.通过reload触发 2.通过refresh触发 3.通过滚动到底部加载更多或点击底部加载更多触发
  31521. QueryFrom: {
  31522. UserPullDown: 0,
  31523. Reload: 1,
  31524. Refresh: 2,
  31525. LoadingMore: 3 } };var _default =
  31526. Enum;exports.default = _default;
  31527. /***/ }),
  31528. /* 282 */
  31529. /*!**********************************************************************************************!*\
  31530. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/i18n.js ***!
  31531. \**********************************************************************************************/
  31532. /*! no static exports found */
  31533. /***/ (function(module, exports, __webpack_require__) {
  31534. "use strict";
  31535. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31536. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  31537. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 273));
  31538. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! .././z-paging-i18n */ 275));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]i18n模块
  31539. var systemInfo = uni.getSystemInfoSync();
  31540. var ZPI18n = {
  31541. props: {
  31542. //i18n国际化设置语言,支持简体中文(zh-cn)、繁体中文(zh-hant-cn)和英文(en)
  31543. language: {
  31544. type: String,
  31545. default: _zPagingUtils.default.gc('language', '') },
  31546. //i18n国际化默认是否跟随系统语言,默认为是
  31547. followSystemLanguage: {
  31548. type: Boolean,
  31549. default: _zPagingUtils.default.gc('followSystemLanguage', true) } },
  31550. data: function data() {
  31551. return {
  31552. tempLanguageUpdateKey: 0 };
  31553. },
  31554. computed: {
  31555. tempLanguage: function tempLanguage() {
  31556. var systemLanguage = false;
  31557. var temp = this.tempLanguageUpdateKey;
  31558. if (this.followSystemLanguage) {
  31559. systemLanguage = systemInfo.language;
  31560. }
  31561. return uni.getStorageSync(_zPagingConstant.default.i18nUpdateKey) || systemLanguage || 'zh-cn';
  31562. },
  31563. finalTempLanguage: function finalTempLanguage() {
  31564. return this.language.length ? this.language : this.tempLanguage;
  31565. },
  31566. finalLanguage: function finalLanguage() {
  31567. var language = this.finalTempLanguage.toLowerCase();
  31568. return _zPagingI18n.default._getPrivateLanguage(language, this.followSystemLanguage);
  31569. },
  31570. finalRefresherDefaultText: function finalRefresherDefaultText() {
  31571. return this._getI18nText('refresherDefaultText', this.refresherDefaultText);
  31572. },
  31573. finalRefresherPullingText: function finalRefresherPullingText() {
  31574. return this._getI18nText('refresherPullingText', this.refresherPullingText);
  31575. },
  31576. finalRefresherRefreshingText: function finalRefresherRefreshingText() {
  31577. return this._getI18nText('refresherRefreshingText', this.refresherRefreshingText);
  31578. },
  31579. finalRefresherCompleteText: function finalRefresherCompleteText() {
  31580. return this._getI18nText('refresherCompleteText', this.refresherCompleteText);
  31581. },
  31582. finalLoadingMoreDefaultText: function finalLoadingMoreDefaultText() {
  31583. return this._getI18nText('loadingMoreDefaultText', this.loadingMoreDefaultText);
  31584. },
  31585. finalLoadingMoreLoadingText: function finalLoadingMoreLoadingText() {
  31586. return this._getI18nText('loadingMoreLoadingText', this.loadingMoreLoadingText);
  31587. },
  31588. finalLoadingMoreNoMoreText: function finalLoadingMoreNoMoreText() {
  31589. return this._getI18nText('loadingMoreNoMoreText', this.loadingMoreNoMoreText);
  31590. },
  31591. finalLoadingMoreFailText: function finalLoadingMoreFailText() {
  31592. return this._getI18nText('loadingMoreFailText', this.loadingMoreFailText);
  31593. },
  31594. finalEmptyViewText: function finalEmptyViewText() {
  31595. return this.isLoadFailed ? this.finalEmptyViewErrorText : this._getI18nText('emptyViewText', this.emptyViewText);
  31596. },
  31597. finalEmptyViewReloadText: function finalEmptyViewReloadText() {
  31598. return this._getI18nText('emptyViewReloadText', this.emptyViewReloadText);
  31599. },
  31600. finalEmptyViewErrorText: function finalEmptyViewErrorText() {
  31601. return this._getI18nText('emptyViewErrorText', this.emptyViewErrorText);
  31602. } },
  31603. methods: {
  31604. //设置i18n国际化语言
  31605. setI18n: function setI18n(language) {
  31606. _zPagingI18n.default.setLanguage(language);
  31607. },
  31608. //获取当前z-paging的语言
  31609. getLanguage: function getLanguage() {
  31610. return this.finalLanguage;
  31611. },
  31612. //获取国际化转换后的文本
  31613. _getI18nText: function _getI18nText(key, value) {
  31614. var dataType = Object.prototype.toString.call(value);
  31615. if (dataType === '[object Object]') {
  31616. var nextValue = value[this.finalLanguage];
  31617. if (nextValue) return nextValue;
  31618. } else if (dataType === '[object String]') {
  31619. return value;
  31620. }
  31621. return _zPagingI18n.default.t[key][this.finalLanguage];
  31622. } } };var _default =
  31623. ZPI18n;exports.default = _default;
  31624. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  31625. /***/ }),
  31626. /* 283 */
  31627. /*!**********************************************************************************************!*\
  31628. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/nvue.js ***!
  31629. \**********************************************************************************************/
  31630. /*! no static exports found */
  31631. /***/ (function(module, exports, __webpack_require__) {
  31632. "use strict";
  31633. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31634. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  31635. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]nvue独有部分模块
  31636. var ZPNvue = {
  31637. props: {
  31638. //nvue中修改列表类型,可选值有list、waterfall和scroller,默认为list
  31639. nvueListIs: {
  31640. type: String,
  31641. default: _zPagingUtils.default.gc('nvueListIs', 'list') },
  31642. //nvue waterfall配置,仅在nvue中且nvueListIs=waterfall时有效,配置参数详情参见:https://uniapp.dcloud.io/component/waterfall
  31643. nvueWaterfallConfig: {
  31644. type: Object,
  31645. default: function _default() {
  31646. return _zPagingUtils.default.gc('nvueWaterfallConfig', {});
  31647. } },
  31648. //nvue 控制是否回弹效果,iOS不支持动态修改
  31649. nvueBounce: {
  31650. type: Boolean,
  31651. default: _zPagingUtils.default.gc('nvueBounce', true) },
  31652. //nvue中通过代码滚动到顶部/底部时,是否加快动画效果(无滚动动画时无效),默认为否
  31653. nvueFastScroll: {
  31654. type: Boolean,
  31655. default: _zPagingUtils.default.gc('nvueFastScroll', false) },
  31656. //nvue中list的id
  31657. nvueListId: {
  31658. type: String,
  31659. default: _zPagingUtils.default.gc('nvueListId', '') },
  31660. //nvue中refresh组件的样式
  31661. nvueRefresherStyle: {
  31662. type: Object,
  31663. default: function _default() {
  31664. return _zPagingUtils.default.gc('nvueRefresherStyle', {});
  31665. } },
  31666. //是否隐藏nvue列表底部的tagView,此view用于标识滚动到底部位置,若隐藏则滚动到底部功能将失效,在nvue中实现吸顶+swiper功能时需将最外层z-paging的此属性设置为true。默认为否
  31667. hideNvueBottomTag: {
  31668. type: Boolean,
  31669. default: _zPagingUtils.default.gc('hideNvueBottomTag', false) } },
  31670. data: function data() {
  31671. return {
  31672. nRefresherLoading: false,
  31673. nListIsDragging: false,
  31674. nShowBottom: true,
  31675. nFixFreezing: false,
  31676. nShowRefresherReveal: false,
  31677. nIsFirstPageAndNoMore: false,
  31678. nFirstPageAndNoMoreChecked: false,
  31679. nLoadingMoreFixedHeight: false,
  31680. nShowRefresherRevealHeight: 0 };
  31681. },
  31682. watch: {
  31683. nIsFirstPageAndNoMore: {
  31684. handler: function handler(newVal) {
  31685. var cellStyle = !this.useChatRecordMode || newVal ? {} : { transform: 'rotate(180deg)' };
  31686. this.$emit('update:cellStyle', cellStyle);
  31687. },
  31688. immediate: true } },
  31689. computed: {},
  31690. methods: {} };var _default2 =
  31691. ZPNvue;exports.default = _default2;
  31692. /***/ }),
  31693. /* 284 */
  31694. /*!***********************************************************************************************!*\
  31695. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/empty.js ***!
  31696. \***********************************************************************************************/
  31697. /*! no static exports found */
  31698. /***/ (function(module, exports, __webpack_require__) {
  31699. "use strict";
  31700. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31701. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]空数据图view模块
  31702. var ZPEmptyView = {
  31703. props: {
  31704. //是否强制隐藏空数据图,默认为否
  31705. hideEmptyView: {
  31706. type: Boolean,
  31707. default: _zPagingUtils.default.gc('hideEmptyView', false) },
  31708. //空数据图描述文字,默认为“没有数据哦~”
  31709. emptyViewText: {
  31710. type: [String, Object],
  31711. default: _zPagingUtils.default.gc('emptyViewText', null) },
  31712. //是否显示空数据图重新加载按钮(无数据时),默认为否
  31713. showEmptyViewReload: {
  31714. type: Boolean,
  31715. default: _zPagingUtils.default.gc('showEmptyViewReload', false) },
  31716. //加载失败时是否显示空数据图重新加载按钮,默认为是
  31717. showEmptyViewReloadWhenError: {
  31718. type: Boolean,
  31719. default: _zPagingUtils.default.gc('showEmptyViewReloadWhenError', true) },
  31720. //空数据图点击重新加载文字,默认为“重新加载”
  31721. emptyViewReloadText: {
  31722. type: [String, Object],
  31723. default: _zPagingUtils.default.gc('emptyViewReloadText', null) },
  31724. //空数据图图片,默认使用z-paging内置的图片
  31725. emptyViewImg: {
  31726. type: String,
  31727. default: _zPagingUtils.default.gc('emptyViewImg', '') },
  31728. //空数据图“加载失败”描述文字,默认为“很抱歉,加载失败”
  31729. emptyViewErrorText: {
  31730. type: [String, Object],
  31731. default: _zPagingUtils.default.gc('emptyViewErrorText', null) },
  31732. //空数据图“加载失败”图片,默认使用z-paging内置的图片
  31733. emptyViewErrorImg: {
  31734. type: String,
  31735. default: _zPagingUtils.default.gc('emptyViewErrorImg', '') },
  31736. //空数据图样式
  31737. emptyViewStyle: {
  31738. type: Object,
  31739. default: function _default() {
  31740. return _zPagingUtils.default.gc('emptyViewStyle', {});
  31741. } },
  31742. //空数据图容器样式
  31743. emptyViewSuperStyle: {
  31744. type: Object,
  31745. default: function _default() {
  31746. return _zPagingUtils.default.gc('emptyViewSuperStyle', {});
  31747. } },
  31748. //空数据图img样式
  31749. emptyViewImgStyle: {
  31750. type: Object,
  31751. default: function _default() {
  31752. return _zPagingUtils.default.gc('emptyViewImgStyle', {});
  31753. } },
  31754. //空数据图描述文字样式
  31755. emptyViewTitleStyle: {
  31756. type: Object,
  31757. default: function _default() {
  31758. return _zPagingUtils.default.gc('emptyViewTitleStyle', {});
  31759. } },
  31760. //空数据图重新加载按钮样式
  31761. emptyViewReloadStyle: {
  31762. type: Object,
  31763. default: function _default() {
  31764. return _zPagingUtils.default.gc('emptyViewReloadStyle', {});
  31765. } },
  31766. //空数据图片是否铺满z-paging,默认为是。若设置为否,则为填充满z-paging的剩余部分
  31767. emptyViewFixed: {
  31768. type: Boolean,
  31769. default: function _default() {
  31770. return _zPagingUtils.default.gc('emptyViewFixed', false);
  31771. } },
  31772. //空数据图片是否垂直居中,默认为是。emptyViewFixed为false时有效
  31773. emptyViewCenter: {
  31774. type: Boolean,
  31775. default: function _default() {
  31776. return _zPagingUtils.default.gc('emptyViewCenter', true);
  31777. } },
  31778. //加载中时是否自动隐藏空数据图,默认为是
  31779. autoHideEmptyViewWhenLoading: {
  31780. type: Boolean,
  31781. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenLoading', true) },
  31782. //用户下拉列表触发下拉刷新加载中时是否自动隐藏空数据图,默认为是
  31783. autoHideEmptyViewWhenPull: {
  31784. type: Boolean,
  31785. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenPull', true) },
  31786. //空数据view的z-index,默认为9
  31787. emptyViewZIndex: {
  31788. type: Number,
  31789. default: _zPagingUtils.default.gc('emptyViewZIndex', 9) } },
  31790. computed: {
  31791. finalEmptyViewImg: function finalEmptyViewImg() {
  31792. return this.isLoadFailed ? this.emptyViewErrorImg : this.emptyViewImg;
  31793. },
  31794. finalShowEmptyViewReload: function finalShowEmptyViewReload() {
  31795. return this.isLoadFailed ? this.showEmptyViewReloadWhenError : this.showEmptyViewReload;
  31796. },
  31797. showEmpty: function showEmpty() {
  31798. if (this.refresherOnly || this.hideEmptyView || this.totalData.length) return false;
  31799. if (this.autoHideEmptyViewWhenLoading) {
  31800. if (this.isAddedData && !this.firstPageLoaded && !this.loading) return true;
  31801. } else {
  31802. return true;
  31803. }
  31804. if (!this.autoHideEmptyViewWhenPull && !this.isUserReload) return true;
  31805. return false;
  31806. } },
  31807. methods: {
  31808. //点击了空数据view重新加载按钮
  31809. _emptyViewReload: function _emptyViewReload() {var _this = this;
  31810. var callbacked = false;
  31811. this.$emit('emptyViewReload', function (reload) {
  31812. if (reload === undefined || reload === true) {
  31813. _this.fromEmptyViewReload = true;
  31814. _this.reload();
  31815. }
  31816. callbacked = true;
  31817. });
  31818. this.$nextTick(function () {
  31819. if (!callbacked) {
  31820. _this.fromEmptyViewReload = true;
  31821. _this.reload();
  31822. }
  31823. });
  31824. } } };var _default2 =
  31825. ZPEmptyView;exports.default = _default2;
  31826. /***/ }),
  31827. /* 285 */
  31828. /*!***************************************************************************************************!*\
  31829. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/refresher.js ***!
  31830. \***************************************************************************************************/
  31831. /*! no static exports found */
  31832. /***/ (function(module, exports, __webpack_require__) {
  31833. "use strict";
  31834. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31835. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  31836. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 273));
  31837. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]下拉刷新view模块
  31838. var ZPRefresher = {
  31839. props: {
  31840. //下拉刷新的主题样式,支持black,white,默认black
  31841. refresherThemeStyle: {
  31842. type: String,
  31843. default: function _default() {
  31844. return _zPagingUtils.default.gc('refresherThemeStyle', '');
  31845. } },
  31846. //自定义下拉刷新中左侧图标的样式
  31847. refresherImgStyle: {
  31848. type: Object,
  31849. default: function _default() {
  31850. return _zPagingUtils.default.gc('refresherImgStyle', {});
  31851. } },
  31852. //自定义下拉刷新中右侧状态描述文字的样式
  31853. refresherTitleStyle: {
  31854. type: Object,
  31855. default: function _default() {
  31856. return _zPagingUtils.default.gc('refresherTitleStyle', {});
  31857. } },
  31858. //自定义下拉刷新中右侧最后更新时间文字的样式(show-refresher-update-time为true时有效)
  31859. refresherUpdateTimeStyle: {
  31860. type: Object,
  31861. default: function _default() {
  31862. return _zPagingUtils.default.gc('refresherUpdateTimeStyle', {});
  31863. } },
  31864. //在微信小程序和QQ小程序中,是否实时监听下拉刷新中进度,默认为否
  31865. watchRefresherTouchmove: {
  31866. type: Boolean,
  31867. default: _zPagingUtils.default.gc('watchRefresherTouchmove', false) },
  31868. //底部加载更多的主题样式,支持black,white,默认black
  31869. loadingMoreThemeStyle: {
  31870. type: String,
  31871. default: function _default() {
  31872. return _zPagingUtils.default.gc('loadingMoreThemeStyle', '');
  31873. } },
  31874. //是否只使用下拉刷新,设置为true后将关闭mounted自动请求数据、关闭滚动到底部加载更多,强制隐藏空数据图。默认为否
  31875. refresherOnly: {
  31876. type: Boolean,
  31877. default: _zPagingUtils.default.gc('refresherOnly', false) },
  31878. //自定义下拉刷新结束以后延迟回弹的时间,单位为毫秒,默认为0
  31879. refresherCompleteDelay: {
  31880. type: [Number, String],
  31881. default: _zPagingUtils.default.gc('refresherCompleteDelay', 0) },
  31882. //自定义下拉刷新结束回弹动画时间,单位为毫秒,默认为300毫秒(refresherEndBounceEnabled为false时,refresherCompleteDuration为设定值的1/3),nvue无效
  31883. refresherCompleteDuration: {
  31884. type: [Number, String],
  31885. default: _zPagingUtils.default.gc('refresherCompleteDuration', 300) },
  31886. //自定义下拉刷新结束状态下是否允许列表滚动,默认为否
  31887. refresherCompleteScrollable: {
  31888. type: Boolean,
  31889. default: _zPagingUtils.default.gc('refresherCompleteScrollable', false) },
  31890. //是否使用自定义的下拉刷新,默认为是,即使用z-paging的下拉刷新。设置为false即代表使用uni scroll-view自带的下拉刷新,h5、App、微信小程序以外的平台不支持uni scroll-view自带的下拉刷新
  31891. useCustomRefresher: {
  31892. type: Boolean,
  31893. default: _zPagingUtils.default.gc('useCustomRefresher', true) },
  31894. //自定义下拉刷新下拉帧率,默认为40,过高可能会出现抖动问题
  31895. refresherFps: {
  31896. type: [Number, String],
  31897. default: _zPagingUtils.default.gc('refresherFps', 40) },
  31898. //自定义下拉刷新允许触发的最大下拉角度,默认为40度,当下拉角度小于设定值时,自定义下拉刷新动画不会被触发
  31899. refresherMaxAngle: {
  31900. type: [Number, String],
  31901. default: _zPagingUtils.default.gc('refresherMaxAngle', 40) },
  31902. //自定义下拉刷新的角度由未达到最大角度变到达到最大角度时,是否继续下拉刷新手势,默认为否
  31903. refresherAngleEnableChangeContinued: {
  31904. type: Boolean,
  31905. default: _zPagingUtils.default.gc('refresherAngleEnableChangeContinued', false) },
  31906. //自定义下拉刷新默认状态下的文字
  31907. refresherDefaultText: {
  31908. type: [String, Object],
  31909. default: _zPagingUtils.default.gc('refresherDefaultText', null) },
  31910. //自定义下拉刷新松手立即刷新状态下的文字
  31911. refresherPullingText: {
  31912. type: [String, Object],
  31913. default: _zPagingUtils.default.gc('refresherPullingText', null) },
  31914. //自定义下拉刷新刷新中状态下的文字
  31915. refresherRefreshingText: {
  31916. type: [String, Object],
  31917. default: _zPagingUtils.default.gc('refresherRefreshingText', null) },
  31918. //自定义下拉刷新刷新结束状态下的文字
  31919. refresherCompleteText: {
  31920. type: [String, Object],
  31921. default: _zPagingUtils.default.gc('refresherCompleteText', null) },
  31922. //是否开启自定义下拉刷新刷新结束回弹效果,默认为是
  31923. refresherEndBounceEnabled: {
  31924. type: Boolean,
  31925. default: _zPagingUtils.default.gc('refresherEndBounceEnabled', true) },
  31926. //是否开启自定义下拉刷新,默认为是
  31927. refresherEnabled: {
  31928. type: Boolean,
  31929. default: _zPagingUtils.default.gc('refresherEnabled', true) },
  31930. //设置自定义下拉刷新阈值,默认为80rpx
  31931. refresherThreshold: {
  31932. type: [Number, String],
  31933. default: _zPagingUtils.default.gc('refresherThreshold', '80rpx') },
  31934. //设置系统下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式,默认为black
  31935. refresherDefaultStyle: {
  31936. type: String,
  31937. default: _zPagingUtils.default.gc('refresherDefaultStyle', 'black') },
  31938. //设置自定义下拉刷新区域背景
  31939. refresherBackground: {
  31940. type: String,
  31941. default: _zPagingUtils.default.gc('refresherBackground', 'transparent') },
  31942. //设置固定的自定义下拉刷新区域背景
  31943. refresherFixedBackground: {
  31944. type: String,
  31945. default: _zPagingUtils.default.gc('refresherFixedBackground', 'transparent') },
  31946. //设置固定的自定义下拉刷新区域高度,默认为0
  31947. refresherFixedBacHeight: {
  31948. type: [Number, String],
  31949. default: _zPagingUtils.default.gc('refresherFixedBacHeight', 0) },
  31950. //设置自定义下拉刷新下拉超出阈值后继续下拉位移衰减的比例,范围0-1,值越大代表衰减越多。默认为0.7(nvue无效)
  31951. refresherOutRate: {
  31952. type: Number,
  31953. default: _zPagingUtils.default.gc('refresherOutRate', 0.7) },
  31954. //是否显示最后更新时间,默认为否
  31955. showRefresherUpdateTime: {
  31956. type: Boolean,
  31957. default: _zPagingUtils.default.gc('showRefresherUpdateTime', false) },
  31958. //如果需要区别不同页面的最后更新时间,请为不同页面的z-paging的`refresher-update-time-key`设置不同的字符串
  31959. refresherUpdateTimeKey: {
  31960. type: String,
  31961. default: _zPagingUtils.default.gc('refresherUpdateTimeKey', 'default') } },
  31962. data: function data() {
  31963. return {
  31964. //下拉刷新状态
  31965. refresherStatus: _zPagingEnum.default.Refresher.Default,
  31966. refresherTouchstartY: 0,
  31967. lastRefresherTouchmove: null,
  31968. refresherReachMaxAngle: true,
  31969. refresherTransform: 'translateY(0px)',
  31970. refresherTransition: '',
  31971. finalRefresherDefaultStyle: 'black',
  31972. refresherRevealStackCount: 0,
  31973. refresherCompleteTimeout: null,
  31974. refresherCompleteSubTimeout: null,
  31975. refresherEndTimeout: null,
  31976. refresherTriggered: false,
  31977. isTouchmoving: false,
  31978. isTouchEnded: false,
  31979. isUserPullDown: false,
  31980. privateRefresherEnabled: -1,
  31981. privateShowRefresherWhenReload: false,
  31982. customRefresherHeight: -1,
  31983. showCustomRefresher: false,
  31984. doRefreshAnimateAfter: false,
  31985. isRefresherInComplete: false,
  31986. pullDownTimeStamp: 0,
  31987. moveDis: 0,
  31988. oldMoveDis: 0 };
  31989. },
  31990. watch: {
  31991. refresherDefaultStyle: {
  31992. handler: function handler(newVal) {
  31993. if (newVal.length) {
  31994. this.finalRefresherDefaultStyle = newVal;
  31995. }
  31996. },
  31997. immediate: true },
  31998. refresherStatus: function refresherStatus(newVal, oldVal) {
  31999. if (newVal === _zPagingEnum.default.Refresher.Loading) {
  32000. this._cleanRefresherEndTimeout();
  32001. }
  32002. this.$emit('refresherStatusChange', newVal);
  32003. this.$emit('update:refresherStatus', newVal);
  32004. },
  32005. moveDis: function moveDis(newVal, oldVal) {
  32006. this.oldMoveDis = oldVal;
  32007. } },
  32008. computed: {
  32009. pullDownDisTimeStamp: function pullDownDisTimeStamp() {
  32010. return 1000 / this.refresherFps;
  32011. },
  32012. finalRefresherEnabled: function finalRefresherEnabled() {
  32013. if (this.useChatRecordMode) return false;
  32014. if (this.privateRefresherEnabled === -1) return this.refresherEnabled;
  32015. return this.privateRefresherEnabled === 1;
  32016. },
  32017. finalRefresherThreshold: function finalRefresherThreshold() {
  32018. var refresherThreshold = this.refresherThreshold;
  32019. var idDefault = false;
  32020. if (refresherThreshold === '80rpx') {
  32021. idDefault = true;
  32022. if (this.showRefresherUpdateTime) {
  32023. refresherThreshold = '120rpx';
  32024. }
  32025. }
  32026. if (idDefault && this.customRefresherHeight > 0) {
  32027. return this.customRefresherHeight;
  32028. }
  32029. return _zPagingUtils.default.convertTextToPx(refresherThreshold);
  32030. },
  32031. finalRefresherFixedBacHeight: function finalRefresherFixedBacHeight() {
  32032. return _zPagingUtils.default.convertTextToPx(this.refresherFixedBacHeight);
  32033. },
  32034. finalRefresherThemeStyle: function finalRefresherThemeStyle() {
  32035. return this.refresherThemeStyle.length ? this.refresherThemeStyle : this.defaultThemeStyle;
  32036. },
  32037. finalRefresherOutRate: function finalRefresherOutRate() {
  32038. var rate = this.refresherOutRate;
  32039. rate = Math.max(0, rate);
  32040. rate = Math.min(1, rate);
  32041. return rate;
  32042. },
  32043. finalRefresherTransform: function finalRefresherTransform() {
  32044. if (this.refresherTransform === 'translateY(0px)') return 'none';
  32045. return this.refresherTransform;
  32046. },
  32047. finalShowRefresherWhenReload: function finalShowRefresherWhenReload() {
  32048. return this.showRefresherWhenReload || this.privateShowRefresherWhenReload;
  32049. },
  32050. finalRefresherTriggered: function finalRefresherTriggered() {
  32051. if (!(this.finalRefresherEnabled && !this.useCustomRefresher)) return false;
  32052. return this.refresherTriggered;
  32053. },
  32054. showRefresher: function showRefresher() {var _this = this;
  32055. var showRefresher = this.finalRefresherEnabled && this.useCustomRefresher && this.isTouchmoving;
  32056. if (this.customRefresherHeight === -1 && showRefresher) {
  32057. setTimeout(function () {
  32058. _this.$nextTick(function () {
  32059. _this._updateCustomRefresherHeight();
  32060. });
  32061. }, 100);
  32062. }
  32063. return showRefresher;
  32064. },
  32065. hasTouchmove: function hasTouchmove() {
  32066. return this.watchRefresherTouchmove;
  32067. return true;
  32068. return this.watchRefresherTouchmove;
  32069. } },
  32070. methods: {
  32071. //终止下拉刷新状态
  32072. endRefresh: function endRefresh() {
  32073. this._refresherEnd();
  32074. },
  32075. handleRefresherStatusChanged: function handleRefresherStatusChanged(func) {
  32076. this.refresherStatusChangedFunc = func;
  32077. },
  32078. //自定义下拉刷新被触发
  32079. _onRefresh: function _onRefresh() {var fromScrollView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;var isUserPullDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32080. if (fromScrollView && !(this.finalRefresherEnabled && !this.useCustomRefresher)) return;
  32081. this.$emit('onRefresh');
  32082. this.$emit('Refresh');
  32083. if (this.loading || this.isRefresherInComplete) return;
  32084. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  32085. if (this.nShowRefresherReveal) return;
  32086. this.isUserPullDown = isUserPullDown;
  32087. this.isUserReload = !isUserPullDown;
  32088. this._startLoading(true);
  32089. this.refresherTriggered = true;
  32090. if (this.reloadWhenRefresh && isUserPullDown) {
  32091. if (this.useChatRecordMode) {
  32092. this._onLoadingMore('click');
  32093. } else {
  32094. this._reload(false, false, isUserPullDown);
  32095. }
  32096. }
  32097. },
  32098. //自定义下拉刷新被复位
  32099. _onRestore: function _onRestore() {
  32100. this.refresherTriggered = 'restore';
  32101. this.$emit('onRestore');
  32102. this.$emit('Restore');
  32103. },
  32104. //进一步处理拖拽开始结果
  32105. _handleRefresherTouchstart: function _handleRefresherTouchstart(touch) {
  32106. if (!this.loading && this.isTouchEnded) {
  32107. this.isTouchmoving = false;
  32108. }
  32109. this.isTouchEnded = false;
  32110. this.refresherTransition = '';
  32111. this.refresherTouchstartY = touch.touchY;
  32112. this.$emit('refresherTouchstart', this.refresherTouchstartY);
  32113. this.lastRefresherTouchmove = touch;
  32114. this._cleanRefresherCompleteTimeout();
  32115. this._cleanRefresherEndTimeout();
  32116. },
  32117. //进一步处理拖拽中结果
  32118. _handleRefresherTouchmove: function _handleRefresherTouchmove(moveDis, touch) {
  32119. this.refresherReachMaxAngle = true;
  32120. this.isTouchmoving = true;
  32121. //this.refresherTransition = '';
  32122. this.isTouchEnded = false;
  32123. this.refresherStatus = moveDis >= this.finalRefresherThreshold ? _zPagingEnum.default.Refresher.ReleaseToRefresh : this.refresherStatus = _zPagingEnum.default.Refresher.Default;
  32124. this.moveDis = moveDis;
  32125. },
  32126. //进一步处理拖拽结束结果
  32127. _handleRefresherTouchend: function _handleRefresherTouchend(moveDis) {var _this2 = this;
  32128. this.refresherReachMaxAngle = true;
  32129. if (moveDis < 0 && this.usePageScroll && this.loadingMoreEnabled && this.useCustomRefresher && this.pageScrollTop === -1) {
  32130. if (this.showConsoleError) {
  32131. _zPagingUtils.default.consoleErr('usePageScroll为true并且自定义下拉刷新时必须引入mixin或在page滚动时通过调用z-paging组件的updatePageScrollTop方法设置当前的scrollTop');
  32132. }
  32133. }
  32134. this.isTouchEnded = true;
  32135. if (moveDis >= this.finalRefresherThreshold && this.refresherStatus === _zPagingEnum.default.Refresher.ReleaseToRefresh) {
  32136. this.moveDis = this.finalRefresherThreshold;
  32137. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  32138. this._doRefresherLoad();
  32139. } else {
  32140. this._refresherEnd();
  32141. setTimeout(function () {
  32142. _this2.isTouchmoving = false;
  32143. }, _zPagingConstant.default.delayTime);
  32144. }
  32145. this.scrollEnable = true;
  32146. // this.refresherTransition = 'transform .1s linear';
  32147. this.$emit('refresherTouchend', moveDis);
  32148. },
  32149. //处理scroll-view bounce是否生效
  32150. _handleScrollViewDisableBounce: function _handleScrollViewDisableBounce(e) {
  32151. if (!this.usePageScroll && !this.scrollToTopBounceEnabled) {
  32152. this.refresherTransition = '';
  32153. this.scrollEnable = e.bounce;
  32154. }
  32155. },
  32156. //wxs正在下拉状态改变处理
  32157. _handleWxsPullingDownStatusChange: function _handleWxsPullingDownStatusChange(onPullingDown) {
  32158. this.wxsOnPullingDown = onPullingDown;
  32159. if (onPullingDown && !this.useChatRecordMode) {
  32160. this.renderPropScrollTop = 0;
  32161. }
  32162. },
  32163. //wxs正在下拉处理
  32164. _handleWxsPullingDown: function _handleWxsPullingDown(e) {
  32165. this._emitTouchmove({ pullingDistance: e.moveDis, dy: e.diffDis });
  32166. },
  32167. //wxs通知更新其props
  32168. _handlePropUpdate: function _handlePropUpdate(e) {
  32169. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  32170. },
  32171. //下拉刷新结束
  32172. _refresherEnd: function _refresherEnd() {var _this3 = this;var shouldEndLoadingDelay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;var fromAddData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var setLoading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  32173. if (this.loadingType === _zPagingEnum.default.LoadingType.Refresher) {
  32174. var refresherCompleteDelay = 0;
  32175. if (fromAddData && (isUserPullDown || this.showRefresherWhenReload)) {
  32176. refresherCompleteDelay = this.refresherCompleteDuration > 700 ? 1 : this.refresherCompleteDelay;
  32177. }
  32178. var refresherStatus = refresherCompleteDelay > 0 ? _zPagingEnum.default.Refresher.Complete : _zPagingEnum.default.Refresher.Default;
  32179. if (this.finalShowRefresherWhenReload) {
  32180. var stackCount = this.refresherRevealStackCount;
  32181. this.refresherRevealStackCount--;
  32182. if (stackCount > 1) return;
  32183. }
  32184. this._cleanRefresherEndTimeout();
  32185. this.refresherEndTimeout = setTimeout(function () {
  32186. _this3.refresherStatus = refresherStatus;
  32187. }, refresherStatus === _zPagingEnum.default.Refresher.Default ? this.refresherCompleteDuration : 0);
  32188. if (refresherCompleteDelay > 0) {
  32189. this.isRefresherInComplete = true;
  32190. }
  32191. this._cleanRefresherCompleteTimeout();
  32192. this.refresherCompleteTimeout = setTimeout(function () {
  32193. var animateDuration = 1;
  32194. var animateType = _this3.refresherEndBounceEnabled && fromAddData ? 'cubic-bezier(0.19,1.64,0.42,0.72)' : 'linear';
  32195. if (fromAddData) {
  32196. animateDuration = _this3.refresherEndBounceEnabled ? _this3.refresherCompleteDuration / 1000 : _this3.refresherCompleteDuration / 3000;
  32197. }
  32198. _this3.refresherTransition = "transform ".concat(fromAddData ? animateDuration : 0.1, "s ").concat(animateType);
  32199. _this3.wxsPropType = _this3.refresherTransition + 'end' + _zPagingUtils.default.getTime();
  32200. _this3.moveDis = 0;
  32201. if (refresherStatus === _zPagingEnum.default.Refresher.Complete) {
  32202. if (_this3.refresherCompleteSubTimeout) {
  32203. clearTimeout(_this3.refresherCompleteSubTimeout);
  32204. _this3.refresherCompleteSubTimeout = null;
  32205. }
  32206. _this3.refresherCompleteSubTimeout = setTimeout(function () {
  32207. _this3.$nextTick(function () {
  32208. _this3.refresherStatus = _zPagingEnum.default.Refresher.Default;
  32209. _this3.isRefresherInComplete = false;
  32210. });
  32211. }, animateDuration * 800);
  32212. }
  32213. }, refresherCompleteDelay);
  32214. }
  32215. if (setLoading) {
  32216. setTimeout(function () {
  32217. _this3.loading = false;
  32218. }, shouldEndLoadingDelay ? _zPagingConstant.default.delayTime : 0);
  32219. isUserPullDown && this._onRestore();
  32220. }
  32221. },
  32222. //模拟用户手动触发下拉刷新
  32223. _doRefresherRefreshAnimate: function _doRefresherRefreshAnimate() {
  32224. this._cleanRefresherCompleteTimeout();
  32225. var doRefreshAnimateAfter = !this.doRefreshAnimateAfter && this.finalShowRefresherWhenReload && this.
  32226. customRefresherHeight === -1 && this.refresherThreshold === '80rpx';
  32227. if (doRefreshAnimateAfter) {
  32228. this.doRefreshAnimateAfter = true;
  32229. return;
  32230. }
  32231. this.refresherRevealStackCount++;
  32232. this.wxsPropType = 'begin' + _zPagingUtils.default.getTime();
  32233. this.moveDis = this.finalRefresherThreshold;
  32234. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  32235. this.isTouchmoving = true;
  32236. this._doRefresherLoad(false);
  32237. },
  32238. //触发下拉刷新
  32239. _doRefresherLoad: function _doRefresherLoad() {var isUserPullDown = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  32240. this._onRefresh(false, isUserPullDown);
  32241. this.loading = true;
  32242. },
  32243. //获取处理后的moveDis
  32244. _getFinalRefresherMoveDis: function _getFinalRefresherMoveDis(moveDis) {
  32245. moveDis = moveDis * 0.85;
  32246. if (moveDis >= this.finalRefresherThreshold) {
  32247. moveDis = this.finalRefresherThreshold + (moveDis - this.finalRefresherThreshold) * (1 - this.finalRefresherOutRate);
  32248. }
  32249. return moveDis;
  32250. },
  32251. //更新自定义下拉刷新view高度
  32252. _updateCustomRefresherHeight: function _updateCustomRefresherHeight() {var _this4 = this;
  32253. this._getNodeClientRect('.zp-custom-refresher-slot-view').then(function (res) {
  32254. if (res) {
  32255. _this4.customRefresherHeight = res[0].height;
  32256. if (_this4.customRefresherHeight > 0) {
  32257. _this4.showCustomRefresher = true;
  32258. }
  32259. } else {
  32260. _this4.customRefresherHeight = 0;
  32261. }
  32262. if (_this4.doRefreshAnimateAfter) {
  32263. _this4.doRefreshAnimateAfter = false;
  32264. _this4._doRefresherRefreshAnimate();
  32265. }
  32266. });
  32267. },
  32268. //发射pullingDown事件
  32269. _emitTouchmove: function _emitTouchmove(e) {
  32270. e.viewHeight = this.finalRefresherThreshold;
  32271. e.rate = e.pullingDistance / e.viewHeight;
  32272. if (this.hasTouchmove) {
  32273. this.$emit('refresherTouchmove', e);
  32274. }
  32275. },
  32276. //清除refresherCompleteTimeout
  32277. _cleanRefresherCompleteTimeout: function _cleanRefresherCompleteTimeout() {
  32278. this.refresherCompleteTimeout = this._cleanTimeout(this.refresherCompleteTimeout);
  32279. },
  32280. //清除refresherEndTimeout
  32281. _cleanRefresherEndTimeout: function _cleanRefresherEndTimeout() {
  32282. this.refresherEndTimeout = this._cleanTimeout(this.refresherEndTimeout);
  32283. } } };var _default2 =
  32284. ZPRefresher;exports.default = _default2;
  32285. /***/ }),
  32286. /* 286 */
  32287. /*!***************************************************************************************************!*\
  32288. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/load-more.js ***!
  32289. \***************************************************************************************************/
  32290. /*! no static exports found */
  32291. /***/ (function(module, exports, __webpack_require__) {
  32292. "use strict";
  32293. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));
  32294. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  32295. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  32296. var ZPLoadMore = {
  32297. props: {
  32298. //自定义底部加载更多样式
  32299. loadingMoreCustomStyle: {
  32300. type: Object,
  32301. default: function _default() {
  32302. return _zPagingUtils.default.gc('loadingMoreCustomStyle', {});
  32303. } },
  32304. //自定义底部加载更多文字样式
  32305. loadingMoreTitleCustomStyle: {
  32306. type: Object,
  32307. default: function _default() {
  32308. return _zPagingUtils.default.gc('loadingMoreTitleCustomStyle', {});
  32309. } },
  32310. //自定义底部加载更多加载中动画样式
  32311. loadingMoreLoadingIconCustomStyle: {
  32312. type: Object,
  32313. default: function _default() {
  32314. return _zPagingUtils.default.gc('loadingMoreLoadingIconCustomStyle', {});
  32315. } },
  32316. //自定义底部加载更多加载中动画图标类型,可选flower或circle,默认为flower
  32317. loadingMoreLoadingIconType: {
  32318. type: String,
  32319. default: _zPagingUtils.default.gc('loadingMoreLoadingIconType', 'flower') },
  32320. //自定义底部加载更多加载中动画图标图片
  32321. loadingMoreLoadingIconCustomImage: {
  32322. type: String,
  32323. default: _zPagingUtils.default.gc('loadingMoreLoadingIconCustomImage', '') },
  32324. //底部加载更多加载中view是否展示旋转动画,默认为是
  32325. loadingMoreLoadingAnimated: {
  32326. type: Boolean,
  32327. default: _zPagingUtils.default.gc('loadingMoreLoadingAnimated', true) },
  32328. //是否启用加载更多数据(含滑动到底部加载更多数据和点击加载更多数据),默认为是
  32329. loadingMoreEnabled: {
  32330. type: Boolean,
  32331. default: _zPagingUtils.default.gc('loadingMoreEnabled', true) },
  32332. //是否启用滑动到底部加载更多数据,默认为是
  32333. toBottomLoadingMoreEnabled: {
  32334. type: Boolean,
  32335. default: _zPagingUtils.default.gc('toBottomLoadingMoreEnabled', true) },
  32336. //滑动到底部状态为默认状态时,以加载中的状态展示,默认为否。若设置为是,可避免滚动到底部看到默认状态然后立刻变为加载中状态的问题,但分页数量未超过一屏时,不会显示【点击加载更多】
  32337. loadingMoreDefaultAsLoading: {
  32338. type: [Boolean],
  32339. default: _zPagingUtils.default.gc('loadingMoreDefaultAsLoading', false) },
  32340. //滑动到底部"默认"文字,默认为【点击加载更多】
  32341. loadingMoreDefaultText: {
  32342. type: [String, Object],
  32343. default: _zPagingUtils.default.gc('loadingMoreDefaultText', null) },
  32344. //滑动到底部"加载中"文字,默认为【正在加载...】
  32345. loadingMoreLoadingText: {
  32346. type: [String, Object],
  32347. default: _zPagingUtils.default.gc('loadingMoreLoadingText', null) },
  32348. //滑动到底部"没有更多"文字,默认为【没有更多了】
  32349. loadingMoreNoMoreText: {
  32350. type: [String, Object],
  32351. default: _zPagingUtils.default.gc('loadingMoreNoMoreText', null) },
  32352. //滑动到底部"加载失败"文字,默认为【加载失败,点击重新加载】
  32353. loadingMoreFailText: {
  32354. type: [String, Object],
  32355. default: _zPagingUtils.default.gc('loadingMoreFailText', null) },
  32356. //当没有更多数据且分页内容未超出z-paging时是否隐藏没有更多数据的view,默认为否
  32357. hideLoadingMoreWhenNoMoreAndInsideOfPaging: {
  32358. type: Boolean,
  32359. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreAndInsideOfPaging', false) },
  32360. //当没有更多数据且分页数组长度少于这个值时,隐藏没有更多数据的view,默认为0,代表不限制。
  32361. hideLoadingMoreWhenNoMoreByLimit: {
  32362. type: Number,
  32363. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreByLimit', 0) },
  32364. //是否显示默认的加载更多text,默认为是
  32365. showDefaultLoadingMoreText: {
  32366. type: Boolean,
  32367. default: _zPagingUtils.default.gc('showDefaultLoadingMoreText', true) },
  32368. //是否显示没有更多数据的view
  32369. showLoadingMoreNoMoreView: {
  32370. type: Boolean,
  32371. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreView', true) },
  32372. //是否显示没有更多数据的分割线,默认为是
  32373. showLoadingMoreNoMoreLine: {
  32374. type: Boolean,
  32375. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreLine', true) },
  32376. //自定义底部没有更多数据的分割线样式
  32377. loadingMoreNoMoreLineCustomStyle: {
  32378. type: Object,
  32379. default: function _default() {
  32380. return _zPagingUtils.default.gc('loadingMoreNoMoreLineCustomStyle', {});
  32381. } },
  32382. //距底部/右边多远时(单位px),触发 scrolltolower 事件,默认为100rpx
  32383. lowerThreshold: {
  32384. type: [Number, String],
  32385. default: _zPagingUtils.default.gc('lowerThreshold', '100rpx') } },
  32386. data: function data() {
  32387. return {
  32388. //底部加载更多状态
  32389. loadingStatus: _zPagingEnum.default.More.Default,
  32390. loadingStatusAfterRender: _zPagingEnum.default.More.Default,
  32391. loadingMoreTimeStamp: 0,
  32392. loadingMoreDefaultSlot: null,
  32393. showLoadingMore: false,
  32394. customNoMore: -1 };
  32395. },
  32396. computed: {
  32397. zPagingLoadMoreConfig: function zPagingLoadMoreConfig() {
  32398. return {
  32399. status: this.loadingStatusAfterRender,
  32400. defaultAsLoading: this.loadingMoreDefaultAsLoading,
  32401. defaultThemeStyle: this.finalLoadingMoreThemeStyle,
  32402. customStyle: this.loadingMoreCustomStyle,
  32403. titleCustomStyle: this.loadingMoreTitleCustomStyle,
  32404. iconCustomStyle: this.loadingMoreLoadingIconCustomStyle,
  32405. loadingIconType: this.loadingMoreLoadingIconType,
  32406. loadingIconCustomImage: this.loadingMoreLoadingIconCustomImage,
  32407. loadingAnimated: this.loadingMoreLoadingAnimated,
  32408. showNoMoreLine: this.showLoadingMoreNoMoreLine,
  32409. noMoreLineCustomStyle: this.loadingMoreNoMoreLineCustomStyle,
  32410. defaultText: this.finalLoadingMoreDefaultText,
  32411. loadingText: this.finalLoadingMoreLoadingText,
  32412. noMoreText: this.finalLoadingMoreNoMoreText,
  32413. failText: this.finalLoadingMoreFailText };
  32414. },
  32415. finalLoadingMoreThemeStyle: function finalLoadingMoreThemeStyle() {
  32416. return this.loadingMoreThemeStyle.length ? this.loadingMoreThemeStyle : this.defaultThemeStyle;
  32417. } },
  32418. methods: {
  32419. //手动触发上拉加载更多(非必须,可依据具体需求使用)
  32420. doLoadMore: function doLoadMore() {
  32421. this._onLoadingMore('toBottom');
  32422. },
  32423. //通过@scroll事件检测是否滚动到了底部
  32424. _checkScrolledToBottom: function _checkScrolledToBottom(scrollDiff) {var _this = this;var checked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  32425. if (this.checkScrolledToBottomTimeOut) {
  32426. clearTimeout(this.checkScrolledToBottomTimeOut);
  32427. this.checkScrolledToBottomTimeOut = null;
  32428. }
  32429. if (this.cacheScrollNodeHeight === -1) {
  32430. this._getNodeClientRect('.zp-scroll-view').then(function (res) {
  32431. if (res) {
  32432. var pageScrollNodeHeight = res[0].height;
  32433. _this.cacheScrollNodeHeight = pageScrollNodeHeight;
  32434. if (scrollDiff - pageScrollNodeHeight <= _this.finalLowerThreshold) {
  32435. _this._onLoadingMore('toBottom');
  32436. }
  32437. }
  32438. });
  32439. } else {
  32440. if (scrollDiff - this.cacheScrollNodeHeight <= this.finalLowerThreshold) {
  32441. this._onLoadingMore('toBottom');
  32442. } else if (scrollDiff - this.cacheScrollNodeHeight <= 500 && !checked) {
  32443. this.checkScrolledToBottomTimeOut = setTimeout(function () {
  32444. _this._getNodeClientRect('.zp-scroll-view', true, true).then(function (res) {
  32445. _this.oldScrollTop = res[0].scrollTop;
  32446. var newScrollDiff = res[0].scrollHeight - _this.oldScrollTop;
  32447. _this._checkScrolledToBottom(newScrollDiff, true);
  32448. });
  32449. }, 150);
  32450. }
  32451. }
  32452. },
  32453. //触发加载更多时调用,from:0-滑动到底部触发;1-点击加载更多触发
  32454. _onLoadingMore: function _onLoadingMore() {var _this2 = this;var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'click';
  32455. if (from === 'toBottom') {
  32456. if (!this.scrollToBottomBounceEnabled) {
  32457. if (this.scrollEnable) {
  32458. this.scrollEnable = false;
  32459. this.$nextTick(function () {
  32460. _this2.scrollEnable = true;
  32461. });
  32462. }
  32463. }
  32464. }
  32465. this.$emit('scrolltolower', from);
  32466. if (from === 'toBottom' && (!this.toBottomLoadingMoreEnabled || this.useChatRecordMode)) return;
  32467. if (this.refresherOnly || !this.loadingMoreEnabled || !(this.loadingStatus === _zPagingEnum.default.More.Default || this.loadingStatus === _zPagingEnum.default.More.Fail) || this.loading) return;
  32468. if (!this.isIos && !this.refresherOnly && !this.usePageScroll) {
  32469. var currentTimestamp = _zPagingUtils.default.getTime();
  32470. if (this.loadingMoreTimeStamp > 0 && currentTimestamp - this.loadingMoreTimeStamp < 100) {
  32471. this.loadingMoreTimeStamp = 0;
  32472. return;
  32473. }
  32474. }
  32475. this._doLoadingMore();
  32476. },
  32477. //处理开始加载更多
  32478. _doLoadingMore: function _doLoadingMore() {var _this3 = this;
  32479. if (this.pageNo >= this.defaultPageNo && this.loadingStatus !== _zPagingEnum.default.More.NoMore) {
  32480. this.pageNo++;
  32481. this._startLoading(false);
  32482. if (this.isLocalPaging) {
  32483. this._localPagingQueryList(this.pageNo, this.defaultPageSize, this.localPagingLoadingTime, function (res) {
  32484. _this3.addData(res);
  32485. });
  32486. } else {
  32487. this._emitQuery(this.pageNo, this.defaultPageSize, _zPagingEnum.default.QueryFrom.LoadingMore);
  32488. this._callMyParentQuery();
  32489. }
  32490. this.loadingType = _zPagingEnum.default.LoadingType.LoadingMore;
  32491. }
  32492. },
  32493. //(预处理)判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  32494. _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode) {var _this4 = this;
  32495. if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreByLimit > 0 && newVal.length) {
  32496. this.showLoadingMore = newVal.length > this.hideLoadingMoreWhenNoMoreByLimit;
  32497. } else if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreAndInsideOfPaging && newVal.length || this.insideMore && this.insideOfPaging !== false && newVal.length) {
  32498. this.$nextTick(function () {
  32499. _this4._checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode);
  32500. });
  32501. if (this.insideMore && this.insideOfPaging !== false && newVal.length) {
  32502. this.showLoadingMore = newVal.length;
  32503. }
  32504. } else {
  32505. this.showLoadingMore = newVal.length;
  32506. }
  32507. },
  32508. //判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  32509. _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, oldScrollViewNode, oldPagingContainerNode) {var _this5 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var scrollViewNode, scrollViewTotalH, pagingContainerH, scrollViewH, pagingContainerNode;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.prev = 0;_context.t0 =
  32510. oldScrollViewNode;if (_context.t0) {_context.next = 6;break;}_context.next = 5;return _this5._getNodeClientRect('.zp-scroll-view');case 5:_context.t0 = _context.sent;case 6:scrollViewNode = _context.t0;if (!
  32511. _this5.usePageScroll) {_context.next = 11;break;}
  32512. if (scrollViewNode) {
  32513. scrollViewTotalH = scrollViewNode[0].top + scrollViewNode[0].height;
  32514. _this5.insideOfPaging = scrollViewTotalH < _this5.windowHeight;
  32515. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32516. _this5.showLoadingMore = !_this5.insideOfPaging;
  32517. }
  32518. _this5._updateInsideOfPaging();
  32519. }_context.next = 24;break;case 11:
  32520. pagingContainerH = 0;
  32521. scrollViewH = 0;_context.t1 =
  32522. oldPagingContainerNode;if (_context.t1) {_context.next = 18;break;}_context.next = 17;return _this5._getNodeClientRect('.zp-paging-container-content');case 17:_context.t1 = _context.sent;case 18:pagingContainerNode = _context.t1;
  32523. if (pagingContainerNode) {
  32524. pagingContainerH = pagingContainerNode[0].height;
  32525. }
  32526. if (scrollViewNode) {
  32527. scrollViewH = scrollViewNode[0].height;
  32528. }
  32529. _this5.insideOfPaging = pagingContainerH < scrollViewH;
  32530. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32531. _this5.showLoadingMore = !_this5.insideOfPaging;
  32532. }
  32533. _this5._updateInsideOfPaging();case 24:_context.next = 31;break;case 26:_context.prev = 26;_context.t2 = _context["catch"](0);
  32534. _this5.insideOfPaging = !totalData.length;
  32535. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32536. _this5.showLoadingMore = !_this5.insideOfPaging;
  32537. }
  32538. _this5._updateInsideOfPaging();case 31:case "end":return _context.stop();}}}, _callee, null, [[0, 26]]);}))();
  32539. },
  32540. //是否要展示上拉加载更多view
  32541. _showLoadingMore: function _showLoadingMore(type) {
  32542. if (!(this.loadingStatus === _zPagingEnum.default.More.Default ? this.nShowBottom : true)) return false;
  32543. if ((!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) && !this.showLoadingMore || !this.loadingMoreEnabled && (!this.showLoadingMoreWhenReload || this.
  32544. isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) || this.refresherOnly) return false;
  32545. if (this.useChatRecordMode && type !== 'Loading') return false;
  32546. if (!this.$slots) return false;
  32547. if (type === 'Custom') {
  32548. return this.showDefaultLoadingMoreText && !(this.loadingStatus === _zPagingEnum.default.More.NoMore && !this.showLoadingMoreNoMoreView);
  32549. }
  32550. var res = this.loadingStatus === _zPagingEnum.default.More[type] && this.$slots["loadingMore".concat(type)] && (type === 'NoMore' ? this.showLoadingMoreNoMoreView : true);
  32551. if (res) {
  32552. }
  32553. return res;
  32554. } } };var _default2 =
  32555. ZPLoadMore;exports.default = _default2;
  32556. /***/ }),
  32557. /* 287 */
  32558. /*!**************************************************************************************************!*\
  32559. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/scroller.js ***!
  32560. \**************************************************************************************************/
  32561. /*! no static exports found */
  32562. /***/ (function(module, exports, __webpack_require__) {
  32563. "use strict";
  32564. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));
  32565. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));
  32566. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 281));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  32567. var ZPScroller = {
  32568. props: {
  32569. //使用页面滚动,默认为否,当设置为是时则使用页面的滚动而非此组件内部的scroll-view的滚动,使用页面滚动时z-paging无需设置确定的高度且对于长列表展示性能更高,但配置会略微繁琐
  32570. usePageScroll: {
  32571. type: Boolean,
  32572. default: _zPagingUtils.default.gc('usePageScroll', false) },
  32573. //是否可以滚动,使用内置scroll-view和nvue时有效,默认为是
  32574. scrollable: {
  32575. type: Boolean,
  32576. default: _zPagingUtils.default.gc('scrollable', true) },
  32577. //控制是否出现滚动条,默认为是
  32578. showScrollbar: {
  32579. type: Boolean,
  32580. default: _zPagingUtils.default.gc('showScrollbar', true) },
  32581. //是否允许横向滚动,默认为否
  32582. scrollX: {
  32583. type: Boolean,
  32584. default: _zPagingUtils.default.gc('scrollX', false) },
  32585. //iOS设备上滚动到顶部时是否允许回弹效果,默认为否。关闭回弹效果后可使滚动到顶部与下拉刷新更连贯,但是有吸顶view时滚动到顶部时可能出现抖动。
  32586. scrollToTopBounceEnabled: {
  32587. type: Boolean,
  32588. default: _zPagingUtils.default.gc('scrollToTopBounceEnabled', false) },
  32589. //iOS设备上滚动到底部时是否允许回弹效果,默认为是。
  32590. scrollToBottomBounceEnabled: {
  32591. type: Boolean,
  32592. default: _zPagingUtils.default.gc('scrollToBottomBounceEnabled', true) },
  32593. //在设置滚动条位置时使用动画过渡,默认为否
  32594. scrollWithAnimation: {
  32595. type: Boolean,
  32596. default: _zPagingUtils.default.gc('scrollWithAnimation', false) },
  32597. //值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
  32598. scrollIntoView: {
  32599. type: String,
  32600. default: _zPagingUtils.default.gc('scrollIntoView', '') } },
  32601. data: function data() {
  32602. return {
  32603. scrollTop: 0,
  32604. oldScrollTop: 0,
  32605. scrollViewStyle: {},
  32606. scrollViewInStyle: {},
  32607. pageScrollTop: -1,
  32608. scrollEnable: true,
  32609. privateScrollWithAnimation: -1,
  32610. cacheScrollNodeHeight: -1 };
  32611. },
  32612. watch: {
  32613. oldScrollTop: function oldScrollTop(newVal, oldVal) {
  32614. !this.usePageScroll && this._scrollTopChange(newVal, oldVal, false);
  32615. },
  32616. pageScrollTop: function pageScrollTop(newVal, oldVal) {
  32617. this.usePageScroll && this._scrollTopChange(newVal, oldVal, true);
  32618. },
  32619. usePageScroll: {
  32620. handler: function handler(newVal) {var _this = this;
  32621. this.$nextTick(function () {
  32622. _this.renderPropUsePageScroll = newVal;
  32623. });
  32624. if (this.loaded && this.autoHeight) {
  32625. this._setAutoHeight(!newVal);
  32626. }
  32627. },
  32628. immediate: true },
  32629. finalScrollTop: function finalScrollTop(newVal, oldVal) {
  32630. if (!this.useChatRecordMode) {
  32631. this.renderPropScrollTop = newVal < 6 ? 0 : 10;
  32632. }
  32633. } },
  32634. computed: {
  32635. finalScrollWithAnimation: function finalScrollWithAnimation() {
  32636. if (this.privateScrollWithAnimation !== -1) {
  32637. var scrollWithAnimation = this.privateScrollWithAnimation === 1;
  32638. this.privateScrollWithAnimation = -1;
  32639. return scrollWithAnimation;
  32640. }
  32641. return this.scrollWithAnimation;
  32642. },
  32643. finalScrollViewStyle: function finalScrollViewStyle() {
  32644. if (this.superContentZIndex != 1) {
  32645. this.scrollViewStyle['z-index'] = this.superContentZIndex;
  32646. this.scrollViewStyle['position'] = 'relative';
  32647. }
  32648. return this.scrollViewStyle;
  32649. },
  32650. finalScrollTop: function finalScrollTop() {
  32651. return this.usePageScroll ? this.pageScrollTop : this.oldScrollTop;
  32652. } },
  32653. methods: {
  32654. //滚动到顶部,animate为是否展示滚动动画,默认为是
  32655. scrollToTop: function scrollToTop(animate) {var _this2 = this;var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32656. this.$nextTick(function () {
  32657. _this2._scrollToTop(animate, false);
  32658. });
  32659. },
  32660. //滚动到底部,animate为是否展示滚动动画,默认为是
  32661. scrollToBottom: function scrollToBottom(animate) {var _this3 = this;var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32662. this.$nextTick(function () {
  32663. _this3._scrollToBottom(animate);
  32664. });
  32665. },
  32666. //滚动到指定view(vue中有效)。sel为需要滚动的view的id值,不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32667. scrollIntoViewById: function scrollIntoViewById(sel, offset, animate) {
  32668. this._scrollIntoView(sel, offset, animate);
  32669. },
  32670. //滚动到指定view(vue中有效)。nodeTop为需要滚动的view的top值(通过uni.createSelectorQuery()获取);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32671. scrollIntoViewByNodeTop: function scrollIntoViewByNodeTop(nodeTop, offset, animate) {var _this4 = this;
  32672. this.scrollTop = this.oldScrollTop;
  32673. this.$nextTick(function () {
  32674. _this4._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  32675. });
  32676. },
  32677. //滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32678. scrollToY: function scrollToY(y, offset, animate) {var _this5 = this;
  32679. this.scrollTop = this.oldScrollTop;
  32680. this.$nextTick(function () {
  32681. _this5._scrollToY(y, offset, animate);
  32682. });
  32683. },
  32684. //滚动到指定view(nvue中有效)。index为需要滚动的view的index(第几个);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32685. scrollIntoViewByIndex: function scrollIntoViewByIndex(index, offset, animate) {
  32686. this._scrollIntoView(index, offset, animate);
  32687. },
  32688. //滚动到指定view(nvue中有效)。view为需要滚动的view(通过`this.$refs.xxx`获取),不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32689. scrollIntoViewByView: function scrollIntoViewByView(view, offset, animate) {
  32690. this._scrollIntoView(view, offset, animate);
  32691. },
  32692. //当使用页面滚动并且自定义下拉刷新时,请在页面的onPageScroll中调用此方法,告知z-paging当前的pageScrollTop,否则会导致在任意位置都可以下拉刷新
  32693. updatePageScrollTop: function updatePageScrollTop(value) {
  32694. if (value == undefined) {
  32695. _zPagingUtils.default.consoleErr('updatePageScrollTop方法缺少参数,请将页面onPageScroll事件中的scrollTop传递给此方法');
  32696. return;
  32697. }
  32698. this.pageScrollTop = value;
  32699. },
  32700. //当使用页面滚动并且设置了slot="top"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="top"的view高度动态改变时,在其高度需要更新时调用此方法
  32701. updatePageScrollTopHeight: function updatePageScrollTopHeight() {
  32702. this._updatePageScrollTopOrBottomHeight('top');
  32703. },
  32704. //当使用页面滚动并且设置了slot="bottom"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="bottom"的view高度动态改变时,在其高度需要更新时调用此方法
  32705. updatePageScrollBottomHeight: function updatePageScrollBottomHeight() {
  32706. this._updatePageScrollTopOrBottomHeight('bottom');
  32707. },
  32708. //更新z-paging内置scroll-view的scrollTop
  32709. updateScrollViewScrollTop: function updateScrollViewScrollTop(scrollTop) {var _this6 = this;var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32710. this.privateScrollWithAnimation = animate ? 1 : 0;
  32711. this.scrollTop = this.oldScrollTop;
  32712. this.$nextTick(function () {
  32713. _this6.scrollTop = scrollTop;
  32714. _this6.oldScrollTop = _this6.scrollTop;
  32715. });
  32716. },
  32717. //当滚动到顶部时
  32718. _scrollToUpper: function _scrollToUpper() {var _this7 = this;
  32719. this.$emit('scrolltoupper');
  32720. this.$emit('scrollTopChange', 0);
  32721. this.$nextTick(function () {
  32722. _this7.oldScrollTop = 0;
  32723. });
  32724. if (!this.useChatRecordMode) return;
  32725. if (this.loadingStatus === _zPagingEnum.default.More.NoMore) return;
  32726. this._onLoadingMore('click');
  32727. },
  32728. //滚动到顶部
  32729. _scrollToTop: function _scrollToTop() {var _this8 = this;var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;var isPrivate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32730. if (this.usePageScroll) {
  32731. this.$nextTick(function () {
  32732. uni.pageScrollTo({
  32733. scrollTop: 0,
  32734. duration: animate ? 100 : 0 });
  32735. });
  32736. return;
  32737. }
  32738. this.privateScrollWithAnimation = animate ? 1 : 0;
  32739. this.scrollTop = this.oldScrollTop;
  32740. this.$nextTick(function () {
  32741. _this8.scrollTop = 0;
  32742. _this8.oldScrollTop = _this8.scrollTop;
  32743. });
  32744. },
  32745. //滚动到底部
  32746. _scrollToBottom: function _scrollToBottom() {var _arguments = arguments,_this9 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var animate, pagingContainerH, scrollViewH, pagingContainerNode, scrollViewNode;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:animate = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;if (!
  32747. _this9.usePageScroll) {_context.next = 4;break;}
  32748. _this9.$nextTick(function () {
  32749. uni.pageScrollTo({
  32750. scrollTop: Number.MAX_VALUE,
  32751. duration: animate ? 100 : 0 });
  32752. });return _context.abrupt("return");case 4:_context.prev = 4;
  32753. _this9.privateScrollWithAnimation = animate ? 1 : 0;
  32754. pagingContainerH = 0;
  32755. scrollViewH = 0;_context.next = 10;return (
  32756. _this9._getNodeClientRect('.zp-paging-container'));case 10:pagingContainerNode = _context.sent;_context.next = 13;return (
  32757. _this9._getNodeClientRect('.zp-scroll-view'));case 13:scrollViewNode = _context.sent;
  32758. if (pagingContainerNode) {
  32759. pagingContainerH = pagingContainerNode[0].height;
  32760. }
  32761. if (scrollViewNode) {
  32762. scrollViewH = scrollViewNode[0].height;
  32763. }
  32764. if (pagingContainerH > scrollViewH) {
  32765. _this9.scrollTop = _this9.oldScrollTop;
  32766. _this9.$nextTick(function () {
  32767. _this9.scrollTop = pagingContainerH - scrollViewH;
  32768. _this9.oldScrollTop = _this9.scrollTop;
  32769. });
  32770. }_context.next = 21;break;case 19:_context.prev = 19;_context.t0 = _context["catch"](4);case 21:case "end":return _context.stop();}}}, _callee, null, [[4, 19]]);}))();
  32771. },
  32772. //滚动到指定view
  32773. _scrollIntoView: function _scrollIntoView(sel) {var _this10 = this;var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var finishCallback = arguments.length > 3 ? arguments[3] : undefined;
  32774. try {
  32775. this.scrollTop = this.oldScrollTop;
  32776. this.$nextTick(function () {
  32777. if (sel.indexOf('#') != -1) {
  32778. sel = sel.replace('#', '');
  32779. }
  32780. _this10._getNodeClientRect('#' + sel, false).then(function (node) {
  32781. if (node) {
  32782. var nodeTop = node[0].top;
  32783. _this10._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  32784. if (finishCallback) {
  32785. finishCallback();
  32786. }
  32787. }
  32788. });
  32789. });
  32790. } catch (e) {}
  32791. },
  32792. //通过nodeTop滚动到指定view
  32793. _scrollIntoViewByNodeTop: function _scrollIntoViewByNodeTop(nodeTop) {var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  32794. this._scrollToY(nodeTop, offset, animate, true);
  32795. },
  32796. //滚动到指定位置
  32797. _scrollToY: function _scrollToY(y) {var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var addScrollTop = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  32798. this.privateScrollWithAnimation = animate ? 1 : 0;
  32799. if (this.usePageScroll) {
  32800. uni.pageScrollTo({
  32801. scrollTop: y - offset,
  32802. duration: animate ? 100 : 0 });
  32803. } else {
  32804. if (addScrollTop) {
  32805. y += this.oldScrollTop;
  32806. }
  32807. this.scrollTop = y - offset;
  32808. this.oldScrollTop = this.scrollTop;
  32809. }
  32810. },
  32811. //scroll-view滚动中
  32812. _scroll: function _scroll(e) {
  32813. this.$emit('scroll', e);
  32814. this.oldScrollTop = e.detail.scrollTop;
  32815. var scrollDiff = e.detail.scrollHeight - this.oldScrollTop;
  32816. !this.isIos && this._checkScrolledToBottom(scrollDiff);
  32817. },
  32818. //scrollTop改变时触发
  32819. _scrollTopChange: function _scrollTopChange(newVal, oldVal, isPageScrollTop) {
  32820. this.$emit('scrollTopChange', newVal);
  32821. this.$emit('update:scrollTop', newVal);
  32822. this._checkShouldShowBackToTop(newVal, oldVal);
  32823. var scrollTop = this.isIos ? newVal > 5 ? 6 : 0 : newVal;
  32824. if (isPageScrollTop) {
  32825. this.wxsPageScrollTop = scrollTop;
  32826. } else {
  32827. this.wxsScrollTop = scrollTop;
  32828. }
  32829. },
  32830. //更新使用页面滚动时slot="top"或"bottom"插入view的高度
  32831. _updatePageScrollTopOrBottomHeight: function _updatePageScrollTopOrBottomHeight(type) {var _this11 = this;
  32832. if (!this.usePageScroll) return;
  32833. this._doCheckScrollViewShouldFullHeight(this.realTotalData);
  32834. var node = ".zp-page-scroll-".concat(type);
  32835. var marginText = "margin".concat(type.slice(0, 1).toUpperCase() + type.slice(1));
  32836. var safeAreaInsetBottomAdd = this.safeAreaInsetBottom;
  32837. this.$nextTick(function () {
  32838. var delayTime = 0;
  32839. setTimeout(function () {
  32840. _this11._getNodeClientRect(node).then(function (res) {
  32841. if (res) {
  32842. var pageScrollNodeHeight = res[0].height;
  32843. if (type === 'bottom') {
  32844. if (safeAreaInsetBottomAdd) {
  32845. pageScrollNodeHeight += _this11.safeAreaBottom;
  32846. }
  32847. } else {
  32848. _this11.cacheTopHeight = pageScrollNodeHeight;
  32849. }
  32850. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(
  32851. pageScrollNodeHeight, "px"));
  32852. } else if (safeAreaInsetBottomAdd) {
  32853. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(_this11.safeAreaBottom, "px"));
  32854. }
  32855. });
  32856. }, delayTime);
  32857. });
  32858. } } };var _default =
  32859. ZPScroller;exports.default = _default;
  32860. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  32861. /***/ }),
  32862. /* 288 */
  32863. /*!*****************************************************************************************************!*\
  32864. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/back-to-top.js ***!
  32865. \*****************************************************************************************************/
  32866. /*! no static exports found */
  32867. /***/ (function(module, exports, __webpack_require__) {
  32868. "use strict";
  32869. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  32870. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 274));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]点击返回顶部view模块
  32871. var ZPBackToTop = {
  32872. props: {
  32873. //自动显示点击返回顶部按钮,默认为否
  32874. autoShowBackToTop: {
  32875. type: Boolean,
  32876. default: _zPagingUtils.default.gc('autoShowBackToTop', false) },
  32877. //点击返回顶部按钮显示/隐藏的阈值(滚动距离),单位为px,默认为400rpx
  32878. backToTopThreshold: {
  32879. type: [Number, String],
  32880. default: _zPagingUtils.default.gc('backToTopThreshold', '400rpx') },
  32881. //点击返回顶部按钮的自定义图片地址,默认使用z-paging内置的图片
  32882. backToTopImg: {
  32883. type: String,
  32884. default: _zPagingUtils.default.gc('backToTopImg', '') },
  32885. //点击返回顶部按钮返回到顶部时是否展示过渡动画,默认为是
  32886. backToTopWithAnimate: {
  32887. type: Boolean,
  32888. default: _zPagingUtils.default.gc('backToTopWithAnimate', true) },
  32889. //点击返回顶部按钮与底部的距离,注意添加单位px或rpx,默认为160rpx
  32890. backToTopBottom: {
  32891. type: [Number, String],
  32892. default: _zPagingUtils.default.gc('backToTopBottom', '160rpx') },
  32893. //点击返回顶部按钮的自定义样式
  32894. backToTopStyle: {
  32895. type: Object,
  32896. default: function _default() {
  32897. return _zPagingUtils.default.gc('backToTopStyle', {});
  32898. } },
  32899. //iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向,默认为是
  32900. enableBackToTop: {
  32901. type: Boolean,
  32902. default: _zPagingUtils.default.gc('enableBackToTop', true) } },
  32903. data: function data() {
  32904. return {
  32905. backToTopClass: 'zp-back-to-top zp-back-to-top-hide',
  32906. lastBackToTopShowTime: 0,
  32907. showBackToTopClass: false };
  32908. },
  32909. computed: {
  32910. finalEnableBackToTop: function finalEnableBackToTop() {
  32911. return this.usePageScroll ? false : this.enableBackToTop;
  32912. },
  32913. finalBackToTopThreshold: function finalBackToTopThreshold() {
  32914. return _zPagingUtils.default.convertTextToPx(this.backToTopThreshold);
  32915. },
  32916. finalBackToTopStyle: function finalBackToTopStyle() {
  32917. var tempBackToTopStyle = this.backToTopStyle;
  32918. if (!tempBackToTopStyle.bottom) {
  32919. tempBackToTopStyle.bottom = this.windowBottom + _zPagingUtils.default.convertTextToPx(this.backToTopBottom) + 'px';
  32920. }
  32921. if (!tempBackToTopStyle.position) {
  32922. tempBackToTopStyle.position = this.usePageScroll ? 'fixed' : 'absolute';
  32923. }
  32924. return tempBackToTopStyle;
  32925. } },
  32926. methods: {
  32927. //点击返回顶部
  32928. _backToTopClick: function _backToTopClick() {
  32929. !this.backToTopWithAnimate && this._checkShouldShowBackToTop(1, 0);
  32930. this.scrollToTop(this.backToTopWithAnimate);
  32931. },
  32932. //判断是否要显示返回顶部按钮
  32933. _checkShouldShowBackToTop: function _checkShouldShowBackToTop(newVal, oldVal) {var _this = this;
  32934. if (!this.autoShowBackToTop) {
  32935. this.showBackToTopClass = false;
  32936. return;
  32937. }
  32938. if (newVal !== oldVal) {
  32939. if (newVal > this.finalBackToTopThreshold) {
  32940. if (!this.showBackToTopClass) {
  32941. this.showBackToTopClass = true;
  32942. this.lastBackToTopShowTime = new Date().getTime();
  32943. setTimeout(function () {
  32944. _this.backToTopClass = 'zp-back-to-top zp-back-to-top-show';
  32945. }, 300);
  32946. }
  32947. } else {
  32948. if (this.showBackToTopClass) {
  32949. var currentTime = new Date().getTime();
  32950. var dalayTime = 300;
  32951. if (currentTime - this.lastBackToTopShowTime < 500) {
  32952. dalayTime = 0;
  32953. }
  32954. this.backToTopClass = 'zp-back-to-top zp-back-to-top-hide';
  32955. setTimeout(function () {
  32956. _this.showBackToTopClass = false;
  32957. }, dalayTime);
  32958. }
  32959. }
  32960. }
  32961. } } };var _default2 =
  32962. ZPBackToTop;exports.default = _default2;
  32963. /***/ }),
  32964. /* 289 */,
  32965. /* 290 */,
  32966. /* 291 */,
  32967. /* 292 */,
  32968. /* 293 */,
  32969. /* 294 */,
  32970. /* 295 */,
  32971. /* 296 */,
  32972. /* 297 */,
  32973. /* 298 */,
  32974. /* 299 */,
  32975. /* 300 */,
  32976. /* 301 */,
  32977. /* 302 */,
  32978. /* 303 */,
  32979. /* 304 */,
  32980. /* 305 */,
  32981. /* 306 */,
  32982. /* 307 */,
  32983. /* 308 */,
  32984. /* 309 */,
  32985. /* 310 */,
  32986. /* 311 */,
  32987. /* 312 */,
  32988. /* 313 */,
  32989. /* 314 */,
  32990. /* 315 */,
  32991. /* 316 */,
  32992. /* 317 */,
  32993. /* 318 */,
  32994. /* 319 */
  32995. /*!*****************************************************************************************!*\
  32996. !*** D:/code/work/broke_news_wx/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  32997. \*****************************************************************************************/
  32998. /*! no static exports found */
  32999. /***/ (function(module, exports, __webpack_require__) {
  33000. "use strict";
  33001. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}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 } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];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);return Constructor;}var pattern = {
  33002. email: /^\S+?@\S+?\.\S+?$/,
  33003. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  33004. url: new RegExp(
  33005. "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
  33006. 'i') };
  33007. var FORMAT_MAPPING = {
  33008. "int": 'integer',
  33009. "bool": 'boolean',
  33010. "double": 'number',
  33011. "long": 'number',
  33012. "password": 'string'
  33013. // "fileurls": 'array'
  33014. };
  33015. function formatMessage(args) {var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  33016. var defaultMessage = ['label'];
  33017. defaultMessage.forEach(function (item) {
  33018. if (args[item] === undefined) {
  33019. args[item] = '';
  33020. }
  33021. });
  33022. var str = resources;
  33023. for (var key in args) {
  33024. var reg = new RegExp('{' + key + '}');
  33025. str = str.replace(reg, args[key]);
  33026. }
  33027. return str;
  33028. }
  33029. function isEmptyValue(value, type) {
  33030. if (value === undefined || value === null) {
  33031. return true;
  33032. }
  33033. if (typeof value === 'string' && !value) {
  33034. return true;
  33035. }
  33036. if (Array.isArray(value) && !value.length) {
  33037. return true;
  33038. }
  33039. if (type === 'object' && !Object.keys(value).length) {
  33040. return true;
  33041. }
  33042. return false;
  33043. }
  33044. var types = {
  33045. integer: function integer(value) {
  33046. return types.number(value) && parseInt(value, 10) === value;
  33047. },
  33048. string: function string(value) {
  33049. return typeof value === 'string';
  33050. },
  33051. number: function number(value) {
  33052. if (isNaN(value)) {
  33053. return false;
  33054. }
  33055. return typeof value === 'number';
  33056. },
  33057. "boolean": function boolean(value) {
  33058. return typeof value === 'boolean';
  33059. },
  33060. "float": function float(value) {
  33061. return types.number(value) && !types.integer(value);
  33062. },
  33063. array: function array(value) {
  33064. return Array.isArray(value);
  33065. },
  33066. object: function object(value) {
  33067. return typeof value === 'object' && !types.array(value);
  33068. },
  33069. date: function date(value) {
  33070. return value instanceof Date;
  33071. },
  33072. timestamp: function timestamp(value) {
  33073. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  33074. return false;
  33075. }
  33076. return true;
  33077. },
  33078. file: function file(value) {
  33079. return typeof value.url === 'string';
  33080. },
  33081. email: function email(value) {
  33082. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  33083. },
  33084. url: function url(value) {
  33085. return typeof value === 'string' && !!value.match(pattern.url);
  33086. },
  33087. pattern: function pattern(reg, value) {
  33088. try {
  33089. return new RegExp(reg).test(value);
  33090. } catch (e) {
  33091. return false;
  33092. }
  33093. },
  33094. method: function method(value) {
  33095. return typeof value === 'function';
  33096. },
  33097. idcard: function idcard(value) {
  33098. return typeof value === 'string' && !!value.match(pattern.idcard);
  33099. },
  33100. 'url-https': function urlHttps(value) {
  33101. return this.url(value) && value.startsWith('https://');
  33102. },
  33103. 'url-scheme': function urlScheme(value) {
  33104. return value.startsWith('://');
  33105. },
  33106. 'url-web': function urlWeb(value) {
  33107. return false;
  33108. } };var
  33109. RuleValidator = /*#__PURE__*/function () {
  33110. function RuleValidator(message) {_classCallCheck(this, RuleValidator);
  33111. this._message = message;
  33112. }_createClass(RuleValidator, [{ key: "validateRule", value: function () {var _validateRule = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(
  33113. fieldKey, fieldValue, value, data, allData) {var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  33114. result = null;
  33115. rules = fieldValue.rules;
  33116. hasRequired = rules.findIndex(function (item) {
  33117. return item.required;
  33118. });if (!(
  33119. hasRequired < 0)) {_context.next = 8;break;}if (!(
  33120. value === null || value === undefined)) {_context.next = 6;break;}return _context.abrupt("return",
  33121. result);case 6:if (!(
  33122. typeof value === 'string' && !value.length)) {_context.next = 8;break;}return _context.abrupt("return",
  33123. result);case 8:
  33124. message = this._message;if (!(
  33125. rules === undefined)) {_context.next = 11;break;}return _context.abrupt("return",
  33126. message['default']);case 11:
  33127. i = 0;case 12:if (!(i < rules.length)) {_context.next = 35;break;}
  33128. rule = rules[i];
  33129. vt = this._getValidateType(rule);
  33130. Object.assign(rule, {
  33131. label: fieldValue.label || "[\"".concat(fieldKey, "\"]") });if (!
  33132. RuleValidatorHelper[vt]) {_context.next = 20;break;}
  33133. result = RuleValidatorHelper[vt](rule, value, message);if (!(
  33134. result != null)) {_context.next = 20;break;}return _context.abrupt("break", 35);case 20:if (!
  33135. rule.validateExpr) {_context.next = 26;break;}
  33136. now = Date.now();
  33137. resultExpr = rule.validateExpr(value, allData, now);if (!(
  33138. resultExpr === false)) {_context.next = 26;break;}
  33139. result = this._getMessage(rule, rule.errorMessage || this._message['default']);return _context.abrupt("break", 35);case 26:if (!
  33140. rule.validateFunction) {_context.next = 32;break;}_context.next = 29;return (
  33141. this.validateFunction(rule, value, data, allData, vt));case 29:result = _context.sent;if (!(
  33142. result !== null)) {_context.next = 32;break;}return _context.abrupt("break", 35);case 32:i++;_context.next = 12;break;case 35:
  33143. if (result !== null) {
  33144. result = message.TAG + result;
  33145. }return _context.abrupt("return",
  33146. result);case 37:case "end":return _context.stop();}}}, _callee, this);}));function validateRule(_x, _x2, _x3, _x4, _x5) {return _validateRule.apply(this, arguments);}return validateRule;}() }, { key: "validateFunction", value: function () {var _validateFunction = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(
  33147. rule, value, data, allData, vt) {var result, callbackMessage, res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  33148. result = null;_context2.prev = 1;
  33149. callbackMessage = null;_context2.next = 5;return (
  33150. rule.validateFunction(rule, value, allData || data, function (message) {
  33151. callbackMessage = message;
  33152. }));case 5:res = _context2.sent;
  33153. if (callbackMessage || typeof res === 'string' && res || res === false) {
  33154. result = this._getMessage(rule, callbackMessage || res, vt);
  33155. }_context2.next = 12;break;case 9:_context2.prev = 9;_context2.t0 = _context2["catch"](1);
  33156. result = this._getMessage(rule, _context2.t0.message, vt);case 12:return _context2.abrupt("return",
  33157. result);case 13:case "end":return _context2.stop();}}}, _callee2, this, [[1, 9]]);}));function validateFunction(_x6, _x7, _x8, _x9, _x10) {return _validateFunction.apply(this, arguments);}return validateFunction;}() }, { key: "_getMessage", value: function _getMessage(
  33158. rule, message, vt) {
  33159. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  33160. } }, { key: "_getValidateType", value: function _getValidateType(
  33161. rule) {
  33162. var result = '';
  33163. if (rule.required) {
  33164. result = 'required';
  33165. } else if (rule.format) {
  33166. result = 'format';
  33167. } else if (rule.arrayType) {
  33168. result = 'arrayTypeFormat';
  33169. } else if (rule.range) {
  33170. result = 'range';
  33171. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  33172. result = 'rangeNumber';
  33173. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  33174. result = 'rangeLength';
  33175. } else if (rule.pattern) {
  33176. result = 'pattern';
  33177. } else if (rule.validateFunction) {
  33178. result = 'validateFunction';
  33179. }
  33180. return result;
  33181. } }]);return RuleValidator;}();
  33182. var RuleValidatorHelper = {
  33183. required: function required(rule, value, message) {
  33184. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  33185. return formatMessage(rule, rule.errorMessage || message.required);
  33186. }
  33187. return null;
  33188. },
  33189. range: function range(rule, value, message) {var
  33190. range =
  33191. rule.range,errorMessage = rule.errorMessage;
  33192. var list = new Array(range.length);
  33193. for (var i = 0; i < range.length; i++) {
  33194. var item = range[i];
  33195. if (types.object(item) && item.value !== undefined) {
  33196. list[i] = item.value;
  33197. } else {
  33198. list[i] = item;
  33199. }
  33200. }
  33201. var result = false;
  33202. if (Array.isArray(value)) {
  33203. result = new Set(value.concat(list)).size === list.length;
  33204. } else {
  33205. if (list.indexOf(value) > -1) {
  33206. result = true;
  33207. }
  33208. }
  33209. if (!result) {
  33210. return formatMessage(rule, errorMessage || message['enum']);
  33211. }
  33212. return null;
  33213. },
  33214. rangeNumber: function rangeNumber(rule, value, message) {
  33215. if (!types.number(value)) {
  33216. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33217. }var
  33218. minimum =
  33219. rule.minimum,maximum = rule.maximum,exclusiveMinimum = rule.exclusiveMinimum,exclusiveMaximum = rule.exclusiveMaximum;
  33220. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  33221. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  33222. if (minimum !== undefined && min) {
  33223. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
  33224. 'exclusiveMinimum' : 'minimum']);
  33225. } else if (maximum !== undefined && max) {
  33226. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
  33227. 'exclusiveMaximum' : 'maximum']);
  33228. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  33229. return formatMessage(rule, rule.errorMessage || message['number'].range);
  33230. }
  33231. return null;
  33232. },
  33233. rangeLength: function rangeLength(rule, value, message) {
  33234. if (!types.string(value) && !types.array(value)) {
  33235. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33236. }
  33237. var min = rule.minLength;
  33238. var max = rule.maxLength;
  33239. var val = value.length;
  33240. if (min !== undefined && val < min) {
  33241. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  33242. } else if (max !== undefined && val > max) {
  33243. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  33244. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  33245. return formatMessage(rule, rule.errorMessage || message['length'].range);
  33246. }
  33247. return null;
  33248. },
  33249. pattern: function pattern(rule, value, message) {
  33250. if (!types['pattern'](rule.pattern, value)) {
  33251. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33252. }
  33253. return null;
  33254. },
  33255. format: function format(rule, value, message) {
  33256. var customTypes = Object.keys(types);
  33257. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  33258. if (customTypes.indexOf(format) > -1) {
  33259. if (!types[format](value)) {
  33260. return formatMessage(rule, rule.errorMessage || message.typeError);
  33261. }
  33262. }
  33263. return null;
  33264. },
  33265. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  33266. if (!Array.isArray(value)) {
  33267. return formatMessage(rule, rule.errorMessage || message.typeError);
  33268. }
  33269. for (var i = 0; i < value.length; i++) {
  33270. var element = value[i];
  33271. var formatResult = this.format(rule, element, message);
  33272. if (formatResult !== null) {
  33273. return formatResult;
  33274. }
  33275. }
  33276. return null;
  33277. } };var
  33278. SchemaValidator = /*#__PURE__*/function (_RuleValidator) {_inherits(SchemaValidator, _RuleValidator);var _super = _createSuper(SchemaValidator);
  33279. function SchemaValidator(schema, options) {var _this;_classCallCheck(this, SchemaValidator);
  33280. _this = _super.call(this, SchemaValidator.message);
  33281. _this._schema = schema;
  33282. _this._options = options || null;return _this;
  33283. }_createClass(SchemaValidator, [{ key: "updateSchema", value: function updateSchema(
  33284. schema) {
  33285. this._schema = schema;
  33286. } }, { key: "validate", value: function () {var _validate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(
  33287. data, allData) {var result;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
  33288. result = this._checkFieldInSchema(data);if (
  33289. result) {_context3.next = 5;break;}_context3.next = 4;return (
  33290. this.invokeValidate(data, false, allData));case 4:result = _context3.sent;case 5:return _context3.abrupt("return",
  33291. result.length ? result[0] : null);case 6:case "end":return _context3.stop();}}}, _callee3, this);}));function validate(_x11, _x12) {return _validate.apply(this, arguments);}return validate;}() }, { key: "validateAll", value: function () {var _validateAll = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(
  33292. data, allData) {var result;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
  33293. result = this._checkFieldInSchema(data);if (
  33294. result) {_context4.next = 5;break;}_context4.next = 4;return (
  33295. this.invokeValidate(data, true, allData));case 4:result = _context4.sent;case 5:return _context4.abrupt("return",
  33296. result);case 6:case "end":return _context4.stop();}}}, _callee4, this);}));function validateAll(_x13, _x14) {return _validateAll.apply(this, arguments);}return validateAll;}() }, { key: "validateUpdate", value: function () {var _validateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(
  33297. data, allData) {var result;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:
  33298. result = this._checkFieldInSchema(data);if (
  33299. result) {_context5.next = 5;break;}_context5.next = 4;return (
  33300. this.invokeValidateUpdate(data, false, allData));case 4:result = _context5.sent;case 5:return _context5.abrupt("return",
  33301. result.length ? result[0] : null);case 6:case "end":return _context5.stop();}}}, _callee5, this);}));function validateUpdate(_x15, _x16) {return _validateUpdate.apply(this, arguments);}return validateUpdate;}() }, { key: "invokeValidate", value: function () {var _invokeValidate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6(
  33302. data, all, allData) {var result, schema, key, value, errorMessage;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:
  33303. result = [];
  33304. schema = this._schema;_context6.t0 = _regenerator.default.keys(
  33305. schema);case 3:if ((_context6.t1 = _context6.t0()).done) {_context6.next = 15;break;}key = _context6.t1.value;
  33306. value = schema[key];_context6.next = 8;return (
  33307. this.validateRule(key, value, data[key], data, allData));case 8:errorMessage = _context6.sent;if (!(
  33308. errorMessage != null)) {_context6.next = 13;break;}
  33309. result.push({
  33310. key: key,
  33311. errorMessage: errorMessage });if (
  33312. all) {_context6.next = 13;break;}return _context6.abrupt("break", 15);case 13:_context6.next = 3;break;case 15:return _context6.abrupt("return",
  33313. result);case 16:case "end":return _context6.stop();}}}, _callee6, this);}));function invokeValidate(_x17, _x18, _x19) {return _invokeValidate.apply(this, arguments);}return invokeValidate;}() }, { key: "invokeValidateUpdate", value: function () {var _invokeValidateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(
  33314. data, all, allData) {var result, key, errorMessage;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:
  33315. result = [];_context7.t0 = _regenerator.default.keys(
  33316. data);case 2:if ((_context7.t1 = _context7.t0()).done) {_context7.next = 13;break;}key = _context7.t1.value;_context7.next = 6;return (
  33317. this.validateRule(key, this._schema[key], data[key], data, allData));case 6:errorMessage = _context7.sent;if (!(
  33318. errorMessage != null)) {_context7.next = 11;break;}
  33319. result.push({
  33320. key: key,
  33321. errorMessage: errorMessage });if (
  33322. all) {_context7.next = 11;break;}return _context7.abrupt("break", 13);case 11:_context7.next = 2;break;case 13:return _context7.abrupt("return",
  33323. result);case 14:case "end":return _context7.stop();}}}, _callee7, this);}));function invokeValidateUpdate(_x20, _x21, _x22) {return _invokeValidateUpdate.apply(this, arguments);}return invokeValidateUpdate;}() }, { key: "_checkFieldInSchema", value: function _checkFieldInSchema(
  33324. data) {
  33325. var keys = Object.keys(data);
  33326. var keys2 = Object.keys(this._schema);
  33327. if (new Set(keys.concat(keys2)).size === keys2.length) {
  33328. return '';
  33329. }
  33330. var noExistFields = keys.filter(function (key) {
  33331. return keys2.indexOf(key) < 0;
  33332. });
  33333. var errorMessage = formatMessage({
  33334. field: JSON.stringify(noExistFields) },
  33335. SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  33336. return [{
  33337. key: 'invalid',
  33338. errorMessage: errorMessage }];
  33339. } }]);return SchemaValidator;}(RuleValidator);
  33340. function Message() {
  33341. return {
  33342. TAG: "",
  33343. default: '验证错误',
  33344. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  33345. validateFunction: '验证无效',
  33346. required: '{label}必填',
  33347. 'enum': '{label}超出范围',
  33348. timestamp: '{label}格式无效',
  33349. whitespace: '{label}不能为空',
  33350. typeError: '{label}类型无效',
  33351. date: {
  33352. format: '{label}日期{value}格式无效',
  33353. parse: '{label}日期无法解析,{value}无效',
  33354. invalid: '{label}日期{value}无效' },
  33355. length: {
  33356. minLength: '{label}长度不能少于{minLength}',
  33357. maxLength: '{label}长度不能超过{maxLength}',
  33358. range: '{label}必须介于{minLength}和{maxLength}之间' },
  33359. number: {
  33360. minimum: '{label}不能小于{minimum}',
  33361. maximum: '{label}不能大于{maximum}',
  33362. exclusiveMinimum: '{label}不能小于等于{minimum}',
  33363. exclusiveMaximum: '{label}不能大于等于{maximum}',
  33364. range: '{label}必须介于{minimum}and{maximum}之间' },
  33365. pattern: {
  33366. mismatch: '{label}格式不匹配' } };
  33367. }
  33368. SchemaValidator.message = new Message();var _default =
  33369. SchemaValidator;exports.default = _default;
  33370. /***/ }),
  33371. /* 320 */,
  33372. /* 321 */,
  33373. /* 322 */,
  33374. /* 323 */,
  33375. /* 324 */,
  33376. /* 325 */,
  33377. /* 326 */,
  33378. /* 327 */,
  33379. /* 328 */,
  33380. /* 329 */,
  33381. /* 330 */,
  33382. /* 331 */,
  33383. /* 332 */,
  33384. /* 333 */,
  33385. /* 334 */,
  33386. /* 335 */,
  33387. /* 336 */,
  33388. /* 337 */,
  33389. /* 338 */,
  33390. /* 339 */,
  33391. /* 340 */,
  33392. /* 341 */
  33393. /*!***************************************************!*\
  33394. !*** D:/code/work/broke_news_wx/utils/bmap-wx.js ***!
  33395. \***************************************************/
  33396. /*! no static exports found */
  33397. /***/ (function(module, exports) {
  33398. function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];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);return Constructor;} /**
  33399. * @file 微信小程序JSAPI
  33400. * @author 崔健 cuijian03@baidu.com 2017.01.10
  33401. * @update 邓淑芳 623996689@qq.com 2019.07.03
  33402. */
  33403. /**
  33404. * 百度地图微信小程序API类
  33405. *
  33406. * @class
  33407. */var
  33408. BMapWX = /*#__PURE__*/function () {"use strict";
  33409. /**
  33410. * 百度地图微信小程序API类
  33411. *
  33412. * @constructor
  33413. */
  33414. function BMapWX(param) {_classCallCheck(this, BMapWX);
  33415. this.ak = param["ak"];
  33416. }
  33417. /**
  33418. * 使用微信接口进行定位
  33419. *
  33420. * @param {string} type 坐标类型
  33421. * @param {Function} success 成功执行
  33422. * @param {Function} fail 失败执行
  33423. * @param {Function} complete 完成后执行
  33424. */_createClass(BMapWX, [{ key: "getWXLocation", value: function getWXLocation(
  33425. type, success, fail, complete) {
  33426. type = type || 'gcj02',
  33427. success = success || function () {};
  33428. fail = fail || function () {};
  33429. complete = complete || function () {};
  33430. // wx.getLocation({
  33431. // type: type,
  33432. // success: success,
  33433. // fail: fail,
  33434. // complete: complete
  33435. // });
  33436. wx.getFuzzyLocation({
  33437. type: type,
  33438. success: success,
  33439. fail: fail,
  33440. complete: complete });
  33441. }
  33442. /**
  33443. * POI周边检索
  33444. *
  33445. * @param {Object} param 检索配置
  33446. * 参数对象结构可以参考
  33447. * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
  33448. */ }, { key: "search", value: function search(
  33449. param) {
  33450. var that = this;
  33451. param = param || {};
  33452. var searchparam = {
  33453. query: param["query"] || '生活服务$美食&酒店',
  33454. scope: param["scope"] || 1,
  33455. filter: param["filter"] || '',
  33456. coord_type: param["coord_type"] || 2,
  33457. page_size: param["page_size"] || 10,
  33458. page_num: param["page_num"] || 0,
  33459. output: param["output"] || 'json',
  33460. ak: that.ak,
  33461. sn: param["sn"] || '',
  33462. timestamp: param["timestamp"] || '',
  33463. radius: param["radius"] || 2000,
  33464. ret_coordtype: 'gcj02ll' };
  33465. var otherparam = {
  33466. iconPath: param["iconPath"],
  33467. iconTapPath: param["iconTapPath"],
  33468. width: param["width"],
  33469. height: param["height"],
  33470. alpha: param["alpha"] || 1,
  33471. success: param["success"] || function () {},
  33472. fail: param["fail"] || function () {} };
  33473. var type = 'gcj02';
  33474. var locationsuccess = function locationsuccess(result) {
  33475. searchparam["location"] = result["latitude"] + ',' + result["longitude"];
  33476. wx.request({
  33477. url: 'https://api.map.baidu.com/place/v2/search',
  33478. data: searchparam,
  33479. header: {
  33480. "content-type": "application/json" },
  33481. method: 'GET',
  33482. success: function success(data) {
  33483. var res = data["data"];
  33484. if (res["status"] === 0) {
  33485. var poiArr = res["results"];
  33486. // outputRes 包含两个对象,
  33487. // originalData为百度接口返回的原始数据
  33488. // wxMarkerData为小程序规范的marker格式
  33489. var outputRes = {};
  33490. outputRes["originalData"] = res;
  33491. outputRes["wxMarkerData"] = [];
  33492. for (var i = 0; i < poiArr.length; i++) {
  33493. outputRes["wxMarkerData"][i] = {
  33494. id: i,
  33495. latitude: poiArr[i]["location"]["lat"],
  33496. longitude: poiArr[i]["location"]["lng"],
  33497. title: poiArr[i]["name"],
  33498. iconPath: otherparam["iconPath"],
  33499. iconTapPath: otherparam["iconTapPath"],
  33500. address: poiArr[i]["address"],
  33501. telephone: poiArr[i]["telephone"],
  33502. alpha: otherparam["alpha"],
  33503. width: otherparam["width"],
  33504. height: otherparam["height"] };
  33505. }
  33506. otherparam.success(outputRes);
  33507. } else {
  33508. otherparam.fail({
  33509. errMsg: res["message"],
  33510. statusCode: res["status"] });
  33511. }
  33512. },
  33513. fail: function fail(data) {
  33514. otherparam.fail(data);
  33515. } });
  33516. };
  33517. var locationfail = function locationfail(result) {
  33518. otherparam.fail(result);
  33519. };
  33520. var locationcomplete = function locationcomplete(result) {};
  33521. if (!param["location"]) {
  33522. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33523. } else {
  33524. var longitude = param.location.split(',')[1];
  33525. var latitude = param.location.split(',')[0];
  33526. var errMsg = 'input location';
  33527. var res = {
  33528. errMsg: errMsg,
  33529. latitude: latitude,
  33530. longitude: longitude };
  33531. locationsuccess(res);
  33532. }
  33533. }
  33534. /**
  33535. * sug模糊检索
  33536. *
  33537. * @param {Object} param 检索配置
  33538. * 参数对象结构可以参考
  33539. * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
  33540. */ }, { key: "suggestion", value: function suggestion(
  33541. param) {
  33542. var that = this;
  33543. param = param || {};
  33544. var suggestionparam = {
  33545. query: param["query"] || '',
  33546. region: param["region"] || '全国',
  33547. city_limit: param["city_limit"] || false,
  33548. output: param["output"] || 'json',
  33549. ak: that.ak,
  33550. sn: param["sn"] || '',
  33551. timestamp: param["timestamp"] || '',
  33552. ret_coordtype: 'gcj02ll' };
  33553. var otherparam = {
  33554. success: param["success"] || function () {},
  33555. fail: param["fail"] || function () {} };
  33556. wx.request({
  33557. url: 'https://api.map.baidu.com/place/v2/suggestion',
  33558. data: suggestionparam,
  33559. header: {
  33560. "content-type": "application/json" },
  33561. method: 'GET',
  33562. success: function success(data) {
  33563. var res = data["data"];
  33564. if (res["status"] === 0) {
  33565. otherparam.success(res);
  33566. } else {
  33567. otherparam.fail({
  33568. errMsg: res["message"],
  33569. statusCode: res["status"] });
  33570. }
  33571. },
  33572. fail: function fail(data) {
  33573. otherparam.fail(data);
  33574. } });
  33575. }
  33576. /**
  33577. * rgc检索(逆地理编码:经纬度->地点描述)
  33578. *
  33579. * @param {Object} param 检索配置
  33580. * 参数对象结构可以参考
  33581. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
  33582. *
  33583. */ }, { key: "regeocoding", value: function regeocoding(
  33584. param) {
  33585. var that = this;
  33586. param = param || {};
  33587. var regeocodingparam = {
  33588. coordtype: param["coordtype"] || 'gcj02ll',
  33589. ret_coordtype: 'gcj02ll',
  33590. radius: param["radius"] || 1000,
  33591. ak: that.ak,
  33592. sn: param["sn"] || '',
  33593. output: param["output"] || 'json',
  33594. callback: param["callback"] || function () {},
  33595. extensions_poi: param["extensions_poi"] || 1,
  33596. extensions_road: param["extensions_road"] || false,
  33597. extensions_town: param["extensions_town"] || false,
  33598. language: param["language"] || 'zh-CN',
  33599. language_auto: param["language_auto"] || 0 };
  33600. var otherparam = {
  33601. iconPath: param["iconPath"],
  33602. iconTapPath: param["iconTapPath"],
  33603. width: param["width"],
  33604. height: param["height"],
  33605. alpha: param["alpha"] || 1,
  33606. success: param["success"] || function () {},
  33607. fail: param["fail"] || function () {} };
  33608. var type = 'gcj02';
  33609. var locationsuccess = function locationsuccess(result) {
  33610. regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
  33611. wx.request({
  33612. url: 'https://api.map.baidu.com/reverse_geocoding/v3',
  33613. data: regeocodingparam,
  33614. header: {
  33615. "content-type": "application/json" },
  33616. method: 'GET',
  33617. success: function success(data) {
  33618. var res = data["data"];
  33619. if (res["status"] === 0) {
  33620. var poiObj = res["result"];
  33621. // outputRes 包含两个对象:
  33622. // originalData为百度接口返回的原始数据
  33623. // wxMarkerData为小程序规范的marker格式
  33624. var outputRes = {};
  33625. outputRes["originalData"] = res;
  33626. outputRes["wxMarkerData"] = [];
  33627. outputRes["wxMarkerData"][0] = {
  33628. id: 0,
  33629. latitude: result["latitude"],
  33630. longitude: result["longitude"],
  33631. address: poiObj["formatted_address"],
  33632. iconPath: otherparam["iconPath"],
  33633. iconTapPath: otherparam["iconTapPath"],
  33634. desc: poiObj["sematic_description"],
  33635. business: poiObj["business"],
  33636. alpha: otherparam["alpha"],
  33637. width: otherparam["width"],
  33638. height: otherparam["height"] };
  33639. otherparam.success(outputRes);
  33640. } else {
  33641. otherparam.fail({
  33642. errMsg: res["message"],
  33643. statusCode: res["status"] });
  33644. }
  33645. },
  33646. fail: function fail(data) {
  33647. otherparam.fail(data);
  33648. } });
  33649. };
  33650. var locationfail = function locationfail(result) {
  33651. otherparam.fail(result);
  33652. };
  33653. var locationcomplete = function locationcomplete(result) {};
  33654. if (!param["location"]) {
  33655. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33656. } else {
  33657. var longitude = param.location.split(',')[1];
  33658. var latitude = param.location.split(',')[0];
  33659. var errMsg = 'input location';
  33660. var res = {
  33661. errMsg: errMsg,
  33662. latitude: latitude,
  33663. longitude: longitude };
  33664. locationsuccess(res);
  33665. }
  33666. }
  33667. /**
  33668. * gc检索(地理编码:地点->经纬度)
  33669. *
  33670. * @param {Object} param 检索配置
  33671. * 参数对象结构可以参考
  33672. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
  33673. *
  33674. */ }, { key: "geocoding", value: function geocoding(
  33675. param) {
  33676. var that = this;
  33677. param = param || {};
  33678. var geocodingparam = {
  33679. address: param["address"] || '',
  33680. city: param["city"] || '',
  33681. ret_coordtype: param["coordtype"] || 'gcj02ll',
  33682. ak: that.ak,
  33683. sn: param["sn"] || '',
  33684. output: param["output"] || 'json',
  33685. callback: param["callback"] || function () {} };
  33686. var otherparam = {
  33687. iconPath: param["iconPath"],
  33688. iconTapPath: param["iconTapPath"],
  33689. width: param["width"],
  33690. height: param["height"],
  33691. alpha: param["alpha"] || 1,
  33692. success: param["success"] || function () {},
  33693. fail: param["fail"] || function () {} };
  33694. if (param["address"]) {
  33695. wx.request({
  33696. url: 'https://api.map.baidu.com/geocoding/v3',
  33697. data: geocodingparam,
  33698. header: {
  33699. "content-type": "application/json" },
  33700. method: 'GET',
  33701. success: function success(data) {
  33702. var res = data["data"];
  33703. if (res["status"] === 0) {
  33704. var poiObj = res["result"];
  33705. // outputRes 包含两个对象:
  33706. // originalData为百度接口返回的原始数据
  33707. // wxMarkerData为小程序规范的marker格式
  33708. var outputRes = res;
  33709. outputRes["originalData"] = res;
  33710. outputRes["wxMarkerData"] = [];
  33711. outputRes["wxMarkerData"][0] = {
  33712. id: 0,
  33713. latitude: poiObj["location"]["lat"],
  33714. longitude: poiObj["location"]["lng"],
  33715. iconPath: otherparam["iconPath"],
  33716. iconTapPath: otherparam["iconTapPath"],
  33717. alpha: otherparam["alpha"],
  33718. width: otherparam["width"],
  33719. height: otherparam["height"] };
  33720. otherparam.success(outputRes);
  33721. } else {
  33722. otherparam.fail({
  33723. errMsg: res["message"],
  33724. statusCode: res["status"] });
  33725. }
  33726. },
  33727. fail: function fail(data) {
  33728. otherparam.fail(data);
  33729. } });
  33730. } else {
  33731. var errMsg = 'input address!';
  33732. var res = {
  33733. errMsg: errMsg };
  33734. otherparam.fail(res);
  33735. }
  33736. }
  33737. /**
  33738. * 天气检索
  33739. *
  33740. * @param {Object} param 检索配置
  33741. */ }, { key: "weather", value: function weather(
  33742. param) {
  33743. var that = this;
  33744. param = param || {};
  33745. var weatherparam = {
  33746. coord_type: param["coord_type"] || 'gcj02',
  33747. output: param["output"] || 'json',
  33748. ak: that.ak,
  33749. sn: param["sn"] || '',
  33750. timestamp: param["timestamp"] || '' };
  33751. var otherparam = {
  33752. success: param["success"] || function () {},
  33753. fail: param["fail"] || function () {} };
  33754. var type = 'gcj02';
  33755. var locationsuccess = function locationsuccess(result) {
  33756. weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
  33757. wx.request({
  33758. url: 'https://api.map.baidu.com/telematics/v3/weather',
  33759. data: weatherparam,
  33760. header: {
  33761. "content-type": "application/json" },
  33762. method: 'GET',
  33763. success: function success(data) {
  33764. var res = data["data"];
  33765. if (res["error"] === 0 && res["status"] === 'success') {
  33766. var weatherArr = res["results"];
  33767. // outputRes 包含两个对象,
  33768. // originalData为百度接口返回的原始数据
  33769. // wxMarkerData为小程序规范的marker格式
  33770. var outputRes = {};
  33771. outputRes["originalData"] = res;
  33772. outputRes["currentWeather"] = [];
  33773. outputRes["currentWeather"][0] = {
  33774. currentCity: weatherArr[0]["currentCity"],
  33775. pm25: weatherArr[0]["pm25"],
  33776. date: weatherArr[0]["weather_data"][0]["date"],
  33777. temperature: weatherArr[0]["weather_data"][0]["temperature"],
  33778. weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
  33779. wind: weatherArr[0]["weather_data"][0]["wind"] };
  33780. otherparam.success(outputRes);
  33781. } else {
  33782. otherparam.fail({
  33783. errMsg: res["message"],
  33784. statusCode: res["status"] });
  33785. }
  33786. },
  33787. fail: function fail(data) {
  33788. otherparam.fail(data);
  33789. } });
  33790. };
  33791. var locationfail = function locationfail(result) {
  33792. otherparam.fail(result);
  33793. };
  33794. var locationcomplete = function locationcomplete(result) {};
  33795. if (!param["location"]) {
  33796. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33797. } else {
  33798. var longitude = param.location.split(',')[0];
  33799. var latitude = param.location.split(',')[1];
  33800. var errMsg = 'input location';
  33801. var res = {
  33802. errMsg: errMsg,
  33803. latitude: latitude,
  33804. longitude: longitude };
  33805. locationsuccess(res);
  33806. }
  33807. } }]);return BMapWX;}();
  33808. module.exports.BMapWX = BMapWX;
  33809. /***/ }),
  33810. /* 342 */,
  33811. /* 343 */,
  33812. /* 344 */,
  33813. /* 345 */,
  33814. /* 346 */,
  33815. /* 347 */,
  33816. /* 348 */,
  33817. /* 349 */,
  33818. /* 350 */,
  33819. /* 351 */,
  33820. /* 352 */,
  33821. /* 353 */,
  33822. /* 354 */,
  33823. /* 355 */,
  33824. /* 356 */,
  33825. /* 357 */,
  33826. /* 358 */,
  33827. /* 359 */,
  33828. /* 360 */,
  33829. /* 361 */,
  33830. /* 362 */,
  33831. /* 363 */,
  33832. /* 364 */,
  33833. /* 365 */,
  33834. /* 366 */,
  33835. /* 367 */,
  33836. /* 368 */,
  33837. /* 369 */,
  33838. /* 370 */,
  33839. /* 371 */,
  33840. /* 372 */,
  33841. /* 373 */,
  33842. /* 374 */,
  33843. /* 375 */,
  33844. /* 376 */,
  33845. /* 377 */
  33846. /*!**************************************************************************************!*\
  33847. !*** D:/code/work/broke_news_wx/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  33848. \**************************************************************************************/
  33849. /*! no static exports found */
  33850. /***/ (function(module, exports, __webpack_require__) {
  33851. "use strict";
  33852. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  33853. "id": "2852637",
  33854. "name": "uniui图标库",
  33855. "font_family": "uniicons",
  33856. "css_prefix_text": "uniui-",
  33857. "description": "",
  33858. "glyphs": [
  33859. {
  33860. "icon_id": "25027049",
  33861. "name": "yanse",
  33862. "font_class": "color",
  33863. "unicode": "e6cf",
  33864. "unicode_decimal": 59087 },
  33865. {
  33866. "icon_id": "25027048",
  33867. "name": "wallet",
  33868. "font_class": "wallet",
  33869. "unicode": "e6b1",
  33870. "unicode_decimal": 59057 },
  33871. {
  33872. "icon_id": "25015720",
  33873. "name": "settings-filled",
  33874. "font_class": "settings-filled",
  33875. "unicode": "e6ce",
  33876. "unicode_decimal": 59086 },
  33877. {
  33878. "icon_id": "25015434",
  33879. "name": "shimingrenzheng-filled",
  33880. "font_class": "auth-filled",
  33881. "unicode": "e6cc",
  33882. "unicode_decimal": 59084 },
  33883. {
  33884. "icon_id": "24934246",
  33885. "name": "shop-filled",
  33886. "font_class": "shop-filled",
  33887. "unicode": "e6cd",
  33888. "unicode_decimal": 59085 },
  33889. {
  33890. "icon_id": "24934159",
  33891. "name": "staff-filled-01",
  33892. "font_class": "staff-filled",
  33893. "unicode": "e6cb",
  33894. "unicode_decimal": 59083 },
  33895. {
  33896. "icon_id": "24932461",
  33897. "name": "VIP-filled",
  33898. "font_class": "vip-filled",
  33899. "unicode": "e6c6",
  33900. "unicode_decimal": 59078 },
  33901. {
  33902. "icon_id": "24932462",
  33903. "name": "plus_circle_fill",
  33904. "font_class": "plus-filled",
  33905. "unicode": "e6c7",
  33906. "unicode_decimal": 59079 },
  33907. {
  33908. "icon_id": "24932463",
  33909. "name": "folder_add-filled",
  33910. "font_class": "folder-add-filled",
  33911. "unicode": "e6c8",
  33912. "unicode_decimal": 59080 },
  33913. {
  33914. "icon_id": "24932464",
  33915. "name": "yanse-filled",
  33916. "font_class": "color-filled",
  33917. "unicode": "e6c9",
  33918. "unicode_decimal": 59081 },
  33919. {
  33920. "icon_id": "24932465",
  33921. "name": "tune-filled",
  33922. "font_class": "tune-filled",
  33923. "unicode": "e6ca",
  33924. "unicode_decimal": 59082 },
  33925. {
  33926. "icon_id": "24932455",
  33927. "name": "a-rilidaka-filled",
  33928. "font_class": "calendar-filled",
  33929. "unicode": "e6c0",
  33930. "unicode_decimal": 59072 },
  33931. {
  33932. "icon_id": "24932456",
  33933. "name": "notification-filled",
  33934. "font_class": "notification-filled",
  33935. "unicode": "e6c1",
  33936. "unicode_decimal": 59073 },
  33937. {
  33938. "icon_id": "24932457",
  33939. "name": "wallet-filled",
  33940. "font_class": "wallet-filled",
  33941. "unicode": "e6c2",
  33942. "unicode_decimal": 59074 },
  33943. {
  33944. "icon_id": "24932458",
  33945. "name": "paihangbang-filled",
  33946. "font_class": "medal-filled",
  33947. "unicode": "e6c3",
  33948. "unicode_decimal": 59075 },
  33949. {
  33950. "icon_id": "24932459",
  33951. "name": "gift-filled",
  33952. "font_class": "gift-filled",
  33953. "unicode": "e6c4",
  33954. "unicode_decimal": 59076 },
  33955. {
  33956. "icon_id": "24932460",
  33957. "name": "fire-filled",
  33958. "font_class": "fire-filled",
  33959. "unicode": "e6c5",
  33960. "unicode_decimal": 59077 },
  33961. {
  33962. "icon_id": "24928001",
  33963. "name": "refreshempty",
  33964. "font_class": "refreshempty",
  33965. "unicode": "e6bf",
  33966. "unicode_decimal": 59071 },
  33967. {
  33968. "icon_id": "24926853",
  33969. "name": "location-ellipse",
  33970. "font_class": "location-filled",
  33971. "unicode": "e6af",
  33972. "unicode_decimal": 59055 },
  33973. {
  33974. "icon_id": "24926735",
  33975. "name": "person-filled",
  33976. "font_class": "person-filled",
  33977. "unicode": "e69d",
  33978. "unicode_decimal": 59037 },
  33979. {
  33980. "icon_id": "24926703",
  33981. "name": "personadd-filled",
  33982. "font_class": "personadd-filled",
  33983. "unicode": "e698",
  33984. "unicode_decimal": 59032 },
  33985. {
  33986. "icon_id": "24923351",
  33987. "name": "back",
  33988. "font_class": "back",
  33989. "unicode": "e6b9",
  33990. "unicode_decimal": 59065 },
  33991. {
  33992. "icon_id": "24923352",
  33993. "name": "forward",
  33994. "font_class": "forward",
  33995. "unicode": "e6ba",
  33996. "unicode_decimal": 59066 },
  33997. {
  33998. "icon_id": "24923353",
  33999. "name": "arrowthinright",
  34000. "font_class": "arrow-right",
  34001. "unicode": "e6bb",
  34002. "unicode_decimal": 59067 },
  34003. {
  34004. "icon_id": "24923353",
  34005. "name": "arrowthinright",
  34006. "font_class": "arrowthinright",
  34007. "unicode": "e6bb",
  34008. "unicode_decimal": 59067 },
  34009. {
  34010. "icon_id": "24923354",
  34011. "name": "arrowthinleft",
  34012. "font_class": "arrow-left",
  34013. "unicode": "e6bc",
  34014. "unicode_decimal": 59068 },
  34015. {
  34016. "icon_id": "24923354",
  34017. "name": "arrowthinleft",
  34018. "font_class": "arrowthinleft",
  34019. "unicode": "e6bc",
  34020. "unicode_decimal": 59068 },
  34021. {
  34022. "icon_id": "24923355",
  34023. "name": "arrowthinup",
  34024. "font_class": "arrow-up",
  34025. "unicode": "e6bd",
  34026. "unicode_decimal": 59069 },
  34027. {
  34028. "icon_id": "24923355",
  34029. "name": "arrowthinup",
  34030. "font_class": "arrowthinup",
  34031. "unicode": "e6bd",
  34032. "unicode_decimal": 59069 },
  34033. {
  34034. "icon_id": "24923356",
  34035. "name": "arrowthindown",
  34036. "font_class": "arrow-down",
  34037. "unicode": "e6be",
  34038. "unicode_decimal": 59070 },
  34039. {
  34040. "icon_id": "24923356",
  34041. "name": "arrowthindown",
  34042. "font_class": "arrowthindown",
  34043. "unicode": "e6be",
  34044. "unicode_decimal": 59070 },
  34045. {
  34046. "icon_id": "24923349",
  34047. "name": "arrowdown",
  34048. "font_class": "bottom",
  34049. "unicode": "e6b8",
  34050. "unicode_decimal": 59064 },
  34051. {
  34052. "icon_id": "24923349",
  34053. "name": "arrowdown",
  34054. "font_class": "arrowdown",
  34055. "unicode": "e6b8",
  34056. "unicode_decimal": 59064 },
  34057. {
  34058. "icon_id": "24923346",
  34059. "name": "arrowright",
  34060. "font_class": "right",
  34061. "unicode": "e6b5",
  34062. "unicode_decimal": 59061 },
  34063. {
  34064. "icon_id": "24923346",
  34065. "name": "arrowright",
  34066. "font_class": "arrowright",
  34067. "unicode": "e6b5",
  34068. "unicode_decimal": 59061 },
  34069. {
  34070. "icon_id": "24923347",
  34071. "name": "arrowup",
  34072. "font_class": "top",
  34073. "unicode": "e6b6",
  34074. "unicode_decimal": 59062 },
  34075. {
  34076. "icon_id": "24923347",
  34077. "name": "arrowup",
  34078. "font_class": "arrowup",
  34079. "unicode": "e6b6",
  34080. "unicode_decimal": 59062 },
  34081. {
  34082. "icon_id": "24923348",
  34083. "name": "arrowleft",
  34084. "font_class": "left",
  34085. "unicode": "e6b7",
  34086. "unicode_decimal": 59063 },
  34087. {
  34088. "icon_id": "24923348",
  34089. "name": "arrowleft",
  34090. "font_class": "arrowleft",
  34091. "unicode": "e6b7",
  34092. "unicode_decimal": 59063 },
  34093. {
  34094. "icon_id": "24923334",
  34095. "name": "eye",
  34096. "font_class": "eye",
  34097. "unicode": "e651",
  34098. "unicode_decimal": 58961 },
  34099. {
  34100. "icon_id": "24923335",
  34101. "name": "eye-filled",
  34102. "font_class": "eye-filled",
  34103. "unicode": "e66a",
  34104. "unicode_decimal": 58986 },
  34105. {
  34106. "icon_id": "24923336",
  34107. "name": "eye-slash",
  34108. "font_class": "eye-slash",
  34109. "unicode": "e6b3",
  34110. "unicode_decimal": 59059 },
  34111. {
  34112. "icon_id": "24923337",
  34113. "name": "eye-slash-filled",
  34114. "font_class": "eye-slash-filled",
  34115. "unicode": "e6b4",
  34116. "unicode_decimal": 59060 },
  34117. {
  34118. "icon_id": "24923305",
  34119. "name": "info-filled",
  34120. "font_class": "info-filled",
  34121. "unicode": "e649",
  34122. "unicode_decimal": 58953 },
  34123. {
  34124. "icon_id": "24923299",
  34125. "name": "reload-01",
  34126. "font_class": "reload",
  34127. "unicode": "e6b2",
  34128. "unicode_decimal": 59058 },
  34129. {
  34130. "icon_id": "24923195",
  34131. "name": "mic_slash_fill",
  34132. "font_class": "micoff-filled",
  34133. "unicode": "e6b0",
  34134. "unicode_decimal": 59056 },
  34135. {
  34136. "icon_id": "24923165",
  34137. "name": "map-pin-ellipse",
  34138. "font_class": "map-pin-ellipse",
  34139. "unicode": "e6ac",
  34140. "unicode_decimal": 59052 },
  34141. {
  34142. "icon_id": "24923166",
  34143. "name": "map-pin",
  34144. "font_class": "map-pin",
  34145. "unicode": "e6ad",
  34146. "unicode_decimal": 59053 },
  34147. {
  34148. "icon_id": "24923167",
  34149. "name": "location",
  34150. "font_class": "location",
  34151. "unicode": "e6ae",
  34152. "unicode_decimal": 59054 },
  34153. {
  34154. "icon_id": "24923064",
  34155. "name": "starhalf",
  34156. "font_class": "starhalf",
  34157. "unicode": "e683",
  34158. "unicode_decimal": 59011 },
  34159. {
  34160. "icon_id": "24923065",
  34161. "name": "star",
  34162. "font_class": "star",
  34163. "unicode": "e688",
  34164. "unicode_decimal": 59016 },
  34165. {
  34166. "icon_id": "24923066",
  34167. "name": "star-filled",
  34168. "font_class": "star-filled",
  34169. "unicode": "e68f",
  34170. "unicode_decimal": 59023 },
  34171. {
  34172. "icon_id": "24899646",
  34173. "name": "a-rilidaka",
  34174. "font_class": "calendar",
  34175. "unicode": "e6a0",
  34176. "unicode_decimal": 59040 },
  34177. {
  34178. "icon_id": "24899647",
  34179. "name": "fire",
  34180. "font_class": "fire",
  34181. "unicode": "e6a1",
  34182. "unicode_decimal": 59041 },
  34183. {
  34184. "icon_id": "24899648",
  34185. "name": "paihangbang",
  34186. "font_class": "medal",
  34187. "unicode": "e6a2",
  34188. "unicode_decimal": 59042 },
  34189. {
  34190. "icon_id": "24899649",
  34191. "name": "font",
  34192. "font_class": "font",
  34193. "unicode": "e6a3",
  34194. "unicode_decimal": 59043 },
  34195. {
  34196. "icon_id": "24899650",
  34197. "name": "gift",
  34198. "font_class": "gift",
  34199. "unicode": "e6a4",
  34200. "unicode_decimal": 59044 },
  34201. {
  34202. "icon_id": "24899651",
  34203. "name": "link",
  34204. "font_class": "link",
  34205. "unicode": "e6a5",
  34206. "unicode_decimal": 59045 },
  34207. {
  34208. "icon_id": "24899652",
  34209. "name": "notification",
  34210. "font_class": "notification",
  34211. "unicode": "e6a6",
  34212. "unicode_decimal": 59046 },
  34213. {
  34214. "icon_id": "24899653",
  34215. "name": "staff",
  34216. "font_class": "staff",
  34217. "unicode": "e6a7",
  34218. "unicode_decimal": 59047 },
  34219. {
  34220. "icon_id": "24899654",
  34221. "name": "VIP",
  34222. "font_class": "vip",
  34223. "unicode": "e6a8",
  34224. "unicode_decimal": 59048 },
  34225. {
  34226. "icon_id": "24899655",
  34227. "name": "folder_add",
  34228. "font_class": "folder-add",
  34229. "unicode": "e6a9",
  34230. "unicode_decimal": 59049 },
  34231. {
  34232. "icon_id": "24899656",
  34233. "name": "tune",
  34234. "font_class": "tune",
  34235. "unicode": "e6aa",
  34236. "unicode_decimal": 59050 },
  34237. {
  34238. "icon_id": "24899657",
  34239. "name": "shimingrenzheng",
  34240. "font_class": "auth",
  34241. "unicode": "e6ab",
  34242. "unicode_decimal": 59051 },
  34243. {
  34244. "icon_id": "24899565",
  34245. "name": "person",
  34246. "font_class": "person",
  34247. "unicode": "e699",
  34248. "unicode_decimal": 59033 },
  34249. {
  34250. "icon_id": "24899566",
  34251. "name": "email-filled",
  34252. "font_class": "email-filled",
  34253. "unicode": "e69a",
  34254. "unicode_decimal": 59034 },
  34255. {
  34256. "icon_id": "24899567",
  34257. "name": "phone-filled",
  34258. "font_class": "phone-filled",
  34259. "unicode": "e69b",
  34260. "unicode_decimal": 59035 },
  34261. {
  34262. "icon_id": "24899568",
  34263. "name": "phone",
  34264. "font_class": "phone",
  34265. "unicode": "e69c",
  34266. "unicode_decimal": 59036 },
  34267. {
  34268. "icon_id": "24899570",
  34269. "name": "email",
  34270. "font_class": "email",
  34271. "unicode": "e69e",
  34272. "unicode_decimal": 59038 },
  34273. {
  34274. "icon_id": "24899571",
  34275. "name": "personadd",
  34276. "font_class": "personadd",
  34277. "unicode": "e69f",
  34278. "unicode_decimal": 59039 },
  34279. {
  34280. "icon_id": "24899558",
  34281. "name": "chatboxes-filled",
  34282. "font_class": "chatboxes-filled",
  34283. "unicode": "e692",
  34284. "unicode_decimal": 59026 },
  34285. {
  34286. "icon_id": "24899559",
  34287. "name": "contact",
  34288. "font_class": "contact",
  34289. "unicode": "e693",
  34290. "unicode_decimal": 59027 },
  34291. {
  34292. "icon_id": "24899560",
  34293. "name": "chatbubble-filled",
  34294. "font_class": "chatbubble-filled",
  34295. "unicode": "e694",
  34296. "unicode_decimal": 59028 },
  34297. {
  34298. "icon_id": "24899561",
  34299. "name": "contact-filled",
  34300. "font_class": "contact-filled",
  34301. "unicode": "e695",
  34302. "unicode_decimal": 59029 },
  34303. {
  34304. "icon_id": "24899562",
  34305. "name": "chatboxes",
  34306. "font_class": "chatboxes",
  34307. "unicode": "e696",
  34308. "unicode_decimal": 59030 },
  34309. {
  34310. "icon_id": "24899563",
  34311. "name": "chatbubble",
  34312. "font_class": "chatbubble",
  34313. "unicode": "e697",
  34314. "unicode_decimal": 59031 },
  34315. {
  34316. "icon_id": "24881290",
  34317. "name": "upload-filled",
  34318. "font_class": "upload-filled",
  34319. "unicode": "e68e",
  34320. "unicode_decimal": 59022 },
  34321. {
  34322. "icon_id": "24881292",
  34323. "name": "upload",
  34324. "font_class": "upload",
  34325. "unicode": "e690",
  34326. "unicode_decimal": 59024 },
  34327. {
  34328. "icon_id": "24881293",
  34329. "name": "weixin",
  34330. "font_class": "weixin",
  34331. "unicode": "e691",
  34332. "unicode_decimal": 59025 },
  34333. {
  34334. "icon_id": "24881274",
  34335. "name": "compose",
  34336. "font_class": "compose",
  34337. "unicode": "e67f",
  34338. "unicode_decimal": 59007 },
  34339. {
  34340. "icon_id": "24881275",
  34341. "name": "qq",
  34342. "font_class": "qq",
  34343. "unicode": "e680",
  34344. "unicode_decimal": 59008 },
  34345. {
  34346. "icon_id": "24881276",
  34347. "name": "download-filled",
  34348. "font_class": "download-filled",
  34349. "unicode": "e681",
  34350. "unicode_decimal": 59009 },
  34351. {
  34352. "icon_id": "24881277",
  34353. "name": "pengyouquan",
  34354. "font_class": "pyq",
  34355. "unicode": "e682",
  34356. "unicode_decimal": 59010 },
  34357. {
  34358. "icon_id": "24881279",
  34359. "name": "sound",
  34360. "font_class": "sound",
  34361. "unicode": "e684",
  34362. "unicode_decimal": 59012 },
  34363. {
  34364. "icon_id": "24881280",
  34365. "name": "trash-filled",
  34366. "font_class": "trash-filled",
  34367. "unicode": "e685",
  34368. "unicode_decimal": 59013 },
  34369. {
  34370. "icon_id": "24881281",
  34371. "name": "sound-filled",
  34372. "font_class": "sound-filled",
  34373. "unicode": "e686",
  34374. "unicode_decimal": 59014 },
  34375. {
  34376. "icon_id": "24881282",
  34377. "name": "trash",
  34378. "font_class": "trash",
  34379. "unicode": "e687",
  34380. "unicode_decimal": 59015 },
  34381. {
  34382. "icon_id": "24881284",
  34383. "name": "videocam-filled",
  34384. "font_class": "videocam-filled",
  34385. "unicode": "e689",
  34386. "unicode_decimal": 59017 },
  34387. {
  34388. "icon_id": "24881285",
  34389. "name": "spinner-cycle",
  34390. "font_class": "spinner-cycle",
  34391. "unicode": "e68a",
  34392. "unicode_decimal": 59018 },
  34393. {
  34394. "icon_id": "24881286",
  34395. "name": "weibo",
  34396. "font_class": "weibo",
  34397. "unicode": "e68b",
  34398. "unicode_decimal": 59019 },
  34399. {
  34400. "icon_id": "24881288",
  34401. "name": "videocam",
  34402. "font_class": "videocam",
  34403. "unicode": "e68c",
  34404. "unicode_decimal": 59020 },
  34405. {
  34406. "icon_id": "24881289",
  34407. "name": "download",
  34408. "font_class": "download",
  34409. "unicode": "e68d",
  34410. "unicode_decimal": 59021 },
  34411. {
  34412. "icon_id": "24879601",
  34413. "name": "help",
  34414. "font_class": "help",
  34415. "unicode": "e679",
  34416. "unicode_decimal": 59001 },
  34417. {
  34418. "icon_id": "24879602",
  34419. "name": "navigate-filled",
  34420. "font_class": "navigate-filled",
  34421. "unicode": "e67a",
  34422. "unicode_decimal": 59002 },
  34423. {
  34424. "icon_id": "24879603",
  34425. "name": "plusempty",
  34426. "font_class": "plusempty",
  34427. "unicode": "e67b",
  34428. "unicode_decimal": 59003 },
  34429. {
  34430. "icon_id": "24879604",
  34431. "name": "smallcircle",
  34432. "font_class": "smallcircle",
  34433. "unicode": "e67c",
  34434. "unicode_decimal": 59004 },
  34435. {
  34436. "icon_id": "24879605",
  34437. "name": "minus-filled",
  34438. "font_class": "minus-filled",
  34439. "unicode": "e67d",
  34440. "unicode_decimal": 59005 },
  34441. {
  34442. "icon_id": "24879606",
  34443. "name": "micoff",
  34444. "font_class": "micoff",
  34445. "unicode": "e67e",
  34446. "unicode_decimal": 59006 },
  34447. {
  34448. "icon_id": "24879588",
  34449. "name": "closeempty",
  34450. "font_class": "closeempty",
  34451. "unicode": "e66c",
  34452. "unicode_decimal": 58988 },
  34453. {
  34454. "icon_id": "24879589",
  34455. "name": "clear",
  34456. "font_class": "clear",
  34457. "unicode": "e66d",
  34458. "unicode_decimal": 58989 },
  34459. {
  34460. "icon_id": "24879590",
  34461. "name": "navigate",
  34462. "font_class": "navigate",
  34463. "unicode": "e66e",
  34464. "unicode_decimal": 58990 },
  34465. {
  34466. "icon_id": "24879591",
  34467. "name": "minus",
  34468. "font_class": "minus",
  34469. "unicode": "e66f",
  34470. "unicode_decimal": 58991 },
  34471. {
  34472. "icon_id": "24879592",
  34473. "name": "image",
  34474. "font_class": "image",
  34475. "unicode": "e670",
  34476. "unicode_decimal": 58992 },
  34477. {
  34478. "icon_id": "24879593",
  34479. "name": "mic",
  34480. "font_class": "mic",
  34481. "unicode": "e671",
  34482. "unicode_decimal": 58993 },
  34483. {
  34484. "icon_id": "24879594",
  34485. "name": "paperplane",
  34486. "font_class": "paperplane",
  34487. "unicode": "e672",
  34488. "unicode_decimal": 58994 },
  34489. {
  34490. "icon_id": "24879595",
  34491. "name": "close",
  34492. "font_class": "close",
  34493. "unicode": "e673",
  34494. "unicode_decimal": 58995 },
  34495. {
  34496. "icon_id": "24879596",
  34497. "name": "help-filled",
  34498. "font_class": "help-filled",
  34499. "unicode": "e674",
  34500. "unicode_decimal": 58996 },
  34501. {
  34502. "icon_id": "24879597",
  34503. "name": "plus-filled",
  34504. "font_class": "paperplane-filled",
  34505. "unicode": "e675",
  34506. "unicode_decimal": 58997 },
  34507. {
  34508. "icon_id": "24879598",
  34509. "name": "plus",
  34510. "font_class": "plus",
  34511. "unicode": "e676",
  34512. "unicode_decimal": 58998 },
  34513. {
  34514. "icon_id": "24879599",
  34515. "name": "mic-filled",
  34516. "font_class": "mic-filled",
  34517. "unicode": "e677",
  34518. "unicode_decimal": 58999 },
  34519. {
  34520. "icon_id": "24879600",
  34521. "name": "image-filled",
  34522. "font_class": "image-filled",
  34523. "unicode": "e678",
  34524. "unicode_decimal": 59000 },
  34525. {
  34526. "icon_id": "24855900",
  34527. "name": "locked-filled",
  34528. "font_class": "locked-filled",
  34529. "unicode": "e668",
  34530. "unicode_decimal": 58984 },
  34531. {
  34532. "icon_id": "24855901",
  34533. "name": "info",
  34534. "font_class": "info",
  34535. "unicode": "e669",
  34536. "unicode_decimal": 58985 },
  34537. {
  34538. "icon_id": "24855903",
  34539. "name": "locked",
  34540. "font_class": "locked",
  34541. "unicode": "e66b",
  34542. "unicode_decimal": 58987 },
  34543. {
  34544. "icon_id": "24855884",
  34545. "name": "camera-filled",
  34546. "font_class": "camera-filled",
  34547. "unicode": "e658",
  34548. "unicode_decimal": 58968 },
  34549. {
  34550. "icon_id": "24855885",
  34551. "name": "chat-filled",
  34552. "font_class": "chat-filled",
  34553. "unicode": "e659",
  34554. "unicode_decimal": 58969 },
  34555. {
  34556. "icon_id": "24855886",
  34557. "name": "camera",
  34558. "font_class": "camera",
  34559. "unicode": "e65a",
  34560. "unicode_decimal": 58970 },
  34561. {
  34562. "icon_id": "24855887",
  34563. "name": "circle",
  34564. "font_class": "circle",
  34565. "unicode": "e65b",
  34566. "unicode_decimal": 58971 },
  34567. {
  34568. "icon_id": "24855888",
  34569. "name": "checkmarkempty",
  34570. "font_class": "checkmarkempty",
  34571. "unicode": "e65c",
  34572. "unicode_decimal": 58972 },
  34573. {
  34574. "icon_id": "24855889",
  34575. "name": "chat",
  34576. "font_class": "chat",
  34577. "unicode": "e65d",
  34578. "unicode_decimal": 58973 },
  34579. {
  34580. "icon_id": "24855890",
  34581. "name": "circle-filled",
  34582. "font_class": "circle-filled",
  34583. "unicode": "e65e",
  34584. "unicode_decimal": 58974 },
  34585. {
  34586. "icon_id": "24855891",
  34587. "name": "flag",
  34588. "font_class": "flag",
  34589. "unicode": "e65f",
  34590. "unicode_decimal": 58975 },
  34591. {
  34592. "icon_id": "24855892",
  34593. "name": "flag-filled",
  34594. "font_class": "flag-filled",
  34595. "unicode": "e660",
  34596. "unicode_decimal": 58976 },
  34597. {
  34598. "icon_id": "24855893",
  34599. "name": "gear-filled",
  34600. "font_class": "gear-filled",
  34601. "unicode": "e661",
  34602. "unicode_decimal": 58977 },
  34603. {
  34604. "icon_id": "24855894",
  34605. "name": "home",
  34606. "font_class": "home",
  34607. "unicode": "e662",
  34608. "unicode_decimal": 58978 },
  34609. {
  34610. "icon_id": "24855895",
  34611. "name": "home-filled",
  34612. "font_class": "home-filled",
  34613. "unicode": "e663",
  34614. "unicode_decimal": 58979 },
  34615. {
  34616. "icon_id": "24855896",
  34617. "name": "gear",
  34618. "font_class": "gear",
  34619. "unicode": "e664",
  34620. "unicode_decimal": 58980 },
  34621. {
  34622. "icon_id": "24855897",
  34623. "name": "smallcircle-filled",
  34624. "font_class": "smallcircle-filled",
  34625. "unicode": "e665",
  34626. "unicode_decimal": 58981 },
  34627. {
  34628. "icon_id": "24855898",
  34629. "name": "map-filled",
  34630. "font_class": "map-filled",
  34631. "unicode": "e666",
  34632. "unicode_decimal": 58982 },
  34633. {
  34634. "icon_id": "24855899",
  34635. "name": "map",
  34636. "font_class": "map",
  34637. "unicode": "e667",
  34638. "unicode_decimal": 58983 },
  34639. {
  34640. "icon_id": "24855825",
  34641. "name": "refresh-filled",
  34642. "font_class": "refresh-filled",
  34643. "unicode": "e656",
  34644. "unicode_decimal": 58966 },
  34645. {
  34646. "icon_id": "24855826",
  34647. "name": "refresh",
  34648. "font_class": "refresh",
  34649. "unicode": "e657",
  34650. "unicode_decimal": 58967 },
  34651. {
  34652. "icon_id": "24855808",
  34653. "name": "cloud-upload",
  34654. "font_class": "cloud-upload",
  34655. "unicode": "e645",
  34656. "unicode_decimal": 58949 },
  34657. {
  34658. "icon_id": "24855809",
  34659. "name": "cloud-download-filled",
  34660. "font_class": "cloud-download-filled",
  34661. "unicode": "e646",
  34662. "unicode_decimal": 58950 },
  34663. {
  34664. "icon_id": "24855810",
  34665. "name": "cloud-download",
  34666. "font_class": "cloud-download",
  34667. "unicode": "e647",
  34668. "unicode_decimal": 58951 },
  34669. {
  34670. "icon_id": "24855811",
  34671. "name": "cloud-upload-filled",
  34672. "font_class": "cloud-upload-filled",
  34673. "unicode": "e648",
  34674. "unicode_decimal": 58952 },
  34675. {
  34676. "icon_id": "24855813",
  34677. "name": "redo",
  34678. "font_class": "redo",
  34679. "unicode": "e64a",
  34680. "unicode_decimal": 58954 },
  34681. {
  34682. "icon_id": "24855814",
  34683. "name": "images-filled",
  34684. "font_class": "images-filled",
  34685. "unicode": "e64b",
  34686. "unicode_decimal": 58955 },
  34687. {
  34688. "icon_id": "24855815",
  34689. "name": "undo-filled",
  34690. "font_class": "undo-filled",
  34691. "unicode": "e64c",
  34692. "unicode_decimal": 58956 },
  34693. {
  34694. "icon_id": "24855816",
  34695. "name": "more",
  34696. "font_class": "more",
  34697. "unicode": "e64d",
  34698. "unicode_decimal": 58957 },
  34699. {
  34700. "icon_id": "24855817",
  34701. "name": "more-filled",
  34702. "font_class": "more-filled",
  34703. "unicode": "e64e",
  34704. "unicode_decimal": 58958 },
  34705. {
  34706. "icon_id": "24855818",
  34707. "name": "undo",
  34708. "font_class": "undo",
  34709. "unicode": "e64f",
  34710. "unicode_decimal": 58959 },
  34711. {
  34712. "icon_id": "24855819",
  34713. "name": "images",
  34714. "font_class": "images",
  34715. "unicode": "e650",
  34716. "unicode_decimal": 58960 },
  34717. {
  34718. "icon_id": "24855821",
  34719. "name": "paperclip",
  34720. "font_class": "paperclip",
  34721. "unicode": "e652",
  34722. "unicode_decimal": 58962 },
  34723. {
  34724. "icon_id": "24855822",
  34725. "name": "settings",
  34726. "font_class": "settings",
  34727. "unicode": "e653",
  34728. "unicode_decimal": 58963 },
  34729. {
  34730. "icon_id": "24855823",
  34731. "name": "search",
  34732. "font_class": "search",
  34733. "unicode": "e654",
  34734. "unicode_decimal": 58964 },
  34735. {
  34736. "icon_id": "24855824",
  34737. "name": "redo-filled",
  34738. "font_class": "redo-filled",
  34739. "unicode": "e655",
  34740. "unicode_decimal": 58965 },
  34741. {
  34742. "icon_id": "24841702",
  34743. "name": "list",
  34744. "font_class": "list",
  34745. "unicode": "e644",
  34746. "unicode_decimal": 58948 },
  34747. {
  34748. "icon_id": "24841489",
  34749. "name": "mail-open-filled",
  34750. "font_class": "mail-open-filled",
  34751. "unicode": "e63a",
  34752. "unicode_decimal": 58938 },
  34753. {
  34754. "icon_id": "24841491",
  34755. "name": "hand-thumbsdown-filled",
  34756. "font_class": "hand-down-filled",
  34757. "unicode": "e63c",
  34758. "unicode_decimal": 58940 },
  34759. {
  34760. "icon_id": "24841492",
  34761. "name": "hand-thumbsdown",
  34762. "font_class": "hand-down",
  34763. "unicode": "e63d",
  34764. "unicode_decimal": 58941 },
  34765. {
  34766. "icon_id": "24841493",
  34767. "name": "hand-thumbsup-filled",
  34768. "font_class": "hand-up-filled",
  34769. "unicode": "e63e",
  34770. "unicode_decimal": 58942 },
  34771. {
  34772. "icon_id": "24841494",
  34773. "name": "hand-thumbsup",
  34774. "font_class": "hand-up",
  34775. "unicode": "e63f",
  34776. "unicode_decimal": 58943 },
  34777. {
  34778. "icon_id": "24841496",
  34779. "name": "heart-filled",
  34780. "font_class": "heart-filled",
  34781. "unicode": "e641",
  34782. "unicode_decimal": 58945 },
  34783. {
  34784. "icon_id": "24841498",
  34785. "name": "mail-open",
  34786. "font_class": "mail-open",
  34787. "unicode": "e643",
  34788. "unicode_decimal": 58947 },
  34789. {
  34790. "icon_id": "24841488",
  34791. "name": "heart",
  34792. "font_class": "heart",
  34793. "unicode": "e639",
  34794. "unicode_decimal": 58937 },
  34795. {
  34796. "icon_id": "24839963",
  34797. "name": "loop",
  34798. "font_class": "loop",
  34799. "unicode": "e633",
  34800. "unicode_decimal": 58931 },
  34801. {
  34802. "icon_id": "24839866",
  34803. "name": "pulldown",
  34804. "font_class": "pulldown",
  34805. "unicode": "e632",
  34806. "unicode_decimal": 58930 },
  34807. {
  34808. "icon_id": "24813798",
  34809. "name": "scan",
  34810. "font_class": "scan",
  34811. "unicode": "e62a",
  34812. "unicode_decimal": 58922 },
  34813. {
  34814. "icon_id": "24813786",
  34815. "name": "bars",
  34816. "font_class": "bars",
  34817. "unicode": "e627",
  34818. "unicode_decimal": 58919 },
  34819. {
  34820. "icon_id": "24813788",
  34821. "name": "cart-filled",
  34822. "font_class": "cart-filled",
  34823. "unicode": "e629",
  34824. "unicode_decimal": 58921 },
  34825. {
  34826. "icon_id": "24813790",
  34827. "name": "checkbox",
  34828. "font_class": "checkbox",
  34829. "unicode": "e62b",
  34830. "unicode_decimal": 58923 },
  34831. {
  34832. "icon_id": "24813791",
  34833. "name": "checkbox-filled",
  34834. "font_class": "checkbox-filled",
  34835. "unicode": "e62c",
  34836. "unicode_decimal": 58924 },
  34837. {
  34838. "icon_id": "24813794",
  34839. "name": "shop",
  34840. "font_class": "shop",
  34841. "unicode": "e62f",
  34842. "unicode_decimal": 58927 },
  34843. {
  34844. "icon_id": "24813795",
  34845. "name": "headphones",
  34846. "font_class": "headphones",
  34847. "unicode": "e630",
  34848. "unicode_decimal": 58928 },
  34849. {
  34850. "icon_id": "24813796",
  34851. "name": "cart",
  34852. "font_class": "cart",
  34853. "unicode": "e631",
  34854. "unicode_decimal": 58929 }] };exports.default = _default;
  34855. /***/ })
  34856. ]]);
  34857. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map