server.mjs 202 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906
  1. import { hasInjectionContext, getCurrentInstance, defineComponent, createElementBlock, ref, inject, h, Suspense, Fragment, createApp, provide, shallowReactive, toRef, onErrorCaptured, onServerPrefetch, unref, createVNode, resolveDynamicComponent, reactive, effectScope, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, defineAsyncComponent, mergeProps, getCurrentScope, useSSRContext } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/vue@3.5.14_typescript@5.8.3/node_modules/vue/index.mjs';
  2. import ft from 'node:http';
  3. import Qa from 'node:https';
  4. import Ye from 'node:zlib';
  5. import ie, { PassThrough, pipeline } from 'node:stream';
  6. import { Buffer as Buffer$1 } from 'node:buffer';
  7. import { promisify, deprecate, types } from 'node:util';
  8. import { format } from 'node:url';
  9. import { isIP } from 'node:net';
  10. import { promises, statSync, createReadStream } from 'node:fs';
  11. import { basename } from 'node:path';
  12. import destr from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs';
  13. import { hasProtocol, isScriptProtocol, joinURL, withQuery, withBase } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs';
  14. import { b as baseURL } from '../_/renderer.mjs';
  15. import { createHooks } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs';
  16. import { getContext, executeAsync } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unctx@2.4.1/node_modules/unctx/dist/index.mjs';
  17. import { sanitizeStatusCode, createError as createError$1, appendHeader } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/h3@1.15.3/node_modules/h3/dist/index.mjs';
  18. import { RouterView, createMemoryHistory, createRouter, START_LOCATION } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/vue-router@4.5.1_vue@3.5.14_typescript@5.8.3_/node_modules/vue-router/dist/vue-router.node.mjs';
  19. import { toRouteMatcher, createRouter as createRouter$1 } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs';
  20. import { defu } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs';
  21. import { ssrRenderSuspense, ssrRenderComponent, ssrRenderVNode, ssrRenderAttrs, ssrRenderAttr, ssrInterpolate } from 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/vue@3.5.14_typescript@5.8.3/node_modules/vue/server-renderer/index.mjs';
  22. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/vue-bundle-renderer@2.1.1/node_modules/vue-bundle-renderer/dist/runtime.mjs';
  23. import '../nitro/nitro.mjs';
  24. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/ofetch@1.4.1/node_modules/ofetch/dist/node.mjs';
  25. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/node-mock-http@1.0.0/node_modules/node-mock-http/dist/index.mjs';
  26. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_ioredis@5.6.1/node_modules/unstorage/dist/index.mjs';
  27. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_ioredis@5.6.1/node_modules/unstorage/drivers/fs.mjs';
  28. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_ioredis@5.6.1/node_modules/unstorage/drivers/fs-lite.mjs';
  29. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_ioredis@5.6.1/node_modules/unstorage/drivers/lru-cache.mjs';
  30. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs';
  31. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs';
  32. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs';
  33. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs';
  34. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/server.mjs';
  35. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/devalue@5.1.1/node_modules/devalue/index.js';
  36. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/utils.mjs';
  37. import 'file:///Users/yuxin/local/code/ccdw-website/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/plugins.mjs';
  38. var __typeError = (msg) => {
  39. throw TypeError(msg);
  40. };
  41. var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
  42. var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
  43. var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
  44. var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
  45. var _e, _t, _r, _n, _a, _e2, _t2, _b, _e3, _c, _e4, _t3, _d, _e5, _f;
  46. var t = Object.defineProperty;
  47. var o$1 = (e, l) => t(e, "name", { value: l, configurable: true });
  48. var n$2 = typeof globalThis < "u" ? globalThis : typeof global < "u" ? global : typeof self < "u" ? self : {};
  49. function f(e) {
  50. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  51. }
  52. o$1(f, "getDefaultExportFromCjs");
  53. var Va = Object.defineProperty;
  54. var n$1 = (i, o2) => Va(i, "name", { value: o2, configurable: true });
  55. function ts(i) {
  56. if (!/^data:/i.test(i)) throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
  57. i = i.replace(/\r?\n/g, "");
  58. const o2 = i.indexOf(",");
  59. if (o2 === -1 || o2 <= 4) throw new TypeError("malformed data: URI");
  60. const a = i.substring(5, o2).split(";");
  61. let l = "", u = false;
  62. const m = a[0] || "text/plain";
  63. let h2 = m;
  64. for (let A = 1; A < a.length; A++) a[A] === "base64" ? u = true : a[A] && (h2 += `;${a[A]}`, a[A].indexOf("charset=") === 0 && (l = a[A].substring(8)));
  65. !a[0] && !l.length && (h2 += ";charset=US-ASCII", l = "US-ASCII");
  66. const S = u ? "base64" : "ascii", E = unescape(i.substring(o2 + 1)), w = Buffer.from(E, S);
  67. return w.type = m, w.typeFull = h2, w.charset = l, w;
  68. }
  69. n$1(ts, "dataUriToBuffer");
  70. var Eo = {}, ct = { exports: {} };
  71. /**
  72. * @license
  73. * web-streams-polyfill v3.3.3
  74. * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
  75. * This code is released under the MIT license.
  76. * SPDX-License-Identifier: MIT
  77. */
  78. var rs = ct.exports, vo;
  79. function ns() {
  80. return vo || (vo = 1, function(i, o2) {
  81. (function(a, l) {
  82. l(o2);
  83. })(rs, function(a) {
  84. function l() {
  85. }
  86. n$1(l, "noop");
  87. function u(e) {
  88. return typeof e == "object" && e !== null || typeof e == "function";
  89. }
  90. n$1(u, "typeIsObject");
  91. const m = l;
  92. function h2(e, t2) {
  93. try {
  94. Object.defineProperty(e, "name", { value: t2, configurable: true });
  95. } catch {
  96. }
  97. }
  98. n$1(h2, "setFunctionName");
  99. const S = Promise, E = Promise.prototype.then, w = Promise.reject.bind(S);
  100. function A(e) {
  101. return new S(e);
  102. }
  103. n$1(A, "newPromise");
  104. function T2(e) {
  105. return A((t2) => t2(e));
  106. }
  107. n$1(T2, "promiseResolvedWith");
  108. function b(e) {
  109. return w(e);
  110. }
  111. n$1(b, "promiseRejectedWith");
  112. function q(e, t2, r2) {
  113. return E.call(e, t2, r2);
  114. }
  115. n$1(q, "PerformPromiseThen");
  116. function g(e, t2, r2) {
  117. q(q(e, t2, r2), void 0, m);
  118. }
  119. n$1(g, "uponPromise");
  120. function V(e, t2) {
  121. g(e, t2);
  122. }
  123. n$1(V, "uponFulfillment");
  124. function I(e, t2) {
  125. g(e, void 0, t2);
  126. }
  127. n$1(I, "uponRejection");
  128. function F(e, t2, r2) {
  129. return q(e, t2, r2);
  130. }
  131. n$1(F, "transformPromiseWith");
  132. function Q(e) {
  133. q(e, void 0, m);
  134. }
  135. n$1(Q, "setPromiseIsHandledToTrue");
  136. let se = n$1((e) => {
  137. if (typeof queueMicrotask == "function") se = queueMicrotask;
  138. else {
  139. const t2 = T2(void 0);
  140. se = n$1((r2) => q(t2, r2), "_queueMicrotask");
  141. }
  142. return se(e);
  143. }, "_queueMicrotask");
  144. function O(e, t2, r2) {
  145. if (typeof e != "function") throw new TypeError("Argument is not a function");
  146. return Function.prototype.apply.call(e, t2, r2);
  147. }
  148. n$1(O, "reflectCall");
  149. function z(e, t2, r2) {
  150. try {
  151. return T2(O(e, t2, r2));
  152. } catch (s) {
  153. return b(s);
  154. }
  155. }
  156. n$1(z, "promiseCall");
  157. const $ = 16384;
  158. const _M = class _M {
  159. constructor() {
  160. this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;
  161. }
  162. get length() {
  163. return this._size;
  164. }
  165. push(t2) {
  166. const r2 = this._back;
  167. let s = r2;
  168. r2._elements.length === $ - 1 && (s = { _elements: [], _next: void 0 }), r2._elements.push(t2), s !== r2 && (this._back = s, r2._next = s), ++this._size;
  169. }
  170. shift() {
  171. const t2 = this._front;
  172. let r2 = t2;
  173. const s = this._cursor;
  174. let f2 = s + 1;
  175. const c = t2._elements, d = c[s];
  176. return f2 === $ && (r2 = t2._next, f2 = 0), --this._size, this._cursor = f2, t2 !== r2 && (this._front = r2), c[s] = void 0, d;
  177. }
  178. forEach(t2) {
  179. let r2 = this._cursor, s = this._front, f2 = s._elements;
  180. for (; (r2 !== f2.length || s._next !== void 0) && !(r2 === f2.length && (s = s._next, f2 = s._elements, r2 = 0, f2.length === 0)); ) t2(f2[r2]), ++r2;
  181. }
  182. peek() {
  183. const t2 = this._front, r2 = this._cursor;
  184. return t2._elements[r2];
  185. }
  186. };
  187. n$1(_M, "SimpleQueue");
  188. let M = _M;
  189. const pt = Symbol("[[AbortSteps]]"), an = Symbol("[[ErrorSteps]]"), ar = Symbol("[[CancelSteps]]"), sr = Symbol("[[PullSteps]]"), ur = Symbol("[[ReleaseSteps]]");
  190. function sn(e, t2) {
  191. e._ownerReadableStream = t2, t2._reader = e, t2._state === "readable" ? fr(e) : t2._state === "closed" ? ri(e) : un(e, t2._storedError);
  192. }
  193. n$1(sn, "ReadableStreamReaderGenericInitialize");
  194. function lr(e, t2) {
  195. const r2 = e._ownerReadableStream;
  196. return X(r2, t2);
  197. }
  198. n$1(lr, "ReadableStreamReaderGenericCancel");
  199. function ue(e) {
  200. const t2 = e._ownerReadableStream;
  201. t2._state === "readable" ? cr(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : ni(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t2._readableStreamController[ur](), t2._reader = void 0, e._ownerReadableStream = void 0;
  202. }
  203. n$1(ue, "ReadableStreamReaderGenericRelease");
  204. function yt(e) {
  205. return new TypeError("Cannot " + e + " a stream using a released reader");
  206. }
  207. n$1(yt, "readerLockException");
  208. function fr(e) {
  209. e._closedPromise = A((t2, r2) => {
  210. e._closedPromise_resolve = t2, e._closedPromise_reject = r2;
  211. });
  212. }
  213. n$1(fr, "defaultReaderClosedPromiseInitialize");
  214. function un(e, t2) {
  215. fr(e), cr(e, t2);
  216. }
  217. n$1(un, "defaultReaderClosedPromiseInitializeAsRejected");
  218. function ri(e) {
  219. fr(e), ln(e);
  220. }
  221. n$1(ri, "defaultReaderClosedPromiseInitializeAsResolved");
  222. function cr(e, t2) {
  223. e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t2), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
  224. }
  225. n$1(cr, "defaultReaderClosedPromiseReject");
  226. function ni(e, t2) {
  227. un(e, t2);
  228. }
  229. n$1(ni, "defaultReaderClosedPromiseResetToRejected");
  230. function ln(e) {
  231. e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
  232. }
  233. n$1(ln, "defaultReaderClosedPromiseResolve");
  234. const fn = Number.isFinite || function(e) {
  235. return typeof e == "number" && isFinite(e);
  236. }, oi = Math.trunc || function(e) {
  237. return e < 0 ? Math.ceil(e) : Math.floor(e);
  238. };
  239. function ii(e) {
  240. return typeof e == "object" || typeof e == "function";
  241. }
  242. n$1(ii, "isDictionary");
  243. function ne(e, t2) {
  244. if (e !== void 0 && !ii(e)) throw new TypeError(`${t2} is not an object.`);
  245. }
  246. n$1(ne, "assertDictionary");
  247. function G(e, t2) {
  248. if (typeof e != "function") throw new TypeError(`${t2} is not a function.`);
  249. }
  250. n$1(G, "assertFunction");
  251. function ai(e) {
  252. return typeof e == "object" && e !== null || typeof e == "function";
  253. }
  254. n$1(ai, "isObject");
  255. function cn(e, t2) {
  256. if (!ai(e)) throw new TypeError(`${t2} is not an object.`);
  257. }
  258. n$1(cn, "assertObject");
  259. function le(e, t2, r2) {
  260. if (e === void 0) throw new TypeError(`Parameter ${t2} is required in '${r2}'.`);
  261. }
  262. n$1(le, "assertRequiredArgument");
  263. function dr(e, t2, r2) {
  264. if (e === void 0) throw new TypeError(`${t2} is required in '${r2}'.`);
  265. }
  266. n$1(dr, "assertRequiredField");
  267. function hr(e) {
  268. return Number(e);
  269. }
  270. n$1(hr, "convertUnrestrictedDouble");
  271. function dn(e) {
  272. return e === 0 ? 0 : e;
  273. }
  274. n$1(dn, "censorNegativeZero");
  275. function si(e) {
  276. return dn(oi(e));
  277. }
  278. n$1(si, "integerPart");
  279. function mr(e, t2) {
  280. const s = Number.MAX_SAFE_INTEGER;
  281. let f2 = Number(e);
  282. if (f2 = dn(f2), !fn(f2)) throw new TypeError(`${t2} is not a finite number`);
  283. if (f2 = si(f2), f2 < 0 || f2 > s) throw new TypeError(`${t2} is outside the accepted range of 0 to ${s}, inclusive`);
  284. return !fn(f2) || f2 === 0 ? 0 : f2;
  285. }
  286. n$1(mr, "convertUnsignedLongLongWithEnforceRange");
  287. function br(e, t2) {
  288. if (!Te(e)) throw new TypeError(`${t2} is not a ReadableStream.`);
  289. }
  290. n$1(br, "assertReadableStream");
  291. function ze(e) {
  292. return new ye(e);
  293. }
  294. n$1(ze, "AcquireReadableStreamDefaultReader");
  295. function hn(e, t2) {
  296. e._reader._readRequests.push(t2);
  297. }
  298. n$1(hn, "ReadableStreamAddReadRequest");
  299. function pr(e, t2, r2) {
  300. const f2 = e._reader._readRequests.shift();
  301. r2 ? f2._closeSteps() : f2._chunkSteps(t2);
  302. }
  303. n$1(pr, "ReadableStreamFulfillReadRequest");
  304. function gt(e) {
  305. return e._reader._readRequests.length;
  306. }
  307. n$1(gt, "ReadableStreamGetNumReadRequests");
  308. function mn(e) {
  309. const t2 = e._reader;
  310. return !(t2 === void 0 || !ge(t2));
  311. }
  312. n$1(mn, "ReadableStreamHasDefaultReader");
  313. const _ye = class _ye {
  314. constructor(t2) {
  315. if (le(t2, 1, "ReadableStreamDefaultReader"), br(t2, "First parameter"), Ce(t2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
  316. sn(this, t2), this._readRequests = new M();
  317. }
  318. get closed() {
  319. return ge(this) ? this._closedPromise : b(_t4("closed"));
  320. }
  321. cancel(t2 = void 0) {
  322. return ge(this) ? this._ownerReadableStream === void 0 ? b(yt("cancel")) : lr(this, t2) : b(_t4("cancel"));
  323. }
  324. read() {
  325. if (!ge(this)) return b(_t4("read"));
  326. if (this._ownerReadableStream === void 0) return b(yt("read from"));
  327. let t2, r2;
  328. const s = A((c, d) => {
  329. t2 = c, r2 = d;
  330. });
  331. return et(this, { _chunkSteps: n$1((c) => t2({ value: c, done: false }), "_chunkSteps"), _closeSteps: n$1(() => t2({ value: void 0, done: true }), "_closeSteps"), _errorSteps: n$1((c) => r2(c), "_errorSteps") }), s;
  332. }
  333. releaseLock() {
  334. if (!ge(this)) throw _t4("releaseLock");
  335. this._ownerReadableStream !== void 0 && ui(this);
  336. }
  337. };
  338. n$1(_ye, "ReadableStreamDefaultReader");
  339. let ye = _ye;
  340. Object.defineProperties(ye.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), h2(ye.prototype.cancel, "cancel"), h2(ye.prototype.read, "read"), h2(ye.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ye.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });
  341. function ge(e) {
  342. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_readRequests") ? false : e instanceof ye;
  343. }
  344. n$1(ge, "IsReadableStreamDefaultReader");
  345. function et(e, t2) {
  346. const r2 = e._ownerReadableStream;
  347. r2._disturbed = true, r2._state === "closed" ? t2._closeSteps() : r2._state === "errored" ? t2._errorSteps(r2._storedError) : r2._readableStreamController[sr](t2);
  348. }
  349. n$1(et, "ReadableStreamDefaultReaderRead");
  350. function ui(e) {
  351. ue(e);
  352. const t2 = new TypeError("Reader was released");
  353. bn(e, t2);
  354. }
  355. n$1(ui, "ReadableStreamDefaultReaderRelease");
  356. function bn(e, t2) {
  357. const r2 = e._readRequests;
  358. e._readRequests = new M(), r2.forEach((s) => {
  359. s._errorSteps(t2);
  360. });
  361. }
  362. n$1(bn, "ReadableStreamDefaultReaderErrorReadRequests");
  363. function _t4(e) {
  364. return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`);
  365. }
  366. n$1(_t4, "defaultReaderBrandCheckException");
  367. const li = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {
  368. }).prototype);
  369. const _pn = class _pn {
  370. constructor(t2, r2) {
  371. this._ongoingPromise = void 0, this._isFinished = false, this._reader = t2, this._preventCancel = r2;
  372. }
  373. next() {
  374. const t2 = n$1(() => this._nextSteps(), "nextSteps");
  375. return this._ongoingPromise = this._ongoingPromise ? F(this._ongoingPromise, t2, t2) : t2(), this._ongoingPromise;
  376. }
  377. return(t2) {
  378. const r2 = n$1(() => this._returnSteps(t2), "returnSteps");
  379. return this._ongoingPromise ? F(this._ongoingPromise, r2, r2) : r2();
  380. }
  381. _nextSteps() {
  382. if (this._isFinished) return Promise.resolve({ value: void 0, done: true });
  383. const t2 = this._reader;
  384. let r2, s;
  385. const f2 = A((d, p) => {
  386. r2 = d, s = p;
  387. });
  388. return et(t2, { _chunkSteps: n$1((d) => {
  389. this._ongoingPromise = void 0, se(() => r2({ value: d, done: false }));
  390. }, "_chunkSteps"), _closeSteps: n$1(() => {
  391. this._ongoingPromise = void 0, this._isFinished = true, ue(t2), r2({ value: void 0, done: true });
  392. }, "_closeSteps"), _errorSteps: n$1((d) => {
  393. this._ongoingPromise = void 0, this._isFinished = true, ue(t2), s(d);
  394. }, "_errorSteps") }), f2;
  395. }
  396. _returnSteps(t2) {
  397. if (this._isFinished) return Promise.resolve({ value: t2, done: true });
  398. this._isFinished = true;
  399. const r2 = this._reader;
  400. if (!this._preventCancel) {
  401. const s = lr(r2, t2);
  402. return ue(r2), F(s, () => ({ value: t2, done: true }));
  403. }
  404. return ue(r2), T2({ value: t2, done: true });
  405. }
  406. };
  407. n$1(_pn, "ReadableStreamAsyncIteratorImpl");
  408. let pn = _pn;
  409. const yn = { next() {
  410. return gn(this) ? this._asyncIteratorImpl.next() : b(_n2("next"));
  411. }, return(e) {
  412. return gn(this) ? this._asyncIteratorImpl.return(e) : b(_n2("return"));
  413. } };
  414. Object.setPrototypeOf(yn, li);
  415. function fi(e, t2) {
  416. const r2 = ze(e), s = new pn(r2, t2), f2 = Object.create(yn);
  417. return f2._asyncIteratorImpl = s, f2;
  418. }
  419. n$1(fi, "AcquireReadableStreamAsyncIterator");
  420. function gn(e) {
  421. if (!u(e) || !Object.prototype.hasOwnProperty.call(e, "_asyncIteratorImpl")) return false;
  422. try {
  423. return e._asyncIteratorImpl instanceof pn;
  424. } catch {
  425. return false;
  426. }
  427. }
  428. n$1(gn, "IsReadableStreamAsyncIterator");
  429. function _n2(e) {
  430. return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`);
  431. }
  432. n$1(_n2, "streamAsyncIteratorBrandCheckException");
  433. const Sn = Number.isNaN || function(e) {
  434. return e !== e;
  435. };
  436. var yr, gr, _r2;
  437. function tt(e) {
  438. return e.slice();
  439. }
  440. n$1(tt, "CreateArrayFromList");
  441. function wn(e, t2, r2, s, f2) {
  442. new Uint8Array(e).set(new Uint8Array(r2, s, f2), t2);
  443. }
  444. n$1(wn, "CopyDataBlockBytes");
  445. let fe = n$1((e) => (typeof e.transfer == "function" ? fe = n$1((t2) => t2.transfer(), "TransferArrayBuffer") : typeof structuredClone == "function" ? fe = n$1((t2) => structuredClone(t2, { transfer: [t2] }), "TransferArrayBuffer") : fe = n$1((t2) => t2, "TransferArrayBuffer"), fe(e)), "TransferArrayBuffer"), _e6 = n$1((e) => (typeof e.detached == "boolean" ? _e6 = n$1((t2) => t2.detached, "IsDetachedBuffer") : _e6 = n$1((t2) => t2.byteLength === 0, "IsDetachedBuffer"), _e6(e)), "IsDetachedBuffer");
  446. function Rn(e, t2, r2) {
  447. if (e.slice) return e.slice(t2, r2);
  448. const s = r2 - t2, f2 = new ArrayBuffer(s);
  449. return wn(f2, 0, e, t2, s), f2;
  450. }
  451. n$1(Rn, "ArrayBufferSlice");
  452. function St(e, t2) {
  453. const r2 = e[t2];
  454. if (r2 != null) {
  455. if (typeof r2 != "function") throw new TypeError(`${String(t2)} is not a function`);
  456. return r2;
  457. }
  458. }
  459. n$1(St, "GetMethod");
  460. function ci(e) {
  461. const t2 = { [Symbol.iterator]: () => e.iterator }, r2 = async function* () {
  462. return yield* t2;
  463. }(), s = r2.next;
  464. return { iterator: r2, nextMethod: s, done: false };
  465. }
  466. n$1(ci, "CreateAsyncFromSyncIterator");
  467. const Sr = (_r2 = (yr = Symbol.asyncIterator) !== null && yr !== void 0 ? yr : (gr = Symbol.for) === null || gr === void 0 ? void 0 : gr.call(Symbol, "Symbol.asyncIterator")) !== null && _r2 !== void 0 ? _r2 : "@@asyncIterator";
  468. function Tn(e, t2 = "sync", r2) {
  469. if (r2 === void 0) if (t2 === "async") {
  470. if (r2 = St(e, Sr), r2 === void 0) {
  471. const c = St(e, Symbol.iterator), d = Tn(e, "sync", c);
  472. return ci(d);
  473. }
  474. } else r2 = St(e, Symbol.iterator);
  475. if (r2 === void 0) throw new TypeError("The object is not iterable");
  476. const s = O(r2, e, []);
  477. if (!u(s)) throw new TypeError("The iterator method must return an object");
  478. const f2 = s.next;
  479. return { iterator: s, nextMethod: f2, done: false };
  480. }
  481. n$1(Tn, "GetIterator");
  482. function di(e) {
  483. const t2 = O(e.nextMethod, e.iterator, []);
  484. if (!u(t2)) throw new TypeError("The iterator.next() method must return an object");
  485. return t2;
  486. }
  487. n$1(di, "IteratorNext");
  488. function hi(e) {
  489. return !!e.done;
  490. }
  491. n$1(hi, "IteratorComplete");
  492. function mi(e) {
  493. return e.value;
  494. }
  495. n$1(mi, "IteratorValue");
  496. function bi(e) {
  497. return !(typeof e != "number" || Sn(e) || e < 0);
  498. }
  499. n$1(bi, "IsNonNegativeNumber");
  500. function Cn(e) {
  501. const t2 = Rn(e.buffer, e.byteOffset, e.byteOffset + e.byteLength);
  502. return new Uint8Array(t2);
  503. }
  504. n$1(Cn, "CloneAsUint8Array");
  505. function wr(e) {
  506. const t2 = e._queue.shift();
  507. return e._queueTotalSize -= t2.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t2.value;
  508. }
  509. n$1(wr, "DequeueValue");
  510. function Rr(e, t2, r2) {
  511. if (!bi(r2) || r2 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
  512. e._queue.push({ value: t2, size: r2 }), e._queueTotalSize += r2;
  513. }
  514. n$1(Rr, "EnqueueValueWithSize");
  515. function pi(e) {
  516. return e._queue.peek().value;
  517. }
  518. n$1(pi, "PeekQueueValue");
  519. function Se(e) {
  520. e._queue = new M(), e._queueTotalSize = 0;
  521. }
  522. n$1(Se, "ResetQueue");
  523. function Pn(e) {
  524. return e === DataView;
  525. }
  526. n$1(Pn, "isDataViewConstructor");
  527. function yi(e) {
  528. return Pn(e.constructor);
  529. }
  530. n$1(yi, "isDataView");
  531. function gi(e) {
  532. return Pn(e) ? 1 : e.BYTES_PER_ELEMENT;
  533. }
  534. n$1(gi, "arrayBufferViewElementSize");
  535. const _ve = class _ve {
  536. constructor() {
  537. throw new TypeError("Illegal constructor");
  538. }
  539. get view() {
  540. if (!Tr(this)) throw Ar("view");
  541. return this._view;
  542. }
  543. respond(t2) {
  544. if (!Tr(this)) throw Ar("respond");
  545. if (le(t2, 1, "respond"), t2 = mr(t2, "First parameter"), this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
  546. if (_e6(this._view.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");
  547. Ct(this._associatedReadableByteStreamController, t2);
  548. }
  549. respondWithNewView(t2) {
  550. if (!Tr(this)) throw Ar("respondWithNewView");
  551. if (le(t2, 1, "respondWithNewView"), !ArrayBuffer.isView(t2)) throw new TypeError("You can only respond with array buffer views");
  552. if (this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
  553. if (_e6(t2.buffer)) throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");
  554. Pt(this._associatedReadableByteStreamController, t2);
  555. }
  556. };
  557. n$1(_ve, "ReadableStreamBYOBRequest");
  558. let ve = _ve;
  559. Object.defineProperties(ve.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), h2(ve.prototype.respond, "respond"), h2(ve.prototype.respondWithNewView, "respondWithNewView"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ve.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true });
  560. const _ce = class _ce {
  561. constructor() {
  562. throw new TypeError("Illegal constructor");
  563. }
  564. get byobRequest() {
  565. if (!Ae(this)) throw nt("byobRequest");
  566. return vr(this);
  567. }
  568. get desiredSize() {
  569. if (!Ae(this)) throw nt("desiredSize");
  570. return Fn(this);
  571. }
  572. close() {
  573. if (!Ae(this)) throw nt("close");
  574. if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
  575. const t2 = this._controlledReadableByteStream._state;
  576. if (t2 !== "readable") throw new TypeError(`The stream (in ${t2} state) is not in the readable state and cannot be closed`);
  577. rt(this);
  578. }
  579. enqueue(t2) {
  580. if (!Ae(this)) throw nt("enqueue");
  581. if (le(t2, 1, "enqueue"), !ArrayBuffer.isView(t2)) throw new TypeError("chunk must be an array buffer view");
  582. if (t2.byteLength === 0) throw new TypeError("chunk must have non-zero byteLength");
  583. if (t2.buffer.byteLength === 0) throw new TypeError("chunk's buffer must have non-zero byteLength");
  584. if (this._closeRequested) throw new TypeError("stream is closed or draining");
  585. const r2 = this._controlledReadableByteStream._state;
  586. if (r2 !== "readable") throw new TypeError(`The stream (in ${r2} state) is not in the readable state and cannot be enqueued to`);
  587. Tt(this, t2);
  588. }
  589. error(t2 = void 0) {
  590. if (!Ae(this)) throw nt("error");
  591. Z(this, t2);
  592. }
  593. [ar](t2) {
  594. En(this), Se(this);
  595. const r2 = this._cancelAlgorithm(t2);
  596. return Rt(this), r2;
  597. }
  598. [sr](t2) {
  599. const r2 = this._controlledReadableByteStream;
  600. if (this._queueTotalSize > 0) {
  601. In(this, t2);
  602. return;
  603. }
  604. const s = this._autoAllocateChunkSize;
  605. if (s !== void 0) {
  606. let f2;
  607. try {
  608. f2 = new ArrayBuffer(s);
  609. } catch (d) {
  610. t2._errorSteps(d);
  611. return;
  612. }
  613. const c = { buffer: f2, bufferByteLength: s, byteOffset: 0, byteLength: s, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };
  614. this._pendingPullIntos.push(c);
  615. }
  616. hn(r2, t2), Be(this);
  617. }
  618. [ur]() {
  619. if (this._pendingPullIntos.length > 0) {
  620. const t2 = this._pendingPullIntos.peek();
  621. t2.readerType = "none", this._pendingPullIntos = new M(), this._pendingPullIntos.push(t2);
  622. }
  623. }
  624. };
  625. n$1(_ce, "ReadableByteStreamController");
  626. let ce = _ce;
  627. Object.defineProperties(ce.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), h2(ce.prototype.close, "close"), h2(ce.prototype.enqueue, "enqueue"), h2(ce.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ce.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true });
  628. function Ae(e) {
  629. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledReadableByteStream") ? false : e instanceof ce;
  630. }
  631. n$1(Ae, "IsReadableByteStreamController");
  632. function Tr(e) {
  633. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_associatedReadableByteStreamController") ? false : e instanceof ve;
  634. }
  635. n$1(Tr, "IsReadableStreamBYOBRequest");
  636. function Be(e) {
  637. if (!Ti(e)) return;
  638. if (e._pulling) {
  639. e._pullAgain = true;
  640. return;
  641. }
  642. e._pulling = true;
  643. const r2 = e._pullAlgorithm();
  644. g(r2, () => (e._pulling = false, e._pullAgain && (e._pullAgain = false, Be(e)), null), (s) => (Z(e, s), null));
  645. }
  646. n$1(Be, "ReadableByteStreamControllerCallPullIfNeeded");
  647. function En(e) {
  648. Pr(e), e._pendingPullIntos = new M();
  649. }
  650. n$1(En, "ReadableByteStreamControllerClearPendingPullIntos");
  651. function Cr(e, t2) {
  652. let r2 = false;
  653. e._state === "closed" && (r2 = true);
  654. const s = vn(t2);
  655. t2.readerType === "default" ? pr(e, s, r2) : Bi(e, s, r2);
  656. }
  657. n$1(Cr, "ReadableByteStreamControllerCommitPullIntoDescriptor");
  658. function vn(e) {
  659. const t2 = e.bytesFilled, r2 = e.elementSize;
  660. return new e.viewConstructor(e.buffer, e.byteOffset, t2 / r2);
  661. }
  662. n$1(vn, "ReadableByteStreamControllerConvertPullIntoDescriptor");
  663. function wt(e, t2, r2, s) {
  664. e._queue.push({ buffer: t2, byteOffset: r2, byteLength: s }), e._queueTotalSize += s;
  665. }
  666. n$1(wt, "ReadableByteStreamControllerEnqueueChunkToQueue");
  667. function An(e, t2, r2, s) {
  668. let f2;
  669. try {
  670. f2 = Rn(t2, r2, r2 + s);
  671. } catch (c) {
  672. throw Z(e, c), c;
  673. }
  674. wt(e, f2, 0, s);
  675. }
  676. n$1(An, "ReadableByteStreamControllerEnqueueClonedChunkToQueue");
  677. function Bn(e, t2) {
  678. t2.bytesFilled > 0 && An(e, t2.buffer, t2.byteOffset, t2.bytesFilled), je(e);
  679. }
  680. n$1(Bn, "ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");
  681. function Wn(e, t2) {
  682. const r2 = Math.min(e._queueTotalSize, t2.byteLength - t2.bytesFilled), s = t2.bytesFilled + r2;
  683. let f2 = r2, c = false;
  684. const d = s % t2.elementSize, p = s - d;
  685. p >= t2.minimumFill && (f2 = p - t2.bytesFilled, c = true);
  686. const R = e._queue;
  687. for (; f2 > 0; ) {
  688. const y = R.peek(), C = Math.min(f2, y.byteLength), P = t2.byteOffset + t2.bytesFilled;
  689. wn(t2.buffer, P, y.buffer, y.byteOffset, C), y.byteLength === C ? R.shift() : (y.byteOffset += C, y.byteLength -= C), e._queueTotalSize -= C, kn(e, C, t2), f2 -= C;
  690. }
  691. return c;
  692. }
  693. n$1(Wn, "ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");
  694. function kn(e, t2, r2) {
  695. r2.bytesFilled += t2;
  696. }
  697. n$1(kn, "ReadableByteStreamControllerFillHeadPullIntoDescriptor");
  698. function qn(e) {
  699. e._queueTotalSize === 0 && e._closeRequested ? (Rt(e), lt(e._controlledReadableByteStream)) : Be(e);
  700. }
  701. n$1(qn, "ReadableByteStreamControllerHandleQueueDrain");
  702. function Pr(e) {
  703. e._byobRequest !== null && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = null, e._byobRequest = null);
  704. }
  705. n$1(Pr, "ReadableByteStreamControllerInvalidateBYOBRequest");
  706. function Er(e) {
  707. for (; e._pendingPullIntos.length > 0; ) {
  708. if (e._queueTotalSize === 0) return;
  709. const t2 = e._pendingPullIntos.peek();
  710. Wn(e, t2) && (je(e), Cr(e._controlledReadableByteStream, t2));
  711. }
  712. }
  713. n$1(Er, "ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");
  714. function _i(e) {
  715. const t2 = e._controlledReadableByteStream._reader;
  716. for (; t2._readRequests.length > 0; ) {
  717. if (e._queueTotalSize === 0) return;
  718. const r2 = t2._readRequests.shift();
  719. In(e, r2);
  720. }
  721. }
  722. n$1(_i, "ReadableByteStreamControllerProcessReadRequestsUsingQueue");
  723. function Si(e, t2, r2, s) {
  724. const f2 = e._controlledReadableByteStream, c = t2.constructor, d = gi(c), { byteOffset: p, byteLength: R } = t2, y = r2 * d;
  725. let C;
  726. try {
  727. C = fe(t2.buffer);
  728. } catch (B) {
  729. s._errorSteps(B);
  730. return;
  731. }
  732. const P = { buffer: C, bufferByteLength: C.byteLength, byteOffset: p, byteLength: R, bytesFilled: 0, minimumFill: y, elementSize: d, viewConstructor: c, readerType: "byob" };
  733. if (e._pendingPullIntos.length > 0) {
  734. e._pendingPullIntos.push(P), Ln(f2, s);
  735. return;
  736. }
  737. if (f2._state === "closed") {
  738. const B = new c(P.buffer, P.byteOffset, 0);
  739. s._closeSteps(B);
  740. return;
  741. }
  742. if (e._queueTotalSize > 0) {
  743. if (Wn(e, P)) {
  744. const B = vn(P);
  745. qn(e), s._chunkSteps(B);
  746. return;
  747. }
  748. if (e._closeRequested) {
  749. const B = new TypeError("Insufficient bytes to fill elements in the given buffer");
  750. Z(e, B), s._errorSteps(B);
  751. return;
  752. }
  753. }
  754. e._pendingPullIntos.push(P), Ln(f2, s), Be(e);
  755. }
  756. n$1(Si, "ReadableByteStreamControllerPullInto");
  757. function wi(e, t2) {
  758. t2.readerType === "none" && je(e);
  759. const r2 = e._controlledReadableByteStream;
  760. if (Br(r2)) for (; Dn(r2) > 0; ) {
  761. const s = je(e);
  762. Cr(r2, s);
  763. }
  764. }
  765. n$1(wi, "ReadableByteStreamControllerRespondInClosedState");
  766. function Ri(e, t2, r2) {
  767. if (kn(e, t2, r2), r2.readerType === "none") {
  768. Bn(e, r2), Er(e);
  769. return;
  770. }
  771. if (r2.bytesFilled < r2.minimumFill) return;
  772. je(e);
  773. const s = r2.bytesFilled % r2.elementSize;
  774. if (s > 0) {
  775. const f2 = r2.byteOffset + r2.bytesFilled;
  776. An(e, r2.buffer, f2 - s, s);
  777. }
  778. r2.bytesFilled -= s, Cr(e._controlledReadableByteStream, r2), Er(e);
  779. }
  780. n$1(Ri, "ReadableByteStreamControllerRespondInReadableState");
  781. function On(e, t2) {
  782. const r2 = e._pendingPullIntos.peek();
  783. Pr(e), e._controlledReadableByteStream._state === "closed" ? wi(e, r2) : Ri(e, t2, r2), Be(e);
  784. }
  785. n$1(On, "ReadableByteStreamControllerRespondInternal");
  786. function je(e) {
  787. return e._pendingPullIntos.shift();
  788. }
  789. n$1(je, "ReadableByteStreamControllerShiftPendingPullInto");
  790. function Ti(e) {
  791. const t2 = e._controlledReadableByteStream;
  792. return t2._state !== "readable" || e._closeRequested || !e._started ? false : !!(mn(t2) && gt(t2) > 0 || Br(t2) && Dn(t2) > 0 || Fn(e) > 0);
  793. }
  794. n$1(Ti, "ReadableByteStreamControllerShouldCallPull");
  795. function Rt(e) {
  796. e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0;
  797. }
  798. n$1(Rt, "ReadableByteStreamControllerClearAlgorithms");
  799. function rt(e) {
  800. const t2 = e._controlledReadableByteStream;
  801. if (!(e._closeRequested || t2._state !== "readable")) {
  802. if (e._queueTotalSize > 0) {
  803. e._closeRequested = true;
  804. return;
  805. }
  806. if (e._pendingPullIntos.length > 0) {
  807. const r2 = e._pendingPullIntos.peek();
  808. if (r2.bytesFilled % r2.elementSize !== 0) {
  809. const s = new TypeError("Insufficient bytes to fill elements in the given buffer");
  810. throw Z(e, s), s;
  811. }
  812. }
  813. Rt(e), lt(t2);
  814. }
  815. }
  816. n$1(rt, "ReadableByteStreamControllerClose");
  817. function Tt(e, t2) {
  818. const r2 = e._controlledReadableByteStream;
  819. if (e._closeRequested || r2._state !== "readable") return;
  820. const { buffer: s, byteOffset: f2, byteLength: c } = t2;
  821. if (_e6(s)) throw new TypeError("chunk's buffer is detached and so cannot be enqueued");
  822. const d = fe(s);
  823. if (e._pendingPullIntos.length > 0) {
  824. const p = e._pendingPullIntos.peek();
  825. if (_e6(p.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");
  826. Pr(e), p.buffer = fe(p.buffer), p.readerType === "none" && Bn(e, p);
  827. }
  828. if (mn(r2)) if (_i(e), gt(r2) === 0) wt(e, d, f2, c);
  829. else {
  830. e._pendingPullIntos.length > 0 && je(e);
  831. const p = new Uint8Array(d, f2, c);
  832. pr(r2, p, false);
  833. }
  834. else Br(r2) ? (wt(e, d, f2, c), Er(e)) : wt(e, d, f2, c);
  835. Be(e);
  836. }
  837. n$1(Tt, "ReadableByteStreamControllerEnqueue");
  838. function Z(e, t2) {
  839. const r2 = e._controlledReadableByteStream;
  840. r2._state === "readable" && (En(e), Se(e), Rt(e), lo(r2, t2));
  841. }
  842. n$1(Z, "ReadableByteStreamControllerError");
  843. function In(e, t2) {
  844. const r2 = e._queue.shift();
  845. e._queueTotalSize -= r2.byteLength, qn(e);
  846. const s = new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength);
  847. t2._chunkSteps(s);
  848. }
  849. n$1(In, "ReadableByteStreamControllerFillReadRequestFromQueue");
  850. function vr(e) {
  851. if (e._byobRequest === null && e._pendingPullIntos.length > 0) {
  852. const t2 = e._pendingPullIntos.peek(), r2 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), s = Object.create(ve.prototype);
  853. Pi(s, e, r2), e._byobRequest = s;
  854. }
  855. return e._byobRequest;
  856. }
  857. n$1(vr, "ReadableByteStreamControllerGetBYOBRequest");
  858. function Fn(e) {
  859. const t2 = e._controlledReadableByteStream._state;
  860. return t2 === "errored" ? null : t2 === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
  861. }
  862. n$1(Fn, "ReadableByteStreamControllerGetDesiredSize");
  863. function Ct(e, t2) {
  864. const r2 = e._pendingPullIntos.peek();
  865. if (e._controlledReadableByteStream._state === "closed") {
  866. if (t2 !== 0) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
  867. } else {
  868. if (t2 === 0) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");
  869. if (r2.bytesFilled + t2 > r2.byteLength) throw new RangeError("bytesWritten out of range");
  870. }
  871. r2.buffer = fe(r2.buffer), On(e, t2);
  872. }
  873. n$1(Ct, "ReadableByteStreamControllerRespond");
  874. function Pt(e, t2) {
  875. const r2 = e._pendingPullIntos.peek();
  876. if (e._controlledReadableByteStream._state === "closed") {
  877. if (t2.byteLength !== 0) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream");
  878. } else if (t2.byteLength === 0) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");
  879. if (r2.byteOffset + r2.bytesFilled !== t2.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
  880. if (r2.bufferByteLength !== t2.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
  881. if (r2.bytesFilled + t2.byteLength > r2.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");
  882. const f2 = t2.byteLength;
  883. r2.buffer = fe(t2.buffer), On(e, f2);
  884. }
  885. n$1(Pt, "ReadableByteStreamControllerRespondWithNewView");
  886. function zn(e, t2, r2, s, f2, c, d) {
  887. t2._controlledReadableByteStream = e, t2._pullAgain = false, t2._pulling = false, t2._byobRequest = null, t2._queue = t2._queueTotalSize = void 0, Se(t2), t2._closeRequested = false, t2._started = false, t2._strategyHWM = c, t2._pullAlgorithm = s, t2._cancelAlgorithm = f2, t2._autoAllocateChunkSize = d, t2._pendingPullIntos = new M(), e._readableStreamController = t2;
  888. const p = r2();
  889. g(T2(p), () => (t2._started = true, Be(t2), null), (R) => (Z(t2, R), null));
  890. }
  891. n$1(zn, "SetUpReadableByteStreamController");
  892. function Ci(e, t2, r2) {
  893. const s = Object.create(ce.prototype);
  894. let f2, c, d;
  895. t2.start !== void 0 ? f2 = n$1(() => t2.start(s), "startAlgorithm") : f2 = n$1(() => {
  896. }, "startAlgorithm"), t2.pull !== void 0 ? c = n$1(() => t2.pull(s), "pullAlgorithm") : c = n$1(() => T2(void 0), "pullAlgorithm"), t2.cancel !== void 0 ? d = n$1((R) => t2.cancel(R), "cancelAlgorithm") : d = n$1(() => T2(void 0), "cancelAlgorithm");
  897. const p = t2.autoAllocateChunkSize;
  898. if (p === 0) throw new TypeError("autoAllocateChunkSize must be greater than 0");
  899. zn(e, s, f2, c, d, r2, p);
  900. }
  901. n$1(Ci, "SetUpReadableByteStreamControllerFromUnderlyingSource");
  902. function Pi(e, t2, r2) {
  903. e._associatedReadableByteStreamController = t2, e._view = r2;
  904. }
  905. n$1(Pi, "SetUpReadableStreamBYOBRequest");
  906. function Ar(e) {
  907. return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`);
  908. }
  909. n$1(Ar, "byobRequestBrandCheckException");
  910. function nt(e) {
  911. return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`);
  912. }
  913. n$1(nt, "byteStreamControllerBrandCheckException");
  914. function Ei(e, t2) {
  915. ne(e, t2);
  916. const r2 = e == null ? void 0 : e.mode;
  917. return { mode: r2 === void 0 ? void 0 : vi(r2, `${t2} has member 'mode' that`) };
  918. }
  919. n$1(Ei, "convertReaderOptions");
  920. function vi(e, t2) {
  921. if (e = `${e}`, e !== "byob") throw new TypeError(`${t2} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);
  922. return e;
  923. }
  924. n$1(vi, "convertReadableStreamReaderMode");
  925. function Ai(e, t2) {
  926. var r2;
  927. ne(e, t2);
  928. const s = (r2 = e == null ? void 0 : e.min) !== null && r2 !== void 0 ? r2 : 1;
  929. return { min: mr(s, `${t2} has member 'min' that`) };
  930. }
  931. n$1(Ai, "convertByobReadOptions");
  932. function jn(e) {
  933. return new we(e);
  934. }
  935. n$1(jn, "AcquireReadableStreamBYOBReader");
  936. function Ln(e, t2) {
  937. e._reader._readIntoRequests.push(t2);
  938. }
  939. n$1(Ln, "ReadableStreamAddReadIntoRequest");
  940. function Bi(e, t2, r2) {
  941. const f2 = e._reader._readIntoRequests.shift();
  942. r2 ? f2._closeSteps(t2) : f2._chunkSteps(t2);
  943. }
  944. n$1(Bi, "ReadableStreamFulfillReadIntoRequest");
  945. function Dn(e) {
  946. return e._reader._readIntoRequests.length;
  947. }
  948. n$1(Dn, "ReadableStreamGetNumReadIntoRequests");
  949. function Br(e) {
  950. const t2 = e._reader;
  951. return !(t2 === void 0 || !We(t2));
  952. }
  953. n$1(Br, "ReadableStreamHasBYOBReader");
  954. const _we = class _we {
  955. constructor(t2) {
  956. if (le(t2, 1, "ReadableStreamBYOBReader"), br(t2, "First parameter"), Ce(t2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
  957. if (!Ae(t2._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
  958. sn(this, t2), this._readIntoRequests = new M();
  959. }
  960. get closed() {
  961. return We(this) ? this._closedPromise : b(Et("closed"));
  962. }
  963. cancel(t2 = void 0) {
  964. return We(this) ? this._ownerReadableStream === void 0 ? b(yt("cancel")) : lr(this, t2) : b(Et("cancel"));
  965. }
  966. read(t2, r2 = {}) {
  967. if (!We(this)) return b(Et("read"));
  968. if (!ArrayBuffer.isView(t2)) return b(new TypeError("view must be an array buffer view"));
  969. if (t2.byteLength === 0) return b(new TypeError("view must have non-zero byteLength"));
  970. if (t2.buffer.byteLength === 0) return b(new TypeError("view's buffer must have non-zero byteLength"));
  971. if (_e6(t2.buffer)) return b(new TypeError("view's buffer has been detached"));
  972. let s;
  973. try {
  974. s = Ai(r2, "options");
  975. } catch (y) {
  976. return b(y);
  977. }
  978. const f2 = s.min;
  979. if (f2 === 0) return b(new TypeError("options.min must be greater than 0"));
  980. if (yi(t2)) {
  981. if (f2 > t2.byteLength) return b(new RangeError("options.min must be less than or equal to view's byteLength"));
  982. } else if (f2 > t2.length) return b(new RangeError("options.min must be less than or equal to view's length"));
  983. if (this._ownerReadableStream === void 0) return b(yt("read from"));
  984. let c, d;
  985. const p = A((y, C) => {
  986. c = y, d = C;
  987. });
  988. return $n(this, t2, f2, { _chunkSteps: n$1((y) => c({ value: y, done: false }), "_chunkSteps"), _closeSteps: n$1((y) => c({ value: y, done: true }), "_closeSteps"), _errorSteps: n$1((y) => d(y), "_errorSteps") }), p;
  989. }
  990. releaseLock() {
  991. if (!We(this)) throw Et("releaseLock");
  992. this._ownerReadableStream !== void 0 && Wi(this);
  993. }
  994. };
  995. n$1(_we, "ReadableStreamBYOBReader");
  996. let we = _we;
  997. Object.defineProperties(we.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), h2(we.prototype.cancel, "cancel"), h2(we.prototype.read, "read"), h2(we.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(we.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true });
  998. function We(e) {
  999. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_readIntoRequests") ? false : e instanceof we;
  1000. }
  1001. n$1(We, "IsReadableStreamBYOBReader");
  1002. function $n(e, t2, r2, s) {
  1003. const f2 = e._ownerReadableStream;
  1004. f2._disturbed = true, f2._state === "errored" ? s._errorSteps(f2._storedError) : Si(f2._readableStreamController, t2, r2, s);
  1005. }
  1006. n$1($n, "ReadableStreamBYOBReaderRead");
  1007. function Wi(e) {
  1008. ue(e);
  1009. const t2 = new TypeError("Reader was released");
  1010. Mn(e, t2);
  1011. }
  1012. n$1(Wi, "ReadableStreamBYOBReaderRelease");
  1013. function Mn(e, t2) {
  1014. const r2 = e._readIntoRequests;
  1015. e._readIntoRequests = new M(), r2.forEach((s) => {
  1016. s._errorSteps(t2);
  1017. });
  1018. }
  1019. n$1(Mn, "ReadableStreamBYOBReaderErrorReadIntoRequests");
  1020. function Et(e) {
  1021. return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`);
  1022. }
  1023. n$1(Et, "byobReaderBrandCheckException");
  1024. function ot(e, t2) {
  1025. const { highWaterMark: r2 } = e;
  1026. if (r2 === void 0) return t2;
  1027. if (Sn(r2) || r2 < 0) throw new RangeError("Invalid highWaterMark");
  1028. return r2;
  1029. }
  1030. n$1(ot, "ExtractHighWaterMark");
  1031. function vt(e) {
  1032. const { size: t2 } = e;
  1033. return t2 || (() => 1);
  1034. }
  1035. n$1(vt, "ExtractSizeAlgorithm");
  1036. function At(e, t2) {
  1037. ne(e, t2);
  1038. const r2 = e == null ? void 0 : e.highWaterMark, s = e == null ? void 0 : e.size;
  1039. return { highWaterMark: r2 === void 0 ? void 0 : hr(r2), size: s === void 0 ? void 0 : ki(s, `${t2} has member 'size' that`) };
  1040. }
  1041. n$1(At, "convertQueuingStrategy");
  1042. function ki(e, t2) {
  1043. return G(e, t2), (r2) => hr(e(r2));
  1044. }
  1045. n$1(ki, "convertQueuingStrategySize");
  1046. function qi(e, t2) {
  1047. ne(e, t2);
  1048. const r2 = e == null ? void 0 : e.abort, s = e == null ? void 0 : e.close, f2 = e == null ? void 0 : e.start, c = e == null ? void 0 : e.type, d = e == null ? void 0 : e.write;
  1049. return { abort: r2 === void 0 ? void 0 : Oi(r2, e, `${t2} has member 'abort' that`), close: s === void 0 ? void 0 : Ii(s, e, `${t2} has member 'close' that`), start: f2 === void 0 ? void 0 : Fi(f2, e, `${t2} has member 'start' that`), write: d === void 0 ? void 0 : zi(d, e, `${t2} has member 'write' that`), type: c };
  1050. }
  1051. n$1(qi, "convertUnderlyingSink");
  1052. function Oi(e, t2, r2) {
  1053. return G(e, r2), (s) => z(e, t2, [s]);
  1054. }
  1055. n$1(Oi, "convertUnderlyingSinkAbortCallback");
  1056. function Ii(e, t2, r2) {
  1057. return G(e, r2), () => z(e, t2, []);
  1058. }
  1059. n$1(Ii, "convertUnderlyingSinkCloseCallback");
  1060. function Fi(e, t2, r2) {
  1061. return G(e, r2), (s) => O(e, t2, [s]);
  1062. }
  1063. n$1(Fi, "convertUnderlyingSinkStartCallback");
  1064. function zi(e, t2, r2) {
  1065. return G(e, r2), (s, f2) => z(e, t2, [s, f2]);
  1066. }
  1067. n$1(zi, "convertUnderlyingSinkWriteCallback");
  1068. function Un(e, t2) {
  1069. if (!Le(e)) throw new TypeError(`${t2} is not a WritableStream.`);
  1070. }
  1071. n$1(Un, "assertWritableStream");
  1072. function ji(e) {
  1073. if (typeof e != "object" || e === null) return false;
  1074. try {
  1075. return typeof e.aborted == "boolean";
  1076. } catch {
  1077. return false;
  1078. }
  1079. }
  1080. n$1(ji, "isAbortSignal");
  1081. const Li = typeof AbortController == "function";
  1082. function Di() {
  1083. if (Li) return new AbortController();
  1084. }
  1085. n$1(Di, "createAbortController");
  1086. const _Re = class _Re {
  1087. constructor(t2 = {}, r2 = {}) {
  1088. t2 === void 0 ? t2 = null : cn(t2, "First parameter");
  1089. const s = At(r2, "Second parameter"), f2 = qi(t2, "First parameter");
  1090. if (Nn(this), f2.type !== void 0) throw new RangeError("Invalid type is specified");
  1091. const d = vt(s), p = ot(s, 1);
  1092. Xi(this, f2, p, d);
  1093. }
  1094. get locked() {
  1095. if (!Le(this)) throw Ot("locked");
  1096. return De(this);
  1097. }
  1098. abort(t2 = void 0) {
  1099. return Le(this) ? De(this) ? b(new TypeError("Cannot abort a stream that already has a writer")) : Bt(this, t2) : b(Ot("abort"));
  1100. }
  1101. close() {
  1102. return Le(this) ? De(this) ? b(new TypeError("Cannot close a stream that already has a writer")) : oe(this) ? b(new TypeError("Cannot close an already-closing stream")) : Hn(this) : b(Ot("close"));
  1103. }
  1104. getWriter() {
  1105. if (!Le(this)) throw Ot("getWriter");
  1106. return xn(this);
  1107. }
  1108. };
  1109. n$1(_Re, "WritableStream");
  1110. let Re = _Re;
  1111. Object.defineProperties(Re.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), h2(Re.prototype.abort, "abort"), h2(Re.prototype.close, "close"), h2(Re.prototype.getWriter, "getWriter"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Re.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true });
  1112. function xn(e) {
  1113. return new de(e);
  1114. }
  1115. n$1(xn, "AcquireWritableStreamDefaultWriter");
  1116. function $i(e, t2, r2, s, f2 = 1, c = () => 1) {
  1117. const d = Object.create(Re.prototype);
  1118. Nn(d);
  1119. const p = Object.create($e.prototype);
  1120. return Kn(d, p, e, t2, r2, s, f2, c), d;
  1121. }
  1122. n$1($i, "CreateWritableStream");
  1123. function Nn(e) {
  1124. e._state = "writable", e._storedError = void 0, e._writer = void 0, e._writableStreamController = void 0, e._writeRequests = new M(), e._inFlightWriteRequest = void 0, e._closeRequest = void 0, e._inFlightCloseRequest = void 0, e._pendingAbortRequest = void 0, e._backpressure = false;
  1125. }
  1126. n$1(Nn, "InitializeWritableStream");
  1127. function Le(e) {
  1128. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_writableStreamController") ? false : e instanceof Re;
  1129. }
  1130. n$1(Le, "IsWritableStream");
  1131. function De(e) {
  1132. return e._writer !== void 0;
  1133. }
  1134. n$1(De, "IsWritableStreamLocked");
  1135. function Bt(e, t2) {
  1136. var r2;
  1137. if (e._state === "closed" || e._state === "errored") return T2(void 0);
  1138. e._writableStreamController._abortReason = t2, (r2 = e._writableStreamController._abortController) === null || r2 === void 0 || r2.abort(t2);
  1139. const s = e._state;
  1140. if (s === "closed" || s === "errored") return T2(void 0);
  1141. if (e._pendingAbortRequest !== void 0) return e._pendingAbortRequest._promise;
  1142. let f2 = false;
  1143. s === "erroring" && (f2 = true, t2 = void 0);
  1144. const c = A((d, p) => {
  1145. e._pendingAbortRequest = { _promise: void 0, _resolve: d, _reject: p, _reason: t2, _wasAlreadyErroring: f2 };
  1146. });
  1147. return e._pendingAbortRequest._promise = c, f2 || kr(e, t2), c;
  1148. }
  1149. n$1(Bt, "WritableStreamAbort");
  1150. function Hn(e) {
  1151. const t2 = e._state;
  1152. if (t2 === "closed" || t2 === "errored") return b(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`));
  1153. const r2 = A((f2, c) => {
  1154. const d = { _resolve: f2, _reject: c };
  1155. e._closeRequest = d;
  1156. }), s = e._writer;
  1157. return s !== void 0 && e._backpressure && t2 === "writable" && Dr(s), ea(e._writableStreamController), r2;
  1158. }
  1159. n$1(Hn, "WritableStreamClose");
  1160. function Mi(e) {
  1161. return A((r2, s) => {
  1162. const f2 = { _resolve: r2, _reject: s };
  1163. e._writeRequests.push(f2);
  1164. });
  1165. }
  1166. n$1(Mi, "WritableStreamAddWriteRequest");
  1167. function Wr(e, t2) {
  1168. if (e._state === "writable") {
  1169. kr(e, t2);
  1170. return;
  1171. }
  1172. qr(e);
  1173. }
  1174. n$1(Wr, "WritableStreamDealWithRejection");
  1175. function kr(e, t2) {
  1176. const r2 = e._writableStreamController;
  1177. e._state = "erroring", e._storedError = t2;
  1178. const s = e._writer;
  1179. s !== void 0 && Qn(s, t2), !Vi(e) && r2._started && qr(e);
  1180. }
  1181. n$1(kr, "WritableStreamStartErroring");
  1182. function qr(e) {
  1183. e._state = "errored", e._writableStreamController[an]();
  1184. const t2 = e._storedError;
  1185. if (e._writeRequests.forEach((f2) => {
  1186. f2._reject(t2);
  1187. }), e._writeRequests = new M(), e._pendingAbortRequest === void 0) {
  1188. Wt(e);
  1189. return;
  1190. }
  1191. const r2 = e._pendingAbortRequest;
  1192. if (e._pendingAbortRequest = void 0, r2._wasAlreadyErroring) {
  1193. r2._reject(t2), Wt(e);
  1194. return;
  1195. }
  1196. const s = e._writableStreamController[pt](r2._reason);
  1197. g(s, () => (r2._resolve(), Wt(e), null), (f2) => (r2._reject(f2), Wt(e), null));
  1198. }
  1199. n$1(qr, "WritableStreamFinishErroring");
  1200. function Ui(e) {
  1201. e._inFlightWriteRequest._resolve(void 0), e._inFlightWriteRequest = void 0;
  1202. }
  1203. n$1(Ui, "WritableStreamFinishInFlightWrite");
  1204. function xi(e, t2) {
  1205. e._inFlightWriteRequest._reject(t2), e._inFlightWriteRequest = void 0, Wr(e, t2);
  1206. }
  1207. n$1(xi, "WritableStreamFinishInFlightWriteWithError");
  1208. function Ni(e) {
  1209. e._inFlightCloseRequest._resolve(void 0), e._inFlightCloseRequest = void 0, e._state === "erroring" && (e._storedError = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._resolve(), e._pendingAbortRequest = void 0)), e._state = "closed";
  1210. const r2 = e._writer;
  1211. r2 !== void 0 && to(r2);
  1212. }
  1213. n$1(Ni, "WritableStreamFinishInFlightClose");
  1214. function Hi(e, t2) {
  1215. e._inFlightCloseRequest._reject(t2), e._inFlightCloseRequest = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._reject(t2), e._pendingAbortRequest = void 0), Wr(e, t2);
  1216. }
  1217. n$1(Hi, "WritableStreamFinishInFlightCloseWithError");
  1218. function oe(e) {
  1219. return !(e._closeRequest === void 0 && e._inFlightCloseRequest === void 0);
  1220. }
  1221. n$1(oe, "WritableStreamCloseQueuedOrInFlight");
  1222. function Vi(e) {
  1223. return !(e._inFlightWriteRequest === void 0 && e._inFlightCloseRequest === void 0);
  1224. }
  1225. n$1(Vi, "WritableStreamHasOperationMarkedInFlight");
  1226. function Qi(e) {
  1227. e._inFlightCloseRequest = e._closeRequest, e._closeRequest = void 0;
  1228. }
  1229. n$1(Qi, "WritableStreamMarkCloseRequestInFlight");
  1230. function Yi(e) {
  1231. e._inFlightWriteRequest = e._writeRequests.shift();
  1232. }
  1233. n$1(Yi, "WritableStreamMarkFirstWriteRequestInFlight");
  1234. function Wt(e) {
  1235. e._closeRequest !== void 0 && (e._closeRequest._reject(e._storedError), e._closeRequest = void 0);
  1236. const t2 = e._writer;
  1237. t2 !== void 0 && jr(t2, e._storedError);
  1238. }
  1239. n$1(Wt, "WritableStreamRejectCloseAndClosedPromiseIfNeeded");
  1240. function Or(e, t2) {
  1241. const r2 = e._writer;
  1242. r2 !== void 0 && t2 !== e._backpressure && (t2 ? sa(r2) : Dr(r2)), e._backpressure = t2;
  1243. }
  1244. n$1(Or, "WritableStreamUpdateBackpressure");
  1245. const _de = class _de {
  1246. constructor(t2) {
  1247. if (le(t2, 1, "WritableStreamDefaultWriter"), Un(t2, "First parameter"), De(t2)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
  1248. this._ownerWritableStream = t2, t2._writer = this;
  1249. const r2 = t2._state;
  1250. if (r2 === "writable") !oe(t2) && t2._backpressure ? Ft(this) : ro(this), It(this);
  1251. else if (r2 === "erroring") Lr(this, t2._storedError), It(this);
  1252. else if (r2 === "closed") ro(this), ia(this);
  1253. else {
  1254. const s = t2._storedError;
  1255. Lr(this, s), eo(this, s);
  1256. }
  1257. }
  1258. get closed() {
  1259. return ke(this) ? this._closedPromise : b(qe("closed"));
  1260. }
  1261. get desiredSize() {
  1262. if (!ke(this)) throw qe("desiredSize");
  1263. if (this._ownerWritableStream === void 0) throw at("desiredSize");
  1264. return Ji(this);
  1265. }
  1266. get ready() {
  1267. return ke(this) ? this._readyPromise : b(qe("ready"));
  1268. }
  1269. abort(t2 = void 0) {
  1270. return ke(this) ? this._ownerWritableStream === void 0 ? b(at("abort")) : Gi(this, t2) : b(qe("abort"));
  1271. }
  1272. close() {
  1273. if (!ke(this)) return b(qe("close"));
  1274. const t2 = this._ownerWritableStream;
  1275. return t2 === void 0 ? b(at("close")) : oe(t2) ? b(new TypeError("Cannot close an already-closing stream")) : Vn(this);
  1276. }
  1277. releaseLock() {
  1278. if (!ke(this)) throw qe("releaseLock");
  1279. this._ownerWritableStream !== void 0 && Yn(this);
  1280. }
  1281. write(t2 = void 0) {
  1282. return ke(this) ? this._ownerWritableStream === void 0 ? b(at("write to")) : Gn(this, t2) : b(qe("write"));
  1283. }
  1284. };
  1285. n$1(_de, "WritableStreamDefaultWriter");
  1286. let de = _de;
  1287. Object.defineProperties(de.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), h2(de.prototype.abort, "abort"), h2(de.prototype.close, "close"), h2(de.prototype.releaseLock, "releaseLock"), h2(de.prototype.write, "write"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(de.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true });
  1288. function ke(e) {
  1289. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_ownerWritableStream") ? false : e instanceof de;
  1290. }
  1291. n$1(ke, "IsWritableStreamDefaultWriter");
  1292. function Gi(e, t2) {
  1293. const r2 = e._ownerWritableStream;
  1294. return Bt(r2, t2);
  1295. }
  1296. n$1(Gi, "WritableStreamDefaultWriterAbort");
  1297. function Vn(e) {
  1298. const t2 = e._ownerWritableStream;
  1299. return Hn(t2);
  1300. }
  1301. n$1(Vn, "WritableStreamDefaultWriterClose");
  1302. function Zi(e) {
  1303. const t2 = e._ownerWritableStream, r2 = t2._state;
  1304. return oe(t2) || r2 === "closed" ? T2(void 0) : r2 === "errored" ? b(t2._storedError) : Vn(e);
  1305. }
  1306. n$1(Zi, "WritableStreamDefaultWriterCloseWithErrorPropagation");
  1307. function Ki(e, t2) {
  1308. e._closedPromiseState === "pending" ? jr(e, t2) : aa(e, t2);
  1309. }
  1310. n$1(Ki, "WritableStreamDefaultWriterEnsureClosedPromiseRejected");
  1311. function Qn(e, t2) {
  1312. e._readyPromiseState === "pending" ? no(e, t2) : ua(e, t2);
  1313. }
  1314. n$1(Qn, "WritableStreamDefaultWriterEnsureReadyPromiseRejected");
  1315. function Ji(e) {
  1316. const t2 = e._ownerWritableStream, r2 = t2._state;
  1317. return r2 === "errored" || r2 === "erroring" ? null : r2 === "closed" ? 0 : Jn(t2._writableStreamController);
  1318. }
  1319. n$1(Ji, "WritableStreamDefaultWriterGetDesiredSize");
  1320. function Yn(e) {
  1321. const t2 = e._ownerWritableStream, r2 = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
  1322. Qn(e, r2), Ki(e, r2), t2._writer = void 0, e._ownerWritableStream = void 0;
  1323. }
  1324. n$1(Yn, "WritableStreamDefaultWriterRelease");
  1325. function Gn(e, t2) {
  1326. const r2 = e._ownerWritableStream, s = r2._writableStreamController, f2 = ta(s, t2);
  1327. if (r2 !== e._ownerWritableStream) return b(at("write to"));
  1328. const c = r2._state;
  1329. if (c === "errored") return b(r2._storedError);
  1330. if (oe(r2) || c === "closed") return b(new TypeError("The stream is closing or closed and cannot be written to"));
  1331. if (c === "erroring") return b(r2._storedError);
  1332. const d = Mi(r2);
  1333. return ra(s, t2, f2), d;
  1334. }
  1335. n$1(Gn, "WritableStreamDefaultWriterWrite");
  1336. const Zn = {};
  1337. const _$e = class _$e {
  1338. constructor() {
  1339. throw new TypeError("Illegal constructor");
  1340. }
  1341. get abortReason() {
  1342. if (!Ir(this)) throw zr("abortReason");
  1343. return this._abortReason;
  1344. }
  1345. get signal() {
  1346. if (!Ir(this)) throw zr("signal");
  1347. if (this._abortController === void 0) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");
  1348. return this._abortController.signal;
  1349. }
  1350. error(t2 = void 0) {
  1351. if (!Ir(this)) throw zr("error");
  1352. this._controlledWritableStream._state === "writable" && Xn(this, t2);
  1353. }
  1354. [pt](t2) {
  1355. const r2 = this._abortAlgorithm(t2);
  1356. return kt(this), r2;
  1357. }
  1358. [an]() {
  1359. Se(this);
  1360. }
  1361. };
  1362. n$1(_$e, "WritableStreamDefaultController");
  1363. let $e = _$e;
  1364. Object.defineProperties($e.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty($e.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true });
  1365. function Ir(e) {
  1366. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledWritableStream") ? false : e instanceof $e;
  1367. }
  1368. n$1(Ir, "IsWritableStreamDefaultController");
  1369. function Kn(e, t2, r2, s, f2, c, d, p) {
  1370. t2._controlledWritableStream = e, e._writableStreamController = t2, t2._queue = void 0, t2._queueTotalSize = void 0, Se(t2), t2._abortReason = void 0, t2._abortController = Di(), t2._started = false, t2._strategySizeAlgorithm = p, t2._strategyHWM = d, t2._writeAlgorithm = s, t2._closeAlgorithm = f2, t2._abortAlgorithm = c;
  1371. const R = Fr(t2);
  1372. Or(e, R);
  1373. const y = r2(), C = T2(y);
  1374. g(C, () => (t2._started = true, qt(t2), null), (P) => (t2._started = true, Wr(e, P), null));
  1375. }
  1376. n$1(Kn, "SetUpWritableStreamDefaultController");
  1377. function Xi(e, t2, r2, s) {
  1378. const f2 = Object.create($e.prototype);
  1379. let c, d, p, R;
  1380. t2.start !== void 0 ? c = n$1(() => t2.start(f2), "startAlgorithm") : c = n$1(() => {
  1381. }, "startAlgorithm"), t2.write !== void 0 ? d = n$1((y) => t2.write(y, f2), "writeAlgorithm") : d = n$1(() => T2(void 0), "writeAlgorithm"), t2.close !== void 0 ? p = n$1(() => t2.close(), "closeAlgorithm") : p = n$1(() => T2(void 0), "closeAlgorithm"), t2.abort !== void 0 ? R = n$1((y) => t2.abort(y), "abortAlgorithm") : R = n$1(() => T2(void 0), "abortAlgorithm"), Kn(e, f2, c, d, p, R, r2, s);
  1382. }
  1383. n$1(Xi, "SetUpWritableStreamDefaultControllerFromUnderlyingSink");
  1384. function kt(e) {
  1385. e._writeAlgorithm = void 0, e._closeAlgorithm = void 0, e._abortAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
  1386. }
  1387. n$1(kt, "WritableStreamDefaultControllerClearAlgorithms");
  1388. function ea(e) {
  1389. Rr(e, Zn, 0), qt(e);
  1390. }
  1391. n$1(ea, "WritableStreamDefaultControllerClose");
  1392. function ta(e, t2) {
  1393. try {
  1394. return e._strategySizeAlgorithm(t2);
  1395. } catch (r2) {
  1396. return it(e, r2), 1;
  1397. }
  1398. }
  1399. n$1(ta, "WritableStreamDefaultControllerGetChunkSize");
  1400. function Jn(e) {
  1401. return e._strategyHWM - e._queueTotalSize;
  1402. }
  1403. n$1(Jn, "WritableStreamDefaultControllerGetDesiredSize");
  1404. function ra(e, t2, r2) {
  1405. try {
  1406. Rr(e, t2, r2);
  1407. } catch (f2) {
  1408. it(e, f2);
  1409. return;
  1410. }
  1411. const s = e._controlledWritableStream;
  1412. if (!oe(s) && s._state === "writable") {
  1413. const f2 = Fr(e);
  1414. Or(s, f2);
  1415. }
  1416. qt(e);
  1417. }
  1418. n$1(ra, "WritableStreamDefaultControllerWrite");
  1419. function qt(e) {
  1420. const t2 = e._controlledWritableStream;
  1421. if (!e._started || t2._inFlightWriteRequest !== void 0) return;
  1422. if (t2._state === "erroring") {
  1423. qr(t2);
  1424. return;
  1425. }
  1426. if (e._queue.length === 0) return;
  1427. const s = pi(e);
  1428. s === Zn ? na(e) : oa(e, s);
  1429. }
  1430. n$1(qt, "WritableStreamDefaultControllerAdvanceQueueIfNeeded");
  1431. function it(e, t2) {
  1432. e._controlledWritableStream._state === "writable" && Xn(e, t2);
  1433. }
  1434. n$1(it, "WritableStreamDefaultControllerErrorIfNeeded");
  1435. function na(e) {
  1436. const t2 = e._controlledWritableStream;
  1437. Qi(t2), wr(e);
  1438. const r2 = e._closeAlgorithm();
  1439. kt(e), g(r2, () => (Ni(t2), null), (s) => (Hi(t2, s), null));
  1440. }
  1441. n$1(na, "WritableStreamDefaultControllerProcessClose");
  1442. function oa(e, t2) {
  1443. const r2 = e._controlledWritableStream;
  1444. Yi(r2);
  1445. const s = e._writeAlgorithm(t2);
  1446. g(s, () => {
  1447. Ui(r2);
  1448. const f2 = r2._state;
  1449. if (wr(e), !oe(r2) && f2 === "writable") {
  1450. const c = Fr(e);
  1451. Or(r2, c);
  1452. }
  1453. return qt(e), null;
  1454. }, (f2) => (r2._state === "writable" && kt(e), xi(r2, f2), null));
  1455. }
  1456. n$1(oa, "WritableStreamDefaultControllerProcessWrite");
  1457. function Fr(e) {
  1458. return Jn(e) <= 0;
  1459. }
  1460. n$1(Fr, "WritableStreamDefaultControllerGetBackpressure");
  1461. function Xn(e, t2) {
  1462. const r2 = e._controlledWritableStream;
  1463. kt(e), kr(r2, t2);
  1464. }
  1465. n$1(Xn, "WritableStreamDefaultControllerError");
  1466. function Ot(e) {
  1467. return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`);
  1468. }
  1469. n$1(Ot, "streamBrandCheckException$2");
  1470. function zr(e) {
  1471. return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`);
  1472. }
  1473. n$1(zr, "defaultControllerBrandCheckException$2");
  1474. function qe(e) {
  1475. return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`);
  1476. }
  1477. n$1(qe, "defaultWriterBrandCheckException");
  1478. function at(e) {
  1479. return new TypeError("Cannot " + e + " a stream using a released writer");
  1480. }
  1481. n$1(at, "defaultWriterLockException");
  1482. function It(e) {
  1483. e._closedPromise = A((t2, r2) => {
  1484. e._closedPromise_resolve = t2, e._closedPromise_reject = r2, e._closedPromiseState = "pending";
  1485. });
  1486. }
  1487. n$1(It, "defaultWriterClosedPromiseInitialize");
  1488. function eo(e, t2) {
  1489. It(e), jr(e, t2);
  1490. }
  1491. n$1(eo, "defaultWriterClosedPromiseInitializeAsRejected");
  1492. function ia(e) {
  1493. It(e), to(e);
  1494. }
  1495. n$1(ia, "defaultWriterClosedPromiseInitializeAsResolved");
  1496. function jr(e, t2) {
  1497. e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t2), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected");
  1498. }
  1499. n$1(jr, "defaultWriterClosedPromiseReject");
  1500. function aa(e, t2) {
  1501. eo(e, t2);
  1502. }
  1503. n$1(aa, "defaultWriterClosedPromiseResetToRejected");
  1504. function to(e) {
  1505. e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved");
  1506. }
  1507. n$1(to, "defaultWriterClosedPromiseResolve");
  1508. function Ft(e) {
  1509. e._readyPromise = A((t2, r2) => {
  1510. e._readyPromise_resolve = t2, e._readyPromise_reject = r2;
  1511. }), e._readyPromiseState = "pending";
  1512. }
  1513. n$1(Ft, "defaultWriterReadyPromiseInitialize");
  1514. function Lr(e, t2) {
  1515. Ft(e), no(e, t2);
  1516. }
  1517. n$1(Lr, "defaultWriterReadyPromiseInitializeAsRejected");
  1518. function ro(e) {
  1519. Ft(e), Dr(e);
  1520. }
  1521. n$1(ro, "defaultWriterReadyPromiseInitializeAsResolved");
  1522. function no(e, t2) {
  1523. e._readyPromise_reject !== void 0 && (Q(e._readyPromise), e._readyPromise_reject(t2), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected");
  1524. }
  1525. n$1(no, "defaultWriterReadyPromiseReject");
  1526. function sa(e) {
  1527. Ft(e);
  1528. }
  1529. n$1(sa, "defaultWriterReadyPromiseReset");
  1530. function ua(e, t2) {
  1531. Lr(e, t2);
  1532. }
  1533. n$1(ua, "defaultWriterReadyPromiseResetToRejected");
  1534. function Dr(e) {
  1535. e._readyPromise_resolve !== void 0 && (e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled");
  1536. }
  1537. n$1(Dr, "defaultWriterReadyPromiseResolve");
  1538. function la() {
  1539. if (typeof globalThis < "u") return globalThis;
  1540. if (typeof self < "u") return self;
  1541. if (typeof n$2 < "u") return n$2;
  1542. }
  1543. n$1(la, "getGlobals");
  1544. const $r = la();
  1545. function fa(e) {
  1546. if (!(typeof e == "function" || typeof e == "object") || e.name !== "DOMException") return false;
  1547. try {
  1548. return new e(), true;
  1549. } catch {
  1550. return false;
  1551. }
  1552. }
  1553. n$1(fa, "isDOMExceptionConstructor");
  1554. function ca() {
  1555. const e = $r == null ? void 0 : $r.DOMException;
  1556. return fa(e) ? e : void 0;
  1557. }
  1558. n$1(ca, "getFromGlobal");
  1559. function da() {
  1560. const e = n$1(function(r2, s) {
  1561. this.message = r2 || "", this.name = s || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
  1562. }, "DOMException");
  1563. return h2(e, "DOMException"), e.prototype = Object.create(Error.prototype), Object.defineProperty(e.prototype, "constructor", { value: e, writable: true, configurable: true }), e;
  1564. }
  1565. n$1(da, "createPolyfill");
  1566. const ha = ca() || da();
  1567. function oo(e, t2, r2, s, f2, c) {
  1568. const d = ze(e), p = xn(t2);
  1569. e._disturbed = true;
  1570. let R = false, y = T2(void 0);
  1571. return A((C, P) => {
  1572. let B;
  1573. if (c !== void 0) {
  1574. if (B = n$1(() => {
  1575. const _ = c.reason !== void 0 ? c.reason : new ha("Aborted", "AbortError"), v = [];
  1576. s || v.push(() => t2._state === "writable" ? Bt(t2, _) : T2(void 0)), f2 || v.push(() => e._state === "readable" ? X(e, _) : T2(void 0)), x(() => Promise.all(v.map((W) => W())), true, _);
  1577. }, "abortAlgorithm"), c.aborted) {
  1578. B();
  1579. return;
  1580. }
  1581. c.addEventListener("abort", B);
  1582. }
  1583. function ee() {
  1584. return A((_, v) => {
  1585. function W(Y) {
  1586. Y ? _() : q(Ne(), W, v);
  1587. }
  1588. n$1(W, "next"), W(false);
  1589. });
  1590. }
  1591. n$1(ee, "pipeLoop");
  1592. function Ne() {
  1593. return R ? T2(true) : q(p._readyPromise, () => A((_, v) => {
  1594. et(d, { _chunkSteps: n$1((W) => {
  1595. y = q(Gn(p, W), void 0, l), _(false);
  1596. }, "_chunkSteps"), _closeSteps: n$1(() => _(true), "_closeSteps"), _errorSteps: v });
  1597. }));
  1598. }
  1599. if (n$1(Ne, "pipeStep"), me(e, d._closedPromise, (_) => (s ? K(true, _) : x(() => Bt(t2, _), true, _), null)), me(t2, p._closedPromise, (_) => (f2 ? K(true, _) : x(() => X(e, _), true, _), null)), U(e, d._closedPromise, () => (r2 ? K() : x(() => Zi(p)), null)), oe(t2) || t2._state === "closed") {
  1600. const _ = new TypeError("the destination writable stream closed before all data could be piped to it");
  1601. f2 ? K(true, _) : x(() => X(e, _), true, _);
  1602. }
  1603. Q(ee());
  1604. function Ee() {
  1605. const _ = y;
  1606. return q(y, () => _ !== y ? Ee() : void 0);
  1607. }
  1608. n$1(Ee, "waitForWritesToFinish");
  1609. function me(_, v, W) {
  1610. _._state === "errored" ? W(_._storedError) : I(v, W);
  1611. }
  1612. n$1(me, "isOrBecomesErrored");
  1613. function U(_, v, W) {
  1614. _._state === "closed" ? W() : V(v, W);
  1615. }
  1616. n$1(U, "isOrBecomesClosed");
  1617. function x(_, v, W) {
  1618. if (R) return;
  1619. R = true, t2._state === "writable" && !oe(t2) ? V(Ee(), Y) : Y();
  1620. function Y() {
  1621. return g(_(), () => be(v, W), (He) => be(true, He)), null;
  1622. }
  1623. n$1(Y, "doTheRest");
  1624. }
  1625. n$1(x, "shutdownWithAction");
  1626. function K(_, v) {
  1627. R || (R = true, t2._state === "writable" && !oe(t2) ? V(Ee(), () => be(_, v)) : be(_, v));
  1628. }
  1629. n$1(K, "shutdown");
  1630. function be(_, v) {
  1631. return Yn(p), ue(d), c !== void 0 && c.removeEventListener("abort", B), _ ? P(v) : C(void 0), null;
  1632. }
  1633. n$1(be, "finalize");
  1634. });
  1635. }
  1636. n$1(oo, "ReadableStreamPipeTo");
  1637. const _he = class _he {
  1638. constructor() {
  1639. throw new TypeError("Illegal constructor");
  1640. }
  1641. get desiredSize() {
  1642. if (!zt(this)) throw Lt("desiredSize");
  1643. return Mr(this);
  1644. }
  1645. close() {
  1646. if (!zt(this)) throw Lt("close");
  1647. if (!Ue(this)) throw new TypeError("The stream is not in a state that permits close");
  1648. Oe(this);
  1649. }
  1650. enqueue(t2 = void 0) {
  1651. if (!zt(this)) throw Lt("enqueue");
  1652. if (!Ue(this)) throw new TypeError("The stream is not in a state that permits enqueue");
  1653. return Me(this, t2);
  1654. }
  1655. error(t2 = void 0) {
  1656. if (!zt(this)) throw Lt("error");
  1657. J(this, t2);
  1658. }
  1659. [ar](t2) {
  1660. Se(this);
  1661. const r2 = this._cancelAlgorithm(t2);
  1662. return jt(this), r2;
  1663. }
  1664. [sr](t2) {
  1665. const r2 = this._controlledReadableStream;
  1666. if (this._queue.length > 0) {
  1667. const s = wr(this);
  1668. this._closeRequested && this._queue.length === 0 ? (jt(this), lt(r2)) : st(this), t2._chunkSteps(s);
  1669. } else hn(r2, t2), st(this);
  1670. }
  1671. [ur]() {
  1672. }
  1673. };
  1674. n$1(_he, "ReadableStreamDefaultController");
  1675. let he = _he;
  1676. Object.defineProperties(he.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), h2(he.prototype.close, "close"), h2(he.prototype.enqueue, "enqueue"), h2(he.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(he.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true });
  1677. function zt(e) {
  1678. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledReadableStream") ? false : e instanceof he;
  1679. }
  1680. n$1(zt, "IsReadableStreamDefaultController");
  1681. function st(e) {
  1682. if (!io(e)) return;
  1683. if (e._pulling) {
  1684. e._pullAgain = true;
  1685. return;
  1686. }
  1687. e._pulling = true;
  1688. const r2 = e._pullAlgorithm();
  1689. g(r2, () => (e._pulling = false, e._pullAgain && (e._pullAgain = false, st(e)), null), (s) => (J(e, s), null));
  1690. }
  1691. n$1(st, "ReadableStreamDefaultControllerCallPullIfNeeded");
  1692. function io(e) {
  1693. const t2 = e._controlledReadableStream;
  1694. return !Ue(e) || !e._started ? false : !!(Ce(t2) && gt(t2) > 0 || Mr(e) > 0);
  1695. }
  1696. n$1(io, "ReadableStreamDefaultControllerShouldCallPull");
  1697. function jt(e) {
  1698. e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
  1699. }
  1700. n$1(jt, "ReadableStreamDefaultControllerClearAlgorithms");
  1701. function Oe(e) {
  1702. if (!Ue(e)) return;
  1703. const t2 = e._controlledReadableStream;
  1704. e._closeRequested = true, e._queue.length === 0 && (jt(e), lt(t2));
  1705. }
  1706. n$1(Oe, "ReadableStreamDefaultControllerClose");
  1707. function Me(e, t2) {
  1708. if (!Ue(e)) return;
  1709. const r2 = e._controlledReadableStream;
  1710. if (Ce(r2) && gt(r2) > 0) pr(r2, t2, false);
  1711. else {
  1712. let s;
  1713. try {
  1714. s = e._strategySizeAlgorithm(t2);
  1715. } catch (f2) {
  1716. throw J(e, f2), f2;
  1717. }
  1718. try {
  1719. Rr(e, t2, s);
  1720. } catch (f2) {
  1721. throw J(e, f2), f2;
  1722. }
  1723. }
  1724. st(e);
  1725. }
  1726. n$1(Me, "ReadableStreamDefaultControllerEnqueue");
  1727. function J(e, t2) {
  1728. const r2 = e._controlledReadableStream;
  1729. r2._state === "readable" && (Se(e), jt(e), lo(r2, t2));
  1730. }
  1731. n$1(J, "ReadableStreamDefaultControllerError");
  1732. function Mr(e) {
  1733. const t2 = e._controlledReadableStream._state;
  1734. return t2 === "errored" ? null : t2 === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
  1735. }
  1736. n$1(Mr, "ReadableStreamDefaultControllerGetDesiredSize");
  1737. function ma(e) {
  1738. return !io(e);
  1739. }
  1740. n$1(ma, "ReadableStreamDefaultControllerHasBackpressure");
  1741. function Ue(e) {
  1742. const t2 = e._controlledReadableStream._state;
  1743. return !e._closeRequested && t2 === "readable";
  1744. }
  1745. n$1(Ue, "ReadableStreamDefaultControllerCanCloseOrEnqueue");
  1746. function ao(e, t2, r2, s, f2, c, d) {
  1747. t2._controlledReadableStream = e, t2._queue = void 0, t2._queueTotalSize = void 0, Se(t2), t2._started = false, t2._closeRequested = false, t2._pullAgain = false, t2._pulling = false, t2._strategySizeAlgorithm = d, t2._strategyHWM = c, t2._pullAlgorithm = s, t2._cancelAlgorithm = f2, e._readableStreamController = t2;
  1748. const p = r2();
  1749. g(T2(p), () => (t2._started = true, st(t2), null), (R) => (J(t2, R), null));
  1750. }
  1751. n$1(ao, "SetUpReadableStreamDefaultController");
  1752. function ba(e, t2, r2, s) {
  1753. const f2 = Object.create(he.prototype);
  1754. let c, d, p;
  1755. t2.start !== void 0 ? c = n$1(() => t2.start(f2), "startAlgorithm") : c = n$1(() => {
  1756. }, "startAlgorithm"), t2.pull !== void 0 ? d = n$1(() => t2.pull(f2), "pullAlgorithm") : d = n$1(() => T2(void 0), "pullAlgorithm"), t2.cancel !== void 0 ? p = n$1((R) => t2.cancel(R), "cancelAlgorithm") : p = n$1(() => T2(void 0), "cancelAlgorithm"), ao(e, f2, c, d, p, r2, s);
  1757. }
  1758. n$1(ba, "SetUpReadableStreamDefaultControllerFromUnderlyingSource");
  1759. function Lt(e) {
  1760. return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`);
  1761. }
  1762. n$1(Lt, "defaultControllerBrandCheckException$1");
  1763. function pa(e, t2) {
  1764. return Ae(e._readableStreamController) ? ga(e) : ya(e);
  1765. }
  1766. n$1(pa, "ReadableStreamTee");
  1767. function ya(e, t2) {
  1768. const r2 = ze(e);
  1769. let s = false, f2 = false, c = false, d = false, p, R, y, C, P;
  1770. const B = A((U) => {
  1771. P = U;
  1772. });
  1773. function ee() {
  1774. return s ? (f2 = true, T2(void 0)) : (s = true, et(r2, { _chunkSteps: n$1((x) => {
  1775. se(() => {
  1776. f2 = false;
  1777. const K = x, be = x;
  1778. c || Me(y._readableStreamController, K), d || Me(C._readableStreamController, be), s = false, f2 && ee();
  1779. });
  1780. }, "_chunkSteps"), _closeSteps: n$1(() => {
  1781. s = false, c || Oe(y._readableStreamController), d || Oe(C._readableStreamController), (!c || !d) && P(void 0);
  1782. }, "_closeSteps"), _errorSteps: n$1(() => {
  1783. s = false;
  1784. }, "_errorSteps") }), T2(void 0));
  1785. }
  1786. n$1(ee, "pullAlgorithm");
  1787. function Ne(U) {
  1788. if (c = true, p = U, d) {
  1789. const x = tt([p, R]), K = X(e, x);
  1790. P(K);
  1791. }
  1792. return B;
  1793. }
  1794. n$1(Ne, "cancel1Algorithm");
  1795. function Ee(U) {
  1796. if (d = true, R = U, c) {
  1797. const x = tt([p, R]), K = X(e, x);
  1798. P(K);
  1799. }
  1800. return B;
  1801. }
  1802. n$1(Ee, "cancel2Algorithm");
  1803. function me() {
  1804. }
  1805. return n$1(me, "startAlgorithm"), y = ut(me, ee, Ne), C = ut(me, ee, Ee), I(r2._closedPromise, (U) => (J(y._readableStreamController, U), J(C._readableStreamController, U), (!c || !d) && P(void 0), null)), [y, C];
  1806. }
  1807. n$1(ya, "ReadableStreamDefaultTee");
  1808. function ga(e) {
  1809. let t2 = ze(e), r2 = false, s = false, f2 = false, c = false, d = false, p, R, y, C, P;
  1810. const B = A((_) => {
  1811. P = _;
  1812. });
  1813. function ee(_) {
  1814. I(_._closedPromise, (v) => (_ !== t2 || (Z(y._readableStreamController, v), Z(C._readableStreamController, v), (!c || !d) && P(void 0)), null));
  1815. }
  1816. n$1(ee, "forwardReaderError");
  1817. function Ne() {
  1818. We(t2) && (ue(t2), t2 = ze(e), ee(t2)), et(t2, { _chunkSteps: n$1((v) => {
  1819. se(() => {
  1820. s = false, f2 = false;
  1821. const W = v;
  1822. let Y = v;
  1823. if (!c && !d) try {
  1824. Y = Cn(v);
  1825. } catch (He) {
  1826. Z(y._readableStreamController, He), Z(C._readableStreamController, He), P(X(e, He));
  1827. return;
  1828. }
  1829. c || Tt(y._readableStreamController, W), d || Tt(C._readableStreamController, Y), r2 = false, s ? me() : f2 && U();
  1830. });
  1831. }, "_chunkSteps"), _closeSteps: n$1(() => {
  1832. r2 = false, c || rt(y._readableStreamController), d || rt(C._readableStreamController), y._readableStreamController._pendingPullIntos.length > 0 && Ct(y._readableStreamController, 0), C._readableStreamController._pendingPullIntos.length > 0 && Ct(C._readableStreamController, 0), (!c || !d) && P(void 0);
  1833. }, "_closeSteps"), _errorSteps: n$1(() => {
  1834. r2 = false;
  1835. }, "_errorSteps") });
  1836. }
  1837. n$1(Ne, "pullWithDefaultReader");
  1838. function Ee(_, v) {
  1839. ge(t2) && (ue(t2), t2 = jn(e), ee(t2));
  1840. const W = v ? C : y, Y = v ? y : C;
  1841. $n(t2, _, 1, { _chunkSteps: n$1((Ve) => {
  1842. se(() => {
  1843. s = false, f2 = false;
  1844. const Qe = v ? d : c;
  1845. if (v ? c : d) Qe || Pt(W._readableStreamController, Ve);
  1846. else {
  1847. let To;
  1848. try {
  1849. To = Cn(Ve);
  1850. } catch (Vr) {
  1851. Z(W._readableStreamController, Vr), Z(Y._readableStreamController, Vr), P(X(e, Vr));
  1852. return;
  1853. }
  1854. Qe || Pt(W._readableStreamController, Ve), Tt(Y._readableStreamController, To);
  1855. }
  1856. r2 = false, s ? me() : f2 && U();
  1857. });
  1858. }, "_chunkSteps"), _closeSteps: n$1((Ve) => {
  1859. r2 = false;
  1860. const Qe = v ? d : c, Vt = v ? c : d;
  1861. Qe || rt(W._readableStreamController), Vt || rt(Y._readableStreamController), Ve !== void 0 && (Qe || Pt(W._readableStreamController, Ve), !Vt && Y._readableStreamController._pendingPullIntos.length > 0 && Ct(Y._readableStreamController, 0)), (!Qe || !Vt) && P(void 0);
  1862. }, "_closeSteps"), _errorSteps: n$1(() => {
  1863. r2 = false;
  1864. }, "_errorSteps") });
  1865. }
  1866. n$1(Ee, "pullWithBYOBReader");
  1867. function me() {
  1868. if (r2) return s = true, T2(void 0);
  1869. r2 = true;
  1870. const _ = vr(y._readableStreamController);
  1871. return _ === null ? Ne() : Ee(_._view, false), T2(void 0);
  1872. }
  1873. n$1(me, "pull1Algorithm");
  1874. function U() {
  1875. if (r2) return f2 = true, T2(void 0);
  1876. r2 = true;
  1877. const _ = vr(C._readableStreamController);
  1878. return _ === null ? Ne() : Ee(_._view, true), T2(void 0);
  1879. }
  1880. n$1(U, "pull2Algorithm");
  1881. function x(_) {
  1882. if (c = true, p = _, d) {
  1883. const v = tt([p, R]), W = X(e, v);
  1884. P(W);
  1885. }
  1886. return B;
  1887. }
  1888. n$1(x, "cancel1Algorithm");
  1889. function K(_) {
  1890. if (d = true, R = _, c) {
  1891. const v = tt([p, R]), W = X(e, v);
  1892. P(W);
  1893. }
  1894. return B;
  1895. }
  1896. n$1(K, "cancel2Algorithm");
  1897. function be() {
  1898. }
  1899. return n$1(be, "startAlgorithm"), y = uo(be, me, x), C = uo(be, U, K), ee(t2), [y, C];
  1900. }
  1901. n$1(ga, "ReadableByteStreamTee");
  1902. function _a2(e) {
  1903. return u(e) && typeof e.getReader < "u";
  1904. }
  1905. n$1(_a2, "isReadableStreamLike");
  1906. function Sa(e) {
  1907. return _a2(e) ? Ra(e.getReader()) : wa(e);
  1908. }
  1909. n$1(Sa, "ReadableStreamFrom");
  1910. function wa(e) {
  1911. let t2;
  1912. const r2 = Tn(e, "async"), s = l;
  1913. function f2() {
  1914. let d;
  1915. try {
  1916. d = di(r2);
  1917. } catch (R) {
  1918. return b(R);
  1919. }
  1920. const p = T2(d);
  1921. return F(p, (R) => {
  1922. if (!u(R)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");
  1923. if (hi(R)) Oe(t2._readableStreamController);
  1924. else {
  1925. const C = mi(R);
  1926. Me(t2._readableStreamController, C);
  1927. }
  1928. });
  1929. }
  1930. n$1(f2, "pullAlgorithm");
  1931. function c(d) {
  1932. const p = r2.iterator;
  1933. let R;
  1934. try {
  1935. R = St(p, "return");
  1936. } catch (P) {
  1937. return b(P);
  1938. }
  1939. if (R === void 0) return T2(void 0);
  1940. let y;
  1941. try {
  1942. y = O(R, p, [d]);
  1943. } catch (P) {
  1944. return b(P);
  1945. }
  1946. const C = T2(y);
  1947. return F(C, (P) => {
  1948. if (!u(P)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");
  1949. });
  1950. }
  1951. return n$1(c, "cancelAlgorithm"), t2 = ut(s, f2, c, 0), t2;
  1952. }
  1953. n$1(wa, "ReadableStreamFromIterable");
  1954. function Ra(e) {
  1955. let t2;
  1956. const r2 = l;
  1957. function s() {
  1958. let c;
  1959. try {
  1960. c = e.read();
  1961. } catch (d) {
  1962. return b(d);
  1963. }
  1964. return F(c, (d) => {
  1965. if (!u(d)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
  1966. if (d.done) Oe(t2._readableStreamController);
  1967. else {
  1968. const p = d.value;
  1969. Me(t2._readableStreamController, p);
  1970. }
  1971. });
  1972. }
  1973. n$1(s, "pullAlgorithm");
  1974. function f2(c) {
  1975. try {
  1976. return T2(e.cancel(c));
  1977. } catch (d) {
  1978. return b(d);
  1979. }
  1980. }
  1981. return n$1(f2, "cancelAlgorithm"), t2 = ut(r2, s, f2, 0), t2;
  1982. }
  1983. n$1(Ra, "ReadableStreamFromDefaultReader");
  1984. function Ta(e, t2) {
  1985. ne(e, t2);
  1986. const r2 = e, s = r2 == null ? void 0 : r2.autoAllocateChunkSize, f2 = r2 == null ? void 0 : r2.cancel, c = r2 == null ? void 0 : r2.pull, d = r2 == null ? void 0 : r2.start, p = r2 == null ? void 0 : r2.type;
  1987. return { autoAllocateChunkSize: s === void 0 ? void 0 : mr(s, `${t2} has member 'autoAllocateChunkSize' that`), cancel: f2 === void 0 ? void 0 : Ca(f2, r2, `${t2} has member 'cancel' that`), pull: c === void 0 ? void 0 : Pa(c, r2, `${t2} has member 'pull' that`), start: d === void 0 ? void 0 : Ea(d, r2, `${t2} has member 'start' that`), type: p === void 0 ? void 0 : va(p, `${t2} has member 'type' that`) };
  1988. }
  1989. n$1(Ta, "convertUnderlyingDefaultOrByteSource");
  1990. function Ca(e, t2, r2) {
  1991. return G(e, r2), (s) => z(e, t2, [s]);
  1992. }
  1993. n$1(Ca, "convertUnderlyingSourceCancelCallback");
  1994. function Pa(e, t2, r2) {
  1995. return G(e, r2), (s) => z(e, t2, [s]);
  1996. }
  1997. n$1(Pa, "convertUnderlyingSourcePullCallback");
  1998. function Ea(e, t2, r2) {
  1999. return G(e, r2), (s) => O(e, t2, [s]);
  2000. }
  2001. n$1(Ea, "convertUnderlyingSourceStartCallback");
  2002. function va(e, t2) {
  2003. if (e = `${e}`, e !== "bytes") throw new TypeError(`${t2} '${e}' is not a valid enumeration value for ReadableStreamType`);
  2004. return e;
  2005. }
  2006. n$1(va, "convertReadableStreamType");
  2007. function Aa(e, t2) {
  2008. return ne(e, t2), { preventCancel: !!(e == null ? void 0 : e.preventCancel) };
  2009. }
  2010. n$1(Aa, "convertIteratorOptions");
  2011. function so(e, t2) {
  2012. ne(e, t2);
  2013. const r2 = e == null ? void 0 : e.preventAbort, s = e == null ? void 0 : e.preventCancel, f2 = e == null ? void 0 : e.preventClose, c = e == null ? void 0 : e.signal;
  2014. return c !== void 0 && Ba(c, `${t2} has member 'signal' that`), { preventAbort: !!r2, preventCancel: !!s, preventClose: !!f2, signal: c };
  2015. }
  2016. n$1(so, "convertPipeOptions");
  2017. function Ba(e, t2) {
  2018. if (!ji(e)) throw new TypeError(`${t2} is not an AbortSignal.`);
  2019. }
  2020. n$1(Ba, "assertAbortSignal");
  2021. function Wa(e, t2) {
  2022. ne(e, t2);
  2023. const r2 = e == null ? void 0 : e.readable;
  2024. dr(r2, "readable", "ReadableWritablePair"), br(r2, `${t2} has member 'readable' that`);
  2025. const s = e == null ? void 0 : e.writable;
  2026. return dr(s, "writable", "ReadableWritablePair"), Un(s, `${t2} has member 'writable' that`), { readable: r2, writable: s };
  2027. }
  2028. n$1(Wa, "convertReadableWritablePair");
  2029. const _L = class _L {
  2030. constructor(t2 = {}, r2 = {}) {
  2031. t2 === void 0 ? t2 = null : cn(t2, "First parameter");
  2032. const s = At(r2, "Second parameter"), f2 = Ta(t2, "First parameter");
  2033. if (Ur(this), f2.type === "bytes") {
  2034. if (s.size !== void 0) throw new RangeError("The strategy for a byte stream cannot have a size function");
  2035. const c = ot(s, 0);
  2036. Ci(this, f2, c);
  2037. } else {
  2038. const c = vt(s), d = ot(s, 1);
  2039. ba(this, f2, d, c);
  2040. }
  2041. }
  2042. get locked() {
  2043. if (!Te(this)) throw Ie("locked");
  2044. return Ce(this);
  2045. }
  2046. cancel(t2 = void 0) {
  2047. return Te(this) ? Ce(this) ? b(new TypeError("Cannot cancel a stream that already has a reader")) : X(this, t2) : b(Ie("cancel"));
  2048. }
  2049. getReader(t2 = void 0) {
  2050. if (!Te(this)) throw Ie("getReader");
  2051. return Ei(t2, "First parameter").mode === void 0 ? ze(this) : jn(this);
  2052. }
  2053. pipeThrough(t2, r2 = {}) {
  2054. if (!Te(this)) throw Ie("pipeThrough");
  2055. le(t2, 1, "pipeThrough");
  2056. const s = Wa(t2, "First parameter"), f2 = so(r2, "Second parameter");
  2057. if (Ce(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
  2058. if (De(s.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
  2059. const c = oo(this, s.writable, f2.preventClose, f2.preventAbort, f2.preventCancel, f2.signal);
  2060. return Q(c), s.readable;
  2061. }
  2062. pipeTo(t2, r2 = {}) {
  2063. if (!Te(this)) return b(Ie("pipeTo"));
  2064. if (t2 === void 0) return b("Parameter 1 is required in 'pipeTo'.");
  2065. if (!Le(t2)) return b(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
  2066. let s;
  2067. try {
  2068. s = so(r2, "Second parameter");
  2069. } catch (f2) {
  2070. return b(f2);
  2071. }
  2072. return Ce(this) ? b(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : De(t2) ? b(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : oo(this, t2, s.preventClose, s.preventAbort, s.preventCancel, s.signal);
  2073. }
  2074. tee() {
  2075. if (!Te(this)) throw Ie("tee");
  2076. const t2 = pa(this);
  2077. return tt(t2);
  2078. }
  2079. values(t2 = void 0) {
  2080. if (!Te(this)) throw Ie("values");
  2081. const r2 = Aa(t2, "First parameter");
  2082. return fi(this, r2.preventCancel);
  2083. }
  2084. [Sr](t2) {
  2085. return this.values(t2);
  2086. }
  2087. static from(t2) {
  2088. return Sa(t2);
  2089. }
  2090. };
  2091. n$1(_L, "ReadableStream");
  2092. let L = _L;
  2093. Object.defineProperties(L, { from: { enumerable: true } }), Object.defineProperties(L.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), h2(L.from, "from"), h2(L.prototype.cancel, "cancel"), h2(L.prototype.getReader, "getReader"), h2(L.prototype.pipeThrough, "pipeThrough"), h2(L.prototype.pipeTo, "pipeTo"), h2(L.prototype.tee, "tee"), h2(L.prototype.values, "values"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(L.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }), Object.defineProperty(L.prototype, Sr, { value: L.prototype.values, writable: true, configurable: true });
  2094. function ut(e, t2, r2, s = 1, f2 = () => 1) {
  2095. const c = Object.create(L.prototype);
  2096. Ur(c);
  2097. const d = Object.create(he.prototype);
  2098. return ao(c, d, e, t2, r2, s, f2), c;
  2099. }
  2100. n$1(ut, "CreateReadableStream");
  2101. function uo(e, t2, r2) {
  2102. const s = Object.create(L.prototype);
  2103. Ur(s);
  2104. const f2 = Object.create(ce.prototype);
  2105. return zn(s, f2, e, t2, r2, 0, void 0), s;
  2106. }
  2107. n$1(uo, "CreateReadableByteStream");
  2108. function Ur(e) {
  2109. e._state = "readable", e._reader = void 0, e._storedError = void 0, e._disturbed = false;
  2110. }
  2111. n$1(Ur, "InitializeReadableStream");
  2112. function Te(e) {
  2113. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_readableStreamController") ? false : e instanceof L;
  2114. }
  2115. n$1(Te, "IsReadableStream");
  2116. function Ce(e) {
  2117. return e._reader !== void 0;
  2118. }
  2119. n$1(Ce, "IsReadableStreamLocked");
  2120. function X(e, t2) {
  2121. if (e._disturbed = true, e._state === "closed") return T2(void 0);
  2122. if (e._state === "errored") return b(e._storedError);
  2123. lt(e);
  2124. const r2 = e._reader;
  2125. if (r2 !== void 0 && We(r2)) {
  2126. const f2 = r2._readIntoRequests;
  2127. r2._readIntoRequests = new M(), f2.forEach((c) => {
  2128. c._closeSteps(void 0);
  2129. });
  2130. }
  2131. const s = e._readableStreamController[ar](t2);
  2132. return F(s, l);
  2133. }
  2134. n$1(X, "ReadableStreamCancel");
  2135. function lt(e) {
  2136. e._state = "closed";
  2137. const t2 = e._reader;
  2138. if (t2 !== void 0 && (ln(t2), ge(t2))) {
  2139. const r2 = t2._readRequests;
  2140. t2._readRequests = new M(), r2.forEach((s) => {
  2141. s._closeSteps();
  2142. });
  2143. }
  2144. }
  2145. n$1(lt, "ReadableStreamClose");
  2146. function lo(e, t2) {
  2147. e._state = "errored", e._storedError = t2;
  2148. const r2 = e._reader;
  2149. r2 !== void 0 && (cr(r2, t2), ge(r2) ? bn(r2, t2) : Mn(r2, t2));
  2150. }
  2151. n$1(lo, "ReadableStreamError");
  2152. function Ie(e) {
  2153. return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`);
  2154. }
  2155. n$1(Ie, "streamBrandCheckException$1");
  2156. function fo(e, t2) {
  2157. ne(e, t2);
  2158. const r2 = e == null ? void 0 : e.highWaterMark;
  2159. return dr(r2, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: hr(r2) };
  2160. }
  2161. n$1(fo, "convertQueuingStrategyInit");
  2162. const co = n$1((e) => e.byteLength, "byteLengthSizeFunction");
  2163. h2(co, "size");
  2164. const _Dt = class _Dt {
  2165. constructor(t2) {
  2166. le(t2, 1, "ByteLengthQueuingStrategy"), t2 = fo(t2, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = t2.highWaterMark;
  2167. }
  2168. get highWaterMark() {
  2169. if (!mo(this)) throw ho("highWaterMark");
  2170. return this._byteLengthQueuingStrategyHighWaterMark;
  2171. }
  2172. get size() {
  2173. if (!mo(this)) throw ho("size");
  2174. return co;
  2175. }
  2176. };
  2177. n$1(_Dt, "ByteLengthQueuingStrategy");
  2178. let Dt = _Dt;
  2179. Object.defineProperties(Dt.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Dt.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true });
  2180. function ho(e) {
  2181. return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`);
  2182. }
  2183. n$1(ho, "byteLengthBrandCheckException");
  2184. function mo(e) {
  2185. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_byteLengthQueuingStrategyHighWaterMark") ? false : e instanceof Dt;
  2186. }
  2187. n$1(mo, "IsByteLengthQueuingStrategy");
  2188. const bo = n$1(() => 1, "countSizeFunction");
  2189. h2(bo, "size");
  2190. const _$t = class _$t {
  2191. constructor(t2) {
  2192. le(t2, 1, "CountQueuingStrategy"), t2 = fo(t2, "First parameter"), this._countQueuingStrategyHighWaterMark = t2.highWaterMark;
  2193. }
  2194. get highWaterMark() {
  2195. if (!yo(this)) throw po("highWaterMark");
  2196. return this._countQueuingStrategyHighWaterMark;
  2197. }
  2198. get size() {
  2199. if (!yo(this)) throw po("size");
  2200. return bo;
  2201. }
  2202. };
  2203. n$1(_$t, "CountQueuingStrategy");
  2204. let $t = _$t;
  2205. Object.defineProperties($t.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty($t.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true });
  2206. function po(e) {
  2207. return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`);
  2208. }
  2209. n$1(po, "countBrandCheckException");
  2210. function yo(e) {
  2211. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_countQueuingStrategyHighWaterMark") ? false : e instanceof $t;
  2212. }
  2213. n$1(yo, "IsCountQueuingStrategy");
  2214. function ka(e, t2) {
  2215. ne(e, t2);
  2216. const r2 = e == null ? void 0 : e.cancel, s = e == null ? void 0 : e.flush, f2 = e == null ? void 0 : e.readableType, c = e == null ? void 0 : e.start, d = e == null ? void 0 : e.transform, p = e == null ? void 0 : e.writableType;
  2217. return { cancel: r2 === void 0 ? void 0 : Fa(r2, e, `${t2} has member 'cancel' that`), flush: s === void 0 ? void 0 : qa(s, e, `${t2} has member 'flush' that`), readableType: f2, start: c === void 0 ? void 0 : Oa(c, e, `${t2} has member 'start' that`), transform: d === void 0 ? void 0 : Ia(d, e, `${t2} has member 'transform' that`), writableType: p };
  2218. }
  2219. n$1(ka, "convertTransformer");
  2220. function qa(e, t2, r2) {
  2221. return G(e, r2), (s) => z(e, t2, [s]);
  2222. }
  2223. n$1(qa, "convertTransformerFlushCallback");
  2224. function Oa(e, t2, r2) {
  2225. return G(e, r2), (s) => O(e, t2, [s]);
  2226. }
  2227. n$1(Oa, "convertTransformerStartCallback");
  2228. function Ia(e, t2, r2) {
  2229. return G(e, r2), (s, f2) => z(e, t2, [s, f2]);
  2230. }
  2231. n$1(Ia, "convertTransformerTransformCallback");
  2232. function Fa(e, t2, r2) {
  2233. return G(e, r2), (s) => z(e, t2, [s]);
  2234. }
  2235. n$1(Fa, "convertTransformerCancelCallback");
  2236. const _Mt = class _Mt {
  2237. constructor(t2 = {}, r2 = {}, s = {}) {
  2238. t2 === void 0 && (t2 = null);
  2239. const f2 = At(r2, "Second parameter"), c = At(s, "Third parameter"), d = ka(t2, "First parameter");
  2240. if (d.readableType !== void 0) throw new RangeError("Invalid readableType specified");
  2241. if (d.writableType !== void 0) throw new RangeError("Invalid writableType specified");
  2242. const p = ot(c, 0), R = vt(c), y = ot(f2, 1), C = vt(f2);
  2243. let P;
  2244. const B = A((ee) => {
  2245. P = ee;
  2246. });
  2247. za(this, B, y, C, p, R), La(this, d), d.start !== void 0 ? P(d.start(this._transformStreamController)) : P(void 0);
  2248. }
  2249. get readable() {
  2250. if (!go(this)) throw Ro("readable");
  2251. return this._readable;
  2252. }
  2253. get writable() {
  2254. if (!go(this)) throw Ro("writable");
  2255. return this._writable;
  2256. }
  2257. };
  2258. n$1(_Mt, "TransformStream");
  2259. let Mt = _Mt;
  2260. Object.defineProperties(Mt.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Mt.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true });
  2261. function za(e, t2, r2, s, f2, c) {
  2262. function d() {
  2263. return t2;
  2264. }
  2265. n$1(d, "startAlgorithm");
  2266. function p(B) {
  2267. return Ma(e, B);
  2268. }
  2269. n$1(p, "writeAlgorithm");
  2270. function R(B) {
  2271. return Ua(e, B);
  2272. }
  2273. n$1(R, "abortAlgorithm");
  2274. function y() {
  2275. return xa(e);
  2276. }
  2277. n$1(y, "closeAlgorithm"), e._writable = $i(d, p, y, R, r2, s);
  2278. function C() {
  2279. return Na(e);
  2280. }
  2281. n$1(C, "pullAlgorithm");
  2282. function P(B) {
  2283. return Ha(e, B);
  2284. }
  2285. n$1(P, "cancelAlgorithm"), e._readable = ut(d, C, P, f2, c), e._backpressure = void 0, e._backpressureChangePromise = void 0, e._backpressureChangePromise_resolve = void 0, Ut(e, true), e._transformStreamController = void 0;
  2286. }
  2287. n$1(za, "InitializeTransformStream");
  2288. function go(e) {
  2289. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_transformStreamController") ? false : e instanceof Mt;
  2290. }
  2291. n$1(go, "IsTransformStream");
  2292. function _o(e, t2) {
  2293. J(e._readable._readableStreamController, t2), xr(e, t2);
  2294. }
  2295. n$1(_o, "TransformStreamError");
  2296. function xr(e, t2) {
  2297. Nt(e._transformStreamController), it(e._writable._writableStreamController, t2), Nr(e);
  2298. }
  2299. n$1(xr, "TransformStreamErrorWritableAndUnblockWrite");
  2300. function Nr(e) {
  2301. e._backpressure && Ut(e, false);
  2302. }
  2303. n$1(Nr, "TransformStreamUnblockWrite");
  2304. function Ut(e, t2) {
  2305. e._backpressureChangePromise !== void 0 && e._backpressureChangePromise_resolve(), e._backpressureChangePromise = A((r2) => {
  2306. e._backpressureChangePromise_resolve = r2;
  2307. }), e._backpressure = t2;
  2308. }
  2309. n$1(Ut, "TransformStreamSetBackpressure");
  2310. const _Pe = class _Pe {
  2311. constructor() {
  2312. throw new TypeError("Illegal constructor");
  2313. }
  2314. get desiredSize() {
  2315. if (!xt(this)) throw Ht("desiredSize");
  2316. const t2 = this._controlledTransformStream._readable._readableStreamController;
  2317. return Mr(t2);
  2318. }
  2319. enqueue(t2 = void 0) {
  2320. if (!xt(this)) throw Ht("enqueue");
  2321. So(this, t2);
  2322. }
  2323. error(t2 = void 0) {
  2324. if (!xt(this)) throw Ht("error");
  2325. Da(this, t2);
  2326. }
  2327. terminate() {
  2328. if (!xt(this)) throw Ht("terminate");
  2329. $a(this);
  2330. }
  2331. };
  2332. n$1(_Pe, "TransformStreamDefaultController");
  2333. let Pe = _Pe;
  2334. Object.defineProperties(Pe.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), h2(Pe.prototype.enqueue, "enqueue"), h2(Pe.prototype.error, "error"), h2(Pe.prototype.terminate, "terminate"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Pe.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true });
  2335. function xt(e) {
  2336. return !u(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledTransformStream") ? false : e instanceof Pe;
  2337. }
  2338. n$1(xt, "IsTransformStreamDefaultController");
  2339. function ja(e, t2, r2, s, f2) {
  2340. t2._controlledTransformStream = e, e._transformStreamController = t2, t2._transformAlgorithm = r2, t2._flushAlgorithm = s, t2._cancelAlgorithm = f2, t2._finishPromise = void 0, t2._finishPromise_resolve = void 0, t2._finishPromise_reject = void 0;
  2341. }
  2342. n$1(ja, "SetUpTransformStreamDefaultController");
  2343. function La(e, t2) {
  2344. const r2 = Object.create(Pe.prototype);
  2345. let s, f2, c;
  2346. t2.transform !== void 0 ? s = n$1((d) => t2.transform(d, r2), "transformAlgorithm") : s = n$1((d) => {
  2347. try {
  2348. return So(r2, d), T2(void 0);
  2349. } catch (p) {
  2350. return b(p);
  2351. }
  2352. }, "transformAlgorithm"), t2.flush !== void 0 ? f2 = n$1(() => t2.flush(r2), "flushAlgorithm") : f2 = n$1(() => T2(void 0), "flushAlgorithm"), t2.cancel !== void 0 ? c = n$1((d) => t2.cancel(d), "cancelAlgorithm") : c = n$1(() => T2(void 0), "cancelAlgorithm"), ja(e, r2, s, f2, c);
  2353. }
  2354. n$1(La, "SetUpTransformStreamDefaultControllerFromTransformer");
  2355. function Nt(e) {
  2356. e._transformAlgorithm = void 0, e._flushAlgorithm = void 0, e._cancelAlgorithm = void 0;
  2357. }
  2358. n$1(Nt, "TransformStreamDefaultControllerClearAlgorithms");
  2359. function So(e, t2) {
  2360. const r2 = e._controlledTransformStream, s = r2._readable._readableStreamController;
  2361. if (!Ue(s)) throw new TypeError("Readable side is not in a state that permits enqueue");
  2362. try {
  2363. Me(s, t2);
  2364. } catch (c) {
  2365. throw xr(r2, c), r2._readable._storedError;
  2366. }
  2367. ma(s) !== r2._backpressure && Ut(r2, true);
  2368. }
  2369. n$1(So, "TransformStreamDefaultControllerEnqueue");
  2370. function Da(e, t2) {
  2371. _o(e._controlledTransformStream, t2);
  2372. }
  2373. n$1(Da, "TransformStreamDefaultControllerError");
  2374. function wo(e, t2) {
  2375. const r2 = e._transformAlgorithm(t2);
  2376. return F(r2, void 0, (s) => {
  2377. throw _o(e._controlledTransformStream, s), s;
  2378. });
  2379. }
  2380. n$1(wo, "TransformStreamDefaultControllerPerformTransform");
  2381. function $a(e) {
  2382. const t2 = e._controlledTransformStream, r2 = t2._readable._readableStreamController;
  2383. Oe(r2);
  2384. const s = new TypeError("TransformStream terminated");
  2385. xr(t2, s);
  2386. }
  2387. n$1($a, "TransformStreamDefaultControllerTerminate");
  2388. function Ma(e, t2) {
  2389. const r2 = e._transformStreamController;
  2390. if (e._backpressure) {
  2391. const s = e._backpressureChangePromise;
  2392. return F(s, () => {
  2393. const f2 = e._writable;
  2394. if (f2._state === "erroring") throw f2._storedError;
  2395. return wo(r2, t2);
  2396. });
  2397. }
  2398. return wo(r2, t2);
  2399. }
  2400. n$1(Ma, "TransformStreamDefaultSinkWriteAlgorithm");
  2401. function Ua(e, t2) {
  2402. const r2 = e._transformStreamController;
  2403. if (r2._finishPromise !== void 0) return r2._finishPromise;
  2404. const s = e._readable;
  2405. r2._finishPromise = A((c, d) => {
  2406. r2._finishPromise_resolve = c, r2._finishPromise_reject = d;
  2407. });
  2408. const f2 = r2._cancelAlgorithm(t2);
  2409. return Nt(r2), g(f2, () => (s._state === "errored" ? xe(r2, s._storedError) : (J(s._readableStreamController, t2), Hr(r2)), null), (c) => (J(s._readableStreamController, c), xe(r2, c), null)), r2._finishPromise;
  2410. }
  2411. n$1(Ua, "TransformStreamDefaultSinkAbortAlgorithm");
  2412. function xa(e) {
  2413. const t2 = e._transformStreamController;
  2414. if (t2._finishPromise !== void 0) return t2._finishPromise;
  2415. const r2 = e._readable;
  2416. t2._finishPromise = A((f2, c) => {
  2417. t2._finishPromise_resolve = f2, t2._finishPromise_reject = c;
  2418. });
  2419. const s = t2._flushAlgorithm();
  2420. return Nt(t2), g(s, () => (r2._state === "errored" ? xe(t2, r2._storedError) : (Oe(r2._readableStreamController), Hr(t2)), null), (f2) => (J(r2._readableStreamController, f2), xe(t2, f2), null)), t2._finishPromise;
  2421. }
  2422. n$1(xa, "TransformStreamDefaultSinkCloseAlgorithm");
  2423. function Na(e) {
  2424. return Ut(e, false), e._backpressureChangePromise;
  2425. }
  2426. n$1(Na, "TransformStreamDefaultSourcePullAlgorithm");
  2427. function Ha(e, t2) {
  2428. const r2 = e._transformStreamController;
  2429. if (r2._finishPromise !== void 0) return r2._finishPromise;
  2430. const s = e._writable;
  2431. r2._finishPromise = A((c, d) => {
  2432. r2._finishPromise_resolve = c, r2._finishPromise_reject = d;
  2433. });
  2434. const f2 = r2._cancelAlgorithm(t2);
  2435. return Nt(r2), g(f2, () => (s._state === "errored" ? xe(r2, s._storedError) : (it(s._writableStreamController, t2), Nr(e), Hr(r2)), null), (c) => (it(s._writableStreamController, c), Nr(e), xe(r2, c), null)), r2._finishPromise;
  2436. }
  2437. n$1(Ha, "TransformStreamDefaultSourceCancelAlgorithm");
  2438. function Ht(e) {
  2439. return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`);
  2440. }
  2441. n$1(Ht, "defaultControllerBrandCheckException");
  2442. function Hr(e) {
  2443. e._finishPromise_resolve !== void 0 && (e._finishPromise_resolve(), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);
  2444. }
  2445. n$1(Hr, "defaultControllerFinishPromiseResolve");
  2446. function xe(e, t2) {
  2447. e._finishPromise_reject !== void 0 && (Q(e._finishPromise), e._finishPromise_reject(t2), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);
  2448. }
  2449. n$1(xe, "defaultControllerFinishPromiseReject");
  2450. function Ro(e) {
  2451. return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`);
  2452. }
  2453. n$1(Ro, "streamBrandCheckException"), a.ByteLengthQueuingStrategy = Dt, a.CountQueuingStrategy = $t, a.ReadableByteStreamController = ce, a.ReadableStream = L, a.ReadableStreamBYOBReader = we, a.ReadableStreamBYOBRequest = ve, a.ReadableStreamDefaultController = he, a.ReadableStreamDefaultReader = ye, a.TransformStream = Mt, a.TransformStreamDefaultController = Pe, a.WritableStream = Re, a.WritableStreamDefaultController = $e, a.WritableStreamDefaultWriter = de;
  2454. });
  2455. }(ct, ct.exports)), ct.exports;
  2456. }
  2457. n$1(ns, "requirePonyfill_es2018");
  2458. var Ao;
  2459. function os() {
  2460. if (Ao) return Eo;
  2461. Ao = 1;
  2462. const i = 65536;
  2463. if (!globalThis.ReadableStream) try {
  2464. const o2 = require("node:process"), { emitWarning: a } = o2;
  2465. try {
  2466. o2.emitWarning = () => {
  2467. }, Object.assign(globalThis, require("node:stream/web")), o2.emitWarning = a;
  2468. } catch (l) {
  2469. throw o2.emitWarning = a, l;
  2470. }
  2471. } catch {
  2472. Object.assign(globalThis, ns());
  2473. }
  2474. try {
  2475. const { Blob: o2 } = require("buffer");
  2476. o2 && !o2.prototype.stream && (o2.prototype.stream = n$1(function(l) {
  2477. let u = 0;
  2478. const m = this;
  2479. return new ReadableStream({ type: "bytes", async pull(h2) {
  2480. const E = await m.slice(u, Math.min(m.size, u + i)).arrayBuffer();
  2481. u += E.byteLength, h2.enqueue(new Uint8Array(E)), u === m.size && h2.close();
  2482. } });
  2483. }, "name"));
  2484. } catch {
  2485. }
  2486. return Eo;
  2487. }
  2488. n$1(os, "requireStreams"), os();
  2489. /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  2490. const Bo = 65536;
  2491. async function* Qr(i, o2 = true) {
  2492. for (const a of i) if ("stream" in a) yield* a.stream();
  2493. else if (ArrayBuffer.isView(a)) if (o2) {
  2494. let l = a.byteOffset;
  2495. const u = a.byteOffset + a.byteLength;
  2496. for (; l !== u; ) {
  2497. const m = Math.min(u - l, Bo), h2 = a.buffer.slice(l, l + m);
  2498. l += h2.byteLength, yield new Uint8Array(h2);
  2499. }
  2500. } else yield a;
  2501. else {
  2502. let l = 0, u = a;
  2503. for (; l !== u.size; ) {
  2504. const h2 = await u.slice(l, Math.min(u.size, l + Bo)).arrayBuffer();
  2505. l += h2.byteLength, yield new Uint8Array(h2);
  2506. }
  2507. }
  2508. }
  2509. n$1(Qr, "toIterator");
  2510. const Wo = (_a = class {
  2511. constructor(o2 = [], a = {}) {
  2512. __privateAdd(this, _e, []);
  2513. __privateAdd(this, _t, "");
  2514. __privateAdd(this, _r, 0);
  2515. __privateAdd(this, _n, "transparent");
  2516. if (typeof o2 != "object" || o2 === null) throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
  2517. if (typeof o2[Symbol.iterator] != "function") throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
  2518. if (typeof a != "object" && typeof a != "function") throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
  2519. a === null && (a = {});
  2520. const l = new TextEncoder();
  2521. for (const m of o2) {
  2522. let h2;
  2523. ArrayBuffer.isView(m) ? h2 = new Uint8Array(m.buffer.slice(m.byteOffset, m.byteOffset + m.byteLength)) : m instanceof ArrayBuffer ? h2 = new Uint8Array(m.slice(0)) : m instanceof _a ? h2 = m : h2 = l.encode(`${m}`), __privateSet(this, _r, __privateGet(this, _r) + (ArrayBuffer.isView(h2) ? h2.byteLength : h2.size)), __privateGet(this, _e).push(h2);
  2524. }
  2525. __privateSet(this, _n, `${a.endings === void 0 ? "transparent" : a.endings}`);
  2526. const u = a.type === void 0 ? "" : String(a.type);
  2527. __privateSet(this, _t, /^[\x20-\x7E]*$/.test(u) ? u : "");
  2528. }
  2529. get size() {
  2530. return __privateGet(this, _r);
  2531. }
  2532. get type() {
  2533. return __privateGet(this, _t);
  2534. }
  2535. async text() {
  2536. const o2 = new TextDecoder();
  2537. let a = "";
  2538. for await (const l of Qr(__privateGet(this, _e), false)) a += o2.decode(l, { stream: true });
  2539. return a += o2.decode(), a;
  2540. }
  2541. async arrayBuffer() {
  2542. const o2 = new Uint8Array(this.size);
  2543. let a = 0;
  2544. for await (const l of Qr(__privateGet(this, _e), false)) o2.set(l, a), a += l.length;
  2545. return o2.buffer;
  2546. }
  2547. stream() {
  2548. const o2 = Qr(__privateGet(this, _e), true);
  2549. return new globalThis.ReadableStream({ type: "bytes", async pull(a) {
  2550. const l = await o2.next();
  2551. l.done ? a.close() : a.enqueue(l.value);
  2552. }, async cancel() {
  2553. await o2.return();
  2554. } });
  2555. }
  2556. slice(o2 = 0, a = this.size, l = "") {
  2557. const { size: u } = this;
  2558. let m = o2 < 0 ? Math.max(u + o2, 0) : Math.min(o2, u), h2 = a < 0 ? Math.max(u + a, 0) : Math.min(a, u);
  2559. const S = Math.max(h2 - m, 0), E = __privateGet(this, _e), w = [];
  2560. let A = 0;
  2561. for (const b of E) {
  2562. if (A >= S) break;
  2563. const q = ArrayBuffer.isView(b) ? b.byteLength : b.size;
  2564. if (m && q <= m) m -= q, h2 -= q;
  2565. else {
  2566. let g;
  2567. ArrayBuffer.isView(b) ? (g = b.subarray(m, Math.min(q, h2)), A += g.byteLength) : (g = b.slice(m, Math.min(q, h2)), A += g.size), h2 -= q, w.push(g), m = 0;
  2568. }
  2569. }
  2570. const T2 = new _a([], { type: String(l).toLowerCase() });
  2571. return __privateSet(T2, _r, S), __privateSet(T2, _e, w), T2;
  2572. }
  2573. get [Symbol.toStringTag]() {
  2574. return "Blob";
  2575. }
  2576. static [Symbol.hasInstance](o2) {
  2577. return o2 && typeof o2 == "object" && typeof o2.constructor == "function" && (typeof o2.stream == "function" || typeof o2.arrayBuffer == "function") && /^(Blob|File)$/.test(o2[Symbol.toStringTag]);
  2578. }
  2579. }, _e = new WeakMap(), _t = new WeakMap(), _r = new WeakMap(), _n = new WeakMap(), n$1(_a, "Blob"), _a);
  2580. Object.defineProperties(Wo.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } });
  2581. const Ze = Wo, is = (_b = class extends Ze {
  2582. constructor(o2, a, l = {}) {
  2583. if (arguments.length < 2) throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
  2584. super(o2, l);
  2585. __privateAdd(this, _e2, 0);
  2586. __privateAdd(this, _t2, "");
  2587. l === null && (l = {});
  2588. const u = l.lastModified === void 0 ? Date.now() : Number(l.lastModified);
  2589. Number.isNaN(u) || __privateSet(this, _e2, u), __privateSet(this, _t2, String(a));
  2590. }
  2591. get name() {
  2592. return __privateGet(this, _t2);
  2593. }
  2594. get lastModified() {
  2595. return __privateGet(this, _e2);
  2596. }
  2597. get [Symbol.toStringTag]() {
  2598. return "File";
  2599. }
  2600. static [Symbol.hasInstance](o2) {
  2601. return !!o2 && o2 instanceof Ze && /^(File)$/.test(o2[Symbol.toStringTag]);
  2602. }
  2603. }, _e2 = new WeakMap(), _t2 = new WeakMap(), n$1(_b, "File"), _b), Yr = is;
  2604. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  2605. var { toStringTag: dt, iterator: as, hasInstance: ss } = Symbol, ko = Math.random, us = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","), qo = n$1((i, o2, a) => (i += "", /^(Blob|File)$/.test(o2 && o2[dt]) ? [(a = a !== void 0 ? a + "" : o2[dt] == "File" ? o2.name : "blob", i), o2.name !== a || o2[dt] == "blob" ? new Yr([o2], a, o2) : o2] : [i, o2 + ""]), "f"), Gr = n$1((i, o2) => (o2 ? i : i.replace(/\r?\n|\r/g, `\r
  2606. `)).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "e$1"), Fe = n$1((i, o2, a) => {
  2607. if (o2.length < a) throw new TypeError(`Failed to execute '${i}' on 'FormData': ${a} arguments required, but only ${o2.length} present.`);
  2608. }, "x");
  2609. const Zt = (_c = class {
  2610. constructor(...o2) {
  2611. __privateAdd(this, _e3, []);
  2612. if (o2.length) throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.");
  2613. }
  2614. get [dt]() {
  2615. return "FormData";
  2616. }
  2617. [as]() {
  2618. return this.entries();
  2619. }
  2620. static [ss](o2) {
  2621. return o2 && typeof o2 == "object" && o2[dt] === "FormData" && !us.some((a) => typeof o2[a] != "function");
  2622. }
  2623. append(...o2) {
  2624. Fe("append", arguments, 2), __privateGet(this, _e3).push(qo(...o2));
  2625. }
  2626. delete(o2) {
  2627. Fe("delete", arguments, 1), o2 += "", __privateSet(this, _e3, __privateGet(this, _e3).filter(([a]) => a !== o2));
  2628. }
  2629. get(o2) {
  2630. Fe("get", arguments, 1), o2 += "";
  2631. for (var a = __privateGet(this, _e3), l = a.length, u = 0; u < l; u++) if (a[u][0] === o2) return a[u][1];
  2632. return null;
  2633. }
  2634. getAll(o2, a) {
  2635. return Fe("getAll", arguments, 1), a = [], o2 += "", __privateGet(this, _e3).forEach((l) => l[0] === o2 && a.push(l[1])), a;
  2636. }
  2637. has(o2) {
  2638. return Fe("has", arguments, 1), o2 += "", __privateGet(this, _e3).some((a) => a[0] === o2);
  2639. }
  2640. forEach(o2, a) {
  2641. Fe("forEach", arguments, 1);
  2642. for (var [l, u] of this) o2.call(a, u, l, this);
  2643. }
  2644. set(...o2) {
  2645. Fe("set", arguments, 2);
  2646. var a = [], l = true;
  2647. o2 = qo(...o2), __privateGet(this, _e3).forEach((u) => {
  2648. u[0] === o2[0] ? l && (l = !a.push(o2)) : a.push(u);
  2649. }), l && a.push(o2), __privateSet(this, _e3, a);
  2650. }
  2651. *entries() {
  2652. yield* __privateGet(this, _e3);
  2653. }
  2654. *keys() {
  2655. for (var [o2] of this) yield o2;
  2656. }
  2657. *values() {
  2658. for (var [, o2] of this) yield o2;
  2659. }
  2660. }, _e3 = new WeakMap(), n$1(_c, "FormData"), _c);
  2661. function ls(i, o2 = Ze) {
  2662. var a = `${ko()}${ko()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), l = [], u = `--${a}\r
  2663. Content-Disposition: form-data; name="`;
  2664. return i.forEach((m, h2) => typeof m == "string" ? l.push(u + Gr(h2) + `"\r
  2665. \r
  2666. ${m.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n", "g"), `\r
  2667. `)}\r
  2668. `) : l.push(u + Gr(h2) + `"; filename="${Gr(m.name, 1)}"\r
  2669. Content-Type: ${m.type || "application/octet-stream"}\r
  2670. \r
  2671. `, m, `\r
  2672. `)), l.push(`--${a}--`), new o2(l, { type: "multipart/form-data; boundary=" + a });
  2673. }
  2674. n$1(ls, "formDataToBlob");
  2675. const _Kt = class _Kt extends Error {
  2676. constructor(o2, a) {
  2677. super(o2), Error.captureStackTrace(this, this.constructor), this.type = a;
  2678. }
  2679. get name() {
  2680. return this.constructor.name;
  2681. }
  2682. get [Symbol.toStringTag]() {
  2683. return this.constructor.name;
  2684. }
  2685. };
  2686. n$1(_Kt, "FetchBaseError");
  2687. let Kt = _Kt;
  2688. const _te = class _te extends Kt {
  2689. constructor(o2, a, l) {
  2690. super(o2, a), l && (this.code = this.errno = l.code, this.erroredSysCall = l.syscall);
  2691. }
  2692. };
  2693. n$1(_te, "FetchError");
  2694. let te = _te;
  2695. const Jt = Symbol.toStringTag, Oo = n$1((i) => typeof i == "object" && typeof i.append == "function" && typeof i.delete == "function" && typeof i.get == "function" && typeof i.getAll == "function" && typeof i.has == "function" && typeof i.set == "function" && typeof i.sort == "function" && i[Jt] === "URLSearchParams", "isURLSearchParameters"), Xt = n$1((i) => i && typeof i == "object" && typeof i.arrayBuffer == "function" && typeof i.type == "string" && typeof i.stream == "function" && typeof i.constructor == "function" && /^(Blob|File)$/.test(i[Jt]), "isBlob"), fs = n$1((i) => typeof i == "object" && (i[Jt] === "AbortSignal" || i[Jt] === "EventTarget"), "isAbortSignal"), cs = n$1((i, o2) => {
  2696. const a = new URL(o2).hostname, l = new URL(i).hostname;
  2697. return a === l || a.endsWith(`.${l}`);
  2698. }, "isDomainOrSubdomain"), ds = n$1((i, o2) => {
  2699. const a = new URL(o2).protocol, l = new URL(i).protocol;
  2700. return a === l;
  2701. }, "isSameProtocol"), hs = promisify(ie.pipeline), N = Symbol("Body internals");
  2702. const _ht = class _ht {
  2703. constructor(o2, { size: a = 0 } = {}) {
  2704. let l = null;
  2705. o2 === null ? o2 = null : Oo(o2) ? o2 = Buffer$1.from(o2.toString()) : Xt(o2) || Buffer$1.isBuffer(o2) || (types.isAnyArrayBuffer(o2) ? o2 = Buffer$1.from(o2) : ArrayBuffer.isView(o2) ? o2 = Buffer$1.from(o2.buffer, o2.byteOffset, o2.byteLength) : o2 instanceof ie || (o2 instanceof Zt ? (o2 = ls(o2), l = o2.type.split("=")[1]) : o2 = Buffer$1.from(String(o2))));
  2706. let u = o2;
  2707. Buffer$1.isBuffer(o2) ? u = ie.Readable.from(o2) : Xt(o2) && (u = ie.Readable.from(o2.stream())), this[N] = { body: o2, stream: u, boundary: l, disturbed: false, error: null }, this.size = a, o2 instanceof ie && o2.on("error", (m) => {
  2708. const h2 = m instanceof Kt ? m : new te(`Invalid response body while trying to fetch ${this.url}: ${m.message}`, "system", m);
  2709. this[N].error = h2;
  2710. });
  2711. }
  2712. get body() {
  2713. return this[N].stream;
  2714. }
  2715. get bodyUsed() {
  2716. return this[N].disturbed;
  2717. }
  2718. async arrayBuffer() {
  2719. const { buffer: o2, byteOffset: a, byteLength: l } = await Zr(this);
  2720. return o2.slice(a, a + l);
  2721. }
  2722. async formData() {
  2723. const o2 = this.headers.get("content-type");
  2724. if (o2.startsWith("application/x-www-form-urlencoded")) {
  2725. const l = new Zt(), u = new URLSearchParams(await this.text());
  2726. for (const [m, h2] of u) l.append(m, h2);
  2727. return l;
  2728. }
  2729. const { toFormData: a } = await import('./multipart-parser-BS1x8A2O.mjs');
  2730. return a(this.body, o2);
  2731. }
  2732. async blob() {
  2733. const o2 = this.headers && this.headers.get("content-type") || this[N].body && this[N].body.type || "", a = await this.arrayBuffer();
  2734. return new Ze([a], { type: o2 });
  2735. }
  2736. async json() {
  2737. const o2 = await this.text();
  2738. return JSON.parse(o2);
  2739. }
  2740. async text() {
  2741. const o2 = await Zr(this);
  2742. return new TextDecoder().decode(o2);
  2743. }
  2744. buffer() {
  2745. return Zr(this);
  2746. }
  2747. };
  2748. n$1(_ht, "Body");
  2749. let ht = _ht;
  2750. ht.prototype.buffer = deprecate(ht.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"), Object.defineProperties(ht.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: deprecate(() => {
  2751. }, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)") } });
  2752. async function Zr(i) {
  2753. if (i[N].disturbed) throw new TypeError(`body used already for: ${i.url}`);
  2754. if (i[N].disturbed = true, i[N].error) throw i[N].error;
  2755. const { body: o2 } = i;
  2756. if (o2 === null) return Buffer$1.alloc(0);
  2757. if (!(o2 instanceof ie)) return Buffer$1.alloc(0);
  2758. const a = [];
  2759. let l = 0;
  2760. try {
  2761. for await (const u of o2) {
  2762. if (i.size > 0 && l + u.length > i.size) {
  2763. const m = new te(`content size at ${i.url} over limit: ${i.size}`, "max-size");
  2764. throw o2.destroy(m), m;
  2765. }
  2766. l += u.length, a.push(u);
  2767. }
  2768. } catch (u) {
  2769. throw u instanceof Kt ? u : new te(`Invalid response body while trying to fetch ${i.url}: ${u.message}`, "system", u);
  2770. }
  2771. if (o2.readableEnded === true || o2._readableState.ended === true) try {
  2772. return a.every((u) => typeof u == "string") ? Buffer$1.from(a.join("")) : Buffer$1.concat(a, l);
  2773. } catch (u) {
  2774. throw new te(`Could not create Buffer from response body for ${i.url}: ${u.message}`, "system", u);
  2775. }
  2776. else throw new te(`Premature close of server response while trying to fetch ${i.url}`);
  2777. }
  2778. n$1(Zr, "consumeBody");
  2779. const Kr = n$1((i, o2) => {
  2780. let a, l, { body: u } = i[N];
  2781. if (i.bodyUsed) throw new Error("cannot clone body after it is used");
  2782. return u instanceof ie && typeof u.getBoundary != "function" && (a = new PassThrough({ highWaterMark: o2 }), l = new PassThrough({ highWaterMark: o2 }), u.pipe(a), u.pipe(l), i[N].stream = a, u = l), u;
  2783. }, "clone"), ms = deprecate((i) => i.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167"), Io = n$1((i, o2) => i === null ? null : typeof i == "string" ? "text/plain;charset=UTF-8" : Oo(i) ? "application/x-www-form-urlencoded;charset=UTF-8" : Xt(i) ? i.type || null : Buffer$1.isBuffer(i) || types.isAnyArrayBuffer(i) || ArrayBuffer.isView(i) ? null : i instanceof Zt ? `multipart/form-data; boundary=${o2[N].boundary}` : i && typeof i.getBoundary == "function" ? `multipart/form-data;boundary=${ms(i)}` : i instanceof ie ? null : "text/plain;charset=UTF-8", "extractContentType"), bs = n$1((i) => {
  2784. const { body: o2 } = i[N];
  2785. return o2 === null ? 0 : Xt(o2) ? o2.size : Buffer$1.isBuffer(o2) ? o2.length : o2 && typeof o2.getLengthSync == "function" && o2.hasKnownLength && o2.hasKnownLength() ? o2.getLengthSync() : null;
  2786. }, "getTotalBytes"), ps = n$1(async (i, { body: o2 }) => {
  2787. o2 === null ? i.end() : await hs(o2, i);
  2788. }, "writeToStream"), er = typeof ft.validateHeaderName == "function" ? ft.validateHeaderName : (i) => {
  2789. if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(i)) {
  2790. const o2 = new TypeError(`Header name must be a valid HTTP token [${i}]`);
  2791. throw Object.defineProperty(o2, "code", { value: "ERR_INVALID_HTTP_TOKEN" }), o2;
  2792. }
  2793. }, Jr = typeof ft.validateHeaderValue == "function" ? ft.validateHeaderValue : (i, o2) => {
  2794. if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(o2)) {
  2795. const a = new TypeError(`Invalid character in header content ["${i}"]`);
  2796. throw Object.defineProperty(a, "code", { value: "ERR_INVALID_CHAR" }), a;
  2797. }
  2798. };
  2799. const _ae = class _ae extends URLSearchParams {
  2800. constructor(o2) {
  2801. let a = [];
  2802. if (o2 instanceof _ae) {
  2803. const l = o2.raw();
  2804. for (const [u, m] of Object.entries(l)) a.push(...m.map((h2) => [u, h2]));
  2805. } else if (o2 != null) if (typeof o2 == "object" && !types.isBoxedPrimitive(o2)) {
  2806. const l = o2[Symbol.iterator];
  2807. if (l == null) a.push(...Object.entries(o2));
  2808. else {
  2809. if (typeof l != "function") throw new TypeError("Header pairs must be iterable");
  2810. a = [...o2].map((u) => {
  2811. if (typeof u != "object" || types.isBoxedPrimitive(u)) throw new TypeError("Each header pair must be an iterable object");
  2812. return [...u];
  2813. }).map((u) => {
  2814. if (u.length !== 2) throw new TypeError("Each header pair must be a name/value tuple");
  2815. return [...u];
  2816. });
  2817. }
  2818. } else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
  2819. return a = a.length > 0 ? a.map(([l, u]) => (er(l), Jr(l, String(u)), [String(l).toLowerCase(), String(u)])) : void 0, super(a), new Proxy(this, { get(l, u, m) {
  2820. switch (u) {
  2821. case "append":
  2822. case "set":
  2823. return (h2, S) => (er(h2), Jr(h2, String(S)), URLSearchParams.prototype[u].call(l, String(h2).toLowerCase(), String(S)));
  2824. case "delete":
  2825. case "has":
  2826. case "getAll":
  2827. return (h2) => (er(h2), URLSearchParams.prototype[u].call(l, String(h2).toLowerCase()));
  2828. case "keys":
  2829. return () => (l.sort(), new Set(URLSearchParams.prototype.keys.call(l)).keys());
  2830. default:
  2831. return Reflect.get(l, u, m);
  2832. }
  2833. } });
  2834. }
  2835. get [Symbol.toStringTag]() {
  2836. return this.constructor.name;
  2837. }
  2838. toString() {
  2839. return Object.prototype.toString.call(this);
  2840. }
  2841. get(o2) {
  2842. const a = this.getAll(o2);
  2843. if (a.length === 0) return null;
  2844. let l = a.join(", ");
  2845. return /^content-encoding$/i.test(o2) && (l = l.toLowerCase()), l;
  2846. }
  2847. forEach(o2, a = void 0) {
  2848. for (const l of this.keys()) Reflect.apply(o2, a, [this.get(l), l, this]);
  2849. }
  2850. *values() {
  2851. for (const o2 of this.keys()) yield this.get(o2);
  2852. }
  2853. *entries() {
  2854. for (const o2 of this.keys()) yield [o2, this.get(o2)];
  2855. }
  2856. [Symbol.iterator]() {
  2857. return this.entries();
  2858. }
  2859. raw() {
  2860. return [...this.keys()].reduce((o2, a) => (o2[a] = this.getAll(a), o2), {});
  2861. }
  2862. [Symbol.for("nodejs.util.inspect.custom")]() {
  2863. return [...this.keys()].reduce((o2, a) => {
  2864. const l = this.getAll(a);
  2865. return a === "host" ? o2[a] = l[0] : o2[a] = l.length > 1 ? l : l[0], o2;
  2866. }, {});
  2867. }
  2868. };
  2869. n$1(_ae, "Headers");
  2870. let ae = _ae;
  2871. Object.defineProperties(ae.prototype, ["get", "entries", "forEach", "values"].reduce((i, o2) => (i[o2] = { enumerable: true }, i), {}));
  2872. function ys(i = []) {
  2873. return new ae(i.reduce((o2, a, l, u) => (l % 2 === 0 && o2.push(u.slice(l, l + 2)), o2), []).filter(([o2, a]) => {
  2874. try {
  2875. return er(o2), Jr(o2, String(a)), true;
  2876. } catch {
  2877. return false;
  2878. }
  2879. }));
  2880. }
  2881. n$1(ys, "fromRawHeaders");
  2882. const gs = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]), Xr = n$1((i) => gs.has(i), "isRedirect"), re = Symbol("Response internals");
  2883. const _H = class _H extends ht {
  2884. constructor(o2 = null, a = {}) {
  2885. super(o2, a);
  2886. const l = a.status != null ? a.status : 200, u = new ae(a.headers);
  2887. if (o2 !== null && !u.has("Content-Type")) {
  2888. const m = Io(o2, this);
  2889. m && u.append("Content-Type", m);
  2890. }
  2891. this[re] = { type: "default", url: a.url, status: l, statusText: a.statusText || "", headers: u, counter: a.counter, highWaterMark: a.highWaterMark };
  2892. }
  2893. get type() {
  2894. return this[re].type;
  2895. }
  2896. get url() {
  2897. return this[re].url || "";
  2898. }
  2899. get status() {
  2900. return this[re].status;
  2901. }
  2902. get ok() {
  2903. return this[re].status >= 200 && this[re].status < 300;
  2904. }
  2905. get redirected() {
  2906. return this[re].counter > 0;
  2907. }
  2908. get statusText() {
  2909. return this[re].statusText;
  2910. }
  2911. get headers() {
  2912. return this[re].headers;
  2913. }
  2914. get highWaterMark() {
  2915. return this[re].highWaterMark;
  2916. }
  2917. clone() {
  2918. return new _H(Kr(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark });
  2919. }
  2920. static redirect(o2, a = 302) {
  2921. if (!Xr(a)) throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
  2922. return new _H(null, { headers: { location: new URL(o2).toString() }, status: a });
  2923. }
  2924. static error() {
  2925. const o2 = new _H(null, { status: 0, statusText: "" });
  2926. return o2[re].type = "error", o2;
  2927. }
  2928. static json(o2 = void 0, a = {}) {
  2929. const l = JSON.stringify(o2);
  2930. if (l === void 0) throw new TypeError("data is not JSON serializable");
  2931. const u = new ae(a && a.headers);
  2932. return u.has("content-type") || u.set("content-type", "application/json"), new _H(l, { ...a, headers: u });
  2933. }
  2934. get [Symbol.toStringTag]() {
  2935. return "Response";
  2936. }
  2937. };
  2938. n$1(_H, "Response");
  2939. let H = _H;
  2940. Object.defineProperties(H.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } });
  2941. const _s = n$1((i) => {
  2942. if (i.search) return i.search;
  2943. const o2 = i.href.length - 1, a = i.hash || (i.href[o2] === "#" ? "#" : "");
  2944. return i.href[o2 - a.length] === "?" ? "?" : "";
  2945. }, "getSearch");
  2946. function Fo(i, o2 = false) {
  2947. return i == null || (i = new URL(i), /^(about|blob|data):$/.test(i.protocol)) ? "no-referrer" : (i.username = "", i.password = "", i.hash = "", o2 && (i.pathname = "", i.search = ""), i);
  2948. }
  2949. n$1(Fo, "stripURLForUseAsAReferrer");
  2950. const zo = /* @__PURE__ */ new Set(["", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"]), Ss = "strict-origin-when-cross-origin";
  2951. function ws(i) {
  2952. if (!zo.has(i)) throw new TypeError(`Invalid referrerPolicy: ${i}`);
  2953. return i;
  2954. }
  2955. n$1(ws, "validateReferrerPolicy");
  2956. function Rs(i) {
  2957. if (/^(http|ws)s:$/.test(i.protocol)) return true;
  2958. const o2 = i.host.replace(/(^\[)|(]$)/g, ""), a = isIP(o2);
  2959. return a === 4 && /^127\./.test(o2) || a === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(o2) ? true : i.host === "localhost" || i.host.endsWith(".localhost") ? false : i.protocol === "file:";
  2960. }
  2961. n$1(Rs, "isOriginPotentiallyTrustworthy");
  2962. function Ke(i) {
  2963. return /^about:(blank|srcdoc)$/.test(i) || i.protocol === "data:" || /^(blob|filesystem):$/.test(i.protocol) ? true : Rs(i);
  2964. }
  2965. n$1(Ke, "isUrlPotentiallyTrustworthy");
  2966. function Ts(i, { referrerURLCallback: o2, referrerOriginCallback: a } = {}) {
  2967. if (i.referrer === "no-referrer" || i.referrerPolicy === "") return null;
  2968. const l = i.referrerPolicy;
  2969. if (i.referrer === "about:client") return "no-referrer";
  2970. const u = i.referrer;
  2971. let m = Fo(u), h2 = Fo(u, true);
  2972. m.toString().length > 4096 && (m = h2), o2 && (m = o2(m)), a && (h2 = a(h2));
  2973. const S = new URL(i.url);
  2974. switch (l) {
  2975. case "no-referrer":
  2976. return "no-referrer";
  2977. case "origin":
  2978. return h2;
  2979. case "unsafe-url":
  2980. return m;
  2981. case "strict-origin":
  2982. return Ke(m) && !Ke(S) ? "no-referrer" : h2.toString();
  2983. case "strict-origin-when-cross-origin":
  2984. return m.origin === S.origin ? m : Ke(m) && !Ke(S) ? "no-referrer" : h2;
  2985. case "same-origin":
  2986. return m.origin === S.origin ? m : "no-referrer";
  2987. case "origin-when-cross-origin":
  2988. return m.origin === S.origin ? m : h2;
  2989. case "no-referrer-when-downgrade":
  2990. return Ke(m) && !Ke(S) ? "no-referrer" : m;
  2991. default:
  2992. throw new TypeError(`Invalid referrerPolicy: ${l}`);
  2993. }
  2994. }
  2995. n$1(Ts, "determineRequestsReferrer");
  2996. function Cs(i) {
  2997. const o2 = (i.get("referrer-policy") || "").split(/[,\s]+/);
  2998. let a = "";
  2999. for (const l of o2) l && zo.has(l) && (a = l);
  3000. return a;
  3001. }
  3002. n$1(Cs, "parseReferrerPolicyFromHeader");
  3003. const j = Symbol("Request internals"), mt = n$1((i) => typeof i == "object" && typeof i[j] == "object", "isRequest"), Ps = deprecate(() => {
  3004. }, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)");
  3005. const _Xe = class _Xe extends ht {
  3006. constructor(o2, a = {}) {
  3007. let l;
  3008. if (mt(o2) ? l = new URL(o2.url) : (l = new URL(o2), o2 = {}), l.username !== "" || l.password !== "") throw new TypeError(`${l} is an url with embedded credentials.`);
  3009. let u = a.method || o2.method || "GET";
  3010. if (/^(delete|get|head|options|post|put)$/i.test(u) && (u = u.toUpperCase()), !mt(a) && "data" in a && Ps(), (a.body != null || mt(o2) && o2.body !== null) && (u === "GET" || u === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body");
  3011. const m = a.body ? a.body : mt(o2) && o2.body !== null ? Kr(o2) : null;
  3012. super(m, { size: a.size || o2.size || 0 });
  3013. const h2 = new ae(a.headers || o2.headers || {});
  3014. if (m !== null && !h2.has("Content-Type")) {
  3015. const w = Io(m, this);
  3016. w && h2.set("Content-Type", w);
  3017. }
  3018. let S = mt(o2) ? o2.signal : null;
  3019. if ("signal" in a && (S = a.signal), S != null && !fs(S)) throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
  3020. let E = a.referrer == null ? o2.referrer : a.referrer;
  3021. if (E === "") E = "no-referrer";
  3022. else if (E) {
  3023. const w = new URL(E);
  3024. E = /^about:(\/\/)?client$/.test(w) ? "client" : w;
  3025. } else E = void 0;
  3026. this[j] = { method: u, redirect: a.redirect || o2.redirect || "follow", headers: h2, parsedURL: l, signal: S, referrer: E }, this.follow = a.follow === void 0 ? o2.follow === void 0 ? 20 : o2.follow : a.follow, this.compress = a.compress === void 0 ? o2.compress === void 0 ? true : o2.compress : a.compress, this.counter = a.counter || o2.counter || 0, this.agent = a.agent || o2.agent, this.highWaterMark = a.highWaterMark || o2.highWaterMark || 16384, this.insecureHTTPParser = a.insecureHTTPParser || o2.insecureHTTPParser || false, this.referrerPolicy = a.referrerPolicy || o2.referrerPolicy || "";
  3027. }
  3028. get method() {
  3029. return this[j].method;
  3030. }
  3031. get url() {
  3032. return format(this[j].parsedURL);
  3033. }
  3034. get headers() {
  3035. return this[j].headers;
  3036. }
  3037. get redirect() {
  3038. return this[j].redirect;
  3039. }
  3040. get signal() {
  3041. return this[j].signal;
  3042. }
  3043. get referrer() {
  3044. if (this[j].referrer === "no-referrer") return "";
  3045. if (this[j].referrer === "client") return "about:client";
  3046. if (this[j].referrer) return this[j].referrer.toString();
  3047. }
  3048. get referrerPolicy() {
  3049. return this[j].referrerPolicy;
  3050. }
  3051. set referrerPolicy(o2) {
  3052. this[j].referrerPolicy = ws(o2);
  3053. }
  3054. clone() {
  3055. return new _Xe(this);
  3056. }
  3057. get [Symbol.toStringTag]() {
  3058. return "Request";
  3059. }
  3060. };
  3061. n$1(_Xe, "Request");
  3062. let Xe = _Xe;
  3063. Object.defineProperties(Xe.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } });
  3064. const Es = n$1((i) => {
  3065. const { parsedURL: o2 } = i[j], a = new ae(i[j].headers);
  3066. a.has("Accept") || a.set("Accept", "*/*");
  3067. let l = null;
  3068. if (i.body === null && /^(post|put)$/i.test(i.method) && (l = "0"), i.body !== null) {
  3069. const S = bs(i);
  3070. typeof S == "number" && !Number.isNaN(S) && (l = String(S));
  3071. }
  3072. l && a.set("Content-Length", l), i.referrerPolicy === "" && (i.referrerPolicy = Ss), i.referrer && i.referrer !== "no-referrer" ? i[j].referrer = Ts(i) : i[j].referrer = "no-referrer", i[j].referrer instanceof URL && a.set("Referer", i.referrer), a.has("User-Agent") || a.set("User-Agent", "node-fetch"), i.compress && !a.has("Accept-Encoding") && a.set("Accept-Encoding", "gzip, deflate, br");
  3073. let { agent: u } = i;
  3074. typeof u == "function" && (u = u(o2));
  3075. const m = _s(o2), h2 = { path: o2.pathname + m, method: i.method, headers: a[Symbol.for("nodejs.util.inspect.custom")](), insecureHTTPParser: i.insecureHTTPParser, agent: u };
  3076. return { parsedURL: o2, options: h2 };
  3077. }, "getNodeRequestOptions");
  3078. const _jo = class _jo extends Kt {
  3079. constructor(o2, a = "aborted") {
  3080. super(o2, a);
  3081. }
  3082. };
  3083. n$1(_jo, "AbortError");
  3084. let jo = _jo;
  3085. /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  3086. var en, Lo;
  3087. function vs() {
  3088. if (Lo) return en;
  3089. if (Lo = 1, !globalThis.DOMException) try {
  3090. const { MessageChannel: i } = require("worker_threads"), o2 = new i().port1, a = new ArrayBuffer();
  3091. o2.postMessage(a, [a, a]);
  3092. } catch (i) {
  3093. i.constructor.name === "DOMException" && (globalThis.DOMException = i.constructor);
  3094. }
  3095. return en = globalThis.DOMException, en;
  3096. }
  3097. n$1(vs, "requireNodeDomexception");
  3098. var As = vs();
  3099. const Bs = f(As), { stat: tn } = promises;
  3100. n$1((i, o2) => Do(statSync(i), i, o2), "blobFromSync");
  3101. n$1((i, o2) => tn(i).then((a) => Do(a, i, o2)), "blobFrom");
  3102. n$1((i, o2) => tn(i).then((a) => $o(a, i, o2)), "fileFrom");
  3103. n$1((i, o2) => $o(statSync(i), i, o2), "fileFromSync");
  3104. const Do = n$1((i, o2, a = "") => new Ze([new ir({ path: o2, size: i.size, lastModified: i.mtimeMs, start: 0 })], { type: a }), "fromBlob"), $o = n$1((i, o2, a = "") => new Yr([new ir({ path: o2, size: i.size, lastModified: i.mtimeMs, start: 0 })], basename(o2), { type: a, lastModified: i.mtimeMs }), "fromFile");
  3105. const _ir = class _ir {
  3106. constructor(o2) {
  3107. __privateAdd(this, _e4);
  3108. __privateAdd(this, _t3);
  3109. __privateSet(this, _e4, o2.path), __privateSet(this, _t3, o2.start), this.size = o2.size, this.lastModified = o2.lastModified;
  3110. }
  3111. slice(o2, a) {
  3112. return new _ir({ path: __privateGet(this, _e4), lastModified: this.lastModified, size: a - o2, start: __privateGet(this, _t3) + o2 });
  3113. }
  3114. async *stream() {
  3115. const { mtimeMs: o2 } = await tn(__privateGet(this, _e4));
  3116. if (o2 > this.lastModified) throw new Bs("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
  3117. yield* createReadStream(__privateGet(this, _e4), { start: __privateGet(this, _t3), end: __privateGet(this, _t3) + this.size - 1 });
  3118. }
  3119. get [Symbol.toStringTag]() {
  3120. return "Blob";
  3121. }
  3122. };
  3123. _e4 = new WeakMap();
  3124. _t3 = new WeakMap();
  3125. n$1(_ir, "BlobDataItem");
  3126. let ir = _ir;
  3127. const Is = /* @__PURE__ */ new Set(["data:", "http:", "https:"]);
  3128. async function Mo(i, o2) {
  3129. return new Promise((a, l) => {
  3130. const u = new Xe(i, o2), { parsedURL: m, options: h2 } = Es(u);
  3131. if (!Is.has(m.protocol)) throw new TypeError(`node-fetch cannot load ${i}. URL scheme "${m.protocol.replace(/:$/, "")}" is not supported.`);
  3132. if (m.protocol === "data:") {
  3133. const g = ts(u.url), V = new H(g, { headers: { "Content-Type": g.typeFull } });
  3134. a(V);
  3135. return;
  3136. }
  3137. const S = (m.protocol === "https:" ? Qa : ft).request, { signal: E } = u;
  3138. let w = null;
  3139. const A = n$1(() => {
  3140. const g = new jo("The operation was aborted.");
  3141. l(g), u.body && u.body instanceof ie.Readable && u.body.destroy(g), !(!w || !w.body) && w.body.emit("error", g);
  3142. }, "abort");
  3143. if (E && E.aborted) {
  3144. A();
  3145. return;
  3146. }
  3147. const T2 = n$1(() => {
  3148. A(), q();
  3149. }, "abortAndFinalize"), b = S(m.toString(), h2);
  3150. E && E.addEventListener("abort", T2);
  3151. const q = n$1(() => {
  3152. b.abort(), E && E.removeEventListener("abort", T2);
  3153. }, "finalize");
  3154. b.on("error", (g) => {
  3155. l(new te(`request to ${u.url} failed, reason: ${g.message}`, "system", g)), q();
  3156. }), Fs(b, (g) => {
  3157. w && w.body && w.body.destroy(g);
  3158. }), process.version < "v14" && b.on("socket", (g) => {
  3159. let V;
  3160. g.prependListener("end", () => {
  3161. V = g._eventsCount;
  3162. }), g.prependListener("close", (I) => {
  3163. if (w && V < g._eventsCount && !I) {
  3164. const F = new Error("Premature close");
  3165. F.code = "ERR_STREAM_PREMATURE_CLOSE", w.body.emit("error", F);
  3166. }
  3167. });
  3168. }), b.on("response", (g) => {
  3169. b.setTimeout(0);
  3170. const V = ys(g.rawHeaders);
  3171. if (Xr(g.statusCode)) {
  3172. const O = V.get("Location");
  3173. let z = null;
  3174. try {
  3175. z = O === null ? null : new URL(O, u.url);
  3176. } catch {
  3177. if (u.redirect !== "manual") {
  3178. l(new te(`uri requested responds with an invalid redirect URL: ${O}`, "invalid-redirect")), q();
  3179. return;
  3180. }
  3181. }
  3182. switch (u.redirect) {
  3183. case "error":
  3184. l(new te(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`, "no-redirect")), q();
  3185. return;
  3186. case "manual":
  3187. break;
  3188. case "follow": {
  3189. if (z === null) break;
  3190. if (u.counter >= u.follow) {
  3191. l(new te(`maximum redirect reached at: ${u.url}`, "max-redirect")), q();
  3192. return;
  3193. }
  3194. const $ = { headers: new ae(u.headers), follow: u.follow, counter: u.counter + 1, agent: u.agent, compress: u.compress, method: u.method, body: Kr(u), signal: u.signal, size: u.size, referrer: u.referrer, referrerPolicy: u.referrerPolicy };
  3195. if (!cs(u.url, z) || !ds(u.url, z)) for (const pt of ["authorization", "www-authenticate", "cookie", "cookie2"]) $.headers.delete(pt);
  3196. if (g.statusCode !== 303 && u.body && o2.body instanceof ie.Readable) {
  3197. l(new te("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), q();
  3198. return;
  3199. }
  3200. (g.statusCode === 303 || (g.statusCode === 301 || g.statusCode === 302) && u.method === "POST") && ($.method = "GET", $.body = void 0, $.headers.delete("content-length"));
  3201. const M = Cs(V);
  3202. M && ($.referrerPolicy = M), a(Mo(new Xe(z, $))), q();
  3203. return;
  3204. }
  3205. default:
  3206. return l(new TypeError(`Redirect option '${u.redirect}' is not a valid value of RequestRedirect`));
  3207. }
  3208. }
  3209. E && g.once("end", () => {
  3210. E.removeEventListener("abort", T2);
  3211. });
  3212. let I = pipeline(g, new PassThrough(), (O) => {
  3213. O && l(O);
  3214. });
  3215. process.version < "v12.10" && g.on("aborted", T2);
  3216. const F = { url: u.url, status: g.statusCode, statusText: g.statusMessage, headers: V, size: u.size, counter: u.counter, highWaterMark: u.highWaterMark }, Q = V.get("Content-Encoding");
  3217. if (!u.compress || u.method === "HEAD" || Q === null || g.statusCode === 204 || g.statusCode === 304) {
  3218. w = new H(I, F), a(w);
  3219. return;
  3220. }
  3221. const se = { flush: Ye.Z_SYNC_FLUSH, finishFlush: Ye.Z_SYNC_FLUSH };
  3222. if (Q === "gzip" || Q === "x-gzip") {
  3223. I = pipeline(I, Ye.createGunzip(se), (O) => {
  3224. O && l(O);
  3225. }), w = new H(I, F), a(w);
  3226. return;
  3227. }
  3228. if (Q === "deflate" || Q === "x-deflate") {
  3229. const O = pipeline(g, new PassThrough(), (z) => {
  3230. z && l(z);
  3231. });
  3232. O.once("data", (z) => {
  3233. (z[0] & 15) === 8 ? I = pipeline(I, Ye.createInflate(), ($) => {
  3234. $ && l($);
  3235. }) : I = pipeline(I, Ye.createInflateRaw(), ($) => {
  3236. $ && l($);
  3237. }), w = new H(I, F), a(w);
  3238. }), O.once("end", () => {
  3239. w || (w = new H(I, F), a(w));
  3240. });
  3241. return;
  3242. }
  3243. if (Q === "br") {
  3244. I = pipeline(I, Ye.createBrotliDecompress(), (O) => {
  3245. O && l(O);
  3246. }), w = new H(I, F), a(w);
  3247. return;
  3248. }
  3249. w = new H(I, F), a(w);
  3250. }), ps(b, u).catch(l);
  3251. });
  3252. }
  3253. n$1(Mo, "fetch$1");
  3254. function Fs(i, o2) {
  3255. const a = Buffer$1.from(`0\r
  3256. \r
  3257. `);
  3258. let l = false, u = false, m;
  3259. i.on("response", (h2) => {
  3260. const { headers: S } = h2;
  3261. l = S["transfer-encoding"] === "chunked" && !S["content-length"];
  3262. }), i.on("socket", (h2) => {
  3263. const S = n$1(() => {
  3264. if (l && !u) {
  3265. const w = new Error("Premature close");
  3266. w.code = "ERR_STREAM_PREMATURE_CLOSE", o2(w);
  3267. }
  3268. }, "onSocketClose"), E = n$1((w) => {
  3269. u = Buffer$1.compare(w.slice(-5), a) === 0, !u && m && (u = Buffer$1.compare(m.slice(-3), a.slice(0, 3)) === 0 && Buffer$1.compare(w.slice(-2), a.slice(3)) === 0), m = w;
  3270. }, "onData");
  3271. h2.prependListener("close", S), h2.on("data", E), i.on("close", () => {
  3272. h2.removeListener("close", S), h2.removeListener("data", E);
  3273. });
  3274. });
  3275. }
  3276. n$1(Fs, "fixResponseChunkedTransferBadEnding");
  3277. const Uo = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap();
  3278. function k(i) {
  3279. const o2 = Uo.get(i);
  3280. return console.assert(o2 != null, "'this' is expected an Event object, but got", i), o2;
  3281. }
  3282. n$1(k, "pd");
  3283. function xo(i) {
  3284. if (i.passiveListener != null) {
  3285. typeof console < "u" && typeof console.error == "function" && console.error("Unable to preventDefault inside passive event listener invocation.", i.passiveListener);
  3286. return;
  3287. }
  3288. i.event.cancelable && (i.canceled = true, typeof i.event.preventDefault == "function" && i.event.preventDefault());
  3289. }
  3290. n$1(xo, "setCancelFlag");
  3291. function Je(i, o2) {
  3292. Uo.set(this, { eventTarget: i, event: o2, eventPhase: 2, currentTarget: i, canceled: false, stopped: false, immediateStopped: false, passiveListener: null, timeStamp: o2.timeStamp || Date.now() }), Object.defineProperty(this, "isTrusted", { value: false, enumerable: true });
  3293. const a = Object.keys(o2);
  3294. for (let l = 0; l < a.length; ++l) {
  3295. const u = a[l];
  3296. u in this || Object.defineProperty(this, u, No(u));
  3297. }
  3298. }
  3299. n$1(Je, "Event"), Je.prototype = { get type() {
  3300. return k(this).event.type;
  3301. }, get target() {
  3302. return k(this).eventTarget;
  3303. }, get currentTarget() {
  3304. return k(this).currentTarget;
  3305. }, composedPath() {
  3306. const i = k(this).currentTarget;
  3307. return i == null ? [] : [i];
  3308. }, get NONE() {
  3309. return 0;
  3310. }, get CAPTURING_PHASE() {
  3311. return 1;
  3312. }, get AT_TARGET() {
  3313. return 2;
  3314. }, get BUBBLING_PHASE() {
  3315. return 3;
  3316. }, get eventPhase() {
  3317. return k(this).eventPhase;
  3318. }, stopPropagation() {
  3319. const i = k(this);
  3320. i.stopped = true, typeof i.event.stopPropagation == "function" && i.event.stopPropagation();
  3321. }, stopImmediatePropagation() {
  3322. const i = k(this);
  3323. i.stopped = true, i.immediateStopped = true, typeof i.event.stopImmediatePropagation == "function" && i.event.stopImmediatePropagation();
  3324. }, get bubbles() {
  3325. return !!k(this).event.bubbles;
  3326. }, get cancelable() {
  3327. return !!k(this).event.cancelable;
  3328. }, preventDefault() {
  3329. xo(k(this));
  3330. }, get defaultPrevented() {
  3331. return k(this).canceled;
  3332. }, get composed() {
  3333. return !!k(this).event.composed;
  3334. }, get timeStamp() {
  3335. return k(this).timeStamp;
  3336. }, get srcElement() {
  3337. return k(this).eventTarget;
  3338. }, get cancelBubble() {
  3339. return k(this).stopped;
  3340. }, set cancelBubble(i) {
  3341. if (!i) return;
  3342. const o2 = k(this);
  3343. o2.stopped = true, typeof o2.event.cancelBubble == "boolean" && (o2.event.cancelBubble = true);
  3344. }, get returnValue() {
  3345. return !k(this).canceled;
  3346. }, set returnValue(i) {
  3347. i || xo(k(this));
  3348. }, initEvent() {
  3349. } }, Object.defineProperty(Je.prototype, "constructor", { value: Je, configurable: true, writable: true });
  3350. function No(i) {
  3351. return { get() {
  3352. return k(this).event[i];
  3353. }, set(o2) {
  3354. k(this).event[i] = o2;
  3355. }, configurable: true, enumerable: true };
  3356. }
  3357. n$1(No, "defineRedirectDescriptor");
  3358. function zs(i) {
  3359. return { value() {
  3360. const o2 = k(this).event;
  3361. return o2[i].apply(o2, arguments);
  3362. }, configurable: true, enumerable: true };
  3363. }
  3364. n$1(zs, "defineCallDescriptor");
  3365. function js(i, o2) {
  3366. const a = Object.keys(o2);
  3367. if (a.length === 0) return i;
  3368. function l(u, m) {
  3369. i.call(this, u, m);
  3370. }
  3371. n$1(l, "CustomEvent"), l.prototype = Object.create(i.prototype, { constructor: { value: l, configurable: true, writable: true } });
  3372. for (let u = 0; u < a.length; ++u) {
  3373. const m = a[u];
  3374. if (!(m in i.prototype)) {
  3375. const S = typeof Object.getOwnPropertyDescriptor(o2, m).value == "function";
  3376. Object.defineProperty(l.prototype, m, S ? zs(m) : No(m));
  3377. }
  3378. }
  3379. return l;
  3380. }
  3381. n$1(js, "defineWrapper");
  3382. function Ho(i) {
  3383. if (i == null || i === Object.prototype) return Je;
  3384. let o2 = rn.get(i);
  3385. return o2 == null && (o2 = js(Ho(Object.getPrototypeOf(i)), i), rn.set(i, o2)), o2;
  3386. }
  3387. n$1(Ho, "getWrapper");
  3388. function Ls(i, o2) {
  3389. const a = Ho(Object.getPrototypeOf(o2));
  3390. return new a(i, o2);
  3391. }
  3392. n$1(Ls, "wrapEvent");
  3393. function Ds(i) {
  3394. return k(i).immediateStopped;
  3395. }
  3396. n$1(Ds, "isStopped");
  3397. function $s(i, o2) {
  3398. k(i).eventPhase = o2;
  3399. }
  3400. n$1($s, "setEventPhase");
  3401. function Ms(i, o2) {
  3402. k(i).currentTarget = o2;
  3403. }
  3404. n$1(Ms, "setCurrentTarget");
  3405. function Vo(i, o2) {
  3406. k(i).passiveListener = o2;
  3407. }
  3408. n$1(Vo, "setPassiveListener");
  3409. const Qo = /* @__PURE__ */ new WeakMap(), Yo = 1, Go = 2, tr = 3;
  3410. function rr(i) {
  3411. return i !== null && typeof i == "object";
  3412. }
  3413. n$1(rr, "isObject");
  3414. function bt(i) {
  3415. const o2 = Qo.get(i);
  3416. if (o2 == null) throw new TypeError("'this' is expected an EventTarget object, but got another value.");
  3417. return o2;
  3418. }
  3419. n$1(bt, "getListeners");
  3420. function Us(i) {
  3421. return { get() {
  3422. let a = bt(this).get(i);
  3423. for (; a != null; ) {
  3424. if (a.listenerType === tr) return a.listener;
  3425. a = a.next;
  3426. }
  3427. return null;
  3428. }, set(o2) {
  3429. typeof o2 != "function" && !rr(o2) && (o2 = null);
  3430. const a = bt(this);
  3431. let l = null, u = a.get(i);
  3432. for (; u != null; ) u.listenerType === tr ? l !== null ? l.next = u.next : u.next !== null ? a.set(i, u.next) : a.delete(i) : l = u, u = u.next;
  3433. if (o2 !== null) {
  3434. const m = { listener: o2, listenerType: tr, passive: false, once: false, next: null };
  3435. l === null ? a.set(i, m) : l.next = m;
  3436. }
  3437. }, configurable: true, enumerable: true };
  3438. }
  3439. n$1(Us, "defineEventAttributeDescriptor");
  3440. function Zo(i, o2) {
  3441. Object.defineProperty(i, `on${o2}`, Us(o2));
  3442. }
  3443. n$1(Zo, "defineEventAttribute");
  3444. function Ko(i) {
  3445. function o2() {
  3446. pe.call(this);
  3447. }
  3448. n$1(o2, "CustomEventTarget"), o2.prototype = Object.create(pe.prototype, { constructor: { value: o2, configurable: true, writable: true } });
  3449. for (let a = 0; a < i.length; ++a) Zo(o2.prototype, i[a]);
  3450. return o2;
  3451. }
  3452. n$1(Ko, "defineCustomEventTarget");
  3453. function pe() {
  3454. if (this instanceof pe) {
  3455. Qo.set(this, /* @__PURE__ */ new Map());
  3456. return;
  3457. }
  3458. if (arguments.length === 1 && Array.isArray(arguments[0])) return Ko(arguments[0]);
  3459. if (arguments.length > 0) {
  3460. const i = new Array(arguments.length);
  3461. for (let o2 = 0; o2 < arguments.length; ++o2) i[o2] = arguments[o2];
  3462. return Ko(i);
  3463. }
  3464. throw new TypeError("Cannot call a class as a function");
  3465. }
  3466. n$1(pe, "EventTarget"), pe.prototype = { addEventListener(i, o2, a) {
  3467. if (o2 == null) return;
  3468. if (typeof o2 != "function" && !rr(o2)) throw new TypeError("'listener' should be a function or an object.");
  3469. const l = bt(this), u = rr(a), h2 = (u ? !!a.capture : !!a) ? Yo : Go, S = { listener: o2, listenerType: h2, passive: u && !!a.passive, once: u && !!a.once, next: null };
  3470. let E = l.get(i);
  3471. if (E === void 0) {
  3472. l.set(i, S);
  3473. return;
  3474. }
  3475. let w = null;
  3476. for (; E != null; ) {
  3477. if (E.listener === o2 && E.listenerType === h2) return;
  3478. w = E, E = E.next;
  3479. }
  3480. w.next = S;
  3481. }, removeEventListener(i, o2, a) {
  3482. if (o2 == null) return;
  3483. const l = bt(this), m = (rr(a) ? !!a.capture : !!a) ? Yo : Go;
  3484. let h2 = null, S = l.get(i);
  3485. for (; S != null; ) {
  3486. if (S.listener === o2 && S.listenerType === m) {
  3487. h2 !== null ? h2.next = S.next : S.next !== null ? l.set(i, S.next) : l.delete(i);
  3488. return;
  3489. }
  3490. h2 = S, S = S.next;
  3491. }
  3492. }, dispatchEvent(i) {
  3493. if (i == null || typeof i.type != "string") throw new TypeError('"event.type" should be a string.');
  3494. const o2 = bt(this), a = i.type;
  3495. let l = o2.get(a);
  3496. if (l == null) return true;
  3497. const u = Ls(this, i);
  3498. let m = null;
  3499. for (; l != null; ) {
  3500. if (l.once ? m !== null ? m.next = l.next : l.next !== null ? o2.set(a, l.next) : o2.delete(a) : m = l, Vo(u, l.passive ? l.listener : null), typeof l.listener == "function") try {
  3501. l.listener.call(this, u);
  3502. } catch (h2) {
  3503. typeof console < "u" && typeof console.error == "function" && console.error(h2);
  3504. }
  3505. else l.listenerType !== tr && typeof l.listener.handleEvent == "function" && l.listener.handleEvent(u);
  3506. if (Ds(u)) break;
  3507. l = l.next;
  3508. }
  3509. return Vo(u, null), $s(u, 0), Ms(u, null), !u.defaultPrevented;
  3510. } }, Object.defineProperty(pe.prototype, "constructor", { value: pe, configurable: true, writable: true });
  3511. const _nr = class _nr extends pe {
  3512. constructor() {
  3513. throw super(), new TypeError("AbortSignal cannot be constructed directly");
  3514. }
  3515. get aborted() {
  3516. const o2 = or.get(this);
  3517. if (typeof o2 != "boolean") throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
  3518. return o2;
  3519. }
  3520. };
  3521. n$1(_nr, "AbortSignal");
  3522. let nr = _nr;
  3523. Zo(nr.prototype, "abort");
  3524. function xs() {
  3525. const i = Object.create(nr.prototype);
  3526. return pe.call(i), or.set(i, false), i;
  3527. }
  3528. n$1(xs, "createAbortSignal");
  3529. function Ns(i) {
  3530. or.get(i) === false && (or.set(i, true), i.dispatchEvent({ type: "abort" }));
  3531. }
  3532. n$1(Ns, "abortSignal");
  3533. const or = /* @__PURE__ */ new WeakMap();
  3534. Object.defineProperties(nr.prototype, { aborted: { enumerable: true } }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(nr.prototype, Symbol.toStringTag, { configurable: true, value: "AbortSignal" });
  3535. let nn = (_d = class {
  3536. constructor() {
  3537. Jo.set(this, xs());
  3538. }
  3539. get signal() {
  3540. return Xo(this);
  3541. }
  3542. abort() {
  3543. Ns(Xo(this));
  3544. }
  3545. }, n$1(_d, "AbortController"), _d);
  3546. const Jo = /* @__PURE__ */ new WeakMap();
  3547. function Xo(i) {
  3548. const o2 = Jo.get(i);
  3549. if (o2 == null) throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${i === null ? "null" : typeof i}`);
  3550. return o2;
  3551. }
  3552. n$1(Xo, "getSignal"), Object.defineProperties(nn.prototype, { signal: { enumerable: true }, abort: { enumerable: true } }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(nn.prototype, Symbol.toStringTag, { configurable: true, value: "AbortController" });
  3553. var Hs = Object.defineProperty, Vs = n$1((i, o2) => Hs(i, "name", { value: o2, configurable: true }), "e");
  3554. const ei = Mo;
  3555. ti();
  3556. function ti() {
  3557. var _a2, _b2, _c2, _d2;
  3558. !((_b2 = (_a2 = globalThis.process) == null ? void 0 : _a2.versions) == null ? void 0 : _b2.node) && !((_d2 = (_c2 = globalThis.process) == null ? void 0 : _c2.env) == null ? void 0 : _d2.DISABLE_NODE_FETCH_NATIVE_WARN) && console.warn("[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.");
  3559. }
  3560. n$1(ti, "s"), Vs(ti, "checkNodeEnvironment");
  3561. const o = !!((_f = (_e5 = globalThis.process) == null ? void 0 : _e5.env) == null ? void 0 : _f.FORCE_NODE_FETCH), r = !o && globalThis.fetch || ei, n = !o && globalThis.Headers || ae, T = !o && globalThis.AbortController || nn;
  3562. class FetchError extends Error {
  3563. constructor(message, opts) {
  3564. super(message, opts);
  3565. this.name = "FetchError";
  3566. if ((opts == null ? void 0 : opts.cause) && !this.cause) {
  3567. this.cause = opts.cause;
  3568. }
  3569. }
  3570. }
  3571. function createFetchError(ctx) {
  3572. var _a2, _b2, _c2, _d2, _e6;
  3573. const errorMessage = ((_a2 = ctx.error) == null ? void 0 : _a2.message) || ((_b2 = ctx.error) == null ? void 0 : _b2.toString()) || "";
  3574. const method = ((_c2 = ctx.request) == null ? void 0 : _c2.method) || ((_d2 = ctx.options) == null ? void 0 : _d2.method) || "GET";
  3575. const url = ((_e6 = ctx.request) == null ? void 0 : _e6.url) || String(ctx.request) || "/";
  3576. const requestStr = `[${method}] ${JSON.stringify(url)}`;
  3577. const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : "<no response>";
  3578. const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : ""}`;
  3579. const fetchError = new FetchError(
  3580. message,
  3581. ctx.error ? { cause: ctx.error } : void 0
  3582. );
  3583. for (const key of ["request", "options", "response"]) {
  3584. Object.defineProperty(fetchError, key, {
  3585. get() {
  3586. return ctx[key];
  3587. }
  3588. });
  3589. }
  3590. for (const [key, refKey] of [
  3591. ["data", "_data"],
  3592. ["status", "status"],
  3593. ["statusCode", "status"],
  3594. ["statusText", "statusText"],
  3595. ["statusMessage", "statusText"]
  3596. ]) {
  3597. Object.defineProperty(fetchError, key, {
  3598. get() {
  3599. return ctx.response && ctx.response[refKey];
  3600. }
  3601. });
  3602. }
  3603. return fetchError;
  3604. }
  3605. const payloadMethods = new Set(
  3606. Object.freeze(["PATCH", "POST", "PUT", "DELETE"])
  3607. );
  3608. function isPayloadMethod(method = "GET") {
  3609. return payloadMethods.has(method.toUpperCase());
  3610. }
  3611. function isJSONSerializable(value) {
  3612. if (value === void 0) {
  3613. return false;
  3614. }
  3615. const t2 = typeof value;
  3616. if (t2 === "string" || t2 === "number" || t2 === "boolean" || t2 === null) {
  3617. return true;
  3618. }
  3619. if (t2 !== "object") {
  3620. return false;
  3621. }
  3622. if (Array.isArray(value)) {
  3623. return true;
  3624. }
  3625. if (value.buffer) {
  3626. return false;
  3627. }
  3628. return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function";
  3629. }
  3630. const textTypes = /* @__PURE__ */ new Set([
  3631. "image/svg",
  3632. "application/xml",
  3633. "application/xhtml",
  3634. "application/html"
  3635. ]);
  3636. const JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
  3637. function detectResponseType(_contentType = "") {
  3638. if (!_contentType) {
  3639. return "json";
  3640. }
  3641. const contentType = _contentType.split(";").shift() || "";
  3642. if (JSON_RE.test(contentType)) {
  3643. return "json";
  3644. }
  3645. if (textTypes.has(contentType) || contentType.startsWith("text/")) {
  3646. return "text";
  3647. }
  3648. return "blob";
  3649. }
  3650. function resolveFetchOptions(request, input, defaults, Headers2) {
  3651. const headers = mergeHeaders(
  3652. (input == null ? void 0 : input.headers) ?? (request == null ? void 0 : request.headers),
  3653. defaults == null ? void 0 : defaults.headers,
  3654. Headers2
  3655. );
  3656. let query;
  3657. if ((defaults == null ? void 0 : defaults.query) || (defaults == null ? void 0 : defaults.params) || (input == null ? void 0 : input.params) || (input == null ? void 0 : input.query)) {
  3658. query = {
  3659. ...defaults == null ? void 0 : defaults.params,
  3660. ...defaults == null ? void 0 : defaults.query,
  3661. ...input == null ? void 0 : input.params,
  3662. ...input == null ? void 0 : input.query
  3663. };
  3664. }
  3665. return {
  3666. ...defaults,
  3667. ...input,
  3668. query,
  3669. params: query,
  3670. headers
  3671. };
  3672. }
  3673. function mergeHeaders(input, defaults, Headers2) {
  3674. if (!defaults) {
  3675. return new Headers2(input);
  3676. }
  3677. const headers = new Headers2(defaults);
  3678. if (input) {
  3679. for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers2(input)) {
  3680. headers.set(key, value);
  3681. }
  3682. }
  3683. return headers;
  3684. }
  3685. async function callHooks(context, hooks) {
  3686. if (hooks) {
  3687. if (Array.isArray(hooks)) {
  3688. for (const hook of hooks) {
  3689. await hook(context);
  3690. }
  3691. } else {
  3692. await hooks(context);
  3693. }
  3694. }
  3695. }
  3696. const retryStatusCodes = /* @__PURE__ */ new Set([
  3697. 408,
  3698. // Request Timeout
  3699. 409,
  3700. // Conflict
  3701. 425,
  3702. // Too Early (Experimental)
  3703. 429,
  3704. // Too Many Requests
  3705. 500,
  3706. // Internal Server Error
  3707. 502,
  3708. // Bad Gateway
  3709. 503,
  3710. // Service Unavailable
  3711. 504
  3712. // Gateway Timeout
  3713. ]);
  3714. const nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);
  3715. function createFetch(globalOptions = {}) {
  3716. const {
  3717. fetch: fetch2 = globalThis.fetch,
  3718. Headers: Headers2 = globalThis.Headers,
  3719. AbortController: AbortController2 = globalThis.AbortController
  3720. } = globalOptions;
  3721. async function onError(context) {
  3722. const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
  3723. if (context.options.retry !== false && !isAbort) {
  3724. let retries;
  3725. if (typeof context.options.retry === "number") {
  3726. retries = context.options.retry;
  3727. } else {
  3728. retries = isPayloadMethod(context.options.method) ? 0 : 1;
  3729. }
  3730. const responseCode = context.response && context.response.status || 500;
  3731. if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {
  3732. const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0;
  3733. if (retryDelay > 0) {
  3734. await new Promise((resolve) => setTimeout(resolve, retryDelay));
  3735. }
  3736. return $fetchRaw(context.request, {
  3737. ...context.options,
  3738. retry: retries - 1
  3739. });
  3740. }
  3741. }
  3742. const error = createFetchError(context);
  3743. if (Error.captureStackTrace) {
  3744. Error.captureStackTrace(error, $fetchRaw);
  3745. }
  3746. throw error;
  3747. }
  3748. const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
  3749. const context = {
  3750. request: _request,
  3751. options: resolveFetchOptions(
  3752. _request,
  3753. _options,
  3754. globalOptions.defaults,
  3755. Headers2
  3756. ),
  3757. response: void 0,
  3758. error: void 0
  3759. };
  3760. if (context.options.method) {
  3761. context.options.method = context.options.method.toUpperCase();
  3762. }
  3763. if (context.options.onRequest) {
  3764. await callHooks(context, context.options.onRequest);
  3765. }
  3766. if (typeof context.request === "string") {
  3767. if (context.options.baseURL) {
  3768. context.request = withBase(context.request, context.options.baseURL);
  3769. }
  3770. if (context.options.query) {
  3771. context.request = withQuery(context.request, context.options.query);
  3772. delete context.options.query;
  3773. }
  3774. if ("query" in context.options) {
  3775. delete context.options.query;
  3776. }
  3777. if ("params" in context.options) {
  3778. delete context.options.params;
  3779. }
  3780. }
  3781. if (context.options.body && isPayloadMethod(context.options.method)) {
  3782. if (isJSONSerializable(context.options.body)) {
  3783. context.options.body = typeof context.options.body === "string" ? context.options.body : JSON.stringify(context.options.body);
  3784. context.options.headers = new Headers2(context.options.headers || {});
  3785. if (!context.options.headers.has("content-type")) {
  3786. context.options.headers.set("content-type", "application/json");
  3787. }
  3788. if (!context.options.headers.has("accept")) {
  3789. context.options.headers.set("accept", "application/json");
  3790. }
  3791. } else if (
  3792. // ReadableStream Body
  3793. "pipeTo" in context.options.body && typeof context.options.body.pipeTo === "function" || // Node.js Stream Body
  3794. typeof context.options.body.pipe === "function"
  3795. ) {
  3796. if (!("duplex" in context.options)) {
  3797. context.options.duplex = "half";
  3798. }
  3799. }
  3800. }
  3801. let abortTimeout;
  3802. if (!context.options.signal && context.options.timeout) {
  3803. const controller = new AbortController2();
  3804. abortTimeout = setTimeout(() => {
  3805. const error = new Error(
  3806. "[TimeoutError]: The operation was aborted due to timeout"
  3807. );
  3808. error.name = "TimeoutError";
  3809. error.code = 23;
  3810. controller.abort(error);
  3811. }, context.options.timeout);
  3812. context.options.signal = controller.signal;
  3813. }
  3814. try {
  3815. context.response = await fetch2(
  3816. context.request,
  3817. context.options
  3818. );
  3819. } catch (error) {
  3820. context.error = error;
  3821. if (context.options.onRequestError) {
  3822. await callHooks(
  3823. context,
  3824. context.options.onRequestError
  3825. );
  3826. }
  3827. return await onError(context);
  3828. } finally {
  3829. if (abortTimeout) {
  3830. clearTimeout(abortTimeout);
  3831. }
  3832. }
  3833. const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324
  3834. // https://github.com/unjs/ofetch/issues/294
  3835. // https://github.com/JakeChampion/fetch/issues/1454
  3836. context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD";
  3837. if (hasBody) {
  3838. const responseType = (context.options.parseResponse ? "json" : context.options.responseType) || detectResponseType(context.response.headers.get("content-type") || "");
  3839. switch (responseType) {
  3840. case "json": {
  3841. const data = await context.response.text();
  3842. const parseFunction = context.options.parseResponse || destr;
  3843. context.response._data = parseFunction(data);
  3844. break;
  3845. }
  3846. case "stream": {
  3847. context.response._data = context.response.body || context.response._bodyInit;
  3848. break;
  3849. }
  3850. default: {
  3851. context.response._data = await context.response[responseType]();
  3852. }
  3853. }
  3854. }
  3855. if (context.options.onResponse) {
  3856. await callHooks(
  3857. context,
  3858. context.options.onResponse
  3859. );
  3860. }
  3861. if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {
  3862. if (context.options.onResponseError) {
  3863. await callHooks(
  3864. context,
  3865. context.options.onResponseError
  3866. );
  3867. }
  3868. return await onError(context);
  3869. }
  3870. return context.response;
  3871. };
  3872. const $fetch2 = async function $fetch22(request, options) {
  3873. const r2 = await $fetchRaw(request, options);
  3874. return r2._data;
  3875. };
  3876. $fetch2.raw = $fetchRaw;
  3877. $fetch2.native = (...args) => fetch2(...args);
  3878. $fetch2.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
  3879. ...globalOptions,
  3880. ...customGlobalOptions,
  3881. defaults: {
  3882. ...globalOptions.defaults,
  3883. ...customGlobalOptions.defaults,
  3884. ...defaultOptions
  3885. }
  3886. });
  3887. return $fetch2;
  3888. }
  3889. function createNodeFetch() {
  3890. const useKeepAlive = JSON.parse(process.env.FETCH_KEEP_ALIVE || "false");
  3891. if (!useKeepAlive) {
  3892. return r;
  3893. }
  3894. const agentOptions = { keepAlive: true };
  3895. const httpAgent = new ft.Agent(agentOptions);
  3896. const httpsAgent = new Qa.Agent(agentOptions);
  3897. const nodeFetchOptions = {
  3898. agent(parsedURL) {
  3899. return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
  3900. }
  3901. };
  3902. return function nodeFetchWithKeepAlive(input, init) {
  3903. return r(input, { ...nodeFetchOptions, ...init });
  3904. };
  3905. }
  3906. const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
  3907. const Headers = globalThis.Headers || n;
  3908. const AbortController$1 = globalThis.AbortController || T;
  3909. const ofetch = createFetch({ fetch, Headers, AbortController: AbortController$1 });
  3910. const $fetch = ofetch;
  3911. if (!globalThis.$fetch) {
  3912. globalThis.$fetch = $fetch.create({
  3913. baseURL: baseURL()
  3914. });
  3915. }
  3916. if (!("global" in globalThis)) {
  3917. globalThis.global = globalThis;
  3918. }
  3919. const nuxtLinkDefaults = { "componentName": "NuxtLink" };
  3920. const appId = "nuxt-app";
  3921. function getNuxtAppCtx(id = appId) {
  3922. return getContext(id, {
  3923. asyncContext: false
  3924. });
  3925. }
  3926. const NuxtPluginIndicator = "__nuxt_plugin";
  3927. function createNuxtApp(options) {
  3928. var _a2;
  3929. let hydratingCount = 0;
  3930. const nuxtApp = {
  3931. _id: options.id || appId || "nuxt-app",
  3932. _scope: effectScope(),
  3933. provide: void 0,
  3934. globalName: "nuxt",
  3935. versions: {
  3936. get nuxt() {
  3937. return "3.17.4";
  3938. },
  3939. get vue() {
  3940. return nuxtApp.vueApp.version;
  3941. }
  3942. },
  3943. payload: shallowReactive({
  3944. ...((_a2 = options.ssrContext) == null ? void 0 : _a2.payload) || {},
  3945. data: shallowReactive({}),
  3946. state: reactive({}),
  3947. once: /* @__PURE__ */ new Set(),
  3948. _errors: shallowReactive({})
  3949. }),
  3950. static: {
  3951. data: {}
  3952. },
  3953. runWithContext(fn) {
  3954. if (nuxtApp._scope.active && !getCurrentScope()) {
  3955. return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
  3956. }
  3957. return callWithNuxt(nuxtApp, fn);
  3958. },
  3959. isHydrating: false,
  3960. deferHydration() {
  3961. if (!nuxtApp.isHydrating) {
  3962. return () => {
  3963. };
  3964. }
  3965. hydratingCount++;
  3966. let called = false;
  3967. return () => {
  3968. if (called) {
  3969. return;
  3970. }
  3971. called = true;
  3972. hydratingCount--;
  3973. if (hydratingCount === 0) {
  3974. nuxtApp.isHydrating = false;
  3975. return nuxtApp.callHook("app:suspense:resolve");
  3976. }
  3977. };
  3978. },
  3979. _asyncDataPromises: {},
  3980. _asyncData: shallowReactive({}),
  3981. _payloadRevivers: {},
  3982. ...options
  3983. };
  3984. {
  3985. nuxtApp.payload.serverRendered = true;
  3986. }
  3987. if (nuxtApp.ssrContext) {
  3988. nuxtApp.payload.path = nuxtApp.ssrContext.url;
  3989. nuxtApp.ssrContext.nuxt = nuxtApp;
  3990. nuxtApp.ssrContext.payload = nuxtApp.payload;
  3991. nuxtApp.ssrContext.config = {
  3992. public: nuxtApp.ssrContext.runtimeConfig.public,
  3993. app: nuxtApp.ssrContext.runtimeConfig.app
  3994. };
  3995. }
  3996. nuxtApp.hooks = createHooks();
  3997. nuxtApp.hook = nuxtApp.hooks.hook;
  3998. {
  3999. const contextCaller = async function(hooks, args) {
  4000. for (const hook of hooks) {
  4001. await nuxtApp.runWithContext(() => hook(...args));
  4002. }
  4003. };
  4004. nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
  4005. }
  4006. nuxtApp.callHook = nuxtApp.hooks.callHook;
  4007. nuxtApp.provide = (name, value) => {
  4008. const $name = "$" + name;
  4009. defineGetter(nuxtApp, $name, value);
  4010. defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
  4011. };
  4012. defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
  4013. defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
  4014. const runtimeConfig = options.ssrContext.runtimeConfig;
  4015. nuxtApp.provide("config", runtimeConfig);
  4016. return nuxtApp;
  4017. }
  4018. function registerPluginHooks(nuxtApp, plugin2) {
  4019. if (plugin2.hooks) {
  4020. nuxtApp.hooks.addHooks(plugin2.hooks);
  4021. }
  4022. }
  4023. async function applyPlugin(nuxtApp, plugin2) {
  4024. if (typeof plugin2 === "function") {
  4025. const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
  4026. if (provide2 && typeof provide2 === "object") {
  4027. for (const key in provide2) {
  4028. nuxtApp.provide(key, provide2[key]);
  4029. }
  4030. }
  4031. }
  4032. }
  4033. async function applyPlugins(nuxtApp, plugins2) {
  4034. var _a2, _b2, _c2, _d2;
  4035. const resolvedPlugins = /* @__PURE__ */ new Set();
  4036. const unresolvedPlugins = [];
  4037. const parallels = [];
  4038. const errors = [];
  4039. let promiseDepth = 0;
  4040. async function executePlugin(plugin2) {
  4041. var _a3;
  4042. const unresolvedPluginsForThisPlugin = ((_a3 = plugin2.dependsOn) == null ? void 0 : _a3.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.has(name))) ?? [];
  4043. if (unresolvedPluginsForThisPlugin.length > 0) {
  4044. unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
  4045. } else {
  4046. const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
  4047. if (plugin2._name) {
  4048. resolvedPlugins.add(plugin2._name);
  4049. await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
  4050. if (dependsOn.has(plugin2._name)) {
  4051. dependsOn.delete(plugin2._name);
  4052. if (dependsOn.size === 0) {
  4053. promiseDepth++;
  4054. await executePlugin(unexecutedPlugin);
  4055. }
  4056. }
  4057. }));
  4058. }
  4059. });
  4060. if (plugin2.parallel) {
  4061. parallels.push(promise.catch((e) => errors.push(e)));
  4062. } else {
  4063. await promise;
  4064. }
  4065. }
  4066. }
  4067. for (const plugin2 of plugins2) {
  4068. if (((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext) && ((_b2 = plugin2.env) == null ? void 0 : _b2.islands) === false) {
  4069. continue;
  4070. }
  4071. registerPluginHooks(nuxtApp, plugin2);
  4072. }
  4073. for (const plugin2 of plugins2) {
  4074. if (((_c2 = nuxtApp.ssrContext) == null ? void 0 : _c2.islandContext) && ((_d2 = plugin2.env) == null ? void 0 : _d2.islands) === false) {
  4075. continue;
  4076. }
  4077. await executePlugin(plugin2);
  4078. }
  4079. await Promise.all(parallels);
  4080. if (promiseDepth) {
  4081. for (let i = 0; i < promiseDepth; i++) {
  4082. await Promise.all(parallels);
  4083. }
  4084. }
  4085. if (errors.length) {
  4086. throw errors[0];
  4087. }
  4088. }
  4089. // @__NO_SIDE_EFFECTS__
  4090. function defineNuxtPlugin(plugin2) {
  4091. if (typeof plugin2 === "function") {
  4092. return plugin2;
  4093. }
  4094. const _name = plugin2._name || plugin2.name;
  4095. delete plugin2.name;
  4096. return Object.assign(plugin2.setup || (() => {
  4097. }), plugin2, { [NuxtPluginIndicator]: true, _name });
  4098. }
  4099. function callWithNuxt(nuxt, setup, args) {
  4100. const fn = () => setup();
  4101. const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
  4102. {
  4103. return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
  4104. }
  4105. }
  4106. function tryUseNuxtApp(id) {
  4107. var _a2;
  4108. let nuxtAppInstance;
  4109. if (hasInjectionContext()) {
  4110. nuxtAppInstance = (_a2 = getCurrentInstance()) == null ? void 0 : _a2.appContext.app.$nuxt;
  4111. }
  4112. nuxtAppInstance || (nuxtAppInstance = getNuxtAppCtx(id).tryUse());
  4113. return nuxtAppInstance || null;
  4114. }
  4115. function useNuxtApp(id) {
  4116. const nuxtAppInstance = tryUseNuxtApp(id);
  4117. if (!nuxtAppInstance) {
  4118. {
  4119. throw new Error("[nuxt] instance unavailable");
  4120. }
  4121. }
  4122. return nuxtAppInstance;
  4123. }
  4124. // @__NO_SIDE_EFFECTS__
  4125. function useRuntimeConfig(_event) {
  4126. return useNuxtApp().$config;
  4127. }
  4128. function defineGetter(obj, key, val) {
  4129. Object.defineProperty(obj, key, { get: () => val });
  4130. }
  4131. const LayoutMetaSymbol = Symbol("layout-meta");
  4132. const PageRouteSymbol = Symbol("route");
  4133. const useRouter = () => {
  4134. var _a2;
  4135. return (_a2 = useNuxtApp()) == null ? void 0 : _a2.$router;
  4136. };
  4137. const useRoute = () => {
  4138. if (hasInjectionContext()) {
  4139. return inject(PageRouteSymbol, useNuxtApp()._route);
  4140. }
  4141. return useNuxtApp()._route;
  4142. };
  4143. // @__NO_SIDE_EFFECTS__
  4144. function defineNuxtRouteMiddleware(middleware) {
  4145. return middleware;
  4146. }
  4147. const isProcessingMiddleware = () => {
  4148. try {
  4149. if (useNuxtApp()._processingMiddleware) {
  4150. return true;
  4151. }
  4152. } catch {
  4153. return false;
  4154. }
  4155. return false;
  4156. };
  4157. const URL_QUOTE_RE = /"/g;
  4158. const navigateTo = (to, options) => {
  4159. to || (to = "/");
  4160. const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
  4161. const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
  4162. const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
  4163. if (isExternal) {
  4164. if (!(options == null ? void 0 : options.external)) {
  4165. throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
  4166. }
  4167. const { protocol } = new URL(toPath, "http://localhost");
  4168. if (protocol && isScriptProtocol(protocol)) {
  4169. throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
  4170. }
  4171. }
  4172. const inMiddleware = isProcessingMiddleware();
  4173. const router = useRouter();
  4174. const nuxtApp = useNuxtApp();
  4175. {
  4176. if (nuxtApp.ssrContext) {
  4177. const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
  4178. const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
  4179. const redirect = async function(response) {
  4180. await nuxtApp.callHook("app:redirected");
  4181. const encodedLoc = location2.replace(URL_QUOTE_RE, "%22");
  4182. const encodedHeader = encodeURL(location2, isExternalHost);
  4183. nuxtApp.ssrContext._renderResponse = {
  4184. statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
  4185. body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
  4186. headers: { location: encodedHeader }
  4187. };
  4188. return response;
  4189. };
  4190. if (!isExternal && inMiddleware) {
  4191. router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
  4192. return to;
  4193. }
  4194. return redirect(!inMiddleware ? void 0 : (
  4195. /* abort route navigation */
  4196. false
  4197. ));
  4198. }
  4199. }
  4200. if (isExternal) {
  4201. nuxtApp._scope.stop();
  4202. if (options == null ? void 0 : options.replace) {
  4203. (void 0).replace(toPath);
  4204. } else {
  4205. (void 0).href = toPath;
  4206. }
  4207. if (inMiddleware) {
  4208. if (!nuxtApp.isHydrating) {
  4209. return false;
  4210. }
  4211. return new Promise(() => {
  4212. });
  4213. }
  4214. return Promise.resolve();
  4215. }
  4216. return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
  4217. };
  4218. function resolveRouteObject(to) {
  4219. return withQuery(to.path || "", to.query || {}) + (to.hash || "");
  4220. }
  4221. function encodeURL(location2, isExternalHost = false) {
  4222. const url = new URL(location2, "http://localhost");
  4223. if (!isExternalHost) {
  4224. return url.pathname + url.search + url.hash;
  4225. }
  4226. if (location2.startsWith("//")) {
  4227. return url.toString().replace(url.protocol, "");
  4228. }
  4229. return url.toString();
  4230. }
  4231. const NUXT_ERROR_SIGNATURE = "__nuxt_error";
  4232. const useError = () => toRef(useNuxtApp().payload, "error");
  4233. const showError = (error) => {
  4234. const nuxtError = createError(error);
  4235. try {
  4236. const nuxtApp = useNuxtApp();
  4237. const error2 = useError();
  4238. if (false) ;
  4239. error2.value || (error2.value = nuxtError);
  4240. } catch {
  4241. throw nuxtError;
  4242. }
  4243. return nuxtError;
  4244. };
  4245. const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
  4246. const createError = (error) => {
  4247. const nuxtError = createError$1(error);
  4248. Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
  4249. value: true,
  4250. configurable: false,
  4251. writable: false
  4252. });
  4253. return nuxtError;
  4254. };
  4255. const unhead_v5ac8_aYQVlP6KGZHvlpq6x2XWXwze6_1FIL8VEzXsY = /* @__PURE__ */ defineNuxtPlugin({
  4256. name: "nuxt:head",
  4257. enforce: "pre",
  4258. setup(nuxtApp) {
  4259. const head = nuxtApp.ssrContext.head;
  4260. nuxtApp.vueApp.use(head);
  4261. }
  4262. });
  4263. function toArray$1(value) {
  4264. return Array.isArray(value) ? value : [value];
  4265. }
  4266. async function getRouteRules(arg) {
  4267. const path = typeof arg === "string" ? arg : arg.path;
  4268. {
  4269. useNuxtApp().ssrContext._preloadManifest = true;
  4270. const _routeRulesMatcher = toRouteMatcher(
  4271. createRouter$1({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
  4272. );
  4273. return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
  4274. }
  4275. }
  4276. const _routes = [
  4277. {
  4278. name: "index",
  4279. path: "/",
  4280. component: () => import('./index-C7bUMxuK.mjs')
  4281. }
  4282. ];
  4283. const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
  4284. const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
  4285. const ROUTE_KEY_NORMAL_RE = /:\w+/g;
  4286. function generateRouteKey(route) {
  4287. const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r2) => {
  4288. var _a2;
  4289. return ((_a2 = route.params[r2.slice(1)]) == null ? void 0 : _a2.toString()) || "";
  4290. });
  4291. return typeof source === "function" ? source(route) : source;
  4292. }
  4293. function isChangingPage(to, from) {
  4294. if (to === from || from === START_LOCATION) {
  4295. return false;
  4296. }
  4297. if (generateRouteKey(to) !== generateRouteKey(from)) {
  4298. return true;
  4299. }
  4300. const areComponentsSame = to.matched.every(
  4301. (comp, index) => {
  4302. var _a2, _b2;
  4303. return comp.components && comp.components.default === ((_b2 = (_a2 = from.matched[index]) == null ? void 0 : _a2.components) == null ? void 0 : _b2.default);
  4304. }
  4305. );
  4306. if (areComponentsSame) {
  4307. return false;
  4308. }
  4309. return true;
  4310. }
  4311. const routerOptions0 = {
  4312. scrollBehavior(to, from, savedPosition) {
  4313. var _a2;
  4314. const nuxtApp = useNuxtApp();
  4315. const behavior = ((_a2 = useRouter().options) == null ? void 0 : _a2.scrollBehaviorType) ?? "auto";
  4316. if (to.path === from.path) {
  4317. if (from.hash && !to.hash) {
  4318. return { left: 0, top: 0 };
  4319. }
  4320. if (to.hash) {
  4321. return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  4322. }
  4323. return false;
  4324. }
  4325. const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
  4326. if (routeAllowsScrollToTop === false) {
  4327. return false;
  4328. }
  4329. let position = savedPosition || void 0;
  4330. if (!position && isChangingPage(to, from)) {
  4331. position = { left: 0, top: 0 };
  4332. }
  4333. const hookToWait = nuxtApp._runningTransition ? "page:transition:finish" : "page:loading:end";
  4334. return new Promise((resolve) => {
  4335. if (from === START_LOCATION) {
  4336. resolve(_calculatePosition(to, "instant", position));
  4337. return;
  4338. }
  4339. nuxtApp.hooks.hookOnce(hookToWait, () => {
  4340. requestAnimationFrame(() => resolve(_calculatePosition(to, "instant", position)));
  4341. });
  4342. });
  4343. }
  4344. };
  4345. function _getHashElementScrollMarginTop(selector) {
  4346. try {
  4347. const elem = (void 0).querySelector(selector);
  4348. if (elem) {
  4349. return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
  4350. }
  4351. } catch {
  4352. }
  4353. return 0;
  4354. }
  4355. function _calculatePosition(to, scrollBehaviorType, position) {
  4356. if (position) {
  4357. return position;
  4358. }
  4359. if (to.hash) {
  4360. return {
  4361. el: to.hash,
  4362. top: _getHashElementScrollMarginTop(to.hash),
  4363. behavior: scrollBehaviorType
  4364. };
  4365. }
  4366. return { left: 0, top: 0, behavior: scrollBehaviorType };
  4367. }
  4368. const configRouterOptions = {
  4369. hashMode: false,
  4370. scrollBehaviorType: "auto"
  4371. };
  4372. const routerOptions = {
  4373. ...configRouterOptions,
  4374. ...routerOptions0
  4375. };
  4376. const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => {
  4377. var _a2;
  4378. let __temp, __restore;
  4379. if (!((_a2 = to.meta) == null ? void 0 : _a2.validate)) {
  4380. return;
  4381. }
  4382. const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
  4383. if (result === true) {
  4384. return;
  4385. }
  4386. const error = createError({
  4387. fatal: false,
  4388. statusCode: result && result.statusCode || 404,
  4389. statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
  4390. data: {
  4391. path: to.fullPath
  4392. }
  4393. });
  4394. return error;
  4395. });
  4396. const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  4397. {
  4398. return;
  4399. }
  4400. });
  4401. const globalMiddleware = [
  4402. validate,
  4403. manifest_45route_45rule
  4404. ];
  4405. const namedMiddleware = {};
  4406. const plugin = /* @__PURE__ */ defineNuxtPlugin({
  4407. name: "nuxt:router",
  4408. enforce: "pre",
  4409. async setup(nuxtApp) {
  4410. var _a2, _b2, _c2;
  4411. let __temp, __restore;
  4412. let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
  4413. const history = ((_a2 = routerOptions.history) == null ? void 0 : _a2.call(routerOptions, routerBase)) ?? createMemoryHistory(routerBase);
  4414. const routes2 = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
  4415. let startPosition;
  4416. const router = createRouter({
  4417. ...routerOptions,
  4418. scrollBehavior: (to, from, savedPosition) => {
  4419. if (from === START_LOCATION) {
  4420. startPosition = savedPosition;
  4421. return;
  4422. }
  4423. if (routerOptions.scrollBehavior) {
  4424. router.options.scrollBehavior = routerOptions.scrollBehavior;
  4425. if ("scrollRestoration" in (void 0).history) {
  4426. const unsub = router.beforeEach(() => {
  4427. unsub();
  4428. (void 0).history.scrollRestoration = "manual";
  4429. });
  4430. }
  4431. return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
  4432. }
  4433. },
  4434. history,
  4435. routes: routes2
  4436. });
  4437. nuxtApp.vueApp.use(router);
  4438. const previousRoute = shallowRef(router.currentRoute.value);
  4439. router.afterEach((_to, from) => {
  4440. previousRoute.value = from;
  4441. });
  4442. Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
  4443. get: () => previousRoute.value
  4444. });
  4445. const initialURL = nuxtApp.ssrContext.url;
  4446. const _route = shallowRef(router.currentRoute.value);
  4447. const syncCurrentRoute = () => {
  4448. _route.value = router.currentRoute.value;
  4449. };
  4450. nuxtApp.hook("page:finish", syncCurrentRoute);
  4451. router.afterEach((to, from) => {
  4452. var _a3, _b3, _c3, _d2;
  4453. if (((_b3 = (_a3 = to.matched[0]) == null ? void 0 : _a3.components) == null ? void 0 : _b3.default) === ((_d2 = (_c3 = from.matched[0]) == null ? void 0 : _c3.components) == null ? void 0 : _d2.default)) {
  4454. syncCurrentRoute();
  4455. }
  4456. });
  4457. const route = {};
  4458. for (const key in _route.value) {
  4459. Object.defineProperty(route, key, {
  4460. get: () => _route.value[key],
  4461. enumerable: true
  4462. });
  4463. }
  4464. nuxtApp._route = shallowReactive(route);
  4465. nuxtApp._middleware || (nuxtApp._middleware = {
  4466. global: [],
  4467. named: {}
  4468. });
  4469. useError();
  4470. if (!((_b2 = nuxtApp.ssrContext) == null ? void 0 : _b2.islandContext)) {
  4471. router.afterEach(async (to, _from, failure) => {
  4472. delete nuxtApp._processingMiddleware;
  4473. if (failure) {
  4474. await nuxtApp.callHook("page:loading:end");
  4475. }
  4476. if ((failure == null ? void 0 : failure.type) === 4) {
  4477. return;
  4478. }
  4479. if (to.redirectedFrom && to.fullPath !== initialURL) {
  4480. await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
  4481. }
  4482. });
  4483. }
  4484. try {
  4485. if (true) {
  4486. ;
  4487. [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
  4488. ;
  4489. }
  4490. ;
  4491. [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
  4492. ;
  4493. } catch (error2) {
  4494. [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
  4495. }
  4496. const resolvedInitialRoute = router.currentRoute.value;
  4497. syncCurrentRoute();
  4498. if ((_c2 = nuxtApp.ssrContext) == null ? void 0 : _c2.islandContext) {
  4499. return { provide: { router } };
  4500. }
  4501. const initialLayout = nuxtApp.payload.state._layout;
  4502. router.beforeEach(async (to, from) => {
  4503. var _a3, _b3;
  4504. await nuxtApp.callHook("page:loading:start");
  4505. to.meta = reactive(to.meta);
  4506. if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
  4507. to.meta.layout = initialLayout;
  4508. }
  4509. nuxtApp._processingMiddleware = true;
  4510. if (!((_a3 = nuxtApp.ssrContext) == null ? void 0 : _a3.islandContext)) {
  4511. const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
  4512. for (const component of to.matched) {
  4513. const componentMiddleware = component.meta.middleware;
  4514. if (!componentMiddleware) {
  4515. continue;
  4516. }
  4517. for (const entry2 of toArray$1(componentMiddleware)) {
  4518. middlewareEntries.add(entry2);
  4519. }
  4520. }
  4521. {
  4522. const routeRules = await nuxtApp.runWithContext(() => getRouteRules({ path: to.path }));
  4523. if (routeRules.appMiddleware) {
  4524. for (const key in routeRules.appMiddleware) {
  4525. if (routeRules.appMiddleware[key]) {
  4526. middlewareEntries.add(key);
  4527. } else {
  4528. middlewareEntries.delete(key);
  4529. }
  4530. }
  4531. }
  4532. }
  4533. for (const entry2 of middlewareEntries) {
  4534. const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await ((_b3 = namedMiddleware[entry2]) == null ? void 0 : _b3.call(namedMiddleware).then((r2) => r2.default || r2)) : entry2;
  4535. if (!middleware) {
  4536. throw new Error(`Unknown route middleware: '${entry2}'.`);
  4537. }
  4538. try {
  4539. const result = await nuxtApp.runWithContext(() => middleware(to, from));
  4540. if (true) {
  4541. if (result === false || result instanceof Error) {
  4542. const error2 = result || createError({
  4543. statusCode: 404,
  4544. statusMessage: `Page Not Found: ${initialURL}`
  4545. });
  4546. await nuxtApp.runWithContext(() => showError(error2));
  4547. return false;
  4548. }
  4549. }
  4550. if (result === true) {
  4551. continue;
  4552. }
  4553. if (result === false) {
  4554. return result;
  4555. }
  4556. if (result) {
  4557. if (isNuxtError(result) && result.fatal) {
  4558. await nuxtApp.runWithContext(() => showError(result));
  4559. }
  4560. return result;
  4561. }
  4562. } catch (err) {
  4563. const error2 = createError(err);
  4564. if (error2.fatal) {
  4565. await nuxtApp.runWithContext(() => showError(error2));
  4566. }
  4567. return error2;
  4568. }
  4569. }
  4570. }
  4571. });
  4572. router.onError(async () => {
  4573. delete nuxtApp._processingMiddleware;
  4574. await nuxtApp.callHook("page:loading:end");
  4575. });
  4576. router.afterEach(async (to, _from) => {
  4577. if (to.matched.length === 0) {
  4578. await nuxtApp.runWithContext(() => showError(createError({
  4579. statusCode: 404,
  4580. fatal: false,
  4581. statusMessage: `Page not found: ${to.fullPath}`,
  4582. data: {
  4583. path: to.fullPath
  4584. }
  4585. })));
  4586. }
  4587. });
  4588. nuxtApp.hooks.hookOnce("app:created", async () => {
  4589. try {
  4590. if ("name" in resolvedInitialRoute) {
  4591. resolvedInitialRoute.name = void 0;
  4592. }
  4593. await router.replace({
  4594. ...resolvedInitialRoute,
  4595. force: true
  4596. });
  4597. router.options.scrollBehavior = routerOptions.scrollBehavior;
  4598. } catch (error2) {
  4599. await nuxtApp.runWithContext(() => showError(error2));
  4600. }
  4601. });
  4602. return { provide: { router } };
  4603. }
  4604. });
  4605. function definePayloadReducer(name, reduce) {
  4606. {
  4607. useNuxtApp().ssrContext._payloadReducers[name] = reduce;
  4608. }
  4609. }
  4610. const reducers = [
  4611. ["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
  4612. ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  4613. ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  4614. ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
  4615. ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
  4616. ["Ref", (data) => isRef(data) && data.value],
  4617. ["Reactive", (data) => isReactive(data) && toRaw(data)]
  4618. ];
  4619. const revive_payload_server_cOgQ3s4LyKn2YZ80ucX0OsNM3PTOSwPOL2UA48dmxm0 = /* @__PURE__ */ defineNuxtPlugin({
  4620. name: "nuxt:revive-payload:server",
  4621. setup() {
  4622. for (const [reducer, fn] of reducers) {
  4623. definePayloadReducer(reducer, fn);
  4624. }
  4625. }
  4626. });
  4627. const components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4 = /* @__PURE__ */ defineNuxtPlugin({
  4628. name: "nuxt:global-components"
  4629. });
  4630. function toArray(value) {
  4631. return Array.isArray(value) ? value : [value];
  4632. }
  4633. function useRequestEvent(nuxtApp) {
  4634. var _a2;
  4635. nuxtApp || (nuxtApp = useNuxtApp());
  4636. return (_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.event;
  4637. }
  4638. function prerenderRoutes(path) {
  4639. const paths = toArray(path);
  4640. appendHeader(useRequestEvent(), "x-nitro-prerender", paths.map((p) => encodeURIComponent(p)).join(", "));
  4641. }
  4642. let routes;
  4643. const prerender_server_cKsUmC_SYa3MXwAfdS__3ZJssblZZqdZAiVNsGcVEcY = /* @__PURE__ */ defineNuxtPlugin(async () => {
  4644. let __temp, __restore;
  4645. if (routes && !routes.length) {
  4646. return;
  4647. }
  4648. (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules;
  4649. routes || (routes = Array.from(processRoutes(([__temp, __restore] = executeAsync(() => {
  4650. var _a2;
  4651. return (_a2 = routerOptions.routes) == null ? void 0 : _a2.call(routerOptions, _routes);
  4652. }), __temp = await __temp, __restore(), __temp) ?? _routes)));
  4653. const batch = routes.splice(0, 10);
  4654. prerenderRoutes(batch);
  4655. });
  4656. const OPTIONAL_PARAM_RE = /^\/?:.*(?:\?|\(\.\*\)\*)$/;
  4657. function shouldPrerender(path) {
  4658. return true;
  4659. }
  4660. function processRoutes(routes2, currentPath = "/", routesToPrerender = /* @__PURE__ */ new Set()) {
  4661. var _a2;
  4662. for (const route of routes2) {
  4663. if (OPTIONAL_PARAM_RE.test(route.path) && !((_a2 = route.children) == null ? void 0 : _a2.length) && shouldPrerender()) {
  4664. routesToPrerender.add(currentPath);
  4665. }
  4666. if (route.path.includes(":")) {
  4667. continue;
  4668. }
  4669. const fullPath = joinURL(currentPath, route.path);
  4670. {
  4671. routesToPrerender.add(fullPath);
  4672. }
  4673. if (route.children) {
  4674. processRoutes(route.children, fullPath, routesToPrerender);
  4675. }
  4676. }
  4677. return routesToPrerender;
  4678. }
  4679. const plugins = [
  4680. unhead_v5ac8_aYQVlP6KGZHvlpq6x2XWXwze6_1FIL8VEzXsY,
  4681. plugin,
  4682. revive_payload_server_cOgQ3s4LyKn2YZ80ucX0OsNM3PTOSwPOL2UA48dmxm0,
  4683. components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4,
  4684. prerender_server_cKsUmC_SYa3MXwAfdS__3ZJssblZZqdZAiVNsGcVEcY
  4685. ];
  4686. const __nuxt_component_0 = defineComponent({
  4687. name: "ServerPlaceholder",
  4688. render() {
  4689. return createElementBlock("div");
  4690. }
  4691. });
  4692. const defineRouteProvider = (name = "RouteProvider") => defineComponent({
  4693. name,
  4694. props: {
  4695. vnode: {
  4696. type: Object,
  4697. required: true
  4698. },
  4699. route: {
  4700. type: Object,
  4701. required: true
  4702. },
  4703. vnodeRef: Object,
  4704. renderKey: String,
  4705. trackRootNodes: Boolean
  4706. },
  4707. setup(props) {
  4708. const previousKey = props.renderKey;
  4709. const previousRoute = props.route;
  4710. const route = {};
  4711. for (const key in props.route) {
  4712. Object.defineProperty(route, key, {
  4713. get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
  4714. enumerable: true
  4715. });
  4716. }
  4717. provide(PageRouteSymbol, shallowReactive(route));
  4718. return () => {
  4719. return h(props.vnode, { ref: props.vnodeRef });
  4720. };
  4721. }
  4722. });
  4723. const RouteProvider = defineRouteProvider();
  4724. const __nuxt_component_1 = defineComponent({
  4725. name: "NuxtPage",
  4726. inheritAttrs: false,
  4727. props: {
  4728. name: {
  4729. type: String
  4730. },
  4731. transition: {
  4732. type: [Boolean, Object],
  4733. default: void 0
  4734. },
  4735. keepalive: {
  4736. type: [Boolean, Object],
  4737. default: void 0
  4738. },
  4739. route: {
  4740. type: Object
  4741. },
  4742. pageKey: {
  4743. type: [Function, String],
  4744. default: null
  4745. }
  4746. },
  4747. setup(props, { attrs, slots, expose }) {
  4748. const nuxtApp = useNuxtApp();
  4749. const pageRef = ref();
  4750. inject(PageRouteSymbol, null);
  4751. expose({ pageRef });
  4752. inject(LayoutMetaSymbol, null);
  4753. nuxtApp.deferHydration();
  4754. return () => {
  4755. return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
  4756. default: (routeProps) => {
  4757. return h(Suspense, { suspensible: true }, {
  4758. default() {
  4759. return h(RouteProvider, {
  4760. vnode: slots.default ? normalizeSlot(slots.default, routeProps) : routeProps.Component,
  4761. route: routeProps.route,
  4762. vnodeRef: pageRef
  4763. });
  4764. }
  4765. });
  4766. }
  4767. });
  4768. };
  4769. }
  4770. });
  4771. function normalizeSlot(slot, data) {
  4772. const slotContent = slot(data);
  4773. return slotContent.length === 1 ? h(slotContent[0]) : h(Fragment, void 0, slotContent);
  4774. }
  4775. const _imports_0 = "" + __buildAssetsURL("ccdw_logo_2025.5.DSzOQ1td.png");
  4776. const _export_sfc = (sfc, props) => {
  4777. const target = sfc.__vccOpts || sfc;
  4778. for (const [key, val] of props) {
  4779. target[key] = val;
  4780. }
  4781. return target;
  4782. };
  4783. const _sfc_main$2 = {};
  4784. function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
  4785. const _component_NuxtRouteAnnouncer = __nuxt_component_0;
  4786. const _component_NuxtPage = __nuxt_component_1;
  4787. _push(`<div${ssrRenderAttrs(_attrs)}>`);
  4788. _push(ssrRenderComponent(_component_NuxtRouteAnnouncer, null, null, _parent));
  4789. _push(`<header class="site-header"><img${ssrRenderAttr("src", _imports_0)} alt="CCDW Logo" class="logo"><h1>CCDW = 纯粹的玩</h1></header><main class="site-main">`);
  4790. _push(ssrRenderComponent(_component_NuxtPage, null, null, _parent));
  4791. _push(`</main><footer class="site-footer"><p>© ${ssrInterpolate((/* @__PURE__ */ new Date()).getFullYear())} CCDW (纯粹的玩). 不保留所有权利.</p><p>杭州纯粹的玩品牌科技有限公司 坐落于 浙江省杭州市西湖区转塘街道云腾丝路中心5号楼商业208室</p></footer></div>`);
  4792. }
  4793. const _sfc_setup$2 = _sfc_main$2.setup;
  4794. _sfc_main$2.setup = (props, ctx) => {
  4795. const ssrContext = useSSRContext();
  4796. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
  4797. return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
  4798. };
  4799. const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
  4800. const _sfc_main$1 = {
  4801. __name: "nuxt-error-page",
  4802. __ssrInlineRender: true,
  4803. props: {
  4804. error: Object
  4805. },
  4806. setup(__props) {
  4807. const props = __props;
  4808. const _error = props.error;
  4809. _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
  4810. const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
  4811. return {
  4812. text,
  4813. internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
  4814. };
  4815. }).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
  4816. const statusCode = Number(_error.statusCode || 500);
  4817. const is404 = statusCode === 404;
  4818. const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
  4819. const description = _error.message || _error.toString();
  4820. const stack = void 0;
  4821. const _Error404 = defineAsyncComponent(() => import('./error-404-BRnVQQNb.mjs'));
  4822. const _Error = defineAsyncComponent(() => import('./error-500-CNX-wKnS.mjs'));
  4823. const ErrorTemplate = is404 ? _Error404 : _Error;
  4824. return (_ctx, _push, _parent, _attrs) => {
  4825. _push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
  4826. };
  4827. }
  4828. };
  4829. const _sfc_setup$1 = _sfc_main$1.setup;
  4830. _sfc_main$1.setup = (props, ctx) => {
  4831. const ssrContext = useSSRContext();
  4832. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/.pnpm/nuxt@3.17.4_@parcel+watcher@2.5.1_@types+node@22.15.21_db0@0.3.2_ioredis@5.6.1_magicast_e2b60321bafda6f7a9390f7ac7478d38/node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
  4833. return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
  4834. };
  4835. const _sfc_main = {
  4836. __name: "nuxt-root",
  4837. __ssrInlineRender: true,
  4838. setup(__props) {
  4839. const IslandRenderer = () => null;
  4840. const nuxtApp = useNuxtApp();
  4841. nuxtApp.deferHydration();
  4842. nuxtApp.ssrContext.url;
  4843. const SingleRenderer = false;
  4844. provide(PageRouteSymbol, useRoute());
  4845. nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
  4846. const error = useError();
  4847. const abortRender = error.value && !nuxtApp.ssrContext.error;
  4848. onErrorCaptured((err, target, info) => {
  4849. nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
  4850. {
  4851. const p = nuxtApp.runWithContext(() => showError(err));
  4852. onServerPrefetch(() => p);
  4853. return false;
  4854. }
  4855. });
  4856. const islandContext = nuxtApp.ssrContext.islandContext;
  4857. return (_ctx, _push, _parent, _attrs) => {
  4858. ssrRenderSuspense(_push, {
  4859. default: () => {
  4860. if (unref(abortRender)) {
  4861. _push(`<div></div>`);
  4862. } else if (unref(error)) {
  4863. _push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
  4864. } else if (unref(islandContext)) {
  4865. _push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
  4866. } else if (unref(SingleRenderer)) {
  4867. ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
  4868. } else {
  4869. _push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
  4870. }
  4871. },
  4872. _: 1
  4873. });
  4874. };
  4875. }
  4876. };
  4877. const _sfc_setup = _sfc_main.setup;
  4878. _sfc_main.setup = (props, ctx) => {
  4879. const ssrContext = useSSRContext();
  4880. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/.pnpm/nuxt@3.17.4_@parcel+watcher@2.5.1_@types+node@22.15.21_db0@0.3.2_ioredis@5.6.1_magicast_e2b60321bafda6f7a9390f7ac7478d38/node_modules/nuxt/dist/app/components/nuxt-root.vue");
  4881. return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
  4882. };
  4883. let entry;
  4884. {
  4885. entry = async function createNuxtAppServer(ssrContext) {
  4886. var _a2;
  4887. const vueApp = createApp(_sfc_main);
  4888. const nuxt = createNuxtApp({ vueApp, ssrContext });
  4889. try {
  4890. await applyPlugins(nuxt, plugins);
  4891. await nuxt.hooks.callHook("app:created", vueApp);
  4892. } catch (error) {
  4893. await nuxt.hooks.callHook("app:error", error);
  4894. (_a2 = nuxt.payload).error || (_a2.error = createError(error));
  4895. }
  4896. if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
  4897. throw new Error("skipping render");
  4898. }
  4899. return vueApp;
  4900. };
  4901. }
  4902. const entry$1 = (ssrContext) => entry(ssrContext);
  4903. export { Yr as Y, Zt as Z, _export_sfc as _, useNuxtApp as a, useRuntimeConfig as b, nuxtLinkDefaults as c, entry$1 as default, navigateTo as n, resolveRouteObject as r, tryUseNuxtApp as t, useRouter as u };
  4904. //# sourceMappingURL=server.mjs.map