123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072 |
- import {
- __commonJS,
- __require
- } from "/node_modules/.vite/deps/chunk-WQG2LZMB.js?v=9548b9c3";
- // node_modules/ali-oss/dist/aliyun-oss-sdk.js
- var require_aliyun_oss_sdk = __commonJS({
- "node_modules/ali-oss/dist/aliyun-oss-sdk.js"(exports, module) {
- (function(global) {
- (function(f) {
- if (typeof exports === "object" && typeof module !== "undefined") {
- module.exports = f();
- } else if (typeof define === "function" && define.amd) {
- define([], f);
- } else {
- var g;
- if (typeof window !== "undefined") {
- g = window;
- } else if (typeof global !== "undefined") {
- g = global;
- } else if (typeof self !== "undefined") {
- g = self;
- } else {
- g = this;
- }
- g.OSS = f();
- }
- })(function() {
- var define2, module2, exports2;
- return function() {
- function r(e, n, t) {
- function o(i2, f) {
- if (!n[i2]) {
- if (!e[i2]) {
- var c = "function" == typeof __require && __require;
- if (!f && c)
- return c(i2, true);
- if (u)
- return u(i2, true);
- var a = new Error("Cannot find module '" + i2 + "'");
- throw a.code = "MODULE_NOT_FOUND", a;
- }
- var p = n[i2] = { exports: {} };
- e[i2][0].call(p.exports, function(r2) {
- var n2 = e[i2][1][r2];
- return o(n2 || r2);
- }, p, p.exports, r, e, n, t);
- }
- return n[i2].exports;
- }
- for (var u = "function" == typeof __require && __require, i = 0; i < t.length; i++)
- o(t[i]);
- return o;
- }
- return r;
- }()({ 1: [function(require2, module3, exports3) {
- "use strict";
- var OSS = require2("./browser/client");
- OSS.Buffer = require2("buffer").Buffer;
- OSS.urllib = require2("../shims/xhr");
- OSS.version = require2("./browser/version").version;
- module3.exports = OSS;
- }, { "../shims/xhr": 475, "./browser/client": 3, "./browser/version": 6, "buffer": 90 }], 2: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.slice.js");
- var assert = require2("assert");
- var _require = require2("../common/utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var proto = exports3;
- function isArray(arr) {
- if (Array.isArray)
- return Array.isArray(arr);
- return Object.prototype.toString.call(arr) === "[object Array]";
- }
- function toArray(obj) {
- if (!obj)
- return [];
- if (isArray(obj))
- return obj;
- return [obj];
- }
- proto.useBucket = function useBucket(name) {
- _checkBucketName(name);
- this.options.bucket = name;
- return this;
- };
- proto.setBucket = function useBucket(name) {
- _checkBucketName(name);
- this.options.bucket = name;
- return this;
- };
- proto.getBucket = function getBucket() {
- return this.options.bucket;
- };
- proto.deleteBucket = function() {
- var _deleteBucket = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- params = this._bucketRequestParams("DELETE", name, "", options);
- _context.next = 3;
- return this.request(params);
- case 3:
- result = _context.sent;
- if (!(result.status === 200 || result.status === 204)) {
- _context.next = 6;
- break;
- }
- return _context.abrupt("return", {
- res: result.res
- });
- case 6:
- _context.next = 8;
- return this.requestError(result);
- case 8:
- throw _context.sent;
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function deleteBucket(_x, _x2) {
- return _deleteBucket.apply(this, arguments);
- }
- return deleteBucket;
- }();
- proto.putBucketACL = function() {
- var _putBucketACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, acl, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- params = this._bucketRequestParams("PUT", name, "acl", options);
- params.headers = {
- "x-oss-acl": acl
- };
- params.successStatuses = [200];
- _context2.next = 5;
- return this.request(params);
- case 5:
- result = _context2.sent;
- return _context2.abrupt("return", {
- bucket: result.headers.location && result.headers.location.substring(1) || null,
- res: result.res
- });
- case 7:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function putBucketACL(_x3, _x4, _x5) {
- return _putBucketACL.apply(this, arguments);
- }
- return putBucketACL;
- }();
- proto.getBucketACL = function() {
- var _getBucketACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- params = this._bucketRequestParams("GET", name, "acl", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context3.next = 5;
- return this.request(params);
- case 5:
- result = _context3.sent;
- return _context3.abrupt("return", {
- acl: result.data.AccessControlList.Grant,
- owner: {
- id: result.data.Owner.ID,
- displayName: result.data.Owner.DisplayName
- },
- res: result.res
- });
- case 7:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function getBucketACL(_x6, _x7) {
- return _getBucketACL.apply(this, arguments);
- }
- return getBucketACL;
- }();
- proto.putBucketLogging = function() {
- var _putBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, prefix, options) {
- var params, xml, result;
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- params = this._bucketRequestParams("PUT", name, "logging", options);
- xml = '<?xml version="1.0" encoding="UTF-8"?>\n<BucketLoggingStatus>\n<LoggingEnabled>\n<TargetBucket>'.concat(name, "</TargetBucket>\n");
- if (prefix) {
- xml += "<TargetPrefix>".concat(prefix, "</TargetPrefix>\n");
- }
- xml += "</LoggingEnabled>\n</BucketLoggingStatus>";
- params.content = xml;
- params.mime = "xml";
- params.successStatuses = [200];
- _context4.next = 9;
- return this.request(params);
- case 9:
- result = _context4.sent;
- return _context4.abrupt("return", {
- res: result.res
- });
- case 11:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- function putBucketLogging(_x8, _x9, _x10) {
- return _putBucketLogging.apply(this, arguments);
- }
- return putBucketLogging;
- }();
- proto.getBucketLogging = function() {
- var _getBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(name, options) {
- var params, result, enable;
- return _regenerator.default.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- params = this._bucketRequestParams("GET", name, "logging", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context5.next = 5;
- return this.request(params);
- case 5:
- result = _context5.sent;
- enable = result.data.LoggingEnabled;
- return _context5.abrupt("return", {
- enable: !!enable,
- prefix: enable && enable.TargetPrefix || null,
- res: result.res
- });
- case 8:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- function getBucketLogging(_x11, _x12) {
- return _getBucketLogging.apply(this, arguments);
- }
- return getBucketLogging;
- }();
- proto.deleteBucketLogging = function() {
- var _deleteBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- params = this._bucketRequestParams("DELETE", name, "logging", options);
- params.successStatuses = [204, 200];
- _context6.next = 4;
- return this.request(params);
- case 4:
- result = _context6.sent;
- return _context6.abrupt("return", {
- res: result.res
- });
- case 6:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6, this);
- }));
- function deleteBucketLogging(_x13, _x14) {
- return _deleteBucketLogging.apply(this, arguments);
- }
- return deleteBucketLogging;
- }();
- proto.putBucketCORS = function() {
- var _putBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name, rules, options) {
- var params, xml, parseOrigin, parseMethod, parseHeader, parseExposeHeader, i, l, rule, result;
- return _regenerator.default.wrap(function _callee7$(_context7) {
- while (1) {
- switch (_context7.prev = _context7.next) {
- case 0:
- rules = rules || [];
- assert(rules.length, "rules is required");
- rules.forEach(function(rule2) {
- assert(rule2.allowedOrigin, "allowedOrigin is required");
- assert(rule2.allowedMethod, "allowedMethod is required");
- });
- params = this._bucketRequestParams("PUT", name, "cors", options);
- xml = '<?xml version="1.0" encoding="UTF-8"?>\n<CORSConfiguration>';
- parseOrigin = function parseOrigin2(val) {
- xml += "<AllowedOrigin>".concat(val, "</AllowedOrigin>");
- };
- parseMethod = function parseMethod2(val) {
- xml += "<AllowedMethod>".concat(val, "</AllowedMethod>");
- };
- parseHeader = function parseHeader2(val) {
- xml += "<AllowedHeader>".concat(val, "</AllowedHeader>");
- };
- parseExposeHeader = function parseExposeHeader2(val) {
- xml += "<ExposeHeader>".concat(val, "</ExposeHeader>");
- };
- for (i = 0, l = rules.length; i < l; i++) {
- rule = rules[i];
- xml += "<CORSRule>";
- toArray(rule.allowedOrigin).forEach(parseOrigin);
- toArray(rule.allowedMethod).forEach(parseMethod);
- toArray(rule.allowedHeader).forEach(parseHeader);
- toArray(rule.exposeHeader).forEach(parseExposeHeader);
- if (rule.maxAgeSeconds) {
- xml += "<MaxAgeSeconds>".concat(rule.maxAgeSeconds, "</MaxAgeSeconds>");
- }
- xml += "</CORSRule>";
- }
- xml += "</CORSConfiguration>";
- params.content = xml;
- params.mime = "xml";
- params.successStatuses = [200];
- _context7.next = 16;
- return this.request(params);
- case 16:
- result = _context7.sent;
- return _context7.abrupt("return", {
- res: result.res
- });
- case 18:
- case "end":
- return _context7.stop();
- }
- }
- }, _callee7, this);
- }));
- function putBucketCORS(_x15, _x16, _x17) {
- return _putBucketCORS.apply(this, arguments);
- }
- return putBucketCORS;
- }();
- proto.getBucketCORS = function() {
- var _getBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8(name, options) {
- var params, result, rules, CORSRule;
- return _regenerator.default.wrap(function _callee8$(_context8) {
- while (1) {
- switch (_context8.prev = _context8.next) {
- case 0:
- params = this._bucketRequestParams("GET", name, "cors", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context8.next = 5;
- return this.request(params);
- case 5:
- result = _context8.sent;
- rules = [];
- if (result.data && result.data.CORSRule) {
- CORSRule = result.data.CORSRule;
- if (!isArray(CORSRule))
- CORSRule = [CORSRule];
- CORSRule.forEach(function(rule) {
- var r = {};
- Object.keys(rule).forEach(function(key) {
- r[key.slice(0, 1).toLowerCase() + key.slice(1, key.length)] = rule[key];
- });
- rules.push(r);
- });
- }
- return _context8.abrupt("return", {
- rules,
- res: result.res
- });
- case 9:
- case "end":
- return _context8.stop();
- }
- }
- }, _callee8, this);
- }));
- function getBucketCORS(_x18, _x19) {
- return _getBucketCORS.apply(this, arguments);
- }
- return getBucketCORS;
- }();
- proto.deleteBucketCORS = function() {
- var _deleteBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee9$(_context9) {
- while (1) {
- switch (_context9.prev = _context9.next) {
- case 0:
- params = this._bucketRequestParams("DELETE", name, "cors", options);
- params.successStatuses = [204];
- _context9.next = 4;
- return this.request(params);
- case 4:
- result = _context9.sent;
- return _context9.abrupt("return", {
- res: result.res
- });
- case 6:
- case "end":
- return _context9.stop();
- }
- }
- }, _callee9, this);
- }));
- function deleteBucketCORS(_x20, _x21) {
- return _deleteBucketCORS.apply(this, arguments);
- }
- return deleteBucketCORS;
- }();
- proto.putBucketReferer = function() {
- var _putBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee10(name, allowEmpty, referers, options) {
- var params, xml, i, result;
- return _regenerator.default.wrap(function _callee10$(_context10) {
- while (1) {
- switch (_context10.prev = _context10.next) {
- case 0:
- params = this._bucketRequestParams("PUT", name, "referer", options);
- xml = '<?xml version="1.0" encoding="UTF-8"?>\n<RefererConfiguration>\n';
- xml += " <AllowEmptyReferer>".concat(allowEmpty ? "true" : "false", "</AllowEmptyReferer>\n");
- if (referers && referers.length > 0) {
- xml += " <RefererList>\n";
- for (i = 0; i < referers.length; i++) {
- xml += " <Referer>".concat(referers[i], "</Referer>\n");
- }
- xml += " </RefererList>\n";
- } else {
- xml += " <RefererList />\n";
- }
- xml += "</RefererConfiguration>";
- params.content = xml;
- params.mime = "xml";
- params.successStatuses = [200];
- _context10.next = 10;
- return this.request(params);
- case 10:
- result = _context10.sent;
- return _context10.abrupt("return", {
- res: result.res
- });
- case 12:
- case "end":
- return _context10.stop();
- }
- }
- }, _callee10, this);
- }));
- function putBucketReferer(_x22, _x23, _x24, _x25) {
- return _putBucketReferer.apply(this, arguments);
- }
- return putBucketReferer;
- }();
- proto.getBucketReferer = function() {
- var _getBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee11(name, options) {
- var params, result, referers;
- return _regenerator.default.wrap(function _callee11$(_context11) {
- while (1) {
- switch (_context11.prev = _context11.next) {
- case 0:
- params = this._bucketRequestParams("GET", name, "referer", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context11.next = 5;
- return this.request(params);
- case 5:
- result = _context11.sent;
- referers = result.data.RefererList.Referer || null;
- if (referers) {
- if (!isArray(referers)) {
- referers = [referers];
- }
- }
- return _context11.abrupt("return", {
- allowEmpty: result.data.AllowEmptyReferer === "true",
- referers,
- res: result.res
- });
- case 9:
- case "end":
- return _context11.stop();
- }
- }
- }, _callee11, this);
- }));
- function getBucketReferer(_x26, _x27) {
- return _getBucketReferer.apply(this, arguments);
- }
- return getBucketReferer;
- }();
- proto.deleteBucketReferer = function() {
- var _deleteBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee12(name, options) {
- return _regenerator.default.wrap(function _callee12$(_context12) {
- while (1) {
- switch (_context12.prev = _context12.next) {
- case 0:
- _context12.next = 2;
- return this.putBucketReferer(name, true, null, options);
- case 2:
- return _context12.abrupt("return", _context12.sent);
- case 3:
- case "end":
- return _context12.stop();
- }
- }
- }, _callee12, this);
- }));
- function deleteBucketReferer(_x28, _x29) {
- return _deleteBucketReferer.apply(this, arguments);
- }
- return deleteBucketReferer;
- }();
- proto._bucketRequestParams = function _bucketRequestParams(method, bucket, subres, options) {
- return {
- method,
- bucket,
- subres,
- timeout: options && options.timeout,
- ctx: options && options.ctx
- };
- };
- }, { "../common/utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "assert": 82, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 3: [function(require2, module3, exports3) {
- (function(Buffer, process) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.split.js");
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.symbol.js");
- require2("core-js/modules/es.symbol.description.js");
- require2("core-js/modules/es.array.slice.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.regexp.to-string.js");
- var debug = require2("debug")("ali-oss");
- var xml = require2("xml2js");
- var AgentKeepalive = require2("agentkeepalive");
- var merge = require2("merge-descriptors");
- var platform = require2("platform");
- var utility = require2("utility");
- var urllib = require2("urllib");
- var pkg = require2("./version");
- var bowser = require2("bowser");
- var signUtils = require2("../common/signUtils");
- var _initOptions = require2("../common/client/initOptions");
- var _require = require2("../common/utils/createRequest"), createRequest = _require.createRequest;
- var _require2 = require2("../common/utils/encoder"), encoder = _require2.encoder;
- var _require3 = require2("../common/client/getReqUrl"), getReqUrl = _require3.getReqUrl;
- var _require4 = require2("../common/utils/setSTSToken"), setSTSToken = _require4.setSTSToken;
- var _require5 = require2("../common/utils/retry"), retry = _require5.retry;
- var _require6 = require2("../common/utils/isFunction"), isFunction = _require6.isFunction;
- var globalHttpAgent = new AgentKeepalive();
- function _unSupportBrowserTip() {
- var name = platform.name, version = platform.version;
- if (name && name.toLowerCase && name.toLowerCase() === "ie" && version.split(".")[0] < 10) {
- console.warn("ali-oss does not support the current browser");
- }
- }
- function isHttpsWebProtocol() {
- return location && location.protocol === "https:";
- }
- function Client(options, ctx) {
- _unSupportBrowserTip();
- if (!(this instanceof Client)) {
- return new Client(options, ctx);
- }
- if (options && options.inited) {
- this.options = options;
- } else {
- this.options = Client.initOptions(options);
- }
- this.options.cancelFlag = false;
- if (this.options.urllib) {
- this.urllib = this.options.urllib;
- } else {
- this.urllib = urllib;
- this.agent = this.options.agent || globalHttpAgent;
- }
- this.ctx = ctx;
- this.userAgent = this._getUserAgent();
- this.stsTokenFreshTime = /* @__PURE__ */ new Date();
- this.options.amendTimeSkewed = 0;
- }
- module3.exports = Client;
- Client.initOptions = function initOptions(options) {
- if (!options.stsToken) {
- console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");
- }
- var opts = Object.assign({
- secure: isHttpsWebProtocol(),
- // for browser compatibility disable fetch.
- useFetch: false
- }, options);
- return _initOptions(opts);
- };
- var proto = Client.prototype;
- proto.debug = debug;
- merge(proto, require2("./object"));
- merge(proto, require2("./bucket"));
- merge(proto, require2("../common/bucket/getBucketWebsite"));
- merge(proto, require2("../common/bucket/putBucketWebsite"));
- merge(proto, require2("../common/bucket/deleteBucketWebsite"));
- merge(proto, require2("../common/bucket/getBucketLifecycle"));
- merge(proto, require2("../common/bucket/putBucketLifecycle"));
- merge(proto, require2("../common/bucket/deleteBucketLifecycle"));
- merge(proto, require2("../common/bucket/putBucketVersioning"));
- merge(proto, require2("../common/bucket/getBucketVersioning"));
- merge(proto, require2("../common/bucket/getBucketInventory"));
- merge(proto, require2("../common/bucket/deleteBucketInventory"));
- merge(proto, require2("../common/bucket/listBucketInventory"));
- merge(proto, require2("../common/bucket/putBucketInventory"));
- merge(proto, require2("../common/bucket/abortBucketWorm"));
- merge(proto, require2("../common/bucket/completeBucketWorm"));
- merge(proto, require2("../common/bucket/extendBucketWorm"));
- merge(proto, require2("../common/bucket/getBucketWorm"));
- merge(proto, require2("../common/bucket/initiateBucketWorm"));
- merge(proto, require2("./managed-upload"));
- merge(proto, require2("../common/multipart-copy"));
- merge(proto, require2("../common/multipart"));
- merge(proto, require2("../common/parallel"));
- proto.signature = function signature(stringToSign) {
- this.debug("authorization stringToSign: %s", stringToSign, "info");
- return signUtils.computeSignature(this.options.accessKeySecret, stringToSign, this.options.headerEncoding);
- };
- proto._getReqUrl = getReqUrl;
- proto.authorization = function authorization(method, resource, subres, headers) {
- var stringToSign = signUtils.buildCanonicalString(method.toUpperCase(), resource, {
- headers,
- parameters: subres
- });
- return signUtils.authorization(this.options.accessKeyId, this.options.accessKeySecret, stringToSign, this.options.headerEncoding);
- };
- proto.request = function() {
- var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(params) {
- var _this = this;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- if (!this.options.retryMax) {
- _context.next = 6;
- break;
- }
- _context.next = 3;
- return retry(request.bind(this), this.options.retryMax, {
- errorHandler: function errorHandler(err) {
- var _errHandle = function _errHandle2(_err) {
- if (params.stream)
- return false;
- var statusErr = [-1, -2].includes(_err.status);
- var requestErrorRetryHandle = _this.options.requestErrorRetryHandle || function() {
- return true;
- };
- return statusErr && requestErrorRetryHandle(_err);
- };
- if (_errHandle(err))
- return true;
- return false;
- }
- })(params);
- case 3:
- return _context.abrupt("return", _context.sent);
- case 6:
- return _context.abrupt("return", request.call(this, params));
- case 7:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return function(_x) {
- return _ref.apply(this, arguments);
- };
- }();
- function request(_x2) {
- return _request.apply(this, arguments);
- }
- function _request() {
- _request = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(params) {
- var reqParams, result, reqErr, useStream, err, parseData;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) {
- _context3.next = 3;
- break;
- }
- _context3.next = 3;
- return setSTSToken.call(this);
- case 3:
- reqParams = createRequest.call(this, params);
- if (!this.options.useFetch) {
- reqParams.params.mode = "disable-fetch";
- }
- useStream = !!params.stream;
- _context3.prev = 6;
- _context3.next = 9;
- return this.urllib.request(reqParams.url, reqParams.params);
- case 9:
- result = _context3.sent;
- this.debug("response %s %s, got %s, headers: %j", params.method, reqParams.url, result.status, result.headers, "info");
- _context3.next = 16;
- break;
- case 13:
- _context3.prev = 13;
- _context3.t0 = _context3["catch"](6);
- reqErr = _context3.t0;
- case 16:
- if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) {
- _context3.next = 28;
- break;
- }
- _context3.next = 19;
- return this.requestError(result);
- case 19:
- err = _context3.sent;
- if (!(err.code === "RequestTimeTooSkewed" && !useStream)) {
- _context3.next = 25;
- break;
- }
- this.options.amendTimeSkewed = +new Date(err.serverTime) - /* @__PURE__ */ new Date();
- _context3.next = 24;
- return this.request(params);
- case 24:
- return _context3.abrupt("return", _context3.sent);
- case 25:
- err.params = params;
- _context3.next = 32;
- break;
- case 28:
- if (!reqErr) {
- _context3.next = 32;
- break;
- }
- _context3.next = 31;
- return this.requestError(reqErr);
- case 31:
- err = _context3.sent;
- case 32:
- if (!err) {
- _context3.next = 34;
- break;
- }
- throw err;
- case 34:
- if (!params.xmlResponse) {
- _context3.next = 39;
- break;
- }
- _context3.next = 37;
- return this.parseXML(result.data);
- case 37:
- parseData = _context3.sent;
- result.data = parseData;
- case 39:
- return _context3.abrupt("return", result);
- case 40:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this, [[6, 13]]);
- }));
- return _request.apply(this, arguments);
- }
- proto._getResource = function _getResource(params) {
- var resource = "/";
- if (params.bucket)
- resource += "".concat(params.bucket, "/");
- if (params.object)
- resource += encoder(params.object, this.options.headerEncoding);
- return resource;
- };
- proto._escape = function _escape(name) {
- return utility.encodeURIComponent(name).replace(/%2F/g, "/");
- };
- proto._getUserAgent = function _getUserAgent() {
- var agent = process && process.browser ? "js" : "nodejs";
- var sdk = "aliyun-sdk-".concat(agent, "/").concat(pkg.version);
- var plat = platform.description;
- if (!plat && process) {
- plat = "Node.js ".concat(process.version.slice(1), " on ").concat(process.platform, " ").concat(process.arch);
- }
- return this._checkUserAgent("".concat(sdk, " ").concat(plat));
- };
- proto._checkUserAgent = function _checkUserAgent(ua) {
- var userAgent = ua.replace(/\u03b1/, "alpha").replace(/\u03b2/, "beta");
- return userAgent;
- };
- proto.checkBrowserAndVersion = function checkBrowserAndVersion(name, version) {
- return bowser.name === name && bowser.version.split(".")[0] === version;
- };
- proto.parseXML = function parseXMLThunk(str) {
- return new Promise(function(resolve, reject) {
- if (Buffer.isBuffer(str)) {
- str = str.toString();
- }
- xml.parseString(str, {
- explicitRoot: false,
- explicitArray: false
- }, function(err, result) {
- if (err) {
- reject(err);
- } else {
- resolve(result);
- }
- });
- });
- };
- proto.requestError = function() {
- var _requestError = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(result) {
- var err, message, info, msg;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- err = null;
- if (!(!result.data || !result.data.length)) {
- _context2.next = 5;
- break;
- }
- if (result.status === -1 || result.status === -2) {
- err = new Error(result.message);
- err.name = result.name;
- err.status = result.status;
- err.code = result.name;
- } else {
- if (result.status === 404) {
- err = new Error("Object not exists");
- err.name = "NoSuchKeyError";
- err.status = 404;
- err.code = "NoSuchKey";
- } else if (result.status === 412) {
- err = new Error("Pre condition failed");
- err.name = "PreconditionFailedError";
- err.status = 412;
- err.code = "PreconditionFailed";
- } else {
- err = new Error("Unknow error, status: ".concat(result.status));
- err.name = "UnknownError";
- err.status = result.status;
- }
- err.requestId = result.headers["x-oss-request-id"];
- err.host = "";
- }
- _context2.next = 32;
- break;
- case 5:
- message = String(result.data);
- this.debug("request response error data: %s", message, "error");
- _context2.prev = 7;
- _context2.next = 10;
- return this.parseXML(message);
- case 10:
- _context2.t0 = _context2.sent;
- if (_context2.t0) {
- _context2.next = 13;
- break;
- }
- _context2.t0 = {};
- case 13:
- info = _context2.t0;
- _context2.next = 23;
- break;
- case 16:
- _context2.prev = 16;
- _context2.t1 = _context2["catch"](7);
- this.debug(message, "error");
- _context2.t1.message += "\nraw xml: ".concat(message);
- _context2.t1.status = result.status;
- _context2.t1.requestId = result.headers["x-oss-request-id"];
- return _context2.abrupt("return", _context2.t1);
- case 23:
- msg = info.Message || "unknow request error, status: ".concat(result.status);
- if (info.Condition) {
- msg += " (condition: ".concat(info.Condition, ")");
- }
- err = new Error(msg);
- err.name = info.Code ? "".concat(info.Code, "Error") : "UnknownError";
- err.status = result.status;
- err.code = info.Code;
- err.requestId = info.RequestId;
- err.hostId = info.HostId;
- err.serverTime = info.ServerTime;
- case 32:
- this.debug("generate error %j", err, "error");
- return _context2.abrupt("return", err);
- case 34:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this, [[7, 16]]);
- }));
- function requestError(_x3) {
- return _requestError.apply(this, arguments);
- }
- return requestError;
- }();
- }).call(this);
- }).call(this, { "isBuffer": require2("../../node_modules/is-buffer/index.js") }, require2("_process"));
- }, { "../../node_modules/is-buffer/index.js": 366, "../common/bucket/abortBucketWorm": 7, "../common/bucket/completeBucketWorm": 8, "../common/bucket/deleteBucketInventory": 9, "../common/bucket/deleteBucketLifecycle": 10, "../common/bucket/deleteBucketWebsite": 11, "../common/bucket/extendBucketWorm": 12, "../common/bucket/getBucketInventory": 13, "../common/bucket/getBucketLifecycle": 14, "../common/bucket/getBucketVersioning": 15, "../common/bucket/getBucketWebsite": 16, "../common/bucket/getBucketWorm": 17, "../common/bucket/initiateBucketWorm": 18, "../common/bucket/listBucketInventory": 19, "../common/bucket/putBucketInventory": 20, "../common/bucket/putBucketLifecycle": 21, "../common/bucket/putBucketVersioning": 22, "../common/bucket/putBucketWebsite": 23, "../common/client/getReqUrl": 25, "../common/client/initOptions": 26, "../common/multipart": 30, "../common/multipart-copy": 29, "../common/parallel": 49, "../common/signUtils": 50, "../common/utils/createRequest": 56, "../common/utils/encoder": 59, "../common/utils/isFunction": 68, "../common/utils/retry": 74, "../common/utils/setSTSToken": 76, "./bucket": 2, "./managed-upload": 4, "./object": 5, "./version": 6, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "agentkeepalive": 81, "bowser": 88, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.symbol.description.js": 310, "core-js/modules/es.symbol.js": 313, "debug": 465, "merge-descriptors": 372, "platform": 379, "urllib": 475, "utility": 474, "xml2js": 426 }], 4: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.array.from.js");
- require2("core-js/modules/es.string.iterator.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.array.filter.js");
- require2("core-js/modules/es.array.find.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.regexp.to-string.js");
- require2("core-js/modules/es.array.slice.js");
- require2("core-js/modules/es.array.iterator.js");
- require2("core-js/modules/es.array-buffer.slice.js");
- require2("core-js/modules/es.typed-array.uint8-array.js");
- require2("core-js/modules/es.typed-array.copy-within.js");
- require2("core-js/modules/es.typed-array.every.js");
- require2("core-js/modules/es.typed-array.fill.js");
- require2("core-js/modules/es.typed-array.filter.js");
- require2("core-js/modules/es.typed-array.find.js");
- require2("core-js/modules/es.typed-array.find-index.js");
- require2("core-js/modules/es.typed-array.for-each.js");
- require2("core-js/modules/es.typed-array.includes.js");
- require2("core-js/modules/es.typed-array.index-of.js");
- require2("core-js/modules/es.typed-array.iterator.js");
- require2("core-js/modules/es.typed-array.join.js");
- require2("core-js/modules/es.typed-array.last-index-of.js");
- require2("core-js/modules/es.typed-array.map.js");
- require2("core-js/modules/es.typed-array.reduce.js");
- require2("core-js/modules/es.typed-array.reduce-right.js");
- require2("core-js/modules/es.typed-array.reverse.js");
- require2("core-js/modules/es.typed-array.set.js");
- require2("core-js/modules/es.typed-array.slice.js");
- require2("core-js/modules/es.typed-array.some.js");
- require2("core-js/modules/es.typed-array.sort.js");
- require2("core-js/modules/es.typed-array.subarray.js");
- require2("core-js/modules/es.typed-array.to-locale-string.js");
- require2("core-js/modules/es.typed-array.to-string.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var util = require2("util");
- var path = require2("path");
- var mime = require2("mime");
- var copy = require2("copy-to");
- var _require = require2("../common/utils/isBlob"), isBlob = _require.isBlob;
- var _require2 = require2("../common/utils/isFile"), isFile = _require2.isFile;
- var _require3 = require2("../common/utils/isBuffer"), isBuffer = _require3.isBuffer;
- var proto = exports3;
- proto.multipartUpload = function() {
- var _multipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file) {
- var options, minPartSize, fileSize, result, ret, initResult, uploadId, partSize, checkpoint, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- this.resetCancelFlag();
- options.disabledMD5 = options.disabledMD5 === void 0 ? true : !!options.disabledMD5;
- if (!(options.checkpoint && options.checkpoint.uploadId)) {
- _context.next = 8;
- break;
- }
- if (file && isFile(file))
- options.checkpoint.file = file;
- _context.next = 7;
- return this._resumeMultipart(options.checkpoint, options);
- case 7:
- return _context.abrupt("return", _context.sent);
- case 8:
- minPartSize = 100 * 1024;
- if (!options.mime) {
- if (isFile(file)) {
- options.mime = mime.getType(path.extname(file.name));
- } else if (isBlob(file)) {
- options.mime = file.type;
- } else if (isBuffer(file)) {
- options.mime = "";
- } else {
- options.mime = mime.getType(path.extname(file));
- }
- }
- options.headers = options.headers || {};
- this._convertMetaToHeaders(options.meta, options.headers);
- _context.next = 14;
- return this._getFileSize(file);
- case 14:
- fileSize = _context.sent;
- if (!(fileSize < minPartSize)) {
- _context.next = 26;
- break;
- }
- options.contentLength = fileSize;
- _context.next = 19;
- return this.put(name, file, options);
- case 19:
- result = _context.sent;
- if (!(options && options.progress)) {
- _context.next = 23;
- break;
- }
- _context.next = 23;
- return options.progress(1);
- case 23:
- ret = {
- res: result.res,
- bucket: this.options.bucket,
- name,
- etag: result.res.headers.etag
- };
- if (options.headers && options.headers["x-oss-callback"] || options.callback) {
- ret.data = result.data;
- }
- return _context.abrupt("return", ret);
- case 26:
- if (!(options.partSize && !(parseInt(options.partSize, 10) === options.partSize))) {
- _context.next = 28;
- break;
- }
- throw new Error("partSize must be int number");
- case 28:
- if (!(options.partSize && options.partSize < minPartSize)) {
- _context.next = 30;
- break;
- }
- throw new Error("partSize must not be smaller than ".concat(minPartSize));
- case 30:
- _context.next = 32;
- return this.initMultipartUpload(name, options);
- case 32:
- initResult = _context.sent;
- uploadId = initResult.uploadId;
- partSize = this._getPartSize(fileSize, options.partSize);
- checkpoint = {
- file,
- name,
- fileSize,
- partSize,
- uploadId,
- doneParts: []
- };
- if (!(options && options.progress)) {
- _context.next = 39;
- break;
- }
- _context.next = 39;
- return options.progress(0, checkpoint, initResult.res);
- case 39:
- _context.next = 41;
- return this._resumeMultipart(checkpoint, options);
- case 41:
- return _context.abrupt("return", _context.sent);
- case 42:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function multipartUpload(_x, _x2) {
- return _multipartUpload.apply(this, arguments);
- }
- return multipartUpload;
- }();
- proto._resumeMultipart = function() {
- var _resumeMultipart2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(checkpoint, options) {
- var that, file, fileSize, partSize, uploadId, doneParts, name, internalDoneParts, partOffs, numParts, multipartFinish, uploadPartJob, all, done, todo, defaultParallel, parallel, jobErr, abortEvent;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- that = this;
- if (!this.isCancel()) {
- _context3.next = 3;
- break;
- }
- throw this._makeCancelEvent();
- case 3:
- file = checkpoint.file, fileSize = checkpoint.fileSize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name;
- internalDoneParts = [];
- if (doneParts.length > 0) {
- copy(doneParts).to(internalDoneParts);
- }
- partOffs = this._divideParts(fileSize, partSize);
- numParts = partOffs.length;
- multipartFinish = false;
- uploadPartJob = function uploadPartJob2(self2, partNo) {
- return new Promise(function() {
- var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(resolve, reject) {
- var pi, content, data, result, tempErr;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- _context2.prev = 0;
- if (self2.isCancel()) {
- _context2.next = 29;
- break;
- }
- pi = partOffs[partNo - 1];
- _context2.next = 5;
- return self2._createBuffer(file, pi.start, pi.end);
- case 5:
- content = _context2.sent;
- data = {
- content,
- size: pi.end - pi.start
- };
- _context2.prev = 7;
- _context2.next = 10;
- return self2._uploadPart(name, uploadId, partNo, data, options);
- case 10:
- result = _context2.sent;
- _context2.next = 18;
- break;
- case 13:
- _context2.prev = 13;
- _context2.t0 = _context2["catch"](7);
- if (!(_context2.t0.status === 404)) {
- _context2.next = 17;
- break;
- }
- throw self2._makeAbortEvent();
- case 17:
- throw _context2.t0;
- case 18:
- if (!(!self2.isCancel() && !multipartFinish)) {
- _context2.next = 26;
- break;
- }
- checkpoint.doneParts.push({
- number: partNo,
- etag: result.res.headers.etag
- });
- if (!options.progress) {
- _context2.next = 23;
- break;
- }
- _context2.next = 23;
- return options.progress(doneParts.length / (numParts + 1), checkpoint, result.res);
- case 23:
- resolve({
- number: partNo,
- etag: result.res.headers.etag
- });
- _context2.next = 27;
- break;
- case 26:
- resolve();
- case 27:
- _context2.next = 30;
- break;
- case 29:
- resolve();
- case 30:
- _context2.next = 41;
- break;
- case 32:
- _context2.prev = 32;
- _context2.t1 = _context2["catch"](0);
- tempErr = new Error();
- tempErr.name = _context2.t1.name;
- tempErr.message = _context2.t1.message;
- tempErr.stack = _context2.t1.stack;
- tempErr.partNum = partNo;
- copy(_context2.t1).to(tempErr);
- reject(tempErr);
- case 41:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, null, [[0, 32], [7, 13]]);
- }));
- return function(_x5, _x6) {
- return _ref.apply(this, arguments);
- };
- }());
- };
- all = Array.from(new Array(numParts), function(x, i) {
- return i + 1;
- });
- done = internalDoneParts.map(function(p) {
- return p.number;
- });
- todo = all.filter(function(p) {
- return done.indexOf(p) < 0;
- });
- defaultParallel = 5;
- parallel = options.parallel || defaultParallel;
- _context3.next = 17;
- return this._parallel(todo, parallel, function(value) {
- return new Promise(function(resolve, reject) {
- uploadPartJob(that, value).then(function(result) {
- if (result) {
- internalDoneParts.push(result);
- }
- resolve();
- }).catch(function(err) {
- reject(err);
- });
- });
- });
- case 17:
- jobErr = _context3.sent;
- multipartFinish = true;
- abortEvent = jobErr.find(function(err) {
- return err.name === "abort";
- });
- if (!abortEvent) {
- _context3.next = 22;
- break;
- }
- throw abortEvent;
- case 22:
- if (!this.isCancel()) {
- _context3.next = 25;
- break;
- }
- uploadPartJob = null;
- throw this._makeCancelEvent();
- case 25:
- if (!(jobErr && jobErr.length > 0)) {
- _context3.next = 28;
- break;
- }
- jobErr[0].message = "Failed to upload some parts with error: ".concat(jobErr[0].toString(), " part_num: ").concat(jobErr[0].partNum);
- throw jobErr[0];
- case 28:
- _context3.next = 30;
- return this.completeMultipartUpload(name, uploadId, internalDoneParts, options);
- case 30:
- return _context3.abrupt("return", _context3.sent);
- case 31:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function _resumeMultipart(_x3, _x4) {
- return _resumeMultipart2.apply(this, arguments);
- }
- return _resumeMultipart;
- }();
- proto._getFileSize = function() {
- var _getFileSize2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(file) {
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- if (!isBuffer(file)) {
- _context4.next = 4;
- break;
- }
- return _context4.abrupt("return", file.length);
- case 4:
- if (!(isBlob(file) || isFile(file))) {
- _context4.next = 6;
- break;
- }
- return _context4.abrupt("return", file.size);
- case 6:
- throw new Error("_getFileSize requires Buffer/File/Blob.");
- case 7:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4);
- }));
- function _getFileSize(_x7) {
- return _getFileSize2.apply(this, arguments);
- }
- return _getFileSize;
- }();
- var _require4 = require2("stream"), Readable = _require4.Readable;
- function WebFileReadStream(file, options) {
- if (!(this instanceof WebFileReadStream)) {
- return new WebFileReadStream(file, options);
- }
- Readable.call(this, options);
- this.file = file;
- this.reader = new FileReader();
- this.start = 0;
- this.finish = false;
- this.fileBuffer = null;
- }
- util.inherits(WebFileReadStream, Readable);
- WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) {
- if (this.fileBuffer) {
- var pushRet = true;
- while (pushRet && this.fileBuffer && this.start < this.fileBuffer.length) {
- var start = this.start;
- var end = start + size;
- end = end > this.fileBuffer.length ? this.fileBuffer.length : end;
- this.start = end;
- pushRet = this.push(this.fileBuffer.slice(start, end));
- }
- }
- };
- WebFileReadStream.prototype._read = function _read(size) {
- if (this.file && this.start >= this.file.size || this.fileBuffer && this.start >= this.fileBuffer.length || this.finish || this.start === 0 && !this.file) {
- if (!this.finish) {
- this.fileBuffer = null;
- this.finish = true;
- }
- this.push(null);
- return;
- }
- var defaultReadSize = 16 * 1024;
- size = size || defaultReadSize;
- var that = this;
- this.reader.onload = function onload(e) {
- that.fileBuffer = Buffer.from(new Uint8Array(e.target.result));
- that.file = null;
- that.readFileAndPush(size);
- };
- if (this.start === 0) {
- this.reader.readAsArrayBuffer(this.file);
- } else {
- this.readFileAndPush(size);
- }
- };
- function getBuffer(file) {
- if (file.arrayBuffer)
- return file.arrayBuffer();
- return new Promise(function(resolve, reject) {
- var reader = new FileReader();
- reader.onload = function(e) {
- resolve(e.target.result);
- };
- reader.onerror = function(e) {
- reject(e);
- };
- reader.readAsArrayBuffer(file);
- });
- }
- proto._createBuffer = function() {
- var _createBuffer2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(file, start, end) {
- var _file, fileContent;
- return _regenerator.default.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- if (!(isBlob(file) || isFile(file))) {
- _context5.next = 8;
- break;
- }
- _file = file.slice(start, end);
- _context5.next = 4;
- return getBuffer(_file);
- case 4:
- fileContent = _context5.sent;
- return _context5.abrupt("return", Buffer.from(fileContent));
- case 8:
- if (!isBuffer(file)) {
- _context5.next = 12;
- break;
- }
- return _context5.abrupt("return", file.subarray(start, end));
- case 12:
- throw new Error("_createBuffer requires File/Blob/Buffer.");
- case 13:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5);
- }));
- function _createBuffer(_x8, _x9, _x10) {
- return _createBuffer2.apply(this, arguments);
- }
- return _createBuffer;
- }();
- proto._getPartSize = function _getPartSize(fileSize, partSize) {
- var maxNumParts = 10 * 1e3;
- var defaultPartSize = 1 * 1024 * 1024;
- if (!partSize)
- partSize = defaultPartSize;
- var safeSize = Math.ceil(fileSize / maxNumParts);
- if (partSize < safeSize) {
- partSize = safeSize;
- console.warn("partSize has been set to ".concat(partSize, ", because the partSize you provided causes partNumber to be greater than 10,000"));
- }
- return partSize;
- };
- proto._divideParts = function _divideParts(fileSize, partSize) {
- var numParts = Math.ceil(fileSize / partSize);
- var partOffs = [];
- for (var i = 0; i < numParts; i++) {
- var start = partSize * i;
- var end = Math.min(start + partSize, fileSize);
- partOffs.push({
- start,
- end
- });
- }
- return partOffs;
- };
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "../common/utils/isBlob": 64, "../common/utils/isBuffer": 65, "../common/utils/isFile": 67, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "buffer": 90, "copy-to": 94, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/es.typed-array.copy-within.js": 315, "core-js/modules/es.typed-array.every.js": 316, "core-js/modules/es.typed-array.fill.js": 317, "core-js/modules/es.typed-array.filter.js": 318, "core-js/modules/es.typed-array.find-index.js": 319, "core-js/modules/es.typed-array.find.js": 320, "core-js/modules/es.typed-array.for-each.js": 321, "core-js/modules/es.typed-array.includes.js": 322, "core-js/modules/es.typed-array.index-of.js": 323, "core-js/modules/es.typed-array.iterator.js": 324, "core-js/modules/es.typed-array.join.js": 325, "core-js/modules/es.typed-array.last-index-of.js": 326, "core-js/modules/es.typed-array.map.js": 327, "core-js/modules/es.typed-array.reduce-right.js": 328, "core-js/modules/es.typed-array.reduce.js": 329, "core-js/modules/es.typed-array.reverse.js": 330, "core-js/modules/es.typed-array.set.js": 331, "core-js/modules/es.typed-array.slice.js": 332, "core-js/modules/es.typed-array.some.js": 333, "core-js/modules/es.typed-array.sort.js": 334, "core-js/modules/es.typed-array.subarray.js": 335, "core-js/modules/es.typed-array.to-locale-string.js": 336, "core-js/modules/es.typed-array.to-string.js": 337, "core-js/modules/es.typed-array.uint8-array.js": 338, "mime": 374, "path": 378, "stream": 398, "util": 419 }], 5: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.regexp.to-string.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.number.constructor.js");
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.promise.js");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var fs = require2("fs");
- var copy = require2("copy-to");
- var path = require2("path");
- var mime = require2("mime");
- var callback = require2("../common/callback");
- var merge = require2("merge-descriptors");
- var _require = require2("../common/utils/isBlob"), isBlob = _require.isBlob;
- var _require2 = require2("../common/utils/isFile"), isFile = _require2.isFile;
- var _require3 = require2("../common/utils/isBuffer"), isBuffer = _require3.isBuffer;
- var _require4 = require2("../common/utils/obj2xml"), obj2xml = _require4.obj2xml;
- var proto = exports3;
- proto.append = function() {
- var _append = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file, options) {
- var result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = options || {};
- if (options.position === void 0)
- options.position = "0";
- options.subres = {
- append: "",
- position: options.position
- };
- options.method = "POST";
- _context.next = 6;
- return this.put(name, file, options);
- case 6:
- result = _context.sent;
- result.nextAppendPosition = result.res.headers["x-oss-next-append-position"];
- return _context.abrupt("return", result);
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function append(_x, _x2, _x3) {
- return _append.apply(this, arguments);
- }
- return append;
- }();
- proto.put = function() {
- var _put = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, file, options) {
- var content, method, params, result, ret;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- options = options || {};
- options.disabledMD5 = options.disabledMD5 === void 0 ? true : !!options.disabledMD5;
- options.headers = options.headers || {};
- name = this._objectName(name);
- if (!isBuffer(file)) {
- _context2.next = 8;
- break;
- }
- content = file;
- _context2.next = 19;
- break;
- case 8:
- if (!(isBlob(file) || isFile(file))) {
- _context2.next = 18;
- break;
- }
- if (!options.mime) {
- if (isFile(file)) {
- options.mime = mime.getType(path.extname(file.name));
- } else {
- options.mime = file.type;
- }
- }
- _context2.next = 12;
- return this._createBuffer(file, 0, file.size);
- case 12:
- content = _context2.sent;
- _context2.next = 15;
- return this._getFileSize(file);
- case 15:
- options.contentLength = _context2.sent;
- _context2.next = 19;
- break;
- case 18:
- throw new TypeError("Must provide Buffer/Blob/File for put.");
- case 19:
- this._convertMetaToHeaders(options.meta, options.headers);
- method = options.method || "PUT";
- params = this._objectRequestParams(method, name, options);
- callback.encodeCallback(params, options);
- params.mime = options.mime;
- params.disabledMD5 = options.disabledMD5;
- params.content = content;
- params.successStatuses = [200];
- _context2.next = 29;
- return this.request(params);
- case 29:
- result = _context2.sent;
- ret = {
- name,
- url: this._objectUrl(name),
- res: result.res
- };
- if (params.headers && params.headers["x-oss-callback"]) {
- ret.data = JSON.parse(result.data.toString());
- }
- return _context2.abrupt("return", ret);
- case 33:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function put(_x4, _x5, _x6) {
- return _put.apply(this, arguments);
- }
- return put;
- }();
- proto.putStream = function() {
- var _putStream = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, stream, options) {
- var method, params, result, ret;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- options = options || {};
- options.headers = options.headers || {};
- name = this._objectName(name);
- if (options.contentLength) {
- options.headers["Content-Length"] = options.contentLength;
- } else {
- options.headers["Transfer-Encoding"] = "chunked";
- }
- this._convertMetaToHeaders(options.meta, options.headers);
- method = options.method || "PUT";
- params = this._objectRequestParams(method, name, options);
- callback.encodeCallback(params, options);
- params.mime = options.mime;
- params.stream = stream;
- params.successStatuses = [200];
- _context3.next = 13;
- return this.request(params);
- case 13:
- result = _context3.sent;
- ret = {
- name,
- url: this._objectUrl(name),
- res: result.res
- };
- if (params.headers && params.headers["x-oss-callback"]) {
- ret.data = JSON.parse(result.data.toString());
- }
- return _context3.abrupt("return", ret);
- case 17:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function putStream(_x7, _x8, _x9) {
- return _putStream.apply(this, arguments);
- }
- return putStream;
- }();
- merge(proto, require2("../common/object/copyObject"));
- merge(proto, require2("../common/object/getObjectTagging"));
- merge(proto, require2("../common/object/putObjectTagging"));
- merge(proto, require2("../common/object/deleteObjectTagging"));
- merge(proto, require2("../common/image"));
- merge(proto, require2("../common/object/getBucketVersions"));
- merge(proto, require2("../common/object/getACL"));
- merge(proto, require2("../common/object/putACL"));
- merge(proto, require2("../common/object/head"));
- merge(proto, require2("../common/object/delete"));
- merge(proto, require2("../common/object/get"));
- merge(proto, require2("../common/object/putSymlink"));
- merge(proto, require2("../common/object/getSymlink"));
- merge(proto, require2("../common/object/deleteMulti"));
- merge(proto, require2("../common/object/getObjectMeta"));
- merge(proto, require2("../common/object/getObjectUrl"));
- merge(proto, require2("../common/object/generateObjectUrl"));
- merge(proto, require2("../common/object/signatureUrl"));
- merge(proto, require2("../common/object/asyncSignatureUrl"));
- proto.putMeta = function() {
- var _putMeta = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, meta, options) {
- var copyResult;
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- _context4.next = 2;
- return this.copy(name, name, {
- meta: meta || {},
- timeout: options && options.timeout,
- ctx: options && options.ctx
- });
- case 2:
- copyResult = _context4.sent;
- return _context4.abrupt("return", copyResult);
- case 4:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- function putMeta(_x10, _x11, _x12) {
- return _putMeta.apply(this, arguments);
- }
- return putMeta;
- }();
- proto.list = function() {
- var _list = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(query, options) {
- var params, result, objects, that, prefixes;
- return _regenerator.default.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- params = this._objectRequestParams("GET", "", options);
- params.query = query;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context5.next = 6;
- return this.request(params);
- case 6:
- result = _context5.sent;
- objects = result.data.Contents || [];
- that = this;
- if (objects) {
- if (!Array.isArray(objects)) {
- objects = [objects];
- }
- objects = objects.map(function(obj) {
- return {
- name: obj.Key,
- url: that._objectUrl(obj.Key),
- lastModified: obj.LastModified,
- etag: obj.ETag,
- type: obj.Type,
- size: Number(obj.Size),
- storageClass: obj.StorageClass,
- owner: {
- id: obj.Owner.ID,
- displayName: obj.Owner.DisplayName
- }
- };
- });
- }
- prefixes = result.data.CommonPrefixes || null;
- if (prefixes) {
- if (!Array.isArray(prefixes)) {
- prefixes = [prefixes];
- }
- prefixes = prefixes.map(function(item) {
- return item.Prefix;
- });
- }
- return _context5.abrupt("return", {
- res: result.res,
- objects,
- prefixes,
- nextMarker: result.data.NextMarker || null,
- isTruncated: result.data.IsTruncated === "true"
- });
- case 13:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- function list(_x13, _x14) {
- return _list.apply(this, arguments);
- }
- return list;
- }();
- proto.listV2 = function() {
- var _listV = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(query) {
- var options, continuation_token, params, result, objects, that, prefixes, _args6 = arguments;
- return _regenerator.default.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- options = _args6.length > 1 && _args6[1] !== void 0 ? _args6[1] : {};
- continuation_token = query["continuation-token"] || query.continuationToken;
- if (continuation_token) {
- options.subres = Object.assign({
- "continuation-token": continuation_token
- }, options.subres);
- }
- params = this._objectRequestParams("GET", "", options);
- params.query = Object.assign({
- "list-type": 2
- }, query);
- delete params.query["continuation-token"];
- delete params.query.continuationToken;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context6.next = 11;
- return this.request(params);
- case 11:
- result = _context6.sent;
- objects = result.data.Contents || [];
- that = this;
- if (objects) {
- if (!Array.isArray(objects)) {
- objects = [objects];
- }
- objects = objects.map(function(obj) {
- var owner = null;
- if (obj.Owner) {
- owner = {
- id: obj.Owner.ID,
- displayName: obj.Owner.DisplayName
- };
- }
- return {
- name: obj.Key,
- url: that._objectUrl(obj.Key),
- lastModified: obj.LastModified,
- etag: obj.ETag,
- type: obj.Type,
- size: Number(obj.Size),
- storageClass: obj.StorageClass,
- owner
- };
- });
- }
- prefixes = result.data.CommonPrefixes || null;
- if (prefixes) {
- if (!Array.isArray(prefixes)) {
- prefixes = [prefixes];
- }
- prefixes = prefixes.map(function(item) {
- return item.Prefix;
- });
- }
- return _context6.abrupt("return", {
- res: result.res,
- objects,
- prefixes,
- isTruncated: result.data.IsTruncated === "true",
- keyCount: +result.data.KeyCount,
- continuationToken: result.data.ContinuationToken || null,
- nextContinuationToken: result.data.NextContinuationToken || null
- });
- case 18:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6, this);
- }));
- function listV2(_x15) {
- return _listV.apply(this, arguments);
- }
- return listV2;
- }();
- proto.restore = function() {
- var _restore = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name) {
- var options, params, paramsXMLObj, result, _args7 = arguments;
- return _regenerator.default.wrap(function _callee7$(_context7) {
- while (1) {
- switch (_context7.prev = _context7.next) {
- case 0:
- options = _args7.length > 1 && _args7[1] !== void 0 ? _args7[1] : {
- type: "Archive"
- };
- options = options || {};
- options.subres = Object.assign({
- restore: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("POST", name, options);
- if (options.type === "ColdArchive") {
- paramsXMLObj = {
- RestoreRequest: {
- Days: options.Days ? options.Days : 2,
- JobParameters: {
- Tier: options.JobParameters ? options.JobParameters : "Standard"
- }
- }
- };
- params.content = obj2xml(paramsXMLObj, {
- headers: true
- });
- params.mime = "xml";
- }
- params.successStatuses = [202];
- _context7.next = 9;
- return this.request(params);
- case 9:
- result = _context7.sent;
- return _context7.abrupt("return", {
- res: result.res
- });
- case 11:
- case "end":
- return _context7.stop();
- }
- }
- }, _callee7, this);
- }));
- function restore(_x16) {
- return _restore.apply(this, arguments);
- }
- return restore;
- }();
- proto._objectUrl = function _objectUrl(name) {
- return this._getReqUrl({
- bucket: this.options.bucket,
- object: name
- });
- };
- proto._objectRequestParams = function _objectRequestParams(method, name, options) {
- if (!this.options.bucket && !this.options.cname) {
- throw new Error("Please create a bucket first");
- }
- options = options || {};
- name = this._objectName(name);
- var params = {
- object: name,
- bucket: this.options.bucket,
- method,
- subres: options && options.subres,
- timeout: options && options.timeout,
- ctx: options && options.ctx
- };
- if (options.headers) {
- params.headers = {};
- copy(options.headers).to(params.headers);
- }
- return params;
- };
- proto._objectName = function _objectName(name) {
- return name.replace(/^\/+/, "");
- };
- proto._convertMetaToHeaders = function _convertMetaToHeaders(meta, headers) {
- if (!meta) {
- return;
- }
- Object.keys(meta).forEach(function(k) {
- headers["x-oss-meta-".concat(k)] = meta[k];
- });
- };
- proto._deleteFileSafe = function _deleteFileSafe(filepath) {
- var _this = this;
- return new Promise(function(resolve) {
- fs.exists(filepath, function(exists) {
- if (!exists) {
- resolve();
- } else {
- fs.unlink(filepath, function(err) {
- if (err) {
- _this.debug("unlink %j error: %s", filepath, err, "error");
- }
- resolve();
- });
- }
- });
- });
- };
- }, { "../common/callback": 24, "../common/image": 27, "../common/object/asyncSignatureUrl": 31, "../common/object/copyObject": 32, "../common/object/delete": 33, "../common/object/deleteMulti": 34, "../common/object/deleteObjectTagging": 35, "../common/object/generateObjectUrl": 36, "../common/object/get": 37, "../common/object/getACL": 38, "../common/object/getBucketVersions": 39, "../common/object/getObjectMeta": 40, "../common/object/getObjectTagging": 41, "../common/object/getObjectUrl": 42, "../common/object/getSymlink": 43, "../common/object/head": 44, "../common/object/putACL": 45, "../common/object/putObjectTagging": 46, "../common/object/putSymlink": 47, "../common/object/signatureUrl": 48, "../common/utils/isBlob": 64, "../common/utils/isBuffer": 65, "../common/utils/isFile": 67, "../common/utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.number.constructor.js": 286, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339, "fs": 89, "merge-descriptors": 372, "mime": 374, "path": 378 }], 6: [function(require2, module3, exports3) {
- "use strict";
- exports3.version = "6.19.0";
- }, {}], 7: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.abortBucketWorm = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- function abortBucketWorm(_x, _x2) {
- return _abortBucketWorm.apply(this, arguments);
- }
- function _abortBucketWorm() {
- _abortBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkBucketName_1.checkBucketName(name);
- params = this._bucketRequestParams("DELETE", name, "worm", options);
- _context.next = 4;
- return this.request(params);
- case 4:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.status
- });
- case 6:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _abortBucketWorm.apply(this, arguments);
- }
- exports3.abortBucketWorm = abortBucketWorm;
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 8: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.completeBucketWorm = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- function completeBucketWorm(_x, _x2, _x3) {
- return _completeBucketWorm.apply(this, arguments);
- }
- function _completeBucketWorm() {
- _completeBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, wormId, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkBucketName_1.checkBucketName(name);
- params = this._bucketRequestParams("POST", name, {
- wormId
- }, options);
- _context.next = 4;
- return this.request(params);
- case 4:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.status
- });
- case 6:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _completeBucketWorm.apply(this, arguments);
- }
- exports3.completeBucketWorm = completeBucketWorm;
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 9: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.deleteBucketInventory = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- function deleteBucketInventory(_x, _x2) {
- return _deleteBucketInventory.apply(this, arguments);
- }
- function _deleteBucketInventory() {
- _deleteBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventoryId) {
- var options, subres, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- subres = Object.assign({
- inventory: "",
- inventoryId
- }, options.subres);
- checkBucketName_1.checkBucketName(bucketName);
- params = this._bucketRequestParams("DELETE", bucketName, subres, options);
- params.successStatuses = [204];
- _context.next = 7;
- return this.request(params);
- case 7:
- result = _context.sent;
- return _context.abrupt("return", {
- status: result.status,
- res: result.res
- });
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _deleteBucketInventory.apply(this, arguments);
- }
- exports3.deleteBucketInventory = deleteBucketInventory;
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 10: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var proto = exports3;
- proto.deleteBucketLifecycle = function() {
- var _deleteBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(name);
- params = this._bucketRequestParams("DELETE", name, "lifecycle", options);
- params.successStatuses = [204];
- _context.next = 5;
- return this.request(params);
- case 5:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 7:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function deleteBucketLifecycle(_x, _x2) {
- return _deleteBucketLifecycle.apply(this, arguments);
- }
- return deleteBucketLifecycle;
- }();
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 11: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var proto = exports3;
- proto.deleteBucketWebsite = function() {
- var _deleteBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(name);
- params = this._bucketRequestParams("DELETE", name, "website", options);
- params.successStatuses = [204];
- _context.next = 5;
- return this.request(params);
- case 5:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 7:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function deleteBucketWebsite(_x, _x2) {
- return _deleteBucketWebsite.apply(this, arguments);
- }
- return deleteBucketWebsite;
- }();
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 12: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.extendBucketWorm = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- var obj2xml_1 = require2("../utils/obj2xml");
- function extendBucketWorm(_x, _x2, _x3, _x4) {
- return _extendBucketWorm.apply(this, arguments);
- }
- function _extendBucketWorm() {
- _extendBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, wormId, days, options) {
- var params, paramlXMLObJ, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkBucketName_1.checkBucketName(name);
- params = this._bucketRequestParams("POST", name, {
- wormExtend: "",
- wormId
- }, options);
- paramlXMLObJ = {
- ExtendWormConfiguration: {
- RetentionPeriodInDays: days
- }
- };
- params.mime = "xml";
- params.content = obj2xml_1.obj2xml(paramlXMLObJ, {
- headers: true
- });
- params.successStatuses = [200];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.status
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _extendBucketWorm.apply(this, arguments);
- }
- exports3.extendBucketWorm = extendBucketWorm;
- }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 13: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.getBucketInventory = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- var formatInventoryConfig_1 = require2("../utils/formatInventoryConfig");
- function getBucketInventory(_x, _x2) {
- return _getBucketInventory.apply(this, arguments);
- }
- function _getBucketInventory() {
- _getBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventoryId) {
- var options, subres, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- subres = Object.assign({
- inventory: "",
- inventoryId
- }, options.subres);
- checkBucketName_1.checkBucketName(bucketName);
- params = this._bucketRequestParams("GET", bucketName, subres, options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- return _context.abrupt("return", {
- status: result.status,
- res: result.res,
- inventory: formatInventoryConfig_1.formatInventoryConfig(result.data)
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _getBucketInventory.apply(this, arguments);
- }
- exports3.getBucketInventory = getBucketInventory;
- }, { "../utils/checkBucketName": 51, "../utils/formatInventoryConfig": 60, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 14: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.map.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
- var _require3 = require2("../utils/formatObjKey"), formatObjKey = _require3.formatObjKey;
- var proto = exports3;
- proto.getBucketLifecycle = function() {
- var _getBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result, rules;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(name);
- params = this._bucketRequestParams("GET", name, "lifecycle", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 6;
- return this.request(params);
- case 6:
- result = _context.sent;
- rules = result.data.Rule || null;
- if (rules) {
- if (!isArray(rules)) {
- rules = [rules];
- }
- rules = rules.map(function(_) {
- if (_.ID) {
- _.id = _.ID;
- delete _.ID;
- }
- if (_.Tag && !isArray(_.Tag)) {
- _.Tag = [_.Tag];
- }
- return formatObjKey(_, "firstLowerCase");
- });
- }
- return _context.abrupt("return", {
- rules,
- res: result.res
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getBucketLifecycle(_x, _x2) {
- return _getBucketLifecycle.apply(this, arguments);
- }
- return getBucketLifecycle;
- }();
- }, { "../utils/checkBucketName": 51, "../utils/formatObjKey": 61, "../utils/isArray": 63, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280 }], 15: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var proto = exports3;
- proto.getBucketVersioning = function() {
- var _getBucketVersioning = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, options) {
- var params, result, versionStatus;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(bucketName);
- params = this._bucketRequestParams("GET", bucketName, "versioning", options);
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context.next = 6;
- return this.request(params);
- case 6:
- result = _context.sent;
- versionStatus = result.data.Status;
- return _context.abrupt("return", {
- status: result.status,
- versionStatus,
- res: result.res
- });
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getBucketVersioning(_x, _x2) {
- return _getBucketVersioning.apply(this, arguments);
- }
- return getBucketVersioning;
- }();
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 16: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/isObject"), isObject = _require2.isObject;
- var proto = exports3;
- proto.getBucketWebsite = function() {
- var _getBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result, routingRules;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(name);
- params = this._bucketRequestParams("GET", name, "website", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 6;
- return this.request(params);
- case 6:
- result = _context.sent;
- routingRules = [];
- if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) {
- if (isObject(result.data.RoutingRules.RoutingRule)) {
- routingRules = [result.data.RoutingRules.RoutingRule];
- } else {
- routingRules = result.data.RoutingRules.RoutingRule;
- }
- }
- return _context.abrupt("return", {
- index: result.data.IndexDocument && result.data.IndexDocument.Suffix || "",
- supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || "false",
- type: result.data.IndexDocument && result.data.IndexDocument.Type,
- routingRules,
- error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null,
- res: result.res
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getBucketWebsite(_x, _x2) {
- return _getBucketWebsite.apply(this, arguments);
- }
- return getBucketWebsite;
- }();
- }, { "../utils/checkBucketName": 51, "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 17: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.getBucketWorm = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- var dataFix_1 = require2("../utils/dataFix");
- function getBucketWorm(_x, _x2) {
- return _getBucketWorm.apply(this, arguments);
- }
- function _getBucketWorm() {
- _getBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkBucketName_1.checkBucketName(name);
- params = this._bucketRequestParams("GET", name, "worm", options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 6;
- return this.request(params);
- case 6:
- result = _context.sent;
- dataFix_1.dataFix(result.data, {
- lowerFirst: true,
- rename: {
- RetentionPeriodInDays: "days"
- }
- });
- return _context.abrupt("return", Object.assign(Object.assign({}, result.data), {
- res: result.res,
- status: result.status
- }));
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _getBucketWorm.apply(this, arguments);
- }
- exports3.getBucketWorm = getBucketWorm;
- }, { "../utils/checkBucketName": 51, "../utils/dataFix": 57, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 18: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.initiateBucketWorm = void 0;
- var obj2xml_1 = require2("../utils/obj2xml");
- var checkBucketName_1 = require2("../utils/checkBucketName");
- function initiateBucketWorm(_x, _x2, _x3) {
- return _initiateBucketWorm.apply(this, arguments);
- }
- function _initiateBucketWorm() {
- _initiateBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, days, options) {
- var params, paramlXMLObJ, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkBucketName_1.checkBucketName(name);
- params = this._bucketRequestParams("POST", name, "worm", options);
- paramlXMLObJ = {
- InitiateWormConfiguration: {
- RetentionPeriodInDays: days
- }
- };
- params.mime = "xml";
- params.content = obj2xml_1.obj2xml(paramlXMLObJ, {
- headers: true
- });
- params.successStatuses = [200];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- wormId: result.res.headers["x-oss-worm-id"],
- status: result.status
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _initiateBucketWorm.apply(this, arguments);
- }
- exports3.initiateBucketWorm = initiateBucketWorm;
- }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 19: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.listBucketInventory = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- var formatInventoryConfig_1 = require2("../utils/formatInventoryConfig");
- function listBucketInventory(_x) {
- return _listBucketInventory.apply(this, arguments);
- }
- function _listBucketInventory() {
- _listBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName) {
- var options, continuationToken, subres, params, result, data, res, status, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- continuationToken = options.continuationToken;
- subres = Object.assign({
- inventory: ""
- }, continuationToken && {
- "continuation-token": continuationToken
- }, options.subres);
- checkBucketName_1.checkBucketName(bucketName);
- params = this._bucketRequestParams("GET", bucketName, subres, options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 9;
- return this.request(params);
- case 9:
- result = _context.sent;
- data = result.data, res = result.res, status = result.status;
- return _context.abrupt("return", {
- isTruncated: data.IsTruncated === "true",
- nextContinuationToken: data.NextContinuationToken,
- inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true),
- status,
- res
- });
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _listBucketInventory.apply(this, arguments);
- }
- exports3.listBucketInventory = listBucketInventory;
- }, { "../utils/checkBucketName": 51, "../utils/formatInventoryConfig": 60, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 20: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.array.concat.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.putBucketInventory = void 0;
- var checkBucketName_1 = require2("../utils/checkBucketName");
- var obj2xml_1 = require2("../utils/obj2xml");
- function putBucketInventory(_x, _x2) {
- return _putBucketInventory.apply(this, arguments);
- }
- function _putBucketInventory() {
- _putBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventory) {
- var options, subres, OSSBucketDestination, optionalFields, includedObjectVersions, destinationBucketPrefix, rolePrefix, paramXMLObj, paramXML, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- subres = Object.assign({
- inventory: "",
- inventoryId: inventory.id
- }, options.subres);
- checkBucketName_1.checkBucketName(bucketName);
- OSSBucketDestination = inventory.OSSBucketDestination, optionalFields = inventory.optionalFields, includedObjectVersions = inventory.includedObjectVersions;
- destinationBucketPrefix = "acs:oss:::";
- rolePrefix = "acs:ram::".concat(OSSBucketDestination.accountId, ":role/");
- paramXMLObj = {
- InventoryConfiguration: {
- Id: inventory.id,
- IsEnabled: inventory.isEnabled,
- Filter: {
- Prefix: inventory.prefix || ""
- },
- Destination: {
- OSSBucketDestination: {
- Format: OSSBucketDestination.format,
- AccountId: OSSBucketDestination.accountId,
- RoleArn: "".concat(rolePrefix).concat(OSSBucketDestination.rolename),
- Bucket: "".concat(destinationBucketPrefix).concat(OSSBucketDestination.bucket),
- Prefix: OSSBucketDestination.prefix || "",
- Encryption: OSSBucketDestination.encryption || ""
- }
- },
- Schedule: {
- Frequency: inventory.frequency
- },
- IncludedObjectVersions: includedObjectVersions,
- OptionalFields: {
- Field: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.field) || []
- }
- }
- };
- paramXML = obj2xml_1.obj2xml(paramXMLObj, {
- headers: true,
- firstUpperCase: true
- });
- params = this._bucketRequestParams("PUT", bucketName, subres, options);
- params.successStatuses = [200];
- params.mime = "xml";
- params.content = paramXML;
- _context.next = 14;
- return this.request(params);
- case 14:
- result = _context.sent;
- return _context.abrupt("return", {
- status: result.status,
- res: result.res
- });
- case 16:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _putBucketInventory.apply(this, arguments);
- }
- exports3.putBucketInventory = putBucketInventory;
- }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.assign.js": 287 }], 21: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.array.includes.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
- var _require3 = require2("../utils/deepCopy"), deepCopy = _require3.deepCopy;
- var _require4 = require2("../utils/isObject"), isObject = _require4.isObject;
- var _require5 = require2("../utils/obj2xml"), obj2xml = _require5.obj2xml;
- var _require6 = require2("../utils/checkObjectTag"), checkObjectTag = _require6.checkObjectTag;
- var _require7 = require2("../utils/getStrBytesCount"), getStrBytesCount = _require7.getStrBytesCount;
- var proto = exports3;
- proto.putBucketLifecycle = function() {
- var _putBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, rules, options) {
- var params, Rule, paramXMLObj, paramXML, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _checkBucketName(name);
- if (isArray(rules)) {
- _context.next = 3;
- break;
- }
- throw new Error("rules must be Array");
- case 3:
- params = this._bucketRequestParams("PUT", name, "lifecycle", options);
- Rule = [];
- paramXMLObj = {
- LifecycleConfiguration: {
- Rule
- }
- };
- rules.forEach(function(_) {
- defaultDaysAndDate2Expiration(_);
- checkRule(_);
- if (_.id) {
- _.ID = _.id;
- delete _.id;
- }
- Rule.push(_);
- });
- paramXML = obj2xml(paramXMLObj, {
- headers: true,
- firstUpperCase: true
- });
- params.content = paramXML;
- params.mime = "xml";
- params.successStatuses = [200];
- _context.next = 13;
- return this.request(params);
- case 13:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 15:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putBucketLifecycle(_x, _x2, _x3) {
- return _putBucketLifecycle.apply(this, arguments);
- }
- return putBucketLifecycle;
- }();
- function defaultDaysAndDate2Expiration(obj) {
- if (obj.days) {
- obj.expiration = {
- days: obj.days
- };
- }
- if (obj.date) {
- obj.expiration = {
- createdBeforeDate: obj.date
- };
- }
- }
- function checkDaysAndDate(obj, key) {
- var days = obj.days, createdBeforeDate = obj.createdBeforeDate;
- if (!days && !createdBeforeDate) {
- throw new Error("".concat(key, " must includes days or createdBeforeDate"));
- } else if (days && !/^[1-9][0-9]*$/.test(days)) {
- throw new Error("days must be a positive integer");
- } else if (createdBeforeDate && !/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(createdBeforeDate)) {
- throw new Error("createdBeforeDate must be date and conform to iso8601 format");
- }
- }
- function handleCheckTag(tag) {
- if (!isArray(tag) && !isObject(tag)) {
- throw new Error("tag must be Object or Array");
- }
- tag = isObject(tag) ? [tag] : tag;
- var tagObj = {};
- var tagClone = deepCopy(tag);
- tagClone.forEach(function(v) {
- tagObj[v.key] = v.value;
- });
- checkObjectTag(tagObj);
- }
- function checkRule(rule) {
- if (rule.id && getStrBytesCount(rule.id) > 255)
- throw new Error("ID is composed of 255 bytes at most");
- if (rule.prefix === void 0)
- throw new Error("Rule must includes prefix");
- if (!["Enabled", "Disabled"].includes(rule.status))
- throw new Error("Status must be Enabled or Disabled");
- if (rule.transition) {
- if (!["IA", "Archive"].includes(rule.transition.storageClass))
- throw new Error("StorageClass must be IA or Archive");
- checkDaysAndDate(rule.transition, "Transition");
- }
- if (rule.expiration) {
- if (!rule.expiration.expiredObjectDeleteMarker) {
- checkDaysAndDate(rule.expiration, "Expiration");
- } else if (rule.expiration.days || rule.expiration.createdBeforeDate) {
- throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate");
- }
- }
- if (rule.abortMultipartUpload) {
- checkDaysAndDate(rule.abortMultipartUpload, "AbortMultipartUpload");
- }
- if (!rule.expiration && !rule.abortMultipartUpload && !rule.transition && !rule.noncurrentVersionTransition) {
- throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");
- }
- if (rule.tag) {
- if (rule.abortMultipartUpload) {
- throw new Error("Tag cannot be used with abortMultipartUpload");
- }
- handleCheckTag(rule.tag);
- }
- }
- }, { "../utils/checkBucketName": 51, "../utils/checkObjectTag": 54, "../utils/deepCopy": 58, "../utils/getStrBytesCount": 62, "../utils/isArray": 63, "../utils/isObject": 70, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/web.dom-collections.for-each.js": 339 }], 22: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.includes.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/obj2xml"), obj2xml = _require2.obj2xml;
- var proto = exports3;
- proto.putBucketVersioning = function() {
- var _putBucketVersioning = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, status) {
- var options, params, paramXMLObj, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- _checkBucketName(name);
- if (["Enabled", "Suspended"].includes(status)) {
- _context.next = 4;
- break;
- }
- throw new Error("status must be Enabled or Suspended");
- case 4:
- params = this._bucketRequestParams("PUT", name, "versioning", options);
- paramXMLObj = {
- VersioningConfiguration: {
- Status: status
- }
- };
- params.mime = "xml";
- params.content = obj2xml(paramXMLObj, {
- headers: true
- });
- _context.next = 10;
- return this.request(params);
- case 10:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.status
- });
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putBucketVersioning(_x, _x2) {
- return _putBucketVersioning.apply(this, arguments);
- }
- return putBucketVersioning;
- }();
- }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.includes.js": 277 }], 23: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/obj2xml"), obj2xml = _require2.obj2xml;
- var _require3 = require2("../utils/isArray"), isArray = _require3.isArray;
- var proto = exports3;
- proto.putBucketWebsite = function() {
- var _putBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var config, options, params, IndexDocument, WebsiteConfiguration, website, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- config = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options = _args.length > 2 ? _args[2] : void 0;
- _checkBucketName(name);
- params = this._bucketRequestParams("PUT", name, "website", options);
- IndexDocument = {
- Suffix: config.index || "index.html"
- };
- WebsiteConfiguration = {
- IndexDocument
- };
- website = {
- WebsiteConfiguration
- };
- if (config.supportSubDir) {
- IndexDocument.SupportSubDir = config.supportSubDir;
- }
- if (config.type) {
- IndexDocument.Type = config.type;
- }
- if (config.error) {
- WebsiteConfiguration.ErrorDocument = {
- Key: config.error
- };
- }
- if (!(config.routingRules !== void 0)) {
- _context.next = 14;
- break;
- }
- if (isArray(config.routingRules)) {
- _context.next = 13;
- break;
- }
- throw new Error("RoutingRules must be Array");
- case 13:
- WebsiteConfiguration.RoutingRules = {
- RoutingRule: config.routingRules
- };
- case 14:
- website = obj2xml(website);
- params.content = website;
- params.mime = "xml";
- params.successStatuses = [200];
- _context.next = 20;
- return this.request(params);
- case 20:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 22:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putBucketWebsite(_x) {
- return _putBucketWebsite.apply(this, arguments);
- }
- return putBucketWebsite;
- }();
- }, { "../utils/checkBucketName": 51, "../utils/isArray": 63, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 24: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.regexp.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- exports3.encodeCallback = function encodeCallback(reqParams, options) {
- reqParams.headers = reqParams.headers || {};
- if (!Object.prototype.hasOwnProperty.call(reqParams.headers, "x-oss-callback")) {
- if (options.callback) {
- var json = {
- callbackUrl: encodeURI(options.callback.url),
- callbackBody: options.callback.body
- };
- if (options.callback.host) {
- json.callbackHost = options.callback.host;
- }
- if (options.callback.contentType) {
- json.callbackBodyType = options.callback.contentType;
- }
- var callback = Buffer.from(JSON.stringify(json)).toString("base64");
- reqParams.headers["x-oss-callback"] = callback;
- if (options.callback.customValue) {
- var callbackVar = {};
- Object.keys(options.callback.customValue).forEach(function(key) {
- callbackVar["x:".concat(key)] = options.callback.customValue[key].toString();
- });
- reqParams.headers["x-oss-callback-var"] = Buffer.from(JSON.stringify(callbackVar)).toString("base64");
- }
- }
- }
- };
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "buffer": 90, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/web.dom-collections.for-each.js": 339 }], 25: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- var __importDefault = function(mod) {
- return mod && mod.__esModule ? mod : {
- "default": mod
- };
- };
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.getReqUrl = void 0;
- var copy_to_1 = __importDefault(require2("copy-to"));
- var url_1 = __importDefault(require2("url"));
- var merge_descriptors_1 = __importDefault(require2("merge-descriptors"));
- var is_type_of_1 = __importDefault(require2("is-type-of"));
- var isIP_1 = require2("../utils/isIP");
- var checkConfigValid_1 = require2("../utils/checkConfigValid");
- function getReqUrl(params) {
- var ep = {};
- var isCname = this.options.cname;
- checkConfigValid_1.checkConfigValid(this.options.endpoint, "endpoint");
- copy_to_1.default(this.options.endpoint, false).to(ep);
- if (params.bucket && !isCname && !isIP_1.isIP(ep.hostname) && !this.options.sldEnable) {
- ep.host = "".concat(params.bucket, ".").concat(ep.host);
- }
- var resourcePath = "/";
- if (params.bucket && this.options.sldEnable) {
- resourcePath += "".concat(params.bucket, "/");
- }
- if (params.object) {
- resourcePath += this._escape(params.object).replace(/\+/g, "%2B");
- }
- ep.pathname = resourcePath;
- var query = {};
- if (params.query) {
- merge_descriptors_1.default(query, params.query);
- }
- if (params.subres) {
- var subresAsQuery = {};
- if (is_type_of_1.default.string(params.subres)) {
- subresAsQuery[params.subres] = "";
- } else if (is_type_of_1.default.array(params.subres)) {
- params.subres.forEach(function(k) {
- subresAsQuery[k] = "";
- });
- } else {
- subresAsQuery = params.subres;
- }
- merge_descriptors_1.default(query, subresAsQuery);
- }
- ep.query = query;
- return url_1.default.format(ep);
- }
- exports3.getReqUrl = getReqUrl;
- }, { "../utils/checkConfigValid": 52, "../utils/isIP": 69, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339, "is-type-of": 466, "merge-descriptors": 372, "url": 472 }], 26: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.string.trim.js");
- var ms = require2("humanize-ms");
- var urlutil = require2("url");
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var _require2 = require2("../utils/setRegion"), setRegion = _require2.setRegion;
- var _require3 = require2("../utils/checkConfigValid"), checkConfigValid = _require3.checkConfigValid;
- function setEndpoint(endpoint, secure) {
- checkConfigValid(endpoint, "endpoint");
- var url = urlutil.parse(endpoint);
- if (!url.protocol) {
- url = urlutil.parse("http".concat(secure ? "s" : "", "://").concat(endpoint));
- }
- if (url.protocol !== "http:" && url.protocol !== "https:") {
- throw new Error("Endpoint protocol must be http or https.");
- }
- return url;
- }
- module3.exports = function(options) {
- if (!options || !options.accessKeyId || !options.accessKeySecret) {
- throw new Error("require accessKeyId, accessKeySecret");
- }
- if (options.stsToken && !options.refreshSTSToken && !options.refreshSTSTokenInterval) {
- console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken、accessKeyId、accessKeySecret automatically when sts token has expired");
- }
- if (options.bucket) {
- _checkBucketName(options.bucket);
- }
- var opts = Object.assign({
- region: "oss-cn-hangzhou",
- internal: false,
- secure: false,
- timeout: 6e4,
- bucket: null,
- endpoint: null,
- cname: false,
- isRequestPay: false,
- sldEnable: false,
- headerEncoding: "utf-8",
- refreshSTSToken: null,
- refreshSTSTokenInterval: 6e4 * 5,
- retryMax: 0
- }, options);
- opts.accessKeyId = opts.accessKeyId.trim();
- opts.accessKeySecret = opts.accessKeySecret.trim();
- if (opts.timeout) {
- opts.timeout = ms(opts.timeout);
- }
- if (opts.endpoint) {
- opts.endpoint = setEndpoint(opts.endpoint, opts.secure);
- } else if (opts.region) {
- opts.endpoint = setRegion(opts.region, opts.internal, opts.secure);
- } else {
- throw new Error("require options.endpoint or options.region");
- }
- opts.inited = true;
- return opts;
- };
- }, { "../utils/checkBucketName": 51, "../utils/checkConfigValid": 52, "../utils/setRegion": 75, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.string.trim.js": 308, "humanize-ms": 356, "url": 472 }], 27: [function(require2, module3, exports3) {
- "use strict";
- var merge = require2("merge-descriptors");
- var proto = exports3;
- merge(proto, require2("./processObjectSave"));
- }, { "./processObjectSave": 28, "merge-descriptors": 372 }], 28: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.concat.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var querystring2 = require2("querystring");
- var _require2 = require2("js-base64"), str2Base64 = _require2.Base64.encode;
- var proto = exports3;
- proto.processObjectSave = function() {
- var _processObjectSave = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(sourceObject, targetObject, process, targetBucket) {
- var params, bucketParam, content, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- checkArgs(sourceObject, "sourceObject");
- checkArgs(targetObject, "targetObject");
- checkArgs(process, "process");
- targetObject = this._objectName(targetObject);
- if (targetBucket) {
- _checkBucketName(targetBucket);
- }
- params = this._objectRequestParams("POST", sourceObject, {
- subres: "x-oss-process"
- });
- bucketParam = targetBucket ? ",b_".concat(str2Base64(targetBucket)) : "";
- targetObject = str2Base64(targetObject);
- content = {
- "x-oss-process": "".concat(process, "|sys/saveas,o_").concat(targetObject).concat(bucketParam)
- };
- params.content = querystring2.stringify(content);
- _context.next = 12;
- return this.request(params);
- case 12:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.res.status
- });
- case 14:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function processObjectSave(_x, _x2, _x3, _x4) {
- return _processObjectSave.apply(this, arguments);
- }
- return processObjectSave;
- }();
- function checkArgs(name, key) {
- if (!name) {
- throw new Error("".concat(key, " is required"));
- }
- if (typeof name !== "string") {
- throw new Error("".concat(key, " must be String"));
- }
- }
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "js-base64": 371, "querystring": 385 }], 29: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.array.from.js");
- require2("core-js/modules/es.string.iterator.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.array.filter.js");
- require2("core-js/modules/es.array.find.js");
- require2("core-js/modules/es.regexp.to-string.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var debug = require2("debug")("ali-oss:multipart-copy");
- var copy = require2("copy-to");
- var proto = exports3;
- proto.uploadPartCopy = function() {
- var _uploadPartCopy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, uploadId, partNo, range, sourceData) {
- var options, versionId, copySource, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 5 && _args[5] !== void 0 ? _args[5] : {};
- options.headers = options.headers || {};
- versionId = options.versionId || options.subres && options.subres.versionId || null;
- if (versionId) {
- copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey), "?versionId=").concat(versionId);
- } else {
- copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey));
- }
- options.headers["x-oss-copy-source"] = copySource;
- if (range) {
- options.headers["x-oss-copy-source-range"] = "bytes=".concat(range);
- }
- options.subres = {
- partNumber: partNo,
- uploadId
- };
- params = this._objectRequestParams("PUT", name, options);
- params.mime = options.mime;
- params.successStatuses = [200];
- _context.next = 12;
- return this.request(params);
- case 12:
- result = _context.sent;
- return _context.abrupt("return", {
- name,
- etag: result.res.headers.etag,
- res: result.res
- });
- case 14:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function uploadPartCopy(_x, _x2, _x3, _x4, _x5) {
- return _uploadPartCopy.apply(this, arguments);
- }
- return uploadPartCopy;
- }();
- proto.multipartUploadCopy = function() {
- var _multipartUploadCopy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, sourceData) {
- var options, _options$versionId, versionId, metaOpt, objectMeta, fileSize, minPartSize, copySize, init, uploadId, partSize, checkpoint, _args2 = arguments;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- options = _args2.length > 2 && _args2[2] !== void 0 ? _args2[2] : {};
- this.resetCancelFlag();
- _options$versionId = options.versionId, versionId = _options$versionId === void 0 ? null : _options$versionId;
- metaOpt = {
- versionId
- };
- _context2.next = 6;
- return this._getObjectMeta(sourceData.sourceBucketName, sourceData.sourceKey, metaOpt);
- case 6:
- objectMeta = _context2.sent;
- fileSize = objectMeta.res.headers["content-length"];
- sourceData.startOffset = sourceData.startOffset || 0;
- sourceData.endOffset = sourceData.endOffset || fileSize;
- if (!(options.checkpoint && options.checkpoint.uploadId)) {
- _context2.next = 14;
- break;
- }
- _context2.next = 13;
- return this._resumeMultipartCopy(options.checkpoint, sourceData, options);
- case 13:
- return _context2.abrupt("return", _context2.sent);
- case 14:
- minPartSize = 100 * 1024;
- copySize = sourceData.endOffset - sourceData.startOffset;
- if (!(copySize < minPartSize)) {
- _context2.next = 18;
- break;
- }
- throw new Error("copySize must not be smaller than ".concat(minPartSize));
- case 18:
- if (!(options.partSize && options.partSize < minPartSize)) {
- _context2.next = 20;
- break;
- }
- throw new Error("partSize must not be smaller than ".concat(minPartSize));
- case 20:
- _context2.next = 22;
- return this.initMultipartUpload(name, options);
- case 22:
- init = _context2.sent;
- uploadId = init.uploadId;
- partSize = this._getPartSize(copySize, options.partSize);
- checkpoint = {
- name,
- copySize,
- partSize,
- uploadId,
- doneParts: []
- };
- if (!(options && options.progress)) {
- _context2.next = 29;
- break;
- }
- _context2.next = 29;
- return options.progress(0, checkpoint, init.res);
- case 29:
- _context2.next = 31;
- return this._resumeMultipartCopy(checkpoint, sourceData, options);
- case 31:
- return _context2.abrupt("return", _context2.sent);
- case 32:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function multipartUploadCopy(_x6, _x7) {
- return _multipartUploadCopy.apply(this, arguments);
- }
- return multipartUploadCopy;
- }();
- proto._resumeMultipartCopy = function() {
- var _resumeMultipartCopy2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(checkpoint, sourceData, options) {
- var _options$versionId2, versionId, metaOpt, copySize, partSize, uploadId, doneParts, name, partOffs, numParts, uploadPartCopyOptions, uploadPartJob, all, done, todo, defaultParallel, parallel, i, errors, abortEvent, err;
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- if (!this.isCancel()) {
- _context4.next = 2;
- break;
- }
- throw this._makeCancelEvent();
- case 2:
- _options$versionId2 = options.versionId, versionId = _options$versionId2 === void 0 ? null : _options$versionId2;
- metaOpt = {
- versionId
- };
- copySize = checkpoint.copySize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name;
- partOffs = this._divideMultipartCopyParts(copySize, partSize, sourceData.startOffset);
- numParts = partOffs.length;
- uploadPartCopyOptions = {
- headers: {}
- };
- if (options.copyheaders) {
- copy(options.copyheaders).to(uploadPartCopyOptions.headers);
- }
- if (versionId) {
- copy(metaOpt).to(uploadPartCopyOptions);
- }
- uploadPartJob = function uploadPartJob2(self2, partNo, source) {
- return new Promise(function() {
- var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(resolve, reject) {
- var pi, range, result;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- _context3.prev = 0;
- if (self2.isCancel()) {
- _context3.next = 22;
- break;
- }
- pi = partOffs[partNo - 1];
- range = "".concat(pi.start, "-").concat(pi.end - 1);
- _context3.prev = 4;
- _context3.next = 7;
- return self2.uploadPartCopy(name, uploadId, partNo, range, source, uploadPartCopyOptions);
- case 7:
- result = _context3.sent;
- _context3.next = 15;
- break;
- case 10:
- _context3.prev = 10;
- _context3.t0 = _context3["catch"](4);
- if (!(_context3.t0.status === 404)) {
- _context3.next = 14;
- break;
- }
- throw self2._makeAbortEvent();
- case 14:
- throw _context3.t0;
- case 15:
- if (self2.isCancel()) {
- _context3.next = 22;
- break;
- }
- debug("content-range ".concat(result.res.headers["content-range"]));
- doneParts.push({
- number: partNo,
- etag: result.res.headers.etag
- });
- checkpoint.doneParts = doneParts;
- if (!(options && options.progress)) {
- _context3.next = 22;
- break;
- }
- _context3.next = 22;
- return options.progress(doneParts.length / numParts, checkpoint, result.res);
- case 22:
- resolve();
- _context3.next = 29;
- break;
- case 25:
- _context3.prev = 25;
- _context3.t1 = _context3["catch"](0);
- _context3.t1.partNum = partNo;
- reject(_context3.t1);
- case 29:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, null, [[0, 25], [4, 10]]);
- }));
- return function(_x11, _x12) {
- return _ref.apply(this, arguments);
- };
- }());
- };
- all = Array.from(new Array(numParts), function(x, i2) {
- return i2 + 1;
- });
- done = doneParts.map(function(p) {
- return p.number;
- });
- todo = all.filter(function(p) {
- return done.indexOf(p) < 0;
- });
- defaultParallel = 5;
- parallel = options.parallel || defaultParallel;
- if (!(this.checkBrowserAndVersion("Internet Explorer", "10") || parallel === 1)) {
- _context4.next = 28;
- break;
- }
- i = 0;
- case 18:
- if (!(i < todo.length)) {
- _context4.next = 26;
- break;
- }
- if (!this.isCancel()) {
- _context4.next = 21;
- break;
- }
- throw this._makeCancelEvent();
- case 21:
- _context4.next = 23;
- return uploadPartJob(this, todo[i], sourceData);
- case 23:
- i++;
- _context4.next = 18;
- break;
- case 26:
- _context4.next = 40;
- break;
- case 28:
- _context4.next = 30;
- return this._parallelNode(todo, parallel, uploadPartJob, sourceData);
- case 30:
- errors = _context4.sent;
- abortEvent = errors.find(function(err2) {
- return err2.name === "abort";
- });
- if (!abortEvent) {
- _context4.next = 34;
- break;
- }
- throw abortEvent;
- case 34:
- if (!this.isCancel()) {
- _context4.next = 36;
- break;
- }
- throw this._makeCancelEvent();
- case 36:
- if (!(errors && errors.length > 0)) {
- _context4.next = 40;
- break;
- }
- err = errors[0];
- err.message = "Failed to copy some parts with error: ".concat(err.toString(), " part_num: ").concat(err.partNum);
- throw err;
- case 40:
- _context4.next = 42;
- return this.completeMultipartUpload(name, uploadId, doneParts, options);
- case 42:
- return _context4.abrupt("return", _context4.sent);
- case 43:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- function _resumeMultipartCopy(_x8, _x9, _x10) {
- return _resumeMultipartCopy2.apply(this, arguments);
- }
- return _resumeMultipartCopy;
- }();
- proto._divideMultipartCopyParts = function _divideMultipartCopyParts(fileSize, partSize, startOffset) {
- var numParts = Math.ceil(fileSize / partSize);
- var partOffs = [];
- for (var i = 0; i < numParts; i++) {
- var start = partSize * i + startOffset;
- var end = Math.min(start + partSize, fileSize + startOffset);
- partOffs.push({
- start,
- end
- });
- }
- return partOffs;
- };
- proto._getObjectMeta = function() {
- var _getObjectMeta2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(bucket, name, options) {
- var currentBucket, data;
- return _regenerator.default.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- currentBucket = this.getBucket();
- this.setBucket(bucket);
- _context5.next = 4;
- return this.head(name, options);
- case 4:
- data = _context5.sent;
- this.setBucket(currentBucket);
- return _context5.abrupt("return", data);
- case 7:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- function _getObjectMeta(_x13, _x14, _x15) {
- return _getObjectMeta2.apply(this, arguments);
- }
- return _getObjectMeta;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.iterator.js": 303, "debug": 465 }], 30: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.array.filter.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.array.sort.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.regexp.to-string.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var copy = require2("copy-to");
- var callback = require2("./callback");
- var _require = require2("./utils/deepCopy"), deepCopyWith = _require.deepCopyWith;
- var _require2 = require2("./utils/isBuffer"), isBuffer = _require2.isBuffer;
- var _require3 = require2("./utils/omit"), omit = _require3.omit;
- var proto = exports3;
- proto.listUploads = function() {
- var _listUploads = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(query, options) {
- var opt, params, result, uploads;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = options || {};
- opt = {};
- copy(options).to(opt);
- opt.subres = "uploads";
- params = this._objectRequestParams("GET", "", opt);
- params.query = query;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context.next = 10;
- return this.request(params);
- case 10:
- result = _context.sent;
- uploads = result.data.Upload || [];
- if (!Array.isArray(uploads)) {
- uploads = [uploads];
- }
- uploads = uploads.map(function(up) {
- return {
- name: up.Key,
- uploadId: up.UploadId,
- initiated: up.Initiated
- };
- });
- return _context.abrupt("return", {
- res: result.res,
- uploads,
- bucket: result.data.Bucket,
- nextKeyMarker: result.data.NextKeyMarker,
- nextUploadIdMarker: result.data.NextUploadIdMarker,
- isTruncated: result.data.IsTruncated === "true"
- });
- case 15:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function listUploads(_x, _x2) {
- return _listUploads.apply(this, arguments);
- }
- return listUploads;
- }();
- proto.listParts = function() {
- var _listParts = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, uploadId, query, options) {
- var opt, params, result;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- options = options || {};
- opt = {};
- copy(options).to(opt);
- opt.subres = {
- uploadId
- };
- params = this._objectRequestParams("GET", name, opt);
- params.query = query;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context2.next = 10;
- return this.request(params);
- case 10:
- result = _context2.sent;
- return _context2.abrupt("return", {
- res: result.res,
- uploadId: result.data.UploadId,
- bucket: result.data.Bucket,
- name: result.data.Key,
- partNumberMarker: result.data.PartNumberMarker,
- nextPartNumberMarker: result.data.NextPartNumberMarker,
- maxParts: result.data.MaxParts,
- isTruncated: result.data.IsTruncated,
- parts: result.data.Part || []
- });
- case 12:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function listParts(_x3, _x4, _x5, _x6) {
- return _listParts.apply(this, arguments);
- }
- return listParts;
- }();
- proto.abortMultipartUpload = function() {
- var _abortMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, uploadId, options) {
- var opt, params, result;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- this._stop();
- options = options || {};
- opt = {};
- copy(options).to(opt);
- opt.subres = {
- uploadId
- };
- params = this._objectRequestParams("DELETE", name, opt);
- params.successStatuses = [204];
- _context3.next = 9;
- return this.request(params);
- case 9:
- result = _context3.sent;
- return _context3.abrupt("return", {
- res: result.res
- });
- case 11:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function abortMultipartUpload(_x7, _x8, _x9) {
- return _abortMultipartUpload.apply(this, arguments);
- }
- return abortMultipartUpload;
- }();
- proto.initMultipartUpload = function() {
- var _initMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, options) {
- var opt, params, result;
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- options = options || {};
- opt = {};
- copy(options).to(opt);
- opt.headers = opt.headers || {};
- this._convertMetaToHeaders(options.meta, opt.headers);
- opt.subres = "uploads";
- params = this._objectRequestParams("POST", name, opt);
- params.mime = options.mime;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context4.next = 12;
- return this.request(params);
- case 12:
- result = _context4.sent;
- return _context4.abrupt("return", {
- res: result.res,
- bucket: result.data.Bucket,
- name: result.data.Key,
- uploadId: result.data.UploadId
- });
- case 14:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- function initMultipartUpload(_x10, _x11) {
- return _initMultipartUpload.apply(this, arguments);
- }
- return initMultipartUpload;
- }();
- proto.uploadPart = function() {
- var _uploadPart2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(name, uploadId, partNo, file, start, end, options) {
- var data, isBrowserEnv;
- return _regenerator.default.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- data = {
- size: end - start
- };
- isBrowserEnv = process && process.browser;
- if (!isBrowserEnv) {
- _context5.next = 8;
- break;
- }
- _context5.next = 5;
- return this._createBuffer(file, start, end);
- case 5:
- data.content = _context5.sent;
- _context5.next = 11;
- break;
- case 8:
- _context5.next = 10;
- return this._createStream(file, start, end);
- case 10:
- data.stream = _context5.sent;
- case 11:
- _context5.next = 13;
- return this._uploadPart(name, uploadId, partNo, data, options);
- case 13:
- return _context5.abrupt("return", _context5.sent);
- case 14:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- function uploadPart(_x12, _x13, _x14, _x15, _x16, _x17, _x18) {
- return _uploadPart2.apply(this, arguments);
- }
- return uploadPart;
- }();
- proto.completeMultipartUpload = function() {
- var _completeMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(name, uploadId, parts, options) {
- var completeParts, xml, i, p, opt, params, result, ret;
- return _regenerator.default.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- completeParts = parts.concat().sort(function(a, b) {
- return a.number - b.number;
- }).filter(function(item, index, arr) {
- return !index || item.number !== arr[index - 1].number;
- });
- xml = '<?xml version="1.0" encoding="UTF-8"?>\n<CompleteMultipartUpload>\n';
- for (i = 0; i < completeParts.length; i++) {
- p = completeParts[i];
- xml += "<Part>\n";
- xml += "<PartNumber>".concat(p.number, "</PartNumber>\n");
- xml += "<ETag>".concat(p.etag, "</ETag>\n");
- xml += "</Part>\n";
- }
- xml += "</CompleteMultipartUpload>";
- options = options || {};
- opt = {};
- opt = deepCopyWith(options, function(_) {
- if (isBuffer(_))
- return null;
- });
- opt.subres = {
- uploadId
- };
- opt.headers = omit(opt.headers, ["x-oss-server-side-encryption", "x-oss-storage-class"]);
- params = this._objectRequestParams("POST", name, opt);
- callback.encodeCallback(params, opt);
- params.mime = "xml";
- params.content = xml;
- if (!(params.headers && params.headers["x-oss-callback"])) {
- params.xmlResponse = true;
- }
- params.successStatuses = [200];
- _context6.next = 17;
- return this.request(params);
- case 17:
- result = _context6.sent;
- if (!options.progress) {
- _context6.next = 21;
- break;
- }
- _context6.next = 21;
- return options.progress(1, null, result.res);
- case 21:
- ret = {
- res: result.res,
- bucket: params.bucket,
- name,
- etag: result.res.headers.etag
- };
- if (params.headers && params.headers["x-oss-callback"]) {
- ret.data = JSON.parse(result.data.toString());
- }
- return _context6.abrupt("return", ret);
- case 24:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6, this);
- }));
- function completeMultipartUpload(_x19, _x20, _x21, _x22) {
- return _completeMultipartUpload.apply(this, arguments);
- }
- return completeMultipartUpload;
- }();
- proto._uploadPart = function() {
- var _uploadPart3 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name, uploadId, partNo, data, options) {
- var opt, params, isBrowserEnv, result;
- return _regenerator.default.wrap(function _callee7$(_context7) {
- while (1) {
- switch (_context7.prev = _context7.next) {
- case 0:
- options = options || {};
- opt = {};
- copy(options).to(opt);
- opt.headers = opt.headers || {};
- opt.headers["Content-Length"] = data.size;
- opt.headers = omit(opt.headers, ["x-oss-server-side-encryption"]);
- opt.subres = {
- partNumber: partNo,
- uploadId
- };
- params = this._objectRequestParams("PUT", name, opt);
- params.mime = opt.mime;
- isBrowserEnv = process && process.browser;
- isBrowserEnv ? params.content = data.content : params.stream = data.stream;
- params.successStatuses = [200];
- params.disabledMD5 = options.disabledMD5;
- _context7.next = 15;
- return this.request(params);
- case 15:
- result = _context7.sent;
- if (result.res.headers.etag) {
- _context7.next = 18;
- break;
- }
- throw new Error("Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html");
- case 18:
- if (data.stream) {
- data.stream = null;
- params.stream = null;
- }
- return _context7.abrupt("return", {
- name,
- etag: result.res.headers.etag,
- res: result.res
- });
- case 20:
- case "end":
- return _context7.stop();
- }
- }
- }, _callee7, this);
- }));
- function _uploadPart(_x23, _x24, _x25, _x26, _x27) {
- return _uploadPart3.apply(this, arguments);
- }
- return _uploadPart;
- }();
- }).call(this);
- }).call(this, require2("_process"));
- }, { "./callback": 24, "./utils/deepCopy": 58, "./utils/isBuffer": 65, "./utils/omit": 73, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.array.sort.js": 282, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 31: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.regexp.exec.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var urlutil = require2("url");
- var utility = require2("utility");
- var copy = require2("copy-to");
- var signHelper = require2("../../common/signUtils");
- var _require = require2("../utils/isIP"), isIP = _require.isIP;
- var _require2 = require2("../utils/setSTSToken"), setSTSToken = _require2.setSTSToken;
- var _require3 = require2("../utils/isFunction"), isFunction = _require3.isFunction;
- var proto = exports3;
- proto.asyncSignatureUrl = function() {
- var _asyncSignatureUrl = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var strictObjectNameValidation, expires, params, resource, signRes, url, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- strictObjectNameValidation = _args.length > 2 && _args[2] !== void 0 ? _args[2] : true;
- if (!isIP(this.options.endpoint.hostname)) {
- _context.next = 3;
- break;
- }
- throw new Error("can not get the object URL when endpoint is IP");
- case 3:
- if (!(strictObjectNameValidation && /^\?/.test(name))) {
- _context.next = 5;
- break;
- }
- throw new Error("Invalid object name ".concat(name));
- case 5:
- options = options || {};
- name = this._objectName(name);
- options.method = options.method || "GET";
- expires = utility.timestamp() + (options.expires || 1800);
- params = {
- bucket: this.options.bucket,
- object: name
- };
- resource = this._getResource(params);
- if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) {
- _context.next = 14;
- break;
- }
- _context.next = 14;
- return setSTSToken.call(this);
- case 14:
- if (this.options.stsToken) {
- options["security-token"] = this.options.stsToken;
- }
- signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires);
- url = urlutil.parse(this._getReqUrl(params));
- url.query = {
- OSSAccessKeyId: this.options.accessKeyId,
- Expires: expires,
- Signature: signRes.Signature
- };
- copy(signRes.subResource).to(url.query);
- return _context.abrupt("return", url.format());
- case 20:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function asyncSignatureUrl(_x, _x2) {
- return _asyncSignatureUrl.apply(this, arguments);
- }
- return asyncSignatureUrl;
- }();
- }, { "../../common/signUtils": 50, "../utils/isFunction": 68, "../utils/isIP": 69, "../utils/setSTSToken": 76, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.regexp.exec.js": 300, "url": 472, "utility": 474 }], 32: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.find.js");
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
- var proto = exports3;
- var REPLACE_HEDERS = ["content-type", "content-encoding", "content-language", "content-disposition", "cache-control", "expires"];
- proto.copy = function() {
- var _copy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, sourceName, bucketName, options) {
- var params, result, data;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- if ((0, _typeof2.default)(bucketName) === "object") {
- options = bucketName;
- }
- options = options || {};
- options.headers = options.headers || {};
- Object.keys(options.headers).forEach(function(key) {
- options.headers["x-oss-copy-source-".concat(key.toLowerCase())] = options.headers[key];
- });
- if (options.meta || Object.keys(options.headers).find(function(_) {
- return REPLACE_HEDERS.includes(_.toLowerCase());
- })) {
- options.headers["x-oss-metadata-directive"] = "REPLACE";
- }
- this._convertMetaToHeaders(options.meta, options.headers);
- sourceName = this._getSourceName(sourceName, bucketName);
- if (options.versionId) {
- sourceName = "".concat(sourceName, "?versionId=").concat(options.versionId);
- }
- options.headers["x-oss-copy-source"] = sourceName;
- params = this._objectRequestParams("PUT", name, options);
- params.xmlResponse = true;
- params.successStatuses = [200, 304];
- _context.next = 14;
- return this.request(params);
- case 14:
- result = _context.sent;
- data = result.data;
- if (data) {
- data = {
- etag: data.ETag,
- lastModified: data.LastModified
- };
- }
- return _context.abrupt("return", {
- data,
- res: result.res
- });
- case 18:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function copy(_x, _x2, _x3, _x4) {
- return _copy.apply(this, arguments);
- }
- return copy;
- }();
- proto._getSourceName = function _getSourceName(sourceName, bucketName) {
- if (typeof bucketName === "string") {
- sourceName = this._objectName(sourceName);
- } else if (sourceName[0] !== "/") {
- bucketName = this.options.bucket;
- } else {
- bucketName = sourceName.replace(/\/(.+?)(\/.*)/, "$1");
- sourceName = sourceName.replace(/(\/.+?\/)(.*)/, "$2");
- }
- _checkBucketName(bucketName);
- sourceName = encodeURIComponent(sourceName);
- sourceName = "/".concat(bucketName, "/").concat(sourceName);
- return sourceName;
- };
- }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 33: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.delete = function() {
- var _delete2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options.subres = Object.assign({}, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("DELETE", name, options);
- params.successStatuses = [204];
- _context.next = 7;
- return this.request(params);
- case 7:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 9:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function _delete(_x) {
- return _delete2.apply(this, arguments);
- }
- return _delete;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 34: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var utility = require2("utility");
- var _require = require2("../utils/obj2xml"), obj2xml = _require.obj2xml;
- var proto = exports3;
- proto.deleteMulti = function() {
- var _deleteMulti = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(names) {
- var options, objects, i, object, _names$i, key, versionId, paramXMLObj, paramXML, params, result, r, deleted, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- objects = [];
- if (!(!names || !names.length)) {
- _context.next = 4;
- break;
- }
- throw new Error("names is required");
- case 4:
- for (i = 0; i < names.length; i++) {
- object = {};
- if (typeof names[i] === "string") {
- object.Key = utility.escape(this._objectName(names[i]));
- } else {
- _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId;
- object.Key = utility.escape(this._objectName(key));
- object.VersionId = versionId;
- }
- objects.push(object);
- }
- paramXMLObj = {
- Delete: {
- Quiet: !!options.quiet,
- Object: objects
- }
- };
- paramXML = obj2xml(paramXMLObj, {
- headers: true
- });
- options.subres = Object.assign({
- delete: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("POST", "", options);
- params.mime = "xml";
- params.content = paramXML;
- params.xmlResponse = true;
- params.successStatuses = [200];
- _context.next = 16;
- return this.request(params);
- case 16:
- result = _context.sent;
- r = result.data;
- deleted = r && r.Deleted || null;
- if (deleted) {
- if (!Array.isArray(deleted)) {
- deleted = [deleted];
- }
- }
- return _context.abrupt("return", {
- res: result.res,
- deleted: deleted || []
- });
- case 21:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function deleteMulti(_x) {
- return _deleteMulti.apply(this, arguments);
- }
- return deleteMulti;
- }();
- }, { "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "utility": 474 }], 35: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.deleteObjectTagging = function() {
- var _deleteObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options.subres = Object.assign({
- tagging: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("DELETE", name, options);
- params.successStatuses = [204];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- return _context.abrupt("return", {
- status: result.status,
- res: result.res
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function deleteObjectTagging(_x) {
- return _deleteObjectTagging.apply(this, arguments);
- }
- return deleteObjectTagging;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 36: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.concat.js");
- var urlutil = require2("url");
- var _require = require2("../utils/isIP"), isIP = _require.isIP;
- var proto = exports3;
- proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) {
- if (isIP(this.options.endpoint.hostname)) {
- throw new Error("can not get the object URL when endpoint is IP");
- }
- if (!baseUrl) {
- baseUrl = this.options.endpoint.format();
- var copyUrl = urlutil.parse(baseUrl);
- var bucket = this.options.bucket;
- copyUrl.hostname = "".concat(bucket, ".").concat(copyUrl.hostname);
- copyUrl.host = "".concat(bucket, ".").concat(copyUrl.host);
- baseUrl = copyUrl.format();
- } else if (baseUrl[baseUrl.length - 1] !== "/") {
- baseUrl += "/";
- }
- return baseUrl + this._escape(this._objectName(name));
- };
- }, { "../utils/isIP": 69, "core-js/modules/es.array.concat.js": 272, "url": 472 }], 37: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var fs = require2("fs");
- var is = require2("is-type-of");
- var proto = exports3;
- proto.get = function() {
- var _get = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file) {
- var options, writeStream, needDestroy, isBrowserEnv, responseCacheControl, defaultSubresOptions, result, params, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- writeStream = null;
- needDestroy = false;
- if (is.writableStream(file)) {
- writeStream = file;
- } else if (is.string(file)) {
- writeStream = fs.createWriteStream(file);
- needDestroy = true;
- } else {
- options = file;
- }
- options = options || {};
- isBrowserEnv = process && process.browser;
- responseCacheControl = options.responseCacheControl === null ? "" : "no-cache";
- defaultSubresOptions = isBrowserEnv && responseCacheControl ? {
- "response-cache-control": responseCacheControl
- } : {};
- options.subres = Object.assign(defaultSubresOptions, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- if (options.process) {
- options.subres["x-oss-process"] = options.process;
- }
- _context.prev = 11;
- params = this._objectRequestParams("GET", name, options);
- params.writeStream = writeStream;
- params.successStatuses = [200, 206, 304];
- _context.next = 17;
- return this.request(params);
- case 17:
- result = _context.sent;
- if (needDestroy) {
- writeStream.destroy();
- }
- _context.next = 28;
- break;
- case 21:
- _context.prev = 21;
- _context.t0 = _context["catch"](11);
- if (!needDestroy) {
- _context.next = 27;
- break;
- }
- writeStream.destroy();
- _context.next = 27;
- return this._deleteFileSafe(file);
- case 27:
- throw _context.t0;
- case 28:
- return _context.abrupt("return", {
- res: result.res,
- content: result.data
- });
- case 29:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this, [[11, 21]]);
- }));
- function get(_x, _x2) {
- return _get.apply(this, arguments);
- }
- return get;
- }();
- }).call(this);
- }).call(this, require2("_process"));
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "core-js/modules/es.object.assign.js": 287, "fs": 89, "is-type-of": 466 }], 38: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.getACL = function() {
- var _getACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options.subres = Object.assign({
- acl: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("GET", name, options);
- params.successStatuses = [200];
- params.xmlResponse = true;
- _context.next = 9;
- return this.request(params);
- case 9:
- result = _context.sent;
- return _context.abrupt("return", {
- acl: result.data.AccessControlList.Grant,
- owner: {
- id: result.data.Owner.ID,
- displayName: result.data.Owner.DisplayName
- },
- res: result.res
- });
- case 11:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getACL(_x) {
- return _getACL.apply(this, arguments);
- }
- return getACL;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 39: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.number.constructor.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- var _require = require2("../utils/isObject"), isObject = _require.isObject;
- var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
- proto.getBucketVersions = getBucketVersions;
- proto.listObjectVersions = getBucketVersions;
- function getBucketVersions() {
- return _getBucketVersions.apply(this, arguments);
- }
- function _getBucketVersions() {
- _getBucketVersions = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
- var query, options, params, result, objects, deleteMarker, that, prefixes, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- query = _args.length > 0 && _args[0] !== void 0 ? _args[0] : {};
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- if (!(query.versionIdMarker && query.keyMarker === void 0)) {
- _context.next = 4;
- break;
- }
- throw new Error("A version-id marker cannot be specified without a key marker");
- case 4:
- options.subres = Object.assign({
- versions: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("GET", "", options);
- params.xmlResponse = true;
- params.successStatuses = [200];
- params.query = formatQuery(query);
- _context.next = 12;
- return this.request(params);
- case 12:
- result = _context.sent;
- objects = result.data.Version || [];
- deleteMarker = result.data.DeleteMarker || [];
- that = this;
- if (objects) {
- if (!Array.isArray(objects)) {
- objects = [objects];
- }
- objects = objects.map(function(obj) {
- return {
- name: obj.Key,
- url: that._objectUrl(obj.Key),
- lastModified: obj.LastModified,
- isLatest: obj.IsLatest === "true",
- versionId: obj.VersionId,
- etag: obj.ETag,
- type: obj.Type,
- size: Number(obj.Size),
- storageClass: obj.StorageClass,
- owner: {
- id: obj.Owner.ID,
- displayName: obj.Owner.DisplayName
- }
- };
- });
- }
- if (deleteMarker) {
- if (!isArray(deleteMarker)) {
- deleteMarker = [deleteMarker];
- }
- deleteMarker = deleteMarker.map(function(obj) {
- return {
- name: obj.Key,
- lastModified: obj.LastModified,
- versionId: obj.VersionId,
- owner: {
- id: obj.Owner.ID,
- displayName: obj.Owner.DisplayName
- }
- };
- });
- }
- prefixes = result.data.CommonPrefixes || null;
- if (prefixes) {
- if (!isArray(prefixes)) {
- prefixes = [prefixes];
- }
- prefixes = prefixes.map(function(item) {
- return item.Prefix;
- });
- }
- return _context.abrupt("return", {
- res: result.res,
- objects,
- deleteMarker,
- prefixes,
- // attirbute of legacy error
- nextMarker: result.data.NextKeyMarker || null,
- // attirbute of legacy error
- NextVersionIdMarker: result.data.NextVersionIdMarker || null,
- nextKeyMarker: result.data.NextKeyMarker || null,
- nextVersionIdMarker: result.data.NextVersionIdMarker || null,
- isTruncated: result.data.IsTruncated === "true"
- });
- case 21:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _getBucketVersions.apply(this, arguments);
- }
- function camel2Line(name) {
- return name.replace(/([A-Z])/g, "-$1").toLowerCase();
- }
- function formatQuery() {
- var query = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- var obj = {};
- if (isObject(query)) {
- Object.keys(query).forEach(function(key) {
- obj[camel2Line(key)] = query[key];
- });
- }
- return obj;
- }
- }, { "../utils/isArray": 63, "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.number.constructor.js": 286, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 40: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.getObjectMeta = function() {
- var _getObjectMeta = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = options || {};
- name = this._objectName(name);
- options.subres = Object.assign({
- objectMeta: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("HEAD", name, options);
- params.successStatuses = [200];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- return _context.abrupt("return", {
- status: result.status,
- res: result.res
- });
- case 10:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getObjectMeta(_x, _x2) {
- return _getObjectMeta.apply(this, arguments);
- }
- return getObjectMeta;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 41: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- var _require = require2("../utils/isObject"), isObject = _require.isObject;
- proto.getObjectTagging = function() {
- var _getObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, Tagging, Tag, tag, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options.subres = Object.assign({
- tagging: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("GET", name, options);
- params.successStatuses = [200];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- _context.next = 11;
- return this.parseXML(result.data);
- case 11:
- Tagging = _context.sent;
- Tag = Tagging.TagSet.Tag;
- Tag = Tag && isObject(Tag) ? [Tag] : Tag || [];
- tag = {};
- Tag.forEach(function(item) {
- tag[item.Key] = item.Value;
- });
- return _context.abrupt("return", {
- status: result.status,
- res: result.res,
- tag
- });
- case 17:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getObjectTagging(_x) {
- return _getObjectTagging.apply(this, arguments);
- }
- return getObjectTagging;
- }();
- }, { "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 42: [function(require2, module3, exports3) {
- "use strict";
- var _require = require2("../utils/isIP"), isIP = _require.isIP;
- var proto = exports3;
- proto.getObjectUrl = function getObjectUrl(name, baseUrl) {
- if (isIP(this.options.endpoint.hostname)) {
- throw new Error("can not get the object URL when endpoint is IP");
- }
- if (!baseUrl) {
- baseUrl = this.options.endpoint.format();
- } else if (baseUrl[baseUrl.length - 1] !== "/") {
- baseUrl += "/";
- }
- return baseUrl + this._escape(this._objectName(name));
- };
- }, { "../utils/isIP": 69 }], 43: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.getSymlink = function() {
- var _getSymlink = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, target, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- options.subres = Object.assign({
- symlink: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("GET", name, options);
- params.successStatuses = [200];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- target = result.res.headers["x-oss-symlink-target"];
- return _context.abrupt("return", {
- targetName: decodeURIComponent(target),
- res: result.res
- });
- case 11:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function getSymlink(_x) {
- return _getSymlink.apply(this, arguments);
- }
- return getSymlink;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 44: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/checkEnv"), checkEnv = _require.checkEnv;
- var proto = exports3;
- proto.head = function() {
- var _head = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
- var options, params, result, data, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
- checkEnv("Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta");
- options.subres = Object.assign({}, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- params = this._objectRequestParams("HEAD", name, options);
- params.successStatuses = [200, 304];
- _context.next = 8;
- return this.request(params);
- case 8:
- result = _context.sent;
- data = {
- meta: null,
- res: result.res,
- status: result.status
- };
- if (result.status === 200) {
- Object.keys(result.headers).forEach(function(k) {
- if (k.indexOf("x-oss-meta-") === 0) {
- if (!data.meta) {
- data.meta = {};
- }
- data.meta[k.substring(11)] = result.headers[k];
- }
- });
- }
- return _context.abrupt("return", data);
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function head(_x) {
- return _head.apply(this, arguments);
- }
- return head;
- }();
- }, { "../utils/checkEnv": 53, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 45: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.putACL = function() {
- var _putACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, acl, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = options || {};
- options.subres = Object.assign({
- acl: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- options.headers = options.headers || {};
- options.headers["x-oss-object-acl"] = acl;
- name = this._objectName(name);
- params = this._objectRequestParams("PUT", name, options);
- params.successStatuses = [200];
- _context.next = 10;
- return this.request(params);
- case 10:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putACL(_x, _x2, _x3) {
- return _putACL.apply(this, arguments);
- }
- return putACL;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 46: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.object.keys.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("../utils/obj2xml"), obj2xml = _require.obj2xml;
- var _require2 = require2("../utils/checkObjectTag"), checkObjectTag = _require2.checkObjectTag;
- var proto = exports3;
- proto.putObjectTagging = function() {
- var _putObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, tag) {
- var options, params, paramXMLObj, result, _args = arguments;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
- checkObjectTag(tag);
- options.subres = Object.assign({
- tagging: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("PUT", name, options);
- params.successStatuses = [200];
- tag = Object.keys(tag).map(function(key) {
- return {
- Key: key,
- Value: tag[key]
- };
- });
- paramXMLObj = {
- Tagging: {
- TagSet: {
- Tag: tag
- }
- }
- };
- params.mime = "xml";
- params.content = obj2xml(paramXMLObj);
- _context.next = 13;
- return this.request(params);
- case 13:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res,
- status: result.status
- });
- case 15:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putObjectTagging(_x, _x2) {
- return _putObjectTagging.apply(this, arguments);
- }
- return putObjectTagging;
- }();
- }, { "../utils/checkObjectTag": 54, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290 }], 47: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var proto = exports3;
- proto.putSymlink = function() {
- var _putSymlink = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, targetName, options) {
- var params, result;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- options = options || {};
- options.headers = options.headers || {};
- targetName = this._escape(this._objectName(targetName));
- this._convertMetaToHeaders(options.meta, options.headers);
- options.headers["x-oss-symlink-target"] = targetName;
- options.subres = Object.assign({
- symlink: ""
- }, options.subres);
- if (options.versionId) {
- options.subres.versionId = options.versionId;
- }
- if (options.storageClass) {
- options.headers["x-oss-storage-class"] = options.storageClass;
- }
- name = this._objectName(name);
- params = this._objectRequestParams("PUT", name, options);
- params.successStatuses = [200];
- _context.next = 13;
- return this.request(params);
- case 13:
- result = _context.sent;
- return _context.abrupt("return", {
- res: result.res
- });
- case 15:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function putSymlink(_x, _x2, _x3) {
- return _putSymlink.apply(this, arguments);
- }
- return putSymlink;
- }();
- }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 48: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- var urlutil = require2("url");
- var utility = require2("utility");
- var copy = require2("copy-to");
- var signHelper = require2("../../common/signUtils");
- var _require = require2("../utils/isIP"), isIP = _require.isIP;
- var proto = exports3;
- proto.signatureUrl = function signatureUrl(name, options) {
- var strictObjectNameValidation = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
- if (isIP(this.options.endpoint.hostname)) {
- throw new Error("can not get the object URL when endpoint is IP");
- }
- if (strictObjectNameValidation && /^\?/.test(name)) {
- throw new Error("Invalid object name ".concat(name));
- }
- options = options || {};
- name = this._objectName(name);
- options.method = options.method || "GET";
- var expires = utility.timestamp() + (options.expires || 1800);
- var params = {
- bucket: this.options.bucket,
- object: name
- };
- var resource = this._getResource(params);
- if (this.options.stsToken) {
- options["security-token"] = this.options.stsToken;
- }
- var signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires);
- var url = urlutil.parse(this._getReqUrl(params));
- url.query = {
- OSSAccessKeyId: this.options.accessKeyId,
- Expires: expires,
- Signature: signRes.Signature
- };
- copy(signRes.subResource).to(url.query);
- return url.format();
- };
- }, { "../../common/signUtils": 50, "../utils/isIP": 69, "copy-to": 94, "core-js/modules/es.regexp.exec.js": 300, "url": 472, "utility": 474 }], 49: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.array.iterator.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.string.iterator.js");
- require2("core-js/modules/web.dom-collections.iterator.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.function.name.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- var _require = require2("./utils/isArray"), isArray = _require.isArray;
- var proto = exports3;
- proto._parallelNode = function() {
- var _parallelNode2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(todo, parallel, fn, sourceData) {
- var that, jobErr, jobs, tempBatch, remainder, batch, taskIndex, i;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- that = this;
- jobErr = [];
- jobs = [];
- tempBatch = todo.length / parallel;
- remainder = todo.length % parallel;
- batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1;
- taskIndex = 1;
- i = 0;
- case 8:
- if (!(i < todo.length)) {
- _context.next = 26;
- break;
- }
- if (!that.isCancel()) {
- _context.next = 11;
- break;
- }
- return _context.abrupt("break", 26);
- case 11:
- if (sourceData) {
- jobs.push(fn(that, todo[i], sourceData));
- } else {
- jobs.push(fn(that, todo[i]));
- }
- if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) {
- _context.next = 23;
- break;
- }
- _context.prev = 13;
- taskIndex += 1;
- _context.next = 17;
- return Promise.all(jobs);
- case 17:
- _context.next = 22;
- break;
- case 19:
- _context.prev = 19;
- _context.t0 = _context["catch"](13);
- jobErr.push(_context.t0);
- case 22:
- jobs = [];
- case 23:
- i++;
- _context.next = 8;
- break;
- case 26:
- return _context.abrupt("return", jobErr);
- case 27:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this, [[13, 19]]);
- }));
- function _parallelNode(_x, _x2, _x3, _x4) {
- return _parallelNode2.apply(this, arguments);
- }
- return _parallelNode;
- }();
- proto._parallel = function _parallel(todo, parallel, jobPromise) {
- var that = this;
- return new Promise(function(resolve) {
- var _jobErr = [];
- if (parallel <= 0 || !todo) {
- resolve(_jobErr);
- return;
- }
- function onlyOnce(fn) {
- return function() {
- if (fn === null)
- throw new Error("Callback was already called.");
- var callFn = fn;
- fn = null;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- callFn.apply(this, args);
- };
- }
- function createArrayIterator(coll) {
- var i = -1;
- var len = coll.length;
- return function next() {
- return ++i < len && !that.isCancel() ? {
- value: coll[i],
- key: i
- } : null;
- };
- }
- var nextElem = createArrayIterator(todo);
- var done = false;
- var running = 0;
- var looping = false;
- function iterateeCallback(err) {
- running -= 1;
- if (err) {
- done = true;
- _jobErr.push(err);
- resolve(_jobErr);
- } else if (done && running <= 0) {
- done = true;
- resolve(_jobErr);
- } else if (!looping) {
- if (that.isCancel()) {
- resolve(_jobErr);
- } else {
- replenish();
- }
- }
- }
- function iteratee(value, callback) {
- jobPromise(value).then(function(result) {
- callback(null, result);
- }).catch(function(err) {
- callback(err);
- });
- }
- function replenish() {
- looping = true;
- while (running < parallel && !done && !that.isCancel()) {
- var elem = nextElem();
- if (elem === null || _jobErr.length > 0) {
- done = true;
- if (running <= 0) {
- resolve(_jobErr);
- }
- return;
- }
- running += 1;
- iteratee(elem.value, onlyOnce(iterateeCallback));
- }
- looping = false;
- }
- replenish();
- });
- };
- proto.cancel = function cancel(abort) {
- this.options.cancelFlag = true;
- if (isArray(this.multipartUploadStreams)) {
- this.multipartUploadStreams.forEach(function(_) {
- if (_.destroyed === false) {
- var err = {
- name: "cancel",
- message: "cancel"
- };
- _.destroy(err);
- }
- });
- }
- this.multipartUploadStreams = [];
- if (abort) {
- this.abortMultipartUpload(abort.name, abort.uploadId, abort.options);
- }
- };
- proto.isCancel = function isCancel() {
- return this.options.cancelFlag;
- };
- proto.resetCancelFlag = function resetCancelFlag() {
- this.options.cancelFlag = false;
- };
- proto._stop = function _stop() {
- this.options.cancelFlag = true;
- };
- proto._makeCancelEvent = function _makeCancelEvent() {
- var cancelEvent = {
- status: 0,
- name: "cancel"
- };
- return cancelEvent;
- };
- proto._makeAbortEvent = function _makeAbortEvent() {
- var abortEvent = {
- status: 0,
- name: "abort",
- message: "upload task has been abort"
- };
- return abortEvent;
- };
- }, { "./utils/isArray": 63, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/web.dom-collections.for-each.js": 339, "core-js/modules/web.dom-collections.iterator.js": 340 }], 50: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.string.trim.js");
- require2("core-js/modules/es.array.sort.js");
- require2("core-js/modules/es.array.join.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.regexp.to-string.js");
- var crypto = require2("./../../shims/crypto/crypto.js");
- var is = require2("is-type-of");
- var _require = require2("./utils/lowercaseKeyHeader"), lowercaseKeyHeader = _require.lowercaseKeyHeader;
- exports3.buildCanonicalizedResource = function buildCanonicalizedResource(resourcePath, parameters) {
- var canonicalizedResource = "".concat(resourcePath);
- var separatorString = "?";
- if (is.string(parameters) && parameters.trim() !== "") {
- canonicalizedResource += separatorString + parameters;
- } else if (is.array(parameters)) {
- parameters.sort();
- canonicalizedResource += separatorString + parameters.join("&");
- } else if (parameters) {
- var compareFunc = function compareFunc2(entry1, entry2) {
- if (entry1[0] > entry2[0]) {
- return 1;
- } else if (entry1[0] < entry2[0]) {
- return -1;
- }
- return 0;
- };
- var processFunc = function processFunc2(key) {
- canonicalizedResource += separatorString + key;
- if (parameters[key] || parameters[key] === 0) {
- canonicalizedResource += "=".concat(parameters[key]);
- }
- separatorString = "&";
- };
- Object.keys(parameters).sort(compareFunc).forEach(processFunc);
- }
- return canonicalizedResource;
- };
- exports3.buildCanonicalString = function canonicalString(method, resourcePath, request, expires) {
- request = request || {};
- var headers = lowercaseKeyHeader(request.headers);
- var OSS_PREFIX = "x-oss-";
- var ossHeaders = [];
- var headersToSign = {};
- var signContent = [method.toUpperCase(), headers["content-md5"] || "", headers["content-type"], expires || headers["x-oss-date"]];
- Object.keys(headers).forEach(function(key) {
- var lowerKey = key.toLowerCase();
- if (lowerKey.indexOf(OSS_PREFIX) === 0) {
- headersToSign[lowerKey] = String(headers[key]).trim();
- }
- });
- Object.keys(headersToSign).sort().forEach(function(key) {
- ossHeaders.push("".concat(key, ":").concat(headersToSign[key]));
- });
- signContent = signContent.concat(ossHeaders);
- signContent.push(this.buildCanonicalizedResource(resourcePath, request.parameters));
- return signContent.join("\n");
- };
- exports3.computeSignature = function computeSignature(accessKeySecret, canonicalString) {
- var headerEncoding = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "utf-8";
- var signature = crypto.createHmac("sha1", accessKeySecret);
- return signature.update(Buffer.from(canonicalString, headerEncoding)).digest("base64");
- };
- exports3.authorization = function authorization(accessKeyId, accessKeySecret, canonicalString, headerEncoding) {
- return "OSS ".concat(accessKeyId, ":").concat(this.computeSignature(accessKeySecret, canonicalString, headerEncoding));
- };
- exports3._signatureForURL = function _signatureForURL(accessKeySecret) {
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- var resource = arguments.length > 2 ? arguments[2] : void 0;
- var expires = arguments.length > 3 ? arguments[3] : void 0;
- var headerEncoding = arguments.length > 4 ? arguments[4] : void 0;
- var headers = {};
- var _options$subResource = options.subResource, subResource = _options$subResource === void 0 ? {} : _options$subResource;
- if (options.process) {
- var processKeyword = "x-oss-process";
- subResource[processKeyword] = options.process;
- }
- if (options.trafficLimit) {
- var trafficLimitKey = "x-oss-traffic-limit";
- subResource[trafficLimitKey] = options.trafficLimit;
- }
- if (options.response) {
- Object.keys(options.response).forEach(function(k) {
- var key = "response-".concat(k.toLowerCase());
- subResource[key] = options.response[k];
- });
- }
- Object.keys(options).forEach(function(key) {
- var lowerKey = key.toLowerCase();
- var value = options[key];
- if (lowerKey.indexOf("x-oss-") === 0) {
- headers[lowerKey] = value;
- } else if (lowerKey.indexOf("content-md5") === 0) {
- headers[key] = value;
- } else if (lowerKey.indexOf("content-type") === 0) {
- headers[key] = value;
- }
- });
- if (Object.prototype.hasOwnProperty.call(options, "security-token")) {
- subResource["security-token"] = options["security-token"];
- }
- if (Object.prototype.hasOwnProperty.call(options, "callback")) {
- var json = {
- callbackUrl: encodeURI(options.callback.url),
- callbackBody: options.callback.body
- };
- if (options.callback.host) {
- json.callbackHost = options.callback.host;
- }
- if (options.callback.contentType) {
- json.callbackBodyType = options.callback.contentType;
- }
- subResource.callback = Buffer.from(JSON.stringify(json)).toString("base64");
- if (options.callback.customValue) {
- var callbackVar = {};
- Object.keys(options.callback.customValue).forEach(function(key) {
- callbackVar["x:".concat(key)] = options.callback.customValue[key];
- });
- subResource["callback-var"] = Buffer.from(JSON.stringify(callbackVar)).toString("base64");
- }
- }
- var canonicalString = this.buildCanonicalString(options.method, resource, {
- headers,
- parameters: subResource
- }, expires.toString());
- return {
- Signature: this.computeSignature(accessKeySecret, canonicalString, headerEncoding),
- subResource
- };
- };
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "./../../shims/crypto/crypto.js": 461, "./utils/lowercaseKeyHeader": 71, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.sort.js": 282, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.trim.js": 308, "core-js/modules/web.dom-collections.for-each.js": 339, "is-type-of": 466 }], 51: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkBucketName = void 0;
- exports3.checkBucketName = function(name) {
- var createBucket = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;
- if (!bucketRegex.test(name)) {
- throw new Error("The bucket must be conform to the specifications");
- }
- };
- }, { "core-js/modules/es.regexp.exec.js": 300 }], 52: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkConfigValid = void 0;
- var checkConfigMap = {
- endpoint: checkEndpoint,
- region: /^[a-zA-Z0-9\-_]+$/
- };
- function checkEndpoint(endpoint) {
- if (typeof endpoint === "string") {
- return /^[a-zA-Z0-9._:/-]+$/.test(endpoint);
- } else if (endpoint.host) {
- return /^[a-zA-Z0-9._:/-]+$/.test(endpoint.host);
- }
- return false;
- }
- exports3.checkConfigValid = function(conf, key) {
- if (checkConfigMap[key]) {
- var isConfigValid = true;
- if (checkConfigMap[key] instanceof Function) {
- isConfigValid = checkConfigMap[key](conf);
- } else {
- isConfigValid = checkConfigMap[key].test(conf);
- }
- if (!isConfigValid) {
- throw new Error("The ".concat(key, " must be conform to the specifications"));
- }
- }
- };
- }, { "core-js/modules/es.regexp.exec.js": 300 }], 53: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkEnv = void 0;
- function checkEnv(msg) {
- if (process.browser) {
- console.warn(msg);
- }
- }
- exports3.checkEnv = checkEnv;
- }).call(this);
- }).call(this, require2("_process"));
- }, { "_process": 467 }], 54: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.object.entries.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkObjectTag = void 0;
- var _require = require2("./checkValid"), checkValid = _require.checkValid;
- var _require2 = require2("./isObject"), isObject = _require2.isObject;
- var commonRules = [{
- validator: function validator(value) {
- if (typeof value !== "string") {
- throw new Error("the key and value of the tag must be String");
- }
- }
- }, {
- pattern: /^[a-zA-Z0-9 +-=._:/]+$/,
- msg: "tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"
- }];
- var rules = {
- key: [].concat(commonRules, [{
- pattern: /^.{1,128}$/,
- msg: "tag key can be a maximum of 128 bytes in length"
- }]),
- value: [].concat(commonRules, [{
- pattern: /^.{0,256}$/,
- msg: "tag value can be a maximum of 256 bytes in length"
- }])
- };
- function checkObjectTag(tag) {
- if (!isObject(tag)) {
- throw new Error("tag must be Object");
- }
- var entries = Object.entries(tag);
- if (entries.length > 10) {
- throw new Error("maximum of 10 tags for a object");
- }
- var rulesIndexKey = ["key", "value"];
- entries.forEach(function(keyValue) {
- keyValue.forEach(function(item, index) {
- checkValid(item, rules[rulesIndexKey[index]]);
- });
- });
- }
- exports3.checkObjectTag = checkObjectTag;
- }, { "./checkValid": 55, "./isObject": 70, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.entries.js": 288, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 55: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.regexp.exec.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkValid = void 0;
- function checkValid(_value, _rules) {
- _rules.forEach(function(rule) {
- if (rule.validator) {
- rule.validator(_value);
- } else if (rule.pattern && !rule.pattern.test(_value)) {
- throw new Error(rule.msg);
- }
- });
- }
- exports3.checkValid = checkValid;
- }, { "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/web.dom-collections.for-each.js": 339 }], 56: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.string.includes.js");
- require2("core-js/modules/es.object.assign.js");
- require2("core-js/modules/es.array.concat.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.createRequest = void 0;
- var crypto = require2("./../../../shims/crypto/crypto.js");
- var debug = require2("debug")("ali-oss");
- var mime = require2("mime");
- var dateFormat = require2("dateformat");
- var copy = require2("copy-to");
- var path = require2("path");
- var _require = require2("./encoder"), encoder = _require.encoder;
- var _require2 = require2("./isIP"), isIP = _require2.isIP;
- var _require3 = require2("./setRegion"), setRegion = _require3.setRegion;
- var _require4 = require2("../client/getReqUrl"), getReqUrl = _require4.getReqUrl;
- var _require5 = require2("./isDingTalk"), isDingTalk = _require5.isDingTalk;
- function getHeader(headers, name) {
- return headers[name] || headers[name.toLowerCase()];
- }
- function delHeader(headers, name) {
- delete headers[name];
- delete headers[name.toLowerCase()];
- }
- function createRequest(params) {
- var date = /* @__PURE__ */ new Date();
- if (this.options.amendTimeSkewed) {
- date = +/* @__PURE__ */ new Date() + this.options.amendTimeSkewed;
- }
- var headers = {
- "x-oss-date": dateFormat(date, "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'")
- };
- if (typeof window !== "undefined") {
- headers["x-oss-user-agent"] = this.userAgent;
- }
- if (this.userAgent.includes("nodejs")) {
- headers["User-Agent"] = this.userAgent;
- }
- if (this.options.isRequestPay) {
- Object.assign(headers, {
- "x-oss-request-payer": "requester"
- });
- }
- if (this.options.stsToken) {
- headers["x-oss-security-token"] = this.options.stsToken;
- }
- copy(params.headers).to(headers);
- if (!getHeader(headers, "Content-Type")) {
- if (params.mime && params.mime.indexOf("/") > 0) {
- headers["Content-Type"] = params.mime;
- } else if (isDingTalk()) {
- headers["Content-Type"] = "application/octet-stream";
- } else {
- headers["Content-Type"] = mime.getType(params.mime || path.extname(params.object || ""));
- }
- }
- if (!getHeader(headers, "Content-Type")) {
- delHeader(headers, "Content-Type");
- }
- if (params.content) {
- if (!params.disabledMD5) {
- if (!params.headers || !params.headers["Content-MD5"]) {
- headers["Content-MD5"] = crypto.createHash("md5").update(Buffer.from(params.content, "utf8")).digest("base64");
- } else {
- headers["Content-MD5"] = params.headers["Content-MD5"];
- }
- }
- if (!headers["Content-Length"]) {
- headers["Content-Length"] = params.content.length;
- }
- }
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- for (var k in headers) {
- if (headers[k] && hasOwnProperty.call(headers, k)) {
- headers[k] = encoder(String(headers[k]), this.options.headerEncoding);
- }
- }
- var authResource = this._getResource(params);
- headers.authorization = this.authorization(params.method, authResource, params.subres, headers, this.options.headerEncoding);
- if (isIP(this.options.endpoint.hostname)) {
- var _this$options = this.options, region = _this$options.region, internal = _this$options.internal, secure = _this$options.secure;
- var hostInfo = setRegion(region, internal, secure);
- headers.host = "".concat(params.bucket, ".").concat(hostInfo.host);
- }
- var url = getReqUrl.bind(this)(params);
- debug("request %s %s, with headers %j, !!stream: %s", params.method, url, headers, !!params.stream);
- var timeout = params.timeout || this.options.timeout;
- var reqParams = {
- method: params.method,
- content: params.content,
- stream: params.stream,
- headers,
- timeout,
- writeStream: params.writeStream,
- customResponse: params.customResponse,
- ctx: params.ctx || this.ctx
- };
- if (this.agent) {
- reqParams.agent = this.agent;
- }
- if (this.httpsAgent) {
- reqParams.httpsAgent = this.httpsAgent;
- }
- reqParams.enableProxy = !!this.options.enableProxy;
- reqParams.proxy = this.options.proxy ? this.options.proxy : null;
- return {
- url,
- params: reqParams
- };
- }
- exports3.createRequest = createRequest;
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "../client/getReqUrl": 25, "./../../../shims/crypto/crypto.js": 461, "./encoder": 59, "./isDingTalk": 66, "./isIP": 69, "./setRegion": 75, "buffer": 90, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.string.includes.js": 302, "dateformat": 342, "debug": 465, "mime": 374, "path": 378 }], 57: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.entries.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.object.keys.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.dataFix = void 0;
- var isObject_1 = require2("./isObject");
- var TRUE = ["true", "TRUE", "1", 1];
- var FALSE = ["false", "FALSE", "0", 0];
- function dataFix(o, conf, finalKill) {
- if (!isObject_1.isObject(o))
- return;
- var _conf$remove = conf.remove, remove = _conf$remove === void 0 ? [] : _conf$remove, _conf$rename = conf.rename, rename = _conf$rename === void 0 ? {} : _conf$rename, _conf$camel = conf.camel, camel = _conf$camel === void 0 ? [] : _conf$camel, _conf$bool = conf.bool, bool = _conf$bool === void 0 ? [] : _conf$bool, _conf$lowerFirst = conf.lowerFirst, lowerFirst = _conf$lowerFirst === void 0 ? false : _conf$lowerFirst;
- remove.forEach(function(v) {
- return delete o[v];
- });
- Object.entries(rename).forEach(function(v) {
- if (!o[v[0]])
- return;
- if (o[v[1]])
- return;
- o[v[1]] = o[v[0]];
- delete o[v[0]];
- });
- camel.forEach(function(v) {
- if (!o[v])
- return;
- var afterKey = v.replace(/^(.)/, function($0) {
- return $0.toLowerCase();
- }).replace(/-(\w)/g, function(_, $1) {
- return $1.toUpperCase();
- });
- if (o[afterKey])
- return;
- o[afterKey] = o[v];
- });
- bool.forEach(function(v) {
- o[v] = fixBool(o[v]);
- });
- if (typeof finalKill === "function") {
- finalKill(o);
- }
- fixLowerFirst(o, lowerFirst);
- return dataFix;
- }
- exports3.dataFix = dataFix;
- function fixBool(value) {
- if (!value)
- return false;
- if (TRUE.includes(value))
- return true;
- return FALSE.includes(value) ? false : value;
- }
- function fixLowerFirst(o, lowerFirst) {
- if (lowerFirst) {
- Object.keys(o).forEach(function(key) {
- var lowerK = key.replace(/^\w/, function(match) {
- return match.toLowerCase();
- });
- if (typeof o[lowerK] === "undefined") {
- o[lowerK] = o[key];
- delete o[key];
- }
- });
- }
- }
- }, { "./isObject": 70, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.entries.js": 288, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 58: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- require2("core-js/modules/es.array.slice.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.deepCopyWith = exports3.deepCopy = void 0;
- var isBuffer_1 = require2("./isBuffer");
- exports3.deepCopy = function(obj) {
- if (obj === null || (0, _typeof2.default)(obj) !== "object") {
- return obj;
- }
- if (isBuffer_1.isBuffer(obj)) {
- return obj.slice();
- }
- var copy = Array.isArray(obj) ? [] : {};
- Object.keys(obj).forEach(function(key) {
- copy[key] = exports3.deepCopy(obj[key]);
- });
- return copy;
- };
- exports3.deepCopyWith = function(obj, customizer) {
- function deepCopyWithHelper(value, innerKey, innerObject) {
- var result = customizer(value, innerKey, innerObject);
- if (result !== void 0)
- return result;
- if (value === null || (0, _typeof2.default)(value) !== "object") {
- return value;
- }
- if (isBuffer_1.isBuffer(value)) {
- return value.slice();
- }
- var copy = Array.isArray(value) ? [] : {};
- Object.keys(value).forEach(function(k) {
- copy[k] = deepCopyWithHelper(value[k], k, value);
- });
- return copy;
- }
- if (customizer) {
- return deepCopyWithHelper(obj, "", null);
- } else {
- return exports3.deepCopy(obj);
- }
- };
- }, { "./isBuffer": 65, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 59: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.regexp.to-string.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.encoder = void 0;
- function encoder(str) {
- var encoding = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "utf-8";
- if (encoding === "utf-8")
- return str;
- return Buffer.from(str).toString("latin1");
- }
- exports3.encoder = encoder;
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "buffer": 90, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 60: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.formatInventoryConfig = void 0;
- var dataFix_1 = require2("../utils/dataFix");
- var isObject_1 = require2("../utils/isObject");
- var isArray_1 = require2("../utils/isArray");
- var formatObjKey_1 = require2("../utils/formatObjKey");
- function formatInventoryConfig(inventoryConfig) {
- var toArray = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (toArray && isObject_1.isObject(inventoryConfig))
- inventoryConfig = [inventoryConfig];
- if (isArray_1.isArray(inventoryConfig)) {
- inventoryConfig = inventoryConfig.map(formatFn);
- } else {
- inventoryConfig = formatFn(inventoryConfig);
- }
- return inventoryConfig;
- }
- exports3.formatInventoryConfig = formatInventoryConfig;
- function formatFn(_) {
- dataFix_1.dataFix(_, {
- bool: ["IsEnabled"]
- }, function(conf) {
- var _a, _b;
- conf.prefix = conf.Filter.Prefix;
- delete conf.Filter;
- conf.OSSBucketDestination = conf.Destination.OSSBucketDestination;
- conf.OSSBucketDestination.rolename = conf.OSSBucketDestination.RoleArn.replace(/.*\//, "");
- delete conf.OSSBucketDestination.RoleArn;
- conf.OSSBucketDestination.bucket = conf.OSSBucketDestination.Bucket.replace(/.*:::/, "");
- delete conf.OSSBucketDestination.Bucket;
- delete conf.Destination;
- conf.frequency = conf.Schedule.Frequency;
- delete conf.Schedule.Frequency;
- if (((_a = conf === null || conf === void 0 ? void 0 : conf.OptionalFields) === null || _a === void 0 ? void 0 : _a.Field) && !isArray_1.isArray((_b = conf.OptionalFields) === null || _b === void 0 ? void 0 : _b.Field))
- conf.OptionalFields.Field = [conf.OptionalFields.Field];
- });
- _ = formatObjKey_1.formatObjKey(_, "firstLowerCase", {
- exclude: ["OSSBucketDestination", "SSE-OSS", "SSE-KMS"]
- });
- return _;
- }
- }, { "../utils/dataFix": 57, "../utils/formatObjKey": 61, "../utils/isArray": 63, "../utils/isObject": 70, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305 }], 61: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.string.includes.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.formatObjKey = void 0;
- function formatObjKey(obj, type, options) {
- if (obj === null || (0, _typeof2.default)(obj) !== "object") {
- return obj;
- }
- var o;
- if (Array.isArray(obj)) {
- o = [];
- for (var i = 0; i < obj.length; i++) {
- o.push(formatObjKey(obj[i], type, options));
- }
- } else {
- o = {};
- Object.keys(obj).forEach(function(key) {
- o[handelFormat(key, type, options)] = formatObjKey(obj[key], type, options);
- });
- }
- return o;
- }
- exports3.formatObjKey = formatObjKey;
- function handelFormat(key, type, options) {
- if (options && options.exclude && options.exclude.includes(key))
- return key;
- if (type === "firstUpperCase") {
- key = key.replace(/^./, function(_) {
- return _.toUpperCase();
- });
- } else if (type === "firstLowerCase") {
- key = key.replace(/^./, function(_) {
- return _.toLowerCase();
- });
- }
- return key;
- }
- }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.includes.js": 302, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 62: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.getStrBytesCount = void 0;
- function getStrBytesCount(str) {
- var bytesCount = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charAt(i);
- if (/^[\u00-\uff]$/.test(c)) {
- bytesCount += 1;
- } else {
- bytesCount += 2;
- }
- }
- return bytesCount;
- }
- exports3.getStrBytesCount = getStrBytesCount;
- }, { "core-js/modules/es.regexp.exec.js": 300 }], 63: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isArray = void 0;
- exports3.isArray = function(obj) {
- return Object.prototype.toString.call(obj) === "[object Array]";
- };
- }, { "core-js/modules/es.object.to-string.js": 291 }], 64: [function(require2, module3, exports3) {
- "use strict";
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isBlob = void 0;
- function isBlob(blob) {
- return typeof Blob !== "undefined" && blob instanceof Blob;
- }
- exports3.isBlob = isBlob;
- }, {}], 65: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isBuffer = void 0;
- function isBuffer(obj) {
- return Buffer.isBuffer(obj);
- }
- exports3.isBuffer = isBuffer;
- }).call(this);
- }).call(this, { "isBuffer": require2("../../../node_modules/is-buffer/index.js") });
- }, { "../../../node_modules/is-buffer/index.js": 366 }], 66: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- require2("core-js/modules/es.array.includes.js");
- require2("core-js/modules/es.string.includes.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isDingTalk = void 0;
- function isDingTalk() {
- if (process.browser && window.navigator.userAgent.toLowerCase().includes("aliapp(dingtalk")) {
- return true;
- }
- return false;
- }
- exports3.isDingTalk = isDingTalk;
- }).call(this);
- }).call(this, require2("_process"));
- }, { "_process": 467, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.string.includes.js": 302 }], 67: [function(require2, module3, exports3) {
- "use strict";
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isFile = void 0;
- exports3.isFile = function(obj) {
- return typeof File !== "undefined" && obj instanceof File;
- };
- }, {}], 68: [function(require2, module3, exports3) {
- "use strict";
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isFunction = void 0;
- exports3.isFunction = function(v) {
- return typeof v === "function";
- };
- }, {}], 69: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isIP = void 0;
- exports3.isIP = function(host) {
- var ipv4Regex = /^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
- var ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
- return ipv4Regex.test(host) || ipv6Regex.test(host);
- };
- }, { "core-js/modules/es.regexp.exec.js": 300 }], 70: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.isObject = void 0;
- exports3.isObject = function(obj) {
- return Object.prototype.toString.call(obj) === "[object Object]";
- };
- }, { "core-js/modules/es.object.to-string.js": 291 }], 71: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.lowercaseKeyHeader = void 0;
- var isObject_1 = require2("./isObject");
- function lowercaseKeyHeader(headers) {
- var lowercaseHeader = {};
- if (isObject_1.isObject(headers)) {
- Object.keys(headers).forEach(function(key) {
- lowercaseHeader[key.toLowerCase()] = headers[key];
- });
- }
- return lowercaseHeader;
- }
- exports3.lowercaseKeyHeader = lowercaseKeyHeader;
- }, { "./isObject": 70, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 72: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.array.join.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.regexp.to-string.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.obj2xml = void 0;
- var formatObjKey_1 = require2("./formatObjKey");
- function type(params) {
- return Object.prototype.toString.call(params).replace(/(.*? |])/g, "").toLowerCase();
- }
- function obj2xml(obj, options) {
- var s = "";
- if (options && options.headers) {
- s = '<?xml version="1.0" encoding="UTF-8"?>\n';
- }
- if (options && options.firstUpperCase) {
- obj = formatObjKey_1.formatObjKey(obj, "firstUpperCase");
- }
- if (type(obj) === "object") {
- Object.keys(obj).forEach(function(key) {
- if (type(obj[key]) !== "undefined" && type(obj[key]) !== "null") {
- if (type(obj[key]) === "string" || type(obj[key]) === "number") {
- s += "<".concat(key, ">").concat(obj[key], "</").concat(key, ">");
- } else if (type(obj[key]) === "object") {
- s += "<".concat(key, ">").concat(obj2xml(obj[key]), "</").concat(key, ">");
- } else if (type(obj[key]) === "array") {
- s += obj[key].map(function(keyChild) {
- return "<".concat(key, ">").concat(obj2xml(keyChild), "</").concat(key, ">");
- }).join("");
- } else {
- s += "<".concat(key, ">").concat(obj[key].toString(), "</").concat(key, ">");
- }
- }
- });
- } else {
- s += obj.toString();
- }
- return s;
- }
- exports3.obj2xml = obj2xml;
- }, { "./formatObjKey": 61, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 73: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.slice.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.array.from.js");
- require2("core-js/modules/es.string.iterator.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.symbol.js");
- require2("core-js/modules/es.symbol.description.js");
- require2("core-js/modules/es.symbol.iterator.js");
- require2("core-js/modules/es.array.iterator.js");
- require2("core-js/modules/web.dom-collections.iterator.js");
- require2("core-js/modules/es.object.assign.js");
- function _createForOfIteratorHelper(o, allowArrayLike) {
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
- if (!it) {
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
- if (it)
- o = it;
- var i = 0;
- var F = function F2() {
- };
- return { s: F, n: function n() {
- if (i >= o.length)
- return { done: true };
- return { done: false, value: o[i++] };
- }, e: function e(_e) {
- throw _e;
- }, f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var normalCompletion = true, didErr = false, err;
- return { s: function s() {
- it = it.call(o);
- }, n: function n() {
- var step = it.next();
- normalCompletion = step.done;
- return step;
- }, e: function e(_e2) {
- didErr = true;
- err = _e2;
- }, f: function f() {
- try {
- if (!normalCompletion && it.return != null)
- it.return();
- } finally {
- if (didErr)
- throw err;
- }
- } };
- }
- 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;
- }
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.omit = void 0;
- function omit(originalObject, keysToOmit) {
- var cloneObject = Object.assign({}, originalObject);
- var _iterator = _createForOfIteratorHelper(keysToOmit), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var path = _step.value;
- delete cloneObject[path];
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return cloneObject;
- }
- exports3.omit = omit;
- }, { "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/es.symbol.description.js": 310, "core-js/modules/es.symbol.iterator.js": 312, "core-js/modules/es.symbol.js": 313, "core-js/modules/web.dom-collections.iterator.js": 340 }], 74: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.retry = void 0;
- function retry(func, retryMax) {
- var config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var retryNum = 0;
- var _config$retryDelay = config.retryDelay, retryDelay = _config$retryDelay === void 0 ? 500 : _config$retryDelay, _config$errorHandler = config.errorHandler, errorHandler = _config$errorHandler === void 0 ? function() {
- return true;
- } : _config$errorHandler;
- var funcR = function funcR2() {
- for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
- arg[_key] = arguments[_key];
- }
- return new Promise(function(resolve, reject) {
- func.apply(void 0, arg).then(function(result) {
- retryNum = 0;
- resolve(result);
- }).catch(function(err) {
- if (retryNum < retryMax && errorHandler(err)) {
- retryNum++;
- setTimeout(function() {
- resolve(funcR2.apply(void 0, arg));
- }, retryDelay);
- } else {
- retryNum = 0;
- reject(err);
- }
- });
- });
- };
- return funcR;
- }
- exports3.retry = retry;
- }, { "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295 }], 75: [function(require2, module3, exports3) {
- "use strict";
- var __importDefault = function(mod) {
- return mod && mod.__esModule ? mod : {
- "default": mod
- };
- };
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.setRegion = void 0;
- var url_1 = __importDefault(require2("url"));
- var checkConfigValid_1 = require2("./checkConfigValid");
- function setRegion(region) {
- var internal = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var secure = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
- checkConfigValid_1.checkConfigValid(region, "region");
- var protocol = secure ? "https://" : "http://";
- var suffix = internal ? "-internal.aliyuncs.com" : ".aliyuncs.com";
- var prefix = "vpc100-oss-cn-";
- if (region.substr(0, prefix.length) === prefix) {
- suffix = ".aliyuncs.com";
- }
- return url_1.default.parse(protocol + region + suffix);
- }
- exports3.setRegion = setRegion;
- }, { "./checkConfigValid": 52, "url": 472 }], 76: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.array.find.js");
- require2("core-js/modules/es.object.assign.js");
- var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
- Object.defineProperty(exports3, "__esModule", {
- value: true
- });
- exports3.checkCredentials = exports3.setSTSToken = void 0;
- var formatObjKey_1 = require2("./formatObjKey");
- function setSTSToken() {
- return _setSTSToken.apply(this, arguments);
- }
- function _setSTSToken() {
- _setSTSToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
- var now, credentials;
- return _regenerator.default.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- if (!this.options)
- this.options = {};
- now = /* @__PURE__ */ new Date();
- if (!this.stsTokenFreshTime) {
- _context.next = 14;
- break;
- }
- if (!(+now - this.stsTokenFreshTime >= this.options.refreshSTSTokenInterval)) {
- _context.next = 12;
- break;
- }
- this.stsTokenFreshTime = now;
- _context.next = 7;
- return this.options.refreshSTSToken();
- case 7:
- credentials = _context.sent;
- credentials = formatObjKey_1.formatObjKey(credentials, "firstLowerCase");
- if (credentials.securityToken) {
- credentials.stsToken = credentials.securityToken;
- }
- checkCredentials(credentials);
- Object.assign(this.options, credentials);
- case 12:
- _context.next = 15;
- break;
- case 14:
- this.stsTokenFreshTime = now;
- case 15:
- return _context.abrupt("return", null);
- case 16:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return _setSTSToken.apply(this, arguments);
- }
- exports3.setSTSToken = setSTSToken;
- function checkCredentials(obj) {
- var stsTokenKey = ["accessKeySecret", "accessKeyId", "stsToken"];
- var objKeys = Object.keys(obj);
- stsTokenKey.forEach(function(_) {
- if (!objKeys.find(function(key) {
- return key === _;
- })) {
- throw Error("refreshSTSToken must return contains ".concat(_));
- }
- });
- }
- exports3.checkCredentials = checkCredentials;
- }, { "./formatObjKey": 61, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291 }], 77: [function(require2, module3, exports3) {
- 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 self2 = this, args = arguments;
- return new Promise(function(resolve, reject) {
- var gen = fn.apply(self2, args);
- function _next(value) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
- }
- function _throw(err) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
- }
- _next(void 0);
- });
- };
- }
- module3.exports = _asyncToGenerator, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
- }, {}], 78: [function(require2, module3, exports3) {
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- module3.exports = _interopRequireDefault, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
- }, {}], 79: [function(require2, module3, exports3) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return module3.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
- return typeof obj2;
- } : function(obj2) {
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
- }, module3.exports.__esModule = true, module3.exports["default"] = module3.exports, _typeof(obj);
- }
- module3.exports = _typeof, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
- }, {}], 80: [function(require2, module3, exports3) {
- module3.exports = require2("regenerator-runtime");
- }, { "regenerator-runtime": 395 }], 81: [function(require2, module3, exports3) {
- module3.exports = noop;
- module3.exports.HttpsAgent = noop;
- function noop() {
- }
- }, {}], 82: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- var objectAssign = require2("object-assign");
- function compare(a, b) {
- if (a === b) {
- return 0;
- }
- var x = a.length;
- var y = b.length;
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i];
- y = b[i];
- break;
- }
- }
- if (x < y) {
- return -1;
- }
- if (y < x) {
- return 1;
- }
- return 0;
- }
- function isBuffer(b) {
- if (global2.Buffer && typeof global2.Buffer.isBuffer === "function") {
- return global2.Buffer.isBuffer(b);
- }
- return !!(b != null && b._isBuffer);
- }
- var util = require2("util/");
- var hasOwn = Object.prototype.hasOwnProperty;
- var pSlice = Array.prototype.slice;
- var functionsHaveNames = function() {
- return function foo() {
- }.name === "foo";
- }();
- function pToString(obj) {
- return Object.prototype.toString.call(obj);
- }
- function isView(arrbuf) {
- if (isBuffer(arrbuf)) {
- return false;
- }
- if (typeof global2.ArrayBuffer !== "function") {
- return false;
- }
- if (typeof ArrayBuffer.isView === "function") {
- return ArrayBuffer.isView(arrbuf);
- }
- if (!arrbuf) {
- return false;
- }
- if (arrbuf instanceof DataView) {
- return true;
- }
- if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
- return true;
- }
- return false;
- }
- var assert = module3.exports = ok;
- var regex = /\s*function\s+([^\(\s]*)\s*/;
- function getName(func) {
- if (!util.isFunction(func)) {
- return;
- }
- if (functionsHaveNames) {
- return func.name;
- }
- var str = func.toString();
- var match = str.match(regex);
- return match && match[1];
- }
- assert.AssertionError = function AssertionError(options) {
- this.name = "AssertionError";
- this.actual = options.actual;
- this.expected = options.expected;
- this.operator = options.operator;
- if (options.message) {
- this.message = options.message;
- this.generatedMessage = false;
- } else {
- this.message = getMessage(this);
- this.generatedMessage = true;
- }
- var stackStartFunction = options.stackStartFunction || fail;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, stackStartFunction);
- } else {
- var err = new Error();
- if (err.stack) {
- var out = err.stack;
- var fn_name = getName(stackStartFunction);
- var idx = out.indexOf("\n" + fn_name);
- if (idx >= 0) {
- var next_line = out.indexOf("\n", idx + 1);
- out = out.substring(next_line + 1);
- }
- this.stack = out;
- }
- }
- };
- util.inherits(assert.AssertionError, Error);
- function truncate(s, n) {
- if (typeof s === "string") {
- return s.length < n ? s : s.slice(0, n);
- } else {
- return s;
- }
- }
- function inspect(something) {
- if (functionsHaveNames || !util.isFunction(something)) {
- return util.inspect(something);
- }
- var rawname = getName(something);
- var name = rawname ? ": " + rawname : "";
- return "[Function" + name + "]";
- }
- function getMessage(self2) {
- return truncate(inspect(self2.actual), 128) + " " + self2.operator + " " + truncate(inspect(self2.expected), 128);
- }
- function fail(actual, expected, message, operator, stackStartFunction) {
- throw new assert.AssertionError({
- message,
- actual,
- expected,
- operator,
- stackStartFunction
- });
- }
- assert.fail = fail;
- function ok(value, message) {
- if (!value)
- fail(value, true, message, "==", assert.ok);
- }
- assert.ok = ok;
- assert.equal = function equal(actual, expected, message) {
- if (actual != expected)
- fail(actual, expected, message, "==", assert.equal);
- };
- assert.notEqual = function notEqual(actual, expected, message) {
- if (actual == expected) {
- fail(actual, expected, message, "!=", assert.notEqual);
- }
- };
- assert.deepEqual = function deepEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, "deepEqual", assert.deepEqual);
- }
- };
- assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, "deepStrictEqual", assert.deepStrictEqual);
- }
- };
- function _deepEqual(actual, expected, strict2, memos) {
- if (actual === expected) {
- return true;
- } else if (isBuffer(actual) && isBuffer(expected)) {
- return compare(actual, expected) === 0;
- } else if (util.isDate(actual) && util.isDate(expected)) {
- return actual.getTime() === expected.getTime();
- } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
- return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase;
- } else if ((actual === null || typeof actual !== "object") && (expected === null || typeof expected !== "object")) {
- return strict2 ? actual === expected : actual == expected;
- } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) {
- return compare(
- new Uint8Array(actual.buffer),
- new Uint8Array(expected.buffer)
- ) === 0;
- } else if (isBuffer(actual) !== isBuffer(expected)) {
- return false;
- } else {
- memos = memos || { actual: [], expected: [] };
- var actualIndex = memos.actual.indexOf(actual);
- if (actualIndex !== -1) {
- if (actualIndex === memos.expected.indexOf(expected)) {
- return true;
- }
- }
- memos.actual.push(actual);
- memos.expected.push(expected);
- return objEquiv(actual, expected, strict2, memos);
- }
- }
- function isArguments(object) {
- return Object.prototype.toString.call(object) == "[object Arguments]";
- }
- function objEquiv(a, b, strict2, actualVisitedObjects) {
- if (a === null || a === void 0 || b === null || b === void 0)
- return false;
- if (util.isPrimitive(a) || util.isPrimitive(b))
- return a === b;
- if (strict2 && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
- return false;
- var aIsArgs = isArguments(a);
- var bIsArgs = isArguments(b);
- if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs)
- return false;
- if (aIsArgs) {
- a = pSlice.call(a);
- b = pSlice.call(b);
- return _deepEqual(a, b, strict2);
- }
- var ka = objectKeys(a);
- var kb = objectKeys(b);
- var key, i;
- if (ka.length !== kb.length)
- return false;
- ka.sort();
- kb.sort();
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] !== kb[i])
- return false;
- }
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!_deepEqual(a[key], b[key], strict2, actualVisitedObjects))
- return false;
- }
- return true;
- }
- assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);
- }
- };
- assert.notDeepStrictEqual = notDeepStrictEqual;
- function notDeepStrictEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, "notDeepStrictEqual", notDeepStrictEqual);
- }
- }
- assert.strictEqual = function strictEqual(actual, expected, message) {
- if (actual !== expected) {
- fail(actual, expected, message, "===", assert.strictEqual);
- }
- };
- assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
- if (actual === expected) {
- fail(actual, expected, message, "!==", assert.notStrictEqual);
- }
- };
- function expectedException(actual, expected) {
- if (!actual || !expected) {
- return false;
- }
- if (Object.prototype.toString.call(expected) == "[object RegExp]") {
- return expected.test(actual);
- }
- try {
- if (actual instanceof expected) {
- return true;
- }
- } catch (e) {
- }
- if (Error.isPrototypeOf(expected)) {
- return false;
- }
- return expected.call({}, actual) === true;
- }
- function _tryBlock(block) {
- var error;
- try {
- block();
- } catch (e) {
- error = e;
- }
- return error;
- }
- function _throws(shouldThrow, block, expected, message) {
- var actual;
- if (typeof block !== "function") {
- throw new TypeError('"block" argument must be a function');
- }
- if (typeof expected === "string") {
- message = expected;
- expected = null;
- }
- actual = _tryBlock(block);
- message = (expected && expected.name ? " (" + expected.name + ")." : ".") + (message ? " " + message : ".");
- if (shouldThrow && !actual) {
- fail(actual, expected, "Missing expected exception" + message);
- }
- var userProvidedMessage = typeof message === "string";
- var isUnwantedException = !shouldThrow && util.isError(actual);
- var isUnexpectedException = !shouldThrow && actual && !expected;
- if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) {
- fail(actual, expected, "Got unwanted exception" + message);
- }
- if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) {
- throw actual;
- }
- }
- assert.throws = function(block, error, message) {
- _throws(true, block, error, message);
- };
- assert.doesNotThrow = function(block, error, message) {
- _throws(false, block, error, message);
- };
- assert.ifError = function(err) {
- if (err)
- throw err;
- };
- function strict(value, message) {
- if (!value)
- fail(value, true, message, "==", strict);
- }
- assert.strict = objectAssign(strict, assert, {
- equal: assert.strictEqual,
- deepEqual: assert.deepStrictEqual,
- notEqual: assert.notStrictEqual,
- notDeepEqual: assert.notDeepStrictEqual
- });
- assert.strict.strict = assert.strict;
- var objectKeys = Object.keys || function(obj) {
- var keys = [];
- for (var key in obj) {
- if (hasOwn.call(obj, key))
- keys.push(key);
- }
- return keys;
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "object-assign": 377, "util/": 85 }], 83: [function(require2, module3, exports3) {
- if (typeof Object.create === "function") {
- module3.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
- } else {
- module3.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function() {
- };
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- };
- }
- }, {}], 84: [function(require2, module3, exports3) {
- module3.exports = function isBuffer(arg) {
- return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function";
- };
- }, {}], 85: [function(require2, module3, exports3) {
- (function(process, global2) {
- (function() {
- var formatRegExp = /%[sdj%]/g;
- exports3.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(" ");
- }
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x2) {
- if (x2 === "%%")
- return "%";
- if (i >= len)
- return x2;
- switch (x2) {
- case "%s":
- return String(args[i++]);
- case "%d":
- return Number(args[i++]);
- case "%j":
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return "[Circular]";
- }
- default:
- return x2;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += " " + x;
- } else {
- str += " " + inspect(x);
- }
- }
- return str;
- };
- exports3.deprecate = function(fn, msg) {
- if (isUndefined(global2.process)) {
- return function() {
- return exports3.deprecate(fn, msg).apply(this, arguments);
- };
- }
- if (process.noDeprecation === true) {
- return fn;
- }
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
- return deprecated;
- };
- var debugs = {};
- var debugEnviron;
- exports3.debuglog = function(set) {
- if (isUndefined(debugEnviron))
- debugEnviron = process.env.NODE_DEBUG || "";
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports3.format.apply(exports3, arguments);
- console.error("%s %d: %s", set, pid, msg);
- };
- } else {
- debugs[set] = function() {
- };
- }
- }
- return debugs[set];
- };
- function inspect(obj, opts) {
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- if (arguments.length >= 3)
- ctx.depth = arguments[2];
- if (arguments.length >= 4)
- ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- ctx.showHidden = opts;
- } else if (opts) {
- exports3._extend(ctx, opts);
- }
- if (isUndefined(ctx.showHidden))
- ctx.showHidden = false;
- if (isUndefined(ctx.depth))
- ctx.depth = 2;
- if (isUndefined(ctx.colors))
- ctx.colors = false;
- if (isUndefined(ctx.customInspect))
- ctx.customInspect = true;
- if (ctx.colors)
- ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
- }
- exports3.inspect = inspect;
- inspect.colors = {
- "bold": [1, 22],
- "italic": [3, 23],
- "underline": [4, 24],
- "inverse": [7, 27],
- "white": [37, 39],
- "grey": [90, 39],
- "black": [30, 39],
- "blue": [34, 39],
- "cyan": [36, 39],
- "green": [32, 39],
- "magenta": [35, 39],
- "red": [31, 39],
- "yellow": [33, 39]
- };
- inspect.styles = {
- "special": "cyan",
- "number": "yellow",
- "boolean": "yellow",
- "undefined": "grey",
- "null": "bold",
- "string": "green",
- "date": "magenta",
- // "name": intentionally not styling
- "regexp": "red"
- };
- function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
- if (style) {
- return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
- } else {
- return str;
- }
- }
- function stylizeNoColor(str, styleType) {
- return str;
- }
- function arrayToHash(array) {
- var hash = {};
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
- return hash;
- }
- function formatValue(ctx, value, recurseTimes) {
- if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
- value.inspect !== exports3.inspect && // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
- if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
- return formatError(value);
- }
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ": " + value.name : "";
- return ctx.stylize("[Function" + name + "]", "special");
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), "date");
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
- var base = "", array = false, braces = ["{", "}"];
- if (isArray(value)) {
- array = true;
- braces = ["[", "]"];
- }
- if (isFunction(value)) {
- var n = value.name ? ": " + value.name : "";
- base = " [Function" + n + "]";
- }
- if (isRegExp(value)) {
- base = " " + RegExp.prototype.toString.call(value);
- }
- if (isDate(value)) {
- base = " " + Date.prototype.toUTCString.call(value);
- }
- if (isError(value)) {
- base = " " + formatError(value);
- }
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- } else {
- return ctx.stylize("[Object]", "special");
- }
- }
- ctx.seen.push(value);
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
- ctx.seen.pop();
- return reduceToSingleString(output, base, braces);
- }
- function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize("undefined", "undefined");
- if (isString(value)) {
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
- return ctx.stylize(simple, "string");
- }
- if (isNumber(value))
- return ctx.stylize("" + value, "number");
- if (isBoolean(value))
- return ctx.stylize("" + value, "boolean");
- if (isNull(value))
- return ctx.stylize("null", "null");
- }
- function formatError(value) {
- return "[" + Error.prototype.toString.call(value) + "]";
- }
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(
- ctx,
- value,
- recurseTimes,
- visibleKeys,
- String(i),
- true
- ));
- } else {
- output.push("");
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(
- ctx,
- value,
- recurseTimes,
- visibleKeys,
- key,
- true
- ));
- }
- });
- return output;
- }
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize("[Getter/Setter]", "special");
- } else {
- str = ctx.stylize("[Getter]", "special");
- }
- } else {
- if (desc.set) {
- str = ctx.stylize("[Setter]", "special");
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = "[" + key + "]";
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf("\n") > -1) {
- if (array) {
- str = str.split("\n").map(function(line) {
- return " " + line;
- }).join("\n").substr(2);
- } else {
- str = "\n" + str.split("\n").map(function(line) {
- return " " + line;
- }).join("\n");
- }
- }
- } else {
- str = ctx.stylize("[Circular]", "special");
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify("" + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, "name");
- } else {
- name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, "string");
- }
- }
- return name + ": " + str;
- }
- function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf("\n") >= 0)
- numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
- }, 0);
- if (length > 60) {
- return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
- }
- return braces[0] + base + " " + output.join(", ") + " " + braces[1];
- }
- function isArray(ar) {
- return Array.isArray(ar);
- }
- exports3.isArray = isArray;
- function isBoolean(arg) {
- return typeof arg === "boolean";
- }
- exports3.isBoolean = isBoolean;
- function isNull(arg) {
- return arg === null;
- }
- exports3.isNull = isNull;
- function isNullOrUndefined(arg) {
- return arg == null;
- }
- exports3.isNullOrUndefined = isNullOrUndefined;
- function isNumber(arg) {
- return typeof arg === "number";
- }
- exports3.isNumber = isNumber;
- function isString(arg) {
- return typeof arg === "string";
- }
- exports3.isString = isString;
- function isSymbol(arg) {
- return typeof arg === "symbol";
- }
- exports3.isSymbol = isSymbol;
- function isUndefined(arg) {
- return arg === void 0;
- }
- exports3.isUndefined = isUndefined;
- function isRegExp(re) {
- return isObject(re) && objectToString(re) === "[object RegExp]";
- }
- exports3.isRegExp = isRegExp;
- function isObject(arg) {
- return typeof arg === "object" && arg !== null;
- }
- exports3.isObject = isObject;
- function isDate(d) {
- return isObject(d) && objectToString(d) === "[object Date]";
- }
- exports3.isDate = isDate;
- function isError(e) {
- return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
- }
- exports3.isError = isError;
- function isFunction(arg) {
- return typeof arg === "function";
- }
- exports3.isFunction = isFunction;
- function isPrimitive(arg) {
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
- typeof arg === "undefined";
- }
- exports3.isPrimitive = isPrimitive;
- exports3.isBuffer = require2("./support/isBuffer");
- function objectToString(o) {
- return Object.prototype.toString.call(o);
- }
- function pad(n) {
- return n < 10 ? "0" + n.toString(10) : n.toString(10);
- }
- var months = [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec"
- ];
- function timestamp() {
- var d = /* @__PURE__ */ new Date();
- var time = [
- pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())
- ].join(":");
- return [d.getDate(), months[d.getMonth()], time].join(" ");
- }
- exports3.log = function() {
- console.log("%s - %s", timestamp(), exports3.format.apply(exports3, arguments));
- };
- exports3.inherits = require2("inherits");
- exports3._extend = function(origin, add) {
- if (!add || !isObject(add))
- return origin;
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
- };
- function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "./support/isBuffer": 84, "_process": 467, "inherits": 83 }], 86: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- var possibleNames = [
- "BigInt64Array",
- "BigUint64Array",
- "Float32Array",
- "Float64Array",
- "Int16Array",
- "Int32Array",
- "Int8Array",
- "Uint16Array",
- "Uint32Array",
- "Uint8Array",
- "Uint8ClampedArray"
- ];
- var g = typeof globalThis === "undefined" ? global2 : globalThis;
- module3.exports = function availableTypedArrays() {
- var out = [];
- for (var i = 0; i < possibleNames.length; i++) {
- if (typeof g[possibleNames[i]] === "function") {
- out[out.length] = possibleNames[i];
- }
- }
- return out;
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 87: [function(require2, module3, exports3) {
- "use strict";
- exports3.byteLength = byteLength;
- exports3.toByteArray = toByteArray;
- exports3.fromByteArray = fromByteArray;
- var lookup = [];
- var revLookup = [];
- var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
- var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i];
- revLookup[code.charCodeAt(i)] = i;
- }
- revLookup["-".charCodeAt(0)] = 62;
- revLookup["_".charCodeAt(0)] = 63;
- function getLens(b64) {
- var len2 = b64.length;
- if (len2 % 4 > 0) {
- throw new Error("Invalid string. Length must be a multiple of 4");
- }
- var validLen = b64.indexOf("=");
- if (validLen === -1)
- validLen = len2;
- var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
- return [validLen, placeHoldersLen];
- }
- function byteLength(b64) {
- var lens = getLens(b64);
- var validLen = lens[0];
- var placeHoldersLen = lens[1];
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
- }
- function _byteLength(b64, validLen, placeHoldersLen) {
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
- }
- function toByteArray(b64) {
- var tmp;
- var lens = getLens(b64);
- var validLen = lens[0];
- var placeHoldersLen = lens[1];
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
- var curByte = 0;
- var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
- var i2;
- for (i2 = 0; i2 < len2; i2 += 4) {
- tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
- arr[curByte++] = tmp >> 16 & 255;
- arr[curByte++] = tmp >> 8 & 255;
- arr[curByte++] = tmp & 255;
- }
- if (placeHoldersLen === 2) {
- tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
- arr[curByte++] = tmp & 255;
- }
- if (placeHoldersLen === 1) {
- tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
- arr[curByte++] = tmp >> 8 & 255;
- arr[curByte++] = tmp & 255;
- }
- return arr;
- }
- function tripletToBase64(num) {
- return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
- }
- function encodeChunk(uint8, start, end) {
- var tmp;
- var output = [];
- for (var i2 = start; i2 < end; i2 += 3) {
- tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
- output.push(tripletToBase64(tmp));
- }
- return output.join("");
- }
- function fromByteArray(uint8) {
- var tmp;
- var len2 = uint8.length;
- var extraBytes = len2 % 3;
- var parts = [];
- var maxChunkLength = 16383;
- for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
- parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
- }
- if (extraBytes === 1) {
- tmp = uint8[len2 - 1];
- parts.push(
- lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
- );
- } else if (extraBytes === 2) {
- tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
- parts.push(
- lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
- );
- }
- return parts.join("");
- }
- }, {}], 88: [function(require2, module3, exports3) {
- !function(root, name, definition) {
- if (typeof module3 != "undefined" && module3.exports)
- module3.exports = definition();
- else if (typeof define2 == "function" && define2.amd)
- define2(name, definition);
- else
- root[name] = definition();
- }(this, "bowser", function() {
- var t = true;
- function detect(ua) {
- function getFirstMatch(regex) {
- var match = ua.match(regex);
- return match && match.length > 1 && match[1] || "";
- }
- function getSecondMatch(regex) {
- var match = ua.match(regex);
- return match && match.length > 1 && match[2] || "";
- }
- var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase(), likeAndroid = /like android/i.test(ua), android = !likeAndroid && /android/i.test(ua), nexusMobile = /nexus\s*[0-6]\s*/i.test(ua), nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua), chromeos = /CrOS/.test(ua), silk = /silk/i.test(ua), sailfish = /sailfish/i.test(ua), tizen = /tizen/i.test(ua), webos = /(web|hpw)(o|0)s/i.test(ua), windowsphone = /windows phone/i.test(ua), samsungBrowser = /SamsungBrowser/i.test(ua), windows = !windowsphone && /windows/i.test(ua), mac = !iosdevice && !silk && /macintosh/i.test(ua), linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua), edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i), versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i), tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua), mobile = !tablet && /[^-]mobi/i.test(ua), xbox = /xbox/i.test(ua), result;
- if (/opera/i.test(ua)) {
- result = {
- name: "Opera",
- opera: t,
- version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
- };
- } else if (/opr\/|opios/i.test(ua)) {
- result = {
- name: "Opera",
- opera: t,
- version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier
- };
- } else if (/SamsungBrowser/i.test(ua)) {
- result = {
- name: "Samsung Internet for Android",
- samsungBrowser: t,
- version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)
- };
- } else if (/Whale/i.test(ua)) {
- result = {
- name: "NAVER Whale browser",
- whale: t,
- version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/MZBrowser/i.test(ua)) {
- result = {
- name: "MZ Browser",
- mzbrowser: t,
- version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/coast/i.test(ua)) {
- result = {
- name: "Opera Coast",
- coast: t,
- version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
- };
- } else if (/focus/i.test(ua)) {
- result = {
- name: "Focus",
- focus: t,
- version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/yabrowser/i.test(ua)) {
- result = {
- name: "Yandex Browser",
- yandexbrowser: t,
- version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)
- };
- } else if (/ucbrowser/i.test(ua)) {
- result = {
- name: "UC Browser",
- ucbrowser: t,
- version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/mxios/i.test(ua)) {
- result = {
- name: "Maxthon",
- maxthon: t,
- version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/epiphany/i.test(ua)) {
- result = {
- name: "Epiphany",
- epiphany: t,
- version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/puffin/i.test(ua)) {
- result = {
- name: "Puffin",
- puffin: t,
- version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)
- };
- } else if (/sleipnir/i.test(ua)) {
- result = {
- name: "Sleipnir",
- sleipnir: t,
- version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (/k-meleon/i.test(ua)) {
- result = {
- name: "K-Meleon",
- kMeleon: t,
- version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)
- };
- } else if (windowsphone) {
- result = {
- name: "Windows Phone",
- osname: "Windows Phone",
- windowsphone: t
- };
- if (edgeVersion) {
- result.msedge = t;
- result.version = edgeVersion;
- } else {
- result.msie = t;
- result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i);
- }
- } else if (/msie|trident/i.test(ua)) {
- result = {
- name: "Internet Explorer",
- msie: t,
- version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
- };
- } else if (chromeos) {
- result = {
- name: "Chrome",
- osname: "Chrome OS",
- chromeos: t,
- chromeBook: t,
- chrome: t,
- version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
- };
- } else if (/edg([ea]|ios)/i.test(ua)) {
- result = {
- name: "Microsoft Edge",
- msedge: t,
- version: edgeVersion
- };
- } else if (/vivaldi/i.test(ua)) {
- result = {
- name: "Vivaldi",
- vivaldi: t,
- version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
- };
- } else if (sailfish) {
- result = {
- name: "Sailfish",
- osname: "Sailfish OS",
- sailfish: t,
- version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i)
- };
- } else if (/seamonkey\//i.test(ua)) {
- result = {
- name: "SeaMonkey",
- seamonkey: t,
- version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i)
- };
- } else if (/firefox|iceweasel|fxios/i.test(ua)) {
- result = {
- name: "Firefox",
- firefox: t,
- version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)
- };
- if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) {
- result.firefoxos = t;
- result.osname = "Firefox OS";
- }
- } else if (silk) {
- result = {
- name: "Amazon Silk",
- silk: t,
- version: getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
- };
- } else if (/phantom/i.test(ua)) {
- result = {
- name: "PhantomJS",
- phantom: t,
- version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i)
- };
- } else if (/slimerjs/i.test(ua)) {
- result = {
- name: "SlimerJS",
- slimer: t,
- version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i)
- };
- } else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) {
- result = {
- name: "BlackBerry",
- osname: "BlackBerry OS",
- blackberry: t,
- version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
- };
- } else if (webos) {
- result = {
- name: "WebOS",
- osname: "WebOS",
- webos: t,
- version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
- };
- /touchpad\//i.test(ua) && (result.touchpad = t);
- } else if (/bada/i.test(ua)) {
- result = {
- name: "Bada",
- osname: "Bada",
- bada: t,
- version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i)
- };
- } else if (tizen) {
- result = {
- name: "Tizen",
- osname: "Tizen",
- tizen: t,
- version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier
- };
- } else if (/qupzilla/i.test(ua)) {
- result = {
- name: "QupZilla",
- qupzilla: t,
- version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
- };
- } else if (/chromium/i.test(ua)) {
- result = {
- name: "Chromium",
- chromium: t,
- version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier
- };
- } else if (/chrome|crios|crmo/i.test(ua)) {
- result = {
- name: "Chrome",
- chrome: t,
- version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
- };
- } else if (android) {
- result = {
- name: "Android",
- version: versionIdentifier
- };
- } else if (/safari|applewebkit/i.test(ua)) {
- result = {
- name: "Safari",
- safari: t
- };
- if (versionIdentifier) {
- result.version = versionIdentifier;
- }
- } else if (iosdevice) {
- result = {
- name: iosdevice == "iphone" ? "iPhone" : iosdevice == "ipad" ? "iPad" : "iPod"
- };
- if (versionIdentifier) {
- result.version = versionIdentifier;
- }
- } else if (/googlebot/i.test(ua)) {
- result = {
- name: "Googlebot",
- googlebot: t,
- version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier
- };
- } else {
- result = {
- name: getFirstMatch(/^(.*)\/(.*) /),
- version: getSecondMatch(/^(.*)\/(.*) /)
- };
- }
- if (!result.msedge && /(apple)?webkit/i.test(ua)) {
- if (/(apple)?webkit\/537\.36/i.test(ua)) {
- result.name = result.name || "Blink";
- result.blink = t;
- } else {
- result.name = result.name || "Webkit";
- result.webkit = t;
- }
- if (!result.version && versionIdentifier) {
- result.version = versionIdentifier;
- }
- } else if (!result.opera && /gecko\//i.test(ua)) {
- result.name = result.name || "Gecko";
- result.gecko = t;
- result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i);
- }
- if (!result.windowsphone && (android || result.silk)) {
- result.android = t;
- result.osname = "Android";
- } else if (!result.windowsphone && iosdevice) {
- result[iosdevice] = t;
- result.ios = t;
- result.osname = "iOS";
- } else if (mac) {
- result.mac = t;
- result.osname = "macOS";
- } else if (xbox) {
- result.xbox = t;
- result.osname = "Xbox";
- } else if (windows) {
- result.windows = t;
- result.osname = "Windows";
- } else if (linux) {
- result.linux = t;
- result.osname = "Linux";
- }
- function getWindowsVersion(s) {
- switch (s) {
- case "NT":
- return "NT";
- case "XP":
- return "XP";
- case "NT 5.0":
- return "2000";
- case "NT 5.1":
- return "XP";
- case "NT 5.2":
- return "2003";
- case "NT 6.0":
- return "Vista";
- case "NT 6.1":
- return "7";
- case "NT 6.2":
- return "8";
- case "NT 6.3":
- return "8.1";
- case "NT 10.0":
- return "10";
- default:
- return void 0;
- }
- }
- var osVersion = "";
- if (result.windows) {
- osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i));
- } else if (result.windowsphone) {
- osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i);
- } else if (result.mac) {
- osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i);
- osVersion = osVersion.replace(/[_\s]/g, ".");
- } else if (iosdevice) {
- osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i);
- osVersion = osVersion.replace(/[_\s]/g, ".");
- } else if (android) {
- osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i);
- } else if (result.webos) {
- osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i);
- } else if (result.blackberry) {
- osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i);
- } else if (result.bada) {
- osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i);
- } else if (result.tizen) {
- osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i);
- }
- if (osVersion) {
- result.osversion = osVersion;
- }
- var osMajorVersion = !result.windows && osVersion.split(".")[0];
- if (tablet || nexusTablet || iosdevice == "ipad" || android && (osMajorVersion == 3 || osMajorVersion >= 4 && !mobile) || result.silk) {
- result.tablet = t;
- } else if (mobile || iosdevice == "iphone" || iosdevice == "ipod" || android || nexusMobile || result.blackberry || result.webos || result.bada) {
- result.mobile = t;
- }
- if (result.msedge || result.msie && result.version >= 10 || result.yandexbrowser && result.version >= 15 || result.vivaldi && result.version >= 1 || result.chrome && result.version >= 20 || result.samsungBrowser && result.version >= 4 || result.whale && compareVersions([result.version, "1.0"]) === 1 || result.mzbrowser && compareVersions([result.version, "6.0"]) === 1 || result.focus && compareVersions([result.version, "1.0"]) === 1 || result.firefox && result.version >= 20 || result.safari && result.version >= 6 || result.opera && result.version >= 10 || result.ios && result.osversion && result.osversion.split(".")[0] >= 6 || result.blackberry && result.version >= 10.1 || result.chromium && result.version >= 20) {
- result.a = t;
- } else if (result.msie && result.version < 10 || result.chrome && result.version < 20 || result.firefox && result.version < 20 || result.safari && result.version < 6 || result.opera && result.version < 10 || result.ios && result.osversion && result.osversion.split(".")[0] < 6 || result.chromium && result.version < 20) {
- result.c = t;
- } else
- result.x = t;
- return result;
- }
- var bowser = detect(typeof navigator !== "undefined" ? navigator.userAgent || "" : "");
- bowser.test = function(browserList) {
- for (var i = 0; i < browserList.length; ++i) {
- var browserItem = browserList[i];
- if (typeof browserItem === "string") {
- if (browserItem in bowser) {
- return true;
- }
- }
- }
- return false;
- };
- function getVersionPrecision(version) {
- return version.split(".").length;
- }
- function map(arr, iterator) {
- var result = [], i;
- if (Array.prototype.map) {
- return Array.prototype.map.call(arr, iterator);
- }
- for (i = 0; i < arr.length; i++) {
- result.push(iterator(arr[i]));
- }
- return result;
- }
- function compareVersions(versions) {
- var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));
- var chunks = map(versions, function(version) {
- var delta = precision - getVersionPrecision(version);
- version = version + new Array(delta + 1).join(".0");
- return map(version.split("."), function(chunk) {
- return new Array(20 - chunk.length).join("0") + chunk;
- }).reverse();
- });
- while (--precision >= 0) {
- if (chunks[0][precision] > chunks[1][precision]) {
- return 1;
- } else if (chunks[0][precision] === chunks[1][precision]) {
- if (precision === 0) {
- return 0;
- }
- } else {
- return -1;
- }
- }
- }
- function isUnsupportedBrowser(minVersions, strictMode, ua) {
- var _bowser = bowser;
- if (typeof strictMode === "string") {
- ua = strictMode;
- strictMode = void 0;
- }
- if (strictMode === void 0) {
- strictMode = false;
- }
- if (ua) {
- _bowser = detect(ua);
- }
- var version = "" + _bowser.version;
- for (var browser in minVersions) {
- if (minVersions.hasOwnProperty(browser)) {
- if (_bowser[browser]) {
- if (typeof minVersions[browser] !== "string") {
- throw new Error("Browser version in the minVersion map should be a string: " + browser + ": " + String(minVersions));
- }
- return compareVersions([version, minVersions[browser]]) < 0;
- }
- }
- }
- return strictMode;
- }
- function check(minVersions, strictMode, ua) {
- return !isUnsupportedBrowser(minVersions, strictMode, ua);
- }
- bowser.isUnsupportedBrowser = isUnsupportedBrowser;
- bowser.compareVersions = compareVersions;
- bowser.check = check;
- bowser._detect = detect;
- bowser.detect = detect;
- return bowser;
- });
- }, {}], 89: [function(require2, module3, exports3) {
- }, {}], 90: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- var base64 = require2("base64-js");
- var ieee754 = require2("ieee754");
- exports3.Buffer = Buffer2;
- exports3.SlowBuffer = SlowBuffer;
- exports3.INSPECT_MAX_BYTES = 50;
- var K_MAX_LENGTH = 2147483647;
- exports3.kMaxLength = K_MAX_LENGTH;
- Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
- if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
- console.error(
- "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
- );
- }
- function typedArraySupport() {
- try {
- var arr = new Uint8Array(1);
- arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
- return 42;
- } };
- return arr.foo() === 42;
- } catch (e) {
- return false;
- }
- }
- Object.defineProperty(Buffer2.prototype, "parent", {
- enumerable: true,
- get: function() {
- if (!Buffer2.isBuffer(this))
- return void 0;
- return this.buffer;
- }
- });
- Object.defineProperty(Buffer2.prototype, "offset", {
- enumerable: true,
- get: function() {
- if (!Buffer2.isBuffer(this))
- return void 0;
- return this.byteOffset;
- }
- });
- function createBuffer(length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"');
- }
- var buf = new Uint8Array(length);
- buf.__proto__ = Buffer2.prototype;
- return buf;
- }
- function Buffer2(arg, encodingOrOffset, length) {
- if (typeof arg === "number") {
- if (typeof encodingOrOffset === "string") {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- );
- }
- return allocUnsafe(arg);
- }
- return from(arg, encodingOrOffset, length);
- }
- if (typeof Symbol !== "undefined" && Symbol.species != null && Buffer2[Symbol.species] === Buffer2) {
- Object.defineProperty(Buffer2, Symbol.species, {
- value: null,
- configurable: true,
- enumerable: false,
- writable: false
- });
- }
- Buffer2.poolSize = 8192;
- function from(value, encodingOrOffset, length) {
- if (typeof value === "string") {
- return fromString(value, encodingOrOffset);
- }
- if (ArrayBuffer.isView(value)) {
- return fromArrayLike(value);
- }
- if (value == null) {
- throw TypeError(
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
- );
- }
- if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
- return fromArrayBuffer(value, encodingOrOffset, length);
- }
- if (typeof value === "number") {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- );
- }
- var valueOf = value.valueOf && value.valueOf();
- if (valueOf != null && valueOf !== value) {
- return Buffer2.from(valueOf, encodingOrOffset, length);
- }
- var b = fromObject(value);
- if (b)
- return b;
- if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
- return Buffer2.from(
- value[Symbol.toPrimitive]("string"),
- encodingOrOffset,
- length
- );
- }
- throw new TypeError(
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
- );
- }
- Buffer2.from = function(value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length);
- };
- Buffer2.prototype.__proto__ = Uint8Array.prototype;
- Buffer2.__proto__ = Uint8Array;
- function assertSize(size) {
- if (typeof size !== "number") {
- throw new TypeError('"size" argument must be of type number');
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"');
- }
- }
- function alloc(size, fill, encoding) {
- assertSize(size);
- if (size <= 0) {
- return createBuffer(size);
- }
- if (fill !== void 0) {
- return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
- }
- return createBuffer(size);
- }
- Buffer2.alloc = function(size, fill, encoding) {
- return alloc(size, fill, encoding);
- };
- function allocUnsafe(size) {
- assertSize(size);
- return createBuffer(size < 0 ? 0 : checked(size) | 0);
- }
- Buffer2.allocUnsafe = function(size) {
- return allocUnsafe(size);
- };
- Buffer2.allocUnsafeSlow = function(size) {
- return allocUnsafe(size);
- };
- function fromString(string, encoding) {
- if (typeof encoding !== "string" || encoding === "") {
- encoding = "utf8";
- }
- if (!Buffer2.isEncoding(encoding)) {
- throw new TypeError("Unknown encoding: " + encoding);
- }
- var length = byteLength(string, encoding) | 0;
- var buf = createBuffer(length);
- var actual = buf.write(string, encoding);
- if (actual !== length) {
- buf = buf.slice(0, actual);
- }
- return buf;
- }
- function fromArrayLike(array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0;
- var buf = createBuffer(length);
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255;
- }
- return buf;
- }
- function fromArrayBuffer(array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds');
- }
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds');
- }
- var buf;
- if (byteOffset === void 0 && length === void 0) {
- buf = new Uint8Array(array);
- } else if (length === void 0) {
- buf = new Uint8Array(array, byteOffset);
- } else {
- buf = new Uint8Array(array, byteOffset, length);
- }
- buf.__proto__ = Buffer2.prototype;
- return buf;
- }
- function fromObject(obj) {
- if (Buffer2.isBuffer(obj)) {
- var len = checked(obj.length) | 0;
- var buf = createBuffer(len);
- if (buf.length === 0) {
- return buf;
- }
- obj.copy(buf, 0, 0, len);
- return buf;
- }
- if (obj.length !== void 0) {
- if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
- return createBuffer(0);
- }
- return fromArrayLike(obj);
- }
- if (obj.type === "Buffer" && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data);
- }
- }
- function checked(length) {
- if (length >= K_MAX_LENGTH) {
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
- }
- return length | 0;
- }
- function SlowBuffer(length) {
- if (+length != length) {
- length = 0;
- }
- return Buffer2.alloc(+length);
- }
- Buffer2.isBuffer = function isBuffer(b) {
- return b != null && b._isBuffer === true && b !== Buffer2.prototype;
- };
- Buffer2.compare = function compare(a, b) {
- if (isInstance(a, Uint8Array))
- a = Buffer2.from(a, a.offset, a.byteLength);
- if (isInstance(b, Uint8Array))
- b = Buffer2.from(b, b.offset, b.byteLength);
- if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- );
- }
- if (a === b)
- return 0;
- var x = a.length;
- var y = b.length;
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i];
- y = b[i];
- break;
- }
- }
- if (x < y)
- return -1;
- if (y < x)
- return 1;
- return 0;
- };
- Buffer2.isEncoding = function isEncoding(encoding) {
- switch (String(encoding).toLowerCase()) {
- case "hex":
- case "utf8":
- case "utf-8":
- case "ascii":
- case "latin1":
- case "binary":
- case "base64":
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return true;
- default:
- return false;
- }
- };
- Buffer2.concat = function concat(list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers');
- }
- if (list.length === 0) {
- return Buffer2.alloc(0);
- }
- var i;
- if (length === void 0) {
- length = 0;
- for (i = 0; i < list.length; ++i) {
- length += list[i].length;
- }
- }
- var buffer = Buffer2.allocUnsafe(length);
- var pos = 0;
- for (i = 0; i < list.length; ++i) {
- var buf = list[i];
- if (isInstance(buf, Uint8Array)) {
- buf = Buffer2.from(buf);
- }
- if (!Buffer2.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers');
- }
- buf.copy(buffer, pos);
- pos += buf.length;
- }
- return buffer;
- };
- function byteLength(string, encoding) {
- if (Buffer2.isBuffer(string)) {
- return string.length;
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength;
- }
- if (typeof string !== "string") {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string
- );
- }
- var len = string.length;
- var mustMatch = arguments.length > 2 && arguments[2] === true;
- if (!mustMatch && len === 0)
- return 0;
- var loweredCase = false;
- for (; ; ) {
- switch (encoding) {
- case "ascii":
- case "latin1":
- case "binary":
- return len;
- case "utf8":
- case "utf-8":
- return utf8ToBytes(string).length;
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return len * 2;
- case "hex":
- return len >>> 1;
- case "base64":
- return base64ToBytes(string).length;
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length;
- }
- encoding = ("" + encoding).toLowerCase();
- loweredCase = true;
- }
- }
- }
- Buffer2.byteLength = byteLength;
- function slowToString(encoding, start, end) {
- var loweredCase = false;
- if (start === void 0 || start < 0) {
- start = 0;
- }
- if (start > this.length) {
- return "";
- }
- if (end === void 0 || end > this.length) {
- end = this.length;
- }
- if (end <= 0) {
- return "";
- }
- end >>>= 0;
- start >>>= 0;
- if (end <= start) {
- return "";
- }
- if (!encoding)
- encoding = "utf8";
- while (true) {
- switch (encoding) {
- case "hex":
- return hexSlice(this, start, end);
- case "utf8":
- case "utf-8":
- return utf8Slice(this, start, end);
- case "ascii":
- return asciiSlice(this, start, end);
- case "latin1":
- case "binary":
- return latin1Slice(this, start, end);
- case "base64":
- return base64Slice(this, start, end);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return utf16leSlice(this, start, end);
- default:
- if (loweredCase)
- throw new TypeError("Unknown encoding: " + encoding);
- encoding = (encoding + "").toLowerCase();
- loweredCase = true;
- }
- }
- }
- Buffer2.prototype._isBuffer = true;
- function swap(b, n, m) {
- var i = b[n];
- b[n] = b[m];
- b[m] = i;
- }
- Buffer2.prototype.swap16 = function swap16() {
- var len = this.length;
- if (len % 2 !== 0) {
- throw new RangeError("Buffer size must be a multiple of 16-bits");
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1);
- }
- return this;
- };
- Buffer2.prototype.swap32 = function swap32() {
- var len = this.length;
- if (len % 4 !== 0) {
- throw new RangeError("Buffer size must be a multiple of 32-bits");
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3);
- swap(this, i + 1, i + 2);
- }
- return this;
- };
- Buffer2.prototype.swap64 = function swap64() {
- var len = this.length;
- if (len % 8 !== 0) {
- throw new RangeError("Buffer size must be a multiple of 64-bits");
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7);
- swap(this, i + 1, i + 6);
- swap(this, i + 2, i + 5);
- swap(this, i + 3, i + 4);
- }
- return this;
- };
- Buffer2.prototype.toString = function toString() {
- var length = this.length;
- if (length === 0)
- return "";
- if (arguments.length === 0)
- return utf8Slice(this, 0, length);
- return slowToString.apply(this, arguments);
- };
- Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
- Buffer2.prototype.equals = function equals(b) {
- if (!Buffer2.isBuffer(b))
- throw new TypeError("Argument must be a Buffer");
- if (this === b)
- return true;
- return Buffer2.compare(this, b) === 0;
- };
- Buffer2.prototype.inspect = function inspect() {
- var str = "";
- var max = exports3.INSPECT_MAX_BYTES;
- str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
- if (this.length > max)
- str += " ... ";
- return "<Buffer " + str + ">";
- };
- Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer2.from(target, target.offset, target.byteLength);
- }
- if (!Buffer2.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target
- );
- }
- if (start === void 0) {
- start = 0;
- }
- if (end === void 0) {
- end = target ? target.length : 0;
- }
- if (thisStart === void 0) {
- thisStart = 0;
- }
- if (thisEnd === void 0) {
- thisEnd = this.length;
- }
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError("out of range index");
- }
- if (thisStart >= thisEnd && start >= end) {
- return 0;
- }
- if (thisStart >= thisEnd) {
- return -1;
- }
- if (start >= end) {
- return 1;
- }
- start >>>= 0;
- end >>>= 0;
- thisStart >>>= 0;
- thisEnd >>>= 0;
- if (this === target)
- return 0;
- var x = thisEnd - thisStart;
- var y = end - start;
- var len = Math.min(x, y);
- var thisCopy = this.slice(thisStart, thisEnd);
- var targetCopy = target.slice(start, end);
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i];
- y = targetCopy[i];
- break;
- }
- }
- if (x < y)
- return -1;
- if (y < x)
- return 1;
- return 0;
- };
- function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
- if (buffer.length === 0)
- return -1;
- if (typeof byteOffset === "string") {
- encoding = byteOffset;
- byteOffset = 0;
- } else if (byteOffset > 2147483647) {
- byteOffset = 2147483647;
- } else if (byteOffset < -2147483648) {
- byteOffset = -2147483648;
- }
- byteOffset = +byteOffset;
- if (numberIsNaN(byteOffset)) {
- byteOffset = dir ? 0 : buffer.length - 1;
- }
- if (byteOffset < 0)
- byteOffset = buffer.length + byteOffset;
- if (byteOffset >= buffer.length) {
- if (dir)
- return -1;
- else
- byteOffset = buffer.length - 1;
- } else if (byteOffset < 0) {
- if (dir)
- byteOffset = 0;
- else
- return -1;
- }
- if (typeof val === "string") {
- val = Buffer2.from(val, encoding);
- }
- if (Buffer2.isBuffer(val)) {
- if (val.length === 0) {
- return -1;
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
- } else if (typeof val === "number") {
- val = val & 255;
- if (typeof Uint8Array.prototype.indexOf === "function") {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
- }
- throw new TypeError("val must be string, number or Buffer");
- }
- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
- var indexSize = 1;
- var arrLength = arr.length;
- var valLength = val.length;
- if (encoding !== void 0) {
- encoding = String(encoding).toLowerCase();
- if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
- if (arr.length < 2 || val.length < 2) {
- return -1;
- }
- indexSize = 2;
- arrLength /= 2;
- valLength /= 2;
- byteOffset /= 2;
- }
- }
- function read(buf, i2) {
- if (indexSize === 1) {
- return buf[i2];
- } else {
- return buf.readUInt16BE(i2 * indexSize);
- }
- }
- var i;
- if (dir) {
- var foundIndex = -1;
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1)
- foundIndex = i;
- if (i - foundIndex + 1 === valLength)
- return foundIndex * indexSize;
- } else {
- if (foundIndex !== -1)
- i -= i - foundIndex;
- foundIndex = -1;
- }
- }
- } else {
- if (byteOffset + valLength > arrLength)
- byteOffset = arrLength - valLength;
- for (i = byteOffset; i >= 0; i--) {
- var found = true;
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false;
- break;
- }
- }
- if (found)
- return i;
- }
- }
- return -1;
- }
- Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1;
- };
- Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
- };
- Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
- };
- function hexWrite(buf, string, offset, length) {
- offset = Number(offset) || 0;
- var remaining = buf.length - offset;
- if (!length) {
- length = remaining;
- } else {
- length = Number(length);
- if (length > remaining) {
- length = remaining;
- }
- }
- var strLen = string.length;
- if (length > strLen / 2) {
- length = strLen / 2;
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16);
- if (numberIsNaN(parsed))
- return i;
- buf[offset + i] = parsed;
- }
- return i;
- }
- function utf8Write(buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
- }
- function asciiWrite(buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length);
- }
- function latin1Write(buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length);
- }
- function base64Write(buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length);
- }
- function ucs2Write(buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
- }
- Buffer2.prototype.write = function write(string, offset, length, encoding) {
- if (offset === void 0) {
- encoding = "utf8";
- length = this.length;
- offset = 0;
- } else if (length === void 0 && typeof offset === "string") {
- encoding = offset;
- length = this.length;
- offset = 0;
- } else if (isFinite(offset)) {
- offset = offset >>> 0;
- if (isFinite(length)) {
- length = length >>> 0;
- if (encoding === void 0)
- encoding = "utf8";
- } else {
- encoding = length;
- length = void 0;
- }
- } else {
- throw new Error(
- "Buffer.write(string, encoding, offset[, length]) is no longer supported"
- );
- }
- var remaining = this.length - offset;
- if (length === void 0 || length > remaining)
- length = remaining;
- if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
- throw new RangeError("Attempt to write outside buffer bounds");
- }
- if (!encoding)
- encoding = "utf8";
- var loweredCase = false;
- for (; ; ) {
- switch (encoding) {
- case "hex":
- return hexWrite(this, string, offset, length);
- case "utf8":
- case "utf-8":
- return utf8Write(this, string, offset, length);
- case "ascii":
- return asciiWrite(this, string, offset, length);
- case "latin1":
- case "binary":
- return latin1Write(this, string, offset, length);
- case "base64":
- return base64Write(this, string, offset, length);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return ucs2Write(this, string, offset, length);
- default:
- if (loweredCase)
- throw new TypeError("Unknown encoding: " + encoding);
- encoding = ("" + encoding).toLowerCase();
- loweredCase = true;
- }
- }
- };
- Buffer2.prototype.toJSON = function toJSON() {
- return {
- type: "Buffer",
- data: Array.prototype.slice.call(this._arr || this, 0)
- };
- };
- function base64Slice(buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf);
- } else {
- return base64.fromByteArray(buf.slice(start, end));
- }
- }
- function utf8Slice(buf, start, end) {
- end = Math.min(buf.length, end);
- var res = [];
- var i = start;
- while (i < end) {
- var firstByte = buf[i];
- var codePoint = null;
- var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint;
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 128) {
- codePoint = firstByte;
- }
- break;
- case 2:
- secondByte = buf[i + 1];
- if ((secondByte & 192) === 128) {
- tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
- if (tempCodePoint > 127) {
- codePoint = tempCodePoint;
- }
- }
- break;
- case 3:
- secondByte = buf[i + 1];
- thirdByte = buf[i + 2];
- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
- tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
- if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
- codePoint = tempCodePoint;
- }
- }
- break;
- case 4:
- secondByte = buf[i + 1];
- thirdByte = buf[i + 2];
- fourthByte = buf[i + 3];
- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
- tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
- if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
- codePoint = tempCodePoint;
- }
- }
- }
- }
- if (codePoint === null) {
- codePoint = 65533;
- bytesPerSequence = 1;
- } else if (codePoint > 65535) {
- codePoint -= 65536;
- res.push(codePoint >>> 10 & 1023 | 55296);
- codePoint = 56320 | codePoint & 1023;
- }
- res.push(codePoint);
- i += bytesPerSequence;
- }
- return decodeCodePointsArray(res);
- }
- var MAX_ARGUMENTS_LENGTH = 4096;
- function decodeCodePointsArray(codePoints) {
- var len = codePoints.length;
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints);
- }
- var res = "";
- var i = 0;
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- );
- }
- return res;
- }
- function asciiSlice(buf, start, end) {
- var ret = "";
- end = Math.min(buf.length, end);
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 127);
- }
- return ret;
- }
- function latin1Slice(buf, start, end) {
- var ret = "";
- end = Math.min(buf.length, end);
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i]);
- }
- return ret;
- }
- function hexSlice(buf, start, end) {
- var len = buf.length;
- if (!start || start < 0)
- start = 0;
- if (!end || end < 0 || end > len)
- end = len;
- var out = "";
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i]);
- }
- return out;
- }
- function utf16leSlice(buf, start, end) {
- var bytes = buf.slice(start, end);
- var res = "";
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
- }
- return res;
- }
- Buffer2.prototype.slice = function slice(start, end) {
- var len = this.length;
- start = ~~start;
- end = end === void 0 ? len : ~~end;
- if (start < 0) {
- start += len;
- if (start < 0)
- start = 0;
- } else if (start > len) {
- start = len;
- }
- if (end < 0) {
- end += len;
- if (end < 0)
- end = 0;
- } else if (end > len) {
- end = len;
- }
- if (end < start)
- end = start;
- var newBuf = this.subarray(start, end);
- newBuf.__proto__ = Buffer2.prototype;
- return newBuf;
- };
- function checkOffset(offset, ext, length) {
- if (offset % 1 !== 0 || offset < 0)
- throw new RangeError("offset is not uint");
- if (offset + ext > length)
- throw new RangeError("Trying to access beyond buffer length");
- }
- Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert)
- checkOffset(offset, byteLength2, this.length);
- var val = this[offset];
- var mul = 1;
- var i = 0;
- while (++i < byteLength2 && (mul *= 256)) {
- val += this[offset + i] * mul;
- }
- return val;
- };
- Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert) {
- checkOffset(offset, byteLength2, this.length);
- }
- var val = this[offset + --byteLength2];
- var mul = 1;
- while (byteLength2 > 0 && (mul *= 256)) {
- val += this[offset + --byteLength2] * mul;
- }
- return val;
- };
- Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 1, this.length);
- return this[offset];
- };
- Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 2, this.length);
- return this[offset] | this[offset + 1] << 8;
- };
- Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 2, this.length);
- return this[offset] << 8 | this[offset + 1];
- };
- Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
- };
- Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
- };
- Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert)
- checkOffset(offset, byteLength2, this.length);
- var val = this[offset];
- var mul = 1;
- var i = 0;
- while (++i < byteLength2 && (mul *= 256)) {
- val += this[offset + i] * mul;
- }
- mul *= 128;
- if (val >= mul)
- val -= Math.pow(2, 8 * byteLength2);
- return val;
- };
- Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert)
- checkOffset(offset, byteLength2, this.length);
- var i = byteLength2;
- var mul = 1;
- var val = this[offset + --i];
- while (i > 0 && (mul *= 256)) {
- val += this[offset + --i] * mul;
- }
- mul *= 128;
- if (val >= mul)
- val -= Math.pow(2, 8 * byteLength2);
- return val;
- };
- Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 1, this.length);
- if (!(this[offset] & 128))
- return this[offset];
- return (255 - this[offset] + 1) * -1;
- };
- Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 2, this.length);
- var val = this[offset] | this[offset + 1] << 8;
- return val & 32768 ? val | 4294901760 : val;
- };
- Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 2, this.length);
- var val = this[offset + 1] | this[offset] << 8;
- return val & 32768 ? val | 4294901760 : val;
- };
- Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
- };
- Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
- };
- Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return ieee754.read(this, offset, true, 23, 4);
- };
- Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 4, this.length);
- return ieee754.read(this, offset, false, 23, 4);
- };
- Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 8, this.length);
- return ieee754.read(this, offset, true, 52, 8);
- };
- Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
- offset = offset >>> 0;
- if (!noAssert)
- checkOffset(offset, 8, this.length);
- return ieee754.read(this, offset, false, 52, 8);
- };
- function checkInt(buf, value, offset, ext, max, min) {
- if (!Buffer2.isBuffer(buf))
- throw new TypeError('"buffer" argument must be a Buffer instance');
- if (value > max || value < min)
- throw new RangeError('"value" argument is out of bounds');
- if (offset + ext > buf.length)
- throw new RangeError("Index out of range");
- }
- Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
- value = +value;
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
- checkInt(this, value, offset, byteLength2, maxBytes, 0);
- }
- var mul = 1;
- var i = 0;
- this[offset] = value & 255;
- while (++i < byteLength2 && (mul *= 256)) {
- this[offset + i] = value / mul & 255;
- }
- return offset + byteLength2;
- };
- Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
- value = +value;
- offset = offset >>> 0;
- byteLength2 = byteLength2 >>> 0;
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
- checkInt(this, value, offset, byteLength2, maxBytes, 0);
- }
- var i = byteLength2 - 1;
- var mul = 1;
- this[offset + i] = value & 255;
- while (--i >= 0 && (mul *= 256)) {
- this[offset + i] = value / mul & 255;
- }
- return offset + byteLength2;
- };
- Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 1, 255, 0);
- this[offset] = value & 255;
- return offset + 1;
- };
- Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 2, 65535, 0);
- this[offset] = value & 255;
- this[offset + 1] = value >>> 8;
- return offset + 2;
- };
- Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 2, 65535, 0);
- this[offset] = value >>> 8;
- this[offset + 1] = value & 255;
- return offset + 2;
- };
- Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 4, 4294967295, 0);
- this[offset + 3] = value >>> 24;
- this[offset + 2] = value >>> 16;
- this[offset + 1] = value >>> 8;
- this[offset] = value & 255;
- return offset + 4;
- };
- Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 4, 4294967295, 0);
- this[offset] = value >>> 24;
- this[offset + 1] = value >>> 16;
- this[offset + 2] = value >>> 8;
- this[offset + 3] = value & 255;
- return offset + 4;
- };
- Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength2 - 1);
- checkInt(this, value, offset, byteLength2, limit - 1, -limit);
- }
- var i = 0;
- var mul = 1;
- var sub = 0;
- this[offset] = value & 255;
- while (++i < byteLength2 && (mul *= 256)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1;
- }
- this[offset + i] = (value / mul >> 0) - sub & 255;
- }
- return offset + byteLength2;
- };
- Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength2 - 1);
- checkInt(this, value, offset, byteLength2, limit - 1, -limit);
- }
- var i = byteLength2 - 1;
- var mul = 1;
- var sub = 0;
- this[offset + i] = value & 255;
- while (--i >= 0 && (mul *= 256)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1;
- }
- this[offset + i] = (value / mul >> 0) - sub & 255;
- }
- return offset + byteLength2;
- };
- Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 1, 127, -128);
- if (value < 0)
- value = 255 + value + 1;
- this[offset] = value & 255;
- return offset + 1;
- };
- Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 2, 32767, -32768);
- this[offset] = value & 255;
- this[offset + 1] = value >>> 8;
- return offset + 2;
- };
- Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 2, 32767, -32768);
- this[offset] = value >>> 8;
- this[offset + 1] = value & 255;
- return offset + 2;
- };
- Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 4, 2147483647, -2147483648);
- this[offset] = value & 255;
- this[offset + 1] = value >>> 8;
- this[offset + 2] = value >>> 16;
- this[offset + 3] = value >>> 24;
- return offset + 4;
- };
- Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert)
- checkInt(this, value, offset, 4, 2147483647, -2147483648);
- if (value < 0)
- value = 4294967295 + value + 1;
- this[offset] = value >>> 24;
- this[offset + 1] = value >>> 16;
- this[offset + 2] = value >>> 8;
- this[offset + 3] = value & 255;
- return offset + 4;
- };
- function checkIEEE754(buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length)
- throw new RangeError("Index out of range");
- if (offset < 0)
- throw new RangeError("Index out of range");
- }
- function writeFloat(buf, value, offset, littleEndian, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4);
- return offset + 4;
- }
- Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert);
- };
- Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert);
- };
- function writeDouble(buf, value, offset, littleEndian, noAssert) {
- value = +value;
- offset = offset >>> 0;
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8);
- return offset + 8;
- }
- Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert);
- };
- Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert);
- };
- Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
- if (!Buffer2.isBuffer(target))
- throw new TypeError("argument should be a Buffer");
- if (!start)
- start = 0;
- if (!end && end !== 0)
- end = this.length;
- if (targetStart >= target.length)
- targetStart = target.length;
- if (!targetStart)
- targetStart = 0;
- if (end > 0 && end < start)
- end = start;
- if (end === start)
- return 0;
- if (target.length === 0 || this.length === 0)
- return 0;
- if (targetStart < 0) {
- throw new RangeError("targetStart out of bounds");
- }
- if (start < 0 || start >= this.length)
- throw new RangeError("Index out of range");
- if (end < 0)
- throw new RangeError("sourceEnd out of bounds");
- if (end > this.length)
- end = this.length;
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start;
- }
- var len = end - start;
- if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {
- this.copyWithin(targetStart, start, end);
- } else if (this === target && start < targetStart && targetStart < end) {
- for (var i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start];
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- );
- }
- return len;
- };
- Buffer2.prototype.fill = function fill(val, start, end, encoding) {
- if (typeof val === "string") {
- if (typeof start === "string") {
- encoding = start;
- start = 0;
- end = this.length;
- } else if (typeof end === "string") {
- encoding = end;
- end = this.length;
- }
- if (encoding !== void 0 && typeof encoding !== "string") {
- throw new TypeError("encoding must be a string");
- }
- if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
- throw new TypeError("Unknown encoding: " + encoding);
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0);
- if (encoding === "utf8" && code < 128 || encoding === "latin1") {
- val = code;
- }
- }
- } else if (typeof val === "number") {
- val = val & 255;
- }
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError("Out of range index");
- }
- if (end <= start) {
- return this;
- }
- start = start >>> 0;
- end = end === void 0 ? this.length : end >>> 0;
- if (!val)
- val = 0;
- var i;
- if (typeof val === "number") {
- for (i = start; i < end; ++i) {
- this[i] = val;
- }
- } else {
- var bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding);
- var len = bytes.length;
- if (len === 0) {
- throw new TypeError('The value "' + val + '" is invalid for argument "value"');
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len];
- }
- }
- return this;
- };
- var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
- function base64clean(str) {
- str = str.split("=")[0];
- str = str.trim().replace(INVALID_BASE64_RE, "");
- if (str.length < 2)
- return "";
- while (str.length % 4 !== 0) {
- str = str + "=";
- }
- return str;
- }
- function toHex(n) {
- if (n < 16)
- return "0" + n.toString(16);
- return n.toString(16);
- }
- function utf8ToBytes(string, units) {
- units = units || Infinity;
- var codePoint;
- var length = string.length;
- var leadSurrogate = null;
- var bytes = [];
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i);
- if (codePoint > 55295 && codePoint < 57344) {
- if (!leadSurrogate) {
- if (codePoint > 56319) {
- if ((units -= 3) > -1)
- bytes.push(239, 191, 189);
- continue;
- } else if (i + 1 === length) {
- if ((units -= 3) > -1)
- bytes.push(239, 191, 189);
- continue;
- }
- leadSurrogate = codePoint;
- continue;
- }
- if (codePoint < 56320) {
- if ((units -= 3) > -1)
- bytes.push(239, 191, 189);
- leadSurrogate = codePoint;
- continue;
- }
- codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
- } else if (leadSurrogate) {
- if ((units -= 3) > -1)
- bytes.push(239, 191, 189);
- }
- leadSurrogate = null;
- if (codePoint < 128) {
- if ((units -= 1) < 0)
- break;
- bytes.push(codePoint);
- } else if (codePoint < 2048) {
- if ((units -= 2) < 0)
- break;
- bytes.push(
- codePoint >> 6 | 192,
- codePoint & 63 | 128
- );
- } else if (codePoint < 65536) {
- if ((units -= 3) < 0)
- break;
- bytes.push(
- codePoint >> 12 | 224,
- codePoint >> 6 & 63 | 128,
- codePoint & 63 | 128
- );
- } else if (codePoint < 1114112) {
- if ((units -= 4) < 0)
- break;
- bytes.push(
- codePoint >> 18 | 240,
- codePoint >> 12 & 63 | 128,
- codePoint >> 6 & 63 | 128,
- codePoint & 63 | 128
- );
- } else {
- throw new Error("Invalid code point");
- }
- }
- return bytes;
- }
- function asciiToBytes(str) {
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- byteArray.push(str.charCodeAt(i) & 255);
- }
- return byteArray;
- }
- function utf16leToBytes(str, units) {
- var c, hi, lo;
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0)
- break;
- c = str.charCodeAt(i);
- hi = c >> 8;
- lo = c % 256;
- byteArray.push(lo);
- byteArray.push(hi);
- }
- return byteArray;
- }
- function base64ToBytes(str) {
- return base64.toByteArray(base64clean(str));
- }
- function blitBuffer(src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if (i + offset >= dst.length || i >= src.length)
- break;
- dst[i + offset] = src[i];
- }
- return i;
- }
- function isInstance(obj, type) {
- return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
- }
- function numberIsNaN(obj) {
- return obj !== obj;
- }
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "base64-js": 87, "buffer": 90, "ieee754": 357 }], 91: [function(require2, module3, exports3) {
- module3.exports = {
- "100": "Continue",
- "101": "Switching Protocols",
- "102": "Processing",
- "200": "OK",
- "201": "Created",
- "202": "Accepted",
- "203": "Non-Authoritative Information",
- "204": "No Content",
- "205": "Reset Content",
- "206": "Partial Content",
- "207": "Multi-Status",
- "208": "Already Reported",
- "226": "IM Used",
- "300": "Multiple Choices",
- "301": "Moved Permanently",
- "302": "Found",
- "303": "See Other",
- "304": "Not Modified",
- "305": "Use Proxy",
- "307": "Temporary Redirect",
- "308": "Permanent Redirect",
- "400": "Bad Request",
- "401": "Unauthorized",
- "402": "Payment Required",
- "403": "Forbidden",
- "404": "Not Found",
- "405": "Method Not Allowed",
- "406": "Not Acceptable",
- "407": "Proxy Authentication Required",
- "408": "Request Timeout",
- "409": "Conflict",
- "410": "Gone",
- "411": "Length Required",
- "412": "Precondition Failed",
- "413": "Payload Too Large",
- "414": "URI Too Long",
- "415": "Unsupported Media Type",
- "416": "Range Not Satisfiable",
- "417": "Expectation Failed",
- "418": "I'm a teapot",
- "421": "Misdirected Request",
- "422": "Unprocessable Entity",
- "423": "Locked",
- "424": "Failed Dependency",
- "425": "Unordered Collection",
- "426": "Upgrade Required",
- "428": "Precondition Required",
- "429": "Too Many Requests",
- "431": "Request Header Fields Too Large",
- "451": "Unavailable For Legal Reasons",
- "500": "Internal Server Error",
- "501": "Not Implemented",
- "502": "Bad Gateway",
- "503": "Service Unavailable",
- "504": "Gateway Timeout",
- "505": "HTTP Version Not Supported",
- "506": "Variant Also Negotiates",
- "507": "Insufficient Storage",
- "508": "Loop Detected",
- "509": "Bandwidth Limit Exceeded",
- "510": "Not Extended",
- "511": "Network Authentication Required"
- };
- }, {}], 92: [function(require2, module3, exports3) {
- "use strict";
- var GetIntrinsic = require2("get-intrinsic");
- var callBind = require2("./");
- var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
- module3.exports = function callBoundIntrinsic(name, allowMissing) {
- var intrinsic = GetIntrinsic(name, !!allowMissing);
- if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
- return callBind(intrinsic);
- }
- return intrinsic;
- };
- }, { "./": 93, "get-intrinsic": 348 }], 93: [function(require2, module3, exports3) {
- "use strict";
- var bind = require2("function-bind");
- var GetIntrinsic = require2("get-intrinsic");
- var $apply = GetIntrinsic("%Function.prototype.apply%");
- var $call = GetIntrinsic("%Function.prototype.call%");
- var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
- var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
- var $max = GetIntrinsic("%Math.max%");
- if ($defineProperty) {
- try {
- $defineProperty({}, "a", { value: 1 });
- } catch (e) {
- $defineProperty = null;
- }
- }
- module3.exports = function callBind(originalFunction) {
- var func = $reflectApply(bind, $call, arguments);
- if ($gOPD && $defineProperty) {
- var desc = $gOPD(func, "length");
- if (desc.configurable) {
- $defineProperty(
- func,
- "length",
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
- );
- }
- }
- return func;
- };
- var applyBind = function applyBind2() {
- return $reflectApply(bind, $apply, arguments);
- };
- if ($defineProperty) {
- $defineProperty(module3.exports, "apply", { value: applyBind });
- } else {
- module3.exports.apply = applyBind;
- }
- }, { "function-bind": 347, "get-intrinsic": 348 }], 94: [function(require2, module3, exports3) {
- "use strict";
- var slice = Array.prototype.slice;
- module3.exports = Copy;
- function Copy(src, withAccess) {
- if (!(this instanceof Copy))
- return new Copy(src, withAccess);
- this.src = src;
- this._withAccess = withAccess;
- }
- Copy.prototype.withAccess = function(w) {
- this._withAccess = w !== false;
- return this;
- };
- Copy.prototype.pick = function(keys) {
- if (!Array.isArray(keys)) {
- keys = slice.call(arguments);
- }
- if (keys.length) {
- this.keys = keys;
- }
- return this;
- };
- Copy.prototype.to = function(to) {
- to = to || {};
- if (!this.src)
- return to;
- var keys = this.keys || Object.keys(this.src);
- if (!this._withAccess) {
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- if (to[key] !== void 0)
- continue;
- to[key] = this.src[key];
- }
- return to;
- }
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!notDefined(to, key))
- continue;
- var getter = this.src.__lookupGetter__(key);
- var setter = this.src.__lookupSetter__(key);
- if (getter)
- to.__defineGetter__(key, getter);
- if (setter)
- to.__defineSetter__(key, setter);
- if (!getter && !setter) {
- to[key] = this.src[key];
- }
- }
- return to;
- };
- Copy.prototype.toCover = function(to) {
- var keys = this.keys || Object.keys(this.src);
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- delete to[key];
- var getter = this.src.__lookupGetter__(key);
- var setter = this.src.__lookupSetter__(key);
- if (getter)
- to.__defineGetter__(key, getter);
- if (setter)
- to.__defineSetter__(key, setter);
- if (!getter && !setter) {
- to[key] = this.src[key];
- }
- }
- };
- Copy.prototype.override = Copy.prototype.toCover;
- Copy.prototype.and = function(obj) {
- var src = {};
- this.to(src);
- this.src = obj;
- this.to(src);
- this.src = src;
- return this;
- };
- function notDefined(obj, key) {
- return obj[key] === void 0 && obj.__lookupGetter__(key) === void 0 && obj.__lookupSetter__(key) === void 0;
- }
- }, {}], 95: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var tryToString = require2("../internals/try-to-string");
- var TypeError2 = global2.TypeError;
- module3.exports = function(argument) {
- if (isCallable(argument))
- return argument;
- throw TypeError2(tryToString(argument) + " is not a function");
- };
- }, { "../internals/global": 163, "../internals/is-callable": 176, "../internals/try-to-string": 257 }], 96: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isConstructor = require2("../internals/is-constructor");
- var tryToString = require2("../internals/try-to-string");
- var TypeError2 = global2.TypeError;
- module3.exports = function(argument) {
- if (isConstructor(argument))
- return argument;
- throw TypeError2(tryToString(argument) + " is not a constructor");
- };
- }, { "../internals/global": 163, "../internals/is-constructor": 177, "../internals/try-to-string": 257 }], 97: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var String2 = global2.String;
- var TypeError2 = global2.TypeError;
- module3.exports = function(argument) {
- if (typeof argument == "object" || isCallable(argument))
- return argument;
- throw TypeError2("Can't set " + String2(argument) + " as a prototype");
- };
- }, { "../internals/global": 163, "../internals/is-callable": 176 }], 98: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var create = require2("../internals/object-create");
- var definePropertyModule = require2("../internals/object-define-property");
- var UNSCOPABLES = wellKnownSymbol("unscopables");
- var ArrayPrototype = Array.prototype;
- if (ArrayPrototype[UNSCOPABLES] == void 0) {
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
- configurable: true,
- value: create(null)
- });
- }
- module3.exports = function(key) {
- ArrayPrototype[UNSCOPABLES][key] = true;
- };
- }, { "../internals/object-create": 196, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 99: [function(require2, module3, exports3) {
- "use strict";
- var charAt = require2("../internals/string-multibyte").charAt;
- module3.exports = function(S, index, unicode) {
- return index + (unicode ? charAt(S, index).length : 1);
- };
- }, { "../internals/string-multibyte": 239 }], 100: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var TypeError2 = global2.TypeError;
- module3.exports = function(it, Prototype) {
- if (isPrototypeOf(Prototype, it))
- return it;
- throw TypeError2("Incorrect invocation");
- };
- }, { "../internals/global": 163, "../internals/object-is-prototype-of": 204 }], 101: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isObject = require2("../internals/is-object");
- var String2 = global2.String;
- var TypeError2 = global2.TypeError;
- module3.exports = function(argument) {
- if (isObject(argument))
- return argument;
- throw TypeError2(String2(argument) + " is not an object");
- };
- }, { "../internals/global": 163, "../internals/is-object": 180 }], 102: [function(require2, module3, exports3) {
- module3.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
- }, {}], 103: [function(require2, module3, exports3) {
- "use strict";
- var NATIVE_ARRAY_BUFFER = require2("../internals/array-buffer-native");
- var DESCRIPTORS = require2("../internals/descriptors");
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var isObject = require2("../internals/is-object");
- var hasOwn = require2("../internals/has-own-property");
- var classof = require2("../internals/classof");
- var tryToString = require2("../internals/try-to-string");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var redefine = require2("../internals/redefine");
- var defineProperty = require2("../internals/object-define-property").f;
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var getPrototypeOf = require2("../internals/object-get-prototype-of");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var uid = require2("../internals/uid");
- var Int8Array2 = global2.Int8Array;
- var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
- var Uint8ClampedArray2 = global2.Uint8ClampedArray;
- var Uint8ClampedArrayPrototype = Uint8ClampedArray2 && Uint8ClampedArray2.prototype;
- var TypedArray = Int8Array2 && getPrototypeOf(Int8Array2);
- var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
- var ObjectPrototype = Object.prototype;
- var TypeError2 = global2.TypeError;
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG");
- var TYPED_ARRAY_CONSTRUCTOR = uid("TYPED_ARRAY_CONSTRUCTOR");
- var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global2.opera) !== "Opera";
- var TYPED_ARRAY_TAG_REQUIRED = false;
- var NAME, Constructor, Prototype;
- var TypedArrayConstructorsList = {
- Int8Array: 1,
- Uint8Array: 1,
- Uint8ClampedArray: 1,
- Int16Array: 2,
- Uint16Array: 2,
- Int32Array: 4,
- Uint32Array: 4,
- Float32Array: 4,
- Float64Array: 8
- };
- var BigIntArrayConstructorsList = {
- BigInt64Array: 8,
- BigUint64Array: 8
- };
- var isView = function isView2(it) {
- if (!isObject(it))
- return false;
- var klass = classof(it);
- return klass === "DataView" || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
- };
- var isTypedArray = function(it) {
- if (!isObject(it))
- return false;
- var klass = classof(it);
- return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
- };
- var aTypedArray = function(it) {
- if (isTypedArray(it))
- return it;
- throw TypeError2("Target is not a typed array");
- };
- var aTypedArrayConstructor = function(C) {
- if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C)))
- return C;
- throw TypeError2(tryToString(C) + " is not a typed array constructor");
- };
- var exportTypedArrayMethod = function(KEY, property, forced, options) {
- if (!DESCRIPTORS)
- return;
- if (forced)
- for (var ARRAY in TypedArrayConstructorsList) {
- var TypedArrayConstructor = global2[ARRAY];
- if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY))
- try {
- delete TypedArrayConstructor.prototype[KEY];
- } catch (error) {
- try {
- TypedArrayConstructor.prototype[KEY] = property;
- } catch (error2) {
- }
- }
- }
- if (!TypedArrayPrototype[KEY] || forced) {
- redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
- }
- };
- var exportTypedArrayStaticMethod = function(KEY, property, forced) {
- var ARRAY, TypedArrayConstructor;
- if (!DESCRIPTORS)
- return;
- if (setPrototypeOf) {
- if (forced)
- for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global2[ARRAY];
- if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY))
- try {
- delete TypedArrayConstructor[KEY];
- } catch (error) {
- }
- }
- if (!TypedArray[KEY] || forced) {
- try {
- return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
- } catch (error) {
- }
- } else
- return;
- }
- for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global2[ARRAY];
- if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
- redefine(TypedArrayConstructor, KEY, property);
- }
- }
- };
- for (NAME in TypedArrayConstructorsList) {
- Constructor = global2[NAME];
- Prototype = Constructor && Constructor.prototype;
- if (Prototype)
- createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
- else
- NATIVE_ARRAY_BUFFER_VIEWS = false;
- }
- for (NAME in BigIntArrayConstructorsList) {
- Constructor = global2[NAME];
- Prototype = Constructor && Constructor.prototype;
- if (Prototype)
- createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
- }
- if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
- TypedArray = function TypedArray2() {
- throw TypeError2("Incorrect invocation");
- };
- if (NATIVE_ARRAY_BUFFER_VIEWS)
- for (NAME in TypedArrayConstructorsList) {
- if (global2[NAME])
- setPrototypeOf(global2[NAME], TypedArray);
- }
- }
- if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
- TypedArrayPrototype = TypedArray.prototype;
- if (NATIVE_ARRAY_BUFFER_VIEWS)
- for (NAME in TypedArrayConstructorsList) {
- if (global2[NAME])
- setPrototypeOf(global2[NAME].prototype, TypedArrayPrototype);
- }
- }
- if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
- setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
- }
- if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
- TYPED_ARRAY_TAG_REQUIRED = true;
- defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function() {
- return isObject(this) ? this[TYPED_ARRAY_TAG] : void 0;
- } });
- for (NAME in TypedArrayConstructorsList)
- if (global2[NAME]) {
- createNonEnumerableProperty(global2[NAME], TYPED_ARRAY_TAG, NAME);
- }
- }
- module3.exports = {
- NATIVE_ARRAY_BUFFER_VIEWS,
- TYPED_ARRAY_CONSTRUCTOR,
- TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
- aTypedArray,
- aTypedArrayConstructor,
- exportTypedArrayMethod,
- exportTypedArrayStaticMethod,
- isView,
- isTypedArray,
- TypedArray,
- TypedArrayPrototype
- };
- }, { "../internals/array-buffer-native": 102, "../internals/classof": 124, "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/object-define-property": 198, "../internals/object-get-prototype-of": 203, "../internals/object-is-prototype-of": 204, "../internals/object-set-prototype-of": 208, "../internals/redefine": 222, "../internals/try-to-string": 257, "../internals/uid": 263, "../internals/well-known-symbol": 268 }], 104: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var DESCRIPTORS = require2("../internals/descriptors");
- var NATIVE_ARRAY_BUFFER = require2("../internals/array-buffer-native");
- var FunctionName = require2("../internals/function-name");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var redefineAll = require2("../internals/redefine-all");
- var fails = require2("../internals/fails");
- var anInstance = require2("../internals/an-instance");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var toLength = require2("../internals/to-length");
- var toIndex = require2("../internals/to-index");
- var IEEE754 = require2("../internals/ieee754");
- var getPrototypeOf = require2("../internals/object-get-prototype-of");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
- var defineProperty = require2("../internals/object-define-property").f;
- var arrayFill = require2("../internals/array-fill");
- var arraySlice = require2("../internals/array-slice-simple");
- var setToStringTag = require2("../internals/set-to-string-tag");
- var InternalStateModule = require2("../internals/internal-state");
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var ARRAY_BUFFER = "ArrayBuffer";
- var DATA_VIEW = "DataView";
- var PROTOTYPE = "prototype";
- var WRONG_LENGTH = "Wrong length";
- var WRONG_INDEX = "Wrong index";
- var NativeArrayBuffer = global2[ARRAY_BUFFER];
- var $ArrayBuffer = NativeArrayBuffer;
- var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
- var $DataView = global2[DATA_VIEW];
- var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
- var ObjectPrototype = Object.prototype;
- var Array2 = global2.Array;
- var RangeError2 = global2.RangeError;
- var fill = uncurryThis(arrayFill);
- var reverse = uncurryThis([].reverse);
- var packIEEE754 = IEEE754.pack;
- var unpackIEEE754 = IEEE754.unpack;
- var packInt8 = function(number) {
- return [number & 255];
- };
- var packInt16 = function(number) {
- return [number & 255, number >> 8 & 255];
- };
- var packInt32 = function(number) {
- return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255];
- };
- var unpackInt32 = function(buffer) {
- return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
- };
- var packFloat32 = function(number) {
- return packIEEE754(number, 23, 4);
- };
- var packFloat64 = function(number) {
- return packIEEE754(number, 52, 8);
- };
- var addGetter = function(Constructor, key2) {
- defineProperty(Constructor[PROTOTYPE], key2, { get: function() {
- return getInternalState(this)[key2];
- } });
- };
- var get = function(view, count, index, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength)
- throw RangeError2(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = arraySlice(bytes, start, start + count);
- return isLittleEndian ? pack : reverse(pack);
- };
- var set = function(view, count, index, conversion, value, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength)
- throw RangeError2(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = conversion(+value);
- for (var i = 0; i < count; i++)
- bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
- };
- if (!NATIVE_ARRAY_BUFFER) {
- $ArrayBuffer = function ArrayBuffer2(length) {
- anInstance(this, ArrayBufferPrototype);
- var byteLength = toIndex(length);
- setInternalState(this, {
- bytes: fill(Array2(byteLength), 0),
- byteLength
- });
- if (!DESCRIPTORS)
- this.byteLength = byteLength;
- };
- ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
- $DataView = function DataView2(buffer, byteOffset, byteLength) {
- anInstance(this, DataViewPrototype);
- anInstance(buffer, ArrayBufferPrototype);
- var bufferLength = getInternalState(buffer).byteLength;
- var offset = toIntegerOrInfinity(byteOffset);
- if (offset < 0 || offset > bufferLength)
- throw RangeError2("Wrong offset");
- byteLength = byteLength === void 0 ? bufferLength - offset : toLength(byteLength);
- if (offset + byteLength > bufferLength)
- throw RangeError2(WRONG_LENGTH);
- setInternalState(this, {
- buffer,
- byteLength,
- byteOffset: offset
- });
- if (!DESCRIPTORS) {
- this.buffer = buffer;
- this.byteLength = byteLength;
- this.byteOffset = offset;
- }
- };
- DataViewPrototype = $DataView[PROTOTYPE];
- if (DESCRIPTORS) {
- addGetter($ArrayBuffer, "byteLength");
- addGetter($DataView, "buffer");
- addGetter($DataView, "byteLength");
- addGetter($DataView, "byteOffset");
- }
- redefineAll(DataViewPrototype, {
- getInt8: function getInt8(byteOffset) {
- return get(this, 1, byteOffset)[0] << 24 >> 24;
- },
- getUint8: function getUint8(byteOffset) {
- return get(this, 1, byteOffset)[0];
- },
- getInt16: function getInt16(byteOffset) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
- return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
- },
- getUint16: function getUint16(byteOffset) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
- return bytes[1] << 8 | bytes[0];
- },
- getInt32: function getInt32(byteOffset) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0));
- },
- getUint32: function getUint32(byteOffset) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)) >>> 0;
- },
- getFloat32: function getFloat32(byteOffset) {
- return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 23);
- },
- getFloat64: function getFloat64(byteOffset) {
- return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 52);
- },
- setInt8: function setInt8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setUint8: function setUint8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setInt16: function setInt16(byteOffset, value) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
- },
- setUint16: function setUint16(byteOffset, value) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
- },
- setInt32: function setInt32(byteOffset, value) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
- },
- setUint32: function setUint32(byteOffset, value) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
- },
- setFloat32: function setFloat32(byteOffset, value) {
- set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : void 0);
- },
- setFloat64: function setFloat64(byteOffset, value) {
- set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : void 0);
- }
- });
- } else {
- var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
- if (!fails(function() {
- NativeArrayBuffer(1);
- }) || !fails(function() {
- new NativeArrayBuffer(-1);
- }) || fails(function() {
- new NativeArrayBuffer();
- new NativeArrayBuffer(1.5);
- new NativeArrayBuffer(NaN);
- return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
- })) {
- $ArrayBuffer = function ArrayBuffer2(length) {
- anInstance(this, ArrayBufferPrototype);
- return new NativeArrayBuffer(toIndex(length));
- };
- $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
- for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j; ) {
- if (!((key = keys[j++]) in $ArrayBuffer)) {
- createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
- }
- }
- ArrayBufferPrototype.constructor = $ArrayBuffer;
- } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
- createNonEnumerableProperty(NativeArrayBuffer, "name", ARRAY_BUFFER);
- }
- if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
- setPrototypeOf(DataViewPrototype, ObjectPrototype);
- }
- var testView = new $DataView(new $ArrayBuffer(2));
- var $setInt8 = uncurryThis(DataViewPrototype.setInt8);
- testView.setInt8(0, 2147483648);
- testView.setInt8(1, 2147483649);
- if (testView.getInt8(0) || !testView.getInt8(1))
- redefineAll(DataViewPrototype, {
- setInt8: function setInt8(byteOffset, value) {
- $setInt8(this, byteOffset, value << 24 >> 24);
- },
- setUint8: function setUint8(byteOffset, value) {
- $setInt8(this, byteOffset, value << 24 >> 24);
- }
- }, { unsafe: true });
- }
- setToStringTag($ArrayBuffer, ARRAY_BUFFER);
- setToStringTag($DataView, DATA_VIEW);
- module3.exports = {
- ArrayBuffer: $ArrayBuffer,
- DataView: $DataView
- };
- }, { "../internals/an-instance": 100, "../internals/array-buffer-native": 102, "../internals/array-fill": 106, "../internals/array-slice-simple": 116, "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-name": 156, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/ieee754": 169, "../internals/internal-state": 173, "../internals/object-define-property": 198, "../internals/object-get-own-property-names": 201, "../internals/object-get-prototype-of": 203, "../internals/object-set-prototype-of": 208, "../internals/redefine-all": 221, "../internals/set-to-string-tag": 234, "../internals/to-index": 246, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249 }], 105: [function(require2, module3, exports3) {
- "use strict";
- var toObject = require2("../internals/to-object");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var min = Math.min;
- module3.exports = [].copyWithin || function copyWithin(target, start) {
- var O = toObject(this);
- var len = lengthOfArrayLike(O);
- var to = toAbsoluteIndex(target, len);
- var from = toAbsoluteIndex(start, len);
- var end = arguments.length > 2 ? arguments[2] : void 0;
- var count = min((end === void 0 ? len : toAbsoluteIndex(end, len)) - from, len - to);
- var inc = 1;
- if (from < to && to < from + count) {
- inc = -1;
- from += count - 1;
- to += count - 1;
- }
- while (count-- > 0) {
- if (from in O)
- O[to] = O[from];
- else
- delete O[to];
- to += inc;
- from += inc;
- }
- return O;
- };
- }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-object": 250 }], 106: [function(require2, module3, exports3) {
- "use strict";
- var toObject = require2("../internals/to-object");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- module3.exports = function fill(value) {
- var O = toObject(this);
- var length = lengthOfArrayLike(O);
- var argumentsLength = arguments.length;
- var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : void 0, length);
- var end = argumentsLength > 2 ? arguments[2] : void 0;
- var endPos = end === void 0 ? length : toAbsoluteIndex(end, length);
- while (endPos > index)
- O[index++] = value;
- return O;
- };
- }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-object": 250 }], 107: [function(require2, module3, exports3) {
- "use strict";
- var $forEach = require2("../internals/array-iteration").forEach;
- var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
- var STRICT_METHOD = arrayMethodIsStrict("forEach");
- module3.exports = !STRICT_METHOD ? function forEach(callbackfn) {
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- } : [].forEach;
- }, { "../internals/array-iteration": 111, "../internals/array-method-is-strict": 114 }], 108: [function(require2, module3, exports3) {
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- module3.exports = function(Constructor, list) {
- var index = 0;
- var length = lengthOfArrayLike(list);
- var result = new Constructor(length);
- while (length > index)
- result[index] = list[index++];
- return result;
- };
- }, { "../internals/length-of-array-like": 188 }], 109: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var bind = require2("../internals/function-bind-context");
- var call = require2("../internals/function-call");
- var toObject = require2("../internals/to-object");
- var callWithSafeIterationClosing = require2("../internals/call-with-safe-iteration-closing");
- var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
- var isConstructor = require2("../internals/is-constructor");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var createProperty = require2("../internals/create-property");
- var getIterator = require2("../internals/get-iterator");
- var getIteratorMethod = require2("../internals/get-iterator-method");
- var Array2 = global2.Array;
- module3.exports = function from(arrayLike) {
- var O = toObject(arrayLike);
- var IS_CONSTRUCTOR = isConstructor(this);
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
- var mapping = mapfn !== void 0;
- if (mapping)
- mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
- var iteratorMethod = getIteratorMethod(O);
- var index = 0;
- var length, result, step, iterator, next, value;
- if (iteratorMethod && !(this == Array2 && isArrayIteratorMethod(iteratorMethod))) {
- iterator = getIterator(O, iteratorMethod);
- next = iterator.next;
- result = IS_CONSTRUCTOR ? new this() : [];
- for (; !(step = call(next, iterator)).done; index++) {
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
- createProperty(result, index, value);
- }
- } else {
- length = lengthOfArrayLike(O);
- result = IS_CONSTRUCTOR ? new this(length) : Array2(length);
- for (; length > index; index++) {
- value = mapping ? mapfn(O[index], index) : O[index];
- createProperty(result, index, value);
- }
- }
- result.length = index;
- return result;
- };
- }, { "../internals/call-with-safe-iteration-closing": 121, "../internals/create-property": 131, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/is-array-iterator-method": 174, "../internals/is-constructor": 177, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 110: [function(require2, module3, exports3) {
- var toIndexedObject = require2("../internals/to-indexed-object");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var createMethod = function(IS_INCLUDES) {
- return function($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = lengthOfArrayLike(O);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- if (IS_INCLUDES && el != el)
- while (length > index) {
- value = O[index++];
- if (value != value)
- return true;
- }
- else
- for (; length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el)
- return IS_INCLUDES || index || 0;
- }
- return !IS_INCLUDES && -1;
- };
- };
- module3.exports = {
- // `Array.prototype.includes` method
- // https://tc39.es/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- indexOf: createMethod(false)
- };
- }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-indexed-object": 247 }], 111: [function(require2, module3, exports3) {
- var bind = require2("../internals/function-bind-context");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var IndexedObject = require2("../internals/indexed-object");
- var toObject = require2("../internals/to-object");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var arraySpeciesCreate = require2("../internals/array-species-create");
- var push = uncurryThis([].push);
- var createMethod = function(TYPE) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var IS_FILTER_REJECT = TYPE == 7;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- return function($this, callbackfn, that, specificCreate) {
- var O = toObject($this);
- var self2 = IndexedObject(O);
- var boundFunction = bind(callbackfn, that);
- var length = lengthOfArrayLike(self2);
- var index = 0;
- var create = specificCreate || arraySpeciesCreate;
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : void 0;
- var value, result;
- for (; length > index; index++)
- if (NO_HOLES || index in self2) {
- value = self2[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP)
- target[index] = result;
- else if (result)
- switch (TYPE) {
- case 3:
- return true;
- case 5:
- return value;
- case 6:
- return index;
- case 2:
- push(target, value);
- }
- else
- switch (TYPE) {
- case 4:
- return false;
- case 7:
- push(target, value);
- }
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
- };
- module3.exports = {
- // `Array.prototype.forEach` method
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.es/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.es/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6),
- // `Array.prototype.filterReject` method
- // https://github.com/tc39/proposal-array-filtering
- filterReject: createMethod(7)
- };
- }, { "../internals/array-species-create": 120, "../internals/function-bind-context": 153, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 112: [function(require2, module3, exports3) {
- "use strict";
- var apply = require2("../internals/function-apply");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
- var min = Math.min;
- var $lastIndexOf = [].lastIndexOf;
- var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf");
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
- module3.exports = FORCED ? function lastIndexOf(searchElement) {
- if (NEGATIVE_ZERO)
- return apply($lastIndexOf, this, arguments) || 0;
- var O = toIndexedObject(this);
- var length = lengthOfArrayLike(O);
- var index = length - 1;
- if (arguments.length > 1)
- index = min(index, toIntegerOrInfinity(arguments[1]));
- if (index < 0)
- index = length + index;
- for (; index >= 0; index--)
- if (index in O && O[index] === searchElement)
- return index || 0;
- return -1;
- } : $lastIndexOf;
- }, { "../internals/array-method-is-strict": 114, "../internals/function-apply": 152, "../internals/length-of-array-like": 188, "../internals/to-indexed-object": 247, "../internals/to-integer-or-infinity": 248 }], 113: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var V8_VERSION = require2("../internals/engine-v8-version");
- var SPECIES = wellKnownSymbol("species");
- module3.exports = function(METHOD_NAME) {
- return V8_VERSION >= 51 || !fails(function() {
- var array = [];
- var constructor = array.constructor = {};
- constructor[SPECIES] = function() {
- return { foo: 1 };
- };
- return array[METHOD_NAME](Boolean).foo !== 1;
- });
- };
- }, { "../internals/engine-v8-version": 146, "../internals/fails": 150, "../internals/well-known-symbol": 268 }], 114: [function(require2, module3, exports3) {
- "use strict";
- var fails = require2("../internals/fails");
- module3.exports = function(METHOD_NAME, argument) {
- var method = [][METHOD_NAME];
- return !!method && fails(function() {
- method.call(null, argument || function() {
- return 1;
- }, 1);
- });
- };
- }, { "../internals/fails": 150 }], 115: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var aCallable = require2("../internals/a-callable");
- var toObject = require2("../internals/to-object");
- var IndexedObject = require2("../internals/indexed-object");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var TypeError2 = global2.TypeError;
- var createMethod = function(IS_RIGHT) {
- return function(that, callbackfn, argumentsLength, memo) {
- aCallable(callbackfn);
- var O = toObject(that);
- var self2 = IndexedObject(O);
- var length = lengthOfArrayLike(O);
- var index = IS_RIGHT ? length - 1 : 0;
- var i = IS_RIGHT ? -1 : 1;
- if (argumentsLength < 2)
- while (true) {
- if (index in self2) {
- memo = self2[index];
- index += i;
- break;
- }
- index += i;
- if (IS_RIGHT ? index < 0 : length <= index) {
- throw TypeError2("Reduce of empty array with no initial value");
- }
- }
- for (; IS_RIGHT ? index >= 0 : length > index; index += i)
- if (index in self2) {
- memo = callbackfn(memo, self2[index], index, O);
- }
- return memo;
- };
- };
- module3.exports = {
- // `Array.prototype.reduce` method
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
- left: createMethod(false),
- // `Array.prototype.reduceRight` method
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
- right: createMethod(true)
- };
- }, { "../internals/a-callable": 95, "../internals/global": 163, "../internals/indexed-object": 170, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 116: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var createProperty = require2("../internals/create-property");
- var Array2 = global2.Array;
- var max = Math.max;
- module3.exports = function(O, start, end) {
- var length = lengthOfArrayLike(O);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
- var result = Array2(max(fin - k, 0));
- for (var n = 0; k < fin; k++, n++)
- createProperty(result, n, O[k]);
- result.length = n;
- return result;
- };
- }, { "../internals/create-property": 131, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245 }], 117: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- module3.exports = uncurryThis([].slice);
- }, { "../internals/function-uncurry-this": 157 }], 118: [function(require2, module3, exports3) {
- var arraySlice = require2("../internals/array-slice-simple");
- var floor = Math.floor;
- var mergeSort = function(array, comparefn) {
- var length = array.length;
- var middle = floor(length / 2);
- return length < 8 ? insertionSort(array, comparefn) : merge(
- array,
- mergeSort(arraySlice(array, 0, middle), comparefn),
- mergeSort(arraySlice(array, middle), comparefn),
- comparefn
- );
- };
- var insertionSort = function(array, comparefn) {
- var length = array.length;
- var i = 1;
- var element, j;
- while (i < length) {
- j = i;
- element = array[i];
- while (j && comparefn(array[j - 1], element) > 0) {
- array[j] = array[--j];
- }
- if (j !== i++)
- array[j] = element;
- }
- return array;
- };
- var merge = function(array, left, right, comparefn) {
- var llength = left.length;
- var rlength = right.length;
- var lindex = 0;
- var rindex = 0;
- while (lindex < llength || rindex < rlength) {
- array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
- }
- return array;
- };
- module3.exports = mergeSort;
- }, { "../internals/array-slice-simple": 116 }], 119: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isArray = require2("../internals/is-array");
- var isConstructor = require2("../internals/is-constructor");
- var isObject = require2("../internals/is-object");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var SPECIES = wellKnownSymbol("species");
- var Array2 = global2.Array;
- module3.exports = function(originalArray) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- if (isConstructor(C) && (C === Array2 || isArray(C.prototype)))
- C = void 0;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null)
- C = void 0;
- }
- }
- return C === void 0 ? Array2 : C;
- };
- }, { "../internals/global": 163, "../internals/is-array": 175, "../internals/is-constructor": 177, "../internals/is-object": 180, "../internals/well-known-symbol": 268 }], 120: [function(require2, module3, exports3) {
- var arraySpeciesConstructor = require2("../internals/array-species-constructor");
- module3.exports = function(originalArray, length) {
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
- };
- }, { "../internals/array-species-constructor": 119 }], 121: [function(require2, module3, exports3) {
- var anObject = require2("../internals/an-object");
- var iteratorClose = require2("../internals/iterator-close");
- module3.exports = function(iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- } catch (error) {
- iteratorClose(iterator, "throw", error);
- }
- };
- }, { "../internals/an-object": 101, "../internals/iterator-close": 185 }], 122: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var ITERATOR = wellKnownSymbol("iterator");
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function() {
- return { done: !!called++ };
- },
- "return": function() {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function() {
- return this;
- };
- Array.from(iteratorWithReturn, function() {
- throw 2;
- });
- } catch (error) {
- }
- module3.exports = function(exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING)
- return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function() {
- return {
- next: function() {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) {
- }
- return ITERATION_SUPPORT;
- };
- }, { "../internals/well-known-symbol": 268 }], 123: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var toString = uncurryThis({}.toString);
- var stringSlice = uncurryThis("".slice);
- module3.exports = function(it) {
- return stringSlice(toString(it), 8, -1);
- };
- }, { "../internals/function-uncurry-this": 157 }], 124: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
- var isCallable = require2("../internals/is-callable");
- var classofRaw = require2("../internals/classof-raw");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var Object2 = global2.Object;
- var CORRECT_ARGUMENTS = classofRaw(function() {
- return arguments;
- }()) == "Arguments";
- var tryGet = function(it, key) {
- try {
- return it[key];
- } catch (error) {
- }
- };
- module3.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
- var O, tag, result;
- return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object2(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
- };
- }, { "../internals/classof-raw": 123, "../internals/global": 163, "../internals/is-callable": 176, "../internals/to-string-tag-support": 255, "../internals/well-known-symbol": 268 }], 125: [function(require2, module3, exports3) {
- var hasOwn = require2("../internals/has-own-property");
- var ownKeys = require2("../internals/own-keys");
- var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
- var definePropertyModule = require2("../internals/object-define-property");
- module3.exports = function(target, source, exceptions) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- }
- };
- }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/own-keys": 212 }], 126: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var MATCH = wellKnownSymbol("match");
- module3.exports = function(METHOD_NAME) {
- var regexp = /./;
- try {
- "/./"[METHOD_NAME](regexp);
- } catch (error1) {
- try {
- regexp[MATCH] = false;
- return "/./"[METHOD_NAME](regexp);
- } catch (error2) {
- }
- }
- return false;
- };
- }, { "../internals/well-known-symbol": 268 }], 127: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- module3.exports = !fails(function() {
- function F() {
- }
- F.prototype.constructor = null;
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- }, { "../internals/fails": 150 }], 128: [function(require2, module3, exports3) {
- "use strict";
- var IteratorPrototype = require2("../internals/iterators-core").IteratorPrototype;
- var create = require2("../internals/object-create");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- var setToStringTag = require2("../internals/set-to-string-tag");
- var Iterators = require2("../internals/iterators");
- var returnThis = function() {
- return this;
- };
- module3.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
- var TO_STRING_TAG = NAME + " Iterator";
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- }, { "../internals/create-property-descriptor": 130, "../internals/iterators": 187, "../internals/iterators-core": 186, "../internals/object-create": 196, "../internals/set-to-string-tag": 234 }], 129: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var definePropertyModule = require2("../internals/object-define-property");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- module3.exports = DESCRIPTORS ? function(object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function(object, key, value) {
- object[key] = value;
- return object;
- };
- }, { "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/object-define-property": 198 }], 130: [function(require2, module3, exports3) {
- module3.exports = function(bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value
- };
- };
- }, {}], 131: [function(require2, module3, exports3) {
- "use strict";
- var toPropertyKey = require2("../internals/to-property-key");
- var definePropertyModule = require2("../internals/object-define-property");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- module3.exports = function(object, key, value) {
- var propertyKey = toPropertyKey(key);
- if (propertyKey in object)
- definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else
- object[propertyKey] = value;
- };
- }, { "../internals/create-property-descriptor": 130, "../internals/object-define-property": 198, "../internals/to-property-key": 254 }], 132: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var call = require2("../internals/function-call");
- var IS_PURE = require2("../internals/is-pure");
- var FunctionName = require2("../internals/function-name");
- var isCallable = require2("../internals/is-callable");
- var createIteratorConstructor = require2("../internals/create-iterator-constructor");
- var getPrototypeOf = require2("../internals/object-get-prototype-of");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- var setToStringTag = require2("../internals/set-to-string-tag");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var redefine = require2("../internals/redefine");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var Iterators = require2("../internals/iterators");
- var IteratorsCore = require2("../internals/iterators-core");
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol("iterator");
- var KEYS = "keys";
- var VALUES = "values";
- var ENTRIES = "entries";
- var returnThis = function() {
- return this;
- };
- module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function(KIND) {
- if (KIND === DEFAULT && defaultIterator)
- return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
- return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS:
- return function keys() {
- return new IteratorConstructor(this, KIND);
- };
- case VALUES:
- return function values() {
- return new IteratorConstructor(this, KIND);
- };
- case ENTRIES:
- return function entries() {
- return new IteratorConstructor(this, KIND);
- };
- }
- return function() {
- return new IteratorConstructor(this);
- };
- };
- var TO_STRING_TAG = NAME + " Iterator";
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
- redefine(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE)
- Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
- createNonEnumerableProperty(IterablePrototype, "name", VALUES);
- } else {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() {
- return call(nativeIterator, this);
- };
- }
- }
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED)
- for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- redefine(IterablePrototype, KEY, methods[KEY]);
- }
- }
- else
- $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
- }
- Iterators[NAME] = defaultIterator;
- return methods;
- };
- }, { "../internals/create-iterator-constructor": 128, "../internals/create-non-enumerable-property": 129, "../internals/export": 149, "../internals/function-call": 155, "../internals/function-name": 156, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/iterators": 187, "../internals/iterators-core": 186, "../internals/object-get-prototype-of": 203, "../internals/object-set-prototype-of": 208, "../internals/redefine": 222, "../internals/set-to-string-tag": 234, "../internals/well-known-symbol": 268 }], 133: [function(require2, module3, exports3) {
- var path = require2("../internals/path");
- var hasOwn = require2("../internals/has-own-property");
- var wrappedWellKnownSymbolModule = require2("../internals/well-known-symbol-wrapped");
- var defineProperty = require2("../internals/object-define-property").f;
- module3.exports = function(NAME) {
- var Symbol2 = path.Symbol || (path.Symbol = {});
- if (!hasOwn(Symbol2, NAME))
- defineProperty(Symbol2, NAME, {
- value: wrappedWellKnownSymbolModule.f(NAME)
- });
- };
- }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/path": 213, "../internals/well-known-symbol-wrapped": 267 }], 134: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- module3.exports = !fails(function() {
- return Object.defineProperty({}, 1, { get: function() {
- return 7;
- } })[1] != 7;
- });
- }, { "../internals/fails": 150 }], 135: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isObject = require2("../internals/is-object");
- var document2 = global2.document;
- var EXISTS = isObject(document2) && isObject(document2.createElement);
- module3.exports = function(it) {
- return EXISTS ? document2.createElement(it) : {};
- };
- }, { "../internals/global": 163, "../internals/is-object": 180 }], 136: [function(require2, module3, exports3) {
- module3.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- }, {}], 137: [function(require2, module3, exports3) {
- var documentCreateElement = require2("../internals/document-create-element");
- var classList = documentCreateElement("span").classList;
- var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
- module3.exports = DOMTokenListPrototype === Object.prototype ? void 0 : DOMTokenListPrototype;
- }, { "../internals/document-create-element": 135 }], 138: [function(require2, module3, exports3) {
- var userAgent = require2("../internals/engine-user-agent");
- var firefox = userAgent.match(/firefox\/(\d+)/i);
- module3.exports = !!firefox && +firefox[1];
- }, { "../internals/engine-user-agent": 145 }], 139: [function(require2, module3, exports3) {
- module3.exports = typeof window == "object" && typeof Deno != "object";
- }, {}], 140: [function(require2, module3, exports3) {
- var UA = require2("../internals/engine-user-agent");
- module3.exports = /MSIE|Trident/.test(UA);
- }, { "../internals/engine-user-agent": 145 }], 141: [function(require2, module3, exports3) {
- var userAgent = require2("../internals/engine-user-agent");
- var global2 = require2("../internals/global");
- module3.exports = /ipad|iphone|ipod/i.test(userAgent) && global2.Pebble !== void 0;
- }, { "../internals/engine-user-agent": 145, "../internals/global": 163 }], 142: [function(require2, module3, exports3) {
- var userAgent = require2("../internals/engine-user-agent");
- module3.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
- }, { "../internals/engine-user-agent": 145 }], 143: [function(require2, module3, exports3) {
- var classof = require2("../internals/classof-raw");
- var global2 = require2("../internals/global");
- module3.exports = classof(global2.process) == "process";
- }, { "../internals/classof-raw": 123, "../internals/global": 163 }], 144: [function(require2, module3, exports3) {
- var userAgent = require2("../internals/engine-user-agent");
- module3.exports = /web0s(?!.*chrome)/i.test(userAgent);
- }, { "../internals/engine-user-agent": 145 }], 145: [function(require2, module3, exports3) {
- var getBuiltIn = require2("../internals/get-built-in");
- module3.exports = getBuiltIn("navigator", "userAgent") || "";
- }, { "../internals/get-built-in": 158 }], 146: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var userAgent = require2("../internals/engine-user-agent");
- var process = global2.process;
- var Deno2 = global2.Deno;
- var versions = process && process.versions || Deno2 && Deno2.version;
- var v8 = versions && versions.v8;
- var match, version;
- if (v8) {
- match = v8.split(".");
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
- }
- if (!version && userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match)
- version = +match[1];
- }
- }
- module3.exports = version;
- }, { "../internals/engine-user-agent": 145, "../internals/global": 163 }], 147: [function(require2, module3, exports3) {
- var userAgent = require2("../internals/engine-user-agent");
- var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
- module3.exports = !!webkit && +webkit[1];
- }, { "../internals/engine-user-agent": 145 }], 148: [function(require2, module3, exports3) {
- module3.exports = [
- "constructor",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "toLocaleString",
- "toString",
- "valueOf"
- ];
- }, {}], 149: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var redefine = require2("../internals/redefine");
- var setGlobal = require2("../internals/set-global");
- var copyConstructorProperties = require2("../internals/copy-constructor-properties");
- var isForced = require2("../internals/is-forced");
- module3.exports = function(options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global2;
- } else if (STATIC) {
- target = global2[TARGET] || setGlobal(TARGET, {});
- } else {
- target = (global2[TARGET] || {}).prototype;
- }
- if (target)
- for (key in source) {
- sourceProperty = source[key];
- if (options.noTargetGet) {
- descriptor = getOwnPropertyDescriptor(target, key);
- targetProperty = descriptor && descriptor.value;
- } else
- targetProperty = target[key];
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
- if (!FORCED && targetProperty !== void 0) {
- if (typeof sourceProperty == typeof targetProperty)
- continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- if (options.sham || targetProperty && targetProperty.sham) {
- createNonEnumerableProperty(sourceProperty, "sham", true);
- }
- redefine(target, key, sourceProperty, options);
- }
- };
- }, { "../internals/copy-constructor-properties": 125, "../internals/create-non-enumerable-property": 129, "../internals/global": 163, "../internals/is-forced": 178, "../internals/object-get-own-property-descriptor": 199, "../internals/redefine": 222, "../internals/set-global": 232 }], 150: [function(require2, module3, exports3) {
- module3.exports = function(exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- }, {}], 151: [function(require2, module3, exports3) {
- "use strict";
- require2("../modules/es.regexp.exec");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var redefine = require2("../internals/redefine");
- var regexpExec = require2("../internals/regexp-exec");
- var fails = require2("../internals/fails");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var SPECIES = wellKnownSymbol("species");
- var RegExpPrototype = RegExp.prototype;
- module3.exports = function(KEY, exec, FORCED, SHAM) {
- var SYMBOL = wellKnownSymbol(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function() {
- var O = {};
- O[SYMBOL] = function() {
- return 7;
- };
- return ""[KEY](O) != 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() {
- var execCalled = false;
- var re = /a/;
- if (KEY === "split") {
- re = {};
- re.constructor = {};
- re.constructor[SPECIES] = function() {
- return re;
- };
- re.flags = "";
- re[SYMBOL] = /./[SYMBOL];
- }
- re.exec = function() {
- execCalled = true;
- return null;
- };
- re[SYMBOL]("");
- return !execCalled;
- });
- if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) {
- var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);
- var methods = exec(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
- var uncurriedNativeMethod = uncurryThis(nativeMethod);
- var $exec = regexp.exec;
- if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
- }
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
- }
- return { done: false };
- });
- redefine(String.prototype, KEY, methods[0]);
- redefine(RegExpPrototype, SYMBOL, methods[1]);
- }
- if (SHAM)
- createNonEnumerableProperty(RegExpPrototype[SYMBOL], "sham", true);
- };
- }, { "../internals/create-non-enumerable-property": 129, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/redefine": 222, "../internals/regexp-exec": 224, "../internals/well-known-symbol": 268, "../modules/es.regexp.exec": 300 }], 152: [function(require2, module3, exports3) {
- var NATIVE_BIND = require2("../internals/function-bind-native");
- var FunctionPrototype = Function.prototype;
- var apply = FunctionPrototype.apply;
- var call = FunctionPrototype.call;
- module3.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
- return call.apply(apply, arguments);
- });
- }, { "../internals/function-bind-native": 154 }], 153: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var aCallable = require2("../internals/a-callable");
- var NATIVE_BIND = require2("../internals/function-bind-native");
- var bind = uncurryThis(uncurryThis.bind);
- module3.exports = function(fn, that) {
- aCallable(fn);
- return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
- return fn.apply(that, arguments);
- };
- };
- }, { "../internals/a-callable": 95, "../internals/function-bind-native": 154, "../internals/function-uncurry-this": 157 }], 154: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- module3.exports = !fails(function() {
- var test = function() {
- }.bind();
- return typeof test != "function" || test.hasOwnProperty("prototype");
- });
- }, { "../internals/fails": 150 }], 155: [function(require2, module3, exports3) {
- var NATIVE_BIND = require2("../internals/function-bind-native");
- var call = Function.prototype.call;
- module3.exports = NATIVE_BIND ? call.bind(call) : function() {
- return call.apply(call, arguments);
- };
- }, { "../internals/function-bind-native": 154 }], 156: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var hasOwn = require2("../internals/has-own-property");
- var FunctionPrototype = Function.prototype;
- var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
- var EXISTS = hasOwn(FunctionPrototype, "name");
- var PROPER = EXISTS && function something() {
- }.name === "something";
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
- module3.exports = {
- EXISTS,
- PROPER,
- CONFIGURABLE
- };
- }, { "../internals/descriptors": 134, "../internals/has-own-property": 164 }], 157: [function(require2, module3, exports3) {
- var NATIVE_BIND = require2("../internals/function-bind-native");
- var FunctionPrototype = Function.prototype;
- var bind = FunctionPrototype.bind;
- var call = FunctionPrototype.call;
- var uncurryThis = NATIVE_BIND && bind.bind(call, call);
- module3.exports = NATIVE_BIND ? function(fn) {
- return fn && uncurryThis(fn);
- } : function(fn) {
- return fn && function() {
- return call.apply(fn, arguments);
- };
- };
- }, { "../internals/function-bind-native": 154 }], 158: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var aFunction = function(argument) {
- return isCallable(argument) ? argument : void 0;
- };
- module3.exports = function(namespace, method) {
- return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
- };
- }, { "../internals/global": 163, "../internals/is-callable": 176 }], 159: [function(require2, module3, exports3) {
- var classof = require2("../internals/classof");
- var getMethod = require2("../internals/get-method");
- var Iterators = require2("../internals/iterators");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var ITERATOR = wellKnownSymbol("iterator");
- module3.exports = function(it) {
- if (it != void 0)
- return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
- };
- }, { "../internals/classof": 124, "../internals/get-method": 161, "../internals/iterators": 187, "../internals/well-known-symbol": 268 }], 160: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var aCallable = require2("../internals/a-callable");
- var anObject = require2("../internals/an-object");
- var tryToString = require2("../internals/try-to-string");
- var getIteratorMethod = require2("../internals/get-iterator-method");
- var TypeError2 = global2.TypeError;
- module3.exports = function(argument, usingIterator) {
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
- if (aCallable(iteratorMethod))
- return anObject(call(iteratorMethod, argument));
- throw TypeError2(tryToString(argument) + " is not iterable");
- };
- }, { "../internals/a-callable": 95, "../internals/an-object": 101, "../internals/function-call": 155, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/try-to-string": 257 }], 161: [function(require2, module3, exports3) {
- var aCallable = require2("../internals/a-callable");
- module3.exports = function(V, P) {
- var func = V[P];
- return func == null ? void 0 : aCallable(func);
- };
- }, { "../internals/a-callable": 95 }], 162: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var toObject = require2("../internals/to-object");
- var floor = Math.floor;
- var charAt = uncurryThis("".charAt);
- var replace = uncurryThis("".replace);
- var stringSlice = uncurryThis("".slice);
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
- module3.exports = function(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== void 0) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return replace(replacement, symbols, function(match, ch) {
- var capture;
- switch (charAt(ch, 0)) {
- case "$":
- return "$";
- case "&":
- return matched;
- case "`":
- return stringSlice(str, 0, position);
- case "'":
- return stringSlice(str, tailPos);
- case "<":
- capture = namedCaptures[stringSlice(ch, 1, -1)];
- break;
- default:
- var n = +ch;
- if (n === 0)
- return match;
- if (n > m) {
- var f = floor(n / 10);
- if (f === 0)
- return match;
- if (f <= m)
- return captures[f - 1] === void 0 ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === void 0 ? "" : capture;
- });
- };
- }, { "../internals/function-uncurry-this": 157, "../internals/to-object": 250 }], 163: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- var check = function(it) {
- return it && it.Math == Math && it;
- };
- module3.exports = // eslint-disable-next-line es-x/no-global-this -- safe
- check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
- check(typeof self == "object" && self) || check(typeof global2 == "object" && global2) || // eslint-disable-next-line no-new-func -- fallback
- function() {
- return this;
- }() || Function("return this")();
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 164: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var toObject = require2("../internals/to-object");
- var hasOwnProperty = uncurryThis({}.hasOwnProperty);
- module3.exports = Object.hasOwn || function hasOwn(it, key) {
- return hasOwnProperty(toObject(it), key);
- };
- }, { "../internals/function-uncurry-this": 157, "../internals/to-object": 250 }], 165: [function(require2, module3, exports3) {
- module3.exports = {};
- }, {}], 166: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- module3.exports = function(a, b) {
- var console2 = global2.console;
- if (console2 && console2.error) {
- arguments.length == 1 ? console2.error(a) : console2.error(a, b);
- }
- };
- }, { "../internals/global": 163 }], 167: [function(require2, module3, exports3) {
- var getBuiltIn = require2("../internals/get-built-in");
- module3.exports = getBuiltIn("document", "documentElement");
- }, { "../internals/get-built-in": 158 }], 168: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var fails = require2("../internals/fails");
- var createElement = require2("../internals/document-create-element");
- module3.exports = !DESCRIPTORS && !fails(function() {
- return Object.defineProperty(createElement("div"), "a", {
- get: function() {
- return 7;
- }
- }).a != 7;
- });
- }, { "../internals/descriptors": 134, "../internals/document-create-element": 135, "../internals/fails": 150 }], 169: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var Array2 = global2.Array;
- var abs = Math.abs;
- var pow = Math.pow;
- var floor = Math.floor;
- var log = Math.log;
- var LN2 = Math.LN2;
- var pack = function(number, mantissaLength, bytes) {
- var buffer = Array2(bytes);
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
- var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
- var index = 0;
- var exponent, mantissa, c;
- number = abs(number);
- if (number != number || number === Infinity) {
- mantissa = number != number ? 1 : 0;
- exponent = eMax;
- } else {
- exponent = floor(log(number) / LN2);
- c = pow(2, -exponent);
- if (number * c < 1) {
- exponent--;
- c *= 2;
- }
- if (exponent + eBias >= 1) {
- number += rt / c;
- } else {
- number += rt * pow(2, 1 - eBias);
- }
- if (number * c >= 2) {
- exponent++;
- c /= 2;
- }
- if (exponent + eBias >= eMax) {
- mantissa = 0;
- exponent = eMax;
- } else if (exponent + eBias >= 1) {
- mantissa = (number * c - 1) * pow(2, mantissaLength);
- exponent = exponent + eBias;
- } else {
- mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
- exponent = 0;
- }
- }
- while (mantissaLength >= 8) {
- buffer[index++] = mantissa & 255;
- mantissa /= 256;
- mantissaLength -= 8;
- }
- exponent = exponent << mantissaLength | mantissa;
- exponentLength += mantissaLength;
- while (exponentLength > 0) {
- buffer[index++] = exponent & 255;
- exponent /= 256;
- exponentLength -= 8;
- }
- buffer[--index] |= sign * 128;
- return buffer;
- };
- var unpack = function(buffer, mantissaLength) {
- var bytes = buffer.length;
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var nBits = exponentLength - 7;
- var index = bytes - 1;
- var sign = buffer[index--];
- var exponent = sign & 127;
- var mantissa;
- sign >>= 7;
- while (nBits > 0) {
- exponent = exponent * 256 + buffer[index--];
- nBits -= 8;
- }
- mantissa = exponent & (1 << -nBits) - 1;
- exponent >>= -nBits;
- nBits += mantissaLength;
- while (nBits > 0) {
- mantissa = mantissa * 256 + buffer[index--];
- nBits -= 8;
- }
- if (exponent === 0) {
- exponent = 1 - eBias;
- } else if (exponent === eMax) {
- return mantissa ? NaN : sign ? -Infinity : Infinity;
- } else {
- mantissa = mantissa + pow(2, mantissaLength);
- exponent = exponent - eBias;
- }
- return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
- };
- module3.exports = {
- pack,
- unpack
- };
- }, { "../internals/global": 163 }], 170: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fails = require2("../internals/fails");
- var classof = require2("../internals/classof-raw");
- var Object2 = global2.Object;
- var split = uncurryThis("".split);
- module3.exports = fails(function() {
- return !Object2("z").propertyIsEnumerable(0);
- }) ? function(it) {
- return classof(it) == "String" ? split(it, "") : Object2(it);
- } : Object2;
- }, { "../internals/classof-raw": 123, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 171: [function(require2, module3, exports3) {
- var isCallable = require2("../internals/is-callable");
- var isObject = require2("../internals/is-object");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- module3.exports = function($this, dummy, Wrapper) {
- var NewTarget, NewTargetPrototype;
- if (
- // it can work only with native `setPrototypeOf`
- setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
- isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype
- )
- setPrototypeOf($this, NewTargetPrototype);
- return $this;
- };
- }, { "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/object-set-prototype-of": 208 }], 172: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var isCallable = require2("../internals/is-callable");
- var store = require2("../internals/shared-store");
- var functionToString = uncurryThis(Function.toString);
- if (!isCallable(store.inspectSource)) {
- store.inspectSource = function(it) {
- return functionToString(it);
- };
- }
- module3.exports = store.inspectSource;
- }, { "../internals/function-uncurry-this": 157, "../internals/is-callable": 176, "../internals/shared-store": 236 }], 173: [function(require2, module3, exports3) {
- var NATIVE_WEAK_MAP = require2("../internals/native-weak-map");
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var isObject = require2("../internals/is-object");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var hasOwn = require2("../internals/has-own-property");
- var shared = require2("../internals/shared-store");
- var sharedKey = require2("../internals/shared-key");
- var hiddenKeys = require2("../internals/hidden-keys");
- var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
- var TypeError2 = global2.TypeError;
- var WeakMap2 = global2.WeakMap;
- var set, get, has;
- var enforce = function(it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function(TYPE) {
- return function(it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError2("Incompatible receiver, " + TYPE + " required");
- }
- return state;
- };
- };
- if (NATIVE_WEAK_MAP || shared.state) {
- var store = shared.state || (shared.state = new WeakMap2());
- var wmget = uncurryThis(store.get);
- var wmhas = uncurryThis(store.has);
- var wmset = uncurryThis(store.set);
- set = function(it, metadata) {
- if (wmhas(store, it))
- throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- wmset(store, it, metadata);
- return metadata;
- };
- get = function(it) {
- return wmget(store, it) || {};
- };
- has = function(it) {
- return wmhas(store, it);
- };
- } else {
- var STATE = sharedKey("state");
- hiddenKeys[STATE] = true;
- set = function(it, metadata) {
- if (hasOwn(it, STATE))
- throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function(it) {
- return hasOwn(it, STATE) ? it[STATE] : {};
- };
- has = function(it) {
- return hasOwn(it, STATE);
- };
- }
- module3.exports = {
- set,
- get,
- has,
- enforce,
- getterFor
- };
- }, { "../internals/create-non-enumerable-property": 129, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/is-object": 180, "../internals/native-weak-map": 192, "../internals/shared-key": 235, "../internals/shared-store": 236 }], 174: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var Iterators = require2("../internals/iterators");
- var ITERATOR = wellKnownSymbol("iterator");
- var ArrayPrototype = Array.prototype;
- module3.exports = function(it) {
- return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- }, { "../internals/iterators": 187, "../internals/well-known-symbol": 268 }], 175: [function(require2, module3, exports3) {
- var classof = require2("../internals/classof-raw");
- module3.exports = Array.isArray || function isArray(argument) {
- return classof(argument) == "Array";
- };
- }, { "../internals/classof-raw": 123 }], 176: [function(require2, module3, exports3) {
- module3.exports = function(argument) {
- return typeof argument == "function";
- };
- }, {}], 177: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fails = require2("../internals/fails");
- var isCallable = require2("../internals/is-callable");
- var classof = require2("../internals/classof");
- var getBuiltIn = require2("../internals/get-built-in");
- var inspectSource = require2("../internals/inspect-source");
- var noop = function() {
- };
- var empty = [];
- var construct = getBuiltIn("Reflect", "construct");
- var constructorRegExp = /^\s*(?:class|function)\b/;
- var exec = uncurryThis(constructorRegExp.exec);
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
- var isConstructorModern = function isConstructor(argument) {
- if (!isCallable(argument))
- return false;
- try {
- construct(noop, empty, argument);
- return true;
- } catch (error) {
- return false;
- }
- };
- var isConstructorLegacy = function isConstructor(argument) {
- if (!isCallable(argument))
- return false;
- switch (classof(argument)) {
- case "AsyncFunction":
- case "GeneratorFunction":
- case "AsyncGeneratorFunction":
- return false;
- }
- try {
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
- } catch (error) {
- return true;
- }
- };
- isConstructorLegacy.sham = true;
- module3.exports = !construct || fails(function() {
- var called;
- return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
- called = true;
- }) || called;
- }) ? isConstructorLegacy : isConstructorModern;
- }, { "../internals/classof": 124, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/inspect-source": 172, "../internals/is-callable": 176 }], 178: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- var isCallable = require2("../internals/is-callable");
- var replacement = /#|\.prototype\./;
- var isForced = function(feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
- };
- var normalize = isForced.normalize = function(string) {
- return String(string).replace(replacement, ".").toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = "N";
- var POLYFILL = isForced.POLYFILL = "P";
- module3.exports = isForced;
- }, { "../internals/fails": 150, "../internals/is-callable": 176 }], 179: [function(require2, module3, exports3) {
- var isObject = require2("../internals/is-object");
- var floor = Math.floor;
- module3.exports = Number.isInteger || function isInteger(it) {
- return !isObject(it) && isFinite(it) && floor(it) === it;
- };
- }, { "../internals/is-object": 180 }], 180: [function(require2, module3, exports3) {
- var isCallable = require2("../internals/is-callable");
- module3.exports = function(it) {
- return typeof it == "object" ? it !== null : isCallable(it);
- };
- }, { "../internals/is-callable": 176 }], 181: [function(require2, module3, exports3) {
- module3.exports = false;
- }, {}], 182: [function(require2, module3, exports3) {
- var isObject = require2("../internals/is-object");
- var classof = require2("../internals/classof-raw");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var MATCH = wellKnownSymbol("match");
- module3.exports = function(it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== void 0 ? !!isRegExp : classof(it) == "RegExp");
- };
- }, { "../internals/classof-raw": 123, "../internals/is-object": 180, "../internals/well-known-symbol": 268 }], 183: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var getBuiltIn = require2("../internals/get-built-in");
- var isCallable = require2("../internals/is-callable");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var USE_SYMBOL_AS_UID = require2("../internals/use-symbol-as-uid");
- var Object2 = global2.Object;
- module3.exports = USE_SYMBOL_AS_UID ? function(it) {
- return typeof it == "symbol";
- } : function(it) {
- var $Symbol = getBuiltIn("Symbol");
- return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object2(it));
- };
- }, { "../internals/get-built-in": 158, "../internals/global": 163, "../internals/is-callable": 176, "../internals/object-is-prototype-of": 204, "../internals/use-symbol-as-uid": 264 }], 184: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var bind = require2("../internals/function-bind-context");
- var call = require2("../internals/function-call");
- var anObject = require2("../internals/an-object");
- var tryToString = require2("../internals/try-to-string");
- var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var getIterator = require2("../internals/get-iterator");
- var getIteratorMethod = require2("../internals/get-iterator-method");
- var iteratorClose = require2("../internals/iterator-close");
- var TypeError2 = global2.TypeError;
- var Result = function(stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- var ResultPrototype = Result.prototype;
- module3.exports = function(iterable, unboundFunction, options) {
- var that = options && options.that;
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
- var INTERRUPTED = !!(options && options.INTERRUPTED);
- var fn = bind(unboundFunction, that);
- var iterator, iterFn, index, length, result, next, step;
- var stop = function(condition) {
- if (iterator)
- iteratorClose(iterator, "normal", condition);
- return new Result(true, condition);
- };
- var callFn = function(value) {
- if (AS_ENTRIES) {
- anObject(value);
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
- }
- return INTERRUPTED ? fn(value, stop) : fn(value);
- };
- if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (!iterFn)
- throw TypeError2(tryToString(iterable) + " is not iterable");
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
- result = callFn(iterable[index]);
- if (result && isPrototypeOf(ResultPrototype, result))
- return result;
- }
- return new Result(false);
- }
- iterator = getIterator(iterable, iterFn);
- }
- next = iterator.next;
- while (!(step = call(next, iterator)).done) {
- try {
- result = callFn(step.value);
- } catch (error) {
- iteratorClose(iterator, "throw", error);
- }
- if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
- return result;
- }
- return new Result(false);
- };
- }, { "../internals/an-object": 101, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/is-array-iterator-method": 174, "../internals/iterator-close": 185, "../internals/length-of-array-like": 188, "../internals/object-is-prototype-of": 204, "../internals/try-to-string": 257 }], 185: [function(require2, module3, exports3) {
- var call = require2("../internals/function-call");
- var anObject = require2("../internals/an-object");
- var getMethod = require2("../internals/get-method");
- module3.exports = function(iterator, kind, value) {
- var innerResult, innerError;
- anObject(iterator);
- try {
- innerResult = getMethod(iterator, "return");
- if (!innerResult) {
- if (kind === "throw")
- throw value;
- return value;
- }
- innerResult = call(innerResult, iterator);
- } catch (error) {
- innerError = true;
- innerResult = error;
- }
- if (kind === "throw")
- throw value;
- if (innerError)
- throw innerResult;
- anObject(innerResult);
- return value;
- };
- }, { "../internals/an-object": 101, "../internals/function-call": 155, "../internals/get-method": 161 }], 186: [function(require2, module3, exports3) {
- "use strict";
- var fails = require2("../internals/fails");
- var isCallable = require2("../internals/is-callable");
- var create = require2("../internals/object-create");
- var getPrototypeOf = require2("../internals/object-get-prototype-of");
- var redefine = require2("../internals/redefine");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var IS_PURE = require2("../internals/is-pure");
- var ITERATOR = wellKnownSymbol("iterator");
- var BUGGY_SAFARI_ITERATORS = false;
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- if ([].keys) {
- arrayIterator = [].keys();
- if (!("next" in arrayIterator))
- BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
- IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == void 0 || fails(function() {
- var test = {};
- return IteratorPrototype[ITERATOR].call(test) !== test;
- });
- if (NEW_ITERATOR_PROTOTYPE)
- IteratorPrototype = {};
- else if (IS_PURE)
- IteratorPrototype = create(IteratorPrototype);
- if (!isCallable(IteratorPrototype[ITERATOR])) {
- redefine(IteratorPrototype, ITERATOR, function() {
- return this;
- });
- }
- module3.exports = {
- IteratorPrototype,
- BUGGY_SAFARI_ITERATORS
- };
- }, { "../internals/fails": 150, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/object-create": 196, "../internals/object-get-prototype-of": 203, "../internals/redefine": 222, "../internals/well-known-symbol": 268 }], 187: [function(require2, module3, exports3) {
- arguments[4][165][0].apply(exports3, arguments);
- }, { "dup": 165 }], 188: [function(require2, module3, exports3) {
- var toLength = require2("../internals/to-length");
- module3.exports = function(obj) {
- return toLength(obj.length);
- };
- }, { "../internals/to-length": 249 }], 189: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var bind = require2("../internals/function-bind-context");
- var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
- var macrotask = require2("../internals/task").set;
- var IS_IOS = require2("../internals/engine-is-ios");
- var IS_IOS_PEBBLE = require2("../internals/engine-is-ios-pebble");
- var IS_WEBOS_WEBKIT = require2("../internals/engine-is-webos-webkit");
- var IS_NODE = require2("../internals/engine-is-node");
- var MutationObserver = global2.MutationObserver || global2.WebKitMutationObserver;
- var document2 = global2.document;
- var process = global2.process;
- var Promise2 = global2.Promise;
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global2, "queueMicrotask");
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
- var flush, head, last, notify, toggle, node, promise, then;
- if (!queueMicrotask) {
- flush = function() {
- var parent, fn;
- if (IS_NODE && (parent = process.domain))
- parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (error) {
- if (head)
- notify();
- else
- last = void 0;
- throw error;
- }
- }
- last = void 0;
- if (parent)
- parent.enter();
- };
- if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document2) {
- toggle = true;
- node = document2.createTextNode("");
- new MutationObserver(flush).observe(node, { characterData: true });
- notify = function() {
- node.data = toggle = !toggle;
- };
- } else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
- promise = Promise2.resolve(void 0);
- promise.constructor = Promise2;
- then = bind(promise.then, promise);
- notify = function() {
- then(flush);
- };
- } else if (IS_NODE) {
- notify = function() {
- process.nextTick(flush);
- };
- } else {
- macrotask = bind(macrotask, global2);
- notify = function() {
- macrotask(flush);
- };
- }
- }
- module3.exports = queueMicrotask || function(fn) {
- var task = { fn, next: void 0 };
- if (last)
- last.next = task;
- if (!head) {
- head = task;
- notify();
- }
- last = task;
- };
- }, { "../internals/engine-is-ios": 142, "../internals/engine-is-ios-pebble": 141, "../internals/engine-is-node": 143, "../internals/engine-is-webos-webkit": 144, "../internals/function-bind-context": 153, "../internals/global": 163, "../internals/object-get-own-property-descriptor": 199, "../internals/task": 243 }], 190: [function(require2, module3, exports3) {
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- module3.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor;
- }, { "../internals/native-symbol": 191 }], 191: [function(require2, module3, exports3) {
- var V8_VERSION = require2("../internals/engine-v8-version");
- var fails = require2("../internals/fails");
- module3.exports = !!Object.getOwnPropertySymbols && !fails(function() {
- var symbol = Symbol();
- return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
- });
- }, { "../internals/engine-v8-version": 146, "../internals/fails": 150 }], 192: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var inspectSource = require2("../internals/inspect-source");
- var WeakMap2 = global2.WeakMap;
- module3.exports = isCallable(WeakMap2) && /native code/.test(inspectSource(WeakMap2));
- }, { "../internals/global": 163, "../internals/inspect-source": 172, "../internals/is-callable": 176 }], 193: [function(require2, module3, exports3) {
- "use strict";
- var aCallable = require2("../internals/a-callable");
- var PromiseCapability = function(C) {
- var resolve, reject;
- this.promise = new C(function($$resolve, $$reject) {
- if (resolve !== void 0 || reject !== void 0)
- throw TypeError("Bad Promise constructor");
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aCallable(resolve);
- this.reject = aCallable(reject);
- };
- module3.exports.f = function(C) {
- return new PromiseCapability(C);
- };
- }, { "../internals/a-callable": 95 }], 194: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isRegExp = require2("../internals/is-regexp");
- var TypeError2 = global2.TypeError;
- module3.exports = function(it) {
- if (isRegExp(it)) {
- throw TypeError2("The method doesn't accept regular expressions");
- }
- return it;
- };
- }, { "../internals/global": 163, "../internals/is-regexp": 182 }], 195: [function(require2, module3, exports3) {
- "use strict";
- var DESCRIPTORS = require2("../internals/descriptors");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var call = require2("../internals/function-call");
- var fails = require2("../internals/fails");
- var objectKeys = require2("../internals/object-keys");
- var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
- var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
- var toObject = require2("../internals/to-object");
- var IndexedObject = require2("../internals/indexed-object");
- var $assign = Object.assign;
- var defineProperty = Object.defineProperty;
- var concat = uncurryThis([].concat);
- module3.exports = !$assign || fails(function() {
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, "a", {
- enumerable: true,
- get: function() {
- defineProperty(this, "b", {
- value: 3,
- enumerable: false
- });
- }
- }), { b: 2 })).b !== 1)
- return true;
- var A = {};
- var B = {};
- var symbol = Symbol();
- var alphabet = "abcdefghijklmnopqrst";
- A[symbol] = 7;
- alphabet.split("").forEach(function(chr) {
- B[chr] = chr;
- });
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join("") != alphabet;
- }) ? function assign(target, source) {
- var T = toObject(target);
- var argumentsLength = arguments.length;
- var index = 1;
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
- while (argumentsLength > index) {
- var S = IndexedObject(arguments[index++]);
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key))
- T[key] = S[key];
- }
- }
- return T;
- } : $assign;
- }, { "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/object-get-own-property-symbols": 202, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/to-object": 250 }], 196: [function(require2, module3, exports3) {
- var anObject = require2("../internals/an-object");
- var definePropertiesModule = require2("../internals/object-define-properties");
- var enumBugKeys = require2("../internals/enum-bug-keys");
- var hiddenKeys = require2("../internals/hidden-keys");
- var html = require2("../internals/html");
- var documentCreateElement = require2("../internals/document-create-element");
- var sharedKey = require2("../internals/shared-key");
- var GT = ">";
- var LT = "<";
- var PROTOTYPE = "prototype";
- var SCRIPT = "script";
- var IE_PROTO = sharedKey("IE_PROTO");
- var EmptyConstructor = function() {
- };
- var scriptTag = function(content) {
- return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
- };
- var NullProtoObjectViaActiveX = function(activeXDocument2) {
- activeXDocument2.write(scriptTag(""));
- activeXDocument2.close();
- var temp = activeXDocument2.parentWindow.Object;
- activeXDocument2 = null;
- return temp;
- };
- var NullProtoObjectViaIFrame = function() {
- var iframe = documentCreateElement("iframe");
- var JS = "java" + SCRIPT + ":";
- var iframeDocument;
- iframe.style.display = "none";
- html.appendChild(iframe);
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag("document.F=Object"));
- iframeDocument.close();
- return iframeDocument.F;
- };
- var activeXDocument;
- var NullProtoObject = function() {
- try {
- activeXDocument = new ActiveXObject("htmlfile");
- } catch (error) {
- }
- NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
- var length = enumBugKeys.length;
- while (length--)
- delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- module3.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- result[IE_PROTO] = O;
- } else
- result = NullProtoObject();
- return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
- };
- }, { "../internals/an-object": 101, "../internals/document-create-element": 135, "../internals/enum-bug-keys": 148, "../internals/hidden-keys": 165, "../internals/html": 167, "../internals/object-define-properties": 197, "../internals/shared-key": 235 }], 197: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var V8_PROTOTYPE_DEFINE_BUG = require2("../internals/v8-prototype-define-bug");
- var definePropertyModule = require2("../internals/object-define-property");
- var anObject = require2("../internals/an-object");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var objectKeys = require2("../internals/object-keys");
- exports3.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var props = toIndexedObject(Properties);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index)
- definePropertyModule.f(O, key = keys[index++], props[key]);
- return O;
- };
- }, { "../internals/an-object": 101, "../internals/descriptors": 134, "../internals/object-define-property": 198, "../internals/object-keys": 206, "../internals/to-indexed-object": 247, "../internals/v8-prototype-define-bug": 265 }], 198: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var DESCRIPTORS = require2("../internals/descriptors");
- var IE8_DOM_DEFINE = require2("../internals/ie8-dom-define");
- var V8_PROTOTYPE_DEFINE_BUG = require2("../internals/v8-prototype-define-bug");
- var anObject = require2("../internals/an-object");
- var toPropertyKey = require2("../internals/to-property-key");
- var TypeError2 = global2.TypeError;
- var $defineProperty = Object.defineProperty;
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var ENUMERABLE = "enumerable";
- var CONFIGURABLE = "configurable";
- var WRITABLE = "writable";
- exports3.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
- var current = $getOwnPropertyDescriptor(O, P);
- if (current && current[WRITABLE]) {
- O[P] = Attributes.value;
- Attributes = {
- configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
- writable: false
- };
- }
- }
- return $defineProperty(O, P, Attributes);
- } : $defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (IE8_DOM_DEFINE)
- try {
- return $defineProperty(O, P, Attributes);
- } catch (error) {
- }
- if ("get" in Attributes || "set" in Attributes)
- throw TypeError2("Accessors not supported");
- if ("value" in Attributes)
- O[P] = Attributes.value;
- return O;
- };
- }, { "../internals/an-object": 101, "../internals/descriptors": 134, "../internals/global": 163, "../internals/ie8-dom-define": 168, "../internals/to-property-key": 254, "../internals/v8-prototype-define-bug": 265 }], 199: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var call = require2("../internals/function-call");
- var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var toPropertyKey = require2("../internals/to-property-key");
- var hasOwn = require2("../internals/has-own-property");
- var IE8_DOM_DEFINE = require2("../internals/ie8-dom-define");
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- exports3.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPropertyKey(P);
- if (IE8_DOM_DEFINE)
- try {
- return $getOwnPropertyDescriptor(O, P);
- } catch (error) {
- }
- if (hasOwn(O, P))
- return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
- };
- }, { "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/function-call": 155, "../internals/has-own-property": 164, "../internals/ie8-dom-define": 168, "../internals/object-property-is-enumerable": 207, "../internals/to-indexed-object": 247, "../internals/to-property-key": 254 }], 200: [function(require2, module3, exports3) {
- var classof = require2("../internals/classof-raw");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var $getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
- var arraySlice = require2("../internals/array-slice-simple");
- var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function(it) {
- try {
- return $getOwnPropertyNames(it);
- } catch (error) {
- return arraySlice(windowNames);
- }
- };
- module3.exports.f = function getOwnPropertyNames(it) {
- return windowNames && classof(it) == "Window" ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it));
- };
- }, { "../internals/array-slice-simple": 116, "../internals/classof-raw": 123, "../internals/object-get-own-property-names": 201, "../internals/to-indexed-object": 247 }], 201: [function(require2, module3, exports3) {
- var internalObjectKeys = require2("../internals/object-keys-internal");
- var enumBugKeys = require2("../internals/enum-bug-keys");
- var hiddenKeys = enumBugKeys.concat("length", "prototype");
- exports3.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- }, { "../internals/enum-bug-keys": 148, "../internals/object-keys-internal": 205 }], 202: [function(require2, module3, exports3) {
- exports3.f = Object.getOwnPropertySymbols;
- }, {}], 203: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var hasOwn = require2("../internals/has-own-property");
- var isCallable = require2("../internals/is-callable");
- var toObject = require2("../internals/to-object");
- var sharedKey = require2("../internals/shared-key");
- var CORRECT_PROTOTYPE_GETTER = require2("../internals/correct-prototype-getter");
- var IE_PROTO = sharedKey("IE_PROTO");
- var Object2 = global2.Object;
- var ObjectPrototype = Object2.prototype;
- module3.exports = CORRECT_PROTOTYPE_GETTER ? Object2.getPrototypeOf : function(O) {
- var object = toObject(O);
- if (hasOwn(object, IE_PROTO))
- return object[IE_PROTO];
- var constructor = object.constructor;
- if (isCallable(constructor) && object instanceof constructor) {
- return constructor.prototype;
- }
- return object instanceof Object2 ? ObjectPrototype : null;
- };
- }, { "../internals/correct-prototype-getter": 127, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/shared-key": 235, "../internals/to-object": 250 }], 204: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- module3.exports = uncurryThis({}.isPrototypeOf);
- }, { "../internals/function-uncurry-this": 157 }], 205: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var hasOwn = require2("../internals/has-own-property");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var indexOf = require2("../internals/array-includes").indexOf;
- var hiddenKeys = require2("../internals/hidden-keys");
- var push = uncurryThis([].push);
- module3.exports = function(object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O)
- !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
- while (names.length > i)
- if (hasOwn(O, key = names[i++])) {
- ~indexOf(result, key) || push(result, key);
- }
- return result;
- };
- }, { "../internals/array-includes": 110, "../internals/function-uncurry-this": 157, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/to-indexed-object": 247 }], 206: [function(require2, module3, exports3) {
- var internalObjectKeys = require2("../internals/object-keys-internal");
- var enumBugKeys = require2("../internals/enum-bug-keys");
- module3.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- }, { "../internals/enum-bug-keys": 148, "../internals/object-keys-internal": 205 }], 207: [function(require2, module3, exports3) {
- "use strict";
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
- exports3.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : $propertyIsEnumerable;
- }, {}], 208: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var anObject = require2("../internals/an-object");
- var aPossiblePrototype = require2("../internals/a-possible-prototype");
- module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
- var CORRECT_SETTER = false;
- var test = {};
- var setter;
- try {
- setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set);
- setter(test, []);
- CORRECT_SETTER = test instanceof Array;
- } catch (error) {
- }
- return function setPrototypeOf(O, proto) {
- anObject(O);
- aPossiblePrototype(proto);
- if (CORRECT_SETTER)
- setter(O, proto);
- else
- O.__proto__ = proto;
- return O;
- };
- }() : void 0);
- }, { "../internals/a-possible-prototype": 97, "../internals/an-object": 101, "../internals/function-uncurry-this": 157 }], 209: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var objectKeys = require2("../internals/object-keys");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var $propertyIsEnumerable = require2("../internals/object-property-is-enumerable").f;
- var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
- var push = uncurryThis([].push);
- var createMethod = function(TO_ENTRIES) {
- return function(it) {
- var O = toIndexedObject(it);
- var keys = objectKeys(O);
- var length = keys.length;
- var i = 0;
- var result = [];
- var key;
- while (length > i) {
- key = keys[i++];
- if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
- push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
- }
- }
- return result;
- };
- };
- module3.exports = {
- // `Object.entries` method
- // https://tc39.es/ecma262/#sec-object.entries
- entries: createMethod(true),
- // `Object.values` method
- // https://tc39.es/ecma262/#sec-object.values
- values: createMethod(false)
- };
- }, { "../internals/descriptors": 134, "../internals/function-uncurry-this": 157, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/to-indexed-object": 247 }], 210: [function(require2, module3, exports3) {
- "use strict";
- var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
- var classof = require2("../internals/classof");
- module3.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
- return "[object " + classof(this) + "]";
- };
- }, { "../internals/classof": 124, "../internals/to-string-tag-support": 255 }], 211: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var isCallable = require2("../internals/is-callable");
- var isObject = require2("../internals/is-object");
- var TypeError2 = global2.TypeError;
- module3.exports = function(input, pref) {
- var fn, val;
- if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
- return val;
- if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
- return val;
- if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
- return val;
- throw TypeError2("Can't convert object to primitive value");
- };
- }, { "../internals/function-call": 155, "../internals/global": 163, "../internals/is-callable": 176, "../internals/is-object": 180 }], 212: [function(require2, module3, exports3) {
- var getBuiltIn = require2("../internals/get-built-in");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var getOwnPropertyNamesModule = require2("../internals/object-get-own-property-names");
- var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
- var anObject = require2("../internals/an-object");
- var concat = uncurryThis([].concat);
- module3.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
- };
- }, { "../internals/an-object": 101, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/object-get-own-property-names": 201, "../internals/object-get-own-property-symbols": 202 }], 213: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- module3.exports = global2;
- }, { "../internals/global": 163 }], 214: [function(require2, module3, exports3) {
- module3.exports = function(exec) {
- try {
- return { error: false, value: exec() };
- } catch (error) {
- return { error: true, value: error };
- }
- };
- }, {}], 215: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var NativePromiseConstructor = require2("../internals/promise-native-constructor");
- var isCallable = require2("../internals/is-callable");
- var isForced = require2("../internals/is-forced");
- var inspectSource = require2("../internals/inspect-source");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var IS_BROWSER = require2("../internals/engine-is-browser");
- var IS_PURE = require2("../internals/is-pure");
- var V8_VERSION = require2("../internals/engine-v8-version");
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var SPECIES = wellKnownSymbol("species");
- var SUBCLASSING = false;
- var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global2.PromiseRejectionEvent);
- var FORCED_PROMISE_CONSTRUCTOR = isForced("Promise", function() {
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
- return true;
- if (IS_PURE && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"]))
- return true;
- if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE))
- return false;
- var promise = new NativePromiseConstructor(function(resolve) {
- resolve(1);
- });
- var FakePromise = function(exec) {
- exec(function() {
- }, function() {
- });
- };
- var constructor = promise.constructor = {};
- constructor[SPECIES] = FakePromise;
- SUBCLASSING = promise.then(function() {
- }) instanceof FakePromise;
- if (!SUBCLASSING)
- return true;
- return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
- });
- module3.exports = {
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
- SUBCLASSING
- };
- }, { "../internals/engine-is-browser": 139, "../internals/engine-v8-version": 146, "../internals/global": 163, "../internals/inspect-source": 172, "../internals/is-callable": 176, "../internals/is-forced": 178, "../internals/is-pure": 181, "../internals/promise-native-constructor": 216, "../internals/well-known-symbol": 268 }], 216: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- module3.exports = global2.Promise;
- }, { "../internals/global": 163 }], 217: [function(require2, module3, exports3) {
- var anObject = require2("../internals/an-object");
- var isObject = require2("../internals/is-object");
- var newPromiseCapability = require2("../internals/new-promise-capability");
- module3.exports = function(C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C)
- return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- }, { "../internals/an-object": 101, "../internals/is-object": 180, "../internals/new-promise-capability": 193 }], 218: [function(require2, module3, exports3) {
- var NativePromiseConstructor = require2("../internals/promise-native-constructor");
- var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
- var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
- module3.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function(iterable) {
- NativePromiseConstructor.all(iterable).then(void 0, function() {
- });
- });
- }, { "../internals/check-correctness-of-iteration": 122, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216 }], 219: [function(require2, module3, exports3) {
- var defineProperty = require2("../internals/object-define-property").f;
- module3.exports = function(Target, Source, key) {
- key in Target || defineProperty(Target, key, {
- configurable: true,
- get: function() {
- return Source[key];
- },
- set: function(it) {
- Source[key] = it;
- }
- });
- };
- }, { "../internals/object-define-property": 198 }], 220: [function(require2, module3, exports3) {
- var Queue = function() {
- this.head = null;
- this.tail = null;
- };
- Queue.prototype = {
- add: function(item) {
- var entry = { item, next: null };
- if (this.head)
- this.tail.next = entry;
- else
- this.head = entry;
- this.tail = entry;
- },
- get: function() {
- var entry = this.head;
- if (entry) {
- this.head = entry.next;
- if (this.tail === entry)
- this.tail = null;
- return entry.item;
- }
- }
- };
- module3.exports = Queue;
- }, {}], 221: [function(require2, module3, exports3) {
- var redefine = require2("../internals/redefine");
- module3.exports = function(target, src, options) {
- for (var key in src)
- redefine(target, key, src[key], options);
- return target;
- };
- }, { "../internals/redefine": 222 }], 222: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var isCallable = require2("../internals/is-callable");
- var hasOwn = require2("../internals/has-own-property");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var setGlobal = require2("../internals/set-global");
- var inspectSource = require2("../internals/inspect-source");
- var InternalStateModule = require2("../internals/internal-state");
- var CONFIGURABLE_FUNCTION_NAME = require2("../internals/function-name").CONFIGURABLE;
- var getInternalState = InternalStateModule.get;
- var enforceInternalState = InternalStateModule.enforce;
- var TEMPLATE = String(String).split("String");
- (module3.exports = function(O, key, value, options) {
- var unsafe = options ? !!options.unsafe : false;
- var simple = options ? !!options.enumerable : false;
- var noTargetGet = options ? !!options.noTargetGet : false;
- var name = options && options.name !== void 0 ? options.name : key;
- var state;
- if (isCallable(value)) {
- if (String(name).slice(0, 7) === "Symbol(") {
- name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
- }
- if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
- createNonEnumerableProperty(value, "name", name);
- }
- state = enforceInternalState(value);
- if (!state.source) {
- state.source = TEMPLATE.join(typeof name == "string" ? name : "");
- }
- }
- if (O === global2) {
- if (simple)
- O[key] = value;
- else
- setGlobal(key, value);
- return;
- } else if (!unsafe) {
- delete O[key];
- } else if (!noTargetGet && O[key]) {
- simple = true;
- }
- if (simple)
- O[key] = value;
- else
- createNonEnumerableProperty(O, key, value);
- })(Function.prototype, "toString", function toString() {
- return isCallable(this) && getInternalState(this).source || inspectSource(this);
- });
- }, { "../internals/create-non-enumerable-property": 129, "../internals/function-name": 156, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inspect-source": 172, "../internals/internal-state": 173, "../internals/is-callable": 176, "../internals/set-global": 232 }], 223: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var anObject = require2("../internals/an-object");
- var isCallable = require2("../internals/is-callable");
- var classof = require2("../internals/classof-raw");
- var regexpExec = require2("../internals/regexp-exec");
- var TypeError2 = global2.TypeError;
- module3.exports = function(R, S) {
- var exec = R.exec;
- if (isCallable(exec)) {
- var result = call(exec, R, S);
- if (result !== null)
- anObject(result);
- return result;
- }
- if (classof(R) === "RegExp")
- return call(regexpExec, R, S);
- throw TypeError2("RegExp#exec called on incompatible receiver");
- };
- }, { "../internals/an-object": 101, "../internals/classof-raw": 123, "../internals/function-call": 155, "../internals/global": 163, "../internals/is-callable": 176, "../internals/regexp-exec": 224 }], 224: [function(require2, module3, exports3) {
- "use strict";
- var call = require2("../internals/function-call");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var toString = require2("../internals/to-string");
- var regexpFlags = require2("../internals/regexp-flags");
- var stickyHelpers = require2("../internals/regexp-sticky-helpers");
- var shared = require2("../internals/shared");
- var create = require2("../internals/object-create");
- var getInternalState = require2("../internals/internal-state").get;
- var UNSUPPORTED_DOT_ALL = require2("../internals/regexp-unsupported-dot-all");
- var UNSUPPORTED_NCG = require2("../internals/regexp-unsupported-ncg");
- var nativeReplace = shared("native-string-replace", String.prototype.replace);
- var nativeExec = RegExp.prototype.exec;
- var patchedExec = nativeExec;
- var charAt = uncurryThis("".charAt);
- var indexOf = uncurryThis("".indexOf);
- var replace = uncurryThis("".replace);
- var stringSlice = uncurryThis("".slice);
- var UPDATES_LAST_INDEX_WRONG = function() {
- var re1 = /a/;
- var re2 = /b*/g;
- call(nativeExec, re1, "a");
- call(nativeExec, re2, "a");
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
- }();
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
- var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
- if (PATCH) {
- patchedExec = function exec(string) {
- var re = this;
- var state = getInternalState(re);
- var str = toString(string);
- var raw = state.raw;
- var result, reCopy, lastIndex, match, i, object, group;
- if (raw) {
- raw.lastIndex = re.lastIndex;
- result = call(patchedExec, raw, str);
- re.lastIndex = raw.lastIndex;
- return result;
- }
- var groups = state.groups;
- var sticky = UNSUPPORTED_Y && re.sticky;
- var flags = call(regexpFlags, re);
- var source = re.source;
- var charsAdded = 0;
- var strCopy = str;
- if (sticky) {
- flags = replace(flags, "y", "");
- if (indexOf(flags, "g") === -1) {
- flags += "g";
- }
- strCopy = stringSlice(str, re.lastIndex);
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== "\n")) {
- source = "(?: " + source + ")";
- strCopy = " " + strCopy;
- charsAdded++;
- }
- reCopy = new RegExp("^(?:" + source + ")", flags);
- }
- if (NPCG_INCLUDED) {
- reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
- }
- if (UPDATES_LAST_INDEX_WRONG)
- lastIndex = re.lastIndex;
- match = call(nativeExec, sticky ? reCopy : re, strCopy);
- if (sticky) {
- if (match) {
- match.input = stringSlice(match.input, charsAdded);
- match[0] = stringSlice(match[0], charsAdded);
- match.index = re.lastIndex;
- re.lastIndex += match[0].length;
- } else
- re.lastIndex = 0;
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- call(nativeReplace, match[0], reCopy, function() {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === void 0)
- match[i] = void 0;
- }
- });
- }
- if (match && groups) {
- match.groups = object = create(null);
- for (i = 0; i < groups.length; i++) {
- group = groups[i];
- object[group[0]] = match[group[1]];
- }
- }
- return match;
- };
- }
- module3.exports = patchedExec;
- }, { "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/internal-state": 173, "../internals/object-create": 196, "../internals/regexp-flags": 225, "../internals/regexp-sticky-helpers": 227, "../internals/regexp-unsupported-dot-all": 228, "../internals/regexp-unsupported-ncg": 229, "../internals/shared": 237, "../internals/to-string": 256 }], 225: [function(require2, module3, exports3) {
- "use strict";
- var anObject = require2("../internals/an-object");
- module3.exports = function() {
- var that = anObject(this);
- var result = "";
- if (that.hasIndices)
- result += "d";
- if (that.global)
- result += "g";
- if (that.ignoreCase)
- result += "i";
- if (that.multiline)
- result += "m";
- if (that.dotAll)
- result += "s";
- if (that.unicode)
- result += "u";
- if (that.sticky)
- result += "y";
- return result;
- };
- }, { "../internals/an-object": 101 }], 226: [function(require2, module3, exports3) {
- var call = require2("../internals/function-call");
- var hasOwn = require2("../internals/has-own-property");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var regExpFlags = require2("../internals/regexp-flags");
- var RegExpPrototype = RegExp.prototype;
- module3.exports = function(R) {
- var flags = R.flags;
- return flags === void 0 && !("flags" in RegExpPrototype) && !hasOwn(R, "flags") && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags;
- };
- }, { "../internals/function-call": 155, "../internals/has-own-property": 164, "../internals/object-is-prototype-of": 204, "../internals/regexp-flags": 225 }], 227: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- var global2 = require2("../internals/global");
- var $RegExp = global2.RegExp;
- var UNSUPPORTED_Y = fails(function() {
- var re = $RegExp("a", "y");
- re.lastIndex = 2;
- return re.exec("abcd") != null;
- });
- var MISSED_STICKY = UNSUPPORTED_Y || fails(function() {
- return !$RegExp("a", "y").sticky;
- });
- var BROKEN_CARET = UNSUPPORTED_Y || fails(function() {
- var re = $RegExp("^r", "gy");
- re.lastIndex = 2;
- return re.exec("str") != null;
- });
- module3.exports = {
- BROKEN_CARET,
- MISSED_STICKY,
- UNSUPPORTED_Y
- };
- }, { "../internals/fails": 150, "../internals/global": 163 }], 228: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- var global2 = require2("../internals/global");
- var $RegExp = global2.RegExp;
- module3.exports = fails(function() {
- var re = $RegExp(".", "s");
- return !(re.dotAll && re.exec("\n") && re.flags === "s");
- });
- }, { "../internals/fails": 150, "../internals/global": 163 }], 229: [function(require2, module3, exports3) {
- var fails = require2("../internals/fails");
- var global2 = require2("../internals/global");
- var $RegExp = global2.RegExp;
- module3.exports = fails(function() {
- var re = $RegExp("(?<a>b)", "g");
- return re.exec("b").groups.a !== "b" || "b".replace(re, "$<a>c") !== "bc";
- });
- }, { "../internals/fails": 150, "../internals/global": 163 }], 230: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var TypeError2 = global2.TypeError;
- module3.exports = function(it) {
- if (it == void 0)
- throw TypeError2("Can't call method on " + it);
- return it;
- };
- }, { "../internals/global": 163 }], 231: [function(require2, module3, exports3) {
- module3.exports = Object.is || function is(x, y) {
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
- };
- }, {}], 232: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var defineProperty = Object.defineProperty;
- module3.exports = function(key, value) {
- try {
- defineProperty(global2, key, { value, configurable: true, writable: true });
- } catch (error) {
- global2[key] = value;
- }
- return value;
- };
- }, { "../internals/global": 163 }], 233: [function(require2, module3, exports3) {
- "use strict";
- var getBuiltIn = require2("../internals/get-built-in");
- var definePropertyModule = require2("../internals/object-define-property");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var DESCRIPTORS = require2("../internals/descriptors");
- var SPECIES = wellKnownSymbol("species");
- module3.exports = function(CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- var defineProperty = definePropertyModule.f;
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineProperty(Constructor, SPECIES, {
- configurable: true,
- get: function() {
- return this;
- }
- });
- }
- };
- }, { "../internals/descriptors": 134, "../internals/get-built-in": 158, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 234: [function(require2, module3, exports3) {
- var defineProperty = require2("../internals/object-define-property").f;
- var hasOwn = require2("../internals/has-own-property");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- module3.exports = function(target, TAG, STATIC) {
- if (target && !STATIC)
- target = target.prototype;
- if (target && !hasOwn(target, TO_STRING_TAG)) {
- defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- };
- }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 235: [function(require2, module3, exports3) {
- var shared = require2("../internals/shared");
- var uid = require2("../internals/uid");
- var keys = shared("keys");
- module3.exports = function(key) {
- return keys[key] || (keys[key] = uid(key));
- };
- }, { "../internals/shared": 237, "../internals/uid": 263 }], 236: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var setGlobal = require2("../internals/set-global");
- var SHARED = "__core-js_shared__";
- var store = global2[SHARED] || setGlobal(SHARED, {});
- module3.exports = store;
- }, { "../internals/global": 163, "../internals/set-global": 232 }], 237: [function(require2, module3, exports3) {
- var IS_PURE = require2("../internals/is-pure");
- var store = require2("../internals/shared-store");
- (module3.exports = function(key, value) {
- return store[key] || (store[key] = value !== void 0 ? value : {});
- })("versions", []).push({
- version: "3.22.1",
- mode: IS_PURE ? "pure" : "global",
- copyright: "© 2014-2022 Denis Pushkarev (zloirock.ru)",
- license: "https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE",
- source: "https://github.com/zloirock/core-js"
- });
- }, { "../internals/is-pure": 181, "../internals/shared-store": 236 }], 238: [function(require2, module3, exports3) {
- var anObject = require2("../internals/an-object");
- var aConstructor = require2("../internals/a-constructor");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var SPECIES = wellKnownSymbol("species");
- module3.exports = function(O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === void 0 || (S = anObject(C)[SPECIES]) == void 0 ? defaultConstructor : aConstructor(S);
- };
- }, { "../internals/a-constructor": 96, "../internals/an-object": 101, "../internals/well-known-symbol": 268 }], 239: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var toString = require2("../internals/to-string");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var charAt = uncurryThis("".charAt);
- var charCodeAt = uncurryThis("".charCodeAt);
- var stringSlice = uncurryThis("".slice);
- var createMethod = function(CONVERT_TO_STRING) {
- return function($this, pos) {
- var S = toString(requireObjectCoercible($this));
- var position = toIntegerOrInfinity(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size)
- return CONVERT_TO_STRING ? "" : void 0;
- first = charCodeAt(S, position);
- return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
- };
- };
- module3.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- }, { "../internals/function-uncurry-this": 157, "../internals/require-object-coercible": 230, "../internals/to-integer-or-infinity": 248, "../internals/to-string": 256 }], 240: [function(require2, module3, exports3) {
- var PROPER_FUNCTION_NAME = require2("../internals/function-name").PROPER;
- var fails = require2("../internals/fails");
- var whitespaces = require2("../internals/whitespaces");
- var non = "
";
- module3.exports = function(METHOD_NAME) {
- return fails(function() {
- return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
- });
- };
- }, { "../internals/fails": 150, "../internals/function-name": 156, "../internals/whitespaces": 269 }], 241: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var toString = require2("../internals/to-string");
- var whitespaces = require2("../internals/whitespaces");
- var replace = uncurryThis("".replace);
- var whitespace = "[" + whitespaces + "]";
- var ltrim = RegExp("^" + whitespace + whitespace + "*");
- var rtrim = RegExp(whitespace + whitespace + "*$");
- var createMethod = function(TYPE) {
- return function($this) {
- var string = toString(requireObjectCoercible($this));
- if (TYPE & 1)
- string = replace(string, ltrim, "");
- if (TYPE & 2)
- string = replace(string, rtrim, "");
- return string;
- };
- };
- module3.exports = {
- // `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.es/ecma262/#sec-string.prototype.trim
- trim: createMethod(3)
- };
- }, { "../internals/function-uncurry-this": 157, "../internals/require-object-coercible": 230, "../internals/to-string": 256, "../internals/whitespaces": 269 }], 242: [function(require2, module3, exports3) {
- var call = require2("../internals/function-call");
- var getBuiltIn = require2("../internals/get-built-in");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var redefine = require2("../internals/redefine");
- module3.exports = function() {
- var Symbol2 = getBuiltIn("Symbol");
- var SymbolPrototype = Symbol2 && Symbol2.prototype;
- var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
- var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
- if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
- redefine(SymbolPrototype, TO_PRIMITIVE, function(hint) {
- return call(valueOf, this);
- });
- }
- };
- }, { "../internals/function-call": 155, "../internals/get-built-in": 158, "../internals/redefine": 222, "../internals/well-known-symbol": 268 }], 243: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var apply = require2("../internals/function-apply");
- var bind = require2("../internals/function-bind-context");
- var isCallable = require2("../internals/is-callable");
- var hasOwn = require2("../internals/has-own-property");
- var fails = require2("../internals/fails");
- var html = require2("../internals/html");
- var arraySlice = require2("../internals/array-slice");
- var createElement = require2("../internals/document-create-element");
- var validateArgumentsLength = require2("../internals/validate-arguments-length");
- var IS_IOS = require2("../internals/engine-is-ios");
- var IS_NODE = require2("../internals/engine-is-node");
- var set = global2.setImmediate;
- var clear = global2.clearImmediate;
- var process = global2.process;
- var Dispatch = global2.Dispatch;
- var Function2 = global2.Function;
- var MessageChannel = global2.MessageChannel;
- var String2 = global2.String;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = "onreadystatechange";
- var location2, defer, channel, port;
- try {
- location2 = global2.location;
- } catch (error) {
- }
- var run = function(id) {
- if (hasOwn(queue, id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var runner = function(id) {
- return function() {
- run(id);
- };
- };
- var listener = function(event) {
- run(event.data);
- };
- var post = function(id) {
- global2.postMessage(String2(id), location2.protocol + "//" + location2.host);
- };
- if (!set || !clear) {
- set = function setImmediate(handler) {
- validateArgumentsLength(arguments.length, 1);
- var fn = isCallable(handler) ? handler : Function2(handler);
- var args = arraySlice(arguments, 1);
- queue[++counter] = function() {
- apply(fn, void 0, args);
- };
- defer(counter);
- return counter;
- };
- clear = function clearImmediate(id) {
- delete queue[id];
- };
- if (IS_NODE) {
- defer = function(id) {
- process.nextTick(runner(id));
- };
- } else if (Dispatch && Dispatch.now) {
- defer = function(id) {
- Dispatch.now(runner(id));
- };
- } else if (MessageChannel && !IS_IOS) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = bind(port.postMessage, port);
- } else if (global2.addEventListener && isCallable(global2.postMessage) && !global2.importScripts && location2 && location2.protocol !== "file:" && !fails(post)) {
- defer = post;
- global2.addEventListener("message", listener, false);
- } else if (ONREADYSTATECHANGE in createElement("script")) {
- defer = function(id) {
- html.appendChild(createElement("script"))[ONREADYSTATECHANGE] = function() {
- html.removeChild(this);
- run(id);
- };
- };
- } else {
- defer = function(id) {
- setTimeout(runner(id), 0);
- };
- }
- }
- module3.exports = {
- set,
- clear
- };
- }, { "../internals/array-slice": 117, "../internals/document-create-element": 135, "../internals/engine-is-ios": 142, "../internals/engine-is-node": 143, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/function-bind-context": 153, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/html": 167, "../internals/is-callable": 176, "../internals/validate-arguments-length": 266 }], 244: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- module3.exports = uncurryThis(1 .valueOf);
- }, { "../internals/function-uncurry-this": 157 }], 245: [function(require2, module3, exports3) {
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var max = Math.max;
- var min = Math.min;
- module3.exports = function(index, length) {
- var integer = toIntegerOrInfinity(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- }, { "../internals/to-integer-or-infinity": 248 }], 246: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var toLength = require2("../internals/to-length");
- var RangeError2 = global2.RangeError;
- module3.exports = function(it) {
- if (it === void 0)
- return 0;
- var number = toIntegerOrInfinity(it);
- var length = toLength(number);
- if (number !== length)
- throw RangeError2("Wrong length or index");
- return length;
- };
- }, { "../internals/global": 163, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249 }], 247: [function(require2, module3, exports3) {
- var IndexedObject = require2("../internals/indexed-object");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- module3.exports = function(it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- }, { "../internals/indexed-object": 170, "../internals/require-object-coercible": 230 }], 248: [function(require2, module3, exports3) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- module3.exports = function(argument) {
- var number = +argument;
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
- };
- }, {}], 249: [function(require2, module3, exports3) {
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var min = Math.min;
- module3.exports = function(argument) {
- return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
- };
- }, { "../internals/to-integer-or-infinity": 248 }], 250: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var Object2 = global2.Object;
- module3.exports = function(argument) {
- return Object2(requireObjectCoercible(argument));
- };
- }, { "../internals/global": 163, "../internals/require-object-coercible": 230 }], 251: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var toPositiveInteger = require2("../internals/to-positive-integer");
- var RangeError2 = global2.RangeError;
- module3.exports = function(it, BYTES) {
- var offset = toPositiveInteger(it);
- if (offset % BYTES)
- throw RangeError2("Wrong offset");
- return offset;
- };
- }, { "../internals/global": 163, "../internals/to-positive-integer": 252 }], 252: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var RangeError2 = global2.RangeError;
- module3.exports = function(it) {
- var result = toIntegerOrInfinity(it);
- if (result < 0)
- throw RangeError2("The argument can't be less than 0");
- return result;
- };
- }, { "../internals/global": 163, "../internals/to-integer-or-infinity": 248 }], 253: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var isObject = require2("../internals/is-object");
- var isSymbol = require2("../internals/is-symbol");
- var getMethod = require2("../internals/get-method");
- var ordinaryToPrimitive = require2("../internals/ordinary-to-primitive");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var TypeError2 = global2.TypeError;
- var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
- module3.exports = function(input, pref) {
- if (!isObject(input) || isSymbol(input))
- return input;
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
- var result;
- if (exoticToPrim) {
- if (pref === void 0)
- pref = "default";
- result = call(exoticToPrim, input, pref);
- if (!isObject(result) || isSymbol(result))
- return result;
- throw TypeError2("Can't convert object to primitive value");
- }
- if (pref === void 0)
- pref = "number";
- return ordinaryToPrimitive(input, pref);
- };
- }, { "../internals/function-call": 155, "../internals/get-method": 161, "../internals/global": 163, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/ordinary-to-primitive": 211, "../internals/well-known-symbol": 268 }], 254: [function(require2, module3, exports3) {
- var toPrimitive = require2("../internals/to-primitive");
- var isSymbol = require2("../internals/is-symbol");
- module3.exports = function(argument) {
- var key = toPrimitive(argument, "string");
- return isSymbol(key) ? key : key + "";
- };
- }, { "../internals/is-symbol": 183, "../internals/to-primitive": 253 }], 255: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var test = {};
- test[TO_STRING_TAG] = "z";
- module3.exports = String(test) === "[object z]";
- }, { "../internals/well-known-symbol": 268 }], 256: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var classof = require2("../internals/classof");
- var String2 = global2.String;
- module3.exports = function(argument) {
- if (classof(argument) === "Symbol")
- throw TypeError("Cannot convert a Symbol value to a string");
- return String2(argument);
- };
- }, { "../internals/classof": 124, "../internals/global": 163 }], 257: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var String2 = global2.String;
- module3.exports = function(argument) {
- try {
- return String2(argument);
- } catch (error) {
- return "Object";
- }
- };
- }, { "../internals/global": 163 }], 258: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var DESCRIPTORS = require2("../internals/descriptors");
- var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require2("../internals/typed-array-constructors-require-wrappers");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var ArrayBufferModule = require2("../internals/array-buffer");
- var anInstance = require2("../internals/an-instance");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var isIntegralNumber = require2("../internals/is-integral-number");
- var toLength = require2("../internals/to-length");
- var toIndex = require2("../internals/to-index");
- var toOffset = require2("../internals/to-offset");
- var toPropertyKey = require2("../internals/to-property-key");
- var hasOwn = require2("../internals/has-own-property");
- var classof = require2("../internals/classof");
- var isObject = require2("../internals/is-object");
- var isSymbol = require2("../internals/is-symbol");
- var create = require2("../internals/object-create");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
- var typedArrayFrom = require2("../internals/typed-array-from");
- var forEach = require2("../internals/array-iteration").forEach;
- var setSpecies = require2("../internals/set-species");
- var definePropertyModule = require2("../internals/object-define-property");
- var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
- var InternalStateModule = require2("../internals/internal-state");
- var inheritIfRequired = require2("../internals/inherit-if-required");
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var round = Math.round;
- var RangeError2 = global2.RangeError;
- var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
- var ArrayBufferPrototype = ArrayBuffer2.prototype;
- var DataView2 = ArrayBufferModule.DataView;
- var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
- var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
- var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
- var TypedArray = ArrayBufferViewCore.TypedArray;
- var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var isTypedArray = ArrayBufferViewCore.isTypedArray;
- var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
- var WRONG_LENGTH = "Wrong length";
- var fromList = function(C, list) {
- aTypedArrayConstructor(C);
- var index = 0;
- var length = list.length;
- var result = new C(length);
- while (length > index)
- result[index] = list[index++];
- return result;
- };
- var addGetter = function(it, key) {
- nativeDefineProperty(it, key, { get: function() {
- return getInternalState(this)[key];
- } });
- };
- var isArrayBuffer = function(it) {
- var klass;
- return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == "ArrayBuffer" || klass == "SharedArrayBuffer";
- };
- var isTypedArrayIndex = function(target, key) {
- return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
- };
- var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
- key = toPropertyKey(key);
- return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
- };
- var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
- key = toPropertyKey(key);
- if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, "value") && !hasOwn(descriptor, "get") && !hasOwn(descriptor, "set") && !descriptor.configurable && (!hasOwn(descriptor, "writable") || descriptor.writable) && (!hasOwn(descriptor, "enumerable") || descriptor.enumerable)) {
- target[key] = descriptor.value;
- return target;
- }
- return nativeDefineProperty(target, key, descriptor);
- };
- if (DESCRIPTORS) {
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
- definePropertyModule.f = wrappedDefineProperty;
- addGetter(TypedArrayPrototype, "buffer");
- addGetter(TypedArrayPrototype, "byteOffset");
- addGetter(TypedArrayPrototype, "byteLength");
- addGetter(TypedArrayPrototype, "length");
- }
- $({ target: "Object", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
- getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
- defineProperty: wrappedDefineProperty
- });
- module3.exports = function(TYPE, wrapper, CLAMPED) {
- var BYTES = TYPE.match(/\d+$/)[0] / 8;
- var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
- var GETTER = "get" + TYPE;
- var SETTER = "set" + TYPE;
- var NativeTypedArrayConstructor = global2[CONSTRUCTOR_NAME];
- var TypedArrayConstructor = NativeTypedArrayConstructor;
- var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
- var exported = {};
- var getter = function(that, index) {
- var data = getInternalState(that);
- return data.view[GETTER](index * BYTES + data.byteOffset, true);
- };
- var setter = function(that, index, value) {
- var data = getInternalState(that);
- if (CLAMPED)
- value = (value = round(value)) < 0 ? 0 : value > 255 ? 255 : value & 255;
- data.view[SETTER](index * BYTES + data.byteOffset, value, true);
- };
- var addElement = function(that, index) {
- nativeDefineProperty(that, index, {
- get: function() {
- return getter(this, index);
- },
- set: function(value) {
- return setter(this, index, value);
- },
- enumerable: true
- });
- };
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- TypedArrayConstructor = wrapper(function(that, data, offset, $length) {
- anInstance(that, TypedArrayConstructorPrototype);
- var index = 0;
- var byteOffset = 0;
- var buffer, byteLength, length;
- if (!isObject(data)) {
- length = toIndex(data);
- byteLength = length * BYTES;
- buffer = new ArrayBuffer2(byteLength);
- } else if (isArrayBuffer(data)) {
- buffer = data;
- byteOffset = toOffset(offset, BYTES);
- var $len = data.byteLength;
- if ($length === void 0) {
- if ($len % BYTES)
- throw RangeError2(WRONG_LENGTH);
- byteLength = $len - byteOffset;
- if (byteLength < 0)
- throw RangeError2(WRONG_LENGTH);
- } else {
- byteLength = toLength($length) * BYTES;
- if (byteLength + byteOffset > $len)
- throw RangeError2(WRONG_LENGTH);
- }
- length = byteLength / BYTES;
- } else if (isTypedArray(data)) {
- return fromList(TypedArrayConstructor, data);
- } else {
- return call(typedArrayFrom, TypedArrayConstructor, data);
- }
- setInternalState(that, {
- buffer,
- byteOffset,
- byteLength,
- length,
- view: new DataView2(buffer)
- });
- while (index < length)
- addElement(that, index++);
- });
- if (setPrototypeOf)
- setPrototypeOf(TypedArrayConstructor, TypedArray);
- TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
- } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
- TypedArrayConstructor = wrapper(function(dummy, data, typedArrayOffset, $length) {
- anInstance(dummy, TypedArrayConstructorPrototype);
- return inheritIfRequired(function() {
- if (!isObject(data))
- return new NativeTypedArrayConstructor(toIndex(data));
- if (isArrayBuffer(data))
- return $length !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
- if (isTypedArray(data))
- return fromList(TypedArrayConstructor, data);
- return call(typedArrayFrom, TypedArrayConstructor, data);
- }(), dummy, TypedArrayConstructor);
- });
- if (setPrototypeOf)
- setPrototypeOf(TypedArrayConstructor, TypedArray);
- forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function(key) {
- if (!(key in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
- }
- });
- TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
- }
- if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, "constructor", TypedArrayConstructor);
- }
- createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);
- if (TYPED_ARRAY_TAG) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
- }
- exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
- $({
- global: true,
- forced: TypedArrayConstructor != NativeTypedArrayConstructor,
- sham: !NATIVE_ARRAY_BUFFER_VIEWS
- }, exported);
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
- }
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
- }
- setSpecies(CONSTRUCTOR_NAME);
- };
- } else
- module3.exports = function() {
- };
- }, { "../internals/an-instance": 100, "../internals/array-buffer": 104, "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/classof": 124, "../internals/create-non-enumerable-property": 129, "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/export": 149, "../internals/function-call": 155, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/internal-state": 173, "../internals/is-integral-number": 179, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/object-create": 196, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/object-set-prototype-of": 208, "../internals/set-species": 233, "../internals/to-index": 246, "../internals/to-length": 249, "../internals/to-offset": 251, "../internals/to-property-key": 254, "../internals/typed-array-constructors-require-wrappers": 259, "../internals/typed-array-from": 261 }], 259: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var fails = require2("../internals/fails");
- var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
- var NATIVE_ARRAY_BUFFER_VIEWS = require2("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS;
- var ArrayBuffer2 = global2.ArrayBuffer;
- var Int8Array2 = global2.Int8Array;
- module3.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function() {
- Int8Array2(1);
- }) || !fails(function() {
- new Int8Array2(-1);
- }) || !checkCorrectnessOfIteration(function(iterable) {
- new Int8Array2();
- new Int8Array2(null);
- new Int8Array2(1.5);
- new Int8Array2(iterable);
- }, true) || fails(function() {
- return new Int8Array2(new ArrayBuffer2(2), 1, void 0).length !== 1;
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/check-correctness-of-iteration": 122, "../internals/fails": 150, "../internals/global": 163 }], 260: [function(require2, module3, exports3) {
- var arrayFromConstructorAndList = require2("../internals/array-from-constructor-and-list");
- var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
- module3.exports = function(instance, list) {
- return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);
- };
- }, { "../internals/array-from-constructor-and-list": 108, "../internals/typed-array-species-constructor": 262 }], 261: [function(require2, module3, exports3) {
- var bind = require2("../internals/function-bind-context");
- var call = require2("../internals/function-call");
- var aConstructor = require2("../internals/a-constructor");
- var toObject = require2("../internals/to-object");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var getIterator = require2("../internals/get-iterator");
- var getIteratorMethod = require2("../internals/get-iterator-method");
- var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
- var aTypedArrayConstructor = require2("../internals/array-buffer-view-core").aTypedArrayConstructor;
- module3.exports = function from(source) {
- var C = aConstructor(this);
- var O = toObject(source);
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
- var mapping = mapfn !== void 0;
- var iteratorMethod = getIteratorMethod(O);
- var i, length, result, step, iterator, next;
- if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
- iterator = getIterator(O, iteratorMethod);
- next = iterator.next;
- O = [];
- while (!(step = call(next, iterator)).done) {
- O.push(step.value);
- }
- }
- if (mapping && argumentsLength > 2) {
- mapfn = bind(mapfn, arguments[2]);
- }
- length = lengthOfArrayLike(O);
- result = new (aTypedArrayConstructor(C))(length);
- for (i = 0; length > i; i++) {
- result[i] = mapping ? mapfn(O[i], i) : O[i];
- }
- return result;
- };
- }, { "../internals/a-constructor": 96, "../internals/array-buffer-view-core": 103, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/is-array-iterator-method": 174, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 262: [function(require2, module3, exports3) {
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var speciesConstructor = require2("../internals/species-constructor");
- var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- module3.exports = function(originalArray) {
- return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));
- };
- }, { "../internals/array-buffer-view-core": 103, "../internals/species-constructor": 238 }], 263: [function(require2, module3, exports3) {
- var uncurryThis = require2("../internals/function-uncurry-this");
- var id = 0;
- var postfix = Math.random();
- var toString = uncurryThis(1 .toString);
- module3.exports = function(key) {
- return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
- };
- }, { "../internals/function-uncurry-this": 157 }], 264: [function(require2, module3, exports3) {
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- module3.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
- }, { "../internals/native-symbol": 191 }], 265: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var fails = require2("../internals/fails");
- module3.exports = DESCRIPTORS && fails(function() {
- return Object.defineProperty(function() {
- }, "prototype", {
- value: 42,
- writable: false
- }).prototype != 42;
- });
- }, { "../internals/descriptors": 134, "../internals/fails": 150 }], 266: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var TypeError2 = global2.TypeError;
- module3.exports = function(passed, required) {
- if (passed < required)
- throw TypeError2("Not enough arguments");
- return passed;
- };
- }, { "../internals/global": 163 }], 267: [function(require2, module3, exports3) {
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- exports3.f = wellKnownSymbol;
- }, { "../internals/well-known-symbol": 268 }], 268: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var shared = require2("../internals/shared");
- var hasOwn = require2("../internals/has-own-property");
- var uid = require2("../internals/uid");
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- var USE_SYMBOL_AS_UID = require2("../internals/use-symbol-as-uid");
- var WellKnownSymbolsStore = shared("wks");
- var Symbol2 = global2.Symbol;
- var symbolFor = Symbol2 && Symbol2["for"];
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
- module3.exports = function(name) {
- if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
- var description = "Symbol." + name;
- if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
- WellKnownSymbolsStore[name] = Symbol2[name];
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
- WellKnownSymbolsStore[name] = symbolFor(description);
- } else {
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
- }
- }
- return WellKnownSymbolsStore[name];
- };
- }, { "../internals/global": 163, "../internals/has-own-property": 164, "../internals/native-symbol": 191, "../internals/shared": 237, "../internals/uid": 263, "../internals/use-symbol-as-uid": 264 }], 269: [function(require2, module3, exports3) {
- module3.exports = " \n\v\f\r \u2028\u2029\uFEFF";
- }, {}], 270: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var arrayBufferModule = require2("../internals/array-buffer");
- var setSpecies = require2("../internals/set-species");
- var ARRAY_BUFFER = "ArrayBuffer";
- var ArrayBuffer2 = arrayBufferModule[ARRAY_BUFFER];
- var NativeArrayBuffer = global2[ARRAY_BUFFER];
- $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer2 }, {
- ArrayBuffer: ArrayBuffer2
- });
- setSpecies(ARRAY_BUFFER);
- }, { "../internals/array-buffer": 104, "../internals/export": 149, "../internals/global": 163, "../internals/set-species": 233 }], 271: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fails = require2("../internals/fails");
- var ArrayBufferModule = require2("../internals/array-buffer");
- var anObject = require2("../internals/an-object");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var toLength = require2("../internals/to-length");
- var speciesConstructor = require2("../internals/species-constructor");
- var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
- var DataView2 = ArrayBufferModule.DataView;
- var DataViewPrototype = DataView2.prototype;
- var un$ArrayBufferSlice = uncurryThis(ArrayBuffer2.prototype.slice);
- var getUint8 = uncurryThis(DataViewPrototype.getUint8);
- var setUint8 = uncurryThis(DataViewPrototype.setUint8);
- var INCORRECT_SLICE = fails(function() {
- return !new ArrayBuffer2(2).slice(1, void 0).byteLength;
- });
- $({ target: "ArrayBuffer", proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
- slice: function slice(start, end) {
- if (un$ArrayBufferSlice && end === void 0) {
- return un$ArrayBufferSlice(anObject(this), start);
- }
- var length = anObject(this).byteLength;
- var first = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
- var result = new (speciesConstructor(this, ArrayBuffer2))(toLength(fin - first));
- var viewSource = new DataView2(this);
- var viewTarget = new DataView2(result);
- var index = 0;
- while (first < fin) {
- setUint8(viewTarget, index++, getUint8(viewSource, first++));
- }
- return result;
- }
- });
- }, { "../internals/an-object": 101, "../internals/array-buffer": 104, "../internals/export": 149, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/species-constructor": 238, "../internals/to-absolute-index": 245, "../internals/to-length": 249 }], 272: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var fails = require2("../internals/fails");
- var isArray = require2("../internals/is-array");
- var isObject = require2("../internals/is-object");
- var toObject = require2("../internals/to-object");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var createProperty = require2("../internals/create-property");
- var arraySpeciesCreate = require2("../internals/array-species-create");
- var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var V8_VERSION = require2("../internals/engine-v8-version");
- var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable");
- var MAX_SAFE_INTEGER = 9007199254740991;
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded";
- var TypeError2 = global2.TypeError;
- var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() {
- var array = [];
- array[IS_CONCAT_SPREADABLE] = false;
- return array.concat()[0] !== array;
- });
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat");
- var isConcatSpreadable = function(O) {
- if (!isObject(O))
- return false;
- var spreadable = O[IS_CONCAT_SPREADABLE];
- return spreadable !== void 0 ? !!spreadable : isArray(O);
- };
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
- $({ target: "Array", proto: true, forced: FORCED }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- concat: function concat(arg) {
- var O = toObject(this);
- var A = arraySpeciesCreate(O, 0);
- var n = 0;
- var i, k, length, len, E;
- for (i = -1, length = arguments.length; i < length; i++) {
- E = i === -1 ? O : arguments[i];
- if (isConcatSpreadable(E)) {
- len = lengthOfArrayLike(E);
- if (n + len > MAX_SAFE_INTEGER)
- throw TypeError2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- for (k = 0; k < len; k++, n++)
- if (k in E)
- createProperty(A, n, E[k]);
- } else {
- if (n >= MAX_SAFE_INTEGER)
- throw TypeError2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- createProperty(A, n++, E);
- }
- }
- A.length = n;
- return A;
- }
- });
- }, { "../internals/array-method-has-species-support": 113, "../internals/array-species-create": 120, "../internals/create-property": 131, "../internals/engine-v8-version": 146, "../internals/export": 149, "../internals/fails": 150, "../internals/global": 163, "../internals/is-array": 175, "../internals/is-object": 180, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/well-known-symbol": 268 }], 273: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var fill = require2("../internals/array-fill");
- var addToUnscopables = require2("../internals/add-to-unscopables");
- $({ target: "Array", proto: true }, {
- fill
- });
- addToUnscopables("fill");
- }, { "../internals/add-to-unscopables": 98, "../internals/array-fill": 106, "../internals/export": 149 }], 274: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var $filter = require2("../internals/array-iteration").filter;
- var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
- $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- filter: function filter(callbackfn) {
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- }
- });
- }, { "../internals/array-iteration": 111, "../internals/array-method-has-species-support": 113, "../internals/export": 149 }], 275: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var $find = require2("../internals/array-iteration").find;
- var addToUnscopables = require2("../internals/add-to-unscopables");
- var FIND = "find";
- var SKIPS_HOLES = true;
- if (FIND in [])
- Array(1)[FIND](function() {
- SKIPS_HOLES = false;
- });
- $({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
- find: function find(callbackfn) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- }
- });
- addToUnscopables(FIND);
- }, { "../internals/add-to-unscopables": 98, "../internals/array-iteration": 111, "../internals/export": 149 }], 276: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var from = require2("../internals/array-from");
- var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
- Array.from(iterable);
- });
- $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
- from
- });
- }, { "../internals/array-from": 109, "../internals/check-correctness-of-iteration": 122, "../internals/export": 149 }], 277: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var $includes = require2("../internals/array-includes").includes;
- var addToUnscopables = require2("../internals/add-to-unscopables");
- $({ target: "Array", proto: true }, {
- includes: function includes(el) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
- }
- });
- addToUnscopables("includes");
- }, { "../internals/add-to-unscopables": 98, "../internals/array-includes": 110, "../internals/export": 149 }], 278: [function(require2, module3, exports3) {
- "use strict";
- var toIndexedObject = require2("../internals/to-indexed-object");
- var addToUnscopables = require2("../internals/add-to-unscopables");
- var Iterators = require2("../internals/iterators");
- var InternalStateModule = require2("../internals/internal-state");
- var defineProperty = require2("../internals/object-define-property").f;
- var defineIterator = require2("../internals/define-iterator");
- var IS_PURE = require2("../internals/is-pure");
- var DESCRIPTORS = require2("../internals/descriptors");
- var ARRAY_ITERATOR = "Array Iterator";
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- module3.exports = defineIterator(Array, "Array", function(iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated),
- // target
- index: 0,
- // next index
- kind
- // kind
- });
- }, function() {
- var state = getInternalState(this);
- var target = state.target;
- var kind = state.kind;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = void 0;
- return { value: void 0, done: true };
- }
- if (kind == "keys")
- return { value: index, done: false };
- if (kind == "values")
- return { value: target[index], done: false };
- return { value: [index, target[index]], done: false };
- }, "values");
- var values = Iterators.Arguments = Iterators.Array;
- addToUnscopables("keys");
- addToUnscopables("values");
- addToUnscopables("entries");
- if (!IS_PURE && DESCRIPTORS && values.name !== "values")
- try {
- defineProperty(values, "name", { value: "values" });
- } catch (error) {
- }
- }, { "../internals/add-to-unscopables": 98, "../internals/define-iterator": 132, "../internals/descriptors": 134, "../internals/internal-state": 173, "../internals/is-pure": 181, "../internals/iterators": 187, "../internals/object-define-property": 198, "../internals/to-indexed-object": 247 }], 279: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var IndexedObject = require2("../internals/indexed-object");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
- var un$Join = uncurryThis([].join);
- var ES3_STRINGS = IndexedObject != Object;
- var STRICT_METHOD = arrayMethodIsStrict("join", ",");
- $({ target: "Array", proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
- join: function join(separator) {
- return un$Join(toIndexedObject(this), separator === void 0 ? "," : separator);
- }
- });
- }, { "../internals/array-method-is-strict": 114, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/to-indexed-object": 247 }], 280: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var $map = require2("../internals/array-iteration").map;
- var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map");
- $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- map: function map(callbackfn) {
- return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- }
- });
- }, { "../internals/array-iteration": 111, "../internals/array-method-has-species-support": 113, "../internals/export": 149 }], 281: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var isArray = require2("../internals/is-array");
- var isConstructor = require2("../internals/is-constructor");
- var isObject = require2("../internals/is-object");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var createProperty = require2("../internals/create-property");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
- var un$Slice = require2("../internals/array-slice");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
- var SPECIES = wellKnownSymbol("species");
- var Array2 = global2.Array;
- var max = Math.max;
- $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- slice: function slice(start, end) {
- var O = toIndexedObject(this);
- var length = lengthOfArrayLike(O);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
- var Constructor, result, n;
- if (isArray(O)) {
- Constructor = O.constructor;
- if (isConstructor(Constructor) && (Constructor === Array2 || isArray(Constructor.prototype))) {
- Constructor = void 0;
- } else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES];
- if (Constructor === null)
- Constructor = void 0;
- }
- if (Constructor === Array2 || Constructor === void 0) {
- return un$Slice(O, k, fin);
- }
- }
- result = new (Constructor === void 0 ? Array2 : Constructor)(max(fin - k, 0));
- for (n = 0; k < fin; k++, n++)
- if (k in O)
- createProperty(result, n, O[k]);
- result.length = n;
- return result;
- }
- });
- }, { "../internals/array-method-has-species-support": 113, "../internals/array-slice": 117, "../internals/create-property": 131, "../internals/export": 149, "../internals/global": 163, "../internals/is-array": 175, "../internals/is-constructor": 177, "../internals/is-object": 180, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-indexed-object": 247, "../internals/well-known-symbol": 268 }], 282: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var aCallable = require2("../internals/a-callable");
- var toObject = require2("../internals/to-object");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var toString = require2("../internals/to-string");
- var fails = require2("../internals/fails");
- var internalSort = require2("../internals/array-sort");
- var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
- var FF = require2("../internals/engine-ff-version");
- var IE_OR_EDGE = require2("../internals/engine-is-ie-or-edge");
- var V8 = require2("../internals/engine-v8-version");
- var WEBKIT = require2("../internals/engine-webkit-version");
- var test = [];
- var un$Sort = uncurryThis(test.sort);
- var push = uncurryThis(test.push);
- var FAILS_ON_UNDEFINED = fails(function() {
- test.sort(void 0);
- });
- var FAILS_ON_NULL = fails(function() {
- test.sort(null);
- });
- var STRICT_METHOD = arrayMethodIsStrict("sort");
- var STABLE_SORT = !fails(function() {
- if (V8)
- return V8 < 70;
- if (FF && FF > 3)
- return;
- if (IE_OR_EDGE)
- return true;
- if (WEBKIT)
- return WEBKIT < 603;
- var result = "";
- var code, chr, value, index;
- for (code = 65; code < 76; code++) {
- chr = String.fromCharCode(code);
- switch (code) {
- case 66:
- case 69:
- case 70:
- case 72:
- value = 3;
- break;
- case 68:
- case 71:
- value = 4;
- break;
- default:
- value = 2;
- }
- for (index = 0; index < 47; index++) {
- test.push({ k: chr + index, v: value });
- }
- }
- test.sort(function(a, b) {
- return b.v - a.v;
- });
- for (index = 0; index < test.length; index++) {
- chr = test[index].k.charAt(0);
- if (result.charAt(result.length - 1) !== chr)
- result += chr;
- }
- return result !== "DGBEFHACIJK";
- });
- var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
- var getSortCompare = function(comparefn) {
- return function(x, y) {
- if (y === void 0)
- return -1;
- if (x === void 0)
- return 1;
- if (comparefn !== void 0)
- return +comparefn(x, y) || 0;
- return toString(x) > toString(y) ? 1 : -1;
- };
- };
- $({ target: "Array", proto: true, forced: FORCED }, {
- sort: function sort(comparefn) {
- if (comparefn !== void 0)
- aCallable(comparefn);
- var array = toObject(this);
- if (STABLE_SORT)
- return comparefn === void 0 ? un$Sort(array) : un$Sort(array, comparefn);
- var items = [];
- var arrayLength = lengthOfArrayLike(array);
- var itemsLength, index;
- for (index = 0; index < arrayLength; index++) {
- if (index in array)
- push(items, array[index]);
- }
- internalSort(items, getSortCompare(comparefn));
- itemsLength = items.length;
- index = 0;
- while (index < itemsLength)
- array[index] = items[index++];
- while (index < arrayLength)
- delete array[index++];
- return array;
- }
- });
- }, { "../internals/a-callable": 95, "../internals/array-method-is-strict": 114, "../internals/array-sort": 118, "../internals/engine-ff-version": 138, "../internals/engine-is-ie-or-edge": 140, "../internals/engine-v8-version": 146, "../internals/engine-webkit-version": 147, "../internals/export": 149, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/to-string": 256 }], 283: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var toObject = require2("../internals/to-object");
- var arraySpeciesCreate = require2("../internals/array-species-create");
- var createProperty = require2("../internals/create-property");
- var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice");
- var TypeError2 = global2.TypeError;
- var max = Math.max;
- var min = Math.min;
- var MAX_SAFE_INTEGER = 9007199254740991;
- var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = "Maximum allowed length exceeded";
- $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- splice: function splice(start, deleteCount) {
- var O = toObject(this);
- var len = lengthOfArrayLike(O);
- var actualStart = toAbsoluteIndex(start, len);
- var argumentsLength = arguments.length;
- var insertCount, actualDeleteCount, A, k, from, to;
- if (argumentsLength === 0) {
- insertCount = actualDeleteCount = 0;
- } else if (argumentsLength === 1) {
- insertCount = 0;
- actualDeleteCount = len - actualStart;
- } else {
- insertCount = argumentsLength - 2;
- actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
- }
- if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
- throw TypeError2(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
- }
- A = arraySpeciesCreate(O, actualDeleteCount);
- for (k = 0; k < actualDeleteCount; k++) {
- from = actualStart + k;
- if (from in O)
- createProperty(A, k, O[from]);
- }
- A.length = actualDeleteCount;
- if (insertCount < actualDeleteCount) {
- for (k = actualStart; k < len - actualDeleteCount; k++) {
- from = k + actualDeleteCount;
- to = k + insertCount;
- if (from in O)
- O[to] = O[from];
- else
- delete O[to];
- }
- for (k = len; k > len - actualDeleteCount + insertCount; k--)
- delete O[k - 1];
- } else if (insertCount > actualDeleteCount) {
- for (k = len - actualDeleteCount; k > actualStart; k--) {
- from = k + actualDeleteCount - 1;
- to = k + insertCount - 1;
- if (from in O)
- O[to] = O[from];
- else
- delete O[to];
- }
- }
- for (k = 0; k < insertCount; k++) {
- O[k + actualStart] = arguments[k + 2];
- }
- O.length = len - actualDeleteCount + insertCount;
- return A;
- }
- });
- }, { "../internals/array-method-has-species-support": 113, "../internals/array-species-create": 120, "../internals/create-property": 131, "../internals/export": 149, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-integer-or-infinity": 248, "../internals/to-object": 250 }], 284: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var FUNCTION_NAME_EXISTS = require2("../internals/function-name").EXISTS;
- var uncurryThis = require2("../internals/function-uncurry-this");
- var defineProperty = require2("../internals/object-define-property").f;
- var FunctionPrototype = Function.prototype;
- var functionToString = uncurryThis(FunctionPrototype.toString);
- var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
- var regExpExec = uncurryThis(nameRE.exec);
- var NAME = "name";
- if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
- defineProperty(FunctionPrototype, NAME, {
- configurable: true,
- get: function() {
- try {
- return regExpExec(nameRE, functionToString(this))[1];
- } catch (error) {
- return "";
- }
- }
- });
- }
- }, { "../internals/descriptors": 134, "../internals/function-name": 156, "../internals/function-uncurry-this": 157, "../internals/object-define-property": 198 }], 285: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var getBuiltIn = require2("../internals/get-built-in");
- var apply = require2("../internals/function-apply");
- var call = require2("../internals/function-call");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fails = require2("../internals/fails");
- var isArray = require2("../internals/is-array");
- var isCallable = require2("../internals/is-callable");
- var isObject = require2("../internals/is-object");
- var isSymbol = require2("../internals/is-symbol");
- var arraySlice = require2("../internals/array-slice");
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- var $stringify = getBuiltIn("JSON", "stringify");
- var exec = uncurryThis(/./.exec);
- var charAt = uncurryThis("".charAt);
- var charCodeAt = uncurryThis("".charCodeAt);
- var replace = uncurryThis("".replace);
- var numberToString = uncurryThis(1 .toString);
- var tester = /[\uD800-\uDFFF]/g;
- var low = /^[\uD800-\uDBFF]$/;
- var hi = /^[\uDC00-\uDFFF]$/;
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
- var symbol = getBuiltIn("Symbol")();
- return $stringify([symbol]) != "[null]" || $stringify({ a: symbol }) != "{}" || $stringify(Object(symbol)) != "{}";
- });
- var ILL_FORMED_UNICODE = fails(function() {
- return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
- });
- var stringifyWithSymbolsFix = function(it, replacer) {
- var args = arraySlice(arguments);
- var $replacer = replacer;
- if (!isObject(replacer) && it === void 0 || isSymbol(it))
- return;
- if (!isArray(replacer))
- replacer = function(key, value) {
- if (isCallable($replacer))
- value = call($replacer, this, key, value);
- if (!isSymbol(value))
- return value;
- };
- args[1] = replacer;
- return apply($stringify, null, args);
- };
- var fixIllFormed = function(match, offset, string) {
- var prev = charAt(string, offset - 1);
- var next = charAt(string, offset + 1);
- if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) {
- return "\\u" + numberToString(charCodeAt(match, 0), 16);
- }
- return match;
- };
- if ($stringify) {
- $({ target: "JSON", stat: true, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- stringify: function stringify(it, replacer, space) {
- var args = arraySlice(arguments);
- var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
- return ILL_FORMED_UNICODE && typeof result == "string" ? replace(result, tester, fixIllFormed) : result;
- }
- });
- }
- }, { "../internals/array-slice": 117, "../internals/export": 149, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/is-array": 175, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/native-symbol": 191 }], 286: [function(require2, module3, exports3) {
- "use strict";
- var DESCRIPTORS = require2("../internals/descriptors");
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var isForced = require2("../internals/is-forced");
- var redefine = require2("../internals/redefine");
- var hasOwn = require2("../internals/has-own-property");
- var inheritIfRequired = require2("../internals/inherit-if-required");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var isSymbol = require2("../internals/is-symbol");
- var toPrimitive = require2("../internals/to-primitive");
- var fails = require2("../internals/fails");
- var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
- var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
- var defineProperty = require2("../internals/object-define-property").f;
- var thisNumberValue = require2("../internals/this-number-value");
- var trim = require2("../internals/string-trim").trim;
- var NUMBER = "Number";
- var NativeNumber = global2[NUMBER];
- var NumberPrototype = NativeNumber.prototype;
- var TypeError2 = global2.TypeError;
- var arraySlice = uncurryThis("".slice);
- var charCodeAt = uncurryThis("".charCodeAt);
- var toNumeric = function(value) {
- var primValue = toPrimitive(value, "number");
- return typeof primValue == "bigint" ? primValue : toNumber(primValue);
- };
- var toNumber = function(argument) {
- var it = toPrimitive(argument, "number");
- var first, third, radix, maxCode, digits, length, index, code;
- if (isSymbol(it))
- throw TypeError2("Cannot convert a Symbol value to a number");
- if (typeof it == "string" && it.length > 2) {
- it = trim(it);
- first = charCodeAt(it, 0);
- if (first === 43 || first === 45) {
- third = charCodeAt(it, 2);
- if (third === 88 || third === 120)
- return NaN;
- } else if (first === 48) {
- switch (charCodeAt(it, 1)) {
- case 66:
- case 98:
- radix = 2;
- maxCode = 49;
- break;
- case 79:
- case 111:
- radix = 8;
- maxCode = 55;
- break;
- default:
- return +it;
- }
- digits = arraySlice(it, 2);
- length = digits.length;
- for (index = 0; index < length; index++) {
- code = charCodeAt(digits, index);
- if (code < 48 || code > maxCode)
- return NaN;
- }
- return parseInt(digits, radix);
- }
- }
- return +it;
- };
- if (isForced(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"))) {
- var NumberWrapper = function Number2(value) {
- var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
- var dummy = this;
- return isPrototypeOf(NumberPrototype, dummy) && fails(function() {
- thisNumberValue(dummy);
- }) ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
- };
- for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
- // ES3:
- "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(",")
- ), j = 0, key; keys.length > j; j++) {
- if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
- defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
- }
- }
- NumberWrapper.prototype = NumberPrototype;
- NumberPrototype.constructor = NumberWrapper;
- redefine(global2, NUMBER, NumberWrapper);
- }
- }, { "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/is-forced": 178, "../internals/is-symbol": 183, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/redefine": 222, "../internals/string-trim": 241, "../internals/this-number-value": 244, "../internals/to-primitive": 253 }], 287: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var assign = require2("../internals/object-assign");
- $({ target: "Object", stat: true, forced: Object.assign !== assign }, {
- assign
- });
- }, { "../internals/export": 149, "../internals/object-assign": 195 }], 288: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var $entries = require2("../internals/object-to-array").entries;
- $({ target: "Object", stat: true }, {
- entries: function entries(O) {
- return $entries(O);
- }
- });
- }, { "../internals/export": 149, "../internals/object-to-array": 209 }], 289: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- var fails = require2("../internals/fails");
- var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
- var toObject = require2("../internals/to-object");
- var FORCED = !NATIVE_SYMBOL || fails(function() {
- getOwnPropertySymbolsModule.f(1);
- });
- $({ target: "Object", stat: true, forced: FORCED }, {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
- }
- });
- }, { "../internals/export": 149, "../internals/fails": 150, "../internals/native-symbol": 191, "../internals/object-get-own-property-symbols": 202, "../internals/to-object": 250 }], 290: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var toObject = require2("../internals/to-object");
- var nativeKeys = require2("../internals/object-keys");
- var fails = require2("../internals/fails");
- var FAILS_ON_PRIMITIVES = fails(function() {
- nativeKeys(1);
- });
- $({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
- keys: function keys(it) {
- return nativeKeys(toObject(it));
- }
- });
- }, { "../internals/export": 149, "../internals/fails": 150, "../internals/object-keys": 206, "../internals/to-object": 250 }], 291: [function(require2, module3, exports3) {
- var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
- var redefine = require2("../internals/redefine");
- var toString = require2("../internals/object-to-string");
- if (!TO_STRING_TAG_SUPPORT) {
- redefine(Object.prototype, "toString", toString, { unsafe: true });
- }
- }, { "../internals/object-to-string": 210, "../internals/redefine": 222, "../internals/to-string-tag-support": 255 }], 292: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var call = require2("../internals/function-call");
- var aCallable = require2("../internals/a-callable");
- var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
- var perform = require2("../internals/perform");
- var iterate = require2("../internals/iterate");
- var PROMISE_STATICS_INCORRECT_ITERATION = require2("../internals/promise-statics-incorrect-iteration");
- $({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function() {
- var $promiseResolve = aCallable(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function(promise) {
- var index = counter++;
- var alreadyCalled = false;
- remaining++;
- call($promiseResolve, C, promise).then(function(value) {
- if (alreadyCalled)
- return;
- alreadyCalled = true;
- values[index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.error)
- reject(result.value);
- return capability.promise;
- }
- });
- }, { "../internals/a-callable": 95, "../internals/export": 149, "../internals/function-call": 155, "../internals/iterate": 184, "../internals/new-promise-capability": 193, "../internals/perform": 214, "../internals/promise-statics-incorrect-iteration": 218 }], 293: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var IS_PURE = require2("../internals/is-pure");
- var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
- var NativePromiseConstructor = require2("../internals/promise-native-constructor");
- var getBuiltIn = require2("../internals/get-built-in");
- var isCallable = require2("../internals/is-callable");
- var redefine = require2("../internals/redefine");
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- $({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
- "catch": function(onRejected) {
- return this.then(void 0, onRejected);
- }
- });
- if (!IS_PURE && isCallable(NativePromiseConstructor)) {
- var method = getBuiltIn("Promise").prototype["catch"];
- if (NativePromisePrototype["catch"] !== method) {
- redefine(NativePromisePrototype, "catch", method, { unsafe: true });
- }
- }
- }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/redefine": 222 }], 294: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var IS_PURE = require2("../internals/is-pure");
- var IS_NODE = require2("../internals/engine-is-node");
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var redefine = require2("../internals/redefine");
- var redefineAll = require2("../internals/redefine-all");
- var setPrototypeOf = require2("../internals/object-set-prototype-of");
- var setToStringTag = require2("../internals/set-to-string-tag");
- var setSpecies = require2("../internals/set-species");
- var aCallable = require2("../internals/a-callable");
- var isCallable = require2("../internals/is-callable");
- var isObject = require2("../internals/is-object");
- var anInstance = require2("../internals/an-instance");
- var speciesConstructor = require2("../internals/species-constructor");
- var task = require2("../internals/task").set;
- var microtask = require2("../internals/microtask");
- var hostReportErrors = require2("../internals/host-report-errors");
- var perform = require2("../internals/perform");
- var Queue = require2("../internals/queue");
- var InternalStateModule = require2("../internals/internal-state");
- var NativePromiseConstructor = require2("../internals/promise-native-constructor");
- var PromiseConstructorDetection = require2("../internals/promise-constructor-detection");
- var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
- var PROMISE = "Promise";
- var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
- var setInternalState = InternalStateModule.set;
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var PromiseConstructor = NativePromiseConstructor;
- var PromisePrototype = NativePromisePrototype;
- var TypeError2 = global2.TypeError;
- var document2 = global2.document;
- var process = global2.process;
- var newPromiseCapability = newPromiseCapabilityModule.f;
- var newGenericPromiseCapability = newPromiseCapability;
- var DISPATCH_EVENT = !!(document2 && document2.createEvent && global2.dispatchEvent);
- var UNHANDLED_REJECTION = "unhandledrejection";
- var REJECTION_HANDLED = "rejectionhandled";
- var PENDING = 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- var HANDLED = 1;
- var UNHANDLED = 2;
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
- var isThenable = function(it) {
- var then;
- return isObject(it) && isCallable(then = it.then) ? then : false;
- };
- var callReaction = function(reaction, state) {
- var value = state.value;
- var ok = state.state == FULFILLED;
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (state.rejection === UNHANDLED)
- onHandleUnhandled(state);
- state.rejection = HANDLED;
- }
- if (handler === true)
- result = value;
- else {
- if (domain)
- domain.enter();
- result = handler(value);
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError2("Promise-chain cycle"));
- } else if (then = isThenable(result)) {
- call(then, result, resolve, reject);
- } else
- resolve(result);
- } else
- reject(value);
- } catch (error) {
- if (domain && !exited)
- domain.exit();
- reject(error);
- }
- };
- var notify = function(state, isReject) {
- if (state.notified)
- return;
- state.notified = true;
- microtask(function() {
- var reactions = state.reactions;
- var reaction;
- while (reaction = reactions.get()) {
- callReaction(reaction, state);
- }
- state.notified = false;
- if (isReject && !state.rejection)
- onUnhandled(state);
- });
- };
- var dispatchEvent = function(name, promise, reason) {
- var event, handler;
- if (DISPATCH_EVENT) {
- event = document2.createEvent("Event");
- event.promise = promise;
- event.reason = reason;
- event.initEvent(name, false, true);
- global2.dispatchEvent(event);
- } else
- event = { promise, reason };
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global2["on" + name]))
- handler(event);
- else if (name === UNHANDLED_REJECTION)
- hostReportErrors("Unhandled promise rejection", reason);
- };
- var onUnhandled = function(state) {
- call(task, global2, function() {
- var promise = state.facade;
- var value = state.value;
- var IS_UNHANDLED = isUnhandled(state);
- var result;
- if (IS_UNHANDLED) {
- result = perform(function() {
- if (IS_NODE) {
- process.emit("unhandledRejection", value, promise);
- } else
- dispatchEvent(UNHANDLED_REJECTION, promise, value);
- });
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
- if (result.error)
- throw result.value;
- }
- });
- };
- var isUnhandled = function(state) {
- return state.rejection !== HANDLED && !state.parent;
- };
- var onHandleUnhandled = function(state) {
- call(task, global2, function() {
- var promise = state.facade;
- if (IS_NODE) {
- process.emit("rejectionHandled", promise);
- } else
- dispatchEvent(REJECTION_HANDLED, promise, state.value);
- });
- };
- var bind = function(fn, state, unwrap) {
- return function(value) {
- fn(state, value, unwrap);
- };
- };
- var internalReject = function(state, value, unwrap) {
- if (state.done)
- return;
- state.done = true;
- if (unwrap)
- state = unwrap;
- state.value = value;
- state.state = REJECTED;
- notify(state, true);
- };
- var internalResolve = function(state, value, unwrap) {
- if (state.done)
- return;
- state.done = true;
- if (unwrap)
- state = unwrap;
- try {
- if (state.facade === value)
- throw TypeError2("Promise can't be resolved itself");
- var then = isThenable(value);
- if (then) {
- microtask(function() {
- var wrapper = { done: false };
- try {
- call(
- then,
- value,
- bind(internalResolve, wrapper, state),
- bind(internalReject, wrapper, state)
- );
- } catch (error) {
- internalReject(wrapper, error, state);
- }
- });
- } else {
- state.value = value;
- state.state = FULFILLED;
- notify(state, false);
- }
- } catch (error) {
- internalReject({ done: false }, error, state);
- }
- };
- if (FORCED_PROMISE_CONSTRUCTOR) {
- PromiseConstructor = function Promise2(executor) {
- anInstance(this, PromisePrototype);
- aCallable(executor);
- call(Internal, this);
- var state = getInternalPromiseState(this);
- try {
- executor(bind(internalResolve, state), bind(internalReject, state));
- } catch (error) {
- internalReject(state, error);
- }
- };
- PromisePrototype = PromiseConstructor.prototype;
- Internal = function Promise2(executor) {
- setInternalState(this, {
- type: PROMISE,
- done: false,
- notified: false,
- parent: false,
- reactions: new Queue(),
- rejection: false,
- state: PENDING,
- value: void 0
- });
- };
- Internal.prototype = redefineAll(PromisePrototype, {
- // `Promise.prototype.then` method
- // https://tc39.es/ecma262/#sec-promise.prototype.then
- // eslint-disable-next-line unicorn/no-thenable -- safe
- then: function then(onFulfilled, onRejected) {
- var state = getInternalPromiseState(this);
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
- state.parent = true;
- reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
- reaction.fail = isCallable(onRejected) && onRejected;
- reaction.domain = IS_NODE ? process.domain : void 0;
- if (state.state == PENDING)
- state.reactions.add(reaction);
- else
- microtask(function() {
- callReaction(reaction, state);
- });
- return reaction.promise;
- }
- });
- OwnPromiseCapability = function() {
- var promise = new Internal();
- var state = getInternalPromiseState(promise);
- this.promise = promise;
- this.resolve = bind(internalResolve, state);
- this.reject = bind(internalReject, state);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function(C) {
- return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C);
- };
- if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
- nativeThen = NativePromisePrototype.then;
- if (!NATIVE_PROMISE_SUBCLASSING) {
- redefine(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
- var that = this;
- return new PromiseConstructor(function(resolve, reject) {
- call(nativeThen, that, resolve, reject);
- }).then(onFulfilled, onRejected);
- }, { unsafe: true });
- }
- try {
- delete NativePromisePrototype.constructor;
- } catch (error) {
- }
- if (setPrototypeOf) {
- setPrototypeOf(NativePromisePrototype, PromisePrototype);
- }
- }
- }
- $({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- Promise: PromiseConstructor
- });
- setToStringTag(PromiseConstructor, PROMISE, false, true);
- setSpecies(PROMISE);
- }, { "../internals/a-callable": 95, "../internals/an-instance": 100, "../internals/engine-is-node": 143, "../internals/export": 149, "../internals/function-call": 155, "../internals/global": 163, "../internals/host-report-errors": 166, "../internals/internal-state": 173, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/is-pure": 181, "../internals/microtask": 189, "../internals/new-promise-capability": 193, "../internals/object-set-prototype-of": 208, "../internals/perform": 214, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/queue": 220, "../internals/redefine": 222, "../internals/redefine-all": 221, "../internals/set-species": 233, "../internals/set-to-string-tag": 234, "../internals/species-constructor": 238, "../internals/task": 243 }], 295: [function(require2, module3, exports3) {
- require2("../modules/es.promise.constructor");
- require2("../modules/es.promise.all");
- require2("../modules/es.promise.catch");
- require2("../modules/es.promise.race");
- require2("../modules/es.promise.reject");
- require2("../modules/es.promise.resolve");
- }, { "../modules/es.promise.all": 292, "../modules/es.promise.catch": 293, "../modules/es.promise.constructor": 294, "../modules/es.promise.race": 296, "../modules/es.promise.reject": 297, "../modules/es.promise.resolve": 298 }], 296: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var call = require2("../internals/function-call");
- var aCallable = require2("../internals/a-callable");
- var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
- var perform = require2("../internals/perform");
- var iterate = require2("../internals/iterate");
- var PROMISE_STATICS_INCORRECT_ITERATION = require2("../internals/promise-statics-incorrect-iteration");
- $({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var reject = capability.reject;
- var result = perform(function() {
- var $promiseResolve = aCallable(C.resolve);
- iterate(iterable, function(promise) {
- call($promiseResolve, C, promise).then(capability.resolve, reject);
- });
- });
- if (result.error)
- reject(result.value);
- return capability.promise;
- }
- });
- }, { "../internals/a-callable": 95, "../internals/export": 149, "../internals/function-call": 155, "../internals/iterate": 184, "../internals/new-promise-capability": 193, "../internals/perform": 214, "../internals/promise-statics-incorrect-iteration": 218 }], 297: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var call = require2("../internals/function-call");
- var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
- var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
- $({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- reject: function reject(r) {
- var capability = newPromiseCapabilityModule.f(this);
- call(capability.reject, void 0, r);
- return capability.promise;
- }
- });
- }, { "../internals/export": 149, "../internals/function-call": 155, "../internals/new-promise-capability": 193, "../internals/promise-constructor-detection": 215 }], 298: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var getBuiltIn = require2("../internals/get-built-in");
- var IS_PURE = require2("../internals/is-pure");
- var NativePromiseConstructor = require2("../internals/promise-native-constructor");
- var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
- var promiseResolve = require2("../internals/promise-resolve");
- var PromiseConstructorWrapper = getBuiltIn("Promise");
- var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
- $({ target: "Promise", stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
- resolve: function resolve(x) {
- return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
- }
- });
- }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/is-pure": 181, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/promise-resolve": 217 }], 299: [function(require2, module3, exports3) {
- var DESCRIPTORS = require2("../internals/descriptors");
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var isForced = require2("../internals/is-forced");
- var inheritIfRequired = require2("../internals/inherit-if-required");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var isRegExp = require2("../internals/is-regexp");
- var toString = require2("../internals/to-string");
- var getRegExpFlags = require2("../internals/regexp-get-flags");
- var stickyHelpers = require2("../internals/regexp-sticky-helpers");
- var proxyAccessor = require2("../internals/proxy-accessor");
- var redefine = require2("../internals/redefine");
- var fails = require2("../internals/fails");
- var hasOwn = require2("../internals/has-own-property");
- var enforceInternalState = require2("../internals/internal-state").enforce;
- var setSpecies = require2("../internals/set-species");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var UNSUPPORTED_DOT_ALL = require2("../internals/regexp-unsupported-dot-all");
- var UNSUPPORTED_NCG = require2("../internals/regexp-unsupported-ncg");
- var MATCH = wellKnownSymbol("match");
- var NativeRegExp = global2.RegExp;
- var RegExpPrototype = NativeRegExp.prototype;
- var SyntaxError2 = global2.SyntaxError;
- var exec = uncurryThis(RegExpPrototype.exec);
- var charAt = uncurryThis("".charAt);
- var replace = uncurryThis("".replace);
- var stringIndexOf = uncurryThis("".indexOf);
- var stringSlice = uncurryThis("".slice);
- var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
- var re1 = /a/g;
- var re2 = /a/g;
- var CORRECT_NEW = new NativeRegExp(re1) !== re1;
- var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
- var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function() {
- re2[MATCH] = false;
- return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, "i") != "/a/i";
- }));
- var handleDotAll = function(string) {
- var length = string.length;
- var index2 = 0;
- var result = "";
- var brackets = false;
- var chr;
- for (; index2 <= length; index2++) {
- chr = charAt(string, index2);
- if (chr === "\\") {
- result += chr + charAt(string, ++index2);
- continue;
- }
- if (!brackets && chr === ".") {
- result += "[\\s\\S]";
- } else {
- if (chr === "[") {
- brackets = true;
- } else if (chr === "]") {
- brackets = false;
- }
- result += chr;
- }
- }
- return result;
- };
- var handleNCG = function(string) {
- var length = string.length;
- var index2 = 0;
- var result = "";
- var named = [];
- var names = {};
- var brackets = false;
- var ncg = false;
- var groupid = 0;
- var groupname = "";
- var chr;
- for (; index2 <= length; index2++) {
- chr = charAt(string, index2);
- if (chr === "\\") {
- chr = chr + charAt(string, ++index2);
- } else if (chr === "]") {
- brackets = false;
- } else if (!brackets)
- switch (true) {
- case chr === "[":
- brackets = true;
- break;
- case chr === "(":
- if (exec(IS_NCG, stringSlice(string, index2 + 1))) {
- index2 += 2;
- ncg = true;
- }
- result += chr;
- groupid++;
- continue;
- case (chr === ">" && ncg):
- if (groupname === "" || hasOwn(names, groupname)) {
- throw new SyntaxError2("Invalid capture group name");
- }
- names[groupname] = true;
- named[named.length] = [groupname, groupid];
- ncg = false;
- groupname = "";
- continue;
- }
- if (ncg)
- groupname += chr;
- else
- result += chr;
- }
- return [result, named];
- };
- if (isForced("RegExp", BASE_FORCED)) {
- var RegExpWrapper = function RegExp2(pattern, flags) {
- var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
- var patternIsRegExp = isRegExp(pattern);
- var flagsAreUndefined = flags === void 0;
- var groups = [];
- var rawPattern = pattern;
- var rawFlags, dotAll, sticky, handled, result, state;
- if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
- return pattern;
- }
- if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
- pattern = pattern.source;
- if (flagsAreUndefined)
- flags = getRegExpFlags(rawPattern);
- }
- pattern = pattern === void 0 ? "" : toString(pattern);
- flags = flags === void 0 ? "" : toString(flags);
- rawPattern = pattern;
- if (UNSUPPORTED_DOT_ALL && "dotAll" in re1) {
- dotAll = !!flags && stringIndexOf(flags, "s") > -1;
- if (dotAll)
- flags = replace(flags, /s/g, "");
- }
- rawFlags = flags;
- if (MISSED_STICKY && "sticky" in re1) {
- sticky = !!flags && stringIndexOf(flags, "y") > -1;
- if (sticky && UNSUPPORTED_Y)
- flags = replace(flags, /y/g, "");
- }
- if (UNSUPPORTED_NCG) {
- handled = handleNCG(pattern);
- pattern = handled[0];
- groups = handled[1];
- }
- result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
- if (dotAll || sticky || groups.length) {
- state = enforceInternalState(result);
- if (dotAll) {
- state.dotAll = true;
- state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
- }
- if (sticky)
- state.sticky = true;
- if (groups.length)
- state.groups = groups;
- }
- if (pattern !== rawPattern)
- try {
- createNonEnumerableProperty(result, "source", rawPattern === "" ? "(?:)" : rawPattern);
- } catch (error) {
- }
- return result;
- };
- for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index; ) {
- proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
- }
- RegExpPrototype.constructor = RegExpWrapper;
- RegExpWrapper.prototype = RegExpPrototype;
- redefine(global2, "RegExp", RegExpWrapper);
- }
- setSpecies("RegExp");
- }, { "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/internal-state": 173, "../internals/is-forced": 178, "../internals/is-regexp": 182, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/proxy-accessor": 219, "../internals/redefine": 222, "../internals/regexp-get-flags": 226, "../internals/regexp-sticky-helpers": 227, "../internals/regexp-unsupported-dot-all": 228, "../internals/regexp-unsupported-ncg": 229, "../internals/set-species": 233, "../internals/to-string": 256, "../internals/well-known-symbol": 268 }], 300: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var exec = require2("../internals/regexp-exec");
- $({ target: "RegExp", proto: true, forced: /./.exec !== exec }, {
- exec
- });
- }, { "../internals/export": 149, "../internals/regexp-exec": 224 }], 301: [function(require2, module3, exports3) {
- "use strict";
- var PROPER_FUNCTION_NAME = require2("../internals/function-name").PROPER;
- var redefine = require2("../internals/redefine");
- var anObject = require2("../internals/an-object");
- var $toString = require2("../internals/to-string");
- var fails = require2("../internals/fails");
- var getRegExpFlags = require2("../internals/regexp-get-flags");
- var TO_STRING = "toString";
- var RegExpPrototype = RegExp.prototype;
- var n$ToString = RegExpPrototype[TO_STRING];
- var NOT_GENERIC = fails(function() {
- return n$ToString.call({ source: "a", flags: "b" }) != "/a/b";
- });
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
- if (NOT_GENERIC || INCORRECT_NAME) {
- redefine(RegExp.prototype, TO_STRING, function toString() {
- var R = anObject(this);
- var pattern = $toString(R.source);
- var flags = $toString(getRegExpFlags(R));
- return "/" + pattern + "/" + flags;
- }, { unsafe: true });
- }
- }, { "../internals/an-object": 101, "../internals/fails": 150, "../internals/function-name": 156, "../internals/redefine": 222, "../internals/regexp-get-flags": 226, "../internals/to-string": 256 }], 302: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var notARegExp = require2("../internals/not-a-regexp");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var toString = require2("../internals/to-string");
- var correctIsRegExpLogic = require2("../internals/correct-is-regexp-logic");
- var stringIndexOf = uncurryThis("".indexOf);
- $({ target: "String", proto: true, forced: !correctIsRegExpLogic("includes") }, {
- includes: function includes(searchString) {
- return !!~stringIndexOf(
- toString(requireObjectCoercible(this)),
- toString(notARegExp(searchString)),
- arguments.length > 1 ? arguments[1] : void 0
- );
- }
- });
- }, { "../internals/correct-is-regexp-logic": 126, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/not-a-regexp": 194, "../internals/require-object-coercible": 230, "../internals/to-string": 256 }], 303: [function(require2, module3, exports3) {
- "use strict";
- var charAt = require2("../internals/string-multibyte").charAt;
- var toString = require2("../internals/to-string");
- var InternalStateModule = require2("../internals/internal-state");
- var defineIterator = require2("../internals/define-iterator");
- var STRING_ITERATOR = "String Iterator";
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- defineIterator(String, "String", function(iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: toString(iterated),
- index: 0
- });
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length)
- return { value: void 0, done: true };
- point = charAt(string, index);
- state.index += point.length;
- return { value: point, done: false };
- });
- }, { "../internals/define-iterator": 132, "../internals/internal-state": 173, "../internals/string-multibyte": 239, "../internals/to-string": 256 }], 304: [function(require2, module3, exports3) {
- "use strict";
- var call = require2("../internals/function-call");
- var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
- var anObject = require2("../internals/an-object");
- var toLength = require2("../internals/to-length");
- var toString = require2("../internals/to-string");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var getMethod = require2("../internals/get-method");
- var advanceStringIndex = require2("../internals/advance-string-index");
- var regExpExec = require2("../internals/regexp-exec-abstract");
- fixRegExpWellKnownSymbolLogic("match", function(MATCH, nativeMatch, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.es/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = requireObjectCoercible(this);
- var matcher = regexp == void 0 ? void 0 : getMethod(regexp, MATCH);
- return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
- function(string) {
- var rx = anObject(this);
- var S = toString(string);
- var res = maybeCallNative(nativeMatch, rx, S);
- if (res.done)
- return res.value;
- if (!rx.global)
- return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = toString(result[0]);
- A[n] = matchStr;
- if (matchStr === "")
- rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-call": 155, "../internals/get-method": 161, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/to-length": 249, "../internals/to-string": 256 }], 305: [function(require2, module3, exports3) {
- "use strict";
- var apply = require2("../internals/function-apply");
- var call = require2("../internals/function-call");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
- var fails = require2("../internals/fails");
- var anObject = require2("../internals/an-object");
- var isCallable = require2("../internals/is-callable");
- var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
- var toLength = require2("../internals/to-length");
- var toString = require2("../internals/to-string");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var advanceStringIndex = require2("../internals/advance-string-index");
- var getMethod = require2("../internals/get-method");
- var getSubstitution = require2("../internals/get-substitution");
- var regExpExec = require2("../internals/regexp-exec-abstract");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var REPLACE = wellKnownSymbol("replace");
- var max = Math.max;
- var min = Math.min;
- var concat = uncurryThis([].concat);
- var push = uncurryThis([].push);
- var stringIndexOf = uncurryThis("".indexOf);
- var stringSlice = uncurryThis("".slice);
- var maybeToString = function(it) {
- return it === void 0 ? it : String(it);
- };
- var REPLACE_KEEPS_$0 = function() {
- return "a".replace(/./, "$0") === "$0";
- }();
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
- if (/./[REPLACE]) {
- return /./[REPLACE]("a", "$0") === "";
- }
- return false;
- }();
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
- var re = /./;
- re.exec = function() {
- var result = [];
- result.groups = { a: "7" };
- return result;
- };
- return "".replace(re, "$<a>") !== "7";
- });
- fixRegExpWellKnownSymbolLogic("replace", function(_, nativeReplace, maybeCallNative) {
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
- return [
- // `String.prototype.replace` method
- // https://tc39.es/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = requireObjectCoercible(this);
- var replacer = searchValue == void 0 ? void 0 : getMethod(searchValue, REPLACE);
- return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
- function(string, replaceValue) {
- var rx = anObject(this);
- var S = toString(string);
- if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
- if (res.done)
- return res.value;
- }
- var functionalReplace = isCallable(replaceValue);
- if (!functionalReplace)
- replaceValue = toString(replaceValue);
- var global2 = rx.global;
- if (global2) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null)
- break;
- push(results, result);
- if (!global2)
- break;
- var matchStr = toString(result[0]);
- if (matchStr === "")
- rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = "";
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = toString(result[0]);
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
- var captures = [];
- for (var j = 1; j < result.length; j++)
- push(captures, maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = concat([matched], captures, position, S);
- if (namedCaptures !== void 0)
- push(replacerArgs, namedCaptures);
- var replacement = toString(apply(replaceValue, void 0, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + stringSlice(S, nextSourcePosition);
- }
- ];
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
- }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/fails": 150, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-method": 161, "../internals/get-substitution": 162, "../internals/is-callable": 176, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249, "../internals/to-string": 256, "../internals/well-known-symbol": 268 }], 306: [function(require2, module3, exports3) {
- "use strict";
- var call = require2("../internals/function-call");
- var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
- var anObject = require2("../internals/an-object");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var sameValue = require2("../internals/same-value");
- var toString = require2("../internals/to-string");
- var getMethod = require2("../internals/get-method");
- var regExpExec = require2("../internals/regexp-exec-abstract");
- fixRegExpWellKnownSymbolLogic("search", function(SEARCH, nativeSearch, maybeCallNative) {
- return [
- // `String.prototype.search` method
- // https://tc39.es/ecma262/#sec-string.prototype.search
- function search(regexp) {
- var O = requireObjectCoercible(this);
- var searcher = regexp == void 0 ? void 0 : getMethod(regexp, SEARCH);
- return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
- },
- // `RegExp.prototype[@@search]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
- function(string) {
- var rx = anObject(this);
- var S = toString(string);
- var res = maybeCallNative(nativeSearch, rx, S);
- if (res.done)
- return res.value;
- var previousLastIndex = rx.lastIndex;
- if (!sameValue(previousLastIndex, 0))
- rx.lastIndex = 0;
- var result = regExpExec(rx, S);
- if (!sameValue(rx.lastIndex, previousLastIndex))
- rx.lastIndex = previousLastIndex;
- return result === null ? -1 : result.index;
- }
- ];
- });
- }, { "../internals/an-object": 101, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-call": 155, "../internals/get-method": 161, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/same-value": 231, "../internals/to-string": 256 }], 307: [function(require2, module3, exports3) {
- "use strict";
- var apply = require2("../internals/function-apply");
- var call = require2("../internals/function-call");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
- var isRegExp = require2("../internals/is-regexp");
- var anObject = require2("../internals/an-object");
- var requireObjectCoercible = require2("../internals/require-object-coercible");
- var speciesConstructor = require2("../internals/species-constructor");
- var advanceStringIndex = require2("../internals/advance-string-index");
- var toLength = require2("../internals/to-length");
- var toString = require2("../internals/to-string");
- var getMethod = require2("../internals/get-method");
- var arraySlice = require2("../internals/array-slice-simple");
- var callRegExpExec = require2("../internals/regexp-exec-abstract");
- var regexpExec = require2("../internals/regexp-exec");
- var stickyHelpers = require2("../internals/regexp-sticky-helpers");
- var fails = require2("../internals/fails");
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
- var MAX_UINT32 = 4294967295;
- var min = Math.min;
- var $push = [].push;
- var exec = uncurryThis(/./.exec);
- var push = uncurryThis($push);
- var stringSlice = uncurryThis("".slice);
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function() {
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function() {
- return originalExec.apply(this, arguments);
- };
- var result = "ab".split(re);
- return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
- });
- fixRegExpWellKnownSymbolLogic("split", function(SPLIT, nativeSplit, maybeCallNative) {
- var internalSplit;
- if ("abbc".split(/(b)*/)[1] == "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
- "test".split(/(?:)/, -1).length != 4 || "ab".split(/(?:ab)*/).length != 2 || ".".split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
- ".".split(/()()/).length > 1 || "".split(/.?/).length) {
- internalSplit = function(separator, limit) {
- var string = toString(requireObjectCoercible(this));
- var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
- if (lim === 0)
- return [];
- if (separator === void 0)
- return [string];
- if (!isRegExp(separator)) {
- return call(nativeSplit, string, separator, lim);
- }
- var output = [];
- var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : "");
- var lastLastIndex = 0;
- var separatorCopy = new RegExp(separator.source, flags + "g");
- var match, lastIndex, lastLength;
- while (match = call(regexpExec, separatorCopy, string)) {
- lastIndex = separatorCopy.lastIndex;
- if (lastIndex > lastLastIndex) {
- push(output, stringSlice(string, lastLastIndex, match.index));
- if (match.length > 1 && match.index < string.length)
- apply($push, output, arraySlice(match, 1));
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= lim)
- break;
- }
- if (separatorCopy.lastIndex === match.index)
- separatorCopy.lastIndex++;
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !exec(separatorCopy, ""))
- push(output, "");
- } else
- push(output, stringSlice(string, lastLastIndex));
- return output.length > lim ? arraySlice(output, 0, lim) : output;
- };
- } else if ("0".split(void 0, 0).length) {
- internalSplit = function(separator, limit) {
- return separator === void 0 && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
- };
- } else
- internalSplit = nativeSplit;
- return [
- // `String.prototype.split` method
- // https://tc39.es/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = requireObjectCoercible(this);
- var splitter = separator == void 0 ? void 0 : getMethod(separator, SPLIT);
- return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function(string, limit) {
- var rx = anObject(this);
- var S = toString(string);
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
- if (res.done)
- return res.value;
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
- var splitter = new C(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
- var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
- if (lim === 0)
- return [];
- if (S.length === 0)
- return callRegExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
- var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
- var e;
- if (z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- push(A, stringSlice(S, p, q));
- if (A.length === lim)
- return A;
- for (var i = 1; i <= z.length - 1; i++) {
- push(A, z[i]);
- if (A.length === lim)
- return A;
- }
- q = p = e;
- }
- }
- push(A, stringSlice(S, p));
- return A;
- }
- ];
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
- }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/array-slice-simple": 116, "../internals/fails": 150, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-method": 161, "../internals/is-regexp": 182, "../internals/regexp-exec": 224, "../internals/regexp-exec-abstract": 223, "../internals/regexp-sticky-helpers": 227, "../internals/require-object-coercible": 230, "../internals/species-constructor": 238, "../internals/to-length": 249, "../internals/to-string": 256 }], 308: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var $trim = require2("../internals/string-trim").trim;
- var forcedStringTrimMethod = require2("../internals/string-trim-forced");
- $({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
- trim: function trim() {
- return $trim(this);
- }
- });
- }, { "../internals/export": 149, "../internals/string-trim": 241, "../internals/string-trim-forced": 240 }], 309: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var IS_PURE = require2("../internals/is-pure");
- var DESCRIPTORS = require2("../internals/descriptors");
- var NATIVE_SYMBOL = require2("../internals/native-symbol");
- var fails = require2("../internals/fails");
- var hasOwn = require2("../internals/has-own-property");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var anObject = require2("../internals/an-object");
- var toIndexedObject = require2("../internals/to-indexed-object");
- var toPropertyKey = require2("../internals/to-property-key");
- var $toString = require2("../internals/to-string");
- var createPropertyDescriptor = require2("../internals/create-property-descriptor");
- var nativeObjectCreate = require2("../internals/object-create");
- var objectKeys = require2("../internals/object-keys");
- var getOwnPropertyNamesModule = require2("../internals/object-get-own-property-names");
- var getOwnPropertyNamesExternal = require2("../internals/object-get-own-property-names-external");
- var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
- var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
- var definePropertyModule = require2("../internals/object-define-property");
- var definePropertiesModule = require2("../internals/object-define-properties");
- var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
- var redefine = require2("../internals/redefine");
- var shared = require2("../internals/shared");
- var sharedKey = require2("../internals/shared-key");
- var hiddenKeys = require2("../internals/hidden-keys");
- var uid = require2("../internals/uid");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var wrappedWellKnownSymbolModule = require2("../internals/well-known-symbol-wrapped");
- var defineWellKnownSymbol = require2("../internals/define-well-known-symbol");
- var defineSymbolToPrimitive = require2("../internals/symbol-define-to-primitive");
- var setToStringTag = require2("../internals/set-to-string-tag");
- var InternalStateModule = require2("../internals/internal-state");
- var $forEach = require2("../internals/array-iteration").forEach;
- var HIDDEN = sharedKey("hidden");
- var SYMBOL = "Symbol";
- var PROTOTYPE = "prototype";
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(SYMBOL);
- var ObjectPrototype = Object[PROTOTYPE];
- var $Symbol = global2.Symbol;
- var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
- var TypeError2 = global2.TypeError;
- var QObject = global2.QObject;
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
- var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
- var push = uncurryThis([].push);
- var AllSymbols = shared("symbols");
- var ObjectPrototypeSymbols = shared("op-symbols");
- var WellKnownSymbolsStore = shared("wks");
- var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- var setSymbolDescriptor = DESCRIPTORS && fails(function() {
- return nativeObjectCreate(nativeDefineProperty({}, "a", {
- get: function() {
- return nativeDefineProperty(this, "a", { value: 7 }).a;
- }
- })).a != 7;
- }) ? function(O, P, Attributes) {
- var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
- if (ObjectPrototypeDescriptor)
- delete ObjectPrototype[P];
- nativeDefineProperty(O, P, Attributes);
- if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
- nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
- }
- } : nativeDefineProperty;
- var wrap = function(tag, description) {
- var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
- setInternalState(symbol, {
- type: SYMBOL,
- tag,
- description
- });
- if (!DESCRIPTORS)
- symbol.description = description;
- return symbol;
- };
- var $defineProperty = function defineProperty(O, P, Attributes) {
- if (O === ObjectPrototype)
- $defineProperty(ObjectPrototypeSymbols, P, Attributes);
- anObject(O);
- var key = toPropertyKey(P);
- anObject(Attributes);
- if (hasOwn(AllSymbols, key)) {
- if (!Attributes.enumerable) {
- if (!hasOwn(O, HIDDEN))
- nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
- O[HIDDEN][key] = true;
- } else {
- if (hasOwn(O, HIDDEN) && O[HIDDEN][key])
- O[HIDDEN][key] = false;
- Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
- }
- return setSymbolDescriptor(O, key, Attributes);
- }
- return nativeDefineProperty(O, key, Attributes);
- };
- var $defineProperties = function defineProperties(O, Properties) {
- anObject(O);
- var properties = toIndexedObject(Properties);
- var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
- $forEach(keys, function(key) {
- if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key))
- $defineProperty(O, key, properties[key]);
- });
- return O;
- };
- var $create = function create(O, Properties) {
- return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(V) {
- var P = toPropertyKey(V);
- var enumerable = call(nativePropertyIsEnumerable, this, P);
- if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P))
- return false;
- return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
- var it = toIndexedObject(O);
- var key = toPropertyKey(P);
- if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key))
- return;
- var descriptor = nativeGetOwnPropertyDescriptor(it, key);
- if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
- descriptor.enumerable = true;
- }
- return descriptor;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(O) {
- var names = nativeGetOwnPropertyNames(toIndexedObject(O));
- var result = [];
- $forEach(names, function(key) {
- if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key))
- push(result, key);
- });
- return result;
- };
- var $getOwnPropertySymbols = function(O) {
- var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
- var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
- var result = [];
- $forEach(names, function(key) {
- if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
- push(result, AllSymbols[key]);
- }
- });
- return result;
- };
- if (!NATIVE_SYMBOL) {
- $Symbol = function Symbol2() {
- if (isPrototypeOf(SymbolPrototype, this))
- throw TypeError2("Symbol is not a constructor");
- var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]);
- var tag = uid(description);
- var setter = function(value) {
- if (this === ObjectPrototype)
- call(setter, ObjectPrototypeSymbols, value);
- if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag))
- this[HIDDEN][tag] = false;
- setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
- };
- if (DESCRIPTORS && USE_SETTER)
- setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
- return wrap(tag, description);
- };
- SymbolPrototype = $Symbol[PROTOTYPE];
- redefine(SymbolPrototype, "toString", function toString() {
- return getInternalState(this).tag;
- });
- redefine($Symbol, "withoutSetter", function(description) {
- return wrap(uid(description), description);
- });
- propertyIsEnumerableModule.f = $propertyIsEnumerable;
- definePropertyModule.f = $defineProperty;
- definePropertiesModule.f = $defineProperties;
- getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
- getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
- getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
- wrappedWellKnownSymbolModule.f = function(name) {
- return wrap(wellKnownSymbol(name), name);
- };
- if (DESCRIPTORS) {
- nativeDefineProperty(SymbolPrototype, "description", {
- configurable: true,
- get: function description() {
- return getInternalState(this).description;
- }
- });
- if (!IS_PURE) {
- redefine(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
- }
- }
- }
- $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
- Symbol: $Symbol
- });
- $forEach(objectKeys(WellKnownSymbolsStore), function(name) {
- defineWellKnownSymbol(name);
- });
- $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
- useSetter: function() {
- USE_SETTER = true;
- },
- useSimple: function() {
- USE_SETTER = false;
- }
- });
- $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- create: $create,
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- defineProperty: $defineProperty,
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- defineProperties: $defineProperties,
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor
- });
- $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
- // `Object.getOwnPropertyNames` method
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
- getOwnPropertyNames: $getOwnPropertyNames
- });
- defineSymbolToPrimitive();
- setToStringTag($Symbol, SYMBOL);
- hiddenKeys[HIDDEN] = true;
- }, { "../internals/an-object": 101, "../internals/array-iteration": 111, "../internals/create-property-descriptor": 130, "../internals/define-well-known-symbol": 133, "../internals/descriptors": 134, "../internals/export": 149, "../internals/fails": 150, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/internal-state": 173, "../internals/is-pure": 181, "../internals/native-symbol": 191, "../internals/object-create": 196, "../internals/object-define-properties": 197, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-get-own-property-names-external": 200, "../internals/object-get-own-property-symbols": 202, "../internals/object-is-prototype-of": 204, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/redefine": 222, "../internals/set-to-string-tag": 234, "../internals/shared": 237, "../internals/shared-key": 235, "../internals/symbol-define-to-primitive": 242, "../internals/to-indexed-object": 247, "../internals/to-property-key": 254, "../internals/to-string": 256, "../internals/uid": 263, "../internals/well-known-symbol": 268, "../internals/well-known-symbol-wrapped": 267 }], 310: [function(require2, module3, exports3) {
- "use strict";
- var $ = require2("../internals/export");
- var DESCRIPTORS = require2("../internals/descriptors");
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var hasOwn = require2("../internals/has-own-property");
- var isCallable = require2("../internals/is-callable");
- var isPrototypeOf = require2("../internals/object-is-prototype-of");
- var toString = require2("../internals/to-string");
- var defineProperty = require2("../internals/object-define-property").f;
- var copyConstructorProperties = require2("../internals/copy-constructor-properties");
- var NativeSymbol = global2.Symbol;
- var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
- if (DESCRIPTORS && isCallable(NativeSymbol) && (!("description" in SymbolPrototype) || // Safari 12 bug
- NativeSymbol().description !== void 0)) {
- var EmptyStringDescriptionStore = {};
- var SymbolWrapper = function Symbol2() {
- var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : toString(arguments[0]);
- var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
- if (description === "")
- EmptyStringDescriptionStore[result] = true;
- return result;
- };
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
- SymbolWrapper.prototype = SymbolPrototype;
- SymbolPrototype.constructor = SymbolWrapper;
- var NATIVE_SYMBOL = String(NativeSymbol("test")) == "Symbol(test)";
- var symbolToString = uncurryThis(SymbolPrototype.toString);
- var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
- var regexp = /^Symbol\((.*)\)[^)]+$/;
- var replace = uncurryThis("".replace);
- var stringSlice = uncurryThis("".slice);
- defineProperty(SymbolPrototype, "description", {
- configurable: true,
- get: function description() {
- var symbol = symbolValueOf(this);
- var string = symbolToString(symbol);
- if (hasOwn(EmptyStringDescriptionStore, symbol))
- return "";
- var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, "$1");
- return desc === "" ? void 0 : desc;
- }
- });
- $({ global: true, forced: true }, {
- Symbol: SymbolWrapper
- });
- }
- }, { "../internals/copy-constructor-properties": 125, "../internals/descriptors": 134, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/object-define-property": 198, "../internals/object-is-prototype-of": 204, "../internals/to-string": 256 }], 311: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var getBuiltIn = require2("../internals/get-built-in");
- var hasOwn = require2("../internals/has-own-property");
- var toString = require2("../internals/to-string");
- var shared = require2("../internals/shared");
- var NATIVE_SYMBOL_REGISTRY = require2("../internals/native-symbol-registry");
- var StringToSymbolRegistry = shared("string-to-symbol-registry");
- var SymbolToStringRegistry = shared("symbol-to-string-registry");
- $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
- "for": function(key) {
- var string = toString(key);
- if (hasOwn(StringToSymbolRegistry, string))
- return StringToSymbolRegistry[string];
- var symbol = getBuiltIn("Symbol")(string);
- StringToSymbolRegistry[string] = symbol;
- SymbolToStringRegistry[symbol] = string;
- return symbol;
- }
- });
- }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/has-own-property": 164, "../internals/native-symbol-registry": 190, "../internals/shared": 237, "../internals/to-string": 256 }], 312: [function(require2, module3, exports3) {
- var defineWellKnownSymbol = require2("../internals/define-well-known-symbol");
- defineWellKnownSymbol("iterator");
- }, { "../internals/define-well-known-symbol": 133 }], 313: [function(require2, module3, exports3) {
- require2("../modules/es.symbol.constructor");
- require2("../modules/es.symbol.for");
- require2("../modules/es.symbol.key-for");
- require2("../modules/es.json.stringify");
- require2("../modules/es.object.get-own-property-symbols");
- }, { "../modules/es.json.stringify": 285, "../modules/es.object.get-own-property-symbols": 289, "../modules/es.symbol.constructor": 309, "../modules/es.symbol.for": 311, "../modules/es.symbol.key-for": 314 }], 314: [function(require2, module3, exports3) {
- var $ = require2("../internals/export");
- var hasOwn = require2("../internals/has-own-property");
- var isSymbol = require2("../internals/is-symbol");
- var tryToString = require2("../internals/try-to-string");
- var shared = require2("../internals/shared");
- var NATIVE_SYMBOL_REGISTRY = require2("../internals/native-symbol-registry");
- var SymbolToStringRegistry = shared("symbol-to-string-registry");
- $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym))
- throw TypeError(tryToString(sym) + " is not a symbol");
- if (hasOwn(SymbolToStringRegistry, sym))
- return SymbolToStringRegistry[sym];
- }
- });
- }, { "../internals/export": 149, "../internals/has-own-property": 164, "../internals/is-symbol": 183, "../internals/native-symbol-registry": 190, "../internals/shared": 237, "../internals/try-to-string": 257 }], 315: [function(require2, module3, exports3) {
- "use strict";
- var uncurryThis = require2("../internals/function-uncurry-this");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $ArrayCopyWithin = require2("../internals/array-copy-within");
- var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("copyWithin", function copyWithin(target, start) {
- return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-copy-within": 105, "../internals/function-uncurry-this": 157 }], 316: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $every = require2("../internals/array-iteration").every;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("every", function every(callbackfn) {
- return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 317: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var call = require2("../internals/function-call");
- var $fill = require2("../internals/array-fill");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("fill", function fill(value) {
- var length = arguments.length;
- return call(
- $fill,
- aTypedArray(this),
- value,
- length > 1 ? arguments[1] : void 0,
- length > 2 ? arguments[2] : void 0
- );
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-fill": 106, "../internals/function-call": 155 }], 318: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $filter = require2("../internals/array-iteration").filter;
- var fromSpeciesAndList = require2("../internals/typed-array-from-species-and-list");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("filter", function filter(callbackfn) {
- var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- return fromSpeciesAndList(this, list);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/typed-array-from-species-and-list": 260 }], 319: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $findIndex = require2("../internals/array-iteration").findIndex;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("findIndex", function findIndex(predicate) {
- return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 320: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $find = require2("../internals/array-iteration").find;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("find", function find(predicate) {
- return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 321: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $forEach = require2("../internals/array-iteration").forEach;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("forEach", function forEach(callbackfn) {
- $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 322: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $includes = require2("../internals/array-includes").includes;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("includes", function includes(searchElement) {
- return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-includes": 110 }], 323: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $indexOf = require2("../internals/array-includes").indexOf;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("indexOf", function indexOf(searchElement) {
- return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-includes": 110 }], 324: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var fails = require2("../internals/fails");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var ArrayIterators = require2("../modules/es.array.iterator");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var ITERATOR = wellKnownSymbol("iterator");
- var Uint8Array2 = global2.Uint8Array;
- var arrayValues = uncurryThis(ArrayIterators.values);
- var arrayKeys = uncurryThis(ArrayIterators.keys);
- var arrayEntries = uncurryThis(ArrayIterators.entries);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var TypedArrayPrototype = Uint8Array2 && Uint8Array2.prototype;
- var GENERIC = !fails(function() {
- TypedArrayPrototype[ITERATOR].call([1]);
- });
- var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === "values";
- var typedArrayValues = function values() {
- return arrayValues(aTypedArray(this));
- };
- exportTypedArrayMethod("entries", function entries() {
- return arrayEntries(aTypedArray(this));
- }, GENERIC);
- exportTypedArrayMethod("keys", function keys() {
- return arrayKeys(aTypedArray(this));
- }, GENERIC);
- exportTypedArrayMethod("values", typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
- exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
- }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/well-known-symbol": 268, "../modules/es.array.iterator": 278 }], 325: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $join = uncurryThis([].join);
- exportTypedArrayMethod("join", function join(separator) {
- return $join(aTypedArray(this), separator);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/function-uncurry-this": 157 }], 326: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var apply = require2("../internals/function-apply");
- var $lastIndexOf = require2("../internals/array-last-index-of");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("lastIndexOf", function lastIndexOf(searchElement) {
- var length = arguments.length;
- return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-last-index-of": 112, "../internals/function-apply": 152 }], 327: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $map = require2("../internals/array-iteration").map;
- var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("map", function map(mapfn) {
- return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : void 0, function(O, length) {
- return new (typedArraySpeciesConstructor(O))(length);
- });
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/typed-array-species-constructor": 262 }], 328: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $reduceRight = require2("../internals/array-reduce").right;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("reduceRight", function reduceRight(callbackfn) {
- var length = arguments.length;
- return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-reduce": 115 }], 329: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $reduce = require2("../internals/array-reduce").left;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("reduce", function reduce(callbackfn) {
- var length = arguments.length;
- return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-reduce": 115 }], 330: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var floor = Math.floor;
- exportTypedArrayMethod("reverse", function reverse() {
- var that = this;
- var length = aTypedArray(that).length;
- var middle = floor(length / 2);
- var index = 0;
- var value;
- while (index < middle) {
- value = that[index];
- that[index++] = that[--length];
- that[length] = value;
- }
- return that;
- });
- }, { "../internals/array-buffer-view-core": 103 }], 331: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var call = require2("../internals/function-call");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var lengthOfArrayLike = require2("../internals/length-of-array-like");
- var toOffset = require2("../internals/to-offset");
- var toIndexedObject = require2("../internals/to-object");
- var fails = require2("../internals/fails");
- var RangeError2 = global2.RangeError;
- var Int8Array2 = global2.Int8Array;
- var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
- var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function() {
- var array = new Uint8ClampedArray(2);
- call($set, array, { length: 1, 0: 3 }, 1);
- return array[1] !== 3;
- });
- var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function() {
- var array = new Int8Array2(2);
- array.set(1);
- array.set("2", 1);
- return array[0] !== 0 || array[1] !== 2;
- });
- exportTypedArrayMethod("set", function set(arrayLike) {
- aTypedArray(this);
- var offset = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1);
- var src = toIndexedObject(arrayLike);
- if (WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS)
- return call($set, this, src, offset);
- var length = this.length;
- var len = lengthOfArrayLike(src);
- var index = 0;
- if (len + offset > length)
- throw RangeError2("Wrong length");
- while (index < len)
- this[offset + index] = src[index++];
- }, !WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
- }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-call": 155, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/to-offset": 251 }], 332: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
- var fails = require2("../internals/fails");
- var arraySlice = require2("../internals/array-slice");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var FORCED = fails(function() {
- new Int8Array(1).slice();
- });
- exportTypedArrayMethod("slice", function slice(start, end) {
- var list = arraySlice(aTypedArray(this), start, end);
- var C = typedArraySpeciesConstructor(this);
- var index = 0;
- var length = list.length;
- var result = new C(length);
- while (length > index)
- result[index] = list[index++];
- return result;
- }, FORCED);
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-slice": 117, "../internals/fails": 150, "../internals/typed-array-species-constructor": 262 }], 333: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var $some = require2("../internals/array-iteration").some;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("some", function some(callbackfn) {
- return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 334: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var fails = require2("../internals/fails");
- var aCallable = require2("../internals/a-callable");
- var internalSort = require2("../internals/array-sort");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var FF = require2("../internals/engine-ff-version");
- var IE_OR_EDGE = require2("../internals/engine-is-ie-or-edge");
- var V8 = require2("../internals/engine-v8-version");
- var WEBKIT = require2("../internals/engine-webkit-version");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var Uint16Array2 = global2.Uint16Array;
- var un$Sort = Uint16Array2 && uncurryThis(Uint16Array2.prototype.sort);
- var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function() {
- un$Sort(new Uint16Array2(2), null);
- }) && fails(function() {
- un$Sort(new Uint16Array2(2), {});
- }));
- var STABLE_SORT = !!un$Sort && !fails(function() {
- if (V8)
- return V8 < 74;
- if (FF)
- return FF < 67;
- if (IE_OR_EDGE)
- return true;
- if (WEBKIT)
- return WEBKIT < 602;
- var array = new Uint16Array2(516);
- var expected = Array(516);
- var index, mod;
- for (index = 0; index < 516; index++) {
- mod = index % 4;
- array[index] = 515 - index;
- expected[index] = index - 2 * mod + 3;
- }
- un$Sort(array, function(a, b) {
- return (a / 4 | 0) - (b / 4 | 0);
- });
- for (index = 0; index < 516; index++) {
- if (array[index] !== expected[index])
- return true;
- }
- });
- var getSortCompare = function(comparefn) {
- return function(x, y) {
- if (comparefn !== void 0)
- return +comparefn(x, y) || 0;
- if (y !== y)
- return -1;
- if (x !== x)
- return 1;
- if (x === 0 && y === 0)
- return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
- return x > y;
- };
- };
- exportTypedArrayMethod("sort", function sort(comparefn) {
- if (comparefn !== void 0)
- aCallable(comparefn);
- if (STABLE_SORT)
- return un$Sort(this, comparefn);
- return internalSort(aTypedArray(this), getSortCompare(comparefn));
- }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
- }, { "../internals/a-callable": 95, "../internals/array-buffer-view-core": 103, "../internals/array-sort": 118, "../internals/engine-ff-version": 138, "../internals/engine-is-ie-or-edge": 140, "../internals/engine-v8-version": 146, "../internals/engine-webkit-version": 147, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 335: [function(require2, module3, exports3) {
- "use strict";
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var toLength = require2("../internals/to-length");
- var toAbsoluteIndex = require2("../internals/to-absolute-index");
- var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- exportTypedArrayMethod("subarray", function subarray(begin, end) {
- var O = aTypedArray(this);
- var length = O.length;
- var beginIndex = toAbsoluteIndex(begin, length);
- var C = typedArraySpeciesConstructor(O);
- return new C(
- O.buffer,
- O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
- toLength((end === void 0 ? length : toAbsoluteIndex(end, length)) - beginIndex)
- );
- });
- }, { "../internals/array-buffer-view-core": 103, "../internals/to-absolute-index": 245, "../internals/to-length": 249, "../internals/typed-array-species-constructor": 262 }], 336: [function(require2, module3, exports3) {
- "use strict";
- var global2 = require2("../internals/global");
- var apply = require2("../internals/function-apply");
- var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
- var fails = require2("../internals/fails");
- var arraySlice = require2("../internals/array-slice");
- var Int8Array2 = global2.Int8Array;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $toLocaleString = [].toLocaleString;
- var TO_LOCALE_STRING_BUG = !!Int8Array2 && fails(function() {
- $toLocaleString.call(new Int8Array2(1));
- });
- var FORCED = fails(function() {
- return [1, 2].toLocaleString() != new Int8Array2([1, 2]).toLocaleString();
- }) || !fails(function() {
- Int8Array2.prototype.toLocaleString.call([1, 2]);
- });
- exportTypedArrayMethod("toLocaleString", function toLocaleString() {
- return apply(
- $toLocaleString,
- TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),
- arraySlice(arguments)
- );
- }, FORCED);
- }, { "../internals/array-buffer-view-core": 103, "../internals/array-slice": 117, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/global": 163 }], 337: [function(require2, module3, exports3) {
- "use strict";
- var exportTypedArrayMethod = require2("../internals/array-buffer-view-core").exportTypedArrayMethod;
- var fails = require2("../internals/fails");
- var global2 = require2("../internals/global");
- var uncurryThis = require2("../internals/function-uncurry-this");
- var Uint8Array2 = global2.Uint8Array;
- var Uint8ArrayPrototype = Uint8Array2 && Uint8Array2.prototype || {};
- var arrayToString = [].toString;
- var join = uncurryThis([].join);
- if (fails(function() {
- arrayToString.call({});
- })) {
- arrayToString = function toString() {
- return join(this);
- };
- }
- var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
- exportTypedArrayMethod("toString", arrayToString, IS_NOT_ARRAY_METHOD);
- }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 338: [function(require2, module3, exports3) {
- var createTypedArrayConstructor = require2("../internals/typed-array-constructor");
- createTypedArrayConstructor("Uint8", function(init) {
- return function Uint8Array2(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- }, { "../internals/typed-array-constructor": 258 }], 339: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var DOMIterables = require2("../internals/dom-iterables");
- var DOMTokenListPrototype = require2("../internals/dom-token-list-prototype");
- var forEach = require2("../internals/array-for-each");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var handlePrototype = function(CollectionPrototype) {
- if (CollectionPrototype && CollectionPrototype.forEach !== forEach)
- try {
- createNonEnumerableProperty(CollectionPrototype, "forEach", forEach);
- } catch (error) {
- CollectionPrototype.forEach = forEach;
- }
- };
- for (var COLLECTION_NAME in DOMIterables) {
- if (DOMIterables[COLLECTION_NAME]) {
- handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype);
- }
- }
- handlePrototype(DOMTokenListPrototype);
- }, { "../internals/array-for-each": 107, "../internals/create-non-enumerable-property": 129, "../internals/dom-iterables": 136, "../internals/dom-token-list-prototype": 137, "../internals/global": 163 }], 340: [function(require2, module3, exports3) {
- var global2 = require2("../internals/global");
- var DOMIterables = require2("../internals/dom-iterables");
- var DOMTokenListPrototype = require2("../internals/dom-token-list-prototype");
- var ArrayIteratorMethods = require2("../modules/es.array.iterator");
- var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
- var wellKnownSymbol = require2("../internals/well-known-symbol");
- var ITERATOR = wellKnownSymbol("iterator");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var ArrayValues = ArrayIteratorMethods.values;
- var handlePrototype = function(CollectionPrototype, COLLECTION_NAME2) {
- if (CollectionPrototype) {
- if (CollectionPrototype[ITERATOR] !== ArrayValues)
- try {
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
- } catch (error) {
- CollectionPrototype[ITERATOR] = ArrayValues;
- }
- if (!CollectionPrototype[TO_STRING_TAG]) {
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME2);
- }
- if (DOMIterables[COLLECTION_NAME2])
- for (var METHOD_NAME in ArrayIteratorMethods) {
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
- try {
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
- } catch (error) {
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
- }
- }
- }
- };
- for (var COLLECTION_NAME in DOMIterables) {
- handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype, COLLECTION_NAME);
- }
- handlePrototype(DOMTokenListPrototype, "DOMTokenList");
- }, { "../internals/create-non-enumerable-property": 129, "../internals/dom-iterables": 136, "../internals/dom-token-list-prototype": 137, "../internals/global": 163, "../internals/well-known-symbol": 268, "../modules/es.array.iterator": 278 }], 341: [function(require2, module3, exports3) {
- function isArray(arg) {
- if (Array.isArray) {
- return Array.isArray(arg);
- }
- return objectToString(arg) === "[object Array]";
- }
- exports3.isArray = isArray;
- function isBoolean(arg) {
- return typeof arg === "boolean";
- }
- exports3.isBoolean = isBoolean;
- function isNull(arg) {
- return arg === null;
- }
- exports3.isNull = isNull;
- function isNullOrUndefined(arg) {
- return arg == null;
- }
- exports3.isNullOrUndefined = isNullOrUndefined;
- function isNumber(arg) {
- return typeof arg === "number";
- }
- exports3.isNumber = isNumber;
- function isString(arg) {
- return typeof arg === "string";
- }
- exports3.isString = isString;
- function isSymbol(arg) {
- return typeof arg === "symbol";
- }
- exports3.isSymbol = isSymbol;
- function isUndefined(arg) {
- return arg === void 0;
- }
- exports3.isUndefined = isUndefined;
- function isRegExp(re) {
- return objectToString(re) === "[object RegExp]";
- }
- exports3.isRegExp = isRegExp;
- function isObject(arg) {
- return typeof arg === "object" && arg !== null;
- }
- exports3.isObject = isObject;
- function isDate(d) {
- return objectToString(d) === "[object Date]";
- }
- exports3.isDate = isDate;
- function isError(e) {
- return objectToString(e) === "[object Error]" || e instanceof Error;
- }
- exports3.isError = isError;
- function isFunction(arg) {
- return typeof arg === "function";
- }
- exports3.isFunction = isFunction;
- function isPrimitive(arg) {
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
- typeof arg === "undefined";
- }
- exports3.isPrimitive = isPrimitive;
- exports3.isBuffer = require2("buffer").Buffer.isBuffer;
- function objectToString(o) {
- return Object.prototype.toString.call(o);
- }
- }, { "buffer": 90 }], 342: [function(require2, module3, exports3) {
- (function(global2) {
- "use strict";
- var dateFormat = function() {
- var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
- var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
- var timezoneClip = /[^-+\dA-Z]/g;
- return function(date, mask, utc, gmt) {
- if (arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
- mask = date;
- date = void 0;
- }
- date = date || /* @__PURE__ */ new Date();
- if (!(date instanceof Date)) {
- date = new Date(date);
- }
- if (isNaN(date)) {
- throw TypeError("Invalid date");
- }
- mask = String(dateFormat.masks[mask] || mask || dateFormat.masks["default"]);
- var maskSlice = mask.slice(0, 4);
- if (maskSlice === "UTC:" || maskSlice === "GMT:") {
- mask = mask.slice(4);
- utc = true;
- if (maskSlice === "GMT:") {
- gmt = true;
- }
- }
- var _ = utc ? "getUTC" : "get";
- var d = date[_ + "Date"]();
- var D = date[_ + "Day"]();
- var m = date[_ + "Month"]();
- var y = date[_ + "FullYear"]();
- var H = date[_ + "Hours"]();
- var M = date[_ + "Minutes"]();
- var s = date[_ + "Seconds"]();
- var L = date[_ + "Milliseconds"]();
- var o = utc ? 0 : date.getTimezoneOffset();
- var W = getWeek(date);
- var N = getDayOfWeek(date);
- var flags = {
- d,
- dd: pad(d),
- ddd: dateFormat.i18n.dayNames[D],
- dddd: dateFormat.i18n.dayNames[D + 7],
- m: m + 1,
- mm: pad(m + 1),
- mmm: dateFormat.i18n.monthNames[m],
- mmmm: dateFormat.i18n.monthNames[m + 12],
- yy: String(y).slice(2),
- yyyy: y,
- h: H % 12 || 12,
- hh: pad(H % 12 || 12),
- H,
- HH: pad(H),
- M,
- MM: pad(M),
- s,
- ss: pad(s),
- l: pad(L, 3),
- L: pad(Math.round(L / 10)),
- t: H < 12 ? "a" : "p",
- tt: H < 12 ? "am" : "pm",
- T: H < 12 ? "A" : "P",
- TT: H < 12 ? "AM" : "PM",
- Z: gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
- o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
- S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
- W,
- N
- };
- return mask.replace(token, function(match) {
- if (match in flags) {
- return flags[match];
- }
- return match.slice(1, match.length - 1);
- });
- };
- }();
- dateFormat.masks = {
- "default": "ddd mmm dd yyyy HH:MM:ss",
- "shortDate": "m/d/yy",
- "mediumDate": "mmm d, yyyy",
- "longDate": "mmmm d, yyyy",
- "fullDate": "dddd, mmmm d, yyyy",
- "shortTime": "h:MM TT",
- "mediumTime": "h:MM:ss TT",
- "longTime": "h:MM:ss TT Z",
- "isoDate": "yyyy-mm-dd",
- "isoTime": "HH:MM:ss",
- "isoDateTime": "yyyy-mm-dd'T'HH:MM:sso",
- "isoUtcDateTime": "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
- "expiresHeaderFormat": "ddd, dd mmm yyyy HH:MM:ss Z"
- };
- dateFormat.i18n = {
- dayNames: [
- "Sun",
- "Mon",
- "Tue",
- "Wed",
- "Thu",
- "Fri",
- "Sat",
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
- ],
- monthNames: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- ]
- };
- function pad(val, len) {
- val = String(val);
- len = len || 2;
- while (val.length < len) {
- val = "0" + val;
- }
- return val;
- }
- function getWeek(date) {
- var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
- targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3);
- var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
- firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3);
- var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
- targetThursday.setHours(targetThursday.getHours() - ds);
- var weekDiff = (targetThursday - firstThursday) / (864e5 * 7);
- return 1 + Math.floor(weekDiff);
- }
- function getDayOfWeek(date) {
- var dow = date.getDay();
- if (dow === 0) {
- dow = 7;
- }
- return dow;
- }
- function kindOf(val) {
- if (val === null) {
- return "null";
- }
- if (val === void 0) {
- return "undefined";
- }
- if (typeof val !== "object") {
- return typeof val;
- }
- if (Array.isArray(val)) {
- return "array";
- }
- return {}.toString.call(val).slice(8, -1).toLowerCase();
- }
- ;
- if (typeof define2 === "function" && define2.amd) {
- define2(function() {
- return dateFormat;
- });
- } else if (typeof exports3 === "object") {
- module3.exports = dateFormat;
- } else {
- global2.dateFormat = dateFormat;
- }
- })(this);
- }, {}], 343: [function(require2, module3, exports3) {
- "use strict";
- var matchHtmlRegExp = /["'&<>]/;
- module3.exports = escapeHtml;
- function escapeHtml(string) {
- var str = "" + string;
- var match = matchHtmlRegExp.exec(str);
- if (!match) {
- return str;
- }
- var escape2;
- var html = "";
- var index = 0;
- var lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- escape2 = """;
- break;
- case 38:
- escape2 = "&";
- break;
- case 39:
- escape2 = "'";
- break;
- case 60:
- escape2 = "<";
- break;
- case 62:
- escape2 = ">";
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escape2;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- }, {}], 344: [function(require2, module3, exports3) {
- "use strict";
- var R = typeof Reflect === "object" ? Reflect : null;
- var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
- return Function.prototype.apply.call(target, receiver, args);
- };
- var ReflectOwnKeys;
- if (R && typeof R.ownKeys === "function") {
- ReflectOwnKeys = R.ownKeys;
- } else if (Object.getOwnPropertySymbols) {
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
- return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
- };
- } else {
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
- return Object.getOwnPropertyNames(target);
- };
- }
- function ProcessEmitWarning(warning) {
- if (console && console.warn)
- console.warn(warning);
- }
- var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
- return value !== value;
- };
- function EventEmitter() {
- EventEmitter.init.call(this);
- }
- module3.exports = EventEmitter;
- module3.exports.once = once;
- EventEmitter.EventEmitter = EventEmitter;
- EventEmitter.prototype._events = void 0;
- EventEmitter.prototype._eventsCount = 0;
- EventEmitter.prototype._maxListeners = void 0;
- var defaultMaxListeners = 10;
- function checkListener(listener) {
- if (typeof listener !== "function") {
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
- }
- }
- Object.defineProperty(EventEmitter, "defaultMaxListeners", {
- enumerable: true,
- get: function() {
- return defaultMaxListeners;
- },
- set: function(arg) {
- if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
- }
- defaultMaxListeners = arg;
- }
- });
- EventEmitter.init = function() {
- if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
- this._events = /* @__PURE__ */ Object.create(null);
- this._eventsCount = 0;
- }
- this._maxListeners = this._maxListeners || void 0;
- };
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
- }
- this._maxListeners = n;
- return this;
- };
- function _getMaxListeners(that) {
- if (that._maxListeners === void 0)
- return EventEmitter.defaultMaxListeners;
- return that._maxListeners;
- }
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
- return _getMaxListeners(this);
- };
- EventEmitter.prototype.emit = function emit(type) {
- var args = [];
- for (var i = 1; i < arguments.length; i++)
- args.push(arguments[i]);
- var doError = type === "error";
- var events = this._events;
- if (events !== void 0)
- doError = doError && events.error === void 0;
- else if (!doError)
- return false;
- if (doError) {
- var er;
- if (args.length > 0)
- er = args[0];
- if (er instanceof Error) {
- throw er;
- }
- var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
- err.context = er;
- throw err;
- }
- var handler = events[type];
- if (handler === void 0)
- return false;
- if (typeof handler === "function") {
- ReflectApply(handler, this, args);
- } else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- ReflectApply(listeners[i], this, args);
- }
- return true;
- };
- function _addListener(target, type, listener, prepend) {
- var m;
- var events;
- var existing;
- checkListener(listener);
- events = target._events;
- if (events === void 0) {
- events = target._events = /* @__PURE__ */ Object.create(null);
- target._eventsCount = 0;
- } else {
- if (events.newListener !== void 0) {
- target.emit(
- "newListener",
- type,
- listener.listener ? listener.listener : listener
- );
- events = target._events;
- }
- existing = events[type];
- }
- if (existing === void 0) {
- existing = events[type] = listener;
- ++target._eventsCount;
- } else {
- if (typeof existing === "function") {
- existing = events[type] = prepend ? [listener, existing] : [existing, listener];
- } else if (prepend) {
- existing.unshift(listener);
- } else {
- existing.push(listener);
- }
- m = _getMaxListeners(target);
- if (m > 0 && existing.length > m && !existing.warned) {
- existing.warned = true;
- var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
- w.name = "MaxListenersExceededWarning";
- w.emitter = target;
- w.type = type;
- w.count = existing.length;
- ProcessEmitWarning(w);
- }
- }
- return target;
- }
- EventEmitter.prototype.addListener = function addListener(type, listener) {
- return _addListener(this, type, listener, false);
- };
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
- EventEmitter.prototype.prependListener = function prependListener(type, listener) {
- return _addListener(this, type, listener, true);
- };
- function onceWrapper() {
- if (!this.fired) {
- this.target.removeListener(this.type, this.wrapFn);
- this.fired = true;
- if (arguments.length === 0)
- return this.listener.call(this.target);
- return this.listener.apply(this.target, arguments);
- }
- }
- function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: void 0, target, type, listener };
- var wrapped = onceWrapper.bind(state);
- wrapped.listener = listener;
- state.wrapFn = wrapped;
- return wrapped;
- }
- EventEmitter.prototype.once = function once2(type, listener) {
- checkListener(listener);
- this.on(type, _onceWrap(this, type, listener));
- return this;
- };
- EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
- checkListener(listener);
- this.prependListener(type, _onceWrap(this, type, listener));
- return this;
- };
- EventEmitter.prototype.removeListener = function removeListener(type, listener) {
- var list, events, position, i, originalListener;
- checkListener(listener);
- events = this._events;
- if (events === void 0)
- return this;
- list = events[type];
- if (list === void 0)
- return this;
- if (list === listener || list.listener === listener) {
- if (--this._eventsCount === 0)
- this._events = /* @__PURE__ */ Object.create(null);
- else {
- delete events[type];
- if (events.removeListener)
- this.emit("removeListener", type, list.listener || listener);
- }
- } else if (typeof list !== "function") {
- position = -1;
- for (i = list.length - 1; i >= 0; i--) {
- if (list[i] === listener || list[i].listener === listener) {
- originalListener = list[i].listener;
- position = i;
- break;
- }
- }
- if (position < 0)
- return this;
- if (position === 0)
- list.shift();
- else {
- spliceOne(list, position);
- }
- if (list.length === 1)
- events[type] = list[0];
- if (events.removeListener !== void 0)
- this.emit("removeListener", type, originalListener || listener);
- }
- return this;
- };
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
- var listeners, events, i;
- events = this._events;
- if (events === void 0)
- return this;
- if (events.removeListener === void 0) {
- if (arguments.length === 0) {
- this._events = /* @__PURE__ */ Object.create(null);
- this._eventsCount = 0;
- } else if (events[type] !== void 0) {
- if (--this._eventsCount === 0)
- this._events = /* @__PURE__ */ Object.create(null);
- else
- delete events[type];
- }
- return this;
- }
- if (arguments.length === 0) {
- var keys = Object.keys(events);
- var key;
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
- if (key === "removeListener")
- continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners("removeListener");
- this._events = /* @__PURE__ */ Object.create(null);
- this._eventsCount = 0;
- return this;
- }
- listeners = events[type];
- if (typeof listeners === "function") {
- this.removeListener(type, listeners);
- } else if (listeners !== void 0) {
- for (i = listeners.length - 1; i >= 0; i--) {
- this.removeListener(type, listeners[i]);
- }
- }
- return this;
- };
- function _listeners(target, type, unwrap) {
- var events = target._events;
- if (events === void 0)
- return [];
- var evlistener = events[type];
- if (evlistener === void 0)
- return [];
- if (typeof evlistener === "function")
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
- return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
- }
- EventEmitter.prototype.listeners = function listeners(type) {
- return _listeners(this, type, true);
- };
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
- return _listeners(this, type, false);
- };
- EventEmitter.listenerCount = function(emitter, type) {
- if (typeof emitter.listenerCount === "function") {
- return emitter.listenerCount(type);
- } else {
- return listenerCount.call(emitter, type);
- }
- };
- EventEmitter.prototype.listenerCount = listenerCount;
- function listenerCount(type) {
- var events = this._events;
- if (events !== void 0) {
- var evlistener = events[type];
- if (typeof evlistener === "function") {
- return 1;
- } else if (evlistener !== void 0) {
- return evlistener.length;
- }
- }
- return 0;
- }
- EventEmitter.prototype.eventNames = function eventNames() {
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
- };
- function arrayClone(arr, n) {
- var copy = new Array(n);
- for (var i = 0; i < n; ++i)
- copy[i] = arr[i];
- return copy;
- }
- function spliceOne(list, index) {
- for (; index + 1 < list.length; index++)
- list[index] = list[index + 1];
- list.pop();
- }
- function unwrapListeners(arr) {
- var ret = new Array(arr.length);
- for (var i = 0; i < ret.length; ++i) {
- ret[i] = arr[i].listener || arr[i];
- }
- return ret;
- }
- function once(emitter, name) {
- return new Promise(function(resolve, reject) {
- function errorListener(err) {
- emitter.removeListener(name, resolver);
- reject(err);
- }
- function resolver() {
- if (typeof emitter.removeListener === "function") {
- emitter.removeListener("error", errorListener);
- }
- resolve([].slice.call(arguments));
- }
- ;
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
- if (name !== "error") {
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
- }
- });
- }
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
- if (typeof emitter.on === "function") {
- eventTargetAgnosticAddListener(emitter, "error", handler, flags);
- }
- }
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
- if (typeof emitter.on === "function") {
- if (flags.once) {
- emitter.once(name, listener);
- } else {
- emitter.on(name, listener);
- }
- } else if (typeof emitter.addEventListener === "function") {
- emitter.addEventListener(name, function wrapListener(arg) {
- if (flags.once) {
- emitter.removeEventListener(name, wrapListener);
- }
- listener(arg);
- });
- } else {
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
- }
- }
- }, {}], 345: [function(require2, module3, exports3) {
- "use strict";
- var isCallable = require2("is-callable");
- var toStr = Object.prototype.toString;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var forEachArray = function forEachArray2(array, iterator, receiver) {
- for (var i = 0, len = array.length; i < len; i++) {
- if (hasOwnProperty.call(array, i)) {
- if (receiver == null) {
- iterator(array[i], i, array);
- } else {
- iterator.call(receiver, array[i], i, array);
- }
- }
- }
- };
- var forEachString = function forEachString2(string, iterator, receiver) {
- for (var i = 0, len = string.length; i < len; i++) {
- if (receiver == null) {
- iterator(string.charAt(i), i, string);
- } else {
- iterator.call(receiver, string.charAt(i), i, string);
- }
- }
- };
- var forEachObject = function forEachObject2(object, iterator, receiver) {
- for (var k in object) {
- if (hasOwnProperty.call(object, k)) {
- if (receiver == null) {
- iterator(object[k], k, object);
- } else {
- iterator.call(receiver, object[k], k, object);
- }
- }
- }
- };
- var forEach = function forEach2(list, iterator, thisArg) {
- if (!isCallable(iterator)) {
- throw new TypeError("iterator must be a function");
- }
- var receiver;
- if (arguments.length >= 3) {
- receiver = thisArg;
- }
- if (toStr.call(list) === "[object Array]") {
- forEachArray(list, iterator, receiver);
- } else if (typeof list === "string") {
- forEachString(list, iterator, receiver);
- } else {
- forEachObject(list, iterator, receiver);
- }
- };
- module3.exports = forEach;
- }, { "is-callable": 367 }], 346: [function(require2, module3, exports3) {
- "use strict";
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
- var slice = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = "[object Function]";
- module3.exports = function bind(that) {
- var target = this;
- if (typeof target !== "function" || toStr.call(target) !== funcType) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice.call(arguments, 1);
- var bound;
- var binder = function() {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
- }
- };
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push("$" + i);
- }
- bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder);
- if (target.prototype) {
- var Empty = function Empty2() {
- };
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
- }, {}], 347: [function(require2, module3, exports3) {
- "use strict";
- var implementation = require2("./implementation");
- module3.exports = Function.prototype.bind || implementation;
- }, { "./implementation": 346 }], 348: [function(require2, module3, exports3) {
- "use strict";
- var undefined2;
- var $SyntaxError = SyntaxError;
- var $Function = Function;
- var $TypeError = TypeError;
- var getEvalledConstructor = function(expressionSyntax) {
- try {
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
- } catch (e) {
- }
- };
- var $gOPD = Object.getOwnPropertyDescriptor;
- if ($gOPD) {
- try {
- $gOPD({}, "");
- } catch (e) {
- $gOPD = null;
- }
- }
- var throwTypeError = function() {
- throw new $TypeError();
- };
- var ThrowTypeError = $gOPD ? function() {
- try {
- arguments.callee;
- return throwTypeError;
- } catch (calleeThrows) {
- try {
- return $gOPD(arguments, "callee").get;
- } catch (gOPDthrows) {
- return throwTypeError;
- }
- }
- }() : throwTypeError;
- var hasSymbols = require2("has-symbols")();
- var hasProto = require2("has-proto")();
- var getProto = Object.getPrototypeOf || (hasProto ? function(x) {
- return x.__proto__;
- } : null);
- var needsEval = {};
- var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
- var INTRINSICS = {
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
- "%Array%": Array,
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
- "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
- "%AsyncFromSyncIteratorPrototype%": undefined2,
- "%AsyncFunction%": needsEval,
- "%AsyncGenerator%": needsEval,
- "%AsyncGeneratorFunction%": needsEval,
- "%AsyncIteratorPrototype%": needsEval,
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
- "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
- "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
- "%Boolean%": Boolean,
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
- "%Date%": Date,
- "%decodeURI%": decodeURI,
- "%decodeURIComponent%": decodeURIComponent,
- "%encodeURI%": encodeURI,
- "%encodeURIComponent%": encodeURIComponent,
- "%Error%": Error,
- "%eval%": eval,
- // eslint-disable-line no-eval
- "%EvalError%": EvalError,
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
- "%Function%": $Function,
- "%GeneratorFunction%": needsEval,
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
- "%isFinite%": isFinite,
- "%isNaN%": isNaN,
- "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
- "%Math%": Math,
- "%Number%": Number,
- "%Object%": Object,
- "%parseFloat%": parseFloat,
- "%parseInt%": parseInt,
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
- "%RangeError%": RangeError,
- "%ReferenceError%": ReferenceError,
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
- "%RegExp%": RegExp,
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
- "%String%": String,
- "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
- "%Symbol%": hasSymbols ? Symbol : undefined2,
- "%SyntaxError%": $SyntaxError,
- "%ThrowTypeError%": ThrowTypeError,
- "%TypedArray%": TypedArray,
- "%TypeError%": $TypeError,
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
- "%URIError%": URIError,
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
- };
- if (getProto) {
- try {
- null.error;
- } catch (e) {
- var errorProto = getProto(getProto(e));
- INTRINSICS["%Error.prototype%"] = errorProto;
- }
- }
- var doEval = function doEval2(name) {
- var value;
- if (name === "%AsyncFunction%") {
- value = getEvalledConstructor("async function () {}");
- } else if (name === "%GeneratorFunction%") {
- value = getEvalledConstructor("function* () {}");
- } else if (name === "%AsyncGeneratorFunction%") {
- value = getEvalledConstructor("async function* () {}");
- } else if (name === "%AsyncGenerator%") {
- var fn = doEval2("%AsyncGeneratorFunction%");
- if (fn) {
- value = fn.prototype;
- }
- } else if (name === "%AsyncIteratorPrototype%") {
- var gen = doEval2("%AsyncGenerator%");
- if (gen && getProto) {
- value = getProto(gen.prototype);
- }
- }
- INTRINSICS[name] = value;
- return value;
- };
- var LEGACY_ALIASES = {
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
- "%ArrayPrototype%": ["Array", "prototype"],
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
- "%ArrayProto_values%": ["Array", "prototype", "values"],
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
- "%BooleanPrototype%": ["Boolean", "prototype"],
- "%DataViewPrototype%": ["DataView", "prototype"],
- "%DatePrototype%": ["Date", "prototype"],
- "%ErrorPrototype%": ["Error", "prototype"],
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
- "%FunctionPrototype%": ["Function", "prototype"],
- "%Generator%": ["GeneratorFunction", "prototype"],
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
- "%JSONParse%": ["JSON", "parse"],
- "%JSONStringify%": ["JSON", "stringify"],
- "%MapPrototype%": ["Map", "prototype"],
- "%NumberPrototype%": ["Number", "prototype"],
- "%ObjectPrototype%": ["Object", "prototype"],
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
- "%PromisePrototype%": ["Promise", "prototype"],
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
- "%Promise_all%": ["Promise", "all"],
- "%Promise_reject%": ["Promise", "reject"],
- "%Promise_resolve%": ["Promise", "resolve"],
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
- "%RegExpPrototype%": ["RegExp", "prototype"],
- "%SetPrototype%": ["Set", "prototype"],
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
- "%StringPrototype%": ["String", "prototype"],
- "%SymbolPrototype%": ["Symbol", "prototype"],
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
- "%URIErrorPrototype%": ["URIError", "prototype"],
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
- };
- var bind = require2("function-bind");
- var hasOwn = require2("has");
- var $concat = bind.call(Function.call, Array.prototype.concat);
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
- var $replace = bind.call(Function.call, String.prototype.replace);
- var $strSlice = bind.call(Function.call, String.prototype.slice);
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
- var reEscapeChar = /\\(\\)?/g;
- var stringToPath = function stringToPath2(string) {
- var first = $strSlice(string, 0, 1);
- var last = $strSlice(string, -1);
- if (first === "%" && last !== "%") {
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
- } else if (last === "%" && first !== "%") {
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
- }
- var result = [];
- $replace(string, rePropName, function(match, number, quote, subString) {
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
- });
- return result;
- };
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
- var intrinsicName = name;
- var alias;
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
- alias = LEGACY_ALIASES[intrinsicName];
- intrinsicName = "%" + alias[0] + "%";
- }
- if (hasOwn(INTRINSICS, intrinsicName)) {
- var value = INTRINSICS[intrinsicName];
- if (value === needsEval) {
- value = doEval(intrinsicName);
- }
- if (typeof value === "undefined" && !allowMissing) {
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
- }
- return {
- alias,
- name: intrinsicName,
- value
- };
- }
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
- };
- module3.exports = function GetIntrinsic(name, allowMissing) {
- if (typeof name !== "string" || name.length === 0) {
- throw new $TypeError("intrinsic name must be a non-empty string");
- }
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
- throw new $TypeError('"allowMissing" argument must be a boolean');
- }
- if ($exec(/^%?[^%]*%?$/, name) === null) {
- throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
- }
- var parts = stringToPath(name);
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
- var intrinsicRealName = intrinsic.name;
- var value = intrinsic.value;
- var skipFurtherCaching = false;
- var alias = intrinsic.alias;
- if (alias) {
- intrinsicBaseName = alias[0];
- $spliceApply(parts, $concat([0, 1], alias));
- }
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
- var part = parts[i];
- var first = $strSlice(part, 0, 1);
- var last = $strSlice(part, -1);
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
- throw new $SyntaxError("property names with quotes must have matching quotes");
- }
- if (part === "constructor" || !isOwn) {
- skipFurtherCaching = true;
- }
- intrinsicBaseName += "." + part;
- intrinsicRealName = "%" + intrinsicBaseName + "%";
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
- value = INTRINSICS[intrinsicRealName];
- } else if (value != null) {
- if (!(part in value)) {
- if (!allowMissing) {
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
- }
- return void 0;
- }
- if ($gOPD && i + 1 >= parts.length) {
- var desc = $gOPD(value, part);
- isOwn = !!desc;
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
- value = desc.get;
- } else {
- value = value[part];
- }
- } else {
- isOwn = hasOwn(value, part);
- value = value[part];
- }
- if (isOwn && !skipFurtherCaching) {
- INTRINSICS[intrinsicRealName] = value;
- }
- }
- }
- return value;
- };
- }, { "function-bind": 347, "has": 354, "has-proto": 350, "has-symbols": 351 }], 349: [function(require2, module3, exports3) {
- "use strict";
- var GetIntrinsic = require2("get-intrinsic");
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
- if ($gOPD) {
- try {
- $gOPD([], "length");
- } catch (e) {
- $gOPD = null;
- }
- }
- module3.exports = $gOPD;
- }, { "get-intrinsic": 348 }], 350: [function(require2, module3, exports3) {
- "use strict";
- var test = {
- foo: {}
- };
- var $Object = Object;
- module3.exports = function hasProto() {
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
- };
- }, {}], 351: [function(require2, module3, exports3) {
- "use strict";
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
- var hasSymbolSham = require2("./shams");
- module3.exports = function hasNativeSymbols() {
- if (typeof origSymbol !== "function") {
- return false;
- }
- if (typeof Symbol !== "function") {
- return false;
- }
- if (typeof origSymbol("foo") !== "symbol") {
- return false;
- }
- if (typeof Symbol("bar") !== "symbol") {
- return false;
- }
- return hasSymbolSham();
- };
- }, { "./shams": 352 }], 352: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = function hasSymbols() {
- if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
- return false;
- }
- if (typeof Symbol.iterator === "symbol") {
- return true;
- }
- var obj = {};
- var sym = Symbol("test");
- var symObj = Object(sym);
- if (typeof sym === "string") {
- return false;
- }
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
- return false;
- }
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
- return false;
- }
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) {
- return false;
- }
- if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
- return false;
- }
- if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
- return false;
- }
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) {
- return false;
- }
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
- return false;
- }
- if (typeof Object.getOwnPropertyDescriptor === "function") {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (descriptor.value !== symVal || descriptor.enumerable !== true) {
- return false;
- }
- }
- return true;
- };
- }, {}], 353: [function(require2, module3, exports3) {
- "use strict";
- var hasSymbols = require2("has-symbols/shams");
- module3.exports = function hasToStringTagShams() {
- return hasSymbols() && !!Symbol.toStringTag;
- };
- }, { "has-symbols/shams": 352 }], 354: [function(require2, module3, exports3) {
- "use strict";
- var bind = require2("function-bind");
- module3.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
- }, { "function-bind": 347 }], 355: [function(require2, module3, exports3) {
- var http = require2("http");
- var url = require2("url");
- var https = module3.exports;
- for (var key in http) {
- if (http.hasOwnProperty(key))
- https[key] = http[key];
- }
- https.request = function(params, cb) {
- params = validateParams(params);
- return http.request.call(this, params, cb);
- };
- https.get = function(params, cb) {
- params = validateParams(params);
- return http.get.call(this, params, cb);
- };
- function validateParams(params) {
- if (typeof params === "string") {
- params = url.parse(params);
- }
- if (!params.protocol) {
- params.protocol = "https:";
- }
- if (params.protocol !== "https:") {
- throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"');
- }
- return params;
- }
- }, { "http": 468, "url": 472 }], 356: [function(require2, module3, exports3) {
- "use strict";
- var util = require2("util");
- var ms = require2("ms");
- module3.exports = function(t) {
- if (typeof t === "number")
- return t;
- var r = ms(t);
- if (r === void 0) {
- var err = new Error(util.format("humanize-ms(%j) result undefined", t));
- console.warn(err.stack);
- }
- return r;
- };
- }, { "ms": 376, "util": 419 }], 357: [function(require2, module3, exports3) {
- exports3.read = function(buffer, offset, isLE, mLen, nBytes) {
- var e, m;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var nBits = -7;
- var i = isLE ? nBytes - 1 : 0;
- var d = isLE ? -1 : 1;
- var s = buffer[offset + i];
- i += d;
- e = s & (1 << -nBits) - 1;
- s >>= -nBits;
- nBits += eLen;
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {
- }
- m = e & (1 << -nBits) - 1;
- e >>= -nBits;
- nBits += mLen;
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {
- }
- if (e === 0) {
- e = 1 - eBias;
- } else if (e === eMax) {
- return m ? NaN : (s ? -1 : 1) * Infinity;
- } else {
- m = m + Math.pow(2, mLen);
- e = e - eBias;
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
- };
- exports3.write = function(buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
- var i = isLE ? 0 : nBytes - 1;
- var d = isLE ? 1 : -1;
- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
- value = Math.abs(value);
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0;
- e = eMax;
- } else {
- e = Math.floor(Math.log(value) / Math.LN2);
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--;
- c *= 2;
- }
- if (e + eBias >= 1) {
- value += rt / c;
- } else {
- value += rt * Math.pow(2, 1 - eBias);
- }
- if (value * c >= 2) {
- e++;
- c /= 2;
- }
- if (e + eBias >= eMax) {
- m = 0;
- e = eMax;
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen);
- e = e + eBias;
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
- e = 0;
- }
- }
- for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
- }
- e = e << mLen | m;
- eLen += mLen;
- for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
- }
- buffer[offset + i - d] |= s * 128;
- };
- }, {}], 358: [function(require2, module3, exports3) {
- "use strict";
- var types = [
- require2("./nextTick"),
- require2("./queueMicrotask"),
- require2("./mutation.js"),
- require2("./messageChannel"),
- require2("./stateChange"),
- require2("./timeout")
- ];
- var draining;
- var currentQueue;
- var queueIndex = -1;
- var queue = [];
- var scheduled = false;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- nextTick();
- }
- }
- function nextTick() {
- if (draining) {
- return;
- }
- scheduled = false;
- draining = true;
- var len2 = queue.length;
- var timeout = setTimeout(cleanUpNextTick);
- while (len2) {
- currentQueue = queue;
- queue = [];
- while (currentQueue && ++queueIndex < len2) {
- currentQueue[queueIndex].run();
- }
- queueIndex = -1;
- len2 = queue.length;
- }
- currentQueue = null;
- queueIndex = -1;
- draining = false;
- clearTimeout(timeout);
- }
- var scheduleDrain;
- var i = -1;
- var len = types.length;
- while (++i < len) {
- if (types[i] && types[i].test && types[i].test()) {
- scheduleDrain = types[i].install(nextTick);
- break;
- }
- }
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function() {
- var fun = this.fun;
- var array = this.array;
- switch (array.length) {
- case 0:
- return fun();
- case 1:
- return fun(array[0]);
- case 2:
- return fun(array[0], array[1]);
- case 3:
- return fun(array[0], array[1], array[2]);
- default:
- return fun.apply(null, array);
- }
- };
- module3.exports = immediate;
- function immediate(task) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- args[i2 - 1] = arguments[i2];
- }
- }
- queue.push(new Item(task, args));
- if (!scheduled && !draining) {
- scheduled = true;
- scheduleDrain();
- }
- }
- }, { "./messageChannel": 359, "./mutation.js": 360, "./nextTick": 89, "./queueMicrotask": 361, "./stateChange": 362, "./timeout": 363 }], 359: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- exports3.test = function() {
- if (global2.setImmediate) {
- return false;
- }
- return typeof global2.MessageChannel !== "undefined";
- };
- exports3.install = function(func) {
- var channel = new global2.MessageChannel();
- channel.port1.onmessage = func;
- return function() {
- channel.port2.postMessage(0);
- };
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 360: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- var Mutation = global2.MutationObserver || global2.WebKitMutationObserver;
- exports3.test = function() {
- return Mutation;
- };
- exports3.install = function(handle) {
- var called = 0;
- var observer = new Mutation(handle);
- var element = global2.document.createTextNode("");
- observer.observe(element, {
- characterData: true
- });
- return function() {
- element.data = called = ++called % 2;
- };
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 361: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- exports3.test = function() {
- return typeof global2.queueMicrotask === "function";
- };
- exports3.install = function(func) {
- return function() {
- global2.queueMicrotask(func);
- };
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 362: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- exports3.test = function() {
- return "document" in global2 && "onreadystatechange" in global2.document.createElement("script");
- };
- exports3.install = function(handle) {
- return function() {
- var scriptEl = global2.document.createElement("script");
- scriptEl.onreadystatechange = function() {
- handle();
- scriptEl.onreadystatechange = null;
- scriptEl.parentNode.removeChild(scriptEl);
- scriptEl = null;
- };
- global2.document.documentElement.appendChild(scriptEl);
- return handle;
- };
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 363: [function(require2, module3, exports3) {
- "use strict";
- exports3.test = function() {
- return true;
- };
- exports3.install = function(t) {
- return function() {
- setTimeout(t, 0);
- };
- };
- }, {}], 364: [function(require2, module3, exports3) {
- if (typeof Object.create === "function") {
- module3.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- }
- };
- } else {
- module3.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function() {
- };
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- }
- };
- }
- }, {}], 365: [function(require2, module3, exports3) {
- "use strict";
- var hasToStringTag = require2("has-tostringtag/shams")();
- var callBound = require2("call-bind/callBound");
- var $toString = callBound("Object.prototype.toString");
- var isStandardArguments = function isArguments(value) {
- if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
- return false;
- }
- return $toString(value) === "[object Arguments]";
- };
- var isLegacyArguments = function isArguments(value) {
- if (isStandardArguments(value)) {
- return true;
- }
- return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
- };
- var supportsStandardArguments = function() {
- return isStandardArguments(arguments);
- }();
- isStandardArguments.isLegacyArguments = isLegacyArguments;
- module3.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
- }, { "call-bind/callBound": 92, "has-tostringtag/shams": 353 }], 366: [function(require2, module3, exports3) {
- module3.exports = function(obj) {
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
- };
- function isBuffer(obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
- }
- function isSlowBuffer(obj) {
- return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0));
- }
- }, {}], 367: [function(require2, module3, exports3) {
- "use strict";
- var fnToStr = Function.prototype.toString;
- var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
- var badArrayLike;
- var isCallableMarker;
- if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
- try {
- badArrayLike = Object.defineProperty({}, "length", {
- get: function() {
- throw isCallableMarker;
- }
- });
- isCallableMarker = {};
- reflectApply(function() {
- throw 42;
- }, null, badArrayLike);
- } catch (_) {
- if (_ !== isCallableMarker) {
- reflectApply = null;
- }
- }
- } else {
- reflectApply = null;
- }
- var constructorRegex = /^\s*class\b/;
- var isES6ClassFn = function isES6ClassFunction(value) {
- try {
- var fnStr = fnToStr.call(value);
- return constructorRegex.test(fnStr);
- } catch (e) {
- return false;
- }
- };
- var tryFunctionObject = function tryFunctionToStr(value) {
- try {
- if (isES6ClassFn(value)) {
- return false;
- }
- fnToStr.call(value);
- return true;
- } catch (e) {
- return false;
- }
- };
- var toStr = Object.prototype.toString;
- var objectClass = "[object Object]";
- var fnClass = "[object Function]";
- var genClass = "[object GeneratorFunction]";
- var ddaClass = "[object HTMLAllCollection]";
- var ddaClass2 = "[object HTML document.all class]";
- var ddaClass3 = "[object HTMLCollection]";
- var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
- var isIE68 = !(0 in [,]);
- var isDDA = function isDocumentDotAll() {
- return false;
- };
- if (typeof document === "object") {
- var all = document.all;
- if (toStr.call(all) === toStr.call(document.all)) {
- isDDA = function isDocumentDotAll(value) {
- if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) {
- try {
- var str = toStr.call(value);
- return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null;
- } catch (e) {
- }
- }
- return false;
- };
- }
- }
- module3.exports = reflectApply ? function isCallable(value) {
- if (isDDA(value)) {
- return true;
- }
- if (!value) {
- return false;
- }
- if (typeof value !== "function" && typeof value !== "object") {
- return false;
- }
- try {
- reflectApply(value, null, badArrayLike);
- } catch (e) {
- if (e !== isCallableMarker) {
- return false;
- }
- }
- return !isES6ClassFn(value) && tryFunctionObject(value);
- } : function isCallable(value) {
- if (isDDA(value)) {
- return true;
- }
- if (!value) {
- return false;
- }
- if (typeof value !== "function" && typeof value !== "object") {
- return false;
- }
- if (hasToStringTag) {
- return tryFunctionObject(value);
- }
- if (isES6ClassFn(value)) {
- return false;
- }
- var strClass = toStr.call(value);
- if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) {
- return false;
- }
- return tryFunctionObject(value);
- };
- }, {}], 368: [function(require2, module3, exports3) {
- "use strict";
- var toStr = Object.prototype.toString;
- var fnToStr = Function.prototype.toString;
- var isFnRegex = /^\s*(?:function)?\*/;
- var hasToStringTag = require2("has-tostringtag/shams")();
- var getProto = Object.getPrototypeOf;
- var getGeneratorFunc = function() {
- if (!hasToStringTag) {
- return false;
- }
- try {
- return Function("return function*() {}")();
- } catch (e) {
- }
- };
- var GeneratorFunction;
- module3.exports = function isGeneratorFunction(fn) {
- if (typeof fn !== "function") {
- return false;
- }
- if (isFnRegex.test(fnToStr.call(fn))) {
- return true;
- }
- if (!hasToStringTag) {
- var str = toStr.call(fn);
- return str === "[object GeneratorFunction]";
- }
- if (!getProto) {
- return false;
- }
- if (typeof GeneratorFunction === "undefined") {
- var generatorFunc = getGeneratorFunc();
- GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
- }
- return getProto(fn) === GeneratorFunction;
- };
- }, { "has-tostringtag/shams": 353 }], 369: [function(require2, module3, exports3) {
- "use strict";
- var whichTypedArray = require2("which-typed-array");
- module3.exports = function isTypedArray(value) {
- return !!whichTypedArray(value);
- };
- }, { "which-typed-array": 420 }], 370: [function(require2, module3, exports3) {
- var toString = {}.toString;
- module3.exports = Array.isArray || function(arr) {
- return toString.call(arr) == "[object Array]";
- };
- }, {}], 371: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- ;
- (function(global3, factory) {
- typeof exports3 === "object" && typeof module3 !== "undefined" ? module3.exports = factory(global3) : typeof define2 === "function" && define2.amd ? define2(factory) : factory(global3);
- })(typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global2 !== "undefined" ? global2 : this, function(global3) {
- "use strict";
- global3 = global3 || {};
- var _Base64 = global3.Base64;
- var version = "2.6.4";
- var b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var b64tab = function(bin) {
- var t = {};
- for (var i = 0, l = bin.length; i < l; i++)
- t[bin.charAt(i)] = i;
- return t;
- }(b64chars);
- var fromCharCode = String.fromCharCode;
- var cb_utob = function(c) {
- if (c.length < 2) {
- var cc = c.charCodeAt(0);
- return cc < 128 ? c : cc < 2048 ? fromCharCode(192 | cc >>> 6) + fromCharCode(128 | cc & 63) : fromCharCode(224 | cc >>> 12 & 15) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
- } else {
- var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);
- return fromCharCode(240 | cc >>> 18 & 7) + fromCharCode(128 | cc >>> 12 & 63) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
- }
- };
- var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
- var utob = function(u) {
- return u.replace(re_utob, cb_utob);
- };
- var cb_encode = function(ccc) {
- var padlen = [0, 2, 1][ccc.length % 3], ord = ccc.charCodeAt(0) << 16 | (ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8 | (ccc.length > 2 ? ccc.charCodeAt(2) : 0), chars = [
- b64chars.charAt(ord >>> 18),
- b64chars.charAt(ord >>> 12 & 63),
- padlen >= 2 ? "=" : b64chars.charAt(ord >>> 6 & 63),
- padlen >= 1 ? "=" : b64chars.charAt(ord & 63)
- ];
- return chars.join("");
- };
- var btoa = global3.btoa && typeof global3.btoa == "function" ? function(b) {
- return global3.btoa(b);
- } : function(b) {
- if (b.match(/[^\x00-\xFF]/))
- throw new RangeError(
- "The string contains invalid characters."
- );
- return b.replace(/[\s\S]{1,3}/g, cb_encode);
- };
- var _encode = function(u) {
- return btoa(utob(String(u)));
- };
- var mkUriSafe = function(b64) {
- return b64.replace(/[+\/]/g, function(m0) {
- return m0 == "+" ? "-" : "_";
- }).replace(/=/g, "");
- };
- var encode = function(u, urisafe) {
- return urisafe ? mkUriSafe(_encode(u)) : _encode(u);
- };
- var encodeURI2 = function(u) {
- return encode(u, true);
- };
- var fromUint8Array;
- if (global3.Uint8Array)
- fromUint8Array = function(a, urisafe) {
- var b64 = "";
- for (var i = 0, l = a.length; i < l; i += 3) {
- var a0 = a[i], a1 = a[i + 1], a2 = a[i + 2];
- var ord = a0 << 16 | a1 << 8 | a2;
- b64 += b64chars.charAt(ord >>> 18) + b64chars.charAt(ord >>> 12 & 63) + (typeof a1 != "undefined" ? b64chars.charAt(ord >>> 6 & 63) : "=") + (typeof a2 != "undefined" ? b64chars.charAt(ord & 63) : "=");
- }
- return urisafe ? mkUriSafe(b64) : b64;
- };
- var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
- var cb_btou = function(cccc) {
- switch (cccc.length) {
- case 4:
- var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;
- return fromCharCode((offset >>> 10) + 55296) + fromCharCode((offset & 1023) + 56320);
- case 3:
- return fromCharCode(
- (15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2)
- );
- default:
- return fromCharCode(
- (31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1)
- );
- }
- };
- var btou = function(b) {
- return b.replace(re_btou, cb_btou);
- };
- var cb_decode = function(cccc) {
- var len = cccc.length, padlen = len % 4, n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0) | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0) | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0) | (len > 3 ? b64tab[cccc.charAt(3)] : 0), chars = [
- fromCharCode(n >>> 16),
- fromCharCode(n >>> 8 & 255),
- fromCharCode(n & 255)
- ];
- chars.length -= [0, 0, 2, 1][padlen];
- return chars.join("");
- };
- var _atob = global3.atob && typeof global3.atob == "function" ? function(a) {
- return global3.atob(a);
- } : function(a) {
- return a.replace(/\S{1,4}/g, cb_decode);
- };
- var atob = function(a) {
- return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, ""));
- };
- var _decode = function(a) {
- return btou(_atob(a));
- };
- var _fromURI = function(a) {
- return String(a).replace(/[-_]/g, function(m0) {
- return m0 == "-" ? "+" : "/";
- }).replace(/[^A-Za-z0-9\+\/]/g, "");
- };
- var decode = function(a) {
- return _decode(_fromURI(a));
- };
- var toUint8Array;
- if (global3.Uint8Array)
- toUint8Array = function(a) {
- return Uint8Array.from(atob(_fromURI(a)), function(c) {
- return c.charCodeAt(0);
- });
- };
- var noConflict = function() {
- var Base642 = global3.Base64;
- global3.Base64 = _Base64;
- return Base642;
- };
- global3.Base64 = {
- VERSION: version,
- atob,
- btoa,
- fromBase64: decode,
- toBase64: encode,
- utob,
- encode,
- encodeURI: encodeURI2,
- btou,
- decode,
- noConflict,
- fromUint8Array,
- toUint8Array
- };
- if (typeof Object.defineProperty === "function") {
- var noEnum = function(v) {
- return { value: v, enumerable: false, writable: true, configurable: true };
- };
- global3.Base64.extendString = function() {
- Object.defineProperty(
- String.prototype,
- "fromBase64",
- noEnum(function() {
- return decode(this);
- })
- );
- Object.defineProperty(
- String.prototype,
- "toBase64",
- noEnum(function(urisafe) {
- return encode(this, urisafe);
- })
- );
- Object.defineProperty(
- String.prototype,
- "toBase64URI",
- noEnum(function() {
- return encode(this, true);
- })
- );
- };
- }
- if (global3["Meteor"]) {
- Base64 = global3.Base64;
- }
- if (typeof module3 !== "undefined" && module3.exports) {
- module3.exports.Base64 = global3.Base64;
- } else if (typeof define2 === "function" && define2.amd) {
- define2([], function() {
- return global3.Base64;
- });
- }
- return { Base64: global3.Base64 };
- });
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 372: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = merge;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function merge(dest, src, redefine) {
- if (!dest) {
- throw new TypeError("argument dest is required");
- }
- if (!src) {
- throw new TypeError("argument src is required");
- }
- if (redefine === void 0) {
- redefine = true;
- }
- Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {
- if (!redefine && hasOwnProperty.call(dest, name)) {
- return;
- }
- var descriptor = Object.getOwnPropertyDescriptor(src, name);
- Object.defineProperty(dest, name, descriptor);
- });
- return dest;
- }
- }, {}], 373: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.regexp.constructor.js");
- require2("core-js/modules/es.regexp.to-string.js");
- function Mime() {
- this._types = /* @__PURE__ */ Object.create(null);
- this._extensions = /* @__PURE__ */ Object.create(null);
- for (var i = 0; i < arguments.length; i++) {
- this.define(arguments[i]);
- }
- this.define = this.define.bind(this);
- this.getType = this.getType.bind(this);
- this.getExtension = this.getExtension.bind(this);
- }
- Mime.prototype.define = function(typeMap, force) {
- for (var type in typeMap) {
- var extensions = typeMap[type].map(function(t) {
- return t.toLowerCase();
- });
- type = type.toLowerCase();
- for (var i = 0; i < extensions.length; i++) {
- var ext = extensions[i];
- if (ext[0] === "*") {
- continue;
- }
- if (!force && ext in this._types) {
- throw new Error('Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".');
- }
- this._types[ext] = type;
- }
- if (force || !this._extensions[type]) {
- var _ext = extensions[0];
- this._extensions[type] = _ext[0] !== "*" ? _ext : _ext.substr(1);
- }
- }
- };
- Mime.prototype.getType = function(path) {
- path = String(path);
- var last = path.replace(/^.*[/\\]/, "").toLowerCase();
- var ext = last.replace(/^.*\./, "").toLowerCase();
- var hasPath = last.length < path.length;
- var hasDot = ext.length < last.length - 1;
- return (hasDot || !hasPath) && this._types[ext] || null;
- };
- Mime.prototype.getExtension = function(type) {
- type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
- return type && this._extensions[type.toLowerCase()] || null;
- };
- module3.exports = Mime;
- }, { "core-js/modules/es.array.map.js": 280, "core-js/modules/es.regexp.constructor.js": 299, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305 }], 374: [function(require2, module3, exports3) {
- "use strict";
- var Mime = require2("./Mime");
- module3.exports = new Mime(require2("./types/standard"));
- }, { "./Mime": 373, "./types/standard": 375 }], 375: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = {
- "application/andrew-inset": ["ez"],
- "application/applixware": ["aw"],
- "application/atom+xml": ["atom"],
- "application/atomcat+xml": ["atomcat"],
- "application/atomdeleted+xml": ["atomdeleted"],
- "application/atomsvc+xml": ["atomsvc"],
- "application/atsc-dwd+xml": ["dwd"],
- "application/atsc-held+xml": ["held"],
- "application/atsc-rsat+xml": ["rsat"],
- "application/bdoc": ["bdoc"],
- "application/calendar+xml": ["xcs"],
- "application/ccxml+xml": ["ccxml"],
- "application/cdfx+xml": ["cdfx"],
- "application/cdmi-capability": ["cdmia"],
- "application/cdmi-container": ["cdmic"],
- "application/cdmi-domain": ["cdmid"],
- "application/cdmi-object": ["cdmio"],
- "application/cdmi-queue": ["cdmiq"],
- "application/cu-seeme": ["cu"],
- "application/dash+xml": ["mpd"],
- "application/davmount+xml": ["davmount"],
- "application/docbook+xml": ["dbk"],
- "application/dssc+der": ["dssc"],
- "application/dssc+xml": ["xdssc"],
- "application/ecmascript": ["es", "ecma"],
- "application/emma+xml": ["emma"],
- "application/emotionml+xml": ["emotionml"],
- "application/epub+zip": ["epub"],
- "application/exi": ["exi"],
- "application/express": ["exp"],
- "application/fdt+xml": ["fdt"],
- "application/font-tdpfr": ["pfr"],
- "application/geo+json": ["geojson"],
- "application/gml+xml": ["gml"],
- "application/gpx+xml": ["gpx"],
- "application/gxf": ["gxf"],
- "application/gzip": ["gz"],
- "application/hjson": ["hjson"],
- "application/hyperstudio": ["stk"],
- "application/inkml+xml": ["ink", "inkml"],
- "application/ipfix": ["ipfix"],
- "application/its+xml": ["its"],
- "application/java-archive": ["jar", "war", "ear"],
- "application/java-serialized-object": ["ser"],
- "application/java-vm": ["class"],
- "application/javascript": ["js", "mjs"],
- "application/json": ["json", "map"],
- "application/json5": ["json5"],
- "application/jsonml+json": ["jsonml"],
- "application/ld+json": ["jsonld"],
- "application/lgr+xml": ["lgr"],
- "application/lost+xml": ["lostxml"],
- "application/mac-binhex40": ["hqx"],
- "application/mac-compactpro": ["cpt"],
- "application/mads+xml": ["mads"],
- "application/manifest+json": ["webmanifest"],
- "application/marc": ["mrc"],
- "application/marcxml+xml": ["mrcx"],
- "application/mathematica": ["ma", "nb", "mb"],
- "application/mathml+xml": ["mathml"],
- "application/mbox": ["mbox"],
- "application/mediaservercontrol+xml": ["mscml"],
- "application/metalink+xml": ["metalink"],
- "application/metalink4+xml": ["meta4"],
- "application/mets+xml": ["mets"],
- "application/mmt-aei+xml": ["maei"],
- "application/mmt-usd+xml": ["musd"],
- "application/mods+xml": ["mods"],
- "application/mp21": ["m21", "mp21"],
- "application/mp4": ["mp4s", "m4p"],
- "application/msword": ["doc", "dot"],
- "application/mxf": ["mxf"],
- "application/n-quads": ["nq"],
- "application/n-triples": ["nt"],
- "application/node": ["cjs"],
- "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"],
- "application/oda": ["oda"],
- "application/oebps-package+xml": ["opf"],
- "application/ogg": ["ogx"],
- "application/omdoc+xml": ["omdoc"],
- "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"],
- "application/oxps": ["oxps"],
- "application/p2p-overlay+xml": ["relo"],
- "application/patch-ops-error+xml": ["xer"],
- "application/pdf": ["pdf"],
- "application/pgp-encrypted": ["pgp"],
- "application/pgp-signature": ["asc", "sig"],
- "application/pics-rules": ["prf"],
- "application/pkcs10": ["p10"],
- "application/pkcs7-mime": ["p7m", "p7c"],
- "application/pkcs7-signature": ["p7s"],
- "application/pkcs8": ["p8"],
- "application/pkix-attr-cert": ["ac"],
- "application/pkix-cert": ["cer"],
- "application/pkix-crl": ["crl"],
- "application/pkix-pkipath": ["pkipath"],
- "application/pkixcmp": ["pki"],
- "application/pls+xml": ["pls"],
- "application/postscript": ["ai", "eps", "ps"],
- "application/provenance+xml": ["provx"],
- "application/pskc+xml": ["pskcxml"],
- "application/raml+yaml": ["raml"],
- "application/rdf+xml": ["rdf", "owl"],
- "application/reginfo+xml": ["rif"],
- "application/relax-ng-compact-syntax": ["rnc"],
- "application/resource-lists+xml": ["rl"],
- "application/resource-lists-diff+xml": ["rld"],
- "application/rls-services+xml": ["rs"],
- "application/route-apd+xml": ["rapd"],
- "application/route-s-tsid+xml": ["sls"],
- "application/route-usd+xml": ["rusd"],
- "application/rpki-ghostbusters": ["gbr"],
- "application/rpki-manifest": ["mft"],
- "application/rpki-roa": ["roa"],
- "application/rsd+xml": ["rsd"],
- "application/rss+xml": ["rss"],
- "application/rtf": ["rtf"],
- "application/sbml+xml": ["sbml"],
- "application/scvp-cv-request": ["scq"],
- "application/scvp-cv-response": ["scs"],
- "application/scvp-vp-request": ["spq"],
- "application/scvp-vp-response": ["spp"],
- "application/sdp": ["sdp"],
- "application/senml+xml": ["senmlx"],
- "application/sensml+xml": ["sensmlx"],
- "application/set-payment-initiation": ["setpay"],
- "application/set-registration-initiation": ["setreg"],
- "application/shf+xml": ["shf"],
- "application/sieve": ["siv", "sieve"],
- "application/smil+xml": ["smi", "smil"],
- "application/sparql-query": ["rq"],
- "application/sparql-results+xml": ["srx"],
- "application/srgs": ["gram"],
- "application/srgs+xml": ["grxml"],
- "application/sru+xml": ["sru"],
- "application/ssdl+xml": ["ssdl"],
- "application/ssml+xml": ["ssml"],
- "application/swid+xml": ["swidtag"],
- "application/tei+xml": ["tei", "teicorpus"],
- "application/thraud+xml": ["tfi"],
- "application/timestamped-data": ["tsd"],
- "application/toml": ["toml"],
- "application/trig": ["trig"],
- "application/ttml+xml": ["ttml"],
- "application/ubjson": ["ubj"],
- "application/urc-ressheet+xml": ["rsheet"],
- "application/urc-targetdesc+xml": ["td"],
- "application/voicexml+xml": ["vxml"],
- "application/wasm": ["wasm"],
- "application/widget": ["wgt"],
- "application/winhlp": ["hlp"],
- "application/wsdl+xml": ["wsdl"],
- "application/wspolicy+xml": ["wspolicy"],
- "application/xaml+xml": ["xaml"],
- "application/xcap-att+xml": ["xav"],
- "application/xcap-caps+xml": ["xca"],
- "application/xcap-diff+xml": ["xdf"],
- "application/xcap-el+xml": ["xel"],
- "application/xcap-ns+xml": ["xns"],
- "application/xenc+xml": ["xenc"],
- "application/xhtml+xml": ["xhtml", "xht"],
- "application/xliff+xml": ["xlf"],
- "application/xml": ["xml", "xsl", "xsd", "rng"],
- "application/xml-dtd": ["dtd"],
- "application/xop+xml": ["xop"],
- "application/xproc+xml": ["xpl"],
- "application/xslt+xml": ["*xsl", "xslt"],
- "application/xspf+xml": ["xspf"],
- "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
- "application/yang": ["yang"],
- "application/yin+xml": ["yin"],
- "application/zip": ["zip"],
- "audio/3gpp": ["*3gpp"],
- "audio/adpcm": ["adp"],
- "audio/amr": ["amr"],
- "audio/basic": ["au", "snd"],
- "audio/midi": ["mid", "midi", "kar", "rmi"],
- "audio/mobile-xmf": ["mxmf"],
- "audio/mp3": ["*mp3"],
- "audio/mp4": ["m4a", "mp4a"],
- "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
- "audio/ogg": ["oga", "ogg", "spx", "opus"],
- "audio/s3m": ["s3m"],
- "audio/silk": ["sil"],
- "audio/wav": ["wav"],
- "audio/wave": ["*wav"],
- "audio/webm": ["weba"],
- "audio/xm": ["xm"],
- "font/collection": ["ttc"],
- "font/otf": ["otf"],
- "font/ttf": ["ttf"],
- "font/woff": ["woff"],
- "font/woff2": ["woff2"],
- "image/aces": ["exr"],
- "image/apng": ["apng"],
- "image/avif": ["avif"],
- "image/bmp": ["bmp"],
- "image/cgm": ["cgm"],
- "image/dicom-rle": ["drle"],
- "image/emf": ["emf"],
- "image/fits": ["fits"],
- "image/g3fax": ["g3"],
- "image/gif": ["gif"],
- "image/heic": ["heic"],
- "image/heic-sequence": ["heics"],
- "image/heif": ["heif"],
- "image/heif-sequence": ["heifs"],
- "image/hej2k": ["hej2"],
- "image/hsj2": ["hsj2"],
- "image/ief": ["ief"],
- "image/jls": ["jls"],
- "image/jp2": ["jp2", "jpg2"],
- "image/jpeg": ["jpeg", "jpg", "jpe"],
- "image/jph": ["jph"],
- "image/jphc": ["jhc"],
- "image/jpm": ["jpm"],
- "image/jpx": ["jpx", "jpf"],
- "image/jxr": ["jxr"],
- "image/jxra": ["jxra"],
- "image/jxrs": ["jxrs"],
- "image/jxs": ["jxs"],
- "image/jxsc": ["jxsc"],
- "image/jxsi": ["jxsi"],
- "image/jxss": ["jxss"],
- "image/ktx": ["ktx"],
- "image/ktx2": ["ktx2"],
- "image/png": ["png"],
- "image/sgi": ["sgi"],
- "image/svg+xml": ["svg", "svgz"],
- "image/t38": ["t38"],
- "image/tiff": ["tif", "tiff"],
- "image/tiff-fx": ["tfx"],
- "image/webp": ["webp"],
- "image/wmf": ["wmf"],
- "message/disposition-notification": ["disposition-notification"],
- "message/global": ["u8msg"],
- "message/global-delivery-status": ["u8dsn"],
- "message/global-disposition-notification": ["u8mdn"],
- "message/global-headers": ["u8hdr"],
- "message/rfc822": ["eml", "mime"],
- "model/3mf": ["3mf"],
- "model/gltf+json": ["gltf"],
- "model/gltf-binary": ["glb"],
- "model/iges": ["igs", "iges"],
- "model/mesh": ["msh", "mesh", "silo"],
- "model/mtl": ["mtl"],
- "model/obj": ["obj"],
- "model/step+xml": ["stpx"],
- "model/step+zip": ["stpz"],
- "model/step-xml+zip": ["stpxz"],
- "model/stl": ["stl"],
- "model/vrml": ["wrl", "vrml"],
- "model/x3d+binary": ["*x3db", "x3dbz"],
- "model/x3d+fastinfoset": ["x3db"],
- "model/x3d+vrml": ["*x3dv", "x3dvz"],
- "model/x3d+xml": ["x3d", "x3dz"],
- "model/x3d-vrml": ["x3dv"],
- "text/cache-manifest": ["appcache", "manifest"],
- "text/calendar": ["ics", "ifb"],
- "text/coffeescript": ["coffee", "litcoffee"],
- "text/css": ["css"],
- "text/csv": ["csv"],
- "text/html": ["html", "htm", "shtml"],
- "text/jade": ["jade"],
- "text/jsx": ["jsx"],
- "text/less": ["less"],
- "text/markdown": ["markdown", "md"],
- "text/mathml": ["mml"],
- "text/mdx": ["mdx"],
- "text/n3": ["n3"],
- "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
- "text/richtext": ["rtx"],
- "text/rtf": ["*rtf"],
- "text/sgml": ["sgml", "sgm"],
- "text/shex": ["shex"],
- "text/slim": ["slim", "slm"],
- "text/spdx": ["spdx"],
- "text/stylus": ["stylus", "styl"],
- "text/tab-separated-values": ["tsv"],
- "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
- "text/turtle": ["ttl"],
- "text/uri-list": ["uri", "uris", "urls"],
- "text/vcard": ["vcard"],
- "text/vtt": ["vtt"],
- "text/xml": ["*xml"],
- "text/yaml": ["yaml", "yml"],
- "video/3gpp": ["3gp", "3gpp"],
- "video/3gpp2": ["3g2"],
- "video/h261": ["h261"],
- "video/h263": ["h263"],
- "video/h264": ["h264"],
- "video/iso.segment": ["m4s"],
- "video/jpeg": ["jpgv"],
- "video/jpm": ["*jpm", "jpgm"],
- "video/mj2": ["mj2", "mjp2"],
- "video/mp2t": ["ts"],
- "video/mp4": ["mp4", "mp4v", "mpg4"],
- "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
- "video/ogg": ["ogv"],
- "video/quicktime": ["qt", "mov"],
- "video/webm": ["webm"]
- };
- }, {}], 376: [function(require2, module3, exports3) {
- var s = 1e3;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var w = d * 7;
- var y = d * 365.25;
- module3.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === "string" && val.length > 0) {
- return parse(val);
- } else if (type === "number" && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
- );
- };
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || "ms").toLowerCase();
- switch (type) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return n * y;
- case "weeks":
- case "week":
- case "w":
- return n * w;
- case "days":
- case "day":
- case "d":
- return n * d;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * h;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * m;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * s;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- default:
- return void 0;
- }
- }
- function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + "d";
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + "h";
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + "m";
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + "s";
- }
- return ms + "ms";
- }
- function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, "day");
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, "hour");
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, "minute");
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, "second");
- }
- return ms + " ms";
- }
- function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
- }
- }, {}], 377: [function(require2, module3, exports3) {
- "use strict";
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
- function toObject(val) {
- if (val === null || val === void 0) {
- throw new TypeError("Object.assign cannot be called with null or undefined");
- }
- return Object(val);
- }
- function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
- var test1 = new String("abc");
- test1[5] = "de";
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
- return false;
- }
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2["_" + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
- return test2[n];
- });
- if (order2.join("") !== "0123456789") {
- return false;
- }
- var test3 = {};
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
- return false;
- }
- return true;
- } catch (err) {
- return false;
- }
- }
- module3.exports = shouldUseNative() ? Object.assign : function(target, source) {
- var from;
- var to = toObject(target);
- var symbols;
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
- return to;
- };
- }, {}], 378: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- function assertPath(path) {
- if (typeof path !== "string") {
- throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
- }
- }
- function normalizeStringPosix(path, allowAboveRoot) {
- var res = "";
- var lastSegmentLength = 0;
- var lastSlash = -1;
- var dots = 0;
- var code;
- for (var i = 0; i <= path.length; ++i) {
- if (i < path.length)
- code = path.charCodeAt(i);
- else if (code === 47)
- break;
- else
- code = 47;
- if (code === 47) {
- if (lastSlash === i - 1 || dots === 1) {
- } else if (lastSlash !== i - 1 && dots === 2) {
- if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
- if (res.length > 2) {
- var lastSlashIndex = res.lastIndexOf("/");
- if (lastSlashIndex !== res.length - 1) {
- if (lastSlashIndex === -1) {
- res = "";
- lastSegmentLength = 0;
- } else {
- res = res.slice(0, lastSlashIndex);
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
- }
- lastSlash = i;
- dots = 0;
- continue;
- }
- } else if (res.length === 2 || res.length === 1) {
- res = "";
- lastSegmentLength = 0;
- lastSlash = i;
- dots = 0;
- continue;
- }
- }
- if (allowAboveRoot) {
- if (res.length > 0)
- res += "/..";
- else
- res = "..";
- lastSegmentLength = 2;
- }
- } else {
- if (res.length > 0)
- res += "/" + path.slice(lastSlash + 1, i);
- else
- res = path.slice(lastSlash + 1, i);
- lastSegmentLength = i - lastSlash - 1;
- }
- lastSlash = i;
- dots = 0;
- } else if (code === 46 && dots !== -1) {
- ++dots;
- } else {
- dots = -1;
- }
- }
- return res;
- }
- function _format(sep, pathObject) {
- var dir = pathObject.dir || pathObject.root;
- var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
- if (!dir) {
- return base;
- }
- if (dir === pathObject.root) {
- return dir + base;
- }
- return dir + sep + base;
- }
- var posix = {
- // path.resolve([from ...], to)
- resolve: function resolve() {
- var resolvedPath = "";
- var resolvedAbsolute = false;
- var cwd;
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path;
- if (i >= 0)
- path = arguments[i];
- else {
- if (cwd === void 0)
- cwd = process.cwd();
- path = cwd;
- }
- assertPath(path);
- if (path.length === 0) {
- continue;
- }
- resolvedPath = path + "/" + resolvedPath;
- resolvedAbsolute = path.charCodeAt(0) === 47;
- }
- resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
- if (resolvedAbsolute) {
- if (resolvedPath.length > 0)
- return "/" + resolvedPath;
- else
- return "/";
- } else if (resolvedPath.length > 0) {
- return resolvedPath;
- } else {
- return ".";
- }
- },
- normalize: function normalize(path) {
- assertPath(path);
- if (path.length === 0)
- return ".";
- var isAbsolute = path.charCodeAt(0) === 47;
- var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
- path = normalizeStringPosix(path, !isAbsolute);
- if (path.length === 0 && !isAbsolute)
- path = ".";
- if (path.length > 0 && trailingSeparator)
- path += "/";
- if (isAbsolute)
- return "/" + path;
- return path;
- },
- isAbsolute: function isAbsolute(path) {
- assertPath(path);
- return path.length > 0 && path.charCodeAt(0) === 47;
- },
- join: function join() {
- if (arguments.length === 0)
- return ".";
- var joined;
- for (var i = 0; i < arguments.length; ++i) {
- var arg = arguments[i];
- assertPath(arg);
- if (arg.length > 0) {
- if (joined === void 0)
- joined = arg;
- else
- joined += "/" + arg;
- }
- }
- if (joined === void 0)
- return ".";
- return posix.normalize(joined);
- },
- relative: function relative(from, to) {
- assertPath(from);
- assertPath(to);
- if (from === to)
- return "";
- from = posix.resolve(from);
- to = posix.resolve(to);
- if (from === to)
- return "";
- var fromStart = 1;
- for (; fromStart < from.length; ++fromStart) {
- if (from.charCodeAt(fromStart) !== 47)
- break;
- }
- var fromEnd = from.length;
- var fromLen = fromEnd - fromStart;
- var toStart = 1;
- for (; toStart < to.length; ++toStart) {
- if (to.charCodeAt(toStart) !== 47)
- break;
- }
- var toEnd = to.length;
- var toLen = toEnd - toStart;
- var length = fromLen < toLen ? fromLen : toLen;
- var lastCommonSep = -1;
- var i = 0;
- for (; i <= length; ++i) {
- if (i === length) {
- if (toLen > length) {
- if (to.charCodeAt(toStart + i) === 47) {
- return to.slice(toStart + i + 1);
- } else if (i === 0) {
- return to.slice(toStart + i);
- }
- } else if (fromLen > length) {
- if (from.charCodeAt(fromStart + i) === 47) {
- lastCommonSep = i;
- } else if (i === 0) {
- lastCommonSep = 0;
- }
- }
- break;
- }
- var fromCode = from.charCodeAt(fromStart + i);
- var toCode = to.charCodeAt(toStart + i);
- if (fromCode !== toCode)
- break;
- else if (fromCode === 47)
- lastCommonSep = i;
- }
- var out = "";
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
- if (i === fromEnd || from.charCodeAt(i) === 47) {
- if (out.length === 0)
- out += "..";
- else
- out += "/..";
- }
- }
- if (out.length > 0)
- return out + to.slice(toStart + lastCommonSep);
- else {
- toStart += lastCommonSep;
- if (to.charCodeAt(toStart) === 47)
- ++toStart;
- return to.slice(toStart);
- }
- },
- _makeLong: function _makeLong(path) {
- return path;
- },
- dirname: function dirname(path) {
- assertPath(path);
- if (path.length === 0)
- return ".";
- var code = path.charCodeAt(0);
- var hasRoot = code === 47;
- var end = -1;
- var matchedSlash = true;
- for (var i = path.length - 1; i >= 1; --i) {
- code = path.charCodeAt(i);
- if (code === 47) {
- if (!matchedSlash) {
- end = i;
- break;
- }
- } else {
- matchedSlash = false;
- }
- }
- if (end === -1)
- return hasRoot ? "/" : ".";
- if (hasRoot && end === 1)
- return "//";
- return path.slice(0, end);
- },
- basename: function basename(path, ext) {
- if (ext !== void 0 && typeof ext !== "string")
- throw new TypeError('"ext" argument must be a string');
- assertPath(path);
- var start = 0;
- var end = -1;
- var matchedSlash = true;
- var i;
- if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
- if (ext.length === path.length && ext === path)
- return "";
- var extIdx = ext.length - 1;
- var firstNonSlashEnd = -1;
- for (i = path.length - 1; i >= 0; --i) {
- var code = path.charCodeAt(i);
- if (code === 47) {
- if (!matchedSlash) {
- start = i + 1;
- break;
- }
- } else {
- if (firstNonSlashEnd === -1) {
- matchedSlash = false;
- firstNonSlashEnd = i + 1;
- }
- if (extIdx >= 0) {
- if (code === ext.charCodeAt(extIdx)) {
- if (--extIdx === -1) {
- end = i;
- }
- } else {
- extIdx = -1;
- end = firstNonSlashEnd;
- }
- }
- }
- }
- if (start === end)
- end = firstNonSlashEnd;
- else if (end === -1)
- end = path.length;
- return path.slice(start, end);
- } else {
- for (i = path.length - 1; i >= 0; --i) {
- if (path.charCodeAt(i) === 47) {
- if (!matchedSlash) {
- start = i + 1;
- break;
- }
- } else if (end === -1) {
- matchedSlash = false;
- end = i + 1;
- }
- }
- if (end === -1)
- return "";
- return path.slice(start, end);
- }
- },
- extname: function extname(path) {
- assertPath(path);
- var startDot = -1;
- var startPart = 0;
- var end = -1;
- var matchedSlash = true;
- var preDotState = 0;
- for (var i = path.length - 1; i >= 0; --i) {
- var code = path.charCodeAt(i);
- if (code === 47) {
- if (!matchedSlash) {
- startPart = i + 1;
- break;
- }
- continue;
- }
- if (end === -1) {
- matchedSlash = false;
- end = i + 1;
- }
- if (code === 46) {
- if (startDot === -1)
- startDot = i;
- else if (preDotState !== 1)
- preDotState = 1;
- } else if (startDot !== -1) {
- preDotState = -1;
- }
- }
- if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
- preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
- return "";
- }
- return path.slice(startDot, end);
- },
- format: function format(pathObject) {
- if (pathObject === null || typeof pathObject !== "object") {
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
- }
- return _format("/", pathObject);
- },
- parse: function parse(path) {
- assertPath(path);
- var ret = { root: "", dir: "", base: "", ext: "", name: "" };
- if (path.length === 0)
- return ret;
- var code = path.charCodeAt(0);
- var isAbsolute = code === 47;
- var start;
- if (isAbsolute) {
- ret.root = "/";
- start = 1;
- } else {
- start = 0;
- }
- var startDot = -1;
- var startPart = 0;
- var end = -1;
- var matchedSlash = true;
- var i = path.length - 1;
- var preDotState = 0;
- for (; i >= start; --i) {
- code = path.charCodeAt(i);
- if (code === 47) {
- if (!matchedSlash) {
- startPart = i + 1;
- break;
- }
- continue;
- }
- if (end === -1) {
- matchedSlash = false;
- end = i + 1;
- }
- if (code === 46) {
- if (startDot === -1)
- startDot = i;
- else if (preDotState !== 1)
- preDotState = 1;
- } else if (startDot !== -1) {
- preDotState = -1;
- }
- }
- if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
- preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
- if (end !== -1) {
- if (startPart === 0 && isAbsolute)
- ret.base = ret.name = path.slice(1, end);
- else
- ret.base = ret.name = path.slice(startPart, end);
- }
- } else {
- if (startPart === 0 && isAbsolute) {
- ret.name = path.slice(1, startDot);
- ret.base = path.slice(1, end);
- } else {
- ret.name = path.slice(startPart, startDot);
- ret.base = path.slice(startPart, end);
- }
- ret.ext = path.slice(startDot, end);
- }
- if (startPart > 0)
- ret.dir = path.slice(0, startPart - 1);
- else if (isAbsolute)
- ret.dir = "/";
- return ret;
- },
- sep: "/",
- delimiter: ":",
- win32: null,
- posix: null
- };
- posix.posix = posix;
- module3.exports = posix;
- }).call(this);
- }).call(this, require2("_process"));
- }, { "_process": 467 }], 379: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- ;
- (function() {
- "use strict";
- var objectTypes = {
- "function": true,
- "object": true
- };
- var root = objectTypes[typeof window] && window || this;
- var oldRoot = root;
- var freeExports = objectTypes[typeof exports3] && exports3;
- var freeModule = objectTypes[typeof module3] && module3 && !module3.nodeType && module3;
- var freeGlobal = freeExports && freeModule && typeof global2 == "object" && global2;
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
- root = freeGlobal;
- }
- var maxSafeInteger = Math.pow(2, 53) - 1;
- var reOpera = /\bOpera/;
- var thisBinding = this;
- var objectProto = Object.prototype;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var toString = objectProto.toString;
- function capitalize(string) {
- string = String(string);
- return string.charAt(0).toUpperCase() + string.slice(1);
- }
- function cleanupOS(os, pattern, label) {
- var data = {
- "10.0": "10",
- "6.4": "10 Technical Preview",
- "6.3": "8.1",
- "6.2": "8",
- "6.1": "Server 2008 R2 / 7",
- "6.0": "Server 2008 / Vista",
- "5.2": "Server 2003 / XP 64-bit",
- "5.1": "XP",
- "5.01": "2000 SP1",
- "5.0": "2000",
- "4.0": "NT",
- "4.90": "ME"
- };
- if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && (data = data[/[\d.]+$/.exec(os)])) {
- os = "Windows " + data;
- }
- os = String(os);
- if (pattern && label) {
- os = os.replace(RegExp(pattern, "i"), label);
- }
- os = format(
- os.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]
- );
- return os;
- }
- function each(object, callback) {
- var index = -1, length = object ? object.length : 0;
- if (typeof length == "number" && length > -1 && length <= maxSafeInteger) {
- while (++index < length) {
- callback(object[index], index, object);
- }
- } else {
- forOwn(object, callback);
- }
- }
- function format(string) {
- string = trim(string);
- return /^(?:webOS|i(?:OS|P))/.test(string) ? string : capitalize(string);
- }
- function forOwn(object, callback) {
- for (var key in object) {
- if (hasOwnProperty.call(object, key)) {
- callback(object[key], key, object);
- }
- }
- }
- function getClassOf(value) {
- return value == null ? capitalize(value) : toString.call(value).slice(8, -1);
- }
- function isHostType(object, property) {
- var type = object != null ? typeof object[property] : "number";
- return !/^(?:boolean|number|string|undefined)$/.test(type) && (type == "object" ? !!object[property] : true);
- }
- function qualify(string) {
- return String(string).replace(/([ -])(?!$)/g, "$1?");
- }
- function reduce(array, callback) {
- var accumulator = null;
- each(array, function(value, index) {
- accumulator = callback(accumulator, value, index, array);
- });
- return accumulator;
- }
- function trim(string) {
- return String(string).replace(/^ +| +$/g, "");
- }
- function parse(ua) {
- var context = root;
- var isCustomContext = ua && typeof ua == "object" && getClassOf(ua) != "String";
- if (isCustomContext) {
- context = ua;
- ua = null;
- }
- var nav = context.navigator || {};
- var userAgent = nav.userAgent || "";
- ua || (ua = userAgent);
- var isModuleScope = isCustomContext || thisBinding == oldRoot;
- var likeChrome = isCustomContext ? !!nav.likeChrome : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
- var objectClass = "Object", airRuntimeClass = isCustomContext ? objectClass : "ScriptBridgingProxyObject", enviroClass = isCustomContext ? objectClass : "Environment", javaClass = isCustomContext && context.java ? "JavaPackage" : getClassOf(context.java), phantomClass = isCustomContext ? objectClass : "RuntimeObject";
- var java = /\bJava/.test(javaClass) && context.java;
- var rhino = java && getClassOf(context.environment) == enviroClass;
- var alpha = java ? "a" : "α";
- var beta = java ? "b" : "β";
- var doc = context.document || {};
- var opera = context.operamini || context.opera;
- var operaClass = reOpera.test(operaClass = isCustomContext && opera ? opera["[[Class]]"] : getClassOf(opera)) ? operaClass : opera = null;
- var data;
- var arch = ua;
- var description = [];
- var prerelease = null;
- var useFeatures = ua == userAgent;
- var version = useFeatures && opera && typeof opera.version == "function" && opera.version();
- var isSpecialCasedOS;
- var layout = getLayout([
- { "label": "EdgeHTML", "pattern": "Edge" },
- "Trident",
- { "label": "WebKit", "pattern": "AppleWebKit" },
- "iCab",
- "Presto",
- "NetFront",
- "Tasman",
- "KHTML",
- "Gecko"
- ]);
- var name = getName([
- "Adobe AIR",
- "Arora",
- "Avant Browser",
- "Breach",
- "Camino",
- "Electron",
- "Epiphany",
- "Fennec",
- "Flock",
- "Galeon",
- "GreenBrowser",
- "iCab",
- "Iceweasel",
- "K-Meleon",
- "Konqueror",
- "Lunascape",
- "Maxthon",
- { "label": "Microsoft Edge", "pattern": "(?:Edge|Edg|EdgA|EdgiOS)" },
- "Midori",
- "Nook Browser",
- "PaleMoon",
- "PhantomJS",
- "Raven",
- "Rekonq",
- "RockMelt",
- { "label": "Samsung Internet", "pattern": "SamsungBrowser" },
- "SeaMonkey",
- { "label": "Silk", "pattern": "(?:Cloud9|Silk-Accelerated)" },
- "Sleipnir",
- "SlimBrowser",
- { "label": "SRWare Iron", "pattern": "Iron" },
- "Sunrise",
- "Swiftfox",
- "Vivaldi",
- "Waterfox",
- "WebPositive",
- { "label": "Yandex Browser", "pattern": "YaBrowser" },
- { "label": "UC Browser", "pattern": "UCBrowser" },
- "Opera Mini",
- { "label": "Opera Mini", "pattern": "OPiOS" },
- "Opera",
- { "label": "Opera", "pattern": "OPR" },
- "Chromium",
- "Chrome",
- { "label": "Chrome", "pattern": "(?:HeadlessChrome)" },
- { "label": "Chrome Mobile", "pattern": "(?:CriOS|CrMo)" },
- { "label": "Firefox", "pattern": "(?:Firefox|Minefield)" },
- { "label": "Firefox for iOS", "pattern": "FxiOS" },
- { "label": "IE", "pattern": "IEMobile" },
- { "label": "IE", "pattern": "MSIE" },
- "Safari"
- ]);
- var product = getProduct([
- { "label": "BlackBerry", "pattern": "BB10" },
- "BlackBerry",
- { "label": "Galaxy S", "pattern": "GT-I9000" },
- { "label": "Galaxy S2", "pattern": "GT-I9100" },
- { "label": "Galaxy S3", "pattern": "GT-I9300" },
- { "label": "Galaxy S4", "pattern": "GT-I9500" },
- { "label": "Galaxy S5", "pattern": "SM-G900" },
- { "label": "Galaxy S6", "pattern": "SM-G920" },
- { "label": "Galaxy S6 Edge", "pattern": "SM-G925" },
- { "label": "Galaxy S7", "pattern": "SM-G930" },
- { "label": "Galaxy S7 Edge", "pattern": "SM-G935" },
- "Google TV",
- "Lumia",
- "iPad",
- "iPod",
- "iPhone",
- "Kindle",
- { "label": "Kindle Fire", "pattern": "(?:Cloud9|Silk-Accelerated)" },
- "Nexus",
- "Nook",
- "PlayBook",
- "PlayStation Vita",
- "PlayStation",
- "TouchPad",
- "Transformer",
- { "label": "Wii U", "pattern": "WiiU" },
- "Wii",
- "Xbox One",
- { "label": "Xbox 360", "pattern": "Xbox" },
- "Xoom"
- ]);
- var manufacturer = getManufacturer({
- "Apple": { "iPad": 1, "iPhone": 1, "iPod": 1 },
- "Alcatel": {},
- "Archos": {},
- "Amazon": { "Kindle": 1, "Kindle Fire": 1 },
- "Asus": { "Transformer": 1 },
- "Barnes & Noble": { "Nook": 1 },
- "BlackBerry": { "PlayBook": 1 },
- "Google": { "Google TV": 1, "Nexus": 1 },
- "HP": { "TouchPad": 1 },
- "HTC": {},
- "Huawei": {},
- "Lenovo": {},
- "LG": {},
- "Microsoft": { "Xbox": 1, "Xbox One": 1 },
- "Motorola": { "Xoom": 1 },
- "Nintendo": { "Wii U": 1, "Wii": 1 },
- "Nokia": { "Lumia": 1 },
- "Oppo": {},
- "Samsung": { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 },
- "Sony": { "PlayStation": 1, "PlayStation Vita": 1 },
- "Xiaomi": { "Mi": 1, "Redmi": 1 }
- });
- var os = getOS([
- "Windows Phone",
- "KaiOS",
- "Android",
- "CentOS",
- { "label": "Chrome OS", "pattern": "CrOS" },
- "Debian",
- { "label": "DragonFly BSD", "pattern": "DragonFly" },
- "Fedora",
- "FreeBSD",
- "Gentoo",
- "Haiku",
- "Kubuntu",
- "Linux Mint",
- "OpenBSD",
- "Red Hat",
- "SuSE",
- "Ubuntu",
- "Xubuntu",
- "Cygwin",
- "Symbian OS",
- "hpwOS",
- "webOS ",
- "webOS",
- "Tablet OS",
- "Tizen",
- "Linux",
- "Mac OS X",
- "Macintosh",
- "Mac",
- "Windows 98;",
- "Windows "
- ]);
- function getLayout(guesses) {
- return reduce(guesses, function(result, guess) {
- return result || RegExp("\\b" + (guess.pattern || qualify(guess)) + "\\b", "i").exec(ua) && (guess.label || guess);
- });
- }
- function getManufacturer(guesses) {
- return reduce(guesses, function(result, value, key) {
- return result || (value[product] || value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || RegExp("\\b" + qualify(key) + "(?:\\b|\\w*\\d)", "i").exec(ua)) && key;
- });
- }
- function getName(guesses) {
- return reduce(guesses, function(result, guess) {
- return result || RegExp("\\b" + (guess.pattern || qualify(guess)) + "\\b", "i").exec(ua) && (guess.label || guess);
- });
- }
- function getOS(guesses) {
- return reduce(guesses, function(result, guess) {
- var pattern = guess.pattern || qualify(guess);
- if (!result && (result = RegExp("\\b" + pattern + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(ua))) {
- result = cleanupOS(result, pattern, guess.label || guess);
- }
- return result;
- });
- }
- function getProduct(guesses) {
- return reduce(guesses, function(result, guess) {
- var pattern = guess.pattern || qualify(guess);
- if (!result && (result = RegExp("\\b" + pattern + " *\\d+[.\\w_]*", "i").exec(ua) || RegExp("\\b" + pattern + " *\\w+-[\\w]*", "i").exec(ua) || RegExp("\\b" + pattern + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(ua))) {
- if ((result = String(guess.label && !RegExp(pattern, "i").test(guess.label) ? guess.label : result).split("/"))[1] && !/[\d.]+/.test(result[0])) {
- result[0] += " " + result[1];
- }
- guess = guess.label || guess;
- result = format(result[0].replace(RegExp(pattern, "i"), guess).replace(RegExp("; *(?:" + guess + "[_-])?", "i"), " ").replace(RegExp("(" + guess + ")[-_.]?(\\w)", "i"), "$1 $2"));
- }
- return result;
- });
- }
- function getVersion(patterns) {
- return reduce(patterns, function(result, pattern) {
- return result || (RegExp(pattern + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(ua) || 0)[1] || null;
- });
- }
- function toStringPlatform() {
- return this.description || "";
- }
- layout && (layout = [layout]);
- if (/\bAndroid\b/.test(os) && !product && (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
- product = trim(data[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i, "") || null;
- }
- if (manufacturer && !product) {
- product = getProduct([manufacturer]);
- } else if (manufacturer && product) {
- product = product.replace(RegExp("^(" + qualify(manufacturer) + ")[-_.\\s]", "i"), manufacturer + " ").replace(RegExp("^(" + qualify(manufacturer) + ")[-_.]?(\\w)", "i"), manufacturer + " $2");
- }
- if (data = /\bGoogle TV\b/.exec(product)) {
- product = data[0];
- }
- if (/\bSimulator\b/i.test(ua)) {
- product = (product ? product + " " : "") + "Simulator";
- }
- if (name == "Opera Mini" && /\bOPiOS\b/.test(ua)) {
- description.push("running in Turbo/Uncompressed mode");
- }
- if (name == "IE" && /\blike iPhone OS\b/.test(ua)) {
- data = parse(ua.replace(/like iPhone OS/, ""));
- manufacturer = data.manufacturer;
- product = data.product;
- } else if (/^iP/.test(product)) {
- name || (name = "Safari");
- os = "iOS" + ((data = / OS ([\d_]+)/i.exec(ua)) ? " " + data[1].replace(/_/g, ".") : "");
- } else if (name == "Konqueror" && /^Linux\b/i.test(os)) {
- os = "Kubuntu";
- } else if (manufacturer && manufacturer != "Google" && (/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua) || /\bVita\b/.test(product)) || /\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua)) {
- name = "Android Browser";
- os = /\bAndroid\b/.test(os) ? os : "Android";
- } else if (name == "Silk") {
- if (!/\bMobi/i.test(ua)) {
- os = "Android";
- description.unshift("desktop mode");
- }
- if (/Accelerated *= *true/i.test(ua)) {
- description.unshift("accelerated");
- }
- } else if (name == "UC Browser" && /\bUCWEB\b/.test(ua)) {
- description.push("speed mode");
- } else if (name == "PaleMoon" && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
- description.push("identifying as Firefox " + data[1]);
- } else if (name == "Firefox" && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
- os || (os = "Firefox OS");
- product || (product = data[1]);
- } else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
- if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + "/") + 8))) {
- name = null;
- }
- if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
- name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + " Browser";
- }
- } else if (name == "Electron" && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
- description.push("Chromium " + data);
- }
- if (!version) {
- version = getVersion([
- "(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)",
- "Version",
- qualify(name),
- "(?:Firefox|Minefield|NetFront)"
- ]);
- }
- if (data = layout == "iCab" && parseFloat(version) > 3 && "WebKit" || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && "WebKit" || !layout && /\bMSIE\b/i.test(ua) && (os == "Mac OS" ? "Tasman" : "Trident") || layout == "WebKit" && /\bPlayStation\b(?! Vita\b)/i.test(name) && "NetFront") {
- layout = [data];
- }
- if (name == "IE" && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
- name += " Mobile";
- os = "Windows Phone " + (/\+$/.test(data) ? data : data + ".x");
- description.unshift("desktop mode");
- } else if (/\bWPDesktop\b/i.test(ua)) {
- name = "IE Mobile";
- os = "Windows Phone 8.x";
- description.unshift("desktop mode");
- version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
- } else if (name != "IE" && layout == "Trident" && (data = /\brv:([\d.]+)/.exec(ua))) {
- if (name) {
- description.push("identifying as " + name + (version ? " " + version : ""));
- }
- name = "IE";
- version = data[1];
- }
- if (useFeatures) {
- if (isHostType(context, "global")) {
- if (java) {
- data = java.lang.System;
- arch = data.getProperty("os.arch");
- os = os || data.getProperty("os.name") + " " + data.getProperty("os.version");
- }
- if (rhino) {
- try {
- version = context.require("ringo/engine").version.join(".");
- name = "RingoJS";
- } catch (e) {
- if ((data = context.system) && data.global.system == context.system) {
- name = "Narwhal";
- os || (os = data[0].os || null);
- }
- }
- if (!name) {
- name = "Rhino";
- }
- } else if (typeof context.process == "object" && !context.process.browser && (data = context.process)) {
- if (typeof data.versions == "object") {
- if (typeof data.versions.electron == "string") {
- description.push("Node " + data.versions.node);
- name = "Electron";
- version = data.versions.electron;
- } else if (typeof data.versions.nw == "string") {
- description.push("Chromium " + version, "Node " + data.versions.node);
- name = "NW.js";
- version = data.versions.nw;
- }
- }
- if (!name) {
- name = "Node.js";
- arch = data.arch;
- os = data.platform;
- version = /[\d.]+/.exec(data.version);
- version = version ? version[0] : null;
- }
- }
- } else if (getClassOf(data = context.runtime) == airRuntimeClass) {
- name = "Adobe AIR";
- os = data.flash.system.Capabilities.os;
- } else if (getClassOf(data = context.phantom) == phantomClass) {
- name = "PhantomJS";
- version = (data = data.version || null) && data.major + "." + data.minor + "." + data.patch;
- } else if (typeof doc.documentMode == "number" && (data = /\bTrident\/(\d+)/i.exec(ua))) {
- version = [version, doc.documentMode];
- if ((data = +data[1] + 4) != version[1]) {
- description.push("IE " + version[1] + " mode");
- layout && (layout[1] = "");
- version[1] = data;
- }
- version = name == "IE" ? String(version[1].toFixed(1)) : version[0];
- } else if (typeof doc.documentMode == "number" && /^(?:Chrome|Firefox)\b/.test(name)) {
- description.push("masking as " + name + " " + version);
- name = "IE";
- version = "11.0";
- layout = ["Trident"];
- os = "Windows";
- }
- os = os && format(os);
- }
- if (version && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ";" + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && "a")) {
- prerelease = /b/i.test(data) ? "beta" : "alpha";
- version = version.replace(RegExp(data + "\\+?$"), "") + (prerelease == "beta" ? beta : alpha) + (/\d+\+?/.exec(data) || "");
- }
- if (name == "Fennec" || name == "Firefox" && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
- name = "Firefox Mobile";
- } else if (name == "Maxthon" && version) {
- version = version.replace(/\.[\d.]+/, ".x");
- } else if (/\bXbox\b/i.test(product)) {
- if (product == "Xbox 360") {
- os = null;
- }
- if (product == "Xbox 360" && /\bIEMobile\b/.test(ua)) {
- description.unshift("mobile mode");
- }
- } else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == "Windows CE" || /Mobi/i.test(ua))) {
- name += " Mobile";
- } else if (name == "IE" && useFeatures) {
- try {
- if (context.external === null) {
- description.unshift("platform preview");
- }
- } catch (e) {
- description.unshift("embedded");
- }
- } else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(ua) || 0)[1] || version)) {
- data = [data, /BB10/.test(ua)];
- os = (data[1] ? (product = null, manufacturer = "BlackBerry") : "Device Software") + " " + data[0];
- version = null;
- } else if (this != forOwn && product != "Wii" && (useFeatures && opera || /Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua) || name == "Firefox" && /\bOS X (?:\d+\.){2,}/.test(os) || name == "IE" && (os && !/^Win/.test(os) && version > 5.5 || /\bWindows XP\b/.test(os) && version > 8 || version == 8 && !/\bTrident\b/.test(ua))) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, "") + ";")) && data.name) {
- data = "ing as " + data.name + ((data = data.version) ? " " + data : "");
- if (reOpera.test(name)) {
- if (/\bIE\b/.test(data) && os == "Mac OS") {
- os = null;
- }
- data = "identify" + data;
- } else {
- data = "mask" + data;
- if (operaClass) {
- name = format(operaClass.replace(/([a-z])([A-Z])/g, "$1 $2"));
- } else {
- name = "Opera";
- }
- if (/\bIE\b/.test(data)) {
- os = null;
- }
- if (!useFeatures) {
- version = null;
- }
- }
- layout = ["Presto"];
- description.push(data);
- }
- if (data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1]) {
- data = [parseFloat(data.replace(/\.(\d)$/, ".0$1")), data];
- if (name == "Safari" && data[1].slice(-1) == "+") {
- name = "WebKit Nightly";
- prerelease = "alpha";
- version = data[1].slice(0, -1);
- } else if (version == data[1] || version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
- version = null;
- }
- data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
- if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == "WebKit") {
- layout = ["Blink"];
- }
- if (!useFeatures || !likeChrome && !data[1]) {
- layout && (layout[1] = "like Safari");
- data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? "4+" : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : "12");
- } else {
- layout && (layout[1] = "like Chrome");
- data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.1 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.3 ? 11 : data < 535.01 ? 12 : data < 535.02 ? "13+" : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.1 ? 19 : data < 537.01 ? 20 : data < 537.11 ? "21+" : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != "Blink" ? "27" : "28");
- }
- layout && (layout[1] += " " + (data += typeof data == "number" ? ".x" : /[.+]/.test(data) ? "" : "+"));
- if (name == "Safari" && (!version || parseInt(version) > 45)) {
- version = data;
- } else if (name == "Chrome" && /\bHeadlessChrome/i.test(ua)) {
- description.unshift("headless");
- }
- }
- if (name == "Opera" && (data = /\bzbov|zvav$/.exec(os))) {
- name += " ";
- description.unshift("desktop mode");
- if (data == "zvav") {
- name += "Mini";
- version = null;
- } else {
- name += "Mobile";
- }
- os = os.replace(RegExp(" *" + data + "$"), "");
- } else if (name == "Safari" && /\bChrome\b/.exec(layout && layout[1])) {
- description.unshift("desktop mode");
- name = "Chrome Mobile";
- version = null;
- if (/\bOS X\b/.test(os)) {
- manufacturer = "Apple";
- os = "iOS 4.3+";
- } else {
- os = null;
- }
- } else if (/\bSRWare Iron\b/.test(name) && !version) {
- version = getVersion("Chrome");
- }
- if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && ua.indexOf("/" + data + "-") > -1) {
- os = trim(os.replace(data, ""));
- }
- if (os && os.indexOf(name) != -1 && !RegExp(name + " OS").test(os)) {
- os = os.replace(RegExp(" *" + qualify(name) + " *"), "");
- }
- if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (/Browser|Lunascape|Maxthon/.test(name) || name != "Safari" && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
- (data = layout[layout.length - 1]) && description.push(data);
- }
- if (description.length) {
- description = ["(" + description.join("; ") + ")"];
- }
- if (manufacturer && product && product.indexOf(manufacturer) < 0) {
- description.push("on " + manufacturer);
- }
- if (product) {
- description.push((/^on /.test(description[description.length - 1]) ? "" : "on ") + product);
- }
- if (os) {
- data = / ([\d.+]+)$/.exec(os);
- isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == "/";
- os = {
- "architecture": 32,
- "family": data && !isSpecialCasedOS ? os.replace(data[0], "") : os,
- "version": data ? data[1] : null,
- "toString": function() {
- var version2 = this.version;
- return this.family + (version2 && !isSpecialCasedOS ? " " + version2 : "") + (this.architecture == 64 ? " 64-bit" : "");
- }
- };
- }
- if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
- if (os) {
- os.architecture = 64;
- os.family = os.family.replace(RegExp(" *" + data), "");
- }
- if (name && (/\bWOW64\b/i.test(ua) || useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) {
- description.unshift("32-bit");
- }
- } else if (os && /^OS X/.test(os.family) && name == "Chrome" && parseFloat(version) >= 39) {
- os.architecture = 64;
- }
- ua || (ua = null);
- var platform2 = {};
- platform2.description = ua;
- platform2.layout = layout && layout[0];
- platform2.manufacturer = manufacturer;
- platform2.name = name;
- platform2.prerelease = prerelease;
- platform2.product = product;
- platform2.ua = ua;
- platform2.version = name && version;
- platform2.os = os || {
- /**
- * The CPU architecture the OS is built for.
- *
- * @memberOf platform.os
- * @type number|null
- */
- "architecture": null,
- /**
- * The family of the OS.
- *
- * Common values include:
- * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
- * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
- * "SuSE", "Android", "iOS" and "Windows Phone"
- *
- * @memberOf platform.os
- * @type string|null
- */
- "family": null,
- /**
- * The version of the OS.
- *
- * @memberOf platform.os
- * @type string|null
- */
- "version": null,
- /**
- * Returns the OS string.
- *
- * @memberOf platform.os
- * @returns {string} The OS string.
- */
- "toString": function() {
- return "null";
- }
- };
- platform2.parse = parse;
- platform2.toString = toStringPlatform;
- if (platform2.version) {
- description.unshift(version);
- }
- if (platform2.name) {
- description.unshift(name);
- }
- if (os && name && !(os == String(os).split(" ")[0] && (os == name.split(" ")[0] || product))) {
- description.push(product ? "(" + os + ")" : "on " + os);
- }
- if (description.length) {
- platform2.description = description.join(" ");
- }
- return platform2;
- }
- var platform = parse();
- if (typeof define2 == "function" && typeof define2.amd == "object" && define2.amd) {
- root.platform = platform;
- define2(function() {
- return platform;
- });
- } else if (freeExports && freeModule) {
- forOwn(platform, function(value, key) {
- freeExports[key] = value;
- });
- } else {
- root.platform = platform;
- }
- }).call(this);
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 380: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
- module3.exports = { nextTick };
- } else {
- module3.exports = process;
- }
- function nextTick(fn, arg1, arg2, arg3) {
- if (typeof fn !== "function") {
- throw new TypeError('"callback" argument must be a function');
- }
- var len = arguments.length;
- var args, i;
- switch (len) {
- case 0:
- case 1:
- return process.nextTick(fn);
- case 2:
- return process.nextTick(function afterTickOne() {
- fn.call(null, arg1);
- });
- case 3:
- return process.nextTick(function afterTickTwo() {
- fn.call(null, arg1, arg2);
- });
- case 4:
- return process.nextTick(function afterTickThree() {
- fn.call(null, arg1, arg2, arg3);
- });
- default:
- args = new Array(len - 1);
- i = 0;
- while (i < args.length) {
- args[i++] = arguments[i];
- }
- return process.nextTick(function afterTick() {
- fn.apply(null, args);
- });
- }
- }
- }).call(this);
- }).call(this, require2("_process"));
- }, { "_process": 467 }], 381: [function(require2, module3, exports3) {
- var process = module3.exports = {};
- var cachedSetTimeout;
- var cachedClearTimeout;
- function defaultSetTimout() {
- throw new Error("setTimeout has not been defined");
- }
- function defaultClearTimeout() {
- throw new Error("clearTimeout has not been defined");
- }
- (function() {
- try {
- if (typeof setTimeout === "function") {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === "function") {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- })();
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- return setTimeout(fun, 0);
- }
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- return cachedSetTimeout(fun, 0);
- } catch (e) {
- try {
- return cachedSetTimeout.call(null, fun, 0);
- } catch (e2) {
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- return clearTimeout(marker);
- }
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- return cachedClearTimeout(marker);
- } catch (e) {
- try {
- return cachedClearTimeout.call(null, marker);
- } catch (e2) {
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while (len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- process.nextTick = function(fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function() {
- this.fun.apply(null, this.array);
- };
- process.title = "browser";
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = "";
- process.versions = {};
- function noop() {
- }
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function(name) {
- return [];
- };
- process.binding = function(name) {
- throw new Error("process.binding is not supported");
- };
- process.cwd = function() {
- return "/";
- };
- process.chdir = function(dir) {
- throw new Error("process.chdir is not supported");
- };
- process.umask = function() {
- return 0;
- };
- }, {}], 382: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- ;
- (function(root) {
- var freeExports = typeof exports3 == "object" && exports3 && !exports3.nodeType && exports3;
- var freeModule = typeof module3 == "object" && module3 && !module3.nodeType && module3;
- var freeGlobal = typeof global2 == "object" && global2;
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
- root = freeGlobal;
- }
- var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
- "overflow": "Overflow: input needs wider integers to process",
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
- "invalid-input": "Invalid input"
- }, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key;
- function error(type) {
- throw new RangeError(errors[type]);
- }
- function map(array, fn) {
- var length = array.length;
- var result = [];
- while (length--) {
- result[length] = fn(array[length]);
- }
- return result;
- }
- function mapDomain(string, fn) {
- var parts = string.split("@");
- var result = "";
- if (parts.length > 1) {
- result = parts[0] + "@";
- string = parts[1];
- }
- string = string.replace(regexSeparators, ".");
- var labels = string.split(".");
- var encoded = map(labels, fn).join(".");
- return result + encoded;
- }
- function ucs2decode(string) {
- var output = [], counter = 0, length = string.length, value, extra;
- while (counter < length) {
- value = string.charCodeAt(counter++);
- if (value >= 55296 && value <= 56319 && counter < length) {
- extra = string.charCodeAt(counter++);
- if ((extra & 64512) == 56320) {
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
- } else {
- output.push(value);
- counter--;
- }
- } else {
- output.push(value);
- }
- }
- return output;
- }
- function ucs2encode(array) {
- return map(array, function(value) {
- var output = "";
- if (value > 65535) {
- value -= 65536;
- output += stringFromCharCode(value >>> 10 & 1023 | 55296);
- value = 56320 | value & 1023;
- }
- output += stringFromCharCode(value);
- return output;
- }).join("");
- }
- function basicToDigit(codePoint) {
- if (codePoint - 48 < 10) {
- return codePoint - 22;
- }
- if (codePoint - 65 < 26) {
- return codePoint - 65;
- }
- if (codePoint - 97 < 26) {
- return codePoint - 97;
- }
- return base;
- }
- function digitToBasic(digit, flag) {
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
- }
- function adapt(delta, numPoints, firstTime) {
- var k = 0;
- delta = firstTime ? floor(delta / damp) : delta >> 1;
- delta += floor(delta / numPoints);
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
- delta = floor(delta / baseMinusTMin);
- }
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
- }
- function decode(input) {
- var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, baseMinusT;
- basic = input.lastIndexOf(delimiter);
- if (basic < 0) {
- basic = 0;
- }
- for (j = 0; j < basic; ++j) {
- if (input.charCodeAt(j) >= 128) {
- error("not-basic");
- }
- output.push(input.charCodeAt(j));
- }
- for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
- for (oldi = i, w = 1, k = base; ; k += base) {
- if (index >= inputLength) {
- error("invalid-input");
- }
- digit = basicToDigit(input.charCodeAt(index++));
- if (digit >= base || digit > floor((maxInt - i) / w)) {
- error("overflow");
- }
- i += digit * w;
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
- if (digit < t) {
- break;
- }
- baseMinusT = base - t;
- if (w > floor(maxInt / baseMinusT)) {
- error("overflow");
- }
- w *= baseMinusT;
- }
- out = output.length + 1;
- bias = adapt(i - oldi, out, oldi == 0);
- if (floor(i / out) > maxInt - n) {
- error("overflow");
- }
- n += floor(i / out);
- i %= out;
- output.splice(i++, 0, n);
- }
- return ucs2encode(output);
- }
- function encode(input) {
- var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
- input = ucs2decode(input);
- inputLength = input.length;
- n = initialN;
- delta = 0;
- bias = initialBias;
- for (j = 0; j < inputLength; ++j) {
- currentValue = input[j];
- if (currentValue < 128) {
- output.push(stringFromCharCode(currentValue));
- }
- }
- handledCPCount = basicLength = output.length;
- if (basicLength) {
- output.push(delimiter);
- }
- while (handledCPCount < inputLength) {
- for (m = maxInt, j = 0; j < inputLength; ++j) {
- currentValue = input[j];
- if (currentValue >= n && currentValue < m) {
- m = currentValue;
- }
- }
- handledCPCountPlusOne = handledCPCount + 1;
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
- error("overflow");
- }
- delta += (m - n) * handledCPCountPlusOne;
- n = m;
- for (j = 0; j < inputLength; ++j) {
- currentValue = input[j];
- if (currentValue < n && ++delta > maxInt) {
- error("overflow");
- }
- if (currentValue == n) {
- for (q = delta, k = base; ; k += base) {
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
- if (q < t) {
- break;
- }
- qMinusT = q - t;
- baseMinusT = base - t;
- output.push(
- stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
- );
- q = floor(qMinusT / baseMinusT);
- }
- output.push(stringFromCharCode(digitToBasic(q, 0)));
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
- delta = 0;
- ++handledCPCount;
- }
- }
- ++delta;
- ++n;
- }
- return output.join("");
- }
- function toUnicode(input) {
- return mapDomain(input, function(string) {
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
- });
- }
- function toASCII(input) {
- return mapDomain(input, function(string) {
- return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
- });
- }
- punycode = {
- /**
- * A string representing the current Punycode.js version number.
- * @memberOf punycode
- * @type String
- */
- "version": "1.4.1",
- /**
- * An object of methods to convert from JavaScript's internal character
- * representation (UCS-2) to Unicode code points, and back.
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
- * @memberOf punycode
- * @type Object
- */
- "ucs2": {
- "decode": ucs2decode,
- "encode": ucs2encode
- },
- "decode": decode,
- "encode": encode,
- "toASCII": toASCII,
- "toUnicode": toUnicode
- };
- if (typeof define2 == "function" && typeof define2.amd == "object" && define2.amd) {
- define2("punycode", function() {
- return punycode;
- });
- } else if (freeExports && freeModule) {
- if (module3.exports == freeExports) {
- freeModule.exports = punycode;
- } else {
- for (key in punycode) {
- punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
- }
- }
- } else {
- root.punycode = punycode;
- }
- })(this);
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 383: [function(require2, module3, exports3) {
- "use strict";
- function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- module3.exports = function(qs2, sep, eq, options) {
- sep = sep || "&";
- eq = eq || "=";
- var obj = {};
- if (typeof qs2 !== "string" || qs2.length === 0) {
- return obj;
- }
- var regexp = /\+/g;
- qs2 = qs2.split(sep);
- var maxKeys = 1e3;
- if (options && typeof options.maxKeys === "number") {
- maxKeys = options.maxKeys;
- }
- var len = qs2.length;
- if (maxKeys > 0 && len > maxKeys) {
- len = maxKeys;
- }
- for (var i = 0; i < len; ++i) {
- var x = qs2[i].replace(regexp, "%20"), idx = x.indexOf(eq), kstr, vstr, k, v;
- if (idx >= 0) {
- kstr = x.substr(0, idx);
- vstr = x.substr(idx + 1);
- } else {
- kstr = x;
- vstr = "";
- }
- k = decodeURIComponent(kstr);
- v = decodeURIComponent(vstr);
- if (!hasOwnProperty(obj, k)) {
- obj[k] = v;
- } else if (isArray(obj[k])) {
- obj[k].push(v);
- } else {
- obj[k] = [obj[k], v];
- }
- }
- return obj;
- };
- var isArray = Array.isArray || function(xs) {
- return Object.prototype.toString.call(xs) === "[object Array]";
- };
- }, {}], 384: [function(require2, module3, exports3) {
- "use strict";
- var stringifyPrimitive = function(v) {
- switch (typeof v) {
- case "string":
- return v;
- case "boolean":
- return v ? "true" : "false";
- case "number":
- return isFinite(v) ? v : "";
- default:
- return "";
- }
- };
- module3.exports = function(obj, sep, eq, name) {
- sep = sep || "&";
- eq = eq || "=";
- if (obj === null) {
- obj = void 0;
- }
- if (typeof obj === "object") {
- return map(objectKeys(obj), function(k) {
- var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
- if (isArray(obj[k])) {
- return map(obj[k], function(v) {
- return ks + encodeURIComponent(stringifyPrimitive(v));
- }).join(sep);
- } else {
- return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
- }
- }).join(sep);
- }
- if (!name)
- return "";
- return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
- };
- var isArray = Array.isArray || function(xs) {
- return Object.prototype.toString.call(xs) === "[object Array]";
- };
- function map(xs, f) {
- if (xs.map)
- return xs.map(f);
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- res.push(f(xs[i], i));
- }
- return res;
- }
- var objectKeys = Object.keys || function(obj) {
- var res = [];
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key))
- res.push(key);
- }
- return res;
- };
- }, {}], 385: [function(require2, module3, exports3) {
- "use strict";
- exports3.decode = exports3.parse = require2("./decode");
- exports3.encode = exports3.stringify = require2("./encode");
- }, { "./decode": 383, "./encode": 384 }], 386: [function(require2, module3, exports3) {
- "use strict";
- var pna = require2("process-nextick-args");
- var objectKeys = Object.keys || function(obj) {
- var keys2 = [];
- for (var key in obj) {
- keys2.push(key);
- }
- return keys2;
- };
- module3.exports = Duplex;
- var util = Object.create(require2("core-util-is"));
- util.inherits = require2("inherits");
- var Readable = require2("./_stream_readable");
- var Writable = require2("./_stream_writable");
- util.inherits(Duplex, Readable);
- {
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method])
- Duplex.prototype[method] = Writable.prototype[method];
- }
- }
- function Duplex(options) {
- if (!(this instanceof Duplex))
- return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
- if (options && options.readable === false)
- this.readable = false;
- if (options && options.writable === false)
- this.writable = false;
- this.allowHalfOpen = true;
- if (options && options.allowHalfOpen === false)
- this.allowHalfOpen = false;
- this.once("end", onend);
- }
- Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function() {
- return this._writableState.highWaterMark;
- }
- });
- function onend() {
- if (this.allowHalfOpen || this._writableState.ended)
- return;
- pna.nextTick(onEndNT, this);
- }
- function onEndNT(self2) {
- self2.end();
- }
- Object.defineProperty(Duplex.prototype, "destroyed", {
- get: function() {
- if (this._readableState === void 0 || this._writableState === void 0) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function(value) {
- if (this._readableState === void 0 || this._writableState === void 0) {
- return;
- }
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
- });
- Duplex.prototype._destroy = function(err, cb) {
- this.push(null);
- this.end();
- pna.nextTick(cb, err);
- };
- }, { "./_stream_readable": 388, "./_stream_writable": 390, "core-util-is": 341, "inherits": 364, "process-nextick-args": 380 }], 387: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = PassThrough;
- var Transform = require2("./_stream_transform");
- var util = Object.create(require2("core-util-is"));
- util.inherits = require2("inherits");
- util.inherits(PassThrough, Transform);
- function PassThrough(options) {
- if (!(this instanceof PassThrough))
- return new PassThrough(options);
- Transform.call(this, options);
- }
- PassThrough.prototype._transform = function(chunk, encoding, cb) {
- cb(null, chunk);
- };
- }, { "./_stream_transform": 389, "core-util-is": 341, "inherits": 364 }], 388: [function(require2, module3, exports3) {
- (function(process, global2) {
- (function() {
- "use strict";
- var pna = require2("process-nextick-args");
- module3.exports = Readable;
- var isArray = require2("isarray");
- var Duplex;
- Readable.ReadableState = ReadableState;
- var EE = require2("events").EventEmitter;
- var EElistenerCount = function(emitter, type) {
- return emitter.listeners(type).length;
- };
- var Stream = require2("./internal/streams/stream");
- var Buffer = require2("safe-buffer").Buffer;
- var OurUint8Array = global2.Uint8Array || function() {
- };
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var util = Object.create(require2("core-util-is"));
- util.inherits = require2("inherits");
- var debugUtil = require2("util");
- var debug = void 0;
- if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog("stream");
- } else {
- debug = function() {
- };
- }
- var BufferList = require2("./internal/streams/BufferList");
- var destroyImpl = require2("./internal/streams/destroy");
- var StringDecoder;
- util.inherits(Readable, Stream);
- var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
- function prependListener(emitter, event, fn) {
- if (typeof emitter.prependListener === "function")
- return emitter.prependListener(event, fn);
- 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]];
- }
- function ReadableState(options, stream) {
- Duplex = Duplex || require2("./_stream_duplex");
- options = options || {};
- var isDuplex = stream instanceof Duplex;
- this.objectMode = !!options.objectMode;
- if (isDuplex)
- this.objectMode = this.objectMode || !!options.readableObjectMode;
- var hwm = options.highWaterMark;
- var readableHwm = options.readableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
- if (hwm || hwm === 0)
- this.highWaterMark = hwm;
- else if (isDuplex && (readableHwm || readableHwm === 0))
- this.highWaterMark = readableHwm;
- else
- this.highWaterMark = defaultHwm;
- this.highWaterMark = Math.floor(this.highWaterMark);
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
- this.sync = true;
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
- this.destroyed = false;
- this.defaultEncoding = options.defaultEncoding || "utf8";
- this.awaitDrain = 0;
- this.readingMore = false;
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder)
- StringDecoder = require2("string_decoder/").StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
- }
- function Readable(options) {
- Duplex = Duplex || require2("./_stream_duplex");
- if (!(this instanceof Readable))
- return new Readable(options);
- this._readableState = new ReadableState(options, this);
- this.readable = true;
- if (options) {
- if (typeof options.read === "function")
- this._read = options.read;
- if (typeof options.destroy === "function")
- this._destroy = options.destroy;
- }
- Stream.call(this);
- }
- Object.defineProperty(Readable.prototype, "destroyed", {
- get: function() {
- if (this._readableState === void 0) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function(value) {
- if (!this._readableState) {
- return;
- }
- this._readableState.destroyed = value;
- }
- });
- Readable.prototype.destroy = destroyImpl.destroy;
- Readable.prototype._undestroy = destroyImpl.undestroy;
- Readable.prototype._destroy = function(err, cb) {
- this.push(null);
- cb(err);
- };
- Readable.prototype.push = function(chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
- if (!state.objectMode) {
- if (typeof chunk === "string") {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = "";
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
- };
- Readable.prototype.unshift = function(chunk) {
- return readableAddChunk(this, chunk, null, true, false);
- };
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck)
- er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit("error", er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (addToFront) {
- if (state.endEmitted)
- stream.emit("error", new Error("stream.unshift() after end event"));
- else
- addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- stream.emit("error", new Error("stream.push() after EOF"));
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0)
- addChunk(stream, state, chunk, false);
- else
- maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- }
- }
- return needMoreData(state);
- }
- function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- stream.emit("data", chunk);
- stream.read(0);
- } else {
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront)
- state.buffer.unshift(chunk);
- else
- state.buffer.push(chunk);
- if (state.needReadable)
- emitReadable(stream);
- }
- maybeReadMore(stream, state);
- }
- function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
- er = new TypeError("Invalid non-string/buffer chunk");
- }
- return er;
- }
- function needMoreData(state) {
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
- }
- Readable.prototype.isPaused = function() {
- return this._readableState.flowing === false;
- };
- Readable.prototype.setEncoding = function(enc) {
- if (!StringDecoder)
- StringDecoder = require2("string_decoder/").StringDecoder;
- this._readableState.decoder = new StringDecoder(enc);
- this._readableState.encoding = enc;
- return this;
- };
- var MAX_HWM = 8388608;
- function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- n = MAX_HWM;
- } else {
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
- }
- function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended)
- return 0;
- if (state.objectMode)
- return 1;
- if (n !== n) {
- if (state.flowing && state.length)
- return state.buffer.head.data.length;
- else
- return state.length;
- }
- if (n > state.highWaterMark)
- state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length)
- return n;
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
- }
- Readable.prototype.read = function(n) {
- debug("read", n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
- if (n !== 0)
- state.emittedReadable = false;
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
- debug("read: emitReadable", state.length, state.ended);
- if (state.length === 0 && state.ended)
- endReadable(this);
- else
- emitReadable(this);
- return null;
- }
- n = howMuchToRead(n, state);
- if (n === 0 && state.ended) {
- if (state.length === 0)
- endReadable(this);
- return null;
- }
- var doRead = state.needReadable;
- debug("need readable", doRead);
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug("length less than watermark", doRead);
- }
- if (state.ended || state.reading) {
- doRead = false;
- debug("reading or ended", doRead);
- } else if (doRead) {
- debug("do read");
- state.reading = true;
- state.sync = true;
- if (state.length === 0)
- state.needReadable = true;
- this._read(state.highWaterMark);
- state.sync = false;
- if (!state.reading)
- n = howMuchToRead(nOrig, state);
- }
- var ret;
- if (n > 0)
- ret = fromList(n, state);
- else
- ret = null;
- if (ret === null) {
- state.needReadable = true;
- n = 0;
- } else {
- state.length -= n;
- }
- if (state.length === 0) {
- if (!state.ended)
- state.needReadable = true;
- if (nOrig !== n && state.ended)
- endReadable(this);
- }
- if (ret !== null)
- this.emit("data", ret);
- return ret;
- };
- function onEofChunk(stream, state) {
- if (state.ended)
- return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
- emitReadable(stream);
- }
- function emitReadable(stream) {
- var state = stream._readableState;
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug("emitReadable", state.flowing);
- state.emittedReadable = true;
- if (state.sync)
- pna.nextTick(emitReadable_, stream);
- else
- emitReadable_(stream);
- }
- }
- function emitReadable_(stream) {
- debug("emit readable");
- stream.emit("readable");
- flow(stream);
- }
- function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- pna.nextTick(maybeReadMore_, stream, state);
- }
- }
- function maybeReadMore_(stream, state) {
- var len = state.length;
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
- debug("maybeReadMore read 0");
- stream.read(0);
- if (len === state.length)
- break;
- else
- len = state.length;
- }
- state.readingMore = false;
- }
- Readable.prototype._read = function(n) {
- this.emit("error", new Error("_read() is not implemented"));
- };
- Readable.prototype.pipe = function(dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted)
- pna.nextTick(endFn);
- else
- src.once("end", endFn);
- dest.on("unpipe", onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug("onunpipe");
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
- function onend() {
- debug("onend");
- dest.end();
- }
- var ondrain = pipeOnDrain(src);
- dest.on("drain", ondrain);
- var cleanedUp = false;
- function cleanup() {
- debug("cleanup");
- dest.removeListener("close", onclose);
- dest.removeListener("finish", onfinish);
- dest.removeListener("drain", ondrain);
- dest.removeListener("error", onerror);
- dest.removeListener("unpipe", onunpipe);
- src.removeListener("end", onend);
- src.removeListener("end", unpipe);
- src.removeListener("data", ondata);
- cleanedUp = true;
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
- ondrain();
- }
- var increasedAwaitDrain = false;
- src.on("data", ondata);
- function ondata(chunk) {
- debug("ondata");
- increasedAwaitDrain = false;
- var ret = dest.write(chunk);
- if (false === ret && !increasedAwaitDrain) {
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug("false write response, pause", src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
- increasedAwaitDrain = true;
- }
- src.pause();
- }
- }
- function onerror(er) {
- debug("onerror", er);
- unpipe();
- dest.removeListener("error", onerror);
- if (EElistenerCount(dest, "error") === 0)
- dest.emit("error", er);
- }
- prependListener(dest, "error", onerror);
- function onclose() {
- dest.removeListener("finish", onfinish);
- unpipe();
- }
- dest.once("close", onclose);
- function onfinish() {
- debug("onfinish");
- dest.removeListener("close", onclose);
- unpipe();
- }
- dest.once("finish", onfinish);
- function unpipe() {
- debug("unpipe");
- src.unpipe(dest);
- }
- dest.emit("pipe", src);
- if (!state.flowing) {
- debug("pipe resume");
- src.resume();
- }
- return dest;
- };
- function pipeOnDrain(src) {
- return function() {
- var state = src._readableState;
- debug("pipeOnDrain", state.awaitDrain);
- if (state.awaitDrain)
- state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
- state.flowing = true;
- flow(src);
- }
- };
- }
- Readable.prototype.unpipe = function(dest) {
- var state = this._readableState;
- var unpipeInfo = { hasUnpiped: false };
- if (state.pipesCount === 0)
- return this;
- if (state.pipesCount === 1) {
- if (dest && dest !== state.pipes)
- return this;
- if (!dest)
- dest = state.pipes;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest)
- dest.emit("unpipe", this, unpipeInfo);
- return this;
- }
- if (!dest) {
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- for (var i = 0; i < len; i++) {
- dests[i].emit("unpipe", this, unpipeInfo);
- }
- return this;
- }
- var index = indexOf(state.pipes, dest);
- if (index === -1)
- return this;
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1)
- state.pipes = state.pipes[0];
- dest.emit("unpipe", this, unpipeInfo);
- return this;
- };
- Readable.prototype.on = function(ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
- if (ev === "data") {
- if (this._readableState.flowing !== false)
- this.resume();
- } else if (ev === "readable") {
- var state = this._readableState;
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.emittedReadable = false;
- if (!state.reading) {
- pna.nextTick(nReadingNextTick, this);
- } else if (state.length) {
- emitReadable(this);
- }
- }
- }
- return res;
- };
- Readable.prototype.addListener = Readable.prototype.on;
- function nReadingNextTick(self2) {
- debug("readable nexttick read 0");
- self2.read(0);
- }
- Readable.prototype.resume = function() {
- var state = this._readableState;
- if (!state.flowing) {
- debug("resume");
- state.flowing = true;
- resume(this, state);
- }
- return this;
- };
- function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- pna.nextTick(resume_, stream, state);
- }
- }
- function resume_(stream, state) {
- if (!state.reading) {
- debug("resume read 0");
- stream.read(0);
- }
- state.resumeScheduled = false;
- state.awaitDrain = 0;
- stream.emit("resume");
- flow(stream);
- if (state.flowing && !state.reading)
- stream.read(0);
- }
- Readable.prototype.pause = function() {
- debug("call pause flowing=%j", this._readableState.flowing);
- if (false !== this._readableState.flowing) {
- debug("pause");
- this._readableState.flowing = false;
- this.emit("pause");
- }
- return this;
- };
- function flow(stream) {
- var state = stream._readableState;
- debug("flow", state.flowing);
- while (state.flowing && stream.read() !== null) {
- }
- }
- Readable.prototype.wrap = function(stream) {
- var _this = this;
- var state = this._readableState;
- var paused = false;
- stream.on("end", function() {
- debug("wrapped end");
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length)
- _this.push(chunk);
- }
- _this.push(null);
- });
- stream.on("data", function(chunk) {
- debug("wrapped data");
- if (state.decoder)
- chunk = state.decoder.write(chunk);
- if (state.objectMode && (chunk === null || chunk === void 0))
- return;
- else if (!state.objectMode && (!chunk || !chunk.length))
- return;
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
- for (var i in stream) {
- if (this[i] === void 0 && typeof stream[i] === "function") {
- this[i] = function(method) {
- return function() {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- }
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- }
- this._read = function(n2) {
- debug("wrapped _read", n2);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
- return this;
- };
- Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function() {
- return this._readableState.highWaterMark;
- }
- });
- Readable._fromList = fromList;
- function fromList(n, state) {
- if (state.length === 0)
- return null;
- var ret;
- if (state.objectMode)
- ret = state.buffer.shift();
- else if (!n || n >= state.length) {
- 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);
- state.buffer.clear();
- } else {
- ret = fromListPartial(n, state.buffer, state.decoder);
- }
- return ret;
- }
- function fromListPartial(n, list, hasStrings) {
- var ret;
- if (n < list.head.data.length) {
- ret = list.head.data.slice(0, n);
- list.head.data = list.head.data.slice(n);
- } else if (n === list.head.data.length) {
- ret = list.shift();
- } else {
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
- }
- return ret;
- }
- function copyFromBufferString(n, list) {
- var p = list.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length)
- ret += str;
- else
- ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next)
- list.head = p.next;
- else
- list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
- }
- function copyFromBuffer(n, list) {
- var ret = Buffer.allocUnsafe(n);
- var p = list.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next)
- list.head = p.next;
- else
- list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
- }
- function endReadable(stream) {
- var state = stream._readableState;
- if (state.length > 0)
- throw new Error('"endReadable()" called on non-empty stream');
- if (!state.endEmitted) {
- state.ended = true;
- pna.nextTick(endReadableNT, state, stream);
- }
- }
- function endReadableNT(state, stream) {
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit("end");
- }
- }
- function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x)
- return i;
- }
- return -1;
- }
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "./_stream_duplex": 386, "./internal/streams/BufferList": 391, "./internal/streams/destroy": 392, "./internal/streams/stream": 393, "_process": 467, "core-util-is": 341, "events": 344, "inherits": 364, "isarray": 370, "process-nextick-args": 380, "safe-buffer": 396, "string_decoder/": 413, "util": 89 }], 389: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = Transform;
- var Duplex = require2("./_stream_duplex");
- var util = Object.create(require2("core-util-is"));
- util.inherits = require2("inherits");
- util.inherits(Transform, Duplex);
- function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
- var cb = ts.writecb;
- if (!cb) {
- return this.emit("error", new Error("write callback called multiple times"));
- }
- ts.writechunk = null;
- ts.writecb = null;
- if (data != null)
- this.push(data);
- cb(er);
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
- }
- function Transform(options) {
- if (!(this instanceof Transform))
- return new Transform(options);
- Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- };
- this._readableState.needReadable = true;
- this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === "function")
- this._transform = options.transform;
- if (typeof options.flush === "function")
- this._flush = options.flush;
- }
- this.on("prefinish", prefinish);
- }
- function prefinish() {
- var _this = this;
- if (typeof this._flush === "function") {
- this._flush(function(er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
- }
- Transform.prototype.push = function(chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
- };
- Transform.prototype._transform = function(chunk, encoding, cb) {
- throw new Error("_transform() is not implemented");
- };
- Transform.prototype._write = function(chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
- this._read(rs.highWaterMark);
- }
- };
- Transform.prototype._read = function(n) {
- var ts = this._transformState;
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- ts.needTransform = true;
- }
- };
- Transform.prototype._destroy = function(err, cb) {
- var _this2 = this;
- Duplex.prototype._destroy.call(this, err, function(err2) {
- cb(err2);
- _this2.emit("close");
- });
- };
- function done(stream, er, data) {
- if (er)
- return stream.emit("error", er);
- if (data != null)
- stream.push(data);
- if (stream._writableState.length)
- throw new Error("Calling transform done when ws.length != 0");
- if (stream._transformState.transforming)
- throw new Error("Calling transform done when still transforming");
- return stream.push(null);
- }
- }, { "./_stream_duplex": 386, "core-util-is": 341, "inherits": 364 }], 390: [function(require2, module3, exports3) {
- (function(process, global2, setImmediate) {
- (function() {
- "use strict";
- var pna = require2("process-nextick-args");
- module3.exports = Writable;
- function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
- }
- function CorkedRequest(state) {
- var _this = this;
- this.next = null;
- this.entry = null;
- this.finish = function() {
- onCorkedFinish(_this, state);
- };
- }
- var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
- var Duplex;
- Writable.WritableState = WritableState;
- var util = Object.create(require2("core-util-is"));
- util.inherits = require2("inherits");
- var internalUtil = {
- deprecate: require2("util-deprecate")
- };
- var Stream = require2("./internal/streams/stream");
- var Buffer = require2("safe-buffer").Buffer;
- var OurUint8Array = global2.Uint8Array || function() {
- };
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var destroyImpl = require2("./internal/streams/destroy");
- util.inherits(Writable, Stream);
- function nop() {
- }
- function WritableState(options, stream) {
- Duplex = Duplex || require2("./_stream_duplex");
- options = options || {};
- var isDuplex = stream instanceof Duplex;
- this.objectMode = !!options.objectMode;
- if (isDuplex)
- this.objectMode = this.objectMode || !!options.writableObjectMode;
- var hwm = options.highWaterMark;
- var writableHwm = options.writableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
- if (hwm || hwm === 0)
- this.highWaterMark = hwm;
- else if (isDuplex && (writableHwm || writableHwm === 0))
- this.highWaterMark = writableHwm;
- else
- this.highWaterMark = defaultHwm;
- this.highWaterMark = Math.floor(this.highWaterMark);
- this.finalCalled = false;
- this.needDrain = false;
- this.ending = false;
- this.ended = false;
- this.finished = false;
- this.destroyed = false;
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
- this.defaultEncoding = options.defaultEncoding || "utf8";
- this.length = 0;
- this.writing = false;
- this.corked = 0;
- this.sync = true;
- this.bufferProcessing = false;
- this.onwrite = function(er) {
- onwrite(stream, er);
- };
- this.writecb = null;
- this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
- this.pendingcb = 0;
- this.prefinished = false;
- this.errorEmitted = false;
- this.bufferedRequestCount = 0;
- this.corkedRequestsFree = new CorkedRequest(this);
- }
- WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
- };
- (function() {
- try {
- Object.defineProperty(WritableState.prototype, "buffer", {
- get: internalUtil.deprecate(function() {
- return this.getBuffer();
- }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
- });
- } catch (_) {
- }
- })();
- var realHasInstance;
- if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function(object) {
- if (realHasInstance.call(this, object))
- return true;
- if (this !== Writable)
- return false;
- return object && object._writableState instanceof WritableState;
- }
- });
- } else {
- realHasInstance = function(object) {
- return object instanceof this;
- };
- }
- function Writable(options) {
- Duplex = Duplex || require2("./_stream_duplex");
- if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
- return new Writable(options);
- }
- this._writableState = new WritableState(options, this);
- this.writable = true;
- if (options) {
- if (typeof options.write === "function")
- this._write = options.write;
- if (typeof options.writev === "function")
- this._writev = options.writev;
- if (typeof options.destroy === "function")
- this._destroy = options.destroy;
- if (typeof options.final === "function")
- this._final = options.final;
- }
- Stream.call(this);
- }
- Writable.prototype.pipe = function() {
- this.emit("error", new Error("Cannot pipe, not readable"));
- };
- function writeAfterEnd(stream, cb) {
- var er = new Error("write after end");
- stream.emit("error", er);
- pna.nextTick(cb, er);
- }
- function validChunk(stream, state, chunk, cb) {
- var valid = true;
- var er = false;
- if (chunk === null) {
- er = new TypeError("May not write null values to stream");
- } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
- er = new TypeError("Invalid non-string/buffer chunk");
- }
- if (er) {
- stream.emit("error", er);
- pna.nextTick(cb, er);
- valid = false;
- }
- return valid;
- }
- Writable.prototype.write = function(chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === "function") {
- cb = encoding;
- encoding = null;
- }
- if (isBuf)
- encoding = "buffer";
- else if (!encoding)
- encoding = state.defaultEncoding;
- if (typeof cb !== "function")
- cb = nop;
- if (state.ended)
- writeAfterEnd(this, cb);
- else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
- }
- return ret;
- };
- Writable.prototype.cork = function() {
- var state = this._writableState;
- state.corked++;
- };
- Writable.prototype.uncork = function() {
- var state = this._writableState;
- if (state.corked) {
- state.corked--;
- if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest)
- clearBuffer(this, state);
- }
- };
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- if (typeof encoding === "string")
- encoding = encoding.toLowerCase();
- 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);
- this._writableState.defaultEncoding = encoding;
- return this;
- };
- function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
- }
- Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function() {
- return this._writableState.highWaterMark;
- }
- });
- function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = "buffer";
- chunk = newChunk;
- }
- }
- var len = state.objectMode ? 1 : chunk.length;
- state.length += len;
- var ret = state.length < state.highWaterMark;
- if (!ret)
- state.needDrain = true;
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk,
- encoding,
- isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
- return ret;
- }
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (writev)
- stream._writev(chunk, state.onwrite);
- else
- stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
- }
- function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) {
- pna.nextTick(cb, er);
- pna.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- stream.emit("error", er);
- } else {
- cb(er);
- stream._writableState.errorEmitted = true;
- stream.emit("error", er);
- finishMaybe(stream, state);
- }
- }
- function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
- }
- function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
- onwriteStateUpdate(state);
- if (er)
- onwriteError(stream, state, sync, er, cb);
- else {
- var finished = needFinish(state);
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
- if (sync) {
- asyncWrite(afterWrite, stream, state, finished, cb);
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
- }
- function afterWrite(stream, state, finished, cb) {
- if (!finished)
- onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
- }
- function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit("drain");
- }
- }
- function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf)
- allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
- doWrite(stream, state, true, state.length, buffer, "", holder.finish);
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--;
- if (state.writing) {
- break;
- }
- }
- if (entry === null)
- state.lastBufferedRequest = null;
- }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
- }
- Writable.prototype._write = function(chunk, encoding, cb) {
- cb(new Error("_write() is not implemented"));
- };
- Writable.prototype._writev = null;
- Writable.prototype.end = function(chunk, encoding, cb) {
- var state = this._writableState;
- if (typeof chunk === "function") {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === "function") {
- cb = encoding;
- encoding = null;
- }
- if (chunk !== null && chunk !== void 0)
- this.write(chunk, encoding);
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
- if (!state.ending && !state.finished)
- endWritable(this, state, cb);
- };
- function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
- }
- function callFinal(stream, state) {
- stream._final(function(err) {
- state.pendingcb--;
- if (err) {
- stream.emit("error", err);
- }
- state.prefinished = true;
- stream.emit("prefinish");
- finishMaybe(stream, state);
- });
- }
- function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === "function") {
- state.pendingcb++;
- state.finalCalled = true;
- pna.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit("prefinish");
- }
- }
- }
- function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit("finish");
- }
- }
- return need;
- }
- function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished)
- pna.nextTick(cb);
- else
- stream.once("finish", cb);
- }
- state.ended = true;
- stream.writable = false;
- }
- function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
- if (state.corkedRequestsFree) {
- state.corkedRequestsFree.next = corkReq;
- } else {
- state.corkedRequestsFree = corkReq;
- }
- }
- Object.defineProperty(Writable.prototype, "destroyed", {
- get: function() {
- if (this._writableState === void 0) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function(value) {
- if (!this._writableState) {
- return;
- }
- this._writableState.destroyed = value;
- }
- });
- Writable.prototype.destroy = destroyImpl.destroy;
- Writable.prototype._undestroy = destroyImpl.undestroy;
- Writable.prototype._destroy = function(err, cb) {
- this.end();
- cb(err);
- };
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("timers").setImmediate);
- }, { "./_stream_duplex": 386, "./internal/streams/destroy": 392, "./internal/streams/stream": 393, "_process": 467, "core-util-is": 341, "inherits": 364, "process-nextick-args": 380, "safe-buffer": 396, "timers": 414, "util-deprecate": 416 }], 391: [function(require2, module3, exports3) {
- "use strict";
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var Buffer = require2("safe-buffer").Buffer;
- var util = require2("util");
- function copyBuffer(src, target, offset) {
- src.copy(target, offset);
- }
- module3.exports = function() {
- function BufferList() {
- _classCallCheck(this, BufferList);
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
- BufferList.prototype.push = function push(v) {
- var entry = { data: v, next: null };
- if (this.length > 0)
- this.tail.next = entry;
- else
- this.head = entry;
- this.tail = entry;
- ++this.length;
- };
- BufferList.prototype.unshift = function unshift(v) {
- var entry = { data: v, next: this.head };
- if (this.length === 0)
- this.tail = entry;
- this.head = entry;
- ++this.length;
- };
- BufferList.prototype.shift = function shift() {
- if (this.length === 0)
- return;
- var ret = this.head.data;
- if (this.length === 1)
- this.head = this.tail = null;
- else
- this.head = this.head.next;
- --this.length;
- return ret;
- };
- BufferList.prototype.clear = function clear() {
- this.head = this.tail = null;
- this.length = 0;
- };
- BufferList.prototype.join = function join(s) {
- if (this.length === 0)
- return "";
- var p = this.head;
- var ret = "" + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }
- return ret;
- };
- BufferList.prototype.concat = function concat(n) {
- if (this.length === 0)
- return Buffer.alloc(0);
- if (this.length === 1)
- return this.head.data;
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- };
- return BufferList;
- }();
- if (util && util.inspect && util.inspect.custom) {
- module3.exports.prototype[util.inspect.custom] = function() {
- var obj = util.inspect({ length: this.length });
- return this.constructor.name + " " + obj;
- };
- }
- }, { "safe-buffer": 396, "util": 89 }], 392: [function(require2, module3, exports3) {
- "use strict";
- var pna = require2("process-nextick-args");
- function destroy(err, cb) {
- var _this = this;
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
- pna.nextTick(emitErrorNT, this, err);
- }
- return this;
- }
- if (this._readableState) {
- this._readableState.destroyed = true;
- }
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
- this._destroy(err || null, function(err2) {
- if (!cb && err2) {
- pna.nextTick(emitErrorNT, _this, err2);
- if (_this._writableState) {
- _this._writableState.errorEmitted = true;
- }
- } else if (cb) {
- cb(err2);
- }
- });
- return this;
- }
- function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
- }
- function emitErrorNT(self2, err) {
- self2.emit("error", err);
- }
- module3.exports = {
- destroy,
- undestroy
- };
- }, { "process-nextick-args": 380 }], 393: [function(require2, module3, exports3) {
- module3.exports = require2("events").EventEmitter;
- }, { "events": 344 }], 394: [function(require2, module3, exports3) {
- exports3 = module3.exports = require2("./lib/_stream_readable.js");
- exports3.Stream = exports3;
- exports3.Readable = exports3;
- exports3.Writable = require2("./lib/_stream_writable.js");
- exports3.Duplex = require2("./lib/_stream_duplex.js");
- exports3.Transform = require2("./lib/_stream_transform.js");
- exports3.PassThrough = require2("./lib/_stream_passthrough.js");
- }, { "./lib/_stream_duplex.js": 386, "./lib/_stream_passthrough.js": 387, "./lib/_stream_readable.js": 388, "./lib/_stream_transform.js": 389, "./lib/_stream_writable.js": 390 }], 395: [function(require2, module3, exports3) {
- var runtime = function(exports4) {
- "use strict";
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined2;
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
- function define3(obj, key, value) {
- Object.defineProperty(obj, key, {
- value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- return obj[key];
- }
- try {
- define3({}, "");
- } catch (err) {
- define3 = function(obj, key, value) {
- return obj[key] = value;
- };
- }
- function wrap(innerFn, outerFn, self2, tryLocsList) {
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
- generator._invoke = makeInvokeMethod(innerFn, self2, context);
- return generator;
- }
- exports4.wrap = wrap;
- function tryCatch(fn, obj, arg) {
- try {
- return { type: "normal", arg: fn.call(obj, arg) };
- } catch (err) {
- return { type: "throw", arg: err };
- }
- }
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
- var ContinueSentinel = {};
- function Generator() {
- }
- function GeneratorFunction() {
- }
- function GeneratorFunctionPrototype() {
- }
- var IteratorPrototype = {};
- define3(IteratorPrototype, iteratorSymbol, function() {
- return this;
- });
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- IteratorPrototype = NativeIteratorPrototype;
- }
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
- define3(Gp, "constructor", GeneratorFunctionPrototype);
- define3(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
- GeneratorFunction.displayName = define3(
- GeneratorFunctionPrototype,
- toStringTagSymbol,
- "GeneratorFunction"
- );
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function(method) {
- define3(prototype, method, function(arg) {
- return this._invoke(method, arg);
- });
- });
- }
- exports4.isGeneratorFunction = function(genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
- // do is to check its .name property.
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
- };
- exports4.mark = function(genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- define3(genFun, toStringTagSymbol, "GeneratorFunction");
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
- exports4.awrap = function(arg) {
- return { __await: arg };
- };
- function AsyncIterator(generator, PromiseImpl) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
- return PromiseImpl.resolve(value.__await).then(function(value2) {
- invoke("next", value2, resolve, reject);
- }, function(err) {
- invoke("throw", err, resolve, reject);
- });
- }
- return PromiseImpl.resolve(value).then(function(unwrapped) {
- result.value = unwrapped;
- resolve(result);
- }, function(error) {
- return invoke("throw", error, resolve, reject);
- });
- }
- }
- var previousPromise;
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new PromiseImpl(function(resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
- return previousPromise = // If enqueue has been called before, then we want to wait until
- // all previous Promises have been resolved before calling invoke,
- // so that results are always delivered in the correct order. If
- // enqueue has not been called before, then it is important to
- // call invoke immediately, without waiting on a callback to fire,
- // so that the async generator function has the opportunity to do
- // any necessary setup in a predictable way. This predictability
- // is why the Promise constructor synchronously invokes its
- // executor callback, and why async functions synchronously
- // execute code before the first await. Since we implement simple
- // async functions in terms of async generators, it is especially
- // important to get this right, even though it requires care.
- previousPromise ? previousPromise.then(
- callInvokeWithMethodAndArg,
- // Avoid propagating failures to Promises returned by later
- // invocations of the iterator.
- callInvokeWithMethodAndArg
- ) : callInvokeWithMethodAndArg();
- }
- this._invoke = enqueue;
- }
- defineIteratorMethods(AsyncIterator.prototype);
- define3(AsyncIterator.prototype, asyncIteratorSymbol, function() {
- return this;
- });
- exports4.AsyncIterator = AsyncIterator;
- exports4.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
- if (PromiseImpl === void 0)
- PromiseImpl = Promise;
- var iter = new AsyncIterator(
- wrap(innerFn, outerFn, self2, tryLocsList),
- PromiseImpl
- );
- return exports4.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
- return result.done ? result.value : iter.next();
- });
- };
- function makeInvokeMethod(innerFn, self2, context) {
- var state = GenStateSuspendedStart;
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
- return doneResult();
- }
- context.method = method;
- context.arg = arg;
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel)
- continue;
- return delegateResult;
- }
- }
- if (context.method === "next") {
- context.sent = context._sent = context.arg;
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
- context.dispatchException(context.arg);
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
- state = GenStateExecuting;
- var record = tryCatch(innerFn, self2, context);
- if (record.type === "normal") {
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
- if (record.arg === ContinueSentinel) {
- continue;
- }
- return {
- value: record.arg,
- done: context.done
- };
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined2) {
- context.delegate = null;
- if (context.method === "throw") {
- if (delegate.iterator["return"]) {
- context.method = "return";
- context.arg = undefined2;
- maybeInvokeDelegate(delegate, context);
- if (context.method === "throw") {
- return ContinueSentinel;
- }
- }
- context.method = "throw";
- context.arg = new TypeError(
- "The iterator does not provide a 'throw' method"
- );
- }
- return ContinueSentinel;
- }
- var record = tryCatch(method, delegate.iterator, context.arg);
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
- var info = record.arg;
- if (!info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
- if (info.done) {
- context[delegate.resultName] = info.value;
- context.next = delegate.nextLoc;
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined2;
- }
- } else {
- return info;
- }
- context.delegate = null;
- return ContinueSentinel;
- }
- defineIteratorMethods(Gp);
- define3(Gp, toStringTagSymbol, "Generator");
- define3(Gp, iteratorSymbol, function() {
- return this;
- });
- define3(Gp, "toString", function() {
- return "[object Generator]";
- });
- function pushTryEntry(locs) {
- var entry = { tryLoc: locs[0] };
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
- this.tryEntries.push(entry);
- }
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
- function Context(tryLocsList) {
- this.tryEntries = [{ tryLoc: "root" }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
- exports4.keys = function(object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
- return function next() {
- while (keys.length) {
- var key2 = keys.pop();
- if (key2 in object) {
- next.value = key2;
- next.done = false;
- return next;
- }
- }
- next.done = true;
- return next;
- };
- };
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
- if (typeof iterable.next === "function") {
- return iterable;
- }
- if (!isNaN(iterable.length)) {
- var i = -1, next = function next2() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next2.value = iterable[i];
- next2.done = false;
- return next2;
- }
- }
- next2.value = undefined2;
- next2.done = true;
- return next2;
- };
- return next.next = next;
- }
- }
- return { next: doneResult };
- }
- exports4.values = values;
- function doneResult() {
- return { value: undefined2, done: true };
- }
- Context.prototype = {
- constructor: Context,
- reset: function(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- this.sent = this._sent = undefined2;
- this.done = false;
- this.delegate = null;
- this.method = "next";
- this.arg = undefined2;
- this.tryEntries.forEach(resetTryEntry);
- if (!skipTempReset) {
- for (var name in this) {
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
- this[name] = undefined2;
- }
- }
- }
- },
- stop: function() {
- this.done = true;
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
- return this.rval;
- },
- dispatchException: function(exception) {
- if (this.done) {
- throw exception;
- }
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
- if (caught) {
- context.method = "next";
- context.arg = undefined2;
- }
- return !!caught;
- }
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
- if (entry.tryLoc === "root") {
- return handle("end");
- }
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
- abrupt: function(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
- finallyEntry = null;
- }
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
- return this.complete(record);
- },
- complete: function(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
- if (record.type === "break" || record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
- return ContinueSentinel;
- },
- finish: function(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
- "catch": function(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
- throw new Error("illegal catch attempt");
- },
- delegateYield: function(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName,
- nextLoc
- };
- if (this.method === "next") {
- this.arg = undefined2;
- }
- return ContinueSentinel;
- }
- };
- return exports4;
- }(
- // If this script is executing as a CommonJS module, use module.exports
- // as the regeneratorRuntime namespace. Otherwise create a new empty
- // object. Either way, the resulting object will be used to initialize
- // the regeneratorRuntime variable at the top of this file.
- typeof module3 === "object" ? module3.exports : {}
- );
- try {
- regeneratorRuntime = runtime;
- } catch (accidentalStrictMode) {
- if (typeof globalThis === "object") {
- globalThis.regeneratorRuntime = runtime;
- } else {
- Function("r", "regeneratorRuntime = r")(runtime);
- }
- }
- }, {}], 396: [function(require2, module3, exports3) {
- var buffer = require2("buffer");
- var Buffer = buffer.Buffer;
- function copyProps(src, dst) {
- for (var key in src) {
- dst[key] = src[key];
- }
- }
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module3.exports = buffer;
- } else {
- copyProps(buffer, exports3);
- exports3.Buffer = SafeBuffer;
- }
- function SafeBuffer(arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length);
- }
- copyProps(Buffer, SafeBuffer);
- SafeBuffer.from = function(arg, encodingOrOffset, length) {
- if (typeof arg === "number") {
- throw new TypeError("Argument must not be a number");
- }
- return Buffer(arg, encodingOrOffset, length);
- };
- SafeBuffer.alloc = function(size, fill, encoding) {
- if (typeof size !== "number") {
- throw new TypeError("Argument must be a number");
- }
- var buf = Buffer(size);
- if (fill !== void 0) {
- if (typeof encoding === "string") {
- buf.fill(fill, encoding);
- } else {
- buf.fill(fill);
- }
- } else {
- buf.fill(0);
- }
- return buf;
- };
- SafeBuffer.allocUnsafe = function(size) {
- if (typeof size !== "number") {
- throw new TypeError("Argument must be a number");
- }
- return Buffer(size);
- };
- SafeBuffer.allocUnsafeSlow = function(size) {
- if (typeof size !== "number") {
- throw new TypeError("Argument must be a number");
- }
- return buffer.SlowBuffer(size);
- };
- }, { "buffer": 90 }], 397: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- ;
- (function(sax) {
- sax.parser = function(strict, opt) {
- return new SAXParser(strict, opt);
- };
- sax.SAXParser = SAXParser;
- sax.SAXStream = SAXStream;
- sax.createStream = createStream;
- sax.MAX_BUFFER_LENGTH = 64 * 1024;
- var buffers = [
- "comment",
- "sgmlDecl",
- "textNode",
- "tagName",
- "doctype",
- "procInstName",
- "procInstBody",
- "entity",
- "attribName",
- "attribValue",
- "cdata",
- "script"
- ];
- sax.EVENTS = [
- "text",
- "processinginstruction",
- "sgmldeclaration",
- "doctype",
- "comment",
- "opentagstart",
- "attribute",
- "opentag",
- "closetag",
- "opencdata",
- "cdata",
- "closecdata",
- "error",
- "end",
- "ready",
- "script",
- "opennamespace",
- "closenamespace"
- ];
- function SAXParser(strict, opt) {
- if (!(this instanceof SAXParser)) {
- return new SAXParser(strict, opt);
- }
- var parser = this;
- clearBuffers(parser);
- parser.q = parser.c = "";
- parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
- parser.opt = opt || {};
- parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
- parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
- parser.tags = [];
- parser.closed = parser.closedRoot = parser.sawRoot = false;
- parser.tag = parser.error = null;
- parser.strict = !!strict;
- parser.noscript = !!(strict || parser.opt.noscript);
- parser.state = S.BEGIN;
- parser.strictEntities = parser.opt.strictEntities;
- parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
- parser.attribList = [];
- if (parser.opt.xmlns) {
- parser.ns = Object.create(rootNS);
- }
- parser.trackPosition = parser.opt.position !== false;
- if (parser.trackPosition) {
- parser.position = parser.line = parser.column = 0;
- }
- emit(parser, "onready");
- }
- if (!Object.create) {
- Object.create = function(o) {
- function F() {
- }
- F.prototype = o;
- var newf = new F();
- return newf;
- };
- }
- if (!Object.keys) {
- Object.keys = function(o) {
- var a = [];
- for (var i in o)
- if (o.hasOwnProperty(i))
- a.push(i);
- return a;
- };
- }
- function checkBufferLength(parser) {
- var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
- var maxActual = 0;
- for (var i = 0, l = buffers.length; i < l; i++) {
- var len = parser[buffers[i]].length;
- if (len > maxAllowed) {
- switch (buffers[i]) {
- case "textNode":
- closeText(parser);
- break;
- case "cdata":
- emitNode(parser, "oncdata", parser.cdata);
- parser.cdata = "";
- break;
- case "script":
- emitNode(parser, "onscript", parser.script);
- parser.script = "";
- break;
- default:
- error(parser, "Max buffer length exceeded: " + buffers[i]);
- }
- }
- maxActual = Math.max(maxActual, len);
- }
- var m = sax.MAX_BUFFER_LENGTH - maxActual;
- parser.bufferCheckPosition = m + parser.position;
- }
- function clearBuffers(parser) {
- for (var i = 0, l = buffers.length; i < l; i++) {
- parser[buffers[i]] = "";
- }
- }
- function flushBuffers(parser) {
- closeText(parser);
- if (parser.cdata !== "") {
- emitNode(parser, "oncdata", parser.cdata);
- parser.cdata = "";
- }
- if (parser.script !== "") {
- emitNode(parser, "onscript", parser.script);
- parser.script = "";
- }
- }
- SAXParser.prototype = {
- end: function() {
- end(this);
- },
- write,
- resume: function() {
- this.error = null;
- return this;
- },
- close: function() {
- return this.write(null);
- },
- flush: function() {
- flushBuffers(this);
- }
- };
- var Stream;
- try {
- Stream = require2("stream").Stream;
- } catch (ex) {
- Stream = function() {
- };
- }
- var streamWraps = sax.EVENTS.filter(function(ev) {
- return ev !== "error" && ev !== "end";
- });
- function createStream(strict, opt) {
- return new SAXStream(strict, opt);
- }
- function SAXStream(strict, opt) {
- if (!(this instanceof SAXStream)) {
- return new SAXStream(strict, opt);
- }
- Stream.apply(this);
- this._parser = new SAXParser(strict, opt);
- this.writable = true;
- this.readable = true;
- var me = this;
- this._parser.onend = function() {
- me.emit("end");
- };
- this._parser.onerror = function(er) {
- me.emit("error", er);
- me._parser.error = null;
- };
- this._decoder = null;
- streamWraps.forEach(function(ev) {
- Object.defineProperty(me, "on" + ev, {
- get: function() {
- return me._parser["on" + ev];
- },
- set: function(h) {
- if (!h) {
- me.removeAllListeners(ev);
- me._parser["on" + ev] = h;
- return h;
- }
- me.on(ev, h);
- },
- enumerable: true,
- configurable: false
- });
- });
- }
- SAXStream.prototype = Object.create(Stream.prototype, {
- constructor: {
- value: SAXStream
- }
- });
- SAXStream.prototype.write = function(data) {
- if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
- if (!this._decoder) {
- var SD = require2("string_decoder").StringDecoder;
- this._decoder = new SD("utf8");
- }
- data = this._decoder.write(data);
- }
- this._parser.write(data.toString());
- this.emit("data", data);
- return true;
- };
- SAXStream.prototype.end = function(chunk) {
- if (chunk && chunk.length) {
- this.write(chunk);
- }
- this._parser.end();
- return true;
- };
- SAXStream.prototype.on = function(ev, handler) {
- var me = this;
- if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
- me._parser["on" + ev] = function() {
- var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
- args.splice(0, 0, ev);
- me.emit.apply(me, args);
- };
- }
- return Stream.prototype.on.call(me, ev, handler);
- };
- var CDATA = "[CDATA[";
- var DOCTYPE = "DOCTYPE";
- var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
- var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
- var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };
- var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
- var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
- var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
- var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
- function isWhitespace(c) {
- return c === " " || c === "\n" || c === "\r" || c === " ";
- }
- function isQuote(c) {
- return c === '"' || c === "'";
- }
- function isAttribEnd(c) {
- return c === ">" || isWhitespace(c);
- }
- function isMatch(regex, c) {
- return regex.test(c);
- }
- function notMatch(regex, c) {
- return !isMatch(regex, c);
- }
- var S = 0;
- sax.STATE = {
- BEGIN: S++,
- // leading byte order mark or whitespace
- BEGIN_WHITESPACE: S++,
- // leading whitespace
- TEXT: S++,
- // general stuff
- TEXT_ENTITY: S++,
- // & and such.
- OPEN_WAKA: S++,
- // <
- SGML_DECL: S++,
- // <!BLARG
- SGML_DECL_QUOTED: S++,
- // <!BLARG foo "bar
- DOCTYPE: S++,
- // <!DOCTYPE
- DOCTYPE_QUOTED: S++,
- // <!DOCTYPE "//blah
- DOCTYPE_DTD: S++,
- // <!DOCTYPE "//blah" [ ...
- DOCTYPE_DTD_QUOTED: S++,
- // <!DOCTYPE "//blah" [ "foo
- COMMENT_STARTING: S++,
- // <!-
- COMMENT: S++,
- // <!--
- COMMENT_ENDING: S++,
- // <!-- blah -
- COMMENT_ENDED: S++,
- // <!-- blah --
- CDATA: S++,
- // <![CDATA[ something
- CDATA_ENDING: S++,
- // ]
- CDATA_ENDING_2: S++,
- // ]]
- PROC_INST: S++,
- // <?hi
- PROC_INST_BODY: S++,
- // <?hi there
- PROC_INST_ENDING: S++,
- // <?hi "there" ?
- OPEN_TAG: S++,
- // <strong
- OPEN_TAG_SLASH: S++,
- // <strong /
- ATTRIB: S++,
- // <a
- ATTRIB_NAME: S++,
- // <a foo
- ATTRIB_NAME_SAW_WHITE: S++,
- // <a foo _
- ATTRIB_VALUE: S++,
- // <a foo=
- ATTRIB_VALUE_QUOTED: S++,
- // <a foo="bar
- ATTRIB_VALUE_CLOSED: S++,
- // <a foo="bar"
- ATTRIB_VALUE_UNQUOTED: S++,
- // <a foo=bar
- ATTRIB_VALUE_ENTITY_Q: S++,
- // <foo bar="""
- ATTRIB_VALUE_ENTITY_U: S++,
- // <foo bar="
- CLOSE_TAG: S++,
- // </a
- CLOSE_TAG_SAW_WHITE: S++,
- // </a >
- SCRIPT: S++,
- // <script> ...
- SCRIPT_ENDING: S++
- // <script> ... <
- };
- sax.XML_ENTITIES = {
- "amp": "&",
- "gt": ">",
- "lt": "<",
- "quot": '"',
- "apos": "'"
- };
- sax.ENTITIES = {
- "amp": "&",
- "gt": ">",
- "lt": "<",
- "quot": '"',
- "apos": "'",
- "AElig": 198,
- "Aacute": 193,
- "Acirc": 194,
- "Agrave": 192,
- "Aring": 197,
- "Atilde": 195,
- "Auml": 196,
- "Ccedil": 199,
- "ETH": 208,
- "Eacute": 201,
- "Ecirc": 202,
- "Egrave": 200,
- "Euml": 203,
- "Iacute": 205,
- "Icirc": 206,
- "Igrave": 204,
- "Iuml": 207,
- "Ntilde": 209,
- "Oacute": 211,
- "Ocirc": 212,
- "Ograve": 210,
- "Oslash": 216,
- "Otilde": 213,
- "Ouml": 214,
- "THORN": 222,
- "Uacute": 218,
- "Ucirc": 219,
- "Ugrave": 217,
- "Uuml": 220,
- "Yacute": 221,
- "aacute": 225,
- "acirc": 226,
- "aelig": 230,
- "agrave": 224,
- "aring": 229,
- "atilde": 227,
- "auml": 228,
- "ccedil": 231,
- "eacute": 233,
- "ecirc": 234,
- "egrave": 232,
- "eth": 240,
- "euml": 235,
- "iacute": 237,
- "icirc": 238,
- "igrave": 236,
- "iuml": 239,
- "ntilde": 241,
- "oacute": 243,
- "ocirc": 244,
- "ograve": 242,
- "oslash": 248,
- "otilde": 245,
- "ouml": 246,
- "szlig": 223,
- "thorn": 254,
- "uacute": 250,
- "ucirc": 251,
- "ugrave": 249,
- "uuml": 252,
- "yacute": 253,
- "yuml": 255,
- "copy": 169,
- "reg": 174,
- "nbsp": 160,
- "iexcl": 161,
- "cent": 162,
- "pound": 163,
- "curren": 164,
- "yen": 165,
- "brvbar": 166,
- "sect": 167,
- "uml": 168,
- "ordf": 170,
- "laquo": 171,
- "not": 172,
- "shy": 173,
- "macr": 175,
- "deg": 176,
- "plusmn": 177,
- "sup1": 185,
- "sup2": 178,
- "sup3": 179,
- "acute": 180,
- "micro": 181,
- "para": 182,
- "middot": 183,
- "cedil": 184,
- "ordm": 186,
- "raquo": 187,
- "frac14": 188,
- "frac12": 189,
- "frac34": 190,
- "iquest": 191,
- "times": 215,
- "divide": 247,
- "OElig": 338,
- "oelig": 339,
- "Scaron": 352,
- "scaron": 353,
- "Yuml": 376,
- "fnof": 402,
- "circ": 710,
- "tilde": 732,
- "Alpha": 913,
- "Beta": 914,
- "Gamma": 915,
- "Delta": 916,
- "Epsilon": 917,
- "Zeta": 918,
- "Eta": 919,
- "Theta": 920,
- "Iota": 921,
- "Kappa": 922,
- "Lambda": 923,
- "Mu": 924,
- "Nu": 925,
- "Xi": 926,
- "Omicron": 927,
- "Pi": 928,
- "Rho": 929,
- "Sigma": 931,
- "Tau": 932,
- "Upsilon": 933,
- "Phi": 934,
- "Chi": 935,
- "Psi": 936,
- "Omega": 937,
- "alpha": 945,
- "beta": 946,
- "gamma": 947,
- "delta": 948,
- "epsilon": 949,
- "zeta": 950,
- "eta": 951,
- "theta": 952,
- "iota": 953,
- "kappa": 954,
- "lambda": 955,
- "mu": 956,
- "nu": 957,
- "xi": 958,
- "omicron": 959,
- "pi": 960,
- "rho": 961,
- "sigmaf": 962,
- "sigma": 963,
- "tau": 964,
- "upsilon": 965,
- "phi": 966,
- "chi": 967,
- "psi": 968,
- "omega": 969,
- "thetasym": 977,
- "upsih": 978,
- "piv": 982,
- "ensp": 8194,
- "emsp": 8195,
- "thinsp": 8201,
- "zwnj": 8204,
- "zwj": 8205,
- "lrm": 8206,
- "rlm": 8207,
- "ndash": 8211,
- "mdash": 8212,
- "lsquo": 8216,
- "rsquo": 8217,
- "sbquo": 8218,
- "ldquo": 8220,
- "rdquo": 8221,
- "bdquo": 8222,
- "dagger": 8224,
- "Dagger": 8225,
- "bull": 8226,
- "hellip": 8230,
- "permil": 8240,
- "prime": 8242,
- "Prime": 8243,
- "lsaquo": 8249,
- "rsaquo": 8250,
- "oline": 8254,
- "frasl": 8260,
- "euro": 8364,
- "image": 8465,
- "weierp": 8472,
- "real": 8476,
- "trade": 8482,
- "alefsym": 8501,
- "larr": 8592,
- "uarr": 8593,
- "rarr": 8594,
- "darr": 8595,
- "harr": 8596,
- "crarr": 8629,
- "lArr": 8656,
- "uArr": 8657,
- "rArr": 8658,
- "dArr": 8659,
- "hArr": 8660,
- "forall": 8704,
- "part": 8706,
- "exist": 8707,
- "empty": 8709,
- "nabla": 8711,
- "isin": 8712,
- "notin": 8713,
- "ni": 8715,
- "prod": 8719,
- "sum": 8721,
- "minus": 8722,
- "lowast": 8727,
- "radic": 8730,
- "prop": 8733,
- "infin": 8734,
- "ang": 8736,
- "and": 8743,
- "or": 8744,
- "cap": 8745,
- "cup": 8746,
- "int": 8747,
- "there4": 8756,
- "sim": 8764,
- "cong": 8773,
- "asymp": 8776,
- "ne": 8800,
- "equiv": 8801,
- "le": 8804,
- "ge": 8805,
- "sub": 8834,
- "sup": 8835,
- "nsub": 8836,
- "sube": 8838,
- "supe": 8839,
- "oplus": 8853,
- "otimes": 8855,
- "perp": 8869,
- "sdot": 8901,
- "lceil": 8968,
- "rceil": 8969,
- "lfloor": 8970,
- "rfloor": 8971,
- "lang": 9001,
- "rang": 9002,
- "loz": 9674,
- "spades": 9824,
- "clubs": 9827,
- "hearts": 9829,
- "diams": 9830
- };
- Object.keys(sax.ENTITIES).forEach(function(key) {
- var e = sax.ENTITIES[key];
- var s2 = typeof e === "number" ? String.fromCharCode(e) : e;
- sax.ENTITIES[key] = s2;
- });
- for (var s in sax.STATE) {
- sax.STATE[sax.STATE[s]] = s;
- }
- S = sax.STATE;
- function emit(parser, event, data) {
- parser[event] && parser[event](data);
- }
- function emitNode(parser, nodeType, data) {
- if (parser.textNode)
- closeText(parser);
- emit(parser, nodeType, data);
- }
- function closeText(parser) {
- parser.textNode = textopts(parser.opt, parser.textNode);
- if (parser.textNode)
- emit(parser, "ontext", parser.textNode);
- parser.textNode = "";
- }
- function textopts(opt, text) {
- if (opt.trim)
- text = text.trim();
- if (opt.normalize)
- text = text.replace(/\s+/g, " ");
- return text;
- }
- function error(parser, er) {
- closeText(parser);
- if (parser.trackPosition) {
- er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c;
- }
- er = new Error(er);
- parser.error = er;
- emit(parser, "onerror", er);
- return parser;
- }
- function end(parser) {
- if (parser.sawRoot && !parser.closedRoot)
- strictFail(parser, "Unclosed root tag");
- if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) {
- error(parser, "Unexpected end");
- }
- closeText(parser);
- parser.c = "";
- parser.closed = true;
- emit(parser, "onend");
- SAXParser.call(parser, parser.strict, parser.opt);
- return parser;
- }
- function strictFail(parser, message) {
- if (typeof parser !== "object" || !(parser instanceof SAXParser)) {
- throw new Error("bad call to strictFail");
- }
- if (parser.strict) {
- error(parser, message);
- }
- }
- function newTag(parser) {
- if (!parser.strict)
- parser.tagName = parser.tagName[parser.looseCase]();
- var parent = parser.tags[parser.tags.length - 1] || parser;
- var tag = parser.tag = { name: parser.tagName, attributes: {} };
- if (parser.opt.xmlns) {
- tag.ns = parent.ns;
- }
- parser.attribList.length = 0;
- emitNode(parser, "onopentagstart", tag);
- }
- function qname(name, attribute) {
- var i = name.indexOf(":");
- var qualName = i < 0 ? ["", name] : name.split(":");
- var prefix = qualName[0];
- var local = qualName[1];
- if (attribute && name === "xmlns") {
- prefix = "xmlns";
- local = "";
- }
- return { prefix, local };
- }
- function attrib(parser) {
- if (!parser.strict) {
- parser.attribName = parser.attribName[parser.looseCase]();
- }
- if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) {
- parser.attribName = parser.attribValue = "";
- return;
- }
- if (parser.opt.xmlns) {
- var qn = qname(parser.attribName, true);
- var prefix = qn.prefix;
- var local = qn.local;
- if (prefix === "xmlns") {
- if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
- strictFail(
- parser,
- "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue
- );
- } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
- strictFail(
- parser,
- "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser.attribValue
- );
- } else {
- var tag = parser.tag;
- var parent = parser.tags[parser.tags.length - 1] || parser;
- if (tag.ns === parent.ns) {
- tag.ns = Object.create(parent.ns);
- }
- tag.ns[local] = parser.attribValue;
- }
- }
- parser.attribList.push([parser.attribName, parser.attribValue]);
- } else {
- parser.tag.attributes[parser.attribName] = parser.attribValue;
- emitNode(parser, "onattribute", {
- name: parser.attribName,
- value: parser.attribValue
- });
- }
- parser.attribName = parser.attribValue = "";
- }
- function openTag(parser, selfClosing) {
- if (parser.opt.xmlns) {
- var tag = parser.tag;
- var qn = qname(parser.tagName);
- tag.prefix = qn.prefix;
- tag.local = qn.local;
- tag.uri = tag.ns[qn.prefix] || "";
- if (tag.prefix && !tag.uri) {
- strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName));
- tag.uri = qn.prefix;
- }
- var parent = parser.tags[parser.tags.length - 1] || parser;
- if (tag.ns && parent.ns !== tag.ns) {
- Object.keys(tag.ns).forEach(function(p) {
- emitNode(parser, "onopennamespace", {
- prefix: p,
- uri: tag.ns[p]
- });
- });
- }
- for (var i = 0, l = parser.attribList.length; i < l; i++) {
- var nv = parser.attribList[i];
- var name = nv[0];
- var value = nv[1];
- var qualName = qname(name, true);
- var prefix = qualName.prefix;
- var local = qualName.local;
- var uri = prefix === "" ? "" : tag.ns[prefix] || "";
- var a = {
- name,
- value,
- prefix,
- local,
- uri
- };
- if (prefix && prefix !== "xmlns" && !uri) {
- strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix));
- a.uri = prefix;
- }
- parser.tag.attributes[name] = a;
- emitNode(parser, "onattribute", a);
- }
- parser.attribList.length = 0;
- }
- parser.tag.isSelfClosing = !!selfClosing;
- parser.sawRoot = true;
- parser.tags.push(parser.tag);
- emitNode(parser, "onopentag", parser.tag);
- if (!selfClosing) {
- if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
- parser.state = S.SCRIPT;
- } else {
- parser.state = S.TEXT;
- }
- parser.tag = null;
- parser.tagName = "";
- }
- parser.attribName = parser.attribValue = "";
- parser.attribList.length = 0;
- }
- function closeTag(parser) {
- if (!parser.tagName) {
- strictFail(parser, "Weird empty close tag.");
- parser.textNode += "</>";
- parser.state = S.TEXT;
- return;
- }
- if (parser.script) {
- if (parser.tagName !== "script") {
- parser.script += "</" + parser.tagName + ">";
- parser.tagName = "";
- parser.state = S.SCRIPT;
- return;
- }
- emitNode(parser, "onscript", parser.script);
- parser.script = "";
- }
- var t = parser.tags.length;
- var tagName = parser.tagName;
- if (!parser.strict) {
- tagName = tagName[parser.looseCase]();
- }
- var closeTo = tagName;
- while (t--) {
- var close = parser.tags[t];
- if (close.name !== closeTo) {
- strictFail(parser, "Unexpected close tag");
- } else {
- break;
- }
- }
- if (t < 0) {
- strictFail(parser, "Unmatched closing tag: " + parser.tagName);
- parser.textNode += "</" + parser.tagName + ">";
- parser.state = S.TEXT;
- return;
- }
- parser.tagName = tagName;
- var s2 = parser.tags.length;
- while (s2-- > t) {
- var tag = parser.tag = parser.tags.pop();
- parser.tagName = parser.tag.name;
- emitNode(parser, "onclosetag", parser.tagName);
- var x = {};
- for (var i in tag.ns) {
- x[i] = tag.ns[i];
- }
- var parent = parser.tags[parser.tags.length - 1] || parser;
- if (parser.opt.xmlns && tag.ns !== parent.ns) {
- Object.keys(tag.ns).forEach(function(p) {
- var n = tag.ns[p];
- emitNode(parser, "onclosenamespace", { prefix: p, uri: n });
- });
- }
- }
- if (t === 0)
- parser.closedRoot = true;
- parser.tagName = parser.attribValue = parser.attribName = "";
- parser.attribList.length = 0;
- parser.state = S.TEXT;
- }
- function parseEntity(parser) {
- var entity = parser.entity;
- var entityLC = entity.toLowerCase();
- var num;
- var numStr = "";
- if (parser.ENTITIES[entity]) {
- return parser.ENTITIES[entity];
- }
- if (parser.ENTITIES[entityLC]) {
- return parser.ENTITIES[entityLC];
- }
- entity = entityLC;
- if (entity.charAt(0) === "#") {
- if (entity.charAt(1) === "x") {
- entity = entity.slice(2);
- num = parseInt(entity, 16);
- numStr = num.toString(16);
- } else {
- entity = entity.slice(1);
- num = parseInt(entity, 10);
- numStr = num.toString(10);
- }
- }
- entity = entity.replace(/^0+/, "");
- if (isNaN(num) || numStr.toLowerCase() !== entity) {
- strictFail(parser, "Invalid character entity");
- return "&" + parser.entity + ";";
- }
- return String.fromCodePoint(num);
- }
- function beginWhiteSpace(parser, c) {
- if (c === "<") {
- parser.state = S.OPEN_WAKA;
- parser.startTagPosition = parser.position;
- } else if (!isWhitespace(c)) {
- strictFail(parser, "Non-whitespace before first tag.");
- parser.textNode = c;
- parser.state = S.TEXT;
- }
- }
- function charAt(chunk, i) {
- var result = "";
- if (i < chunk.length) {
- result = chunk.charAt(i);
- }
- return result;
- }
- function write(chunk) {
- var parser = this;
- if (this.error) {
- throw this.error;
- }
- if (parser.closed) {
- return error(
- parser,
- "Cannot write after close. Assign an onready handler."
- );
- }
- if (chunk === null) {
- return end(parser);
- }
- if (typeof chunk === "object") {
- chunk = chunk.toString();
- }
- var i = 0;
- var c = "";
- while (true) {
- c = charAt(chunk, i++);
- parser.c = c;
- if (!c) {
- break;
- }
- if (parser.trackPosition) {
- parser.position++;
- if (c === "\n") {
- parser.line++;
- parser.column = 0;
- } else {
- parser.column++;
- }
- }
- switch (parser.state) {
- case S.BEGIN:
- parser.state = S.BEGIN_WHITESPACE;
- if (c === "\uFEFF") {
- continue;
- }
- beginWhiteSpace(parser, c);
- continue;
- case S.BEGIN_WHITESPACE:
- beginWhiteSpace(parser, c);
- continue;
- case S.TEXT:
- if (parser.sawRoot && !parser.closedRoot) {
- var starti = i - 1;
- while (c && c !== "<" && c !== "&") {
- c = charAt(chunk, i++);
- if (c && parser.trackPosition) {
- parser.position++;
- if (c === "\n") {
- parser.line++;
- parser.column = 0;
- } else {
- parser.column++;
- }
- }
- }
- parser.textNode += chunk.substring(starti, i - 1);
- }
- if (c === "<" && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
- parser.state = S.OPEN_WAKA;
- parser.startTagPosition = parser.position;
- } else {
- if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
- strictFail(parser, "Text data outside of root node.");
- }
- if (c === "&") {
- parser.state = S.TEXT_ENTITY;
- } else {
- parser.textNode += c;
- }
- }
- continue;
- case S.SCRIPT:
- if (c === "<") {
- parser.state = S.SCRIPT_ENDING;
- } else {
- parser.script += c;
- }
- continue;
- case S.SCRIPT_ENDING:
- if (c === "/") {
- parser.state = S.CLOSE_TAG;
- } else {
- parser.script += "<" + c;
- parser.state = S.SCRIPT;
- }
- continue;
- case S.OPEN_WAKA:
- if (c === "!") {
- parser.state = S.SGML_DECL;
- parser.sgmlDecl = "";
- } else if (isWhitespace(c)) {
- } else if (isMatch(nameStart, c)) {
- parser.state = S.OPEN_TAG;
- parser.tagName = c;
- } else if (c === "/") {
- parser.state = S.CLOSE_TAG;
- parser.tagName = "";
- } else if (c === "?") {
- parser.state = S.PROC_INST;
- parser.procInstName = parser.procInstBody = "";
- } else {
- strictFail(parser, "Unencoded <");
- if (parser.startTagPosition + 1 < parser.position) {
- var pad = parser.position - parser.startTagPosition;
- c = new Array(pad).join(" ") + c;
- }
- parser.textNode += "<" + c;
- parser.state = S.TEXT;
- }
- continue;
- case S.SGML_DECL:
- if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
- emitNode(parser, "onopencdata");
- parser.state = S.CDATA;
- parser.sgmlDecl = "";
- parser.cdata = "";
- } else if (parser.sgmlDecl + c === "--") {
- parser.state = S.COMMENT;
- parser.comment = "";
- parser.sgmlDecl = "";
- } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
- parser.state = S.DOCTYPE;
- if (parser.doctype || parser.sawRoot) {
- strictFail(
- parser,
- "Inappropriately located doctype declaration"
- );
- }
- parser.doctype = "";
- parser.sgmlDecl = "";
- } else if (c === ">") {
- emitNode(parser, "onsgmldeclaration", parser.sgmlDecl);
- parser.sgmlDecl = "";
- parser.state = S.TEXT;
- } else if (isQuote(c)) {
- parser.state = S.SGML_DECL_QUOTED;
- parser.sgmlDecl += c;
- } else {
- parser.sgmlDecl += c;
- }
- continue;
- case S.SGML_DECL_QUOTED:
- if (c === parser.q) {
- parser.state = S.SGML_DECL;
- parser.q = "";
- }
- parser.sgmlDecl += c;
- continue;
- case S.DOCTYPE:
- if (c === ">") {
- parser.state = S.TEXT;
- emitNode(parser, "ondoctype", parser.doctype);
- parser.doctype = true;
- } else {
- parser.doctype += c;
- if (c === "[") {
- parser.state = S.DOCTYPE_DTD;
- } else if (isQuote(c)) {
- parser.state = S.DOCTYPE_QUOTED;
- parser.q = c;
- }
- }
- continue;
- case S.DOCTYPE_QUOTED:
- parser.doctype += c;
- if (c === parser.q) {
- parser.q = "";
- parser.state = S.DOCTYPE;
- }
- continue;
- case S.DOCTYPE_DTD:
- parser.doctype += c;
- if (c === "]") {
- parser.state = S.DOCTYPE;
- } else if (isQuote(c)) {
- parser.state = S.DOCTYPE_DTD_QUOTED;
- parser.q = c;
- }
- continue;
- case S.DOCTYPE_DTD_QUOTED:
- parser.doctype += c;
- if (c === parser.q) {
- parser.state = S.DOCTYPE_DTD;
- parser.q = "";
- }
- continue;
- case S.COMMENT:
- if (c === "-") {
- parser.state = S.COMMENT_ENDING;
- } else {
- parser.comment += c;
- }
- continue;
- case S.COMMENT_ENDING:
- if (c === "-") {
- parser.state = S.COMMENT_ENDED;
- parser.comment = textopts(parser.opt, parser.comment);
- if (parser.comment) {
- emitNode(parser, "oncomment", parser.comment);
- }
- parser.comment = "";
- } else {
- parser.comment += "-" + c;
- parser.state = S.COMMENT;
- }
- continue;
- case S.COMMENT_ENDED:
- if (c !== ">") {
- strictFail(parser, "Malformed comment");
- parser.comment += "--" + c;
- parser.state = S.COMMENT;
- } else {
- parser.state = S.TEXT;
- }
- continue;
- case S.CDATA:
- if (c === "]") {
- parser.state = S.CDATA_ENDING;
- } else {
- parser.cdata += c;
- }
- continue;
- case S.CDATA_ENDING:
- if (c === "]") {
- parser.state = S.CDATA_ENDING_2;
- } else {
- parser.cdata += "]" + c;
- parser.state = S.CDATA;
- }
- continue;
- case S.CDATA_ENDING_2:
- if (c === ">") {
- if (parser.cdata) {
- emitNode(parser, "oncdata", parser.cdata);
- }
- emitNode(parser, "onclosecdata");
- parser.cdata = "";
- parser.state = S.TEXT;
- } else if (c === "]") {
- parser.cdata += "]";
- } else {
- parser.cdata += "]]" + c;
- parser.state = S.CDATA;
- }
- continue;
- case S.PROC_INST:
- if (c === "?") {
- parser.state = S.PROC_INST_ENDING;
- } else if (isWhitespace(c)) {
- parser.state = S.PROC_INST_BODY;
- } else {
- parser.procInstName += c;
- }
- continue;
- case S.PROC_INST_BODY:
- if (!parser.procInstBody && isWhitespace(c)) {
- continue;
- } else if (c === "?") {
- parser.state = S.PROC_INST_ENDING;
- } else {
- parser.procInstBody += c;
- }
- continue;
- case S.PROC_INST_ENDING:
- if (c === ">") {
- emitNode(parser, "onprocessinginstruction", {
- name: parser.procInstName,
- body: parser.procInstBody
- });
- parser.procInstName = parser.procInstBody = "";
- parser.state = S.TEXT;
- } else {
- parser.procInstBody += "?" + c;
- parser.state = S.PROC_INST_BODY;
- }
- continue;
- case S.OPEN_TAG:
- if (isMatch(nameBody, c)) {
- parser.tagName += c;
- } else {
- newTag(parser);
- if (c === ">") {
- openTag(parser);
- } else if (c === "/") {
- parser.state = S.OPEN_TAG_SLASH;
- } else {
- if (!isWhitespace(c)) {
- strictFail(parser, "Invalid character in tag name");
- }
- parser.state = S.ATTRIB;
- }
- }
- continue;
- case S.OPEN_TAG_SLASH:
- if (c === ">") {
- openTag(parser, true);
- closeTag(parser);
- } else {
- strictFail(parser, "Forward-slash in opening tag not followed by >");
- parser.state = S.ATTRIB;
- }
- continue;
- case S.ATTRIB:
- if (isWhitespace(c)) {
- continue;
- } else if (c === ">") {
- openTag(parser);
- } else if (c === "/") {
- parser.state = S.OPEN_TAG_SLASH;
- } else if (isMatch(nameStart, c)) {
- parser.attribName = c;
- parser.attribValue = "";
- parser.state = S.ATTRIB_NAME;
- } else {
- strictFail(parser, "Invalid attribute name");
- }
- continue;
- case S.ATTRIB_NAME:
- if (c === "=") {
- parser.state = S.ATTRIB_VALUE;
- } else if (c === ">") {
- strictFail(parser, "Attribute without value");
- parser.attribValue = parser.attribName;
- attrib(parser);
- openTag(parser);
- } else if (isWhitespace(c)) {
- parser.state = S.ATTRIB_NAME_SAW_WHITE;
- } else if (isMatch(nameBody, c)) {
- parser.attribName += c;
- } else {
- strictFail(parser, "Invalid attribute name");
- }
- continue;
- case S.ATTRIB_NAME_SAW_WHITE:
- if (c === "=") {
- parser.state = S.ATTRIB_VALUE;
- } else if (isWhitespace(c)) {
- continue;
- } else {
- strictFail(parser, "Attribute without value");
- parser.tag.attributes[parser.attribName] = "";
- parser.attribValue = "";
- emitNode(parser, "onattribute", {
- name: parser.attribName,
- value: ""
- });
- parser.attribName = "";
- if (c === ">") {
- openTag(parser);
- } else if (isMatch(nameStart, c)) {
- parser.attribName = c;
- parser.state = S.ATTRIB_NAME;
- } else {
- strictFail(parser, "Invalid attribute name");
- parser.state = S.ATTRIB;
- }
- }
- continue;
- case S.ATTRIB_VALUE:
- if (isWhitespace(c)) {
- continue;
- } else if (isQuote(c)) {
- parser.q = c;
- parser.state = S.ATTRIB_VALUE_QUOTED;
- } else {
- strictFail(parser, "Unquoted attribute value");
- parser.state = S.ATTRIB_VALUE_UNQUOTED;
- parser.attribValue = c;
- }
- continue;
- case S.ATTRIB_VALUE_QUOTED:
- if (c !== parser.q) {
- if (c === "&") {
- parser.state = S.ATTRIB_VALUE_ENTITY_Q;
- } else {
- parser.attribValue += c;
- }
- continue;
- }
- attrib(parser);
- parser.q = "";
- parser.state = S.ATTRIB_VALUE_CLOSED;
- continue;
- case S.ATTRIB_VALUE_CLOSED:
- if (isWhitespace(c)) {
- parser.state = S.ATTRIB;
- } else if (c === ">") {
- openTag(parser);
- } else if (c === "/") {
- parser.state = S.OPEN_TAG_SLASH;
- } else if (isMatch(nameStart, c)) {
- strictFail(parser, "No whitespace between attributes");
- parser.attribName = c;
- parser.attribValue = "";
- parser.state = S.ATTRIB_NAME;
- } else {
- strictFail(parser, "Invalid attribute name");
- }
- continue;
- case S.ATTRIB_VALUE_UNQUOTED:
- if (!isAttribEnd(c)) {
- if (c === "&") {
- parser.state = S.ATTRIB_VALUE_ENTITY_U;
- } else {
- parser.attribValue += c;
- }
- continue;
- }
- attrib(parser);
- if (c === ">") {
- openTag(parser);
- } else {
- parser.state = S.ATTRIB;
- }
- continue;
- case S.CLOSE_TAG:
- if (!parser.tagName) {
- if (isWhitespace(c)) {
- continue;
- } else if (notMatch(nameStart, c)) {
- if (parser.script) {
- parser.script += "</" + c;
- parser.state = S.SCRIPT;
- } else {
- strictFail(parser, "Invalid tagname in closing tag.");
- }
- } else {
- parser.tagName = c;
- }
- } else if (c === ">") {
- closeTag(parser);
- } else if (isMatch(nameBody, c)) {
- parser.tagName += c;
- } else if (parser.script) {
- parser.script += "</" + parser.tagName;
- parser.tagName = "";
- parser.state = S.SCRIPT;
- } else {
- if (!isWhitespace(c)) {
- strictFail(parser, "Invalid tagname in closing tag");
- }
- parser.state = S.CLOSE_TAG_SAW_WHITE;
- }
- continue;
- case S.CLOSE_TAG_SAW_WHITE:
- if (isWhitespace(c)) {
- continue;
- }
- if (c === ">") {
- closeTag(parser);
- } else {
- strictFail(parser, "Invalid characters in closing tag");
- }
- continue;
- case S.TEXT_ENTITY:
- case S.ATTRIB_VALUE_ENTITY_Q:
- case S.ATTRIB_VALUE_ENTITY_U:
- var returnState;
- var buffer;
- switch (parser.state) {
- case S.TEXT_ENTITY:
- returnState = S.TEXT;
- buffer = "textNode";
- break;
- case S.ATTRIB_VALUE_ENTITY_Q:
- returnState = S.ATTRIB_VALUE_QUOTED;
- buffer = "attribValue";
- break;
- case S.ATTRIB_VALUE_ENTITY_U:
- returnState = S.ATTRIB_VALUE_UNQUOTED;
- buffer = "attribValue";
- break;
- }
- if (c === ";") {
- parser[buffer] += parseEntity(parser);
- parser.entity = "";
- parser.state = returnState;
- } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
- parser.entity += c;
- } else {
- strictFail(parser, "Invalid character in entity name");
- parser[buffer] += "&" + parser.entity + c;
- parser.entity = "";
- parser.state = returnState;
- }
- continue;
- default:
- throw new Error(parser, "Unknown state: " + parser.state);
- }
- }
- if (parser.position >= parser.bufferCheckPosition) {
- checkBufferLength(parser);
- }
- return parser;
- }
- if (!String.fromCodePoint) {
- (function() {
- var stringFromCharCode = String.fromCharCode;
- var floor = Math.floor;
- var fromCodePoint = function() {
- var MAX_SIZE = 16384;
- var codeUnits = [];
- var highSurrogate;
- var lowSurrogate;
- var index = -1;
- var length = arguments.length;
- if (!length) {
- return "";
- }
- var result = "";
- while (++index < length) {
- var codePoint = Number(arguments[index]);
- if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
- codePoint < 0 || // not a valid Unicode code point
- codePoint > 1114111 || // not a valid Unicode code point
- floor(codePoint) !== codePoint) {
- throw RangeError("Invalid code point: " + codePoint);
- }
- if (codePoint <= 65535) {
- codeUnits.push(codePoint);
- } else {
- codePoint -= 65536;
- highSurrogate = (codePoint >> 10) + 55296;
- lowSurrogate = codePoint % 1024 + 56320;
- codeUnits.push(highSurrogate, lowSurrogate);
- }
- if (index + 1 === length || codeUnits.length > MAX_SIZE) {
- result += stringFromCharCode.apply(null, codeUnits);
- codeUnits.length = 0;
- }
- }
- return result;
- };
- if (Object.defineProperty) {
- Object.defineProperty(String, "fromCodePoint", {
- value: fromCodePoint,
- configurable: true,
- writable: true
- });
- } else {
- String.fromCodePoint = fromCodePoint;
- }
- })();
- }
- })(typeof exports3 === "undefined" ? this.sax = {} : exports3);
- }).call(this);
- }).call(this, require2("buffer").Buffer);
- }, { "buffer": 90, "stream": 398, "string_decoder": 413 }], 398: [function(require2, module3, exports3) {
- module3.exports = Stream;
- var EE = require2("events").EventEmitter;
- var inherits = require2("inherits");
- inherits(Stream, EE);
- Stream.Readable = require2("readable-stream/lib/_stream_readable.js");
- Stream.Writable = require2("readable-stream/lib/_stream_writable.js");
- Stream.Duplex = require2("readable-stream/lib/_stream_duplex.js");
- Stream.Transform = require2("readable-stream/lib/_stream_transform.js");
- Stream.PassThrough = require2("readable-stream/lib/_stream_passthrough.js");
- Stream.finished = require2("readable-stream/lib/internal/streams/end-of-stream.js");
- Stream.pipeline = require2("readable-stream/lib/internal/streams/pipeline.js");
- Stream.Stream = Stream;
- function Stream() {
- EE.call(this);
- }
- Stream.prototype.pipe = function(dest, options) {
- var source = this;
- function ondata(chunk) {
- if (dest.writable) {
- if (false === dest.write(chunk) && source.pause) {
- source.pause();
- }
- }
- }
- source.on("data", ondata);
- function ondrain() {
- if (source.readable && source.resume) {
- source.resume();
- }
- }
- dest.on("drain", ondrain);
- if (!dest._isStdio && (!options || options.end !== false)) {
- source.on("end", onend);
- source.on("close", onclose);
- }
- var didOnEnd = false;
- function onend() {
- if (didOnEnd)
- return;
- didOnEnd = true;
- dest.end();
- }
- function onclose() {
- if (didOnEnd)
- return;
- didOnEnd = true;
- if (typeof dest.destroy === "function")
- dest.destroy();
- }
- function onerror(er) {
- cleanup();
- if (EE.listenerCount(this, "error") === 0) {
- throw er;
- }
- }
- source.on("error", onerror);
- dest.on("error", onerror);
- function cleanup() {
- source.removeListener("data", ondata);
- dest.removeListener("drain", ondrain);
- source.removeListener("end", onend);
- source.removeListener("close", onclose);
- source.removeListener("error", onerror);
- dest.removeListener("error", onerror);
- source.removeListener("end", cleanup);
- source.removeListener("close", cleanup);
- dest.removeListener("close", cleanup);
- }
- source.on("end", cleanup);
- source.on("close", cleanup);
- dest.on("close", cleanup);
- dest.emit("pipe", source);
- return dest;
- };
- }, { "events": 344, "inherits": 364, "readable-stream/lib/_stream_duplex.js": 400, "readable-stream/lib/_stream_passthrough.js": 401, "readable-stream/lib/_stream_readable.js": 402, "readable-stream/lib/_stream_transform.js": 403, "readable-stream/lib/_stream_writable.js": 404, "readable-stream/lib/internal/streams/end-of-stream.js": 408, "readable-stream/lib/internal/streams/pipeline.js": 410 }], 399: [function(require2, module3, exports3) {
- "use strict";
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
- var codes = {};
- function createErrorType(code, message, Base) {
- if (!Base) {
- Base = Error;
- }
- function getMessage(arg1, arg2, arg3) {
- if (typeof message === "string") {
- return message;
- } else {
- return message(arg1, arg2, arg3);
- }
- }
- var NodeError = function(_Base) {
- _inheritsLoose(NodeError2, _Base);
- function NodeError2(arg1, arg2, arg3) {
- return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
- }
- return NodeError2;
- }(Base);
- NodeError.prototype.name = Base.name;
- NodeError.prototype.code = code;
- codes[code] = NodeError;
- }
- function oneOf(expected, thing) {
- if (Array.isArray(expected)) {
- var len = expected.length;
- expected = expected.map(function(i) {
- return String(i);
- });
- if (len > 2) {
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
- } else if (len === 2) {
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
- } else {
- return "of ".concat(thing, " ").concat(expected[0]);
- }
- } else {
- return "of ".concat(thing, " ").concat(String(expected));
- }
- }
- function startsWith(str, search, pos) {
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
- }
- function endsWith(str, search, this_len) {
- if (this_len === void 0 || this_len > str.length) {
- this_len = str.length;
- }
- return str.substring(this_len - search.length, this_len) === search;
- }
- function includes(str, search, start) {
- if (typeof start !== "number") {
- start = 0;
- }
- if (start + search.length > str.length) {
- return false;
- } else {
- return str.indexOf(search, start) !== -1;
- }
- }
- createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
- return 'The value "' + value + '" is invalid for option "' + name + '"';
- }, TypeError);
- createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
- var determiner;
- if (typeof expected === "string" && startsWith(expected, "not ")) {
- determiner = "must not be";
- expected = expected.replace(/^not /, "");
- } else {
- determiner = "must be";
- }
- var msg;
- if (endsWith(name, " argument")) {
- msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
- } else {
- var type = includes(name, ".") ? "property" : "argument";
- msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
- }
- msg += ". Received type ".concat(typeof actual);
- return msg;
- }, TypeError);
- createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
- return "The " + name + " method is not implemented";
- });
- createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
- createErrorType("ERR_STREAM_DESTROYED", function(name) {
- return "Cannot call " + name + " after a stream was destroyed";
- });
- createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
- createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
- createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
- createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
- createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
- return "Unknown encoding: " + arg;
- }, TypeError);
- createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
- module3.exports.codes = codes;
- }, {}], 400: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- var objectKeys = Object.keys || function(obj) {
- var keys2 = [];
- for (var key in obj)
- keys2.push(key);
- return keys2;
- };
- module3.exports = Duplex;
- var Readable = require2("./_stream_readable");
- var Writable = require2("./_stream_writable");
- require2("inherits")(Duplex, Readable);
- {
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method])
- Duplex.prototype[method] = Writable.prototype[method];
- }
- }
- function Duplex(options) {
- if (!(this instanceof Duplex))
- return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
- this.allowHalfOpen = true;
- if (options) {
- if (options.readable === false)
- this.readable = false;
- if (options.writable === false)
- this.writable = false;
- if (options.allowHalfOpen === false) {
- this.allowHalfOpen = false;
- this.once("end", onend);
- }
- }
- }
- Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- });
- Object.defineProperty(Duplex.prototype, "writableBuffer", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- Object.defineProperty(Duplex.prototype, "writableLength", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- });
- function onend() {
- if (this._writableState.ended)
- return;
- process.nextTick(onEndNT, this);
- }
- function onEndNT(self2) {
- self2.end();
- }
- Object.defineProperty(Duplex.prototype, "destroyed", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === void 0 || this._writableState === void 0) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function set(value) {
- if (this._readableState === void 0 || this._writableState === void 0) {
- return;
- }
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
- });
- }).call(this);
- }).call(this, require2("_process"));
- }, { "./_stream_readable": 402, "./_stream_writable": 404, "_process": 467, "inherits": 364 }], 401: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = PassThrough;
- var Transform = require2("./_stream_transform");
- require2("inherits")(PassThrough, Transform);
- function PassThrough(options) {
- if (!(this instanceof PassThrough))
- return new PassThrough(options);
- Transform.call(this, options);
- }
- PassThrough.prototype._transform = function(chunk, encoding, cb) {
- cb(null, chunk);
- };
- }, { "./_stream_transform": 403, "inherits": 364 }], 402: [function(require2, module3, exports3) {
- (function(process, global2) {
- (function() {
- "use strict";
- module3.exports = Readable;
- var Duplex;
- Readable.ReadableState = ReadableState;
- var EE = require2("events").EventEmitter;
- var EElistenerCount = function EElistenerCount2(emitter, type) {
- return emitter.listeners(type).length;
- };
- var Stream = require2("./internal/streams/stream");
- var Buffer = require2("buffer").Buffer;
- var OurUint8Array = (typeof global2 !== "undefined" ? global2 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
- };
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var debugUtil = require2("util");
- var debug;
- if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog("stream");
- } else {
- debug = function debug2() {
- };
- }
- var BufferList = require2("./internal/streams/buffer_list");
- var destroyImpl = require2("./internal/streams/destroy");
- var _require = require2("./internal/streams/state"), getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = require2("../errors").codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
- var StringDecoder;
- var createReadableStreamAsyncIterator;
- var from;
- require2("inherits")(Readable, Stream);
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
- function prependListener(emitter, event, fn) {
- if (typeof emitter.prependListener === "function")
- return emitter.prependListener(event, fn);
- if (!emitter._events || !emitter._events[event])
- emitter.on(event, fn);
- else if (Array.isArray(emitter._events[event]))
- emitter._events[event].unshift(fn);
- else
- emitter._events[event] = [fn, emitter._events[event]];
- }
- function ReadableState(options, stream, isDuplex) {
- Duplex = Duplex || require2("./_stream_duplex");
- options = options || {};
- if (typeof isDuplex !== "boolean")
- isDuplex = stream instanceof Duplex;
- this.objectMode = !!options.objectMode;
- if (isDuplex)
- this.objectMode = this.objectMode || !!options.readableObjectMode;
- this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
- this.sync = true;
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
- this.paused = true;
- this.emitClose = options.emitClose !== false;
- this.autoDestroy = !!options.autoDestroy;
- this.destroyed = false;
- this.defaultEncoding = options.defaultEncoding || "utf8";
- this.awaitDrain = 0;
- this.readingMore = false;
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder)
- StringDecoder = require2("string_decoder/").StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
- }
- function Readable(options) {
- Duplex = Duplex || require2("./_stream_duplex");
- if (!(this instanceof Readable))
- return new Readable(options);
- var isDuplex = this instanceof Duplex;
- this._readableState = new ReadableState(options, this, isDuplex);
- this.readable = true;
- if (options) {
- if (typeof options.read === "function")
- this._read = options.read;
- if (typeof options.destroy === "function")
- this._destroy = options.destroy;
- }
- Stream.call(this);
- }
- Object.defineProperty(Readable.prototype, "destroyed", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === void 0) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function set(value) {
- if (!this._readableState) {
- return;
- }
- this._readableState.destroyed = value;
- }
- });
- Readable.prototype.destroy = destroyImpl.destroy;
- Readable.prototype._undestroy = destroyImpl.undestroy;
- Readable.prototype._destroy = function(err, cb) {
- cb(err);
- };
- Readable.prototype.push = function(chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
- if (!state.objectMode) {
- if (typeof chunk === "string") {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = "";
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
- };
- Readable.prototype.unshift = function(chunk) {
- return readableAddChunk(this, chunk, null, true, false);
- };
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- debug("readableAddChunk", chunk);
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck)
- er = chunkInvalid(state, chunk);
- if (er) {
- errorOrDestroy(stream, er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (addToFront) {
- if (state.endEmitted)
- errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
- else
- addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
- } else if (state.destroyed) {
- return false;
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0)
- addChunk(stream, state, chunk, false);
- else
- maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- maybeReadMore(stream, state);
- }
- }
- return !state.ended && (state.length < state.highWaterMark || state.length === 0);
- }
- function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- state.awaitDrain = 0;
- stream.emit("data", chunk);
- } else {
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront)
- state.buffer.unshift(chunk);
- else
- state.buffer.push(chunk);
- if (state.needReadable)
- emitReadable(stream);
- }
- maybeReadMore(stream, state);
- }
- function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
- }
- return er;
- }
- Readable.prototype.isPaused = function() {
- return this._readableState.flowing === false;
- };
- Readable.prototype.setEncoding = function(enc) {
- if (!StringDecoder)
- StringDecoder = require2("string_decoder/").StringDecoder;
- var decoder = new StringDecoder(enc);
- this._readableState.decoder = decoder;
- this._readableState.encoding = this._readableState.decoder.encoding;
- var p = this._readableState.buffer.head;
- var content = "";
- while (p !== null) {
- content += decoder.write(p.data);
- p = p.next;
- }
- this._readableState.buffer.clear();
- if (content !== "")
- this._readableState.buffer.push(content);
- this._readableState.length = content.length;
- return this;
- };
- var MAX_HWM = 1073741824;
- function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- n = MAX_HWM;
- } else {
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
- }
- function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended)
- return 0;
- if (state.objectMode)
- return 1;
- if (n !== n) {
- if (state.flowing && state.length)
- return state.buffer.head.data.length;
- else
- return state.length;
- }
- if (n > state.highWaterMark)
- state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length)
- return n;
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
- }
- Readable.prototype.read = function(n) {
- debug("read", n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
- if (n !== 0)
- state.emittedReadable = false;
- if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
- debug("read: emitReadable", state.length, state.ended);
- if (state.length === 0 && state.ended)
- endReadable(this);
- else
- emitReadable(this);
- return null;
- }
- n = howMuchToRead(n, state);
- if (n === 0 && state.ended) {
- if (state.length === 0)
- endReadable(this);
- return null;
- }
- var doRead = state.needReadable;
- debug("need readable", doRead);
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug("length less than watermark", doRead);
- }
- if (state.ended || state.reading) {
- doRead = false;
- debug("reading or ended", doRead);
- } else if (doRead) {
- debug("do read");
- state.reading = true;
- state.sync = true;
- if (state.length === 0)
- state.needReadable = true;
- this._read(state.highWaterMark);
- state.sync = false;
- if (!state.reading)
- n = howMuchToRead(nOrig, state);
- }
- var ret;
- if (n > 0)
- ret = fromList(n, state);
- else
- ret = null;
- if (ret === null) {
- state.needReadable = state.length <= state.highWaterMark;
- n = 0;
- } else {
- state.length -= n;
- state.awaitDrain = 0;
- }
- if (state.length === 0) {
- if (!state.ended)
- state.needReadable = true;
- if (nOrig !== n && state.ended)
- endReadable(this);
- }
- if (ret !== null)
- this.emit("data", ret);
- return ret;
- };
- function onEofChunk(stream, state) {
- debug("onEofChunk");
- if (state.ended)
- return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
- if (state.sync) {
- emitReadable(stream);
- } else {
- state.needReadable = false;
- if (!state.emittedReadable) {
- state.emittedReadable = true;
- emitReadable_(stream);
- }
- }
- }
- function emitReadable(stream) {
- var state = stream._readableState;
- debug("emitReadable", state.needReadable, state.emittedReadable);
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug("emitReadable", state.flowing);
- state.emittedReadable = true;
- process.nextTick(emitReadable_, stream);
- }
- }
- function emitReadable_(stream) {
- var state = stream._readableState;
- debug("emitReadable_", state.destroyed, state.length, state.ended);
- if (!state.destroyed && (state.length || state.ended)) {
- stream.emit("readable");
- state.emittedReadable = false;
- }
- state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
- flow(stream);
- }
- function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- process.nextTick(maybeReadMore_, stream, state);
- }
- }
- function maybeReadMore_(stream, state) {
- while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
- var len = state.length;
- debug("maybeReadMore read 0");
- stream.read(0);
- if (len === state.length)
- break;
- }
- state.readingMore = false;
- }
- Readable.prototype._read = function(n) {
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
- };
- Readable.prototype.pipe = function(dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted)
- process.nextTick(endFn);
- else
- src.once("end", endFn);
- dest.on("unpipe", onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug("onunpipe");
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
- function onend() {
- debug("onend");
- dest.end();
- }
- var ondrain = pipeOnDrain(src);
- dest.on("drain", ondrain);
- var cleanedUp = false;
- function cleanup() {
- debug("cleanup");
- dest.removeListener("close", onclose);
- dest.removeListener("finish", onfinish);
- dest.removeListener("drain", ondrain);
- dest.removeListener("error", onerror);
- dest.removeListener("unpipe", onunpipe);
- src.removeListener("end", onend);
- src.removeListener("end", unpipe);
- src.removeListener("data", ondata);
- cleanedUp = true;
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
- ondrain();
- }
- src.on("data", ondata);
- function ondata(chunk) {
- debug("ondata");
- var ret = dest.write(chunk);
- debug("dest.write", ret);
- if (ret === false) {
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug("false write response, pause", state.awaitDrain);
- state.awaitDrain++;
- }
- src.pause();
- }
- }
- function onerror(er) {
- debug("onerror", er);
- unpipe();
- dest.removeListener("error", onerror);
- if (EElistenerCount(dest, "error") === 0)
- errorOrDestroy(dest, er);
- }
- prependListener(dest, "error", onerror);
- function onclose() {
- dest.removeListener("finish", onfinish);
- unpipe();
- }
- dest.once("close", onclose);
- function onfinish() {
- debug("onfinish");
- dest.removeListener("close", onclose);
- unpipe();
- }
- dest.once("finish", onfinish);
- function unpipe() {
- debug("unpipe");
- src.unpipe(dest);
- }
- dest.emit("pipe", src);
- if (!state.flowing) {
- debug("pipe resume");
- src.resume();
- }
- return dest;
- };
- function pipeOnDrain(src) {
- return function pipeOnDrainFunctionResult() {
- var state = src._readableState;
- debug("pipeOnDrain", state.awaitDrain);
- if (state.awaitDrain)
- state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
- state.flowing = true;
- flow(src);
- }
- };
- }
- Readable.prototype.unpipe = function(dest) {
- var state = this._readableState;
- var unpipeInfo = {
- hasUnpiped: false
- };
- if (state.pipesCount === 0)
- return this;
- if (state.pipesCount === 1) {
- if (dest && dest !== state.pipes)
- return this;
- if (!dest)
- dest = state.pipes;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest)
- dest.emit("unpipe", this, unpipeInfo);
- return this;
- }
- if (!dest) {
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- for (var i = 0; i < len; i++)
- dests[i].emit("unpipe", this, {
- hasUnpiped: false
- });
- return this;
- }
- var index = indexOf(state.pipes, dest);
- if (index === -1)
- return this;
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1)
- state.pipes = state.pipes[0];
- dest.emit("unpipe", this, unpipeInfo);
- return this;
- };
- Readable.prototype.on = function(ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
- var state = this._readableState;
- if (ev === "data") {
- state.readableListening = this.listenerCount("readable") > 0;
- if (state.flowing !== false)
- this.resume();
- } else if (ev === "readable") {
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.flowing = false;
- state.emittedReadable = false;
- debug("on readable", state.length, state.reading);
- if (state.length) {
- emitReadable(this);
- } else if (!state.reading) {
- process.nextTick(nReadingNextTick, this);
- }
- }
- }
- return res;
- };
- Readable.prototype.addListener = Readable.prototype.on;
- Readable.prototype.removeListener = function(ev, fn) {
- var res = Stream.prototype.removeListener.call(this, ev, fn);
- if (ev === "readable") {
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- Readable.prototype.removeAllListeners = function(ev) {
- var res = Stream.prototype.removeAllListeners.apply(this, arguments);
- if (ev === "readable" || ev === void 0) {
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- function updateReadableListening(self2) {
- var state = self2._readableState;
- state.readableListening = self2.listenerCount("readable") > 0;
- if (state.resumeScheduled && !state.paused) {
- state.flowing = true;
- } else if (self2.listenerCount("data") > 0) {
- self2.resume();
- }
- }
- function nReadingNextTick(self2) {
- debug("readable nexttick read 0");
- self2.read(0);
- }
- Readable.prototype.resume = function() {
- var state = this._readableState;
- if (!state.flowing) {
- debug("resume");
- state.flowing = !state.readableListening;
- resume(this, state);
- }
- state.paused = false;
- return this;
- };
- function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- process.nextTick(resume_, stream, state);
- }
- }
- function resume_(stream, state) {
- debug("resume", state.reading);
- if (!state.reading) {
- stream.read(0);
- }
- state.resumeScheduled = false;
- stream.emit("resume");
- flow(stream);
- if (state.flowing && !state.reading)
- stream.read(0);
- }
- Readable.prototype.pause = function() {
- debug("call pause flowing=%j", this._readableState.flowing);
- if (this._readableState.flowing !== false) {
- debug("pause");
- this._readableState.flowing = false;
- this.emit("pause");
- }
- this._readableState.paused = true;
- return this;
- };
- function flow(stream) {
- var state = stream._readableState;
- debug("flow", state.flowing);
- while (state.flowing && stream.read() !== null)
- ;
- }
- Readable.prototype.wrap = function(stream) {
- var _this = this;
- var state = this._readableState;
- var paused = false;
- stream.on("end", function() {
- debug("wrapped end");
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length)
- _this.push(chunk);
- }
- _this.push(null);
- });
- stream.on("data", function(chunk) {
- debug("wrapped data");
- if (state.decoder)
- chunk = state.decoder.write(chunk);
- if (state.objectMode && (chunk === null || chunk === void 0))
- return;
- else if (!state.objectMode && (!chunk || !chunk.length))
- return;
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
- for (var i in stream) {
- if (this[i] === void 0 && typeof stream[i] === "function") {
- this[i] = function methodWrap(method) {
- return function methodWrapReturnFunction() {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- }
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- }
- this._read = function(n2) {
- debug("wrapped _read", n2);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
- return this;
- };
- if (typeof Symbol === "function") {
- Readable.prototype[Symbol.asyncIterator] = function() {
- if (createReadableStreamAsyncIterator === void 0) {
- createReadableStreamAsyncIterator = require2("./internal/streams/async_iterator");
- }
- return createReadableStreamAsyncIterator(this);
- };
- }
- Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.highWaterMark;
- }
- });
- Object.defineProperty(Readable.prototype, "readableBuffer", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState && this._readableState.buffer;
- }
- });
- Object.defineProperty(Readable.prototype, "readableFlowing", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.flowing;
- },
- set: function set(state) {
- if (this._readableState) {
- this._readableState.flowing = state;
- }
- }
- });
- Readable._fromList = fromList;
- Object.defineProperty(Readable.prototype, "readableLength", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.length;
- }
- });
- function fromList(n, state) {
- if (state.length === 0)
- return null;
- var ret;
- if (state.objectMode)
- ret = state.buffer.shift();
- else if (!n || n >= state.length) {
- if (state.decoder)
- ret = state.buffer.join("");
- else if (state.buffer.length === 1)
- ret = state.buffer.first();
- else
- ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- ret = state.buffer.consume(n, state.decoder);
- }
- return ret;
- }
- function endReadable(stream) {
- var state = stream._readableState;
- debug("endReadable", state.endEmitted);
- if (!state.endEmitted) {
- state.ended = true;
- process.nextTick(endReadableNT, state, stream);
- }
- }
- function endReadableNT(state, stream) {
- debug("endReadableNT", state.endEmitted, state.length);
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit("end");
- if (state.autoDestroy) {
- var wState = stream._writableState;
- if (!wState || wState.autoDestroy && wState.finished) {
- stream.destroy();
- }
- }
- }
- }
- if (typeof Symbol === "function") {
- Readable.from = function(iterable, opts) {
- if (from === void 0) {
- from = require2("./internal/streams/from");
- }
- return from(Readable, iterable, opts);
- };
- }
- function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x)
- return i;
- }
- return -1;
- }
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "../errors": 399, "./_stream_duplex": 400, "./internal/streams/async_iterator": 405, "./internal/streams/buffer_list": 406, "./internal/streams/destroy": 407, "./internal/streams/from": 409, "./internal/streams/state": 411, "./internal/streams/stream": 412, "_process": 467, "buffer": 90, "events": 344, "inherits": 364, "string_decoder/": 413, "util": 89 }], 403: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = Transform;
- var _require$codes = require2("../errors").codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
- var Duplex = require2("./_stream_duplex");
- require2("inherits")(Transform, Duplex);
- function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
- var cb = ts.writecb;
- if (cb === null) {
- return this.emit("error", new ERR_MULTIPLE_CALLBACK());
- }
- ts.writechunk = null;
- ts.writecb = null;
- if (data != null)
- this.push(data);
- cb(er);
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
- }
- function Transform(options) {
- if (!(this instanceof Transform))
- return new Transform(options);
- Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- };
- this._readableState.needReadable = true;
- this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === "function")
- this._transform = options.transform;
- if (typeof options.flush === "function")
- this._flush = options.flush;
- }
- this.on("prefinish", prefinish);
- }
- function prefinish() {
- var _this = this;
- if (typeof this._flush === "function" && !this._readableState.destroyed) {
- this._flush(function(er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
- }
- Transform.prototype.push = function(chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
- };
- Transform.prototype._transform = function(chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
- };
- Transform.prototype._write = function(chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
- this._read(rs.highWaterMark);
- }
- };
- Transform.prototype._read = function(n) {
- var ts = this._transformState;
- if (ts.writechunk !== null && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- ts.needTransform = true;
- }
- };
- Transform.prototype._destroy = function(err, cb) {
- Duplex.prototype._destroy.call(this, err, function(err2) {
- cb(err2);
- });
- };
- function done(stream, er, data) {
- if (er)
- return stream.emit("error", er);
- if (data != null)
- stream.push(data);
- if (stream._writableState.length)
- throw new ERR_TRANSFORM_WITH_LENGTH_0();
- if (stream._transformState.transforming)
- throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
- return stream.push(null);
- }
- }, { "../errors": 399, "./_stream_duplex": 400, "inherits": 364 }], 404: [function(require2, module3, exports3) {
- (function(process, global2) {
- (function() {
- "use strict";
- module3.exports = Writable;
- function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
- }
- function CorkedRequest(state) {
- var _this = this;
- this.next = null;
- this.entry = null;
- this.finish = function() {
- onCorkedFinish(_this, state);
- };
- }
- var Duplex;
- Writable.WritableState = WritableState;
- var internalUtil = {
- deprecate: require2("util-deprecate")
- };
- var Stream = require2("./internal/streams/stream");
- var Buffer = require2("buffer").Buffer;
- var OurUint8Array = (typeof global2 !== "undefined" ? global2 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
- };
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var destroyImpl = require2("./internal/streams/destroy");
- var _require = require2("./internal/streams/state"), getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = require2("../errors").codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- require2("inherits")(Writable, Stream);
- function nop() {
- }
- function WritableState(options, stream, isDuplex) {
- Duplex = Duplex || require2("./_stream_duplex");
- options = options || {};
- if (typeof isDuplex !== "boolean")
- isDuplex = stream instanceof Duplex;
- this.objectMode = !!options.objectMode;
- if (isDuplex)
- this.objectMode = this.objectMode || !!options.writableObjectMode;
- this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
- this.finalCalled = false;
- this.needDrain = false;
- this.ending = false;
- this.ended = false;
- this.finished = false;
- this.destroyed = false;
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
- this.defaultEncoding = options.defaultEncoding || "utf8";
- this.length = 0;
- this.writing = false;
- this.corked = 0;
- this.sync = true;
- this.bufferProcessing = false;
- this.onwrite = function(er) {
- onwrite(stream, er);
- };
- this.writecb = null;
- this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
- this.pendingcb = 0;
- this.prefinished = false;
- this.errorEmitted = false;
- this.emitClose = options.emitClose !== false;
- this.autoDestroy = !!options.autoDestroy;
- this.bufferedRequestCount = 0;
- this.corkedRequestsFree = new CorkedRequest(this);
- }
- WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
- };
- (function() {
- try {
- Object.defineProperty(WritableState.prototype, "buffer", {
- get: internalUtil.deprecate(function writableStateBufferGetter() {
- return this.getBuffer();
- }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
- });
- } catch (_) {
- }
- })();
- var realHasInstance;
- if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function value(object) {
- if (realHasInstance.call(this, object))
- return true;
- if (this !== Writable)
- return false;
- return object && object._writableState instanceof WritableState;
- }
- });
- } else {
- realHasInstance = function realHasInstance2(object) {
- return object instanceof this;
- };
- }
- function Writable(options) {
- Duplex = Duplex || require2("./_stream_duplex");
- var isDuplex = this instanceof Duplex;
- if (!isDuplex && !realHasInstance.call(Writable, this))
- return new Writable(options);
- this._writableState = new WritableState(options, this, isDuplex);
- this.writable = true;
- if (options) {
- if (typeof options.write === "function")
- this._write = options.write;
- if (typeof options.writev === "function")
- this._writev = options.writev;
- if (typeof options.destroy === "function")
- this._destroy = options.destroy;
- if (typeof options.final === "function")
- this._final = options.final;
- }
- Stream.call(this);
- }
- Writable.prototype.pipe = function() {
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
- };
- function writeAfterEnd(stream, cb) {
- var er = new ERR_STREAM_WRITE_AFTER_END();
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- }
- function validChunk(stream, state, chunk, cb) {
- var er;
- if (chunk === null) {
- er = new ERR_STREAM_NULL_VALUES();
- } else if (typeof chunk !== "string" && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
- }
- if (er) {
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- return false;
- }
- return true;
- }
- Writable.prototype.write = function(chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === "function") {
- cb = encoding;
- encoding = null;
- }
- if (isBuf)
- encoding = "buffer";
- else if (!encoding)
- encoding = state.defaultEncoding;
- if (typeof cb !== "function")
- cb = nop;
- if (state.ending)
- writeAfterEnd(this, cb);
- else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
- }
- return ret;
- };
- Writable.prototype.cork = function() {
- this._writableState.corked++;
- };
- Writable.prototype.uncork = function() {
- var state = this._writableState;
- if (state.corked) {
- state.corked--;
- if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest)
- clearBuffer(this, state);
- }
- };
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- if (typeof encoding === "string")
- encoding = encoding.toLowerCase();
- if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
- throw new ERR_UNKNOWN_ENCODING(encoding);
- this._writableState.defaultEncoding = encoding;
- return this;
- };
- Object.defineProperty(Writable.prototype, "writableBuffer", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
- }
- Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- });
- function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = "buffer";
- chunk = newChunk;
- }
- }
- var len = state.objectMode ? 1 : chunk.length;
- state.length += len;
- var ret = state.length < state.highWaterMark;
- if (!ret)
- state.needDrain = true;
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk,
- encoding,
- isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
- return ret;
- }
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (state.destroyed)
- state.onwrite(new ERR_STREAM_DESTROYED("write"));
- else if (writev)
- stream._writev(chunk, state.onwrite);
- else
- stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
- }
- function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) {
- process.nextTick(cb, er);
- process.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- } else {
- cb(er);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- finishMaybe(stream, state);
- }
- }
- function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
- }
- function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
- if (typeof cb !== "function")
- throw new ERR_MULTIPLE_CALLBACK();
- onwriteStateUpdate(state);
- if (er)
- onwriteError(stream, state, sync, er, cb);
- else {
- var finished = needFinish(state) || stream.destroyed;
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
- if (sync) {
- process.nextTick(afterWrite, stream, state, finished, cb);
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
- }
- function afterWrite(stream, state, finished, cb) {
- if (!finished)
- onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
- }
- function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit("drain");
- }
- }
- function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf)
- allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
- doWrite(stream, state, true, state.length, buffer, "", holder.finish);
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--;
- if (state.writing) {
- break;
- }
- }
- if (entry === null)
- state.lastBufferedRequest = null;
- }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
- }
- Writable.prototype._write = function(chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
- };
- Writable.prototype._writev = null;
- Writable.prototype.end = function(chunk, encoding, cb) {
- var state = this._writableState;
- if (typeof chunk === "function") {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === "function") {
- cb = encoding;
- encoding = null;
- }
- if (chunk !== null && chunk !== void 0)
- this.write(chunk, encoding);
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
- if (!state.ending)
- endWritable(this, state, cb);
- return this;
- };
- Object.defineProperty(Writable.prototype, "writableLength", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- });
- function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
- }
- function callFinal(stream, state) {
- stream._final(function(err) {
- state.pendingcb--;
- if (err) {
- errorOrDestroy(stream, err);
- }
- state.prefinished = true;
- stream.emit("prefinish");
- finishMaybe(stream, state);
- });
- }
- function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === "function" && !state.destroyed) {
- state.pendingcb++;
- state.finalCalled = true;
- process.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit("prefinish");
- }
- }
- }
- function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit("finish");
- if (state.autoDestroy) {
- var rState = stream._readableState;
- if (!rState || rState.autoDestroy && rState.endEmitted) {
- stream.destroy();
- }
- }
- }
- }
- return need;
- }
- function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished)
- process.nextTick(cb);
- else
- stream.once("finish", cb);
- }
- state.ended = true;
- stream.writable = false;
- }
- function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
- state.corkedRequestsFree.next = corkReq;
- }
- Object.defineProperty(Writable.prototype, "destroyed", {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._writableState === void 0) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function set(value) {
- if (!this._writableState) {
- return;
- }
- this._writableState.destroyed = value;
- }
- });
- Writable.prototype.destroy = destroyImpl.destroy;
- Writable.prototype._undestroy = destroyImpl.undestroy;
- Writable.prototype._destroy = function(err, cb) {
- cb(err);
- };
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "../errors": 399, "./_stream_duplex": 400, "./internal/streams/destroy": 407, "./internal/streams/state": 411, "./internal/streams/stream": 412, "_process": 467, "buffer": 90, "inherits": 364, "util-deprecate": 416 }], 405: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- var _Object$setPrototypeO;
- function _defineProperty(obj, key, value) {
- key = _toPropertyKey(key);
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _toPropertyKey(arg) {
- var key = _toPrimitive(arg, "string");
- return typeof key === "symbol" ? key : String(key);
- }
- function _toPrimitive(input, hint) {
- if (typeof input !== "object" || input === null)
- return input;
- var prim = input[Symbol.toPrimitive];
- if (prim !== void 0) {
- var res = prim.call(input, hint || "default");
- if (typeof res !== "object")
- return res;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (hint === "string" ? String : Number)(input);
- }
- var finished = require2("./end-of-stream");
- var kLastResolve = Symbol("lastResolve");
- var kLastReject = Symbol("lastReject");
- var kError = Symbol("error");
- var kEnded = Symbol("ended");
- var kLastPromise = Symbol("lastPromise");
- var kHandlePromise = Symbol("handlePromise");
- var kStream = Symbol("stream");
- function createIterResult(value, done) {
- return {
- value,
- done
- };
- }
- function readAndResolve(iter) {
- var resolve = iter[kLastResolve];
- if (resolve !== null) {
- var data = iter[kStream].read();
- if (data !== null) {
- iter[kLastPromise] = null;
- iter[kLastResolve] = null;
- iter[kLastReject] = null;
- resolve(createIterResult(data, false));
- }
- }
- }
- function onReadable(iter) {
- process.nextTick(readAndResolve, iter);
- }
- function wrapForNext(lastPromise, iter) {
- return function(resolve, reject) {
- lastPromise.then(function() {
- if (iter[kEnded]) {
- resolve(createIterResult(void 0, true));
- return;
- }
- iter[kHandlePromise](resolve, reject);
- }, reject);
- };
- }
- var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
- });
- var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
- get stream() {
- return this[kStream];
- },
- next: function next() {
- var _this = this;
- var error = this[kError];
- if (error !== null) {
- return Promise.reject(error);
- }
- if (this[kEnded]) {
- return Promise.resolve(createIterResult(void 0, true));
- }
- if (this[kStream].destroyed) {
- return new Promise(function(resolve, reject) {
- process.nextTick(function() {
- if (_this[kError]) {
- reject(_this[kError]);
- } else {
- resolve(createIterResult(void 0, true));
- }
- });
- });
- }
- var lastPromise = this[kLastPromise];
- var promise;
- if (lastPromise) {
- promise = new Promise(wrapForNext(lastPromise, this));
- } else {
- var data = this[kStream].read();
- if (data !== null) {
- return Promise.resolve(createIterResult(data, false));
- }
- promise = new Promise(this[kHandlePromise]);
- }
- this[kLastPromise] = promise;
- return promise;
- }
- }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
- return this;
- }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
- var _this2 = this;
- return new Promise(function(resolve, reject) {
- _this2[kStream].destroy(null, function(err) {
- if (err) {
- reject(err);
- return;
- }
- resolve(createIterResult(void 0, true));
- });
- });
- }), _Object$setPrototypeO), AsyncIteratorPrototype);
- var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
- var _Object$create;
- var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
- value: stream,
- writable: true
- }), _defineProperty(_Object$create, kLastResolve, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kLastReject, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kError, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kEnded, {
- value: stream._readableState.endEmitted,
- writable: true
- }), _defineProperty(_Object$create, kHandlePromise, {
- value: function value(resolve, reject) {
- var data = iterator[kStream].read();
- if (data) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(data, false));
- } else {
- iterator[kLastResolve] = resolve;
- iterator[kLastReject] = reject;
- }
- },
- writable: true
- }), _Object$create));
- iterator[kLastPromise] = null;
- finished(stream, function(err) {
- if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
- var reject = iterator[kLastReject];
- if (reject !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- reject(err);
- }
- iterator[kError] = err;
- return;
- }
- var resolve = iterator[kLastResolve];
- if (resolve !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(void 0, true));
- }
- iterator[kEnded] = true;
- });
- stream.on("readable", onReadable.bind(null, iterator));
- return iterator;
- };
- module3.exports = createReadableStreamAsyncIterator;
- }).call(this);
- }).call(this, require2("_process"));
- }, { "./end-of-stream": 408, "_process": 467 }], 406: [function(require2, module3, exports3) {
- "use strict";
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = null != arguments[i] ? arguments[i] : {};
- i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- key = _toPropertyKey(key);
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties(target, props) {
- for (var 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, _toPropertyKey(descriptor.key), descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- function _toPropertyKey(arg) {
- var key = _toPrimitive(arg, "string");
- return typeof key === "symbol" ? key : String(key);
- }
- function _toPrimitive(input, hint) {
- if (typeof input !== "object" || input === null)
- return input;
- var prim = input[Symbol.toPrimitive];
- if (prim !== void 0) {
- var res = prim.call(input, hint || "default");
- if (typeof res !== "object")
- return res;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (hint === "string" ? String : Number)(input);
- }
- var _require = require2("buffer"), Buffer = _require.Buffer;
- var _require2 = require2("util"), inspect = _require2.inspect;
- var custom = inspect && inspect.custom || "inspect";
- function copyBuffer(src, target, offset) {
- Buffer.prototype.copy.call(src, target, offset);
- }
- module3.exports = function() {
- function BufferList() {
- _classCallCheck(this, BufferList);
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
- _createClass(BufferList, [{
- key: "push",
- value: function push(v) {
- var entry = {
- data: v,
- next: null
- };
- if (this.length > 0)
- this.tail.next = entry;
- else
- this.head = entry;
- this.tail = entry;
- ++this.length;
- }
- }, {
- key: "unshift",
- value: function unshift(v) {
- var entry = {
- data: v,
- next: this.head
- };
- if (this.length === 0)
- this.tail = entry;
- this.head = entry;
- ++this.length;
- }
- }, {
- key: "shift",
- value: function shift() {
- if (this.length === 0)
- return;
- var ret = this.head.data;
- if (this.length === 1)
- this.head = this.tail = null;
- else
- this.head = this.head.next;
- --this.length;
- return ret;
- }
- }, {
- key: "clear",
- value: function clear() {
- this.head = this.tail = null;
- this.length = 0;
- }
- }, {
- key: "join",
- value: function join(s) {
- if (this.length === 0)
- return "";
- var p = this.head;
- var ret = "" + p.data;
- while (p = p.next)
- ret += s + p.data;
- return ret;
- }
- }, {
- key: "concat",
- value: function concat(n) {
- if (this.length === 0)
- return Buffer.alloc(0);
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- }
- // Consumes a specified amount of bytes or characters from the buffered data.
- }, {
- key: "consume",
- value: function consume(n, hasStrings) {
- var ret;
- if (n < this.head.data.length) {
- ret = this.head.data.slice(0, n);
- this.head.data = this.head.data.slice(n);
- } else if (n === this.head.data.length) {
- ret = this.shift();
- } else {
- ret = hasStrings ? this._getString(n) : this._getBuffer(n);
- }
- return ret;
- }
- }, {
- key: "first",
- value: function first() {
- return this.head.data;
- }
- // Consumes a specified amount of characters from the buffered data.
- }, {
- key: "_getString",
- value: function _getString(n) {
- var p = this.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length)
- ret += str;
- else
- ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next)
- this.head = p.next;
- else
- this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- }
- // Consumes a specified amount of bytes from the buffered data.
- }, {
- key: "_getBuffer",
- value: function _getBuffer(n) {
- var ret = Buffer.allocUnsafe(n);
- var p = this.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next)
- this.head = p.next;
- else
- this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- }
- // Make sure the linked list only shows the minimal necessary information.
- }, {
- key: custom,
- value: function value(_, options) {
- return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
- // Only inspect one level.
- depth: 0,
- // It should not recurse.
- customInspect: false
- }));
- }
- }]);
- return BufferList;
- }();
- }, { "buffer": 90, "util": 89 }], 407: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- "use strict";
- function destroy(err, cb) {
- var _this = this;
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err) {
- if (!this._writableState) {
- process.nextTick(emitErrorNT, this, err);
- } else if (!this._writableState.errorEmitted) {
- this._writableState.errorEmitted = true;
- process.nextTick(emitErrorNT, this, err);
- }
- }
- return this;
- }
- if (this._readableState) {
- this._readableState.destroyed = true;
- }
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
- this._destroy(err || null, function(err2) {
- if (!cb && err2) {
- if (!_this._writableState) {
- process.nextTick(emitErrorAndCloseNT, _this, err2);
- } else if (!_this._writableState.errorEmitted) {
- _this._writableState.errorEmitted = true;
- process.nextTick(emitErrorAndCloseNT, _this, err2);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- } else if (cb) {
- process.nextTick(emitCloseNT, _this);
- cb(err2);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- });
- return this;
- }
- function emitErrorAndCloseNT(self2, err) {
- emitErrorNT(self2, err);
- emitCloseNT(self2);
- }
- function emitCloseNT(self2) {
- if (self2._writableState && !self2._writableState.emitClose)
- return;
- if (self2._readableState && !self2._readableState.emitClose)
- return;
- self2.emit("close");
- }
- function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finalCalled = false;
- this._writableState.prefinished = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
- }
- function emitErrorNT(self2, err) {
- self2.emit("error", err);
- }
- function errorOrDestroy(stream, err) {
- var rState = stream._readableState;
- var wState = stream._writableState;
- if (rState && rState.autoDestroy || wState && wState.autoDestroy)
- stream.destroy(err);
- else
- stream.emit("error", err);
- }
- module3.exports = {
- destroy,
- undestroy,
- errorOrDestroy
- };
- }).call(this);
- }).call(this, require2("_process"));
- }, { "_process": 467 }], 408: [function(require2, module3, exports3) {
- "use strict";
- var ERR_STREAM_PREMATURE_CLOSE = require2("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;
- function once(callback) {
- var called = false;
- return function() {
- if (called)
- return;
- called = true;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- callback.apply(this, args);
- };
- }
- function noop() {
- }
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === "function";
- }
- function eos(stream, opts, callback) {
- if (typeof opts === "function")
- return eos(stream, null, opts);
- if (!opts)
- opts = {};
- callback = once(callback || noop);
- var readable = opts.readable || opts.readable !== false && stream.readable;
- var writable = opts.writable || opts.writable !== false && stream.writable;
- var onlegacyfinish = function onlegacyfinish2() {
- if (!stream.writable)
- onfinish();
- };
- var writableEnded = stream._writableState && stream._writableState.finished;
- var onfinish = function onfinish2() {
- writable = false;
- writableEnded = true;
- if (!readable)
- callback.call(stream);
- };
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
- var onend = function onend2() {
- readable = false;
- readableEnded = true;
- if (!writable)
- callback.call(stream);
- };
- var onerror = function onerror2(err) {
- callback.call(stream, err);
- };
- var onclose = function onclose2() {
- var err;
- if (readable && !readableEnded) {
- if (!stream._readableState || !stream._readableState.ended)
- err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- if (writable && !writableEnded) {
- if (!stream._writableState || !stream._writableState.ended)
- err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- };
- var onrequest = function onrequest2() {
- stream.req.on("finish", onfinish);
- };
- if (isRequest(stream)) {
- stream.on("complete", onfinish);
- stream.on("abort", onclose);
- if (stream.req)
- onrequest();
- else
- stream.on("request", onrequest);
- } else if (writable && !stream._writableState) {
- stream.on("end", onlegacyfinish);
- stream.on("close", onlegacyfinish);
- }
- stream.on("end", onend);
- stream.on("finish", onfinish);
- if (opts.error !== false)
- stream.on("error", onerror);
- stream.on("close", onclose);
- return function() {
- stream.removeListener("complete", onfinish);
- stream.removeListener("abort", onclose);
- stream.removeListener("request", onrequest);
- if (stream.req)
- stream.req.removeListener("finish", onfinish);
- stream.removeListener("end", onlegacyfinish);
- stream.removeListener("close", onlegacyfinish);
- stream.removeListener("finish", onfinish);
- stream.removeListener("end", onend);
- stream.removeListener("error", onerror);
- stream.removeListener("close", onclose);
- };
- }
- module3.exports = eos;
- }, { "../../../errors": 399 }], 409: [function(require2, module3, exports3) {
- module3.exports = function() {
- throw new Error("Readable.from is not available in the browser");
- };
- }, {}], 410: [function(require2, module3, exports3) {
- "use strict";
- var eos;
- function once(callback) {
- var called = false;
- return function() {
- if (called)
- return;
- called = true;
- callback.apply(void 0, arguments);
- };
- }
- var _require$codes = require2("../../../errors").codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
- function noop(err) {
- if (err)
- throw err;
- }
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === "function";
- }
- function destroyer(stream, reading, writing, callback) {
- callback = once(callback);
- var closed = false;
- stream.on("close", function() {
- closed = true;
- });
- if (eos === void 0)
- eos = require2("./end-of-stream");
- eos(stream, {
- readable: reading,
- writable: writing
- }, function(err) {
- if (err)
- return callback(err);
- closed = true;
- callback();
- });
- var destroyed = false;
- return function(err) {
- if (closed)
- return;
- if (destroyed)
- return;
- destroyed = true;
- if (isRequest(stream))
- return stream.abort();
- if (typeof stream.destroy === "function")
- return stream.destroy();
- callback(err || new ERR_STREAM_DESTROYED("pipe"));
- };
- }
- function call(fn) {
- fn();
- }
- function pipe(from, to) {
- return from.pipe(to);
- }
- function popCallback(streams) {
- if (!streams.length)
- return noop;
- if (typeof streams[streams.length - 1] !== "function")
- return noop;
- return streams.pop();
- }
- function pipeline() {
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
- streams[_key] = arguments[_key];
- }
- var callback = popCallback(streams);
- if (Array.isArray(streams[0]))
- streams = streams[0];
- if (streams.length < 2) {
- throw new ERR_MISSING_ARGS("streams");
- }
- var error;
- var destroys = streams.map(function(stream, i) {
- var reading = i < streams.length - 1;
- var writing = i > 0;
- return destroyer(stream, reading, writing, function(err) {
- if (!error)
- error = err;
- if (err)
- destroys.forEach(call);
- if (reading)
- return;
- destroys.forEach(call);
- callback(error);
- });
- });
- return streams.reduce(pipe);
- }
- module3.exports = pipeline;
- }, { "../../../errors": 399, "./end-of-stream": 408 }], 411: [function(require2, module3, exports3) {
- "use strict";
- var ERR_INVALID_OPT_VALUE = require2("../../../errors").codes.ERR_INVALID_OPT_VALUE;
- function highWaterMarkFrom(options, isDuplex, duplexKey) {
- return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
- }
- function getHighWaterMark(state, options, duplexKey, isDuplex) {
- var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
- if (hwm != null) {
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
- var name = isDuplex ? duplexKey : "highWaterMark";
- throw new ERR_INVALID_OPT_VALUE(name, hwm);
- }
- return Math.floor(hwm);
- }
- return state.objectMode ? 16 : 16 * 1024;
- }
- module3.exports = {
- getHighWaterMark
- };
- }, { "../../../errors": 399 }], 412: [function(require2, module3, exports3) {
- arguments[4][393][0].apply(exports3, arguments);
- }, { "dup": 393, "events": 344 }], 413: [function(require2, module3, exports3) {
- "use strict";
- var Buffer = require2("safe-buffer").Buffer;
- var isEncoding = Buffer.isEncoding || function(encoding) {
- encoding = "" + encoding;
- switch (encoding && encoding.toLowerCase()) {
- 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":
- return true;
- default:
- return false;
- }
- };
- function _normalizeEncoding(enc) {
- if (!enc)
- return "utf8";
- var retried;
- while (true) {
- switch (enc) {
- case "utf8":
- case "utf-8":
- return "utf8";
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return "utf16le";
- case "latin1":
- case "binary":
- return "latin1";
- case "base64":
- case "ascii":
- case "hex":
- return enc;
- default:
- if (retried)
- return;
- enc = ("" + enc).toLowerCase();
- retried = true;
- }
- }
- }
- ;
- function normalizeEncoding(enc) {
- var nenc = _normalizeEncoding(enc);
- if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc)))
- throw new Error("Unknown encoding: " + enc);
- return nenc || enc;
- }
- exports3.StringDecoder = StringDecoder;
- function StringDecoder(encoding) {
- this.encoding = normalizeEncoding(encoding);
- var nb;
- switch (this.encoding) {
- case "utf16le":
- this.text = utf16Text;
- this.end = utf16End;
- nb = 4;
- break;
- case "utf8":
- this.fillLast = utf8FillLast;
- nb = 4;
- break;
- case "base64":
- this.text = base64Text;
- this.end = base64End;
- nb = 3;
- break;
- default:
- this.write = simpleWrite;
- this.end = simpleEnd;
- return;
- }
- this.lastNeed = 0;
- this.lastTotal = 0;
- this.lastChar = Buffer.allocUnsafe(nb);
- }
- StringDecoder.prototype.write = function(buf) {
- if (buf.length === 0)
- return "";
- var r;
- var i;
- if (this.lastNeed) {
- r = this.fillLast(buf);
- if (r === void 0)
- return "";
- i = this.lastNeed;
- this.lastNeed = 0;
- } else {
- i = 0;
- }
- if (i < buf.length)
- return r ? r + this.text(buf, i) : this.text(buf, i);
- return r || "";
- };
- StringDecoder.prototype.end = utf8End;
- StringDecoder.prototype.text = utf8Text;
- StringDecoder.prototype.fillLast = function(buf) {
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
- this.lastNeed -= buf.length;
- };
- function utf8CheckByte(byte) {
- if (byte <= 127)
- return 0;
- else if (byte >> 5 === 6)
- return 2;
- else if (byte >> 4 === 14)
- return 3;
- else if (byte >> 3 === 30)
- return 4;
- return byte >> 6 === 2 ? -1 : -2;
- }
- function utf8CheckIncomplete(self2, buf, i) {
- var j = buf.length - 1;
- if (j < i)
- return 0;
- var nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0)
- self2.lastNeed = nb - 1;
- return nb;
- }
- if (--j < i || nb === -2)
- return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0)
- self2.lastNeed = nb - 2;
- return nb;
- }
- if (--j < i || nb === -2)
- return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) {
- if (nb === 2)
- nb = 0;
- else
- self2.lastNeed = nb - 3;
- }
- return nb;
- }
- return 0;
- }
- function utf8CheckExtraBytes(self2, buf, p) {
- if ((buf[0] & 192) !== 128) {
- self2.lastNeed = 0;
- return "�";
- }
- if (self2.lastNeed > 1 && buf.length > 1) {
- if ((buf[1] & 192) !== 128) {
- self2.lastNeed = 1;
- return "�";
- }
- if (self2.lastNeed > 2 && buf.length > 2) {
- if ((buf[2] & 192) !== 128) {
- self2.lastNeed = 2;
- return "�";
- }
- }
- }
- }
- function utf8FillLast(buf) {
- var p = this.lastTotal - this.lastNeed;
- var r = utf8CheckExtraBytes(this, buf, p);
- if (r !== void 0)
- return r;
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, p, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, p, 0, buf.length);
- this.lastNeed -= buf.length;
- }
- function utf8Text(buf, i) {
- var total = utf8CheckIncomplete(this, buf, i);
- if (!this.lastNeed)
- return buf.toString("utf8", i);
- this.lastTotal = total;
- var end = buf.length - (total - this.lastNeed);
- buf.copy(this.lastChar, 0, end);
- return buf.toString("utf8", i, end);
- }
- function utf8End(buf) {
- var r = buf && buf.length ? this.write(buf) : "";
- if (this.lastNeed)
- return r + "�";
- return r;
- }
- function utf16Text(buf, i) {
- if ((buf.length - i) % 2 === 0) {
- var r = buf.toString("utf16le", i);
- if (r) {
- var c = r.charCodeAt(r.length - 1);
- if (c >= 55296 && c <= 56319) {
- this.lastNeed = 2;
- this.lastTotal = 4;
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- return r.slice(0, -1);
- }
- }
- return r;
- }
- this.lastNeed = 1;
- this.lastTotal = 2;
- this.lastChar[0] = buf[buf.length - 1];
- return buf.toString("utf16le", i, buf.length - 1);
- }
- function utf16End(buf) {
- var r = buf && buf.length ? this.write(buf) : "";
- if (this.lastNeed) {
- var end = this.lastTotal - this.lastNeed;
- return r + this.lastChar.toString("utf16le", 0, end);
- }
- return r;
- }
- function base64Text(buf, i) {
- var n = (buf.length - i) % 3;
- if (n === 0)
- return buf.toString("base64", i);
- this.lastNeed = 3 - n;
- this.lastTotal = 3;
- if (n === 1) {
- this.lastChar[0] = buf[buf.length - 1];
- } else {
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- }
- return buf.toString("base64", i, buf.length - n);
- }
- function base64End(buf) {
- var r = buf && buf.length ? this.write(buf) : "";
- if (this.lastNeed)
- return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
- return r;
- }
- function simpleWrite(buf) {
- return buf.toString(this.encoding);
- }
- function simpleEnd(buf) {
- return buf && buf.length ? this.write(buf) : "";
- }
- }, { "safe-buffer": 396 }], 414: [function(require2, module3, exports3) {
- (function(setImmediate, clearImmediate) {
- (function() {
- var nextTick = require2("process/browser.js").nextTick;
- var apply = Function.prototype.apply;
- var slice = Array.prototype.slice;
- var immediateIds = {};
- var nextImmediateId = 0;
- exports3.setTimeout = function() {
- return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
- };
- exports3.setInterval = function() {
- return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
- };
- exports3.clearTimeout = exports3.clearInterval = function(timeout) {
- timeout.close();
- };
- function Timeout(id, clearFn) {
- this._id = id;
- this._clearFn = clearFn;
- }
- Timeout.prototype.unref = Timeout.prototype.ref = function() {
- };
- Timeout.prototype.close = function() {
- this._clearFn.call(window, this._id);
- };
- exports3.enroll = function(item, msecs) {
- clearTimeout(item._idleTimeoutId);
- item._idleTimeout = msecs;
- };
- exports3.unenroll = function(item) {
- clearTimeout(item._idleTimeoutId);
- item._idleTimeout = -1;
- };
- exports3._unrefActive = exports3.active = function(item) {
- clearTimeout(item._idleTimeoutId);
- var msecs = item._idleTimeout;
- if (msecs >= 0) {
- item._idleTimeoutId = setTimeout(function onTimeout() {
- if (item._onTimeout)
- item._onTimeout();
- }, msecs);
- }
- };
- exports3.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
- var id = nextImmediateId++;
- var args = arguments.length < 2 ? false : slice.call(arguments, 1);
- immediateIds[id] = true;
- nextTick(function onNextTick() {
- if (immediateIds[id]) {
- if (args) {
- fn.apply(null, args);
- } else {
- fn.call(null);
- }
- exports3.clearImmediate(id);
- }
- });
- return id;
- };
- exports3.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
- delete immediateIds[id];
- };
- }).call(this);
- }).call(this, require2("timers").setImmediate, require2("timers").clearImmediate);
- }, { "process/browser.js": 381, "timers": 414 }], 415: [function(require2, module3, exports3) {
- var Buffer = require2("buffer").Buffer;
- module3.exports = function(buf) {
- if (buf instanceof Uint8Array) {
- if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
- return buf.buffer;
- } else if (typeof buf.buffer.slice === "function") {
- return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- }
- }
- if (Buffer.isBuffer(buf)) {
- var arrayCopy = new Uint8Array(buf.length);
- var len = buf.length;
- for (var i = 0; i < len; i++) {
- arrayCopy[i] = buf[i];
- }
- return arrayCopy.buffer;
- } else {
- throw new Error("Argument must be a Buffer");
- }
- };
- }, { "buffer": 90 }], 416: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- module3.exports = deprecate;
- function deprecate(fn, msg) {
- if (config("noDeprecation")) {
- return fn;
- }
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config("throwDeprecation")) {
- throw new Error(msg);
- } else if (config("traceDeprecation")) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
- return deprecated;
- }
- function config(name) {
- try {
- if (!global2.localStorage)
- return false;
- } catch (_) {
- return false;
- }
- var val = global2.localStorage[name];
- if (null == val)
- return false;
- return String(val).toLowerCase() === "true";
- }
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, {}], 417: [function(require2, module3, exports3) {
- arguments[4][84][0].apply(exports3, arguments);
- }, { "dup": 84 }], 418: [function(require2, module3, exports3) {
- "use strict";
- var isArgumentsObject = require2("is-arguments");
- var isGeneratorFunction = require2("is-generator-function");
- var whichTypedArray = require2("which-typed-array");
- var isTypedArray = require2("is-typed-array");
- function uncurryThis(f) {
- return f.call.bind(f);
- }
- var BigIntSupported = typeof BigInt !== "undefined";
- var SymbolSupported = typeof Symbol !== "undefined";
- var ObjectToString = uncurryThis(Object.prototype.toString);
- var numberValue = uncurryThis(Number.prototype.valueOf);
- var stringValue = uncurryThis(String.prototype.valueOf);
- var booleanValue = uncurryThis(Boolean.prototype.valueOf);
- if (BigIntSupported) {
- var bigIntValue = uncurryThis(BigInt.prototype.valueOf);
- }
- if (SymbolSupported) {
- var symbolValue = uncurryThis(Symbol.prototype.valueOf);
- }
- function checkBoxedPrimitive(value, prototypeValueOf) {
- if (typeof value !== "object") {
- return false;
- }
- try {
- prototypeValueOf(value);
- return true;
- } catch (e) {
- return false;
- }
- }
- exports3.isArgumentsObject = isArgumentsObject;
- exports3.isGeneratorFunction = isGeneratorFunction;
- exports3.isTypedArray = isTypedArray;
- function isPromise(input) {
- return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
- }
- exports3.isPromise = isPromise;
- function isArrayBufferView(value) {
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
- return ArrayBuffer.isView(value);
- }
- return isTypedArray(value) || isDataView(value);
- }
- exports3.isArrayBufferView = isArrayBufferView;
- function isUint8Array(value) {
- return whichTypedArray(value) === "Uint8Array";
- }
- exports3.isUint8Array = isUint8Array;
- function isUint8ClampedArray(value) {
- return whichTypedArray(value) === "Uint8ClampedArray";
- }
- exports3.isUint8ClampedArray = isUint8ClampedArray;
- function isUint16Array(value) {
- return whichTypedArray(value) === "Uint16Array";
- }
- exports3.isUint16Array = isUint16Array;
- function isUint32Array(value) {
- return whichTypedArray(value) === "Uint32Array";
- }
- exports3.isUint32Array = isUint32Array;
- function isInt8Array(value) {
- return whichTypedArray(value) === "Int8Array";
- }
- exports3.isInt8Array = isInt8Array;
- function isInt16Array(value) {
- return whichTypedArray(value) === "Int16Array";
- }
- exports3.isInt16Array = isInt16Array;
- function isInt32Array(value) {
- return whichTypedArray(value) === "Int32Array";
- }
- exports3.isInt32Array = isInt32Array;
- function isFloat32Array(value) {
- return whichTypedArray(value) === "Float32Array";
- }
- exports3.isFloat32Array = isFloat32Array;
- function isFloat64Array(value) {
- return whichTypedArray(value) === "Float64Array";
- }
- exports3.isFloat64Array = isFloat64Array;
- function isBigInt64Array(value) {
- return whichTypedArray(value) === "BigInt64Array";
- }
- exports3.isBigInt64Array = isBigInt64Array;
- function isBigUint64Array(value) {
- return whichTypedArray(value) === "BigUint64Array";
- }
- exports3.isBigUint64Array = isBigUint64Array;
- function isMapToString(value) {
- return ObjectToString(value) === "[object Map]";
- }
- isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map());
- function isMap(value) {
- if (typeof Map === "undefined") {
- return false;
- }
- return isMapToString.working ? isMapToString(value) : value instanceof Map;
- }
- exports3.isMap = isMap;
- function isSetToString(value) {
- return ObjectToString(value) === "[object Set]";
- }
- isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set());
- function isSet(value) {
- if (typeof Set === "undefined") {
- return false;
- }
- return isSetToString.working ? isSetToString(value) : value instanceof Set;
- }
- exports3.isSet = isSet;
- function isWeakMapToString(value) {
- return ObjectToString(value) === "[object WeakMap]";
- }
- isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap());
- function isWeakMap(value) {
- if (typeof WeakMap === "undefined") {
- return false;
- }
- return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
- }
- exports3.isWeakMap = isWeakMap;
- function isWeakSetToString(value) {
- return ObjectToString(value) === "[object WeakSet]";
- }
- isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet());
- function isWeakSet(value) {
- return isWeakSetToString(value);
- }
- exports3.isWeakSet = isWeakSet;
- function isArrayBufferToString(value) {
- return ObjectToString(value) === "[object ArrayBuffer]";
- }
- isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer());
- function isArrayBuffer(value) {
- if (typeof ArrayBuffer === "undefined") {
- return false;
- }
- return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
- }
- exports3.isArrayBuffer = isArrayBuffer;
- function isDataViewToString(value) {
- return ObjectToString(value) === "[object DataView]";
- }
- isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));
- function isDataView(value) {
- if (typeof DataView === "undefined") {
- return false;
- }
- return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
- }
- exports3.isDataView = isDataView;
- var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
- function isSharedArrayBufferToString(value) {
- return ObjectToString(value) === "[object SharedArrayBuffer]";
- }
- function isSharedArrayBuffer(value) {
- if (typeof SharedArrayBufferCopy === "undefined") {
- return false;
- }
- if (typeof isSharedArrayBufferToString.working === "undefined") {
- isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
- }
- return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
- }
- exports3.isSharedArrayBuffer = isSharedArrayBuffer;
- function isAsyncFunction(value) {
- return ObjectToString(value) === "[object AsyncFunction]";
- }
- exports3.isAsyncFunction = isAsyncFunction;
- function isMapIterator(value) {
- return ObjectToString(value) === "[object Map Iterator]";
- }
- exports3.isMapIterator = isMapIterator;
- function isSetIterator(value) {
- return ObjectToString(value) === "[object Set Iterator]";
- }
- exports3.isSetIterator = isSetIterator;
- function isGeneratorObject(value) {
- return ObjectToString(value) === "[object Generator]";
- }
- exports3.isGeneratorObject = isGeneratorObject;
- function isWebAssemblyCompiledModule(value) {
- return ObjectToString(value) === "[object WebAssembly.Module]";
- }
- exports3.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
- function isNumberObject(value) {
- return checkBoxedPrimitive(value, numberValue);
- }
- exports3.isNumberObject = isNumberObject;
- function isStringObject(value) {
- return checkBoxedPrimitive(value, stringValue);
- }
- exports3.isStringObject = isStringObject;
- function isBooleanObject(value) {
- return checkBoxedPrimitive(value, booleanValue);
- }
- exports3.isBooleanObject = isBooleanObject;
- function isBigIntObject(value) {
- return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
- }
- exports3.isBigIntObject = isBigIntObject;
- function isSymbolObject(value) {
- return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
- }
- exports3.isSymbolObject = isSymbolObject;
- function isBoxedPrimitive(value) {
- return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
- }
- exports3.isBoxedPrimitive = isBoxedPrimitive;
- function isAnyArrayBuffer(value) {
- return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
- }
- exports3.isAnyArrayBuffer = isAnyArrayBuffer;
- ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
- Object.defineProperty(exports3, method, {
- enumerable: false,
- value: function() {
- throw new Error(method + " is not supported in userland");
- }
- });
- });
- }, { "is-arguments": 365, "is-generator-function": 368, "is-typed-array": 369, "which-typed-array": 420 }], 419: [function(require2, module3, exports3) {
- (function(process) {
- (function() {
- var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) {
- var keys = Object.keys(obj);
- var descriptors = {};
- for (var i = 0; i < keys.length; i++) {
- descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
- }
- return descriptors;
- };
- var formatRegExp = /%[sdj%]/g;
- exports3.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(" ");
- }
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x2) {
- if (x2 === "%%")
- return "%";
- if (i >= len)
- return x2;
- switch (x2) {
- case "%s":
- return String(args[i++]);
- case "%d":
- return Number(args[i++]);
- case "%j":
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return "[Circular]";
- }
- default:
- return x2;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += " " + x;
- } else {
- str += " " + inspect(x);
- }
- }
- return str;
- };
- exports3.deprecate = function(fn, msg) {
- if (typeof process !== "undefined" && process.noDeprecation === true) {
- return fn;
- }
- if (typeof process === "undefined") {
- return function() {
- return exports3.deprecate(fn, msg).apply(this, arguments);
- };
- }
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
- return deprecated;
- };
- var debugs = {};
- var debugEnvRegex = /^$/;
- if (process.env.NODE_DEBUG) {
- var debugEnv = process.env.NODE_DEBUG;
- debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
- debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
- }
- exports3.debuglog = function(set) {
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (debugEnvRegex.test(set)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports3.format.apply(exports3, arguments);
- console.error("%s %d: %s", set, pid, msg);
- };
- } else {
- debugs[set] = function() {
- };
- }
- }
- return debugs[set];
- };
- function inspect(obj, opts) {
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- if (arguments.length >= 3)
- ctx.depth = arguments[2];
- if (arguments.length >= 4)
- ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- ctx.showHidden = opts;
- } else if (opts) {
- exports3._extend(ctx, opts);
- }
- if (isUndefined(ctx.showHidden))
- ctx.showHidden = false;
- if (isUndefined(ctx.depth))
- ctx.depth = 2;
- if (isUndefined(ctx.colors))
- ctx.colors = false;
- if (isUndefined(ctx.customInspect))
- ctx.customInspect = true;
- if (ctx.colors)
- ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
- }
- exports3.inspect = inspect;
- inspect.colors = {
- "bold": [1, 22],
- "italic": [3, 23],
- "underline": [4, 24],
- "inverse": [7, 27],
- "white": [37, 39],
- "grey": [90, 39],
- "black": [30, 39],
- "blue": [34, 39],
- "cyan": [36, 39],
- "green": [32, 39],
- "magenta": [35, 39],
- "red": [31, 39],
- "yellow": [33, 39]
- };
- inspect.styles = {
- "special": "cyan",
- "number": "yellow",
- "boolean": "yellow",
- "undefined": "grey",
- "null": "bold",
- "string": "green",
- "date": "magenta",
- // "name": intentionally not styling
- "regexp": "red"
- };
- function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
- if (style) {
- return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
- } else {
- return str;
- }
- }
- function stylizeNoColor(str, styleType) {
- return str;
- }
- function arrayToHash(array) {
- var hash = {};
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
- return hash;
- }
- function formatValue(ctx, value, recurseTimes) {
- if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
- value.inspect !== exports3.inspect && // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
- if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
- return formatError(value);
- }
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ": " + value.name : "";
- return ctx.stylize("[Function" + name + "]", "special");
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), "date");
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
- var base = "", array = false, braces = ["{", "}"];
- if (isArray(value)) {
- array = true;
- braces = ["[", "]"];
- }
- if (isFunction(value)) {
- var n = value.name ? ": " + value.name : "";
- base = " [Function" + n + "]";
- }
- if (isRegExp(value)) {
- base = " " + RegExp.prototype.toString.call(value);
- }
- if (isDate(value)) {
- base = " " + Date.prototype.toUTCString.call(value);
- }
- if (isError(value)) {
- base = " " + formatError(value);
- }
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- } else {
- return ctx.stylize("[Object]", "special");
- }
- }
- ctx.seen.push(value);
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
- ctx.seen.pop();
- return reduceToSingleString(output, base, braces);
- }
- function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize("undefined", "undefined");
- if (isString(value)) {
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
- return ctx.stylize(simple, "string");
- }
- if (isNumber(value))
- return ctx.stylize("" + value, "number");
- if (isBoolean(value))
- return ctx.stylize("" + value, "boolean");
- if (isNull(value))
- return ctx.stylize("null", "null");
- }
- function formatError(value) {
- return "[" + Error.prototype.toString.call(value) + "]";
- }
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(
- ctx,
- value,
- recurseTimes,
- visibleKeys,
- String(i),
- true
- ));
- } else {
- output.push("");
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(
- ctx,
- value,
- recurseTimes,
- visibleKeys,
- key,
- true
- ));
- }
- });
- return output;
- }
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize("[Getter/Setter]", "special");
- } else {
- str = ctx.stylize("[Getter]", "special");
- }
- } else {
- if (desc.set) {
- str = ctx.stylize("[Setter]", "special");
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = "[" + key + "]";
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf("\n") > -1) {
- if (array) {
- str = str.split("\n").map(function(line) {
- return " " + line;
- }).join("\n").slice(2);
- } else {
- str = "\n" + str.split("\n").map(function(line) {
- return " " + line;
- }).join("\n");
- }
- }
- } else {
- str = ctx.stylize("[Circular]", "special");
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify("" + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.slice(1, -1);
- name = ctx.stylize(name, "name");
- } else {
- name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, "string");
- }
- }
- return name + ": " + str;
- }
- function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf("\n") >= 0)
- numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
- }, 0);
- if (length > 60) {
- return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
- }
- return braces[0] + base + " " + output.join(", ") + " " + braces[1];
- }
- exports3.types = require2("./support/types");
- function isArray(ar) {
- return Array.isArray(ar);
- }
- exports3.isArray = isArray;
- function isBoolean(arg) {
- return typeof arg === "boolean";
- }
- exports3.isBoolean = isBoolean;
- function isNull(arg) {
- return arg === null;
- }
- exports3.isNull = isNull;
- function isNullOrUndefined(arg) {
- return arg == null;
- }
- exports3.isNullOrUndefined = isNullOrUndefined;
- function isNumber(arg) {
- return typeof arg === "number";
- }
- exports3.isNumber = isNumber;
- function isString(arg) {
- return typeof arg === "string";
- }
- exports3.isString = isString;
- function isSymbol(arg) {
- return typeof arg === "symbol";
- }
- exports3.isSymbol = isSymbol;
- function isUndefined(arg) {
- return arg === void 0;
- }
- exports3.isUndefined = isUndefined;
- function isRegExp(re) {
- return isObject(re) && objectToString(re) === "[object RegExp]";
- }
- exports3.isRegExp = isRegExp;
- exports3.types.isRegExp = isRegExp;
- function isObject(arg) {
- return typeof arg === "object" && arg !== null;
- }
- exports3.isObject = isObject;
- function isDate(d) {
- return isObject(d) && objectToString(d) === "[object Date]";
- }
- exports3.isDate = isDate;
- exports3.types.isDate = isDate;
- function isError(e) {
- return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
- }
- exports3.isError = isError;
- exports3.types.isNativeError = isError;
- function isFunction(arg) {
- return typeof arg === "function";
- }
- exports3.isFunction = isFunction;
- function isPrimitive(arg) {
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
- typeof arg === "undefined";
- }
- exports3.isPrimitive = isPrimitive;
- exports3.isBuffer = require2("./support/isBuffer");
- function objectToString(o) {
- return Object.prototype.toString.call(o);
- }
- function pad(n) {
- return n < 10 ? "0" + n.toString(10) : n.toString(10);
- }
- var months = [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec"
- ];
- function timestamp() {
- var d = /* @__PURE__ */ new Date();
- var time = [
- pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())
- ].join(":");
- return [d.getDate(), months[d.getMonth()], time].join(" ");
- }
- exports3.log = function() {
- console.log("%s - %s", timestamp(), exports3.format.apply(exports3, arguments));
- };
- exports3.inherits = require2("inherits");
- exports3._extend = function(origin, add) {
- if (!add || !isObject(add))
- return origin;
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
- };
- function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
- exports3.promisify = function promisify(original) {
- if (typeof original !== "function")
- throw new TypeError('The "original" argument must be of type Function');
- if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
- var fn = original[kCustomPromisifiedSymbol];
- if (typeof fn !== "function") {
- throw new TypeError('The "util.promisify.custom" argument must be of type Function');
- }
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
- value: fn,
- enumerable: false,
- writable: false,
- configurable: true
- });
- return fn;
- }
- function fn() {
- var promiseResolve, promiseReject;
- var promise = new Promise(function(resolve, reject) {
- promiseResolve = resolve;
- promiseReject = reject;
- });
- var args = [];
- for (var i = 0; i < arguments.length; i++) {
- args.push(arguments[i]);
- }
- args.push(function(err, value) {
- if (err) {
- promiseReject(err);
- } else {
- promiseResolve(value);
- }
- });
- try {
- original.apply(this, args);
- } catch (err) {
- promiseReject(err);
- }
- return promise;
- }
- Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
- if (kCustomPromisifiedSymbol)
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
- value: fn,
- enumerable: false,
- writable: false,
- configurable: true
- });
- return Object.defineProperties(
- fn,
- getOwnPropertyDescriptors(original)
- );
- };
- exports3.promisify.custom = kCustomPromisifiedSymbol;
- function callbackifyOnRejected(reason, cb) {
- if (!reason) {
- var newReason = new Error("Promise was rejected with a falsy value");
- newReason.reason = reason;
- reason = newReason;
- }
- return cb(reason);
- }
- function callbackify(original) {
- if (typeof original !== "function") {
- throw new TypeError('The "original" argument must be of type Function');
- }
- function callbackified() {
- var args = [];
- for (var i = 0; i < arguments.length; i++) {
- args.push(arguments[i]);
- }
- var maybeCb = args.pop();
- if (typeof maybeCb !== "function") {
- throw new TypeError("The last argument must be of type Function");
- }
- var self2 = this;
- var cb = function() {
- return maybeCb.apply(self2, arguments);
- };
- original.apply(this, args).then(
- function(ret) {
- process.nextTick(cb.bind(null, null, ret));
- },
- function(rej) {
- process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
- }
- );
- }
- Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
- Object.defineProperties(
- callbackified,
- getOwnPropertyDescriptors(original)
- );
- return callbackified;
- }
- exports3.callbackify = callbackify;
- }).call(this);
- }).call(this, require2("_process"));
- }, { "./support/isBuffer": 417, "./support/types": 418, "_process": 467, "inherits": 364 }], 420: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- var forEach = require2("for-each");
- var availableTypedArrays = require2("available-typed-arrays");
- var callBind = require2("call-bind");
- var callBound = require2("call-bind/callBound");
- var gOPD = require2("gopd");
- var $toString = callBound("Object.prototype.toString");
- var hasToStringTag = require2("has-tostringtag/shams")();
- var g = typeof globalThis === "undefined" ? global2 : globalThis;
- var typedArrays = availableTypedArrays();
- var $slice = callBound("String.prototype.slice");
- var getPrototypeOf = Object.getPrototypeOf;
- var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) {
- for (var i = 0; i < array.length; i += 1) {
- if (array[i] === value) {
- return i;
- }
- }
- return -1;
- };
- var cache = { __proto__: null };
- if (hasToStringTag && gOPD && getPrototypeOf) {
- forEach(typedArrays, function(typedArray) {
- var arr = new g[typedArray]();
- if (Symbol.toStringTag in arr) {
- var proto = getPrototypeOf(arr);
- var descriptor = gOPD(proto, Symbol.toStringTag);
- if (!descriptor) {
- var superProto = getPrototypeOf(proto);
- descriptor = gOPD(superProto, Symbol.toStringTag);
- }
- cache["$" + typedArray] = callBind(descriptor.get);
- }
- });
- } else {
- forEach(typedArrays, function(typedArray) {
- var arr = new g[typedArray]();
- cache["$" + typedArray] = callBind(arr.slice);
- });
- }
- var tryTypedArrays = function tryAllTypedArrays(value) {
- var found = false;
- forEach(cache, function(getter, typedArray) {
- if (!found) {
- try {
- if ("$" + getter(value) === typedArray) {
- found = $slice(typedArray, 1);
- }
- } catch (e) {
- }
- }
- });
- return found;
- };
- var trySlices = function tryAllSlices(value) {
- var found = false;
- forEach(cache, function(getter, name) {
- if (!found) {
- try {
- getter(value);
- found = $slice(name, 1);
- } catch (e) {
- }
- }
- });
- return found;
- };
- module3.exports = function whichTypedArray(value) {
- if (!value || typeof value !== "object") {
- return false;
- }
- if (!hasToStringTag) {
- var tag = $slice($toString(value), 8, -1);
- if ($indexOf(typedArrays, tag) > -1) {
- return tag;
- }
- if (tag !== "Object") {
- return false;
- }
- return trySlices(value);
- }
- if (!gOPD) {
- return null;
- }
- return tryTypedArrays(value);
- };
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "available-typed-arrays": 86, "call-bind": 93, "call-bind/callBound": 92, "for-each": 345, "gopd": 349, "has-tostringtag/shams": 353 }], 421: [function(require2, module3, exports3) {
- (function() {
- "use strict";
- exports3.stripBOM = function(str) {
- if (str[0] === "\uFEFF") {
- return str.substring(1);
- } else {
- return str;
- }
- };
- }).call(this);
- }, {}], 422: [function(require2, module3, exports3) {
- (function() {
- "use strict";
- var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty;
- builder = require2("xmlbuilder");
- defaults = require2("./defaults").defaults;
- requiresCDATA = function(entry) {
- return typeof entry === "string" && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0);
- };
- wrapCDATA = function(entry) {
- return "<![CDATA[" + escapeCDATA(entry) + "]]>";
- };
- escapeCDATA = function(entry) {
- return entry.replace("]]>", "]]]]><![CDATA[>");
- };
- exports3.Builder = function() {
- function Builder(opts) {
- var key, ref, value;
- this.options = {};
- ref = defaults["0.2"];
- for (key in ref) {
- if (!hasProp.call(ref, key))
- continue;
- value = ref[key];
- this.options[key] = value;
- }
- for (key in opts) {
- if (!hasProp.call(opts, key))
- continue;
- value = opts[key];
- this.options[key] = value;
- }
- }
- Builder.prototype.buildObject = function(rootObj) {
- var attrkey, charkey, render, rootElement, rootName;
- attrkey = this.options.attrkey;
- charkey = this.options.charkey;
- if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults["0.2"].rootName) {
- rootName = Object.keys(rootObj)[0];
- rootObj = rootObj[rootName];
- } else {
- rootName = this.options.rootName;
- }
- render = function(_this) {
- return function(element, obj) {
- var attr, child, entry, index, key, value;
- if (typeof obj !== "object") {
- if (_this.options.cdata && requiresCDATA(obj)) {
- element.raw(wrapCDATA(obj));
- } else {
- element.txt(obj);
- }
- } else if (Array.isArray(obj)) {
- for (index in obj) {
- if (!hasProp.call(obj, index))
- continue;
- child = obj[index];
- for (key in child) {
- entry = child[key];
- element = render(element.ele(key), entry).up();
- }
- }
- } else {
- for (key in obj) {
- if (!hasProp.call(obj, key))
- continue;
- child = obj[key];
- if (key === attrkey) {
- if (typeof child === "object") {
- for (attr in child) {
- value = child[attr];
- element = element.att(attr, value);
- }
- }
- } else if (key === charkey) {
- if (_this.options.cdata && requiresCDATA(child)) {
- element = element.raw(wrapCDATA(child));
- } else {
- element = element.txt(child);
- }
- } else if (Array.isArray(child)) {
- for (index in child) {
- if (!hasProp.call(child, index))
- continue;
- entry = child[index];
- if (typeof entry === "string") {
- if (_this.options.cdata && requiresCDATA(entry)) {
- element = element.ele(key).raw(wrapCDATA(entry)).up();
- } else {
- element = element.ele(key, entry).up();
- }
- } else {
- element = render(element.ele(key), entry).up();
- }
- }
- } else if (typeof child === "object") {
- element = render(element.ele(key), child).up();
- } else {
- if (typeof child === "string" && _this.options.cdata && requiresCDATA(child)) {
- element = element.ele(key).raw(wrapCDATA(child)).up();
- } else {
- if (child == null) {
- child = "";
- }
- element = element.ele(key, child.toString()).up();
- }
- }
- }
- }
- return element;
- };
- }(this);
- rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
- headless: this.options.headless,
- allowSurrogateChars: this.options.allowSurrogateChars
- });
- return render(rootElement, rootObj).end(this.options.renderOpts);
- };
- return Builder;
- }();
- }).call(this);
- }, { "./defaults": 423, "xmlbuilder": 459 }], 423: [function(require2, module3, exports3) {
- (function() {
- exports3.defaults = {
- "0.1": {
- explicitCharkey: false,
- trim: true,
- normalize: true,
- normalizeTags: false,
- attrkey: "@",
- charkey: "#",
- explicitArray: false,
- ignoreAttrs: false,
- mergeAttrs: false,
- explicitRoot: false,
- validator: null,
- xmlns: false,
- explicitChildren: false,
- childkey: "@@",
- charsAsChildren: false,
- includeWhiteChars: false,
- async: false,
- strict: true,
- attrNameProcessors: null,
- attrValueProcessors: null,
- tagNameProcessors: null,
- valueProcessors: null,
- emptyTag: ""
- },
- "0.2": {
- explicitCharkey: false,
- trim: false,
- normalize: false,
- normalizeTags: false,
- attrkey: "$",
- charkey: "_",
- explicitArray: true,
- ignoreAttrs: false,
- mergeAttrs: false,
- explicitRoot: true,
- validator: null,
- xmlns: false,
- explicitChildren: false,
- preserveChildrenOrder: false,
- childkey: "$$",
- charsAsChildren: false,
- includeWhiteChars: false,
- async: false,
- strict: true,
- attrNameProcessors: null,
- attrValueProcessors: null,
- tagNameProcessors: null,
- valueProcessors: null,
- rootName: "root",
- xmldec: {
- "version": "1.0",
- "encoding": "UTF-8",
- "standalone": true
- },
- doctype: null,
- renderOpts: {
- "pretty": true,
- "indent": " ",
- "newline": "\n"
- },
- headless: false,
- chunkSize: 1e4,
- emptyTag: "",
- cdata: false
- }
- };
- }).call(this);
- }, {}], 424: [function(require2, module3, exports3) {
- (function() {
- "use strict";
- var bom, defaults, defineProperty, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me) {
- return function() {
- return fn.apply(me, arguments);
- };
- }, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- sax = require2("sax");
- events = require2("events");
- bom = require2("./bom");
- processors = require2("./processors");
- setImmediate = require2("timers").setImmediate;
- defaults = require2("./defaults").defaults;
- isEmpty = function(thing) {
- return typeof thing === "object" && thing != null && Object.keys(thing).length === 0;
- };
- processItem = function(processors2, item, key) {
- var i, len, process;
- for (i = 0, len = processors2.length; i < len; i++) {
- process = processors2[i];
- item = process(item, key);
- }
- return item;
- };
- defineProperty = function(obj, key, value) {
- var descriptor;
- descriptor = /* @__PURE__ */ Object.create(null);
- descriptor.value = value;
- descriptor.writable = true;
- descriptor.enumerable = true;
- descriptor.configurable = true;
- return Object.defineProperty(obj, key, descriptor);
- };
- exports3.Parser = function(superClass) {
- extend(Parser, superClass);
- function Parser(opts) {
- this.parseStringPromise = bind(this.parseStringPromise, this);
- this.parseString = bind(this.parseString, this);
- this.reset = bind(this.reset, this);
- this.assignOrPush = bind(this.assignOrPush, this);
- this.processAsync = bind(this.processAsync, this);
- var key, ref, value;
- if (!(this instanceof exports3.Parser)) {
- return new exports3.Parser(opts);
- }
- this.options = {};
- ref = defaults["0.2"];
- for (key in ref) {
- if (!hasProp.call(ref, key))
- continue;
- value = ref[key];
- this.options[key] = value;
- }
- for (key in opts) {
- if (!hasProp.call(opts, key))
- continue;
- value = opts[key];
- this.options[key] = value;
- }
- if (this.options.xmlns) {
- this.options.xmlnskey = this.options.attrkey + "ns";
- }
- if (this.options.normalizeTags) {
- if (!this.options.tagNameProcessors) {
- this.options.tagNameProcessors = [];
- }
- this.options.tagNameProcessors.unshift(processors.normalize);
- }
- this.reset();
- }
- Parser.prototype.processAsync = function() {
- var chunk, err;
- try {
- if (this.remaining.length <= this.options.chunkSize) {
- chunk = this.remaining;
- this.remaining = "";
- this.saxParser = this.saxParser.write(chunk);
- return this.saxParser.close();
- } else {
- chunk = this.remaining.substr(0, this.options.chunkSize);
- this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
- this.saxParser = this.saxParser.write(chunk);
- return setImmediate(this.processAsync);
- }
- } catch (error1) {
- err = error1;
- if (!this.saxParser.errThrown) {
- this.saxParser.errThrown = true;
- return this.emit(err);
- }
- }
- };
- Parser.prototype.assignOrPush = function(obj, key, newValue) {
- if (!(key in obj)) {
- if (!this.options.explicitArray) {
- return defineProperty(obj, key, newValue);
- } else {
- return defineProperty(obj, key, [newValue]);
- }
- } else {
- if (!(obj[key] instanceof Array)) {
- defineProperty(obj, key, [obj[key]]);
- }
- return obj[key].push(newValue);
- }
- };
- Parser.prototype.reset = function() {
- var attrkey, charkey, ontext, stack;
- this.removeAllListeners();
- this.saxParser = sax.parser(this.options.strict, {
- trim: false,
- normalize: false,
- xmlns: this.options.xmlns
- });
- this.saxParser.errThrown = false;
- this.saxParser.onerror = function(_this) {
- return function(error) {
- _this.saxParser.resume();
- if (!_this.saxParser.errThrown) {
- _this.saxParser.errThrown = true;
- return _this.emit("error", error);
- }
- };
- }(this);
- this.saxParser.onend = function(_this) {
- return function() {
- if (!_this.saxParser.ended) {
- _this.saxParser.ended = true;
- return _this.emit("end", _this.resultObject);
- }
- };
- }(this);
- this.saxParser.ended = false;
- this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
- this.resultObject = null;
- stack = [];
- attrkey = this.options.attrkey;
- charkey = this.options.charkey;
- this.saxParser.onopentag = function(_this) {
- return function(node) {
- var key, newValue, obj, processedKey, ref;
- obj = {};
- obj[charkey] = "";
- if (!_this.options.ignoreAttrs) {
- ref = node.attributes;
- for (key in ref) {
- if (!hasProp.call(ref, key))
- continue;
- if (!(attrkey in obj) && !_this.options.mergeAttrs) {
- obj[attrkey] = {};
- }
- newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
- processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
- if (_this.options.mergeAttrs) {
- _this.assignOrPush(obj, processedKey, newValue);
- } else {
- defineProperty(obj[attrkey], processedKey, newValue);
- }
- }
- }
- obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
- if (_this.options.xmlns) {
- obj[_this.options.xmlnskey] = {
- uri: node.uri,
- local: node.local
- };
- }
- return stack.push(obj);
- };
- }(this);
- this.saxParser.onclosetag = function(_this) {
- return function() {
- var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
- obj = stack.pop();
- nodeName = obj["#name"];
- if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
- delete obj["#name"];
- }
- if (obj.cdata === true) {
- cdata = obj.cdata;
- delete obj.cdata;
- }
- s = stack[stack.length - 1];
- if (obj[charkey].match(/^\s*$/) && !cdata) {
- emptyStr = obj[charkey];
- delete obj[charkey];
- } else {
- if (_this.options.trim) {
- obj[charkey] = obj[charkey].trim();
- }
- if (_this.options.normalize) {
- obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
- }
- obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
- if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
- obj = obj[charkey];
- }
- }
- if (isEmpty(obj)) {
- if (typeof _this.options.emptyTag === "function") {
- obj = _this.options.emptyTag();
- } else {
- obj = _this.options.emptyTag !== "" ? _this.options.emptyTag : emptyStr;
- }
- }
- if (_this.options.validator != null) {
- xpath = "/" + function() {
- var i, len, results;
- results = [];
- for (i = 0, len = stack.length; i < len; i++) {
- node = stack[i];
- results.push(node["#name"]);
- }
- return results;
- }().concat(nodeName).join("/");
- (function() {
- var err;
- try {
- return obj = _this.options.validator(xpath, s && s[nodeName], obj);
- } catch (error1) {
- err = error1;
- return _this.emit("error", err);
- }
- })();
- }
- if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === "object") {
- if (!_this.options.preserveChildrenOrder) {
- node = {};
- if (_this.options.attrkey in obj) {
- node[_this.options.attrkey] = obj[_this.options.attrkey];
- delete obj[_this.options.attrkey];
- }
- if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
- node[_this.options.charkey] = obj[_this.options.charkey];
- delete obj[_this.options.charkey];
- }
- if (Object.getOwnPropertyNames(obj).length > 0) {
- node[_this.options.childkey] = obj;
- }
- obj = node;
- } else if (s) {
- s[_this.options.childkey] = s[_this.options.childkey] || [];
- objClone = {};
- for (key in obj) {
- if (!hasProp.call(obj, key))
- continue;
- defineProperty(objClone, key, obj[key]);
- }
- s[_this.options.childkey].push(objClone);
- delete obj["#name"];
- if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
- obj = obj[charkey];
- }
- }
- }
- if (stack.length > 0) {
- return _this.assignOrPush(s, nodeName, obj);
- } else {
- if (_this.options.explicitRoot) {
- old = obj;
- obj = {};
- defineProperty(obj, nodeName, old);
- }
- _this.resultObject = obj;
- _this.saxParser.ended = true;
- return _this.emit("end", _this.resultObject);
- }
- };
- }(this);
- ontext = function(_this) {
- return function(text) {
- var charChild, s;
- s = stack[stack.length - 1];
- if (s) {
- s[charkey] += text;
- if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, "").trim() !== "")) {
- s[_this.options.childkey] = s[_this.options.childkey] || [];
- charChild = {
- "#name": "__text__"
- };
- charChild[charkey] = text;
- if (_this.options.normalize) {
- charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
- }
- s[_this.options.childkey].push(charChild);
- }
- return s;
- }
- };
- }(this);
- this.saxParser.ontext = ontext;
- return this.saxParser.oncdata = function(_this) {
- return function(text) {
- var s;
- s = ontext(text);
- if (s) {
- return s.cdata = true;
- }
- };
- }(this);
- };
- Parser.prototype.parseString = function(str, cb) {
- var err;
- if (cb != null && typeof cb === "function") {
- this.on("end", function(result) {
- this.reset();
- return cb(null, result);
- });
- this.on("error", function(err2) {
- this.reset();
- return cb(err2);
- });
- }
- try {
- str = str.toString();
- if (str.trim() === "") {
- this.emit("end", null);
- return true;
- }
- str = bom.stripBOM(str);
- if (this.options.async) {
- this.remaining = str;
- setImmediate(this.processAsync);
- return this.saxParser;
- }
- return this.saxParser.write(str).close();
- } catch (error1) {
- err = error1;
- if (!(this.saxParser.errThrown || this.saxParser.ended)) {
- this.emit("error", err);
- return this.saxParser.errThrown = true;
- } else if (this.saxParser.ended) {
- throw err;
- }
- }
- };
- Parser.prototype.parseStringPromise = function(str) {
- return new Promise(function(_this) {
- return function(resolve, reject) {
- return _this.parseString(str, function(err, value) {
- if (err) {
- return reject(err);
- } else {
- return resolve(value);
- }
- });
- };
- }(this));
- };
- return Parser;
- }(events);
- exports3.parseString = function(str, a, b) {
- var cb, options, parser;
- if (b != null) {
- if (typeof b === "function") {
- cb = b;
- }
- if (typeof a === "object") {
- options = a;
- }
- } else {
- if (typeof a === "function") {
- cb = a;
- }
- options = {};
- }
- parser = new exports3.Parser(options);
- return parser.parseString(str, cb);
- };
- exports3.parseStringPromise = function(str, a) {
- var options, parser;
- if (typeof a === "object") {
- options = a;
- }
- parser = new exports3.Parser(options);
- return parser.parseStringPromise(str);
- };
- }).call(this);
- }, { "./bom": 421, "./defaults": 423, "./processors": 425, "events": 344, "sax": 397, "timers": 414 }], 425: [function(require2, module3, exports3) {
- (function() {
- "use strict";
- var prefixMatch;
- prefixMatch = new RegExp(/(?!xmlns)^.*:/);
- exports3.normalize = function(str) {
- return str.toLowerCase();
- };
- exports3.firstCharLowerCase = function(str) {
- return str.charAt(0).toLowerCase() + str.slice(1);
- };
- exports3.stripPrefix = function(str) {
- return str.replace(prefixMatch, "");
- };
- exports3.parseNumbers = function(str) {
- if (!isNaN(str)) {
- str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
- }
- return str;
- };
- exports3.parseBooleans = function(str) {
- if (/^(?:true|false)$/i.test(str)) {
- str = str.toLowerCase() === "true";
- }
- return str;
- };
- }).call(this);
- }, {}], 426: [function(require2, module3, exports3) {
- (function() {
- "use strict";
- var builder, defaults, parser, processors, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- defaults = require2("./defaults");
- builder = require2("./builder");
- parser = require2("./parser");
- processors = require2("./processors");
- exports3.defaults = defaults.defaults;
- exports3.processors = processors;
- exports3.ValidationError = function(superClass) {
- extend(ValidationError, superClass);
- function ValidationError(message) {
- this.message = message;
- }
- return ValidationError;
- }(Error);
- exports3.Builder = builder.Builder;
- exports3.Parser = parser.Parser;
- exports3.parseString = parser.parseString;
- exports3.parseStringPromise = parser.parseStringPromise;
- }).call(this);
- }, { "./builder": 422, "./defaults": 423, "./parser": 424, "./processors": 425 }], 427: [function(require2, module3, exports3) {
- (function() {
- module3.exports = {
- Disconnected: 1,
- Preceding: 2,
- Following: 4,
- Contains: 8,
- ContainedBy: 16,
- ImplementationSpecific: 32
- };
- }).call(this);
- }, {}], 428: [function(require2, module3, exports3) {
- (function() {
- module3.exports = {
- Element: 1,
- Attribute: 2,
- Text: 3,
- CData: 4,
- EntityReference: 5,
- EntityDeclaration: 6,
- ProcessingInstruction: 7,
- Comment: 8,
- Document: 9,
- DocType: 10,
- DocumentFragment: 11,
- NotationDeclaration: 12,
- Declaration: 201,
- Raw: 202,
- AttributeDeclaration: 203,
- ElementDeclaration: 204,
- Dummy: 205
- };
- }).call(this);
- }, {}], 429: [function(require2, module3, exports3) {
- (function() {
- var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty;
- assign = function() {
- var i, key, len, source, sources, target;
- target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- if (isFunction(Object.assign)) {
- Object.assign.apply(null, arguments);
- } else {
- for (i = 0, len = sources.length; i < len; i++) {
- source = sources[i];
- if (source != null) {
- for (key in source) {
- if (!hasProp.call(source, key))
- continue;
- target[key] = source[key];
- }
- }
- }
- }
- return target;
- };
- isFunction = function(val) {
- return !!val && Object.prototype.toString.call(val) === "[object Function]";
- };
- isObject = function(val) {
- var ref;
- return !!val && ((ref = typeof val) === "function" || ref === "object");
- };
- isArray = function(val) {
- if (isFunction(Array.isArray)) {
- return Array.isArray(val);
- } else {
- return Object.prototype.toString.call(val) === "[object Array]";
- }
- };
- isEmpty = function(val) {
- var key;
- if (isArray(val)) {
- return !val.length;
- } else {
- for (key in val) {
- if (!hasProp.call(val, key))
- continue;
- return false;
- }
- return true;
- }
- };
- isPlainObject = function(val) {
- var ctor, proto;
- return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object);
- };
- getValue = function(obj) {
- if (isFunction(obj.valueOf)) {
- return obj.valueOf();
- } else {
- return obj;
- }
- };
- module3.exports.assign = assign;
- module3.exports.isFunction = isFunction;
- module3.exports.isObject = isObject;
- module3.exports.isArray = isArray;
- module3.exports.isEmpty = isEmpty;
- module3.exports.isPlainObject = isPlainObject;
- module3.exports.getValue = getValue;
- }).call(this);
- }, {}], 430: [function(require2, module3, exports3) {
- (function() {
- module3.exports = {
- None: 0,
- OpenTag: 1,
- InsideTag: 2,
- CloseTag: 3
- };
- }).call(this);
- }, {}], 431: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLAttribute, XMLNode;
- NodeType = require2("./NodeType");
- XMLNode = require2("./XMLNode");
- module3.exports = XMLAttribute = function() {
- function XMLAttribute2(parent, name, value) {
- this.parent = parent;
- if (this.parent) {
- this.options = this.parent.options;
- this.stringify = this.parent.stringify;
- }
- if (name == null) {
- throw new Error("Missing attribute name. " + this.debugInfo(name));
- }
- this.name = this.stringify.name(name);
- this.value = this.stringify.attValue(value);
- this.type = NodeType.Attribute;
- this.isId = false;
- this.schemaTypeInfo = null;
- }
- Object.defineProperty(XMLAttribute2.prototype, "nodeType", {
- get: function() {
- return this.type;
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "ownerElement", {
- get: function() {
- return this.parent;
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "textContent", {
- get: function() {
- return this.value;
- },
- set: function(value) {
- return this.value = value || "";
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "namespaceURI", {
- get: function() {
- return "";
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "prefix", {
- get: function() {
- return "";
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "localName", {
- get: function() {
- return this.name;
- }
- });
- Object.defineProperty(XMLAttribute2.prototype, "specified", {
- get: function() {
- return true;
- }
- });
- XMLAttribute2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLAttribute2.prototype.toString = function(options) {
- return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
- };
- XMLAttribute2.prototype.debugInfo = function(name) {
- name = name || this.name;
- if (name == null) {
- return "parent: <" + this.parent.name + ">";
- } else {
- return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
- }
- };
- XMLAttribute2.prototype.isEqualNode = function(node) {
- if (node.namespaceURI !== this.namespaceURI) {
- return false;
- }
- if (node.prefix !== this.prefix) {
- return false;
- }
- if (node.localName !== this.localName) {
- return false;
- }
- if (node.value !== this.value) {
- return false;
- }
- return true;
- };
- return XMLAttribute2;
- }();
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 432: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLCData, XMLCharacterData, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLCharacterData = require2("./XMLCharacterData");
- module3.exports = XMLCData = function(superClass) {
- extend(XMLCData2, superClass);
- function XMLCData2(parent, text) {
- XMLCData2.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing CDATA text. " + this.debugInfo());
- }
- this.name = "#cdata-section";
- this.type = NodeType.CData;
- this.value = this.stringify.cdata(text);
- }
- XMLCData2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLCData2.prototype.toString = function(options) {
- return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
- };
- return XMLCData2;
- }(XMLCharacterData);
- }).call(this);
- }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 433: [function(require2, module3, exports3) {
- (function() {
- var XMLCharacterData, XMLNode, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLNode = require2("./XMLNode");
- module3.exports = XMLCharacterData = function(superClass) {
- extend(XMLCharacterData2, superClass);
- function XMLCharacterData2(parent) {
- XMLCharacterData2.__super__.constructor.call(this, parent);
- this.value = "";
- }
- Object.defineProperty(XMLCharacterData2.prototype, "data", {
- get: function() {
- return this.value;
- },
- set: function(value) {
- return this.value = value || "";
- }
- });
- Object.defineProperty(XMLCharacterData2.prototype, "length", {
- get: function() {
- return this.value.length;
- }
- });
- Object.defineProperty(XMLCharacterData2.prototype, "textContent", {
- get: function() {
- return this.value;
- },
- set: function(value) {
- return this.value = value || "";
- }
- });
- XMLCharacterData2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLCharacterData2.prototype.substringData = function(offset, count) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLCharacterData2.prototype.appendData = function(arg) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLCharacterData2.prototype.insertData = function(offset, arg) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLCharacterData2.prototype.deleteData = function(offset, count) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLCharacterData2.prototype.replaceData = function(offset, count, arg) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLCharacterData2.prototype.isEqualNode = function(node) {
- if (!XMLCharacterData2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
- return false;
- }
- if (node.data !== this.data) {
- return false;
- }
- return true;
- };
- return XMLCharacterData2;
- }(XMLNode);
- }).call(this);
- }, { "./XMLNode": 450 }], 434: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLCharacterData, XMLComment, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLCharacterData = require2("./XMLCharacterData");
- module3.exports = XMLComment = function(superClass) {
- extend(XMLComment2, superClass);
- function XMLComment2(parent, text) {
- XMLComment2.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing comment text. " + this.debugInfo());
- }
- this.name = "#comment";
- this.type = NodeType.Comment;
- this.value = this.stringify.comment(text);
- }
- XMLComment2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLComment2.prototype.toString = function(options) {
- return this.options.writer.comment(this, this.options.writer.filterOptions(options));
- };
- return XMLComment2;
- }(XMLCharacterData);
- }).call(this);
- }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 435: [function(require2, module3, exports3) {
- (function() {
- var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
- XMLDOMErrorHandler = require2("./XMLDOMErrorHandler");
- XMLDOMStringList = require2("./XMLDOMStringList");
- module3.exports = XMLDOMConfiguration = function() {
- function XMLDOMConfiguration2() {
- var clonedSelf;
- this.defaultParams = {
- "canonical-form": false,
- "cdata-sections": false,
- "comments": false,
- "datatype-normalization": false,
- "element-content-whitespace": true,
- "entities": true,
- "error-handler": new XMLDOMErrorHandler(),
- "infoset": true,
- "validate-if-schema": false,
- "namespaces": true,
- "namespace-declarations": true,
- "normalize-characters": false,
- "schema-location": "",
- "schema-type": "",
- "split-cdata-sections": true,
- "validate": false,
- "well-formed": true
- };
- this.params = clonedSelf = Object.create(this.defaultParams);
- }
- Object.defineProperty(XMLDOMConfiguration2.prototype, "parameterNames", {
- get: function() {
- return new XMLDOMStringList(Object.keys(this.defaultParams));
- }
- });
- XMLDOMConfiguration2.prototype.getParameter = function(name) {
- if (this.params.hasOwnProperty(name)) {
- return this.params[name];
- } else {
- return null;
- }
- };
- XMLDOMConfiguration2.prototype.canSetParameter = function(name, value) {
- return true;
- };
- XMLDOMConfiguration2.prototype.setParameter = function(name, value) {
- if (value != null) {
- return this.params[name] = value;
- } else {
- return delete this.params[name];
- }
- };
- return XMLDOMConfiguration2;
- }();
- }).call(this);
- }, { "./XMLDOMErrorHandler": 436, "./XMLDOMStringList": 438 }], 436: [function(require2, module3, exports3) {
- (function() {
- var XMLDOMErrorHandler;
- module3.exports = XMLDOMErrorHandler = function() {
- function XMLDOMErrorHandler2() {
- }
- XMLDOMErrorHandler2.prototype.handleError = function(error) {
- throw new Error(error);
- };
- return XMLDOMErrorHandler2;
- }();
- }).call(this);
- }, {}], 437: [function(require2, module3, exports3) {
- (function() {
- var XMLDOMImplementation;
- module3.exports = XMLDOMImplementation = function() {
- function XMLDOMImplementation2() {
- }
- XMLDOMImplementation2.prototype.hasFeature = function(feature, version) {
- return true;
- };
- XMLDOMImplementation2.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
- throw new Error("This DOM method is not implemented.");
- };
- XMLDOMImplementation2.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
- throw new Error("This DOM method is not implemented.");
- };
- XMLDOMImplementation2.prototype.createHTMLDocument = function(title) {
- throw new Error("This DOM method is not implemented.");
- };
- XMLDOMImplementation2.prototype.getFeature = function(feature, version) {
- throw new Error("This DOM method is not implemented.");
- };
- return XMLDOMImplementation2;
- }();
- }).call(this);
- }, {}], 438: [function(require2, module3, exports3) {
- (function() {
- var XMLDOMStringList;
- module3.exports = XMLDOMStringList = function() {
- function XMLDOMStringList2(arr) {
- this.arr = arr || [];
- }
- Object.defineProperty(XMLDOMStringList2.prototype, "length", {
- get: function() {
- return this.arr.length;
- }
- });
- XMLDOMStringList2.prototype.item = function(index) {
- return this.arr[index] || null;
- };
- XMLDOMStringList2.prototype.contains = function(str) {
- return this.arr.indexOf(str) !== -1;
- };
- return XMLDOMStringList2;
- }();
- }).call(this);
- }, {}], 439: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDTDAttList, XMLNode, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDTDAttList = function(superClass) {
- extend(XMLDTDAttList2, superClass);
- function XMLDTDAttList2(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- XMLDTDAttList2.__super__.constructor.call(this, parent);
- if (elementName == null) {
- throw new Error("Missing DTD element name. " + this.debugInfo());
- }
- if (attributeName == null) {
- throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
- }
- if (!attributeType) {
- throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
- }
- if (!defaultValueType) {
- throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
- }
- if (defaultValueType.indexOf("#") !== 0) {
- defaultValueType = "#" + defaultValueType;
- }
- if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
- throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
- }
- if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
- throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
- }
- this.elementName = this.stringify.name(elementName);
- this.type = NodeType.AttributeDeclaration;
- this.attributeName = this.stringify.name(attributeName);
- this.attributeType = this.stringify.dtdAttType(attributeType);
- if (defaultValue) {
- this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
- }
- this.defaultValueType = defaultValueType;
- }
- XMLDTDAttList2.prototype.toString = function(options) {
- return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
- };
- return XMLDTDAttList2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 440: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDTDElement, XMLNode, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDTDElement = function(superClass) {
- extend(XMLDTDElement2, superClass);
- function XMLDTDElement2(parent, name, value) {
- XMLDTDElement2.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing DTD element name. " + this.debugInfo());
- }
- if (!value) {
- value = "(#PCDATA)";
- }
- if (Array.isArray(value)) {
- value = "(" + value.join(",") + ")";
- }
- this.name = this.stringify.name(name);
- this.type = NodeType.ElementDeclaration;
- this.value = this.stringify.dtdElementValue(value);
- }
- XMLDTDElement2.prototype.toString = function(options) {
- return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
- };
- return XMLDTDElement2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 441: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDTDEntity, XMLNode, isObject, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- isObject = require2("./Utility").isObject;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDTDEntity = function(superClass) {
- extend(XMLDTDEntity2, superClass);
- function XMLDTDEntity2(parent, pe, name, value) {
- XMLDTDEntity2.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing DTD entity name. " + this.debugInfo(name));
- }
- if (value == null) {
- throw new Error("Missing DTD entity value. " + this.debugInfo(name));
- }
- this.pe = !!pe;
- this.name = this.stringify.name(name);
- this.type = NodeType.EntityDeclaration;
- if (!isObject(value)) {
- this.value = this.stringify.dtdEntityValue(value);
- this.internal = true;
- } else {
- if (!value.pubID && !value.sysID) {
- throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name));
- }
- if (value.pubID && !value.sysID) {
- throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name));
- }
- this.internal = false;
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- if (value.nData != null) {
- this.nData = this.stringify.dtdNData(value.nData);
- }
- if (this.pe && this.nData) {
- throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name));
- }
- }
- }
- Object.defineProperty(XMLDTDEntity2.prototype, "publicId", {
- get: function() {
- return this.pubID;
- }
- });
- Object.defineProperty(XMLDTDEntity2.prototype, "systemId", {
- get: function() {
- return this.sysID;
- }
- });
- Object.defineProperty(XMLDTDEntity2.prototype, "notationName", {
- get: function() {
- return this.nData || null;
- }
- });
- Object.defineProperty(XMLDTDEntity2.prototype, "inputEncoding", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDTDEntity2.prototype, "xmlEncoding", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDTDEntity2.prototype, "xmlVersion", {
- get: function() {
- return null;
- }
- });
- XMLDTDEntity2.prototype.toString = function(options) {
- return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
- };
- return XMLDTDEntity2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./XMLNode": 450 }], 442: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDTDNotation, XMLNode, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDTDNotation = function(superClass) {
- extend(XMLDTDNotation2, superClass);
- function XMLDTDNotation2(parent, name, value) {
- XMLDTDNotation2.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing DTD notation name. " + this.debugInfo(name));
- }
- if (!value.pubID && !value.sysID) {
- throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
- }
- this.name = this.stringify.name(name);
- this.type = NodeType.NotationDeclaration;
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- }
- Object.defineProperty(XMLDTDNotation2.prototype, "publicId", {
- get: function() {
- return this.pubID;
- }
- });
- Object.defineProperty(XMLDTDNotation2.prototype, "systemId", {
- get: function() {
- return this.sysID;
- }
- });
- XMLDTDNotation2.prototype.toString = function(options) {
- return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
- };
- return XMLDTDNotation2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 443: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDeclaration, XMLNode, isObject, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- isObject = require2("./Utility").isObject;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDeclaration = function(superClass) {
- extend(XMLDeclaration2, superClass);
- function XMLDeclaration2(parent, version, encoding, standalone) {
- var ref;
- XMLDeclaration2.__super__.constructor.call(this, parent);
- if (isObject(version)) {
- ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
- }
- if (!version) {
- version = "1.0";
- }
- this.type = NodeType.Declaration;
- this.version = this.stringify.xmlVersion(version);
- if (encoding != null) {
- this.encoding = this.stringify.xmlEncoding(encoding);
- }
- if (standalone != null) {
- this.standalone = this.stringify.xmlStandalone(standalone);
- }
- }
- XMLDeclaration2.prototype.toString = function(options) {
- return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
- };
- return XMLDeclaration2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./XMLNode": 450 }], 444: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- isObject = require2("./Utility").isObject;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- XMLDTDAttList = require2("./XMLDTDAttList");
- XMLDTDEntity = require2("./XMLDTDEntity");
- XMLDTDElement = require2("./XMLDTDElement");
- XMLDTDNotation = require2("./XMLDTDNotation");
- XMLNamedNodeMap = require2("./XMLNamedNodeMap");
- module3.exports = XMLDocType = function(superClass) {
- extend(XMLDocType2, superClass);
- function XMLDocType2(parent, pubID, sysID) {
- var child, i, len, ref, ref1, ref2;
- XMLDocType2.__super__.constructor.call(this, parent);
- this.type = NodeType.DocType;
- if (parent.children) {
- ref = parent.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- if (child.type === NodeType.Element) {
- this.name = child.name;
- break;
- }
- }
- }
- this.documentObject = parent;
- if (isObject(pubID)) {
- ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;
- }
- if (sysID == null) {
- ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];
- }
- if (pubID != null) {
- this.pubID = this.stringify.dtdPubID(pubID);
- }
- if (sysID != null) {
- this.sysID = this.stringify.dtdSysID(sysID);
- }
- }
- Object.defineProperty(XMLDocType2.prototype, "entities", {
- get: function() {
- var child, i, len, nodes, ref;
- nodes = {};
- ref = this.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- if (child.type === NodeType.EntityDeclaration && !child.pe) {
- nodes[child.name] = child;
- }
- }
- return new XMLNamedNodeMap(nodes);
- }
- });
- Object.defineProperty(XMLDocType2.prototype, "notations", {
- get: function() {
- var child, i, len, nodes, ref;
- nodes = {};
- ref = this.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- if (child.type === NodeType.NotationDeclaration) {
- nodes[child.name] = child;
- }
- }
- return new XMLNamedNodeMap(nodes);
- }
- });
- Object.defineProperty(XMLDocType2.prototype, "publicId", {
- get: function() {
- return this.pubID;
- }
- });
- Object.defineProperty(XMLDocType2.prototype, "systemId", {
- get: function() {
- return this.sysID;
- }
- });
- Object.defineProperty(XMLDocType2.prototype, "internalSubset", {
- get: function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- XMLDocType2.prototype.element = function(name, value) {
- var child;
- child = new XMLDTDElement(this, name, value);
- this.children.push(child);
- return this;
- };
- XMLDocType2.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- var child;
- child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
- this.children.push(child);
- return this;
- };
- XMLDocType2.prototype.entity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, false, name, value);
- this.children.push(child);
- return this;
- };
- XMLDocType2.prototype.pEntity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, true, name, value);
- this.children.push(child);
- return this;
- };
- XMLDocType2.prototype.notation = function(name, value) {
- var child;
- child = new XMLDTDNotation(this, name, value);
- this.children.push(child);
- return this;
- };
- XMLDocType2.prototype.toString = function(options) {
- return this.options.writer.docType(this, this.options.writer.filterOptions(options));
- };
- XMLDocType2.prototype.ele = function(name, value) {
- return this.element(name, value);
- };
- XMLDocType2.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
- };
- XMLDocType2.prototype.ent = function(name, value) {
- return this.entity(name, value);
- };
- XMLDocType2.prototype.pent = function(name, value) {
- return this.pEntity(name, value);
- };
- XMLDocType2.prototype.not = function(name, value) {
- return this.notation(name, value);
- };
- XMLDocType2.prototype.up = function() {
- return this.root() || this.documentObject;
- };
- XMLDocType2.prototype.isEqualNode = function(node) {
- if (!XMLDocType2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
- return false;
- }
- if (node.name !== this.name) {
- return false;
- }
- if (node.publicId !== this.publicId) {
- return false;
- }
- if (node.systemId !== this.systemId) {
- return false;
- }
- return true;
- };
- return XMLDocType2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLNamedNodeMap": 449, "./XMLNode": 450 }], 445: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- isPlainObject = require2("./Utility").isPlainObject;
- XMLDOMImplementation = require2("./XMLDOMImplementation");
- XMLDOMConfiguration = require2("./XMLDOMConfiguration");
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- XMLStringifier = require2("./XMLStringifier");
- XMLStringWriter = require2("./XMLStringWriter");
- module3.exports = XMLDocument = function(superClass) {
- extend(XMLDocument2, superClass);
- function XMLDocument2(options) {
- XMLDocument2.__super__.constructor.call(this, null);
- this.name = "#document";
- this.type = NodeType.Document;
- this.documentURI = null;
- this.domConfig = new XMLDOMConfiguration();
- options || (options = {});
- if (!options.writer) {
- options.writer = new XMLStringWriter();
- }
- this.options = options;
- this.stringify = new XMLStringifier(options);
- }
- Object.defineProperty(XMLDocument2.prototype, "implementation", {
- value: new XMLDOMImplementation()
- });
- Object.defineProperty(XMLDocument2.prototype, "doctype", {
- get: function() {
- var child, i, len, ref;
- ref = this.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- if (child.type === NodeType.DocType) {
- return child;
- }
- }
- return null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "documentElement", {
- get: function() {
- return this.rootObject || null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "inputEncoding", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "strictErrorChecking", {
- get: function() {
- return false;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "xmlEncoding", {
- get: function() {
- if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
- return this.children[0].encoding;
- } else {
- return null;
- }
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "xmlStandalone", {
- get: function() {
- if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
- return this.children[0].standalone === "yes";
- } else {
- return false;
- }
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "xmlVersion", {
- get: function() {
- if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
- return this.children[0].version;
- } else {
- return "1.0";
- }
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "URL", {
- get: function() {
- return this.documentURI;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "origin", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "compatMode", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "characterSet", {
- get: function() {
- return null;
- }
- });
- Object.defineProperty(XMLDocument2.prototype, "contentType", {
- get: function() {
- return null;
- }
- });
- XMLDocument2.prototype.end = function(writer) {
- var writerOptions;
- writerOptions = {};
- if (!writer) {
- writer = this.options.writer;
- } else if (isPlainObject(writer)) {
- writerOptions = writer;
- writer = this.options.writer;
- }
- return writer.document(this, writer.filterOptions(writerOptions));
- };
- XMLDocument2.prototype.toString = function(options) {
- return this.options.writer.document(this, this.options.writer.filterOptions(options));
- };
- XMLDocument2.prototype.createElement = function(tagName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createDocumentFragment = function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createTextNode = function(data) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createComment = function(data) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createCDATASection = function(data) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createProcessingInstruction = function(target, data) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createAttribute = function(name) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createEntityReference = function(name) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.getElementsByTagName = function(tagname) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.importNode = function(importedNode, deep) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createElementNS = function(namespaceURI, qualifiedName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.getElementById = function(elementId) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.adoptNode = function(source) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.normalizeDocument = function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.getElementsByClassName = function(classNames) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createEvent = function(eventInterface) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createRange = function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createNodeIterator = function(root, whatToShow, filter) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLDocument2.prototype.createTreeWalker = function(root, whatToShow, filter) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- return XMLDocument2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./XMLDOMConfiguration": 435, "./XMLDOMImplementation": 437, "./XMLNode": 450, "./XMLStringWriter": 455, "./XMLStringifier": 456 }], 446: [function(require2, module3, exports3) {
- (function() {
- var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty;
- ref = require2("./Utility"), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
- NodeType = require2("./NodeType");
- XMLDocument = require2("./XMLDocument");
- XMLElement = require2("./XMLElement");
- XMLCData = require2("./XMLCData");
- XMLComment = require2("./XMLComment");
- XMLRaw = require2("./XMLRaw");
- XMLText = require2("./XMLText");
- XMLProcessingInstruction = require2("./XMLProcessingInstruction");
- XMLDeclaration = require2("./XMLDeclaration");
- XMLDocType = require2("./XMLDocType");
- XMLDTDAttList = require2("./XMLDTDAttList");
- XMLDTDEntity = require2("./XMLDTDEntity");
- XMLDTDElement = require2("./XMLDTDElement");
- XMLDTDNotation = require2("./XMLDTDNotation");
- XMLAttribute = require2("./XMLAttribute");
- XMLStringifier = require2("./XMLStringifier");
- XMLStringWriter = require2("./XMLStringWriter");
- WriterState = require2("./WriterState");
- module3.exports = XMLDocumentCB = function() {
- function XMLDocumentCB2(options, onData, onEnd) {
- var writerOptions;
- this.name = "?xml";
- this.type = NodeType.Document;
- options || (options = {});
- writerOptions = {};
- if (!options.writer) {
- options.writer = new XMLStringWriter();
- } else if (isPlainObject(options.writer)) {
- writerOptions = options.writer;
- options.writer = new XMLStringWriter();
- }
- this.options = options;
- this.writer = options.writer;
- this.writerOptions = this.writer.filterOptions(writerOptions);
- this.stringify = new XMLStringifier(options);
- this.onDataCallback = onData || function() {
- };
- this.onEndCallback = onEnd || function() {
- };
- this.currentNode = null;
- this.currentLevel = -1;
- this.openTags = {};
- this.documentStarted = false;
- this.documentCompleted = false;
- this.root = null;
- }
- XMLDocumentCB2.prototype.createChildNode = function(node) {
- var att, attName, attributes, child, i, len, ref1, ref2;
- switch (node.type) {
- case NodeType.CData:
- this.cdata(node.value);
- break;
- case NodeType.Comment:
- this.comment(node.value);
- break;
- case NodeType.Element:
- attributes = {};
- ref1 = node.attribs;
- for (attName in ref1) {
- if (!hasProp.call(ref1, attName))
- continue;
- att = ref1[attName];
- attributes[attName] = att.value;
- }
- this.node(node.name, attributes);
- break;
- case NodeType.Dummy:
- this.dummy();
- break;
- case NodeType.Raw:
- this.raw(node.value);
- break;
- case NodeType.Text:
- this.text(node.value);
- break;
- case NodeType.ProcessingInstruction:
- this.instruction(node.target, node.value);
- break;
- default:
- throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
- }
- ref2 = node.children;
- for (i = 0, len = ref2.length; i < len; i++) {
- child = ref2[i];
- this.createChildNode(child);
- if (child.type === NodeType.Element) {
- this.up();
- }
- }
- return this;
- };
- XMLDocumentCB2.prototype.dummy = function() {
- return this;
- };
- XMLDocumentCB2.prototype.node = function(name, attributes, text) {
- var ref1;
- if (name == null) {
- throw new Error("Missing node name.");
- }
- if (this.root && this.currentLevel === -1) {
- throw new Error("Document can only have one root node. " + this.debugInfo(name));
- }
- this.openCurrent();
- name = getValue(name);
- if (attributes == null) {
- attributes = {};
- }
- attributes = getValue(attributes);
- if (!isObject(attributes)) {
- ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
- }
- this.currentNode = new XMLElement(this, name, attributes);
- this.currentNode.children = false;
- this.currentLevel++;
- this.openTags[this.currentLevel] = this.currentNode;
- if (text != null) {
- this.text(text);
- }
- return this;
- };
- XMLDocumentCB2.prototype.element = function(name, attributes, text) {
- var child, i, len, oldValidationFlag, ref1, root;
- if (this.currentNode && this.currentNode.type === NodeType.DocType) {
- this.dtdElement.apply(this, arguments);
- } else {
- if (Array.isArray(name) || isObject(name) || isFunction(name)) {
- oldValidationFlag = this.options.noValidation;
- this.options.noValidation = true;
- root = new XMLDocument(this.options).element("TEMP_ROOT");
- root.element(name);
- this.options.noValidation = oldValidationFlag;
- ref1 = root.children;
- for (i = 0, len = ref1.length; i < len; i++) {
- child = ref1[i];
- this.createChildNode(child);
- if (child.type === NodeType.Element) {
- this.up();
- }
- }
- } else {
- this.node(name, attributes, text);
- }
- }
- return this;
- };
- XMLDocumentCB2.prototype.attribute = function(name, value) {
- var attName, attValue;
- if (!this.currentNode || this.currentNode.children) {
- throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
- }
- if (name != null) {
- name = getValue(name);
- }
- if (isObject(name)) {
- for (attName in name) {
- if (!hasProp.call(name, attName))
- continue;
- attValue = name[attName];
- this.attribute(attName, attValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- if (this.options.keepNullAttributes && value == null) {
- this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
- } else if (value != null) {
- this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
- }
- }
- return this;
- };
- XMLDocumentCB2.prototype.text = function(value) {
- var node;
- this.openCurrent();
- node = new XMLText(this, value);
- this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.cdata = function(value) {
- var node;
- this.openCurrent();
- node = new XMLCData(this, value);
- this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.comment = function(value) {
- var node;
- this.openCurrent();
- node = new XMLComment(this, value);
- this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.raw = function(value) {
- var node;
- this.openCurrent();
- node = new XMLRaw(this, value);
- this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.instruction = function(target, value) {
- var i, insTarget, insValue, len, node;
- this.openCurrent();
- if (target != null) {
- target = getValue(target);
- }
- if (value != null) {
- value = getValue(value);
- }
- if (Array.isArray(target)) {
- for (i = 0, len = target.length; i < len; i++) {
- insTarget = target[i];
- this.instruction(insTarget);
- }
- } else if (isObject(target)) {
- for (insTarget in target) {
- if (!hasProp.call(target, insTarget))
- continue;
- insValue = target[insTarget];
- this.instruction(insTarget, insValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- node = new XMLProcessingInstruction(this, target, value);
- this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- }
- return this;
- };
- XMLDocumentCB2.prototype.declaration = function(version, encoding, standalone) {
- var node;
- this.openCurrent();
- if (this.documentStarted) {
- throw new Error("declaration() must be the first node.");
- }
- node = new XMLDeclaration(this, version, encoding, standalone);
- this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.doctype = function(root, pubID, sysID) {
- this.openCurrent();
- if (root == null) {
- throw new Error("Missing root node name.");
- }
- if (this.root) {
- throw new Error("dtd() must come before the root node.");
- }
- this.currentNode = new XMLDocType(this, pubID, sysID);
- this.currentNode.rootNodeName = root;
- this.currentNode.children = false;
- this.currentLevel++;
- this.openTags[this.currentLevel] = this.currentNode;
- return this;
- };
- XMLDocumentCB2.prototype.dtdElement = function(name, value) {
- var node;
- this.openCurrent();
- node = new XMLDTDElement(this, name, value);
- this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- var node;
- this.openCurrent();
- node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
- this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.entity = function(name, value) {
- var node;
- this.openCurrent();
- node = new XMLDTDEntity(this, false, name, value);
- this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.pEntity = function(name, value) {
- var node;
- this.openCurrent();
- node = new XMLDTDEntity(this, true, name, value);
- this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.notation = function(name, value) {
- var node;
- this.openCurrent();
- node = new XMLDTDNotation(this, name, value);
- this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
- return this;
- };
- XMLDocumentCB2.prototype.up = function() {
- if (this.currentLevel < 0) {
- throw new Error("The document node has no parent.");
- }
- if (this.currentNode) {
- if (this.currentNode.children) {
- this.closeNode(this.currentNode);
- } else {
- this.openNode(this.currentNode);
- }
- this.currentNode = null;
- } else {
- this.closeNode(this.openTags[this.currentLevel]);
- }
- delete this.openTags[this.currentLevel];
- this.currentLevel--;
- return this;
- };
- XMLDocumentCB2.prototype.end = function() {
- while (this.currentLevel >= 0) {
- this.up();
- }
- return this.onEnd();
- };
- XMLDocumentCB2.prototype.openCurrent = function() {
- if (this.currentNode) {
- this.currentNode.children = true;
- return this.openNode(this.currentNode);
- }
- };
- XMLDocumentCB2.prototype.openNode = function(node) {
- var att, chunk, name, ref1;
- if (!node.isOpen) {
- if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
- this.root = node;
- }
- chunk = "";
- if (node.type === NodeType.Element) {
- this.writerOptions.state = WriterState.OpenTag;
- chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name;
- ref1 = node.attribs;
- for (name in ref1) {
- if (!hasProp.call(ref1, name))
- continue;
- att = ref1[name];
- chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
- }
- chunk += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel);
- this.writerOptions.state = WriterState.InsideTag;
- } else {
- this.writerOptions.state = WriterState.OpenTag;
- chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<!DOCTYPE " + node.rootNodeName;
- if (node.pubID && node.sysID) {
- chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
- } else if (node.sysID) {
- chunk += ' SYSTEM "' + node.sysID + '"';
- }
- if (node.children) {
- chunk += " [";
- this.writerOptions.state = WriterState.InsideTag;
- } else {
- this.writerOptions.state = WriterState.CloseTag;
- chunk += ">";
- }
- chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
- }
- this.onData(chunk, this.currentLevel);
- return node.isOpen = true;
- }
- };
- XMLDocumentCB2.prototype.closeNode = function(node) {
- var chunk;
- if (!node.isClosed) {
- chunk = "";
- this.writerOptions.state = WriterState.CloseTag;
- if (node.type === NodeType.Element) {
- chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "</" + node.name + ">" + this.writer.endline(node, this.writerOptions, this.currentLevel);
- } else {
- chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel);
- }
- this.writerOptions.state = WriterState.None;
- this.onData(chunk, this.currentLevel);
- return node.isClosed = true;
- }
- };
- XMLDocumentCB2.prototype.onData = function(chunk, level) {
- this.documentStarted = true;
- return this.onDataCallback(chunk, level + 1);
- };
- XMLDocumentCB2.prototype.onEnd = function() {
- this.documentCompleted = true;
- return this.onEndCallback();
- };
- XMLDocumentCB2.prototype.debugInfo = function(name) {
- if (name == null) {
- return "";
- } else {
- return "node: <" + name + ">";
- }
- };
- XMLDocumentCB2.prototype.ele = function() {
- return this.element.apply(this, arguments);
- };
- XMLDocumentCB2.prototype.nod = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
- XMLDocumentCB2.prototype.txt = function(value) {
- return this.text(value);
- };
- XMLDocumentCB2.prototype.dat = function(value) {
- return this.cdata(value);
- };
- XMLDocumentCB2.prototype.com = function(value) {
- return this.comment(value);
- };
- XMLDocumentCB2.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
- XMLDocumentCB2.prototype.dec = function(version, encoding, standalone) {
- return this.declaration(version, encoding, standalone);
- };
- XMLDocumentCB2.prototype.dtd = function(root, pubID, sysID) {
- return this.doctype(root, pubID, sysID);
- };
- XMLDocumentCB2.prototype.e = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
- XMLDocumentCB2.prototype.n = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
- XMLDocumentCB2.prototype.t = function(value) {
- return this.text(value);
- };
- XMLDocumentCB2.prototype.d = function(value) {
- return this.cdata(value);
- };
- XMLDocumentCB2.prototype.c = function(value) {
- return this.comment(value);
- };
- XMLDocumentCB2.prototype.r = function(value) {
- return this.raw(value);
- };
- XMLDocumentCB2.prototype.i = function(target, value) {
- return this.instruction(target, value);
- };
- XMLDocumentCB2.prototype.att = function() {
- if (this.currentNode && this.currentNode.type === NodeType.DocType) {
- return this.attList.apply(this, arguments);
- } else {
- return this.attribute.apply(this, arguments);
- }
- };
- XMLDocumentCB2.prototype.a = function() {
- if (this.currentNode && this.currentNode.type === NodeType.DocType) {
- return this.attList.apply(this, arguments);
- } else {
- return this.attribute.apply(this, arguments);
- }
- };
- XMLDocumentCB2.prototype.ent = function(name, value) {
- return this.entity(name, value);
- };
- XMLDocumentCB2.prototype.pent = function(name, value) {
- return this.pEntity(name, value);
- };
- XMLDocumentCB2.prototype.not = function(name, value) {
- return this.notation(name, value);
- };
- return XMLDocumentCB2;
- }();
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLAttribute": 431, "./XMLCData": 432, "./XMLComment": 434, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDocument": 445, "./XMLElement": 448, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLStringWriter": 455, "./XMLStringifier": 456, "./XMLText": 457 }], 447: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLDummy, XMLNode, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- module3.exports = XMLDummy = function(superClass) {
- extend(XMLDummy2, superClass);
- function XMLDummy2(parent) {
- XMLDummy2.__super__.constructor.call(this, parent);
- this.type = NodeType.Dummy;
- }
- XMLDummy2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLDummy2.prototype.toString = function(options) {
- return "";
- };
- return XMLDummy2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 448: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- ref = require2("./Utility"), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
- XMLNode = require2("./XMLNode");
- NodeType = require2("./NodeType");
- XMLAttribute = require2("./XMLAttribute");
- XMLNamedNodeMap = require2("./XMLNamedNodeMap");
- module3.exports = XMLElement = function(superClass) {
- extend(XMLElement2, superClass);
- function XMLElement2(parent, name, attributes) {
- var child, j, len, ref1;
- XMLElement2.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing element name. " + this.debugInfo());
- }
- this.name = this.stringify.name(name);
- this.type = NodeType.Element;
- this.attribs = {};
- this.schemaTypeInfo = null;
- if (attributes != null) {
- this.attribute(attributes);
- }
- if (parent.type === NodeType.Document) {
- this.isRoot = true;
- this.documentObject = parent;
- parent.rootObject = this;
- if (parent.children) {
- ref1 = parent.children;
- for (j = 0, len = ref1.length; j < len; j++) {
- child = ref1[j];
- if (child.type === NodeType.DocType) {
- child.name = this.name;
- break;
- }
- }
- }
- }
- }
- Object.defineProperty(XMLElement2.prototype, "tagName", {
- get: function() {
- return this.name;
- }
- });
- Object.defineProperty(XMLElement2.prototype, "namespaceURI", {
- get: function() {
- return "";
- }
- });
- Object.defineProperty(XMLElement2.prototype, "prefix", {
- get: function() {
- return "";
- }
- });
- Object.defineProperty(XMLElement2.prototype, "localName", {
- get: function() {
- return this.name;
- }
- });
- Object.defineProperty(XMLElement2.prototype, "id", {
- get: function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- Object.defineProperty(XMLElement2.prototype, "className", {
- get: function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- Object.defineProperty(XMLElement2.prototype, "classList", {
- get: function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- Object.defineProperty(XMLElement2.prototype, "attributes", {
- get: function() {
- if (!this.attributeMap || !this.attributeMap.nodes) {
- this.attributeMap = new XMLNamedNodeMap(this.attribs);
- }
- return this.attributeMap;
- }
- });
- XMLElement2.prototype.clone = function() {
- var att, attName, clonedSelf, ref1;
- clonedSelf = Object.create(this);
- if (clonedSelf.isRoot) {
- clonedSelf.documentObject = null;
- }
- clonedSelf.attribs = {};
- ref1 = this.attribs;
- for (attName in ref1) {
- if (!hasProp.call(ref1, attName))
- continue;
- att = ref1[attName];
- clonedSelf.attribs[attName] = att.clone();
- }
- clonedSelf.children = [];
- this.children.forEach(function(child) {
- var clonedChild;
- clonedChild = child.clone();
- clonedChild.parent = clonedSelf;
- return clonedSelf.children.push(clonedChild);
- });
- return clonedSelf;
- };
- XMLElement2.prototype.attribute = function(name, value) {
- var attName, attValue;
- if (name != null) {
- name = getValue(name);
- }
- if (isObject(name)) {
- for (attName in name) {
- if (!hasProp.call(name, attName))
- continue;
- attValue = name[attName];
- this.attribute(attName, attValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- if (this.options.keepNullAttributes && value == null) {
- this.attribs[name] = new XMLAttribute(this, name, "");
- } else if (value != null) {
- this.attribs[name] = new XMLAttribute(this, name, value);
- }
- }
- return this;
- };
- XMLElement2.prototype.removeAttribute = function(name) {
- var attName, j, len;
- if (name == null) {
- throw new Error("Missing attribute name. " + this.debugInfo());
- }
- name = getValue(name);
- if (Array.isArray(name)) {
- for (j = 0, len = name.length; j < len; j++) {
- attName = name[j];
- delete this.attribs[attName];
- }
- } else {
- delete this.attribs[name];
- }
- return this;
- };
- XMLElement2.prototype.toString = function(options) {
- return this.options.writer.element(this, this.options.writer.filterOptions(options));
- };
- XMLElement2.prototype.att = function(name, value) {
- return this.attribute(name, value);
- };
- XMLElement2.prototype.a = function(name, value) {
- return this.attribute(name, value);
- };
- XMLElement2.prototype.getAttribute = function(name) {
- if (this.attribs.hasOwnProperty(name)) {
- return this.attribs[name].value;
- } else {
- return null;
- }
- };
- XMLElement2.prototype.setAttribute = function(name, value) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getAttributeNode = function(name) {
- if (this.attribs.hasOwnProperty(name)) {
- return this.attribs[name];
- } else {
- return null;
- }
- };
- XMLElement2.prototype.setAttributeNode = function(newAttr) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.removeAttributeNode = function(oldAttr) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getElementsByTagName = function(name) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getAttributeNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.removeAttributeNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.setAttributeNodeNS = function(newAttr) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.hasAttribute = function(name) {
- return this.attribs.hasOwnProperty(name);
- };
- XMLElement2.prototype.hasAttributeNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.setIdAttribute = function(name, isId) {
- if (this.attribs.hasOwnProperty(name)) {
- return this.attribs[name].isId;
- } else {
- return isId;
- }
- };
- XMLElement2.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.setIdAttributeNode = function(idAttr, isId) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getElementsByTagName = function(tagname) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.getElementsByClassName = function(classNames) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLElement2.prototype.isEqualNode = function(node) {
- var i, j, ref1;
- if (!XMLElement2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
- return false;
- }
- if (node.namespaceURI !== this.namespaceURI) {
- return false;
- }
- if (node.prefix !== this.prefix) {
- return false;
- }
- if (node.localName !== this.localName) {
- return false;
- }
- if (node.attribs.length !== this.attribs.length) {
- return false;
- }
- for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {
- if (!this.attribs[i].isEqualNode(node.attribs[i])) {
- return false;
- }
- }
- return true;
- };
- return XMLElement2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./XMLAttribute": 431, "./XMLNamedNodeMap": 449, "./XMLNode": 450 }], 449: [function(require2, module3, exports3) {
- (function() {
- var XMLNamedNodeMap;
- module3.exports = XMLNamedNodeMap = function() {
- function XMLNamedNodeMap2(nodes) {
- this.nodes = nodes;
- }
- Object.defineProperty(XMLNamedNodeMap2.prototype, "length", {
- get: function() {
- return Object.keys(this.nodes).length || 0;
- }
- });
- XMLNamedNodeMap2.prototype.clone = function() {
- return this.nodes = null;
- };
- XMLNamedNodeMap2.prototype.getNamedItem = function(name) {
- return this.nodes[name];
- };
- XMLNamedNodeMap2.prototype.setNamedItem = function(node) {
- var oldNode;
- oldNode = this.nodes[node.nodeName];
- this.nodes[node.nodeName] = node;
- return oldNode || null;
- };
- XMLNamedNodeMap2.prototype.removeNamedItem = function(name) {
- var oldNode;
- oldNode = this.nodes[name];
- delete this.nodes[name];
- return oldNode || null;
- };
- XMLNamedNodeMap2.prototype.item = function(index) {
- return this.nodes[Object.keys(this.nodes)[index]] || null;
- };
- XMLNamedNodeMap2.prototype.getNamedItemNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented.");
- };
- XMLNamedNodeMap2.prototype.setNamedItemNS = function(node) {
- throw new Error("This DOM method is not implemented.");
- };
- XMLNamedNodeMap2.prototype.removeNamedItemNS = function(namespaceURI, localName) {
- throw new Error("This DOM method is not implemented.");
- };
- return XMLNamedNodeMap2;
- }();
- }).call(this);
- }, {}], 450: [function(require2, module3, exports3) {
- (function() {
- var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, hasProp = {}.hasOwnProperty;
- ref1 = require2("./Utility"), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
- XMLElement = null;
- XMLCData = null;
- XMLComment = null;
- XMLDeclaration = null;
- XMLDocType = null;
- XMLRaw = null;
- XMLText = null;
- XMLProcessingInstruction = null;
- XMLDummy = null;
- NodeType = null;
- XMLNodeList = null;
- XMLNamedNodeMap = null;
- DocumentPosition = null;
- module3.exports = XMLNode = function() {
- function XMLNode2(parent1) {
- this.parent = parent1;
- if (this.parent) {
- this.options = this.parent.options;
- this.stringify = this.parent.stringify;
- }
- this.value = null;
- this.children = [];
- this.baseURI = null;
- if (!XMLElement) {
- XMLElement = require2("./XMLElement");
- XMLCData = require2("./XMLCData");
- XMLComment = require2("./XMLComment");
- XMLDeclaration = require2("./XMLDeclaration");
- XMLDocType = require2("./XMLDocType");
- XMLRaw = require2("./XMLRaw");
- XMLText = require2("./XMLText");
- XMLProcessingInstruction = require2("./XMLProcessingInstruction");
- XMLDummy = require2("./XMLDummy");
- NodeType = require2("./NodeType");
- XMLNodeList = require2("./XMLNodeList");
- XMLNamedNodeMap = require2("./XMLNamedNodeMap");
- DocumentPosition = require2("./DocumentPosition");
- }
- }
- Object.defineProperty(XMLNode2.prototype, "nodeName", {
- get: function() {
- return this.name;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "nodeType", {
- get: function() {
- return this.type;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "nodeValue", {
- get: function() {
- return this.value;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "parentNode", {
- get: function() {
- return this.parent;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "childNodes", {
- get: function() {
- if (!this.childNodeList || !this.childNodeList.nodes) {
- this.childNodeList = new XMLNodeList(this.children);
- }
- return this.childNodeList;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "firstChild", {
- get: function() {
- return this.children[0] || null;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "lastChild", {
- get: function() {
- return this.children[this.children.length - 1] || null;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "previousSibling", {
- get: function() {
- var i;
- i = this.parent.children.indexOf(this);
- return this.parent.children[i - 1] || null;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "nextSibling", {
- get: function() {
- var i;
- i = this.parent.children.indexOf(this);
- return this.parent.children[i + 1] || null;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "ownerDocument", {
- get: function() {
- return this.document() || null;
- }
- });
- Object.defineProperty(XMLNode2.prototype, "textContent", {
- get: function() {
- var child, j, len, ref2, str;
- if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
- str = "";
- ref2 = this.children;
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- if (child.textContent) {
- str += child.textContent;
- }
- }
- return str;
- } else {
- return null;
- }
- },
- set: function(value) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- XMLNode2.prototype.setParent = function(parent) {
- var child, j, len, ref2, results;
- this.parent = parent;
- if (parent) {
- this.options = parent.options;
- this.stringify = parent.stringify;
- }
- ref2 = this.children;
- results = [];
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- results.push(child.setParent(this));
- }
- return results;
- };
- XMLNode2.prototype.element = function(name, attributes, text) {
- var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
- lastChild = null;
- if (attributes === null && text == null) {
- ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
- }
- if (attributes == null) {
- attributes = {};
- }
- attributes = getValue(attributes);
- if (!isObject(attributes)) {
- ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
- }
- if (name != null) {
- name = getValue(name);
- }
- if (Array.isArray(name)) {
- for (j = 0, len = name.length; j < len; j++) {
- item = name[j];
- lastChild = this.element(item);
- }
- } else if (isFunction(name)) {
- lastChild = this.element(name.apply());
- } else if (isObject(name)) {
- for (key in name) {
- if (!hasProp.call(name, key))
- continue;
- val = name[key];
- if (isFunction(val)) {
- val = val.apply();
- }
- if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
- lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
- } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
- lastChild = this.dummy();
- } else if (isObject(val) && isEmpty(val)) {
- lastChild = this.element(key);
- } else if (!this.options.keepNullNodes && val == null) {
- lastChild = this.dummy();
- } else if (!this.options.separateArrayItems && Array.isArray(val)) {
- for (k = 0, len1 = val.length; k < len1; k++) {
- item = val[k];
- childNode = {};
- childNode[key] = item;
- lastChild = this.element(childNode);
- }
- } else if (isObject(val)) {
- if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
- lastChild = this.element(val);
- } else {
- lastChild = this.element(key);
- lastChild.element(val);
- }
- } else {
- lastChild = this.element(key, val);
- }
- }
- } else if (!this.options.keepNullNodes && text === null) {
- lastChild = this.dummy();
- } else {
- if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
- lastChild = this.text(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
- lastChild = this.cdata(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
- lastChild = this.comment(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
- lastChild = this.raw(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
- lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
- } else {
- lastChild = this.node(name, attributes, text);
- }
- }
- if (lastChild == null) {
- throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
- }
- return lastChild;
- };
- XMLNode2.prototype.insertBefore = function(name, attributes, text) {
- var child, i, newChild, refChild, removed;
- if (name != null ? name.type : void 0) {
- newChild = name;
- refChild = attributes;
- newChild.setParent(this);
- if (refChild) {
- i = children.indexOf(refChild);
- removed = children.splice(i);
- children.push(newChild);
- Array.prototype.push.apply(children, removed);
- } else {
- children.push(newChild);
- }
- return newChild;
- } else {
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- }
- };
- XMLNode2.prototype.insertAfter = function(name, attributes, text) {
- var child, i, removed;
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i + 1);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- };
- XMLNode2.prototype.remove = function() {
- var i, ref2;
- if (this.isRoot) {
- throw new Error("Cannot remove the root element. " + this.debugInfo());
- }
- i = this.parent.children.indexOf(this);
- [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
- return this.parent;
- };
- XMLNode2.prototype.node = function(name, attributes, text) {
- var child, ref2;
- if (name != null) {
- name = getValue(name);
- }
- attributes || (attributes = {});
- attributes = getValue(attributes);
- if (!isObject(attributes)) {
- ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
- }
- child = new XMLElement(this, name, attributes);
- if (text != null) {
- child.text(text);
- }
- this.children.push(child);
- return child;
- };
- XMLNode2.prototype.text = function(value) {
- var child;
- if (isObject(value)) {
- this.element(value);
- }
- child = new XMLText(this, value);
- this.children.push(child);
- return this;
- };
- XMLNode2.prototype.cdata = function(value) {
- var child;
- child = new XMLCData(this, value);
- this.children.push(child);
- return this;
- };
- XMLNode2.prototype.comment = function(value) {
- var child;
- child = new XMLComment(this, value);
- this.children.push(child);
- return this;
- };
- XMLNode2.prototype.commentBefore = function(value) {
- var child, i, removed;
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i);
- child = this.parent.comment(value);
- Array.prototype.push.apply(this.parent.children, removed);
- return this;
- };
- XMLNode2.prototype.commentAfter = function(value) {
- var child, i, removed;
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i + 1);
- child = this.parent.comment(value);
- Array.prototype.push.apply(this.parent.children, removed);
- return this;
- };
- XMLNode2.prototype.raw = function(value) {
- var child;
- child = new XMLRaw(this, value);
- this.children.push(child);
- return this;
- };
- XMLNode2.prototype.dummy = function() {
- var child;
- child = new XMLDummy(this);
- return child;
- };
- XMLNode2.prototype.instruction = function(target, value) {
- var insTarget, insValue, instruction, j, len;
- if (target != null) {
- target = getValue(target);
- }
- if (value != null) {
- value = getValue(value);
- }
- if (Array.isArray(target)) {
- for (j = 0, len = target.length; j < len; j++) {
- insTarget = target[j];
- this.instruction(insTarget);
- }
- } else if (isObject(target)) {
- for (insTarget in target) {
- if (!hasProp.call(target, insTarget))
- continue;
- insValue = target[insTarget];
- this.instruction(insTarget, insValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- instruction = new XMLProcessingInstruction(this, target, value);
- this.children.push(instruction);
- }
- return this;
- };
- XMLNode2.prototype.instructionBefore = function(target, value) {
- var child, i, removed;
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i);
- child = this.parent.instruction(target, value);
- Array.prototype.push.apply(this.parent.children, removed);
- return this;
- };
- XMLNode2.prototype.instructionAfter = function(target, value) {
- var child, i, removed;
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i + 1);
- child = this.parent.instruction(target, value);
- Array.prototype.push.apply(this.parent.children, removed);
- return this;
- };
- XMLNode2.prototype.declaration = function(version, encoding, standalone) {
- var doc, xmldec;
- doc = this.document();
- xmldec = new XMLDeclaration(doc, version, encoding, standalone);
- if (doc.children.length === 0) {
- doc.children.unshift(xmldec);
- } else if (doc.children[0].type === NodeType.Declaration) {
- doc.children[0] = xmldec;
- } else {
- doc.children.unshift(xmldec);
- }
- return doc.root() || doc;
- };
- XMLNode2.prototype.dtd = function(pubID, sysID) {
- var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
- doc = this.document();
- doctype = new XMLDocType(doc, pubID, sysID);
- ref2 = doc.children;
- for (i = j = 0, len = ref2.length; j < len; i = ++j) {
- child = ref2[i];
- if (child.type === NodeType.DocType) {
- doc.children[i] = doctype;
- return doctype;
- }
- }
- ref3 = doc.children;
- for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
- child = ref3[i];
- if (child.isRoot) {
- doc.children.splice(i, 0, doctype);
- return doctype;
- }
- }
- doc.children.push(doctype);
- return doctype;
- };
- XMLNode2.prototype.up = function() {
- if (this.isRoot) {
- throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
- }
- return this.parent;
- };
- XMLNode2.prototype.root = function() {
- var node;
- node = this;
- while (node) {
- if (node.type === NodeType.Document) {
- return node.rootObject;
- } else if (node.isRoot) {
- return node;
- } else {
- node = node.parent;
- }
- }
- };
- XMLNode2.prototype.document = function() {
- var node;
- node = this;
- while (node) {
- if (node.type === NodeType.Document) {
- return node;
- } else {
- node = node.parent;
- }
- }
- };
- XMLNode2.prototype.end = function(options) {
- return this.document().end(options);
- };
- XMLNode2.prototype.prev = function() {
- var i;
- i = this.parent.children.indexOf(this);
- if (i < 1) {
- throw new Error("Already at the first node. " + this.debugInfo());
- }
- return this.parent.children[i - 1];
- };
- XMLNode2.prototype.next = function() {
- var i;
- i = this.parent.children.indexOf(this);
- if (i === -1 || i === this.parent.children.length - 1) {
- throw new Error("Already at the last node. " + this.debugInfo());
- }
- return this.parent.children[i + 1];
- };
- XMLNode2.prototype.importDocument = function(doc) {
- var clonedRoot;
- clonedRoot = doc.root().clone();
- clonedRoot.parent = this;
- clonedRoot.isRoot = false;
- this.children.push(clonedRoot);
- return this;
- };
- XMLNode2.prototype.debugInfo = function(name) {
- var ref2, ref3;
- name = name || this.name;
- if (name == null && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
- return "";
- } else if (name == null) {
- return "parent: <" + this.parent.name + ">";
- } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
- return "node: <" + name + ">";
- } else {
- return "node: <" + name + ">, parent: <" + this.parent.name + ">";
- }
- };
- XMLNode2.prototype.ele = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
- XMLNode2.prototype.nod = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
- XMLNode2.prototype.txt = function(value) {
- return this.text(value);
- };
- XMLNode2.prototype.dat = function(value) {
- return this.cdata(value);
- };
- XMLNode2.prototype.com = function(value) {
- return this.comment(value);
- };
- XMLNode2.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
- XMLNode2.prototype.doc = function() {
- return this.document();
- };
- XMLNode2.prototype.dec = function(version, encoding, standalone) {
- return this.declaration(version, encoding, standalone);
- };
- XMLNode2.prototype.e = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
- XMLNode2.prototype.n = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
- XMLNode2.prototype.t = function(value) {
- return this.text(value);
- };
- XMLNode2.prototype.d = function(value) {
- return this.cdata(value);
- };
- XMLNode2.prototype.c = function(value) {
- return this.comment(value);
- };
- XMLNode2.prototype.r = function(value) {
- return this.raw(value);
- };
- XMLNode2.prototype.i = function(target, value) {
- return this.instruction(target, value);
- };
- XMLNode2.prototype.u = function() {
- return this.up();
- };
- XMLNode2.prototype.importXMLBuilder = function(doc) {
- return this.importDocument(doc);
- };
- XMLNode2.prototype.replaceChild = function(newChild, oldChild) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.removeChild = function(oldChild) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.appendChild = function(newChild) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.hasChildNodes = function() {
- return this.children.length !== 0;
- };
- XMLNode2.prototype.cloneNode = function(deep) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.normalize = function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.isSupported = function(feature, version) {
- return true;
- };
- XMLNode2.prototype.hasAttributes = function() {
- return this.attribs.length !== 0;
- };
- XMLNode2.prototype.compareDocumentPosition = function(other) {
- var ref, res;
- ref = this;
- if (ref === other) {
- return 0;
- } else if (this.document() !== other.document()) {
- res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
- if (Math.random() < 0.5) {
- res |= DocumentPosition.Preceding;
- } else {
- res |= DocumentPosition.Following;
- }
- return res;
- } else if (ref.isAncestor(other)) {
- return DocumentPosition.Contains | DocumentPosition.Preceding;
- } else if (ref.isDescendant(other)) {
- return DocumentPosition.Contains | DocumentPosition.Following;
- } else if (ref.isPreceding(other)) {
- return DocumentPosition.Preceding;
- } else {
- return DocumentPosition.Following;
- }
- };
- XMLNode2.prototype.isSameNode = function(other) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.lookupPrefix = function(namespaceURI) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.isDefaultNamespace = function(namespaceURI) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.lookupNamespaceURI = function(prefix) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.isEqualNode = function(node) {
- var i, j, ref2;
- if (node.nodeType !== this.nodeType) {
- return false;
- }
- if (node.children.length !== this.children.length) {
- return false;
- }
- for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
- if (!this.children[i].isEqualNode(node.children[i])) {
- return false;
- }
- }
- return true;
- };
- XMLNode2.prototype.getFeature = function(feature, version) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.setUserData = function(key, data, handler) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.getUserData = function(key) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLNode2.prototype.contains = function(other) {
- if (!other) {
- return false;
- }
- return other === this || this.isDescendant(other);
- };
- XMLNode2.prototype.isDescendant = function(node) {
- var child, isDescendantChild, j, len, ref2;
- ref2 = this.children;
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- if (node === child) {
- return true;
- }
- isDescendantChild = child.isDescendant(node);
- if (isDescendantChild) {
- return true;
- }
- }
- return false;
- };
- XMLNode2.prototype.isAncestor = function(node) {
- return node.isDescendant(this);
- };
- XMLNode2.prototype.isPreceding = function(node) {
- var nodePos, thisPos;
- nodePos = this.treePosition(node);
- thisPos = this.treePosition(this);
- if (nodePos === -1 || thisPos === -1) {
- return false;
- } else {
- return nodePos < thisPos;
- }
- };
- XMLNode2.prototype.isFollowing = function(node) {
- var nodePos, thisPos;
- nodePos = this.treePosition(node);
- thisPos = this.treePosition(this);
- if (nodePos === -1 || thisPos === -1) {
- return false;
- } else {
- return nodePos > thisPos;
- }
- };
- XMLNode2.prototype.treePosition = function(node) {
- var found, pos;
- pos = 0;
- found = false;
- this.foreachTreeNode(this.document(), function(childNode) {
- pos++;
- if (!found && childNode === node) {
- return found = true;
- }
- });
- if (found) {
- return pos;
- } else {
- return -1;
- }
- };
- XMLNode2.prototype.foreachTreeNode = function(node, func) {
- var child, j, len, ref2, res;
- node || (node = this.document());
- ref2 = node.children;
- for (j = 0, len = ref2.length; j < len; j++) {
- child = ref2[j];
- if (res = func(child)) {
- return res;
- } else {
- res = this.foreachTreeNode(child, func);
- if (res) {
- return res;
- }
- }
- }
- };
- return XMLNode2;
- }();
- }).call(this);
- }, { "./DocumentPosition": 427, "./NodeType": 428, "./Utility": 429, "./XMLCData": 432, "./XMLComment": 434, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDummy": 447, "./XMLElement": 448, "./XMLNamedNodeMap": 449, "./XMLNodeList": 451, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLText": 457 }], 451: [function(require2, module3, exports3) {
- (function() {
- var XMLNodeList;
- module3.exports = XMLNodeList = function() {
- function XMLNodeList2(nodes) {
- this.nodes = nodes;
- }
- Object.defineProperty(XMLNodeList2.prototype, "length", {
- get: function() {
- return this.nodes.length || 0;
- }
- });
- XMLNodeList2.prototype.clone = function() {
- return this.nodes = null;
- };
- XMLNodeList2.prototype.item = function(index) {
- return this.nodes[index] || null;
- };
- return XMLNodeList2;
- }();
- }).call(this);
- }, {}], 452: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLCharacterData, XMLProcessingInstruction, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLCharacterData = require2("./XMLCharacterData");
- module3.exports = XMLProcessingInstruction = function(superClass) {
- extend(XMLProcessingInstruction2, superClass);
- function XMLProcessingInstruction2(parent, target, value) {
- XMLProcessingInstruction2.__super__.constructor.call(this, parent);
- if (target == null) {
- throw new Error("Missing instruction target. " + this.debugInfo());
- }
- this.type = NodeType.ProcessingInstruction;
- this.target = this.stringify.insTarget(target);
- this.name = this.target;
- if (value) {
- this.value = this.stringify.insValue(value);
- }
- }
- XMLProcessingInstruction2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLProcessingInstruction2.prototype.toString = function(options) {
- return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
- };
- XMLProcessingInstruction2.prototype.isEqualNode = function(node) {
- if (!XMLProcessingInstruction2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
- return false;
- }
- if (node.target !== this.target) {
- return false;
- }
- return true;
- };
- return XMLProcessingInstruction2;
- }(XMLCharacterData);
- }).call(this);
- }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 453: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLNode, XMLRaw, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLNode = require2("./XMLNode");
- module3.exports = XMLRaw = function(superClass) {
- extend(XMLRaw2, superClass);
- function XMLRaw2(parent, text) {
- XMLRaw2.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing raw text. " + this.debugInfo());
- }
- this.type = NodeType.Raw;
- this.value = this.stringify.raw(text);
- }
- XMLRaw2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLRaw2.prototype.toString = function(options) {
- return this.options.writer.raw(this, this.options.writer.filterOptions(options));
- };
- return XMLRaw2;
- }(XMLNode);
- }).call(this);
- }, { "./NodeType": 428, "./XMLNode": 450 }], 454: [function(require2, module3, exports3) {
- (function() {
- var NodeType, WriterState, XMLStreamWriter, XMLWriterBase, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLWriterBase = require2("./XMLWriterBase");
- WriterState = require2("./WriterState");
- module3.exports = XMLStreamWriter = function(superClass) {
- extend(XMLStreamWriter2, superClass);
- function XMLStreamWriter2(stream, options) {
- this.stream = stream;
- XMLStreamWriter2.__super__.constructor.call(this, options);
- }
- XMLStreamWriter2.prototype.endline = function(node, options, level) {
- if (node.isLastRootNode && options.state === WriterState.CloseTag) {
- return "";
- } else {
- return XMLStreamWriter2.__super__.endline.call(this, node, options, level);
- }
- };
- XMLStreamWriter2.prototype.document = function(doc, options) {
- var child, i, j, k, len, len1, ref, ref1, results;
- ref = doc.children;
- for (i = j = 0, len = ref.length; j < len; i = ++j) {
- child = ref[i];
- child.isLastRootNode = i === doc.children.length - 1;
- }
- options = this.filterOptions(options);
- ref1 = doc.children;
- results = [];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- child = ref1[k];
- results.push(this.writeChildNode(child, options, 0));
- }
- return results;
- };
- XMLStreamWriter2.prototype.attribute = function(att, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.attribute.call(this, att, options, level));
- };
- XMLStreamWriter2.prototype.cdata = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.cdata.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.comment = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.comment.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.declaration = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.declaration.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.docType = function(node, options, level) {
- var child, j, len, ref;
- level || (level = 0);
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- this.stream.write(this.indent(node, options, level));
- this.stream.write("<!DOCTYPE " + node.root().name);
- if (node.pubID && node.sysID) {
- this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
- } else if (node.sysID) {
- this.stream.write(' SYSTEM "' + node.sysID + '"');
- }
- if (node.children.length > 0) {
- this.stream.write(" [");
- this.stream.write(this.endline(node, options, level));
- options.state = WriterState.InsideTag;
- ref = node.children;
- for (j = 0, len = ref.length; j < len; j++) {
- child = ref[j];
- this.writeChildNode(child, options, level + 1);
- }
- options.state = WriterState.CloseTag;
- this.stream.write("]");
- }
- options.state = WriterState.CloseTag;
- this.stream.write(options.spaceBeforeSlash + ">");
- this.stream.write(this.endline(node, options, level));
- options.state = WriterState.None;
- return this.closeNode(node, options, level);
- };
- XMLStreamWriter2.prototype.element = function(node, options, level) {
- var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;
- level || (level = 0);
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- this.stream.write(this.indent(node, options, level) + "<" + node.name);
- ref = node.attribs;
- for (name in ref) {
- if (!hasProp.call(ref, name))
- continue;
- att = ref[name];
- this.attribute(att, options, level);
- }
- childNodeCount = node.children.length;
- firstChildNode = childNodeCount === 0 ? null : node.children[0];
- if (childNodeCount === 0 || node.children.every(function(e) {
- return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
- })) {
- if (options.allowEmpty) {
- this.stream.write(">");
- options.state = WriterState.CloseTag;
- this.stream.write("</" + node.name + ">");
- } else {
- options.state = WriterState.CloseTag;
- this.stream.write(options.spaceBeforeSlash + "/>");
- }
- } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
- this.stream.write(">");
- options.state = WriterState.InsideTag;
- options.suppressPrettyCount++;
- prettySuppressed = true;
- this.writeChildNode(firstChildNode, options, level + 1);
- options.suppressPrettyCount--;
- prettySuppressed = false;
- options.state = WriterState.CloseTag;
- this.stream.write("</" + node.name + ">");
- } else {
- this.stream.write(">" + this.endline(node, options, level));
- options.state = WriterState.InsideTag;
- ref1 = node.children;
- for (j = 0, len = ref1.length; j < len; j++) {
- child = ref1[j];
- this.writeChildNode(child, options, level + 1);
- }
- options.state = WriterState.CloseTag;
- this.stream.write(this.indent(node, options, level) + "</" + node.name + ">");
- }
- this.stream.write(this.endline(node, options, level));
- options.state = WriterState.None;
- return this.closeNode(node, options, level);
- };
- XMLStreamWriter2.prototype.processingInstruction = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.processingInstruction.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.raw = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.raw.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.text = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.text.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.dtdAttList = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.dtdAttList.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.dtdElement = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.dtdElement.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.dtdEntity = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.dtdEntity.call(this, node, options, level));
- };
- XMLStreamWriter2.prototype.dtdNotation = function(node, options, level) {
- return this.stream.write(XMLStreamWriter2.__super__.dtdNotation.call(this, node, options, level));
- };
- return XMLStreamWriter2;
- }(XMLWriterBase);
- }).call(this);
- }, { "./NodeType": 428, "./WriterState": 430, "./XMLWriterBase": 458 }], 455: [function(require2, module3, exports3) {
- (function() {
- var XMLStringWriter, XMLWriterBase, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- XMLWriterBase = require2("./XMLWriterBase");
- module3.exports = XMLStringWriter = function(superClass) {
- extend(XMLStringWriter2, superClass);
- function XMLStringWriter2(options) {
- XMLStringWriter2.__super__.constructor.call(this, options);
- }
- XMLStringWriter2.prototype.document = function(doc, options) {
- var child, i, len, r, ref;
- options = this.filterOptions(options);
- r = "";
- ref = doc.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- r += this.writeChildNode(child, options, 0);
- }
- if (options.pretty && r.slice(-options.newline.length) === options.newline) {
- r = r.slice(0, -options.newline.length);
- }
- return r;
- };
- return XMLStringWriter2;
- }(XMLWriterBase);
- }).call(this);
- }, { "./XMLWriterBase": 458 }], 456: [function(require2, module3, exports3) {
- (function() {
- var XMLStringifier, bind = function(fn, me) {
- return function() {
- return fn.apply(me, arguments);
- };
- }, hasProp = {}.hasOwnProperty;
- module3.exports = XMLStringifier = function() {
- function XMLStringifier2(options) {
- this.assertLegalName = bind(this.assertLegalName, this);
- this.assertLegalChar = bind(this.assertLegalChar, this);
- var key, ref, value;
- options || (options = {});
- this.options = options;
- if (!this.options.version) {
- this.options.version = "1.0";
- }
- ref = options.stringify || {};
- for (key in ref) {
- if (!hasProp.call(ref, key))
- continue;
- value = ref[key];
- this[key] = value;
- }
- }
- XMLStringifier2.prototype.name = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalName("" + val || "");
- };
- XMLStringifier2.prototype.text = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar(this.textEscape("" + val || ""));
- };
- XMLStringifier2.prototype.cdata = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- val = "" + val || "";
- val = val.replace("]]>", "]]]]><![CDATA[>");
- return this.assertLegalChar(val);
- };
- XMLStringifier2.prototype.comment = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- val = "" + val || "";
- if (val.match(/--/)) {
- throw new Error("Comment text cannot contain double-hypen: " + val);
- }
- return this.assertLegalChar(val);
- };
- XMLStringifier2.prototype.raw = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return "" + val || "";
- };
- XMLStringifier2.prototype.attValue = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar(this.attEscape(val = "" + val || ""));
- };
- XMLStringifier2.prototype.insTarget = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.insValue = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- val = "" + val || "";
- if (val.match(/\?>/)) {
- throw new Error("Invalid processing instruction value: " + val);
- }
- return this.assertLegalChar(val);
- };
- XMLStringifier2.prototype.xmlVersion = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- val = "" + val || "";
- if (!val.match(/1\.[0-9]+/)) {
- throw new Error("Invalid version number: " + val);
- }
- return val;
- };
- XMLStringifier2.prototype.xmlEncoding = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- val = "" + val || "";
- if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
- throw new Error("Invalid encoding: " + val);
- }
- return this.assertLegalChar(val);
- };
- XMLStringifier2.prototype.xmlStandalone = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- if (val) {
- return "yes";
- } else {
- return "no";
- }
- };
- XMLStringifier2.prototype.dtdPubID = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdSysID = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdElementValue = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdAttType = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdAttDefault = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdEntityValue = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.dtdNData = function(val) {
- if (this.options.noValidation) {
- return val;
- }
- return this.assertLegalChar("" + val || "");
- };
- XMLStringifier2.prototype.convertAttKey = "@";
- XMLStringifier2.prototype.convertPIKey = "?";
- XMLStringifier2.prototype.convertTextKey = "#text";
- XMLStringifier2.prototype.convertCDataKey = "#cdata";
- XMLStringifier2.prototype.convertCommentKey = "#comment";
- XMLStringifier2.prototype.convertRawKey = "#raw";
- XMLStringifier2.prototype.assertLegalChar = function(str) {
- var regex, res;
- if (this.options.noValidation) {
- return str;
- }
- regex = "";
- if (this.options.version === "1.0") {
- regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- if (res = str.match(regex)) {
- throw new Error("Invalid character in string: " + str + " at index " + res.index);
- }
- } else if (this.options.version === "1.1") {
- regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- if (res = str.match(regex)) {
- throw new Error("Invalid character in string: " + str + " at index " + res.index);
- }
- }
- return str;
- };
- XMLStringifier2.prototype.assertLegalName = function(str) {
- var regex;
- if (this.options.noValidation) {
- return str;
- }
- this.assertLegalChar(str);
- regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
- if (!str.match(regex)) {
- throw new Error("Invalid character in name");
- }
- return str;
- };
- XMLStringifier2.prototype.textEscape = function(str) {
- var ampregex;
- if (this.options.noValidation) {
- return str;
- }
- ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
- return str.replace(ampregex, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\r/g, "
");
- };
- XMLStringifier2.prototype.attEscape = function(str) {
- var ampregex;
- if (this.options.noValidation) {
- return str;
- }
- ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
- return str.replace(ampregex, "&").replace(/</g, "<").replace(/"/g, """).replace(/\t/g, "	").replace(/\n/g, "
").replace(/\r/g, "
");
- };
- return XMLStringifier2;
- }();
- }).call(this);
- }, {}], 457: [function(require2, module3, exports3) {
- (function() {
- var NodeType, XMLCharacterData, XMLText, extend = function(child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key))
- child[key] = parent[key];
- }
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- child.__super__ = parent.prototype;
- return child;
- }, hasProp = {}.hasOwnProperty;
- NodeType = require2("./NodeType");
- XMLCharacterData = require2("./XMLCharacterData");
- module3.exports = XMLText = function(superClass) {
- extend(XMLText2, superClass);
- function XMLText2(parent, text) {
- XMLText2.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing element text. " + this.debugInfo());
- }
- this.name = "#text";
- this.type = NodeType.Text;
- this.value = this.stringify.text(text);
- }
- Object.defineProperty(XMLText2.prototype, "isElementContentWhitespace", {
- get: function() {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- }
- });
- Object.defineProperty(XMLText2.prototype, "wholeText", {
- get: function() {
- var next, prev, str;
- str = "";
- prev = this.previousSibling;
- while (prev) {
- str = prev.data + str;
- prev = prev.previousSibling;
- }
- str += this.data;
- next = this.nextSibling;
- while (next) {
- str = str + next.data;
- next = next.nextSibling;
- }
- return str;
- }
- });
- XMLText2.prototype.clone = function() {
- return Object.create(this);
- };
- XMLText2.prototype.toString = function(options) {
- return this.options.writer.text(this, this.options.writer.filterOptions(options));
- };
- XMLText2.prototype.splitText = function(offset) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- XMLText2.prototype.replaceWholeText = function(content) {
- throw new Error("This DOM method is not implemented." + this.debugInfo());
- };
- return XMLText2;
- }(XMLCharacterData);
- }).call(this);
- }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 458: [function(require2, module3, exports3) {
- (function() {
- var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign, hasProp = {}.hasOwnProperty;
- assign = require2("./Utility").assign;
- NodeType = require2("./NodeType");
- XMLDeclaration = require2("./XMLDeclaration");
- XMLDocType = require2("./XMLDocType");
- XMLCData = require2("./XMLCData");
- XMLComment = require2("./XMLComment");
- XMLElement = require2("./XMLElement");
- XMLRaw = require2("./XMLRaw");
- XMLText = require2("./XMLText");
- XMLProcessingInstruction = require2("./XMLProcessingInstruction");
- XMLDummy = require2("./XMLDummy");
- XMLDTDAttList = require2("./XMLDTDAttList");
- XMLDTDElement = require2("./XMLDTDElement");
- XMLDTDEntity = require2("./XMLDTDEntity");
- XMLDTDNotation = require2("./XMLDTDNotation");
- WriterState = require2("./WriterState");
- module3.exports = XMLWriterBase = function() {
- function XMLWriterBase2(options) {
- var key, ref, value;
- options || (options = {});
- this.options = options;
- ref = options.writer || {};
- for (key in ref) {
- if (!hasProp.call(ref, key))
- continue;
- value = ref[key];
- this["_" + key] = this[key];
- this[key] = value;
- }
- }
- XMLWriterBase2.prototype.filterOptions = function(options) {
- var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
- options || (options = {});
- options = assign({}, this.options, options);
- filteredOptions = {
- writer: this
- };
- filteredOptions.pretty = options.pretty || false;
- filteredOptions.allowEmpty = options.allowEmpty || false;
- filteredOptions.indent = (ref = options.indent) != null ? ref : " ";
- filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : "\n";
- filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
- filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
- filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : "";
- if (filteredOptions.spaceBeforeSlash === true) {
- filteredOptions.spaceBeforeSlash = " ";
- }
- filteredOptions.suppressPrettyCount = 0;
- filteredOptions.user = {};
- filteredOptions.state = WriterState.None;
- return filteredOptions;
- };
- XMLWriterBase2.prototype.indent = function(node, options, level) {
- var indentLevel;
- if (!options.pretty || options.suppressPrettyCount) {
- return "";
- } else if (options.pretty) {
- indentLevel = (level || 0) + options.offset + 1;
- if (indentLevel > 0) {
- return new Array(indentLevel).join(options.indent);
- }
- }
- return "";
- };
- XMLWriterBase2.prototype.endline = function(node, options, level) {
- if (!options.pretty || options.suppressPrettyCount) {
- return "";
- } else {
- return options.newline;
- }
- };
- XMLWriterBase2.prototype.attribute = function(att, options, level) {
- var r;
- this.openAttribute(att, options, level);
- r = " " + att.name + '="' + att.value + '"';
- this.closeAttribute(att, options, level);
- return r;
- };
- XMLWriterBase2.prototype.cdata = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<![CDATA[";
- options.state = WriterState.InsideTag;
- r += node.value;
- options.state = WriterState.CloseTag;
- r += "]]>" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.comment = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<!-- ";
- options.state = WriterState.InsideTag;
- r += node.value;
- options.state = WriterState.CloseTag;
- r += " -->" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.declaration = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<?xml";
- options.state = WriterState.InsideTag;
- r += ' version="' + node.version + '"';
- if (node.encoding != null) {
- r += ' encoding="' + node.encoding + '"';
- }
- if (node.standalone != null) {
- r += ' standalone="' + node.standalone + '"';
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + "?>";
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.docType = function(node, options, level) {
- var child, i, len, r, ref;
- level || (level = 0);
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level);
- r += "<!DOCTYPE " + node.root().name;
- if (node.pubID && node.sysID) {
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
- } else if (node.sysID) {
- r += ' SYSTEM "' + node.sysID + '"';
- }
- if (node.children.length > 0) {
- r += " [";
- r += this.endline(node, options, level);
- options.state = WriterState.InsideTag;
- ref = node.children;
- for (i = 0, len = ref.length; i < len; i++) {
- child = ref[i];
- r += this.writeChildNode(child, options, level + 1);
- }
- options.state = WriterState.CloseTag;
- r += "]";
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + ">";
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.element = function(node, options, level) {
- var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
- level || (level = 0);
- prettySuppressed = false;
- r = "";
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r += this.indent(node, options, level) + "<" + node.name;
- ref = node.attribs;
- for (name in ref) {
- if (!hasProp.call(ref, name))
- continue;
- att = ref[name];
- r += this.attribute(att, options, level);
- }
- childNodeCount = node.children.length;
- firstChildNode = childNodeCount === 0 ? null : node.children[0];
- if (childNodeCount === 0 || node.children.every(function(e) {
- return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
- })) {
- if (options.allowEmpty) {
- r += ">";
- options.state = WriterState.CloseTag;
- r += "</" + node.name + ">" + this.endline(node, options, level);
- } else {
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + "/>" + this.endline(node, options, level);
- }
- } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
- r += ">";
- options.state = WriterState.InsideTag;
- options.suppressPrettyCount++;
- prettySuppressed = true;
- r += this.writeChildNode(firstChildNode, options, level + 1);
- options.suppressPrettyCount--;
- prettySuppressed = false;
- options.state = WriterState.CloseTag;
- r += "</" + node.name + ">" + this.endline(node, options, level);
- } else {
- if (options.dontPrettyTextNodes) {
- ref1 = node.children;
- for (i = 0, len = ref1.length; i < len; i++) {
- child = ref1[i];
- if ((child.type === NodeType.Text || child.type === NodeType.Raw) && child.value != null) {
- options.suppressPrettyCount++;
- prettySuppressed = true;
- break;
- }
- }
- }
- r += ">" + this.endline(node, options, level);
- options.state = WriterState.InsideTag;
- ref2 = node.children;
- for (j = 0, len1 = ref2.length; j < len1; j++) {
- child = ref2[j];
- r += this.writeChildNode(child, options, level + 1);
- }
- options.state = WriterState.CloseTag;
- r += this.indent(node, options, level) + "</" + node.name + ">";
- if (prettySuppressed) {
- options.suppressPrettyCount--;
- }
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- }
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.writeChildNode = function(node, options, level) {
- switch (node.type) {
- case NodeType.CData:
- return this.cdata(node, options, level);
- case NodeType.Comment:
- return this.comment(node, options, level);
- case NodeType.Element:
- return this.element(node, options, level);
- case NodeType.Raw:
- return this.raw(node, options, level);
- case NodeType.Text:
- return this.text(node, options, level);
- case NodeType.ProcessingInstruction:
- return this.processingInstruction(node, options, level);
- case NodeType.Dummy:
- return "";
- case NodeType.Declaration:
- return this.declaration(node, options, level);
- case NodeType.DocType:
- return this.docType(node, options, level);
- case NodeType.AttributeDeclaration:
- return this.dtdAttList(node, options, level);
- case NodeType.ElementDeclaration:
- return this.dtdElement(node, options, level);
- case NodeType.EntityDeclaration:
- return this.dtdEntity(node, options, level);
- case NodeType.NotationDeclaration:
- return this.dtdNotation(node, options, level);
- default:
- throw new Error("Unknown XML node type: " + node.constructor.name);
- }
- };
- XMLWriterBase2.prototype.processingInstruction = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<?";
- options.state = WriterState.InsideTag;
- r += node.target;
- if (node.value) {
- r += " " + node.value;
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + "?>";
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.raw = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level);
- options.state = WriterState.InsideTag;
- r += node.value;
- options.state = WriterState.CloseTag;
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.text = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level);
- options.state = WriterState.InsideTag;
- r += node.value;
- options.state = WriterState.CloseTag;
- r += this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.dtdAttList = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<!ATTLIST";
- options.state = WriterState.InsideTag;
- r += " " + node.elementName + " " + node.attributeName + " " + node.attributeType;
- if (node.defaultValueType !== "#DEFAULT") {
- r += " " + node.defaultValueType;
- }
- if (node.defaultValue) {
- r += ' "' + node.defaultValue + '"';
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.dtdElement = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<!ELEMENT";
- options.state = WriterState.InsideTag;
- r += " " + node.name + " " + node.value;
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.dtdEntity = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<!ENTITY";
- options.state = WriterState.InsideTag;
- if (node.pe) {
- r += " %";
- }
- r += " " + node.name;
- if (node.value) {
- r += ' "' + node.value + '"';
- } else {
- if (node.pubID && node.sysID) {
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
- } else if (node.sysID) {
- r += ' SYSTEM "' + node.sysID + '"';
- }
- if (node.nData) {
- r += " NDATA " + node.nData;
- }
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.dtdNotation = function(node, options, level) {
- var r;
- this.openNode(node, options, level);
- options.state = WriterState.OpenTag;
- r = this.indent(node, options, level) + "<!NOTATION";
- options.state = WriterState.InsideTag;
- r += " " + node.name;
- if (node.pubID && node.sysID) {
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
- } else if (node.pubID) {
- r += ' PUBLIC "' + node.pubID + '"';
- } else if (node.sysID) {
- r += ' SYSTEM "' + node.sysID + '"';
- }
- options.state = WriterState.CloseTag;
- r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
- options.state = WriterState.None;
- this.closeNode(node, options, level);
- return r;
- };
- XMLWriterBase2.prototype.openNode = function(node, options, level) {
- };
- XMLWriterBase2.prototype.closeNode = function(node, options, level) {
- };
- XMLWriterBase2.prototype.openAttribute = function(att, options, level) {
- };
- XMLWriterBase2.prototype.closeAttribute = function(att, options, level) {
- };
- return XMLWriterBase2;
- }();
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLCData": 432, "./XMLComment": 434, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDummy": 447, "./XMLElement": 448, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLText": 457 }], 459: [function(require2, module3, exports3) {
- (function() {
- var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
- ref = require2("./Utility"), assign = ref.assign, isFunction = ref.isFunction;
- XMLDOMImplementation = require2("./XMLDOMImplementation");
- XMLDocument = require2("./XMLDocument");
- XMLDocumentCB = require2("./XMLDocumentCB");
- XMLStringWriter = require2("./XMLStringWriter");
- XMLStreamWriter = require2("./XMLStreamWriter");
- NodeType = require2("./NodeType");
- WriterState = require2("./WriterState");
- module3.exports.create = function(name, xmldec, doctype, options) {
- var doc, root;
- if (name == null) {
- throw new Error("Root element needs a name.");
- }
- options = assign({}, xmldec, doctype, options);
- doc = new XMLDocument(options);
- root = doc.element(name);
- if (!options.headless) {
- doc.declaration(options);
- if (options.pubID != null || options.sysID != null) {
- doc.dtd(options);
- }
- }
- return root;
- };
- module3.exports.begin = function(options, onData, onEnd) {
- var ref1;
- if (isFunction(options)) {
- ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
- options = {};
- }
- if (onData) {
- return new XMLDocumentCB(options, onData, onEnd);
- } else {
- return new XMLDocument(options);
- }
- };
- module3.exports.stringWriter = function(options) {
- return new XMLStringWriter(options);
- };
- module3.exports.streamWriter = function(stream, options) {
- return new XMLStreamWriter(stream, options);
- };
- module3.exports.implementation = new XMLDOMImplementation();
- module3.exports.nodeType = NodeType;
- module3.exports.writerState = WriterState;
- }).call(this);
- }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLDOMImplementation": 437, "./XMLDocument": 445, "./XMLDocumentCB": 446, "./XMLStreamWriter": 454, "./XMLStringWriter": 455 }], 460: [function(require2, module3, exports3) {
- module3.exports = extend;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function extend() {
- var target = {};
- for (var i = 0; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- }
- }, {}], 461: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.fill.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.regexp.to-string.js");
- require2("core-js/modules/es.array.join.js");
- require2("core-js/modules/es.array.slice.js");
- var Buffer = require2("buffer").Buffer;
- var sha = require2("./sha");
- var md5 = require2("./md5");
- var algorithms = {
- sha1: sha,
- md5
- };
- var blocksize = 64;
- var zeroBuffer = Buffer.alloc(blocksize);
- zeroBuffer.fill(0);
- function hmac(fn, key, data) {
- if (!Buffer.isBuffer(key))
- key = Buffer.from(key);
- if (!Buffer.isBuffer(data))
- data = Buffer.from(data);
- if (key.length > blocksize) {
- key = fn(key);
- } else if (key.length < blocksize) {
- key = Buffer.concat([key, zeroBuffer], blocksize);
- }
- var ipad = Buffer.alloc(blocksize), opad = Buffer.alloc(blocksize);
- for (var i = 0; i < blocksize; i++) {
- ipad[i] = key[i] ^ 54;
- opad[i] = key[i] ^ 92;
- }
- var hash2 = fn(Buffer.concat([ipad, data]));
- return fn(Buffer.concat([opad, hash2]));
- }
- function hash(alg, key) {
- alg = alg || "sha1";
- var fn = algorithms[alg];
- var bufs = [];
- var length = 0;
- if (!fn)
- error("algorithm:", alg, "is not yet supported");
- return {
- update: function update(data) {
- if (!Buffer.isBuffer(data))
- data = Buffer.from(data);
- bufs.push(data);
- length += data.length;
- return this;
- },
- digest: function digest(enc) {
- var buf = Buffer.concat(bufs);
- var r = key ? hmac(fn, key, buf) : fn(buf);
- bufs = null;
- return enc ? r.toString(enc) : r;
- }
- };
- }
- function error() {
- var m = [].slice.call(arguments).join(" ");
- throw new Error([m, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join("\n"));
- }
- exports3.createHash = function(alg) {
- return hash(alg);
- };
- exports3.createHmac = function(alg, key) {
- return hash(alg, key);
- };
- exports3.createCredentials = function() {
- error("sorry,createCredentials is not implemented yet");
- };
- exports3.createCipher = function() {
- error("sorry,createCipher is not implemented yet");
- };
- exports3.createCipheriv = function() {
- error("sorry,createCipheriv is not implemented yet");
- };
- exports3.createDecipher = function() {
- error("sorry,createDecipher is not implemented yet");
- };
- exports3.createDecipheriv = function() {
- error("sorry,createDecipheriv is not implemented yet");
- };
- exports3.createSign = function() {
- error("sorry,createSign is not implemented yet");
- };
- exports3.createVerify = function() {
- error("sorry,createVerify is not implemented yet");
- };
- exports3.createDiffieHellman = function() {
- error("sorry,createDiffieHellman is not implemented yet");
- };
- exports3.pbkdf2 = function() {
- error("sorry,pbkdf2 is not implemented yet");
- };
- }, { "./md5": 463, "./sha": 464, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.fill.js": 273, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 462: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.array.fill.js");
- require2("core-js/modules/es.array.concat.js");
- var Buffer = require2("buffer").Buffer;
- var intSize = 4;
- var zeroBuffer = Buffer.alloc(intSize);
- zeroBuffer.fill(0);
- var chrsz = 8;
- function toArray(buf, bigEndian) {
- if (buf.length % intSize !== 0) {
- var len = buf.length + (intSize - buf.length % intSize);
- buf = Buffer.concat([buf, zeroBuffer], len);
- }
- var arr = [];
- var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
- for (var i = 0; i < buf.length; i += intSize) {
- arr.push(fn.call(buf, i));
- }
- return arr;
- }
- function toBuffer(arr, size, bigEndian) {
- var buf = Buffer.alloc(size);
- var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
- for (var i = 0; i < arr.length; i++) {
- fn.call(buf, arr[i], i * 4, true);
- }
- return buf;
- }
- function hash(buf, fn, hashSize, bigEndian) {
- if (!Buffer.isBuffer(buf))
- buf = Buffer.from(buf);
- var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
- return toBuffer(arr, hashSize, bigEndian);
- }
- module3.exports = {
- hash
- };
- }, { "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.fill.js": 273 }], 463: [function(require2, module3, exports3) {
- "use strict";
- var helpers = require2("./helpers");
- function md5_vm_test() {
- return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
- }
- function core_md5(x, len) {
- x[len >> 5] |= 128 << len % 32;
- x[(len + 64 >>> 9 << 4) + 14] = len;
- var a = 1732584193;
- var b = -271733879;
- var c = -1732584194;
- var d = 271733878;
- for (var i = 0; i < x.length; i += 16) {
- var olda = a;
- var oldb = b;
- var oldc = c;
- var oldd = d;
- a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
- d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
- c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
- b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
- a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
- d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
- c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
- b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
- a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
- d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
- c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
- b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
- a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
- d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
- c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
- b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
- a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
- d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
- c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
- b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
- a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
- d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
- c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
- b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
- a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
- d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
- c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
- b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
- a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
- d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
- c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
- b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
- a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
- d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
- c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
- b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
- a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
- d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
- c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
- b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
- a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
- d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
- c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
- b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
- a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
- d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
- c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
- b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
- a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
- d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
- c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
- b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
- a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
- d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
- c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
- b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
- a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
- d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
- c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
- b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
- a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
- d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
- c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
- b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
- a = safe_add(a, olda);
- b = safe_add(b, oldb);
- c = safe_add(c, oldc);
- d = safe_add(d, oldd);
- }
- return Array(a, b, c, d);
- }
- function md5_cmn(q, a, b, x, s, t) {
- return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
- }
- function md5_ff(a, b, c, d, x, s, t) {
- return md5_cmn(b & c | ~b & d, a, b, x, s, t);
- }
- function md5_gg(a, b, c, d, x, s, t) {
- return md5_cmn(b & d | c & ~d, a, b, x, s, t);
- }
- function md5_hh(a, b, c, d, x, s, t) {
- return md5_cmn(b ^ c ^ d, a, b, x, s, t);
- }
- function md5_ii(a, b, c, d, x, s, t) {
- return md5_cmn(c ^ (b | ~d), a, b, x, s, t);
- }
- function safe_add(x, y) {
- var lsw = (x & 65535) + (y & 65535);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return msw << 16 | lsw & 65535;
- }
- function bit_rol(num, cnt) {
- return num << cnt | num >>> 32 - cnt;
- }
- module3.exports = function md5(buf) {
- return helpers.hash(buf, core_md5, 16);
- };
- }, { "./helpers": 462 }], 464: [function(require2, module3, exports3) {
- "use strict";
- var helpers = require2("./helpers");
- function core_sha1(x, len) {
- x[len >> 5] |= 128 << 24 - len % 32;
- x[(len + 64 >> 9 << 4) + 15] = len;
- var w = Array(80);
- var a = 1732584193;
- var b = -271733879;
- var c = -1732584194;
- var d = 271733878;
- var e = -1009589776;
- for (var i = 0; i < x.length; i += 16) {
- var olda = a;
- var oldb = b;
- var oldc = c;
- var oldd = d;
- var olde = e;
- for (var j = 0; j < 80; j++) {
- if (j < 16)
- w[j] = x[i + j];
- else
- w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
- var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = t;
- }
- a = safe_add(a, olda);
- b = safe_add(b, oldb);
- c = safe_add(c, oldc);
- d = safe_add(d, oldd);
- e = safe_add(e, olde);
- }
- return Array(a, b, c, d, e);
- }
- function sha1_ft(t, b, c, d) {
- if (t < 20)
- return b & c | ~b & d;
- if (t < 40)
- return b ^ c ^ d;
- if (t < 60)
- return b & c | b & d | c & d;
- return b ^ c ^ d;
- }
- function sha1_kt(t) {
- return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
- }
- function safe_add(x, y) {
- var lsw = (x & 65535) + (y & 65535);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return msw << 16 | lsw & 65535;
- }
- function rol(num, cnt) {
- return num << cnt | num >>> 32 - cnt;
- }
- module3.exports = function sha1(buf) {
- return helpers.hash(buf, core_sha1, 20, true);
- };
- }, { "./helpers": 462 }], 465: [function(require2, module3, exports3) {
- "use strict";
- module3.exports = function() {
- return function() {
- };
- };
- }, {}], 466: [function(require2, module3, exports3) {
- (function(Buffer) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- var _require = require2("stream"), Stream = _require.Stream;
- var _require2 = require2("../lib/common/utils/isArray"), isArray = _require2.isArray;
- module3.exports.string = function isString(obj) {
- return typeof obj === "string";
- };
- module3.exports.array = isArray;
- module3.exports.buffer = Buffer.isBuffer;
- function isStream(obj) {
- return obj instanceof Stream;
- }
- module3.exports.writableStream = function isWritableStream(obj) {
- return isStream(obj) && typeof obj._write === "function" && (0, _typeof2.default)(obj._writableState) === "object";
- };
- }).call(this);
- }).call(this, { "isBuffer": require2("../node_modules/is-buffer/index.js") });
- }, { "../lib/common/utils/isArray": 63, "../node_modules/is-buffer/index.js": 366, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "stream": 398 }], 467: [function(require2, module3, exports3) {
- "use strict";
- var immediate = require2("immediate");
- var process = module3.exports = {};
- process.nextTick = immediate;
- process.title = "browser";
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = "";
- process.versions = {};
- function noop() {
- }
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function(name) {
- return [];
- };
- process.binding = function(name) {
- throw new Error("process.binding is not supported");
- };
- process.cwd = function() {
- return "/";
- };
- process.chdir = function(dir) {
- throw new Error("process.chdir is not supported");
- };
- process.umask = function() {
- return 0;
- };
- }, { "immediate": 358 }], 468: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.search.js");
- var ClientRequest = require2("./lib/request");
- var response = require2("./lib/response");
- var extend = require2("xtend");
- var statusCodes = require2("builtin-status-codes");
- var url = require2("url");
- var http = exports3;
- http.request = function(opts, cb) {
- if (typeof opts === "string")
- opts = url.parse(opts);
- else
- opts = extend(opts);
- var defaultProtocol = global2.location.protocol.search(/^https?:$/) === -1 ? "http:" : "";
- var protocol = opts.protocol || defaultProtocol;
- var host = opts.hostname || opts.host;
- var port = opts.port;
- var path = opts.path || "/";
- if (host && host.indexOf(":") !== -1)
- host = "[" + host + "]";
- opts.url = (host ? protocol + "//" + host : "") + (port ? ":" + port : "") + path;
- opts.method = (opts.method || "GET").toUpperCase();
- opts.headers = opts.headers || {};
- var req = new ClientRequest(opts);
- if (cb)
- req.on("response", cb);
- return req;
- };
- http.get = function get(opts, cb) {
- var req = http.request(opts, cb);
- req.end();
- return req;
- };
- http.ClientRequest = ClientRequest;
- http.IncomingMessage = response.IncomingMessage;
- http.Agent = function() {
- };
- http.Agent.defaultMaxSockets = 4;
- http.globalAgent = new http.Agent();
- http.STATUS_CODES = statusCodes;
- http.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"];
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "./lib/request": 470, "./lib/response": 471, "builtin-status-codes": 91, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.search.js": 306, "url": 472, "xtend": 460 }], 469: [function(require2, module3, exports3) {
- (function(global2) {
- (function() {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.array-buffer.constructor.js");
- require2("core-js/modules/es.array-buffer.slice.js");
- require2("core-js/modules/es.array.slice.js");
- exports3.fetch = isFunction(global2.fetch) && isFunction(global2.ReadableStream);
- exports3.writableStream = isFunction(global2.WritableStream);
- exports3.abortController = isFunction(global2.AbortController);
- exports3.blobConstructor = false;
- try {
- new Blob([new ArrayBuffer(1)]);
- exports3.blobConstructor = true;
- } catch (e) {
- }
- var xhr;
- function getXHR() {
- if (xhr !== void 0)
- return xhr;
- if (global2.XMLHttpRequest) {
- xhr = new global2.XMLHttpRequest();
- try {
- xhr.open("GET", global2.XDomainRequest ? "/" : "https://example.com");
- } catch (e) {
- xhr = null;
- }
- } else {
- xhr = null;
- }
- return xhr;
- }
- function checkTypeSupport(type) {
- var xhr2 = getXHR();
- if (!xhr2)
- return false;
- try {
- xhr2.responseType = type;
- return xhr2.responseType === type;
- } catch (e) {
- }
- return false;
- }
- var haveArrayBuffer = typeof global2.ArrayBuffer !== "undefined";
- var haveSlice = haveArrayBuffer && isFunction(global2.ArrayBuffer.prototype.slice);
- exports3.arraybuffer = exports3.fetch || haveArrayBuffer && checkTypeSupport("arraybuffer");
- exports3.msstream = !exports3.fetch && haveSlice && checkTypeSupport("ms-stream");
- exports3.mozchunkedarraybuffer = !exports3.fetch && haveArrayBuffer && checkTypeSupport("moz-chunked-arraybuffer");
- exports3.overrideMimeType = exports3.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false);
- exports3.vbArray = isFunction(global2.VBArray);
- function isFunction(value) {
- return typeof value === "function";
- }
- xhr = null;
- }).call(this);
- }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
- }, { "core-js/modules/es.array-buffer.constructor.js": 270, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295 }], 470: [function(require2, module3, exports3) {
- (function(process, global2, Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.regexp.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.array.map.js");
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.split.js");
- var capability = require2("./capability");
- var inherits = require2("inherits");
- var response = require2("./response");
- var stream = require2("readable-stream");
- var toArrayBuffer = require2("to-arraybuffer");
- var IncomingMessage = response.IncomingMessage;
- var rStates = response.readyStates;
- function decideMode(preferBinary, useFetch) {
- if (capability.fetch && useFetch) {
- return "fetch";
- } else if (capability.mozchunkedarraybuffer) {
- return "moz-chunked-arraybuffer";
- } else if (capability.msstream) {
- return "ms-stream";
- } else if (capability.arraybuffer && preferBinary) {
- return "arraybuffer";
- } else if (capability.vbArray && preferBinary) {
- return "text:vbarray";
- } else {
- return "text";
- }
- }
- var ClientRequest = module3.exports = function(opts) {
- var self2 = this;
- stream.Writable.call(self2);
- self2._opts = opts;
- self2._body = [];
- self2._headers = {};
- if (opts.auth)
- self2.setHeader("Authorization", "Basic " + new Buffer(opts.auth).toString("base64"));
- Object.keys(opts.headers).forEach(function(name) {
- self2.setHeader(name, opts.headers[name]);
- });
- var preferBinary;
- var useFetch = true;
- if (opts.mode === "disable-fetch" || "requestTimeout" in opts && !capability.abortController) {
- useFetch = false;
- preferBinary = true;
- } else if (opts.mode === "prefer-streaming") {
- preferBinary = false;
- } else if (opts.mode === "allow-wrong-content-type") {
- preferBinary = !capability.overrideMimeType;
- } else if (!opts.mode || opts.mode === "default" || opts.mode === "prefer-fast") {
- preferBinary = true;
- } else {
- throw new Error("Invalid value for opts.mode");
- }
- self2._mode = decideMode(preferBinary, useFetch);
- self2._fetchTimer = null;
- self2.on("finish", function() {
- self2._onFinish();
- });
- };
- inherits(ClientRequest, stream.Writable);
- ClientRequest.prototype.setHeader = function(name, value) {
- var self2 = this;
- var lowerName = name.toLowerCase();
- if (unsafeHeaders.indexOf(lowerName) !== -1)
- return;
- self2._headers[lowerName] = {
- name,
- value
- };
- };
- ClientRequest.prototype.getHeader = function(name) {
- var header = this._headers[name.toLowerCase()];
- if (header)
- return header.value;
- return null;
- };
- ClientRequest.prototype.removeHeader = function(name) {
- var self2 = this;
- delete self2._headers[name.toLowerCase()];
- };
- ClientRequest.prototype._onFinish = function() {
- var self2 = this;
- if (self2._destroyed)
- return;
- var opts = self2._opts;
- var headersObj = self2._headers;
- var body = null;
- if (opts.method !== "GET" && opts.method !== "HEAD") {
- if (capability.arraybuffer) {
- body = toArrayBuffer(Buffer.concat(self2._body));
- } else if (capability.blobConstructor) {
- body = new global2.Blob(self2._body.map(function(buffer) {
- return toArrayBuffer(buffer);
- }), {
- type: (headersObj["content-type"] || {}).value || ""
- });
- } else {
- body = Buffer.concat(self2._body).toString();
- }
- }
- var headersList = [];
- Object.keys(headersObj).forEach(function(keyName) {
- var name = headersObj[keyName].name;
- var value = headersObj[keyName].value;
- if (Array.isArray(value)) {
- value.forEach(function(v) {
- headersList.push([name, v]);
- });
- } else {
- headersList.push([name, value]);
- }
- });
- if (self2._mode === "fetch") {
- var signal = null;
- var fetchTimer = null;
- if (capability.abortController) {
- var controller = new AbortController();
- signal = controller.signal;
- self2._fetchAbortController = controller;
- if ("requestTimeout" in opts && opts.requestTimeout !== 0) {
- self2._fetchTimer = global2.setTimeout(function() {
- self2.emit("requestTimeout");
- if (self2._fetchAbortController)
- self2._fetchAbortController.abort();
- }, opts.requestTimeout);
- }
- }
- global2.fetch(self2._opts.url, {
- method: self2._opts.method,
- headers: headersList,
- body: body || void 0,
- mode: "cors",
- credentials: opts.withCredentials ? "include" : "same-origin",
- signal
- }).then(function(response2) {
- self2._fetchResponse = response2;
- self2._connect();
- }, function(reason) {
- global2.clearTimeout(self2._fetchTimer);
- if (!self2._destroyed)
- self2.emit("error", reason);
- });
- } else {
- var xhr = self2._xhr = new global2.XMLHttpRequest();
- try {
- xhr.open(self2._opts.method, self2._opts.url, true);
- } catch (err) {
- process.nextTick(function() {
- self2.emit("error", err);
- });
- return;
- }
- if ("responseType" in xhr)
- xhr.responseType = self2._mode.split(":")[0];
- if ("withCredentials" in xhr)
- xhr.withCredentials = !!opts.withCredentials;
- if (self2._mode === "text" && "overrideMimeType" in xhr)
- xhr.overrideMimeType("text/plain; charset=x-user-defined");
- if ("requestTimeout" in opts) {
- xhr.timeout = opts.requestTimeout;
- xhr.ontimeout = function() {
- self2.emit("requestTimeout");
- };
- }
- headersList.forEach(function(header) {
- xhr.setRequestHeader(header[0], header[1]);
- });
- self2._response = null;
- xhr.onreadystatechange = function() {
- switch (xhr.readyState) {
- case rStates.LOADING:
- case rStates.DONE:
- self2._onXHRProgress();
- break;
- }
- };
- if (self2._mode === "moz-chunked-arraybuffer") {
- xhr.onprogress = function() {
- self2._onXHRProgress();
- };
- }
- xhr.onerror = function() {
- if (self2._destroyed)
- return;
- self2.emit("error", new Error("XHR error"));
- };
- try {
- xhr.send(body);
- } catch (err) {
- process.nextTick(function() {
- self2.emit("error", err);
- });
- return;
- }
- }
- };
- function statusValid(xhr) {
- try {
- var status = xhr.status;
- return status !== null && status !== 0;
- } catch (e) {
- return false;
- }
- }
- ClientRequest.prototype._onXHRProgress = function() {
- var self2 = this;
- if (!statusValid(self2._xhr) || self2._destroyed)
- return;
- if (!self2._response)
- self2._connect();
- self2._response._onXHRProgress();
- };
- ClientRequest.prototype._connect = function() {
- var self2 = this;
- if (self2._destroyed)
- return;
- self2._response = new IncomingMessage(self2._xhr, self2._fetchResponse, self2._mode, self2._fetchTimer);
- self2._response.on("error", function(err) {
- self2.emit("error", err);
- });
- self2.emit("response", self2._response);
- };
- ClientRequest.prototype._write = function(chunk, encoding, cb) {
- var self2 = this;
- self2._body.push(chunk);
- cb();
- };
- ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function() {
- var self2 = this;
- self2._destroyed = true;
- global2.clearTimeout(self2._fetchTimer);
- if (self2._response)
- self2._response._destroyed = true;
- if (self2._xhr)
- self2._xhr.abort();
- else if (self2._fetchAbortController)
- self2._fetchAbortController.abort();
- };
- ClientRequest.prototype.end = function(data, encoding, cb) {
- var self2 = this;
- if (typeof data === "function") {
- cb = data;
- data = void 0;
- }
- stream.Writable.prototype.end.call(self2, data, encoding, cb);
- };
- ClientRequest.prototype.flushHeaders = function() {
- };
- ClientRequest.prototype.setTimeout = function() {
- };
- ClientRequest.prototype.setNoDelay = function() {
- };
- ClientRequest.prototype.setSocketKeepAlive = function() {
- };
- var unsafeHeaders = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via"];
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("buffer").Buffer);
- }, { "./capability": 469, "./response": 471, "_process": 467, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.split.js": 307, "core-js/modules/web.dom-collections.for-each.js": 339, "inherits": 364, "readable-stream": 394, "to-arraybuffer": 415 }], 471: [function(require2, module3, exports3) {
- (function(process, global2, Buffer) {
- (function() {
- "use strict";
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/web.dom-collections.for-each.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.split.js");
- require2("core-js/modules/es.string.match.js");
- require2("core-js/modules/es.array.iterator.js");
- require2("core-js/modules/es.array-buffer.slice.js");
- require2("core-js/modules/es.typed-array.uint8-array.js");
- require2("core-js/modules/es.typed-array.copy-within.js");
- require2("core-js/modules/es.typed-array.every.js");
- require2("core-js/modules/es.typed-array.fill.js");
- require2("core-js/modules/es.typed-array.filter.js");
- require2("core-js/modules/es.typed-array.find.js");
- require2("core-js/modules/es.typed-array.find-index.js");
- require2("core-js/modules/es.typed-array.for-each.js");
- require2("core-js/modules/es.typed-array.includes.js");
- require2("core-js/modules/es.typed-array.index-of.js");
- require2("core-js/modules/es.typed-array.iterator.js");
- require2("core-js/modules/es.typed-array.join.js");
- require2("core-js/modules/es.typed-array.last-index-of.js");
- require2("core-js/modules/es.typed-array.map.js");
- require2("core-js/modules/es.typed-array.reduce.js");
- require2("core-js/modules/es.typed-array.reduce-right.js");
- require2("core-js/modules/es.typed-array.reverse.js");
- require2("core-js/modules/es.typed-array.set.js");
- require2("core-js/modules/es.typed-array.slice.js");
- require2("core-js/modules/es.typed-array.some.js");
- require2("core-js/modules/es.typed-array.sort.js");
- require2("core-js/modules/es.typed-array.subarray.js");
- require2("core-js/modules/es.typed-array.to-locale-string.js");
- require2("core-js/modules/es.typed-array.to-string.js");
- require2("core-js/modules/es.array.slice.js");
- var capability = require2("./capability");
- var inherits = require2("inherits");
- var stream = require2("readable-stream");
- var rStates = exports3.readyStates = {
- UNSENT: 0,
- OPENED: 1,
- HEADERS_RECEIVED: 2,
- LOADING: 3,
- DONE: 4
- };
- var IncomingMessage = exports3.IncomingMessage = function(xhr, response, mode, fetchTimer) {
- var self2 = this;
- stream.Readable.call(self2);
- self2._mode = mode;
- self2.headers = {};
- self2.rawHeaders = [];
- self2.trailers = {};
- self2.rawTrailers = [];
- self2.on("end", function() {
- process.nextTick(function() {
- self2.emit("close");
- });
- });
- if (mode === "fetch") {
- var read = function read2() {
- reader.read().then(function(result) {
- if (self2._destroyed)
- return;
- if (result.done) {
- global2.clearTimeout(fetchTimer);
- self2.push(null);
- return;
- }
- self2.push(new Buffer(result.value));
- read2();
- }).catch(function(err) {
- global2.clearTimeout(fetchTimer);
- if (!self2._destroyed)
- self2.emit("error", err);
- });
- };
- self2._fetchResponse = response;
- self2.url = response.url;
- self2.statusCode = response.status;
- self2.statusMessage = response.statusText;
- response.headers.forEach(function(header, key) {
- self2.headers[key.toLowerCase()] = header;
- self2.rawHeaders.push(key, header);
- });
- if (capability.writableStream) {
- var writable = new WritableStream({
- write: function write(chunk) {
- return new Promise(function(resolve, reject) {
- if (self2._destroyed) {
- reject();
- } else if (self2.push(new Buffer(chunk))) {
- resolve();
- } else {
- self2._resumeFetch = resolve;
- }
- });
- },
- close: function close() {
- global2.clearTimeout(fetchTimer);
- if (!self2._destroyed)
- self2.push(null);
- },
- abort: function abort(err) {
- if (!self2._destroyed)
- self2.emit("error", err);
- }
- });
- try {
- response.body.pipeTo(writable).catch(function(err) {
- global2.clearTimeout(fetchTimer);
- if (!self2._destroyed)
- self2.emit("error", err);
- });
- return;
- } catch (e) {
- }
- }
- var reader = response.body.getReader();
- read();
- } else {
- self2._xhr = xhr;
- self2._pos = 0;
- self2.url = xhr.responseURL;
- self2.statusCode = xhr.status;
- self2.statusMessage = xhr.statusText;
- var headers = xhr.getAllResponseHeaders().split(/\r?\n/);
- headers.forEach(function(header) {
- var matches = header.match(/^([^:]+):\s*(.*)/);
- if (matches) {
- var key = matches[1].toLowerCase();
- if (key === "set-cookie") {
- if (self2.headers[key] === void 0) {
- self2.headers[key] = [];
- }
- self2.headers[key].push(matches[2]);
- } else if (self2.headers[key] !== void 0) {
- self2.headers[key] += ", " + matches[2];
- } else {
- self2.headers[key] = matches[2];
- }
- self2.rawHeaders.push(matches[1], matches[2]);
- }
- });
- self2._charset = "x-user-defined";
- if (!capability.overrideMimeType) {
- var mimeType = self2.rawHeaders["mime-type"];
- if (mimeType) {
- var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/);
- if (charsetMatch) {
- self2._charset = charsetMatch[1].toLowerCase();
- }
- }
- if (!self2._charset)
- self2._charset = "utf-8";
- }
- }
- };
- inherits(IncomingMessage, stream.Readable);
- IncomingMessage.prototype._read = function() {
- var self2 = this;
- var resolve = self2._resumeFetch;
- if (resolve) {
- self2._resumeFetch = null;
- resolve();
- }
- };
- IncomingMessage.prototype._onXHRProgress = function() {
- var self2 = this;
- var xhr = self2._xhr;
- var response = null;
- switch (self2._mode) {
- case "text:vbarray":
- if (xhr.readyState !== rStates.DONE)
- break;
- try {
- response = new global2.VBArray(xhr.responseBody).toArray();
- } catch (e) {
- }
- if (response !== null) {
- self2.push(new Buffer(response));
- break;
- }
- case "text":
- try {
- response = xhr.responseText;
- } catch (e) {
- self2._mode = "text:vbarray";
- break;
- }
- if (response.length > self2._pos) {
- var newData = response.substr(self2._pos);
- if (self2._charset === "x-user-defined") {
- var buffer = new Buffer(newData.length);
- for (var i = 0; i < newData.length; i++) {
- buffer[i] = newData.charCodeAt(i) & 255;
- }
- self2.push(buffer);
- } else {
- self2.push(newData, self2._charset);
- }
- self2._pos = response.length;
- }
- break;
- case "arraybuffer":
- if (xhr.readyState !== rStates.DONE || !xhr.response)
- break;
- response = xhr.response;
- self2.push(new Buffer(new Uint8Array(response)));
- break;
- case "moz-chunked-arraybuffer":
- response = xhr.response;
- if (xhr.readyState !== rStates.LOADING || !response)
- break;
- self2.push(new Buffer(new Uint8Array(response)));
- break;
- case "ms-stream":
- response = xhr.response;
- if (xhr.readyState !== rStates.LOADING)
- break;
- var reader = new global2.MSStreamReader();
- reader.onprogress = function() {
- if (reader.result.byteLength > self2._pos) {
- self2.push(new Buffer(new Uint8Array(reader.result.slice(self2._pos))));
- self2._pos = reader.result.byteLength;
- }
- };
- reader.onload = function() {
- self2.push(null);
- };
- reader.readAsArrayBuffer(response);
- break;
- }
- if (self2._xhr.readyState === rStates.DONE && self2._mode !== "ms-stream") {
- self2.push(null);
- }
- };
- }).call(this);
- }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("buffer").Buffer);
- }, { "./capability": 469, "_process": 467, "buffer": 90, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.match.js": 304, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.typed-array.copy-within.js": 315, "core-js/modules/es.typed-array.every.js": 316, "core-js/modules/es.typed-array.fill.js": 317, "core-js/modules/es.typed-array.filter.js": 318, "core-js/modules/es.typed-array.find-index.js": 319, "core-js/modules/es.typed-array.find.js": 320, "core-js/modules/es.typed-array.for-each.js": 321, "core-js/modules/es.typed-array.includes.js": 322, "core-js/modules/es.typed-array.index-of.js": 323, "core-js/modules/es.typed-array.iterator.js": 324, "core-js/modules/es.typed-array.join.js": 325, "core-js/modules/es.typed-array.last-index-of.js": 326, "core-js/modules/es.typed-array.map.js": 327, "core-js/modules/es.typed-array.reduce-right.js": 328, "core-js/modules/es.typed-array.reduce.js": 329, "core-js/modules/es.typed-array.reverse.js": 330, "core-js/modules/es.typed-array.set.js": 331, "core-js/modules/es.typed-array.slice.js": 332, "core-js/modules/es.typed-array.some.js": 333, "core-js/modules/es.typed-array.sort.js": 334, "core-js/modules/es.typed-array.subarray.js": 335, "core-js/modules/es.typed-array.to-locale-string.js": 336, "core-js/modules/es.typed-array.to-string.js": 337, "core-js/modules/es.typed-array.uint8-array.js": 338, "core-js/modules/web.dom-collections.for-each.js": 339, "inherits": 364, "readable-stream": 394 }], 472: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.search.js");
- require2("core-js/modules/es.array.concat.js");
- require2("core-js/modules/es.string.split.js");
- require2("core-js/modules/es.string.replace.js");
- require2("core-js/modules/es.array.join.js");
- require2("core-js/modules/es.string.trim.js");
- require2("core-js/modules/es.string.match.js");
- require2("core-js/modules/es.array.slice.js");
- require2("core-js/modules/es.object.keys.js");
- require2("core-js/modules/es.array.splice.js");
- var punycode = require2("punycode");
- var util = require2("./util");
- exports3.parse = urlParse;
- exports3.resolve = urlResolve;
- exports3.resolveObject = urlResolveObject;
- exports3.format = urlFormat;
- exports3.Url = Url;
- function Url() {
- this.protocol = null;
- this.slashes = null;
- this.auth = null;
- this.host = null;
- this.port = null;
- this.hostname = null;
- this.hash = null;
- this.search = null;
- this.query = null;
- this.pathname = null;
- this.path = null;
- this.href = null;
- }
- var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, delims = ["<", ">", '"', "`", " ", "\r", "\n", " "], unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims), autoEscape = ["'"].concat(unwise), nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape), hostEndingChars = ["/", "?", "#"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {
- javascript: true,
- "javascript:": true
- }, hostlessProtocol = {
- javascript: true,
- "javascript:": true
- }, slashedProtocol = {
- http: true,
- https: true,
- ftp: true,
- gopher: true,
- file: true,
- "http:": true,
- "https:": true,
- "ftp:": true,
- "gopher:": true,
- "file:": true
- }, querystring2 = require2("querystring");
- function urlParse(url, parseQueryString, slashesDenoteHost) {
- if (url && util.isObject(url) && url instanceof Url)
- return url;
- var u = new Url();
- u.parse(url, parseQueryString, slashesDenoteHost);
- return u;
- }
- Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
- if (!util.isString(url)) {
- throw new TypeError("Parameter 'url' must be a string, not " + (0, _typeof2.default)(url));
- }
- var queryIndex = url.indexOf("?"), splitter = queryIndex !== -1 && queryIndex < url.indexOf("#") ? "?" : "#", uSplit = url.split(splitter), slashRegex = /\\/g;
- uSplit[0] = uSplit[0].replace(slashRegex, "/");
- url = uSplit.join(splitter);
- var rest = url;
- rest = rest.trim();
- if (!slashesDenoteHost && url.split("#").length === 1) {
- var simplePath = simplePathPattern.exec(rest);
- if (simplePath) {
- this.path = rest;
- this.href = rest;
- this.pathname = simplePath[1];
- if (simplePath[2]) {
- this.search = simplePath[2];
- if (parseQueryString) {
- this.query = querystring2.parse(this.search.substr(1));
- } else {
- this.query = this.search.substr(1);
- }
- } else if (parseQueryString) {
- this.search = "";
- this.query = {};
- }
- return this;
- }
- }
- var proto = protocolPattern.exec(rest);
- if (proto) {
- proto = proto[0];
- var lowerProto = proto.toLowerCase();
- this.protocol = lowerProto;
- rest = rest.substr(proto.length);
- }
- if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- var slashes = rest.substr(0, 2) === "//";
- if (slashes && !(proto && hostlessProtocol[proto])) {
- rest = rest.substr(2);
- this.slashes = true;
- }
- }
- if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
- var hostEnd = -1;
- for (var i = 0; i < hostEndingChars.length; i++) {
- var hec = rest.indexOf(hostEndingChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
- hostEnd = hec;
- }
- var auth, atSign;
- if (hostEnd === -1) {
- atSign = rest.lastIndexOf("@");
- } else {
- atSign = rest.lastIndexOf("@", hostEnd);
- }
- if (atSign !== -1) {
- auth = rest.slice(0, atSign);
- rest = rest.slice(atSign + 1);
- this.auth = decodeURIComponent(auth);
- }
- hostEnd = -1;
- for (var i = 0; i < nonHostChars.length; i++) {
- var hec = rest.indexOf(nonHostChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
- hostEnd = hec;
- }
- if (hostEnd === -1)
- hostEnd = rest.length;
- this.host = rest.slice(0, hostEnd);
- rest = rest.slice(hostEnd);
- this.parseHost();
- this.hostname = this.hostname || "";
- var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
- if (!ipv6Hostname) {
- var hostparts = this.hostname.split(".");
- for (var i = 0, l = hostparts.length; i < l; i++) {
- var part = hostparts[i];
- if (!part)
- continue;
- if (!part.match(hostnamePartPattern)) {
- var newpart = "";
- for (var j = 0, k = part.length; j < k; j++) {
- if (part.charCodeAt(j) > 127) {
- newpart += "x";
- } else {
- newpart += part[j];
- }
- }
- if (!newpart.match(hostnamePartPattern)) {
- var validParts = hostparts.slice(0, i);
- var notHost = hostparts.slice(i + 1);
- var bit = part.match(hostnamePartStart);
- if (bit) {
- validParts.push(bit[1]);
- notHost.unshift(bit[2]);
- }
- if (notHost.length) {
- rest = "/" + notHost.join(".") + rest;
- }
- this.hostname = validParts.join(".");
- break;
- }
- }
- }
- }
- if (this.hostname.length > hostnameMaxLen) {
- this.hostname = "";
- } else {
- this.hostname = this.hostname.toLowerCase();
- }
- if (!ipv6Hostname) {
- this.hostname = punycode.toASCII(this.hostname);
- }
- var p = this.port ? ":" + this.port : "";
- var h = this.hostname || "";
- this.host = h + p;
- this.href += this.host;
- if (ipv6Hostname) {
- this.hostname = this.hostname.substr(1, this.hostname.length - 2);
- if (rest[0] !== "/") {
- rest = "/" + rest;
- }
- }
- }
- if (!unsafeProtocol[lowerProto]) {
- for (var i = 0, l = autoEscape.length; i < l; i++) {
- var ae = autoEscape[i];
- if (rest.indexOf(ae) === -1)
- continue;
- var esc = encodeURIComponent(ae);
- if (esc === ae) {
- esc = escape(ae);
- }
- rest = rest.split(ae).join(esc);
- }
- }
- var hash = rest.indexOf("#");
- if (hash !== -1) {
- this.hash = rest.substr(hash);
- rest = rest.slice(0, hash);
- }
- var qm = rest.indexOf("?");
- if (qm !== -1) {
- this.search = rest.substr(qm);
- this.query = rest.substr(qm + 1);
- if (parseQueryString) {
- this.query = querystring2.parse(this.query);
- }
- rest = rest.slice(0, qm);
- } else if (parseQueryString) {
- this.search = "";
- this.query = {};
- }
- if (rest)
- this.pathname = rest;
- if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
- this.pathname = "/";
- }
- if (this.pathname || this.search) {
- var p = this.pathname || "";
- var s = this.search || "";
- this.path = p + s;
- }
- this.href = this.format();
- return this;
- };
- function urlFormat(obj) {
- if (util.isString(obj))
- obj = urlParse(obj);
- if (!(obj instanceof Url))
- return Url.prototype.format.call(obj);
- return obj.format();
- }
- Url.prototype.format = function() {
- var auth = this.auth || "";
- if (auth) {
- auth = encodeURIComponent(auth);
- auth = auth.replace(/%3A/i, ":");
- auth += "@";
- }
- var protocol = this.protocol || "", pathname = this.pathname || "", hash = this.hash || "", host = false, query = "";
- if (this.host) {
- host = auth + this.host;
- } else if (this.hostname) {
- host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]");
- if (this.port) {
- host += ":" + this.port;
- }
- }
- if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
- query = querystring2.stringify(this.query);
- }
- var search = this.search || query && "?" + query || "";
- if (protocol && protocol.substr(-1) !== ":")
- protocol += ":";
- if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
- host = "//" + (host || "");
- if (pathname && pathname.charAt(0) !== "/")
- pathname = "/" + pathname;
- } else if (!host) {
- host = "";
- }
- if (hash && hash.charAt(0) !== "#")
- hash = "#" + hash;
- if (search && search.charAt(0) !== "?")
- search = "?" + search;
- pathname = pathname.replace(/[?#]/g, function(match) {
- return encodeURIComponent(match);
- });
- search = search.replace("#", "%23");
- return protocol + host + pathname + search + hash;
- };
- function urlResolve(source, relative) {
- return urlParse(source, false, true).resolve(relative);
- }
- Url.prototype.resolve = function(relative) {
- return this.resolveObject(urlParse(relative, false, true)).format();
- };
- function urlResolveObject(source, relative) {
- if (!source)
- return relative;
- return urlParse(source, false, true).resolveObject(relative);
- }
- Url.prototype.resolveObject = function(relative) {
- if (util.isString(relative)) {
- var rel = new Url();
- rel.parse(relative, false, true);
- relative = rel;
- }
- var result = new Url();
- var tkeys = Object.keys(this);
- for (var tk = 0; tk < tkeys.length; tk++) {
- var tkey = tkeys[tk];
- result[tkey] = this[tkey];
- }
- result.hash = relative.hash;
- if (relative.href === "") {
- result.href = result.format();
- return result;
- }
- if (relative.slashes && !relative.protocol) {
- var rkeys = Object.keys(relative);
- for (var rk = 0; rk < rkeys.length; rk++) {
- var rkey = rkeys[rk];
- if (rkey !== "protocol")
- result[rkey] = relative[rkey];
- }
- if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
- result.path = result.pathname = "/";
- }
- result.href = result.format();
- return result;
- }
- if (relative.protocol && relative.protocol !== result.protocol) {
- if (!slashedProtocol[relative.protocol]) {
- var keys = Object.keys(relative);
- for (var v = 0; v < keys.length; v++) {
- var k = keys[v];
- result[k] = relative[k];
- }
- result.href = result.format();
- return result;
- }
- result.protocol = relative.protocol;
- if (!relative.host && !hostlessProtocol[relative.protocol]) {
- var relPath = (relative.pathname || "").split("/");
- while (relPath.length && !(relative.host = relPath.shift())) {
- ;
- }
- if (!relative.host)
- relative.host = "";
- if (!relative.hostname)
- relative.hostname = "";
- if (relPath[0] !== "")
- relPath.unshift("");
- if (relPath.length < 2)
- relPath.unshift("");
- result.pathname = relPath.join("/");
- } else {
- result.pathname = relative.pathname;
- }
- result.search = relative.search;
- result.query = relative.query;
- result.host = relative.host || "";
- result.auth = relative.auth;
- result.hostname = relative.hostname || relative.host;
- result.port = relative.port;
- if (result.pathname || result.search) {
- var p = result.pathname || "";
- var s = result.search || "";
- result.path = p + s;
- }
- result.slashes = result.slashes || relative.slashes;
- result.href = result.format();
- return result;
- }
- var isSourceAbs = result.pathname && result.pathname.charAt(0) === "/", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === "/", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split("/") || [], relPath = relative.pathname && relative.pathname.split("/") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];
- if (psychotic) {
- result.hostname = "";
- result.port = null;
- if (result.host) {
- if (srcPath[0] === "")
- srcPath[0] = result.host;
- else
- srcPath.unshift(result.host);
- }
- result.host = "";
- if (relative.protocol) {
- relative.hostname = null;
- relative.port = null;
- if (relative.host) {
- if (relPath[0] === "")
- relPath[0] = relative.host;
- else
- relPath.unshift(relative.host);
- }
- relative.host = null;
- }
- mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
- }
- if (isRelAbs) {
- result.host = relative.host || relative.host === "" ? relative.host : result.host;
- result.hostname = relative.hostname || relative.hostname === "" ? relative.hostname : result.hostname;
- result.search = relative.search;
- result.query = relative.query;
- srcPath = relPath;
- } else if (relPath.length) {
- if (!srcPath)
- srcPath = [];
- srcPath.pop();
- srcPath = srcPath.concat(relPath);
- result.search = relative.search;
- result.query = relative.query;
- } else if (!util.isNullOrUndefined(relative.search)) {
- if (psychotic) {
- result.hostname = result.host = srcPath.shift();
- var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
- if (authInHost) {
- result.auth = authInHost.shift();
- result.host = result.hostname = authInHost.shift();
- }
- }
- result.search = relative.search;
- result.query = relative.query;
- if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
- result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
- }
- result.href = result.format();
- return result;
- }
- if (!srcPath.length) {
- result.pathname = null;
- if (result.search) {
- result.path = "/" + result.search;
- } else {
- result.path = null;
- }
- result.href = result.format();
- return result;
- }
- var last = srcPath.slice(-1)[0];
- var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === "." || last === "..") || last === "";
- var up = 0;
- for (var i = srcPath.length; i >= 0; i--) {
- last = srcPath[i];
- if (last === ".") {
- srcPath.splice(i, 1);
- } else if (last === "..") {
- srcPath.splice(i, 1);
- up++;
- } else if (up) {
- srcPath.splice(i, 1);
- up--;
- }
- }
- if (!mustEndAbs && !removeAllDots) {
- for (; up--; up) {
- srcPath.unshift("..");
- }
- }
- if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) {
- srcPath.unshift("");
- }
- if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
- srcPath.push("");
- }
- var isAbsolute = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/";
- if (psychotic) {
- result.hostname = result.host = isAbsolute ? "" : srcPath.length ? srcPath.shift() : "";
- var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
- if (authInHost) {
- result.auth = authInHost.shift();
- result.host = result.hostname = authInHost.shift();
- }
- }
- mustEndAbs = mustEndAbs || result.host && srcPath.length;
- if (mustEndAbs && !isAbsolute) {
- srcPath.unshift("");
- }
- if (!srcPath.length) {
- result.pathname = null;
- result.path = null;
- } else {
- result.pathname = srcPath.join("/");
- }
- if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
- result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
- }
- result.auth = relative.auth || result.auth;
- result.slashes = result.slashes || relative.slashes;
- result.href = result.format();
- return result;
- };
- Url.prototype.parseHost = function() {
- var host = this.host;
- var port = portPattern.exec(host);
- if (port) {
- port = port[0];
- if (port !== ":") {
- this.port = port.substr(1);
- }
- host = host.substr(0, host.length - port.length);
- }
- if (host)
- this.hostname = host;
- };
- }, { "./util": 473, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.array.splice.js": 283, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.match.js": 304, "core-js/modules/es.string.replace.js": 305, "core-js/modules/es.string.search.js": 306, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.string.trim.js": 308, "punycode": 382, "querystring": 385 }], 473: [function(require2, module3, exports3) {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- module3.exports = {
- isString: function isString(arg) {
- return typeof arg === "string";
- },
- isObject: function isObject(arg) {
- return (0, _typeof2.default)(arg) === "object" && arg !== null;
- },
- isNull: function isNull(arg) {
- return arg === null;
- },
- isNullOrUndefined: function isNullOrUndefined(arg) {
- return arg == null;
- }
- };
- }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79 }], 474: [function(require2, module3, exports3) {
- "use strict";
- require2("core-js/modules/es.number.constructor.js");
- exports3.encodeURIComponent = function(text) {
- try {
- return encodeURIComponent(text);
- } catch (e) {
- return text;
- }
- };
- exports3.escape = require2("escape-html");
- exports3.timestamp = function timestamp(t) {
- if (t) {
- var v = t;
- if (typeof v === "string") {
- v = Number(v);
- }
- if (String(t).length === 10) {
- v *= 1e3;
- }
- return new Date(v);
- }
- return Math.round(Date.now() / 1e3);
- };
- }, { "core-js/modules/es.number.constructor.js": 286, "escape-html": 343 }], 475: [function(require2, module3, exports3) {
- (function(process, Buffer) {
- (function() {
- "use strict";
- var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
- var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
- require2("core-js/modules/es.string.trim.js");
- require2("core-js/modules/es.regexp.exec.js");
- require2("core-js/modules/es.string.split.js");
- require2("core-js/modules/es.object.to-string.js");
- require2("core-js/modules/es.promise.js");
- require2("core-js/modules/es.function.name.js");
- require2("core-js/modules/es.array.concat.js");
- var util = require2("util");
- var urlutil = require2("url");
- var http = require2("http");
- var https = require2("https");
- var debug = require2("debug")("urllib");
- var ms = require2("humanize-ms");
- var REQUEST_ID = 0;
- var MAX_VALUE = Math.pow(2, 31) - 10;
- var PROTO_RE = /^https?:\/\//i;
- function getAgent(agent, defaultAgent) {
- return agent === void 0 ? defaultAgent : agent;
- }
- function parseContentType(str) {
- if (!str) {
- return "";
- }
- return str.split(";")[0].trim().toLowerCase();
- }
- function makeCallback(resolve, reject) {
- return function(err, data, res) {
- if (err) {
- return reject(err);
- }
- resolve({
- data,
- status: res.statusCode,
- headers: res.headers,
- res
- });
- };
- }
- exports3.TIMEOUTS = [ms("300s"), ms("300s")];
- var TEXT_DATA_TYPES = ["json", "text"];
- exports3.request = function request(url, args, callback) {
- if (arguments.length === 2 && typeof args === "function") {
- callback = args;
- args = null;
- }
- if (typeof callback === "function") {
- return exports3.requestWithCallback(url, args, callback);
- }
- return new Promise(function(resolve, reject) {
- exports3.requestWithCallback(url, args, makeCallback(resolve, reject));
- });
- };
- exports3.requestWithCallback = function requestWithCallback(url, args, callback) {
- if (!url || typeof url !== "string" && (0, _typeof2.default)(url) !== "object") {
- var msg = util.format("expect request url to be a string or a http request options, but got %j", url);
- throw new Error(msg);
- }
- if (arguments.length === 2 && typeof args === "function") {
- callback = args;
- args = null;
- }
- args = args || {};
- if (REQUEST_ID >= MAX_VALUE) {
- REQUEST_ID = 0;
- }
- var reqId = ++REQUEST_ID;
- args.requestUrls = args.requestUrls || [];
- var reqMeta = {
- requestId: reqId,
- url,
- args,
- ctx: args.ctx
- };
- if (args.emitter) {
- args.emitter.emit("request", reqMeta);
- }
- args.timeout = args.timeout || exports3.TIMEOUTS;
- args.maxRedirects = args.maxRedirects || 10;
- args.streaming = args.streaming || args.customResponse;
- var requestStartTime = Date.now();
- var parsedUrl;
- if (typeof url === "string") {
- if (!PROTO_RE.test(url)) {
- url = "https://" + url;
- }
- parsedUrl = urlutil.parse(url);
- } else {
- parsedUrl = url;
- }
- var method = (args.type || args.method || parsedUrl.method || "GET").toUpperCase();
- var port = parsedUrl.port || 80;
- var httplib = http;
- var agent = getAgent(args.agent, exports3.agent);
- var fixJSONCtlChars = args.fixJSONCtlChars;
- if (parsedUrl.protocol === "https:") {
- httplib = https;
- agent = getAgent(args.httpsAgent, exports3.httpsAgent);
- if (!parsedUrl.port) {
- port = 443;
- }
- }
- var options = {
- host: parsedUrl.hostname || parsedUrl.host || "localhost",
- path: parsedUrl.path || "/",
- method,
- port,
- agent,
- headers: args.headers || {},
- // default is dns.lookup
- // https://github.com/nodejs/node/blob/master/lib/net.js#L986
- // custom dnslookup require node >= 4.0.0
- // https://github.com/nodejs/node/blob/archived-io.js-v0.12/lib/net.js#L952
- lookup: args.lookup
- };
- if (Array.isArray(args.timeout)) {
- options.requestTimeout = args.timeout[args.timeout.length - 1];
- } else if (typeof args.timeout !== "undefined") {
- options.requestTimeout = args.timeout;
- }
- var auth = args.auth || parsedUrl.auth;
- if (auth) {
- options.auth = auth;
- }
- var body = args.content || args.data;
- var dataAsQueryString = method === "GET" || method === "HEAD" || args.dataAsQueryString;
- if (!args.content) {
- if (body && !(typeof body === "string" || Buffer.isBuffer(body))) {
- if (dataAsQueryString) {
- body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body);
- } else {
- var contentType = options.headers["Content-Type"] || options.headers["content-type"];
- if (!contentType) {
- if (args.contentType === "json") {
- contentType = "application/json";
- } else {
- contentType = "application/x-www-form-urlencoded";
- }
- options.headers["Content-Type"] = contentType;
- }
- if (parseContentType(contentType) === "application/json") {
- body = JSON.stringify(body);
- } else {
- body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body);
- }
- }
- }
- }
- if (dataAsQueryString && body) {
- options.path += (parsedUrl.query ? "&" : "?") + body;
- body = null;
- }
- var requestSize = 0;
- if (body) {
- var length = body.length;
- if (!Buffer.isBuffer(body)) {
- length = Buffer.byteLength(body);
- }
- requestSize = options.headers["Content-Length"] = length;
- }
- if (args.dataType === "json") {
- options.headers.Accept = "application/json";
- }
- if (typeof args.beforeRequest === "function") {
- args.beforeRequest(options);
- }
- var connectTimer = null;
- var responseTimer = null;
- var __err = null;
- var connected = false;
- var keepAliveSocket = false;
- var responseSize = 0;
- var statusCode = -1;
- var responseAborted = false;
- var remoteAddress = "";
- var remotePort = "";
- var timing = null;
- if (args.timing) {
- timing = {
- // socket assigned
- queuing: 0,
- // dns lookup time
- dnslookup: 0,
- // socket connected
- connected: 0,
- // request sent
- requestSent: 0,
- // Time to first byte (TTFB)
- waiting: 0,
- contentDownload: 0
- };
- }
- function cancelConnectTimer() {
- if (connectTimer) {
- clearTimeout(connectTimer);
- connectTimer = null;
- }
- }
- function cancelResponseTimer() {
- if (responseTimer) {
- clearTimeout(responseTimer);
- responseTimer = null;
- }
- }
- function done(err, data, res) {
- cancelResponseTimer();
- if (!callback) {
- console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!", Date(), reqId, process.pid, options.method, url);
- if (err) {
- console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s: %s\nstack: %s", Date(), reqId, process.pid, err.name, err.message, err.stack);
- }
- return;
- }
- var cb = callback;
- callback = null;
- var headers = {};
- if (res) {
- statusCode = res.statusCode;
- headers = res.headers;
- }
- var requestUseTime = Date.now() - requestStartTime;
- if (timing) {
- timing.contentDownload = requestUseTime;
- }
- debug("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j", requestUseTime, responseSize, statusCode, options.method, options.host, options.path, keepAliveSocket, timing);
- var response = {
- status: statusCode,
- statusCode,
- headers,
- size: responseSize,
- aborted: responseAborted,
- rt: requestUseTime,
- keepAliveSocket,
- data,
- requestUrls: args.requestUrls,
- timing,
- remoteAddress,
- remotePort
- };
- if (err) {
- var agentStatus = "";
- if (agent && typeof agent.getCurrentStatus === "function") {
- agentStatus = ", agent status: " + JSON.stringify(agent.getCurrentStatus());
- }
- err.message += ", " + options.method + " " + url + " " + statusCode + " (connected: " + connected + ", keepalive socket: " + keepAliveSocket + agentStatus + ")\nheaders: " + JSON.stringify(headers);
- err.data = data;
- err.path = options.path;
- err.status = statusCode;
- err.headers = headers;
- err.res = response;
- }
- cb(err, data, args.streaming ? res : response);
- if (args.emitter) {
- reqMeta.url = url;
- reqMeta.socket = req && req.connection;
- reqMeta.options = options;
- reqMeta.size = requestSize;
- args.emitter.emit("response", {
- requestId: reqId,
- error: err,
- ctx: args.ctx,
- req: reqMeta,
- res: response
- });
- }
- }
- function handleRedirect(res) {
- var err = null;
- if (args.followRedirect && statuses.redirect[res.statusCode]) {
- args._followRedirectCount = (args._followRedirectCount || 0) + 1;
- var location2 = res.headers.location;
- if (!location2) {
- err = new Error("Got statusCode " + res.statusCode + " but cannot resolve next location from headers");
- err.name = "FollowRedirectError";
- } else if (args._followRedirectCount > args.maxRedirects) {
- err = new Error("Exceeded maxRedirects. Probably stuck in a redirect loop " + url);
- err.name = "MaxRedirectError";
- } else {
- var newUrl = args.formatRedirectUrl ? args.formatRedirectUrl(url, location2) : urlutil.resolve(url, location2);
- debug("Request#%d %s: `redirected` from %s to %s", reqId, options.path, url, newUrl);
- cancelResponseTimer();
- if (args.headers && args.headers.Host && PROTO_RE.test(location2)) {
- args.headers.Host = null;
- }
- var cb = callback;
- callback = null;
- exports3.requestWithCallback(newUrl, args, cb);
- return {
- redirect: true,
- error: null
- };
- }
- }
- return {
- redirect: false,
- error: err
- };
- }
- if (args.gzip) {
- if (!options.headers["Accept-Encoding"] && !options.headers["accept-encoding"]) {
- options.headers["Accept-Encoding"] = "gzip";
- }
- }
- function decodeContent(res, body2, cb) {
- var encoding = res.headers["content-encoding"];
- return cb(null, body2, encoding);
- }
- var writeStream = args.writeStream;
- debug("Request#%d %s %s with headers %j, options.path: %s", reqId, method, url, options.headers, options.path);
- args.requestUrls.push(url);
- function onResponse(res) {
- if (timing) {
- timing.waiting = Date.now() - requestStartTime;
- }
- debug("Request#%d %s `req response` event emit: status %d, headers: %j", reqId, url, res.statusCode, res.headers);
- if (args.streaming) {
- var result = handleRedirect(res);
- if (result.redirect) {
- res.resume();
- return;
- }
- if (result.error) {
- res.resume();
- return done(result.error, null, res);
- }
- return done(null, null, res);
- }
- res.on("close", function() {
- debug("Request#%d %s: `res close` event emit, total size %d", reqId, url, responseSize);
- });
- res.on("error", function() {
- debug("Request#%d %s: `res error` event emit, total size %d", reqId, url, responseSize);
- });
- res.on("aborted", function() {
- responseAborted = true;
- debug("Request#%d %s: `res aborted` event emit, total size %d", reqId, url, responseSize);
- });
- if (writeStream) {
- var _result = handleRedirect(res);
- if (_result.redirect) {
- res.resume();
- return;
- }
- if (_result.error) {
- res.resume();
- writeStream.end();
- return done(_result.error, null, res);
- }
- if (args.consumeWriteStream === false) {
- res.on("end", done.bind(null, null, null, res));
- } else {
- if (false) {
- } else {
- writeStream.on("close", function() {
- debug("Request#%d %s: writeStream close event emitted", reqId, url);
- done(__err || null, null, res);
- });
- }
- }
- return res.pipe(writeStream);
- }
- var chunks = [];
- res.on("data", function(chunk) {
- debug("Request#%d %s: `res data` event emit, size %d", reqId, url, chunk.length);
- responseSize += chunk.length;
- chunks.push(chunk);
- });
- res.on("end", function() {
- var body2 = Buffer.concat(chunks, responseSize);
- debug("Request#%d %s: `res end` event emit, total size %d, _dumped: %s", reqId, url, responseSize, res._dumped);
- if (__err) {
- return done(__err, body2, res);
- }
- var result2 = handleRedirect(res);
- if (result2.error) {
- return done(result2.error, body2, res);
- }
- if (result2.redirect) {
- return;
- }
- decodeContent(res, body2, function(err, data, encoding) {
- if (err) {
- return done(err, body2, res);
- }
- if (!encoding && TEXT_DATA_TYPES.indexOf(args.dataType) >= 0) {
- try {
- data = decodeBodyByCharset(data, res);
- } catch (e) {
- debug("decodeBodyByCharset error: %s", e);
- return done(null, data, res);
- }
- if (args.dataType === "json") {
- if (responseSize === 0) {
- data = null;
- } else {
- var r = parseJSON(data, fixJSONCtlChars);
- if (r.error) {
- err = r.error;
- } else {
- data = r.data;
- }
- }
- }
- }
- if (responseAborted) {
- debug("Request#%d %s: Remote socket was terminated before `response.end()` was called", reqId, url);
- }
- done(err, data, res);
- });
- });
- }
- var connectTimeout, responseTimeout;
- if (Array.isArray(args.timeout)) {
- connectTimeout = ms(args.timeout[0]);
- responseTimeout = ms(args.timeout[1]);
- } else {
- connectTimeout = responseTimeout = ms(args.timeout);
- }
- debug("ConnectTimeout: %d, ResponseTimeout: %d", connectTimeout, responseTimeout);
- function startConnectTimer() {
- debug("Connect timer ticking, timeout: %d", connectTimeout);
- connectTimer = setTimeout(function() {
- connectTimer = null;
- if (statusCode === -1) {
- statusCode = -2;
- }
- var msg2 = "Connect timeout for " + connectTimeout + "ms";
- var errorName = "ConnectionTimeoutError";
- if (!req.socket) {
- errorName = "SocketAssignTimeoutError";
- msg2 += ", working sockets is full";
- }
- __err = new Error(msg2);
- __err.name = errorName;
- __err.requestId = reqId;
- debug("ConnectTimeout: Request#%d %s %s: %s, connected: %s", reqId, url, __err.name, msg2, connected);
- abortRequest();
- }, connectTimeout);
- }
- function startResposneTimer() {
- debug("Response timer ticking, timeout: %d", responseTimeout);
- responseTimer = setTimeout(function() {
- responseTimer = null;
- var msg2 = "Response timeout for " + responseTimeout + "ms";
- var errorName = "ResponseTimeoutError";
- __err = new Error(msg2);
- __err.name = errorName;
- __err.requestId = reqId;
- debug("ResponseTimeout: Request#%d %s %s: %s, connected: %s", reqId, url, __err.name, msg2, connected);
- abortRequest();
- }, responseTimeout);
- }
- var req;
- options.mode = args.mode ? args.mode : "";
- try {
- req = httplib.request(options, onResponse);
- } catch (err) {
- return done(err);
- }
- if (typeof window === "undefined") {
- startConnectTimer();
- } else {
- req.on("requestTimeout", function() {
- if (statusCode === -1) {
- statusCode = -2;
- }
- var msg2 = "Connect timeout for " + connectTimeout + "ms";
- var errorName = "ConnectionTimeoutError";
- __err = new Error(msg2);
- __err.name = errorName;
- __err.requestId = reqId;
- abortRequest();
- });
- }
- function abortRequest() {
- debug("Request#%d %s abort, connected: %s", reqId, url, connected);
- if (!req.socket) {
- __err.noSocket = true;
- done(__err);
- }
- req.abort();
- }
- if (timing) {
- req.on("finish", function() {
- timing.requestSent = Date.now() - requestStartTime;
- });
- }
- req.once("socket", function(socket) {
- if (timing) {
- timing.queuing = Date.now() - requestStartTime;
- }
- var readyState = socket.readyState;
- if (readyState === "opening") {
- socket.once("lookup", function(err, ip, addressType) {
- debug("Request#%d %s lookup: %s, %s, %s", reqId, url, err, ip, addressType);
- if (timing) {
- timing.dnslookup = Date.now() - requestStartTime;
- }
- if (ip) {
- remoteAddress = ip;
- }
- });
- socket.once("connect", function() {
- if (timing) {
- timing.connected = Date.now() - requestStartTime;
- }
- cancelConnectTimer();
- startResposneTimer();
- debug("Request#%d %s new socket connected", reqId, url);
- connected = true;
- if (!remoteAddress) {
- remoteAddress = socket.remoteAddress;
- }
- remotePort = socket.remotePort;
- });
- return;
- }
- debug("Request#%d %s reuse socket connected, readyState: %s", reqId, url, readyState);
- connected = true;
- keepAliveSocket = true;
- if (!remoteAddress) {
- remoteAddress = socket.remoteAddress;
- }
- remotePort = socket.remotePort;
- cancelConnectTimer();
- startResposneTimer();
- });
- req.on("error", function(err) {
- if (err.name === "Error" || err.name === "TypeError") {
- err.name = connected ? "ResponseError" : "RequestError";
- }
- err.message += ' (req "error")';
- debug("Request#%d %s `req error` event emit, %s: %s", reqId, url, err.name, err.message);
- done(__err || err);
- });
- if (writeStream) {
- writeStream.once("error", function(err) {
- err.message += ' (writeStream "error")';
- __err = err;
- debug("Request#%d %s `writeStream error` event emit, %s: %s", reqId, url, err.name, err.message);
- abortRequest();
- });
- }
- if (args.stream) {
- args.stream.pipe(req);
- args.stream.once("error", function(err) {
- err.message += ' (stream "error")';
- __err = err;
- debug("Request#%d %s `readStream error` event emit, %s: %s", reqId, url, err.name, err.message);
- abortRequest();
- });
- } else {
- req.end(body);
- }
- req.requestId = reqId;
- return req;
- };
- }).call(this);
- }).call(this, require2("_process"), require2("buffer").Buffer);
- }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "_process": 467, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.string.trim.js": 308, "debug": 465, "http": 468, "https": 355, "humanize-ms": 356, "url": 472, "util": 419 }] }, {}, [1])(1);
- });
- })(window);
- }
- });
- export default require_aliyun_oss_sdk();
- /*! Bundled license information:
- ali-oss/dist/aliyun-oss-sdk.js:
- (*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
- * @license MIT
- *)
- (*!
- * Bowser - a browser detector
- * https://github.com/ded/bowser
- * MIT License | (c) Dustin Diaz 2015
- *)
- (*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- *)
- (*!
- * copy-to - index.js
- * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
- * MIT Licensed
- *)
- (*!
- * escape-html
- * Copyright(c) 2012-2013 TJ Holowaychuk
- * Copyright(c) 2015 Andreas Lubbe
- * Copyright(c) 2015 Tiancheng "Timothy" Gu
- * MIT Licensed
- *)
- (*!
- * humanize-ms - index.js
- * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
- * MIT Licensed
- *)
- (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
- (*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- *)
- (*!
- * merge-descriptors
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- *)
- (*
- object-assign
- (c) Sindre Sorhus
- @license MIT
- *)
- (*!
- * Platform.js v1.3.6
- * Copyright 2014-2020 Benjamin Tan
- * Copyright 2011-2013 John-David Dalton
- * Available under MIT license
- *)
- (*! https://mths.be/punycode v1.4.1 by @mathias *)
- (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
- */
- //# sourceMappingURL=ali-oss.js.map
|