PageSourceSearch

https://futurebridge.me/_next/static/chunks/536-80c5445a7a382aba.js

js futurebridge.me collected 2026-10-07 16:28:41 UTC 234,410 bytes, 399 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{82217:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let{Decimal:n,objectEnumValues:i,makeStrictEnum:o,Public:a,getRuntime:s,skip:c}=r(57392),l={};t.Prisma=l,t.$Enums={},l.prismaVersion={client:"5.21.1",engine:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},l.PrismaClientKnownRequestError=()=>{let e=s().prettyName;throw Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
2In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientUnknownRequestError=()=>{let e=s().prettyName;throw Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
3In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientRustPanicError=()=>{let e=s().prettyName;throw Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
4In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientInitializationError=()=>{let e=s().prettyName;throw Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
5In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientValidationError=()=>{let e=s().prettyName;throw Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
6In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.NotFoundError=()=>{let e=s().prettyName;throw Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
7In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.Decimal=n,l.sql=()=>{let e=s().prettyName;throw Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
8In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.empty=()=>{let e=s().prettyName;throw Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
9In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.join=()=>{let e=s().prettyName;throw Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
10In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.raw=()=>{let e=s().prettyName;throw Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
11In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.validator=a.validator,l.getExtensionContext=()=>{let e=s().prettyName;throw Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
12In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.defineExtension=()=>{let e=s().prettyName;throw Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
13In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.DbNull=i.instances.DbNull,l.JsonNull=i.instances.JsonNull,l.AnyNull=i.instances.AnyNull,l.NullTypes={DbNull:i.classes.DbNull,JsonNull:i.classes.JsonNull,AnyNull:i.classes.AnyNull},t.Prisma.TransactionIsolationLevel=o({ReadUncommitted:"ReadUncommitted",ReadCommitted:"ReadCommitted",RepeatableRead:"RepeatableRead",Serializable:"Serializable"}),t.Prisma.LandingCarouselImageScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",orderIndex:"orderIndex",imageUrl:"imageUrl",link:"link"},t.Prisma.SessionScalarFieldEnum={id:"id",sessionToken:"sessionToken",userId:"userId",expires:"expires"},t.Prisma.VerificationTokenScalarFieldEnum={identifier:"identifier",token:"token",expires:"expires"},t.Prisma.PrimaryCourseCategoryScalarFieldEnum={code:"code",name:"name"},t.Prisma.SecondaryCourseCategoryScalarFieldEnum={code:"code",name:"name",primaryCourseCategoryCode:"primaryCourseCategoryCode"},t.Prisma.CourseScalarFieldEnum={code:"code",name:"name",secondaryCourseCategoryCode:"secondaryCourseCategoryCode"},t.Prisma.DepartmentScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",cricosCode:"cricosCode",degree:"degree",name:"name",representativeImageUrls:"representativeImageUrls",description:"description",hasScholarship:"hasScholarship",duration:"duration",fee:"fee",requirementATAR:"requirementATAR",requirementIELTS:"requirementIELTS",courseCode:"courseCode",universityId:"universityId"},t.Prisma.AdmissionApplicationScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",type:"type",fileName:"fileName",fileUrl:"fileUrl",userId:"userId"},t.Prisma.RecommendFormScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",preferredDegree:"preferredDegree",preferredCourseCode:"preferredCourseCode",budget:"budget",userId:"userId"},t.Prisma.RecommendResultScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",score:"score",analysis:"analysis",departmentId:"departmentId",formId:"formId"},t.Prisma.LanguageProficiencyScoreScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",type:"type",score:"score",formId:"formId"},t.Prisma.HighestEducationLevelScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",type:"type",score:"score",formId:"formId"},t.Prisma.UniversityScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",logoImageUrl:"logoImageUrl",name:"name",ranking:"ranking",region:"region",address:"address",latitude:"latitude",longitude:"longitude",contactLink:"contactLink"},t.Prisma.UserScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",name:"name",image:"image",email:"email",emailVerified:"emailVerified",hashedPassword:"hashedPassword",phoneNumber:"phoneNumber",hasMembership:"hasMembership",freeUses:"freeUses"},t.Prisma.AccountScalarFieldEnum={id:"id",userId:"userId",type:"type",provider:"provider",providerAccountId:"providerAccountId",refresh_token:"refresh_token",access_token:"access_token",expires_at:"expires_at",refresh_token_expires_in:"refresh_token_expires_in",token_type:"token_type",scope:"scope",id_token:"id_token",session_state:"session_state"},t.Prisma.SortOrder={asc:"asc",desc:"desc"},t.Prisma.QueryMode={default:"default",insensitive:"insensitive"},t.Prisma.NullsOrder={first:"first",last:"last"},t.Prisma.LandingCarouselImageOrderByRelevanceFieldEnum={imageUrl:"imageUrl",link:"link"},t.Prisma.SessionOrderByRelevanceFieldEnum={id:"id",sessionToken:"sessionToken",userId:"userId"},t.Prisma.VerificationTokenOrderByRelevanceFieldEnum={identifier:"identifier",token:"token"},t.Prisma.PrimaryCourseCategoryOrderByRelevanceFieldEnum={code:"code",name:"name"},t.Prisma.SecondaryCourseCategoryOrderByRelevanceFieldEnum={code:"code",name:"name",primaryCourseCategoryCode:"primaryCourseCategoryCode"},t.Prisma.CourseOrderByRelevanceFieldEnum={code:"code",name:"name",secondaryCourseCategoryCode:"secondaryCourseCategoryCode"},t.Prisma.DepartmentOrderByRelevanceFieldEnum={cricosCode:"cricosCode",name:"name",representativeImageUrls:"representativeImageUrls",description:"description",courseCode:"courseCode",universityId:"universityId"},t.Prisma.AdmissionApplicationOrderByRelevanceFieldEnum={id:"id",fileName:"fileName",fileUrl:"fileUrl",userId:"userId"},t.Prisma.RecommendFormOrderByRelevanceFieldEnum={id:"id",preferredCourseCode:"preferredCourseCode",userId:"userId"},t.Prisma.RecommendResultOrderByRelevanceFieldEnum={id:"id",analysis:"analysis",formId:"formId"},t.Prisma.LanguageProficiencyScoreOrderByRelevanceFieldEnum={id:"id",formId:"formId"},t.Prisma.HighestEducationLevelOrderByRelevanceFieldEnum={id:"id",formId:"formId"},t.Prisma.UniversityOrderByRelevanceFieldEnum={id:"id",logoImageUrl:"logoImageUrl",name:"name",address:"address",contactLink:"contactLink"},t.Prisma.UserOrderByRelevanceFieldEnum={id:"id",name:"name",image:"image",email:"email",hashedPassword:"hashedPassword",phoneNumber:"phoneNumber"},t.Prisma.AccountOrderByRelevanceFieldEnum={id:"id",userId:"userId",type:"type",provider:"provider",providerAccountId:"providerAccountId",refresh_token:"refresh_token",access_token:"access_token",token_type:"token_type",scope:"scope",id_token:"id_token",session_state:"session_state"},t.DegreeEnum=t.$Enums.DegreeEnum={BACHELOR:"BACHELOR",MASTER:"MASTER",FOUNDATION:"FOUNDATION",DIPLOMA:"DIPLOMA"},t.AdmissionApplicationType=t.$Enums.AdmissionApplicationType={PASSPORT:"PASSPORT",GRADUATION_CERTIFICATE:"GRADUATION_CERTIFICATE",ACADEMIC_TRANSCRIPT:"ACADEMIC_TRANSCRIPT",ENGLISH_PROFICIENCY_TEST_SCORE:"ENGLISH_PROFICIENCY_TEST_SCORE",RESUME:"RESUME",STATE_OF_PURPOSE:"STATE_OF_PURPOSE",PORTFOLIO:"PORTFOLIO",CONFIRMATION_OF_ENROLMENT:"CONFIRMATION_OF_ENROLMENT",OVERSEAS_STUDENT_HEALTH_COVER:"OVERSEAS_STUDENT_HEALTH_COVER",GENUINE_STUDENT:"GENUINE_STUDENT",BANK_STATEMENT:"BANK_STATEMENT",FAMILY_RELATIONSHIP_CERTIFICATE:"FAMILY_RELATIONSHIP_CERTIFICATE",CRIMINAL_RECORD_CHECK:"CRIMINAL_RECORD_CHECK",OTHER:"OTHER"}
13,t.BudgetEnum=t.$Enums.BudgetEnum={UNDER_3000:"UNDER_3000",FROM_3000_TO_4000:"FROM_3000_TO_4000",FROM_4000_TO_5000:"FROM_4000_TO_5000",OVER_5000:"OVER_5000"},t.LanguageProficiencyScoreType=t.$Enums.LanguageProficiencyScoreType={IELTS:"IELTS",TOEFL:"TOEFL",PTE:"PTE",NONE:"NONE"},t.HighestEducationLevelType=t.$Enums.HighestEducationLevelType={HIGH_SCHOOL:"HIGH_SCHOOL",ASSOCIATE:"ASSOCIATE",BACHELOR:"BACHELOR",MASTER:"MASTER",DROP_OUT:"DROP_OUT"},t.UniversityRegion=t.$Enums.UniversityRegion={NSW:"NSW",VIC:"VIC",QLD:"QLD",SA:"SA",WA:"WA",TAS:"TAS",ACT:"ACT",NT:"NT"},t.Prisma.ModelName={LandingCarouselImage:"LandingCarouselImage",Session:"Session",VerificationToken:"VerificationToken",PrimaryCourseCategory:"PrimaryCourseCategory",SecondaryCourseCategory:"SecondaryCourseCategory",Course:"Course",Department:"Department",AdmissionApplication:"AdmissionApplication",RecommendForm:"RecommendForm",RecommendResult:"RecommendResult",LanguageProficiencyScore:"LanguageProficiencyScore",HighestEducationLevel:"HighestEducationLevel",University:"University",User:"User",Account:"Account"};class u{constructor(){return new Proxy(this,{get(e,t){let r=s();throw Error((r.isEdge?`PrismaClient is not configured to run in ${r.prettyName}. In order to run Prisma Client on edge runtime, either:
14- Use Prisma Accelerate: https://pris.ly/d/accelerate
15- Use Driver Adapters: https://pris.ly/d/driver-adapters
16`:"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `"+r.prettyName+"`).")+`
17If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`)}})}}t.PrismaClient=u,Object.assign(t,l)},64394:function(e,t,r){let n=r(82217);e.exports=n},57392:function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})},a={};o(a,{Decimal:()=>e0,Public:()=>s,getRuntime:()=>_,makeStrictEnum:()=>b,objectEnumValues:()=>w}),e.exports=((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))i.call(e,c)||c===a||t(e,c,{get:()=>o[c],enumerable:!(s=r(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),a);var s={};function c(...e){return e=>e}o(s,{validator:()=>c});var l=Symbol(),u=new WeakMap,d=class{constructor(e){e===l?u.set(this,"Prisma.".concat(this._getName())):u.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return u.get(this)}},h=class extends d{_getNamespace(){return"NullTypes"}},p=class extends h{};y(p,"DbNull");var f=class extends h{};y(f,"JsonNull");var m=class extends h{};y(m,"AnyNull");var w={classes:{DbNull:p,JsonNull:f,AnyNull:m},instances:{DbNull:new p(l),JsonNull:new f(l),AnyNull:new m(l)}};function y(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var g=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function b(e){return new Proxy(e,{get(e,t){if(t in e)return e[t];if(!g.has(t))throw TypeError("Invalid enum value: ".concat(String(t)))}})}var v={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function _(){var e,t,r;let n="object"==typeof Netlify?"netlify":"string"==typeof EdgeRuntime?"edge-light":(null==(e=globalThis.navigator)?void 0:e.userAgent)==="Cloudflare-Workers"?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":(null==(r=null==(t=globalThis.process)?void 0:t.release)?void 0:r.name)==="node"?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown";return{id:n,prettyName:v[n]||n,isEdge:["workerd","deno","netlify","edge-light"].includes(n)}}var k,A,E="0123456789abcdef",S="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",x="3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193
1711881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",T={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},P=!0,C="[DecimalError] ",R=C+"Invalid argument: ",O=C+"Precision limit exceeded",U=C+"crypto unavailable",I="[object Decimal]",N=Math.floor,H=Math.pow,j=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,L=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,D=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,M=S.length-1,W=x.length-1,K={toStringTag:I};function J(e){var t,r,n,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(o+=ee(r)),o+=n;(r=7-(n=(a=e[t])+"").length)&&(o+=ee(r))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function F(e,t,r){if(e!==~~e||e<t||e>r)throw Error(R+e)}function q(e,t,r,n){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=H(10,7-t),s=e[i]%o|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(s==o/2||0==s)&&(e[i+1]/o/100|0)==0:t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(n||r<4)&&9999==s||!n&&r>3&&4999==s):a=((n||r<4)&&s+1==o||!n&&r>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,a}function B(e,t,r){for(var n,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=E.indexOf(e.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}K.absoluteValue=K.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),V(e)},K.ceil=function(){return V(new this.constructor(this),this.e+1,2)},K.clampedTo=K.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(R+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new r(this)}
17,K.comparedTo=K.cmp=function(e){var t,r,n,i,o=this.d,a=(e=new this.constructor(e)).d,s=this.s,c=e.s;if(!o||!a)return s&&c?s!==c?s:o===a?0:!o^s<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?s:a[0]?-c:0;if(s!==c)return s;if(this.e!==e.e)return this.e>e.e^s<0?1:-1;for(n=o.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},K.cosine=K.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/el(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ec(e,1,t.times(i),new e(1));for(var o=r;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}(n,eu(n,r)),n.precision=e,n.rounding=t,V(2==A||3==A?r.neg():r,e,t,!0)):new n(1):new n(NaN)},K.cubeRoot=K.cbrt=function(){var e,t,r,n,i,o,a,s,c,l,u=this.constructor;if(!this.isFinite()||this.isZero())return new u(this);for(P=!1,(o=this.s*H(this.s*this,1/3))&&Math.abs(o)!=1/0?n=new u(o.toString()):(r=J(this.d),(o=((e=this.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=H(r,1/3),e=N((e+1)/3)-(e%3==(e<0?-1:2)),(n=new u(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=this.s),a=(e=u.precision)+3;;)if(n=z((l=(c=(s=n).times(s).times(s)).plus(this)).plus(this).times(s),l.plus(c),a+2,1),J(s.d).slice(0,a)===(r=J(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(V(n,e+1,1),t=!n.times(n).times(n).eq(this));break}if(!i&&(V(s,e+1,0),s.times(s).times(s).eq(this))){n=s;break}a+=4,i=1}return P=!0,V(n,e,u.rounding,t)},K.decimalPlaces=K.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-N(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},K.dividedBy=K.div=function(e){return z(this,new this.constructor(e))},K.dividedToIntegerBy=K.divToInt=function(e){var t=this.constructor;return V(z(this,new t(e),0,1,1),t.precision,t.rounding)},K.equals=K.eq=function(e){return 0===this.cmp(e)},K.floor=function(){return V(new this.constructor(this),this.e+1,3)},K.greaterThan=K.gt=function(e){return this.cmp(e)>0},K.greaterThanOrEqualTo=K.gte=function(e){var t=this.cmp(e);return 1==t||0===t},K.hyperbolicCosine=K.cosh=function(){var e,t,r,n,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/el(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=ec(a,1,o.times(t),new a(1),!0);for(var c,l=e,u=new a(8);l--;)c=o.times(o),o=s.minus(c.times(u.minus(c.times(u))));return V(o,a.precision=r,a.rounding=n,!0)},K.hyperbolicSine=K.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=ec(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=ec(o,2,i=i.times(1/el(5,e)),i,!0);for(var a,s=new o(5),c=new o(16),l=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(c.times(a).plus(l))))}return o.precision=t,o.rounding=r,V(i,t,r,!0)},K.hyperbolicTangent=K.tanh=function(){var e,t,r=this.constructor;return this.isFinite()?this.isZero()?new r(this):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,z(this.sinh(),this.cosh(),r.precision=e,r.rounding=t)):new r(this.s)},K.inverseCosine=K.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return -1!==n?0===n?t.isNeg()?Y(r,i,o):new r(0):new r(NaN):t.isZero()?Y(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Y(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},K.inverseHyperbolicCosine=K.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,P=!1,r=r.times(r).minus(1).sqrt().plus(r),P=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},K.inverseHyperbolicSine=K.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.roun
17ding=1,P=!1,r=r.times(r).plus(1).sqrt().plus(r),P=!0,n.precision=e,n.rounding=t,r.ln())},K.inverseHyperbolicTangent=K.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(n=i.sd(),e)<-(2*i.e)-1?V(new o(i),e,t,!0):(o.precision=r=n-i.e,i=z(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},K.inverseSine=K.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t?0===t?((e=Y(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},K.inverseTangent=K.atan=function(){var e,t,r,n,i,o,a,s,c,l=this,u=l.constructor,d=u.precision,h=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=W)return(a=Y(u,d+4,h).times(.25)).s=l.s,a}else{if(!l.s)return new u(NaN);if(d+4<=W)return(a=Y(u,d+4,h).times(.5)).s=l.s,a}for(u.precision=s=d+10,u.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(P=!1,t=Math.ceil(s/7),n=1,c=l.times(l),a=new u(l),i=l;-1!==e;)if(i=i.times(c),o=a.minus(i.div(n+=2)),i=i.times(c),void 0!==(a=o.plus(i.div(n+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return r&&(a=a.times(2<<r-1)),P=!0,V(a,u.precision=d,u.rounding=h,!0)},K.isFinite=function(){return!!this.d},K.isInteger=K.isInt=function(){return!!this.d&&N(this.e/7)>this.d.length-2},K.isNaN=function(){return!this.s},K.isNegative=K.isNeg=function(){return this.s<0},K.isPositive=K.isPos=function(){return this.s>0},K.isZero=function(){return!!this.d&&0===this.d[0]},K.lessThan=K.lt=function(e){return 0>this.cmp(e)},K.lessThanOrEqualTo=K.lte=function(e){return 1>this.cmp(e)},K.logarithm=K.log=function(e){var t,r,n,i,o,a,s,c=this.constructor,l=c.precision,u=c.rounding;if(null==e)e=new c(10),t=!0;else{if(r=(e=new c(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(t){if(r.length>1)i=!0;else{for(n=r[0];n%10==0;)n/=10;i=1!==n}}if(P=!1,q((s=z(eo(this,a=l+5),t?Z(c,a+10):eo(e,a),a,1)).d,n=l,u))do if(a+=10,s=z(eo(this,a),t?Z(c,a+10):eo(e,a),a,1),!i){+J(s.d).slice(n+1,n+15)+1==1e14&&(s=V(s,l+1,0));break}while(q(s.d,n+=10,u));return P=!0,V(s,l,u)},K.minus=K.sub=function(e){var t,r,n,i,o,a,s,c,l,u,d,h,p=this.constructor;if(e=new p(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new p(e.d||this.s!==e.s?this:NaN):e=new p(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(l=this.d,h=e.d,s=p.precision,c=p.rounding,!l[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!l[0])return new p(3===c?-0:0);e=new p(this)}return P?V(e,s,c):e}if(r=N(e.e/7),u=N(this.e/7),l=l.slice(),o=u-r){for((d=o<0)?(t=l,o=-o,a=h.length):(t=h,r=u,a=l.length),o>(n=Math.max(Math.ceil(s/7),a)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((d=(n=l.length)<(a=h.length))&&(a=n),n=0;n<a;n++)if(l[n]!=h[n]){d=l[n]<h[n];break}o=0}for(d&&(t=l,l=h,h=t,e.s=-e.s),a=l.length,n=h.length-a;n>0;--n)l[a++]=0;for(n=h.length;n>o;){if(l[--n]<h[n]){for(i=n;i&&0===l[--i];)l[i]=1e7-1;--l[i],l[n]+=1e7}l[n]-=h[n]}for(;0===l[--a];)l.pop();for(;0===l[0];l.shift())--r;return l[0]?(e.d=l,e.e=X(l,r),P?V(e,s,c):e):new p(3===c?-0:0)},K.modulo=K.mod=function(e){var t,r=this.constructor;return e=new r(e),this.d&&e.s&&(!e.d||e.d[0])?e.d&&(!this.d||this.d[0])?(P=!1,9==r.modulo?(t=z(this,e.abs(),0,3,1),t.s*=e.s):t=z(this,e,0,r.modulo,1),t=t.times(e),P=!0,this.minus(t)):V(new r(this),r.precision,r.rounding):new r(NaN)},K.naturalExponential=K.exp=function(){return ei(this)},K.naturalLogarithm=K.ln=function(){return eo(this)},K.negated=K.neg=function(){var e=new this.constructor(this);return e.s=-e.s,V(e)},K.plus=K.add=function(e){var t,r,n,i,o,a,s,c,l,u,d=this.constructor;if(e=new d(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new d(e.d||this.s===e.s?this:NaN)):e=new d(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);
17if(l=this.d,u=e.d,s=d.precision,c=d.rounding,!l[0]||!u[0])return u[0]||(e=new d(this)),P?V(e,s,c):e;if(o=N(this.e/7),n=N(e.e/7),l=l.slice(),i=o-n){for(i<0?(r=l,i=-i,a=u.length):(r=u,n=o,a=l.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=l.length)-(i=u.length)<0&&(i=a,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/1e7|0,l[i]%=1e7;for(t&&(l.unshift(t),++n),a=l.length;0==l[--a];)l.pop();return e.d=l,e.e=X(l,n),P?V(e,s,c):e},K.precision=K.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(R+e);return this.d?(t=Q(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},K.round=function(){var e=this.constructor;return V(new e(this),this.e+1,e.rounding)},K.sine=K.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ec(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=ec(e,2,t=t.times(1/el(5,r)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(n,eu(n,r)),n.precision=e,n.rounding=t,V(A>2?r.neg():r,e,t,!0)):new n(NaN)},K.squareRoot=K.sqrt=function(){var e,t,r,n,i,o,a=this.d,s=this.e,c=this.s,l=this.constructor;if(1!==c||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?this:1/0);for(P=!1,0==(c=Math.sqrt(+this))||c==1/0?(((t=J(a)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=N((s+1)/2)-(s<0||s%2),n=new l(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new l(c.toString()),r=(s=l.precision)+3;;)if(n=(o=n).plus(z(this,o,r+2,1)).times(.5),J(o.d).slice(0,r)===(t=J(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(V(n,s+1,1),e=!n.times(n).eq(this));break}if(!i&&(V(o,s+1,0),o.times(o).eq(this))){n=o;break}r+=4,i=1}return P=!0,V(n,s,l.rounding,e)},K.tangent=K.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=z(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,V(2==A||4==A?r.neg():r,e,t,!0)):new n(NaN)},K.times=K.mul=function(e){var t,r,n,i,o,a,s,c,l,u=this.constructor,d=this.d,h=(e=new u(e)).d;if(e.s*=this.s,!d||!d[0]||!h||!h[0])return new u(e.s&&(!d||d[0]||h)&&(!h||h[0]||d)?d&&h?0*e.s:e.s/0:NaN);for(r=N(this.e/7)+N(e.e/7),(c=d.length)<(l=h.length)&&(o=d,d=h,h=o,a=c,c=l,l=a),o=[],n=a=c+l;n--;)o.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)s=o[i]+h[n]*d[i-n-1]+t,o[i--]=s%1e7|0,t=s/1e7|0;o[i]=(o[i]+t)%1e7|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=X(o,r),P?V(e,u.precision,u.rounding):e},K.toBinary=function(e,t){return ed(this,2,e,t)},K.toDecimalPlaces=K.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(F(e,0,1e9),void 0===t?t=n.rounding:F(t,0,8),V(r,e+r.e+1,t))},K.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=G(n,!0):(F(e,0,1e9),void 0===t?t=i.rounding:F(t,0,8),r=G(n=V(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},K.toFixed=function(e,t){var r,n,i=this.constructor;return void 0===e?r=G(this):(F(e,0,1e9),void 0===t?t=i.rounding:F(t,0,8),r=G(n=V(new i(this),e+this.e+1,t),!1,e+n.e+1)),this.isNeg()&&!this.isZero()?"-"+r:r},K.toFraction=function(e){var t,r,n,i,o,a,s,c,l,u,d,h,p=this.d,f=this.constructor;if(!p)return new f(this);if(l=r=new f(1),n=c=new f(0),a=(o=(t=new f(n)).e=Q(p)-this.e-1)%7,t.d[0]=H(10,a<0?7+a:a),null==e)e=o>0?t:l;else{if(!(s=new f(e)).isInt()||s.lt(l))throw Error(R+s);e=s.gt(t)?o>0?t:l:s}for(P=!1,s=new f(J(p)),u=f.precision,f.precision=o=14*p.length;d=z(s,t,0,1,1),1!=(i=r.plus(d.times(n))).cmp(e);)r=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=z(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=this.s,h=1>z(l,n,o,1).minus(this).abs().cmp(z(c,r,o,1).minus(this).abs())?[l,n]:[c,r],f.precision=u,P=!0,h},K.toHexadecimal=K.toHex=function(e,t){return ed(this,16,e,t)},K.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:F(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(P=!1,r=z(r,e,0,t,1).times(e),P=!0,V(r)):(e.s=r.s,r=e),r},K.toNumber=function(){return+this},K.toOctal=function(e,t){return ed(this,8,e,t)},K.toPower=K.pow=function(e){var t,r,n,i,o,a,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(H(+s,l));if((s=new c(s)).eq(1))return s;if(n=c.precision,o=c.rounding,e.eq(1))return V(s,n,o);if((t=N(e.e/7))>=e.d.length-1&&(r=l<0?-l:l)<=9007199254740991)return i=et(c,s,r,n
17),e.s<0?new c(1).div(i):V(i,n,o);if((a=s.s)<0){if(t<e.d.length-1)return new c(NaN);if(1&e.d[t]||(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(r=H(+s,l))&&isFinite(r)?new c(r+"").e:N(l*(Math.log("0."+J(s.d))/Math.LN10+s.e+1)))>c.maxE+1||t<c.minE-1?new c(t>0?a/0:0):(P=!1,c.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=ei(e.times(eo(s,n+r)),n)).d&&q((i=V(i,n+5,1)).d,n,o)&&(t=n+10,+J((i=V(ei(e.times(eo(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=V(i,n+1,0))),i.s=a,P=!0,c.rounding=o,V(i,n,o))},K.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=G(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(F(e,1,1e9),void 0===t?t=i.rounding:F(t,0,8),r=G(n=V(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},K.toSignificantDigits=K.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(F(e,1,1e9),void 0===t?t=r.rounding:F(t,0,8)),V(new r(this),e,t)},K.toString=function(){var e=this.constructor,t=G(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},K.truncated=K.trunc=function(){return V(new this.constructor(this),this.e+1,1)},K.valueOf=K.toJSON=function(){var e=this.constructor,t=G(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var z=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,o,a,s,c){var l,u,d,h,p,f,m,w,y,g,b,v,_,A,E,S,x,T,P,C,R=n.constructor,O=n.s==i.s?1:-1,U=n.d,I=i.d;if(!U||!U[0]||!I||!I[0])return new R(n.s&&i.s&&(U?!I||U[0]!=I[0]:I)?U&&0==U[0]||!I?0*O:O/0:NaN);for(c?(p=1,u=n.e-i.e):(c=1e7,p=7,u=N(n.e/p)-N(i.e/p)),P=I.length,x=U.length,g=(y=new R(O)).d=[],d=0;I[d]==(U[d]||0);d++);if(I[d]>(U[d]||0)&&u--,null==o?(A=o=R.precision,a=R.rounding):A=s?o+(n.e-i.e)+1:o,A<0)g.push(1),f=!0;else{if(A=A/p+2|0,d=0,1==P){for(h=0,I=I[0],A++;(d<x||h)&&A--;d++)E=h*c+(U[d]||0),g[d]=E/I|0,h=E%I|0;f=h||d<x}else{for((h=c/(I[0]+1)|0)>1&&(I=e(I,h,c),U=e(U,h,c),P=I.length,x=U.length),S=P,v=(b=U.slice(0,P)).length;v<P;)b[v++]=0;(C=I.slice()).unshift(0),T=I[0],I[1]>=c/2&&++T;do h=0,(l=t(I,b,P,v))<0?(_=b[0],P!=v&&(_=_*c+(b[1]||0)),(h=_/T|0)>1?(h>=c&&(h=c-1),w=(m=e(I,h,c)).length,v=b.length,1==(l=t(m,b,w,v))&&(h--,r(m,P<w?C:I,w,c))):(0==h&&(l=h=1),m=I.slice()),(w=m.length)<v&&m.unshift(0),r(b,m,v,c),-1==l&&(v=b.length,(l=t(I,b,P,v))<1&&(h++,r(b,P<v?C:I,v,c))),v=b.length):0===l&&(h++,b=[0]),g[d++]=h,l&&b[0]?b[v++]=U[S]||0:(b=[U[S]],v=1);while((S++<x||void 0!==b[0])&&A--);f=void 0!==b[0]}g[0]||g.shift()}if(1==p)y.e=u,k=f;else{for(d=1,h=g[0];h>=10;h/=10)d++;y.e=d+u*p-1,V(y,s?o+y.e+1:o,a,f)}return y}}();function V(e,t,r,n){var i,o,a,s,c,l,u,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,s=d[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,c=(u=d[h=0])/H(10,i-a-1)%10|0;else if((h=Math.ceil((o+1)/7))>=(s=d.length)){if(n){for(;s++<=h;)d.push(0);u=c=0,i=1,o%=7,a=o-7+1}else break e}else{for(u=s=d[h],i=1;s>=10;s/=10)i++;o%=7,c=(a=o-7+i)<0?0:u/H(10,i-a-1)%10|0}if(n=n||t<0||void 0!==d[h+1]||(a<0?u:u%H(10,i-a-1)),l=r<4?(c||n)&&(0==r||r==(e.s<0?3:2)):c>5||5==c&&(4==r||n||6==r&&(o>0?a>0?u/H(10,i-a):0:d[h-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=H(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=h,s=1,h--):(d.length=h+1,s=H(10,7-o),d[h]=a>0?(u/H(10,i-a)%H(10,a)|0)*s:0),l)for(;;)if(0==h){for(o=1,a=d[0];a>=10;a/=10)o++;for(a=d[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,1e7==d[0]&&(d[0]=1));break}else{if(d[h]+=s,1e7!=d[h])break;d[h--]=0,s=1}for(o=d.length;0===d[--o];)d.pop()}return P&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function G(e,t,r){if(!e.isFinite())return ea(e);var n,i=e.e,o=J(e.d),a=o.length;return t?(r&&(n=r-a)>0?o=o.charAt(0)+"."+o.slice(1)+ee(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+ee(-i-1)+o,r&&(n=r-a)>
vendor: 4,307 bytes, line 17
170&&(o+=ee(n))):i>=a?(o+=ee(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+ee(n))):((n=i+1)<a&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(o+="."),o+=ee(n))),o}function X(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function Z(e,t,r){if(t>M)throw P=!0,r&&(e.precision=r),Error(O);return V(new e(S),t,1,!0)}function Y(e,t,r){if(t>W)throw Error(O);return V(new e(x),t,r,!0)}function Q(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function ee(e){for(var t="";e--;)t+="0";return t}function et(e,t,r,n){var i,o=new e(1),a=Math.ceil(n/7+4);for(P=!1;;){if(r%2&&eh((o=o.times(t)).d,a)&&(i=!0),0===(r=N(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}eh((t=t.times(t)).d,a)}return P=!0,o}function er(e){return 1&e.d[e.d.length-1]}function en(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if((n=new e(t[o])).s)i[r](n)&&(i=n);else{i=n;break}return i}function ei(e,t){var r,n,i,o,a,s,c,l=0,u=0,d=0,h=e.constructor,p=h.rounding,f=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(P=!1,c=f):c=t,s=new h(.03125);e.e>-2;)e=e.times(s),d+=5;for(c+=n=Math.log(H(2,d))/Math.LN10*2+5|0,r=o=a=new h(1),h.precision=c;;){if(o=V(o.times(e),c,1),r=r.times(++u),J((s=a.plus(z(o,r,c,1))).d).slice(0,c)===J(a.d).slice(0,c)){for(i=d;i--;)a=V(a.times(a),c,1);if(null!=t)return h.precision=f,a;if(!(l<3&&q(a.d,c-n,p,l)))return V(a,h.precision=f,p,P=!0);h.precision=c+=10,r=o=s=new h(1),u=0,l++}a=s}}function eo(e,t){var r,n,i,o,a,s,c,l,u,d,h,p=1,f=e,m=f.d,w=f.constructor,y=w.rounding,g=w.precision;if(f.s<0||!m||!m[0]||!f.e&&1==m[0]&&1==m.length)return new w(m&&!m[0]?-1/0:1!=f.s?NaN:m?0:f);if(null==t?(P=!1,u=g):u=t,w.precision=u+=10,n=(r=J(m)).charAt(0),!(15e14>Math.abs(o=f.e)))return l=Z(w,u+2,g).times(o+""),f=eo(new w(n+"."+r.slice(1)),u-10).plus(l),w.precision=g,null==t?V(f,g,y,P=!0):f;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=J((f=f.times(e)).d)).charAt(0),p++;for(o=f.e,n>1?(f=new w("0."+r),o++):f=new w(n+"."+r.slice(1)),d=f,c=a=f=z(f.minus(1),f.plus(1),u,1),h=V(f.times(f),u,1),i=3;;){if(a=V(a.times(h),u,1),J((l=c.plus(z(a,new w(i),u,1))).d).slice(0,u)===J(c.d).slice(0,u)){if(c=c.times(2),0!==o&&(c=c.plus(Z(w,u+2,g).times(o+""))),c=z(c,new w(p),u,1),null!=t)return w.precision=g,c;if(!q(c.d,u-10,y,s))return V(c,w.precision=g,y,P=!0);w.precision=u+=10,l=a=f=z(d.minus(1),d.plus(1),u,1),h=V(f.times(f),u,1),i=s=1}c=l,i+=2}}function ea(e){return String(e.s*e.s/0)}function es(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";e.d.push(+t),P&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ec(e,t,r,n,i){var o,a,s,c,l=e.precision,u=Math.ceil(l/7);for(P=!1,c=r.times(r),s=new e(n);;){if(a=z(s.times(c),new e(t++*t++),l,1),s=i?n.plus(a):n.minus(a),n=z(a.times(c),new e(t++*t++),l,1),void 0!==(a=s.plus(n)).d[u]){for(o=u;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=n,n=a,a=o}return P=!0,a.d.length=u+1,a}function el(e,t){for(var r=e;--t;)r*=e;return r}function eu(e,t){var r,n=t.s<0,i=Y(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return A=n?4:1,t;if((r=t.divToInt(i)).isZero())A=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return A=er(r)?n?2:3:n?4:1,t;A=er(r)?n?1:4:n?3:2}return t.minus(i).abs()}function ed(e,t,r,n){var i,o,a,s,c,l,u,d,h,p=e.constructor,f=void 0!==r;if(f?(F(r,1,1e9),void 0===n?n=p.rounding:F(n,0,8)):(r=p.precision,n=p.rounding),e.isFinite()){for(a=(u=G(e)).indexOf("."),f?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,a>=0&&(u=u.replace(".",""),(h=new p(1)).e=u.length-a,h.d=B(G(h),10,i),h.e=h.d.length),o=c=(d=B(u,10,i)).length;0==d[--c];)d.pop();if(d[0]){if(a<0?o--:((e=new p(e)).d=d,e.e=o,d=(e=z(e,h,r,n,0,i)).d,o=e.e,l=k),a=d[r],s=i/2,l=l||void 0!==d[r+1],l=n<4?(void 0!==a||l)&&(0===n||n===(e.s<0?3:2)):a>s||a===s&&(4===n||l||6===n&&1&d[r-1]||n===(e.s<0?8:7)),d.length=r,l)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;
17!d[c-1];--c);for(a=0,u="";a<c;a++)u+=E.charAt(d[a]);if(f){if(c>1){if(16==t||8==t){for(a=16==t?4:3,--c;c%a;c++)u+="0";for(c=(d=B(u,i,t)).length;!d[c-1];--c);for(a=1,u="1.";a<c;a++)u+=E.charAt(d[a])}else u=u.charAt(0)+"."+u.slice(1)}u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>c)for(o-=c;o--;)u+="0";else o<c&&(u=u.slice(0,o)+"."+u.slice(o))}else u=f?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=ea(e);return e.s<0?"-"+u:u}function eh(e,t){if(e.length>t)return e.length=t,!0}function ep(e){return new this(e).abs()}function ef(e){return new this(e).acos()}function em(e){return new this(e).acosh()}function ew(e,t){return new this(e).plus(t)}function ey(e){return new this(e).asin()}function eg(e){return new this(e).asinh()}function eb(e){return new this(e).atan()}function ev(e){return new this(e).atanh()}function e_(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?Y(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=Y(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(z(e,t,o,1)),t=Y(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(z(e,t,o,1)):(r=Y(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function ek(e){return new this(e).cbrt()}function eA(e){return V(e=new this(e),e.e+1,2)}function eE(e,t,r){return new this(e).clamp(t,r)}function eS(e){if(!e||"object"!=typeof e)throw Error(C+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=T[r]),void 0!==(n=e[r])){if(N(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(R+r+": "+n)}if(r="crypto",i&&(this[r]=T[r]),void 0!==(n=e[r])){if(!0===n||!1===n||0===n||1===n){if(n){if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(U)}else this[r]=!1}else throw Error(R+r+": "+n)}return this}function ex(e){return new this(e).cos()}function eT(e){return new this(e).cosh()}function eP(e,t){return new this(e).div(t)}function eC(e){return new this(e).exp()}function eR(e){return V(e=new this(e),e.e+1,3)}function eO(){var e,t,r=new this(0);for(P=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return P=!0,new this(1/0);r=t}return P=!0,r.sqrt()}function eU(e){return e instanceof eQ||e&&e.toStringTag===I||!1}function eI(e){return new this(e).ln()}function eN(e,t){return new this(e).log(t)}function eH(e){return new this(e).log(2)}function ej(e){return new this(e).log(10)}function e$(){return en(this,arguments,"lt")}function eL(){return en(this,arguments,"gt")}function eD(e,t){return new this(e).mod(t)}function eM(e,t){return new this(e).mul(t)}function eW(e,t){return new this(e).pow(t)}function eK(e){var t,r,n,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:F(e,1,1e9),n=Math.ceil(e/7),this.crypto){if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=n/4}else throw Error(U)}else for(;o<n;)s[o++]=1e7*Math.random()|0;for(n=s[--o],e%=7,n&&e&&(i=H(10,7-e),s[o]=(n/i|0)*i);0===s[o];o--)s.pop();if(o<0)r=0,s=[0];else{for(r=-1;0===s[0];r-=7)s.shift();for(n=1,i=s[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=s,a}function eJ(e){return V(e=new this(e),e.e+1,this.rounding)}function eF(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function eq(e){return new this(e).sin()}function eB(e){return new this(e).sinh()}function ez(e){return new this(e).sqrt()}function eV(e,t){return new this(e).sub(t)}function eG(){var e=0,t=arguments,r=new this(t[0]);for(P=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return P=!0,V(r,this.precision,this.rounding)}function eX(e){return new this(e).tan()}function eZ(e){return new this(e).tanh()}function eY(e){return V(e=new this(e),e.e+1,1)}K[Symbol.for("nodejs.util.inspect.custom")]=K.toString,K[Symbol.toStringTag]="Decimal";var eQ=K.constructor=function e(t){var r,n,i;function o(e){var t,r,n;if(!(this instanceof o))return new o(e);if(this.constructor=o,eU(e)){this.s=e.s,P?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(n=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;P?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return es(this,e.toString())}if("string"!==n)throw Error(R+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===r&&(e=e.slice(1)),this.s=1),D.test(e)?es(this,e):function(e,t){var r,n,i,o,a,s,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),D.test(t))return es(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if($.test(t))r=16,t=t.toLowerCase();else if(j.test(t))r=2;else if(L.test(t))r=8;else throw Error(R+t);for((o=t.search(/p/i))>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,n=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=et(n,new n(r),o,2*o)),o=u=(l=B(t,r,1e7)).length-1;0===l[o];--o)l.pop();return o<0?new n(0*e.s):(e.e=X(l,u),e.d=l,P=!1,a&&(e=z(e,i,4*s)),c&&(e=e.times(54>Math.abs(c)?H(2,c):eQ.pow(2,c))),P=!0,e)}(this,e)}if(o.prototype=K,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=eS,o.clone=e,o.isDecimal=eU,o.abs=ep,o.acos=ef,o.acosh=em,o.add=ew,o.asin=ey,o.asinh=eg,o.atan=eb,o.atanh=ev,o.atan2=e_,o.cbrt=ek,o.ceil=eA,o.clamp=eE,o.cos=ex,o.cosh=eT,o.div=eP,o.exp=eC,o.floor=eR,o.hypot=eO,o.ln=eI,o.log=eN,o.log10=ej,o.log2=eH,o.max=e$,o.min=eL,o.mod=eD,o.mul=eM,o.pow=eW,o.random=eK,o.round=eJ,o.sign=eF,o.sin=eq,o.sinh=eB,o.sqrt=ez,o.sub=eV,o.sum=eG,o.tan=eX,o.tanh=eZ,o.trunc=eY,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return o.config(t),o}(T);S=new eQ(S),x=new eQ(x);var e0=eQ;/*! Bundled license information:
18
19decimal.js/decimal.mjs:
20  (*!
21   *  decimal.js v10.4.3
22   *  An arbitrary-precision Decimal type for JavaScript.
23   *  https://github.com/MikeMcl/decimal.js
24   *  Copyright (c) 2022 Michael Mclaughlin <[email protected]>
25   *  MIT Licence
26   *)
27*/},41819:function(e,t){"use strict";/*!
28 * cookie
29 * Copyright(c) 2012-2014 Roman Shtylman
30 * Copyright(c) 2015 Douglas Christopher Wilson
31 * MIT Licensed
32 */t.Q=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},n=(t||{}).decode||i,o=0;o<e.length;){var a=e.indexOf("=",o);if(-1===a)break;var s=e.indexOf(";",o);if(-1===s)s=e.length;else if(s<a){o=e.lastIndexOf(";",a-1)+1;continue}var c=e.slice(o,a).trim();if(void 0===r[c]){var l=e.slice(a+1,s).trim();
3234===l.charCodeAt(0)&&(l=l.slice(1,-1)),r[c]=function(e,t){try{return t(e)}catch(t){return e}}(l,n)}o=s+1}return r},t.q=function(e,t,i){var a=i||{},s=a.encode||o;if("function"!=typeof s)throw TypeError("option encode is invalid");if(!n.test(e))throw TypeError("argument name is invalid");var c=s(t);if(c&&!n.test(c))throw TypeError("argument val is invalid");var l=e+"="+c;if(null!=a.maxAge){var u=a.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(a.domain){if(!n.test(a.domain))throw TypeError("option domain is invalid");l+="; Domain="+a.domain}if(a.path){if(!n.test(a.path))throw TypeError("option path is invalid");l+="; Path="+a.path}if(a.expires){var d=a.expires;if("[object Date]"!==r.call(d)&&!(d instanceof Date)||isNaN(d.valueOf()))throw TypeError("option expires is invalid");l+="; Expires="+d.toUTCString()}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.partitioned&&(l+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;
32default:throw TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var r=Object.prototype.toString,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function i(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function o(e){return encodeURIComponent(e)}},71600:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraftMode",{enumerable:!0,get:function(){return o}});let n=r(9313),i=r(45968);class o{get isEnabled(){return this._provider.isEnabled}enable(){let e=n.staticGenerationAsyncStorage.getStore();return e&&(0,i.trackDynamicDataAccessed)(e,"draftMode().enable()"),this._provider.enable()}disable(){let e=n.staticGenerationAsyncStorage.getStore();return e&&(0,i.trackDynamicDataAccessed)(e,"draftMode().disable()"),this._provider.disable()}constructor(e){this._provider=e}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},22440:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{cookies:function(){return h},draftMode:function(){return p},headers:function(){return d}});let n=r(3115),i=r(70365),o=r(66153),a=r(14649),s=r(71600),c=r(45968),l=r(9313),u=r(56011);function d(){let e="headers",t=l.staticGenerationAsyncStorage.getStore();if(t){if(t.forceStatic)return i.HeadersAdapter.seal(new Headers({}));(0,c.trackDynamicDataAccessed)(t,e)}return(0,u.getExpectedRequestStore)(e).headers}function h(){let e="cookies",t=l.staticGenerationAsyncStorage.getStore();if(t){if(t.forceStatic)return n.RequestCookiesAdapter.seal(new o.RequestCookies(new Headers({})));(0,c.trackDynamicDataAccessed)(t,e)}let r=(0,u.getExpectedRequestStore)(e),i=a.actionAsyncStorage.getStore();return(null==i?void 0:i.isAction)||(null==i?void 0:i.isAppRoute)?r.mutableCookies:r.cookies}function p(){let e=(0,u.getExpectedRequestStore)("draftMode");return new s.DraftMode(e.draftMode)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40169:function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o={};function a(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function s(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function c(e){var t,r;if(!e)return;let[[n,i],...o]=s(e),{domain:a,expires:c,httponly:d,maxage:h,path:p,samesite:f,secure:m,partitioned:w,priority:y}=Object.fromEntries(o.map(([e,t])=>[e.toLowerCase(),t]));return function(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}({name:n,value:decodeURIComponent(i),domain:a,...c&&{expires:new Date(c)},...d&&{httpOnly:!0},..."string"==typeof h&&{maxAge:Number(h)},path:p,...f&&{sameSite:l.includes(t=(t=f).toLowerCase())?t:void 0},...m&&{secure:!0},...y&&{priority:u.includes(r=(r=y).toLowerCase())?r:void 0},...w&&{partitioned:!0}})}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(o,{RequestCookies:()=>d,ResponseCookies:()=>h,parseCookie:()=>s,parseSetCookie:()=>c,stringifyCookie:()=>a}),e.exports=((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))i.call(e,c)||c===a||t(e,c,{get:()=>o[c],enumerable:!(s=r(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),o);var l=["strict","lax","none"],u=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of s(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}
32has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>a(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>a(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},h=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}(i)){let t=c(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=a(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r,n]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:n,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(a).join("; ")}}},78431:function(e,t,r){var n;(()=>{var i={226:function(i,o){!function(a,s){"use strict";var c="function",l="undefined",u="object",d="string",h="major",p="model",f="name",m="type",w="vendor",y="version",g="architecture",b="console",v="mobile",_="tablet",k="smarttv",A="wearable",E="embedded",S="Amazon",x="Apple",T="ASUS",P="BlackBerry",C="Browser",R="Chrome",O="Firefox",U="Google",I="Huawei",N="Microsoft",H="Motorola",j="Opera",$="Samsung",L="Sharp",D="Sony",M="Xiaomi",W="Zebra",K="Facebook",J="Chromium OS",F="Mac OS",q=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},B=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},z=function(e,t){return typeof e===d&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===d)return e=e.replace(/^\s\s*/,""),typeof t===l?e:e.substring(0,350)},X=function(e,t){for(var r,n,i,o,a,l,d=0;d<t.length&&!a;){var h=t[d],p=t[d+1];for(r=n=0;r<h.length&&!a&&h[r];)if(a=h[r++].exec(e))for(i=0;i<p.length;i++)l=a[++n],typeof(o=p[i])===u&&o.length>0?2===o.length?typeof o[1]==c?this[o[0]]=o[1].call(this,l):this[o[0]]=o[1]:3===o.length?typeof o[1]!==c||o[1].exec&&o[1].test?this[o[0]]=l?l.replace(o[
321],o[2]):void 0:this[o[0]]=l?o[1].call(this,l,o[2]):void 0:4===o.length&&(this[o[0]]=l?o[3].call(this,l.replace(o[1],o[2])):void 0):this[o]=l||s;d+=2}},Z=function(e,t){for(var r in t)if(typeof t[r]===u&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(z(t[r][n],e))return"?"===r?s:r}else if(z(t[r],e))return"?"===r?s:r;return e},Y={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,j+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[f,j]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[y,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+C],y],[/\bfocus\/([\w\.]+)/i],[y,[f,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,j+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,j+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[y,[f,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+C],y],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[f,y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,K],y],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,R+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,Z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,y],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,V]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;
32|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[w,$],[m,_]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[w,$],[m,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[w,x],[m,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[w,x],[m,_]],[/(macintosh);/i],[p,[w,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[w,L],[m,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[w,I],[m,_]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[w,I],[m,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[w,M],[m,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[w,M],[m,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[w,"OPPO"],[m,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[w,"Vivo"],[m,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[p,[w,"Realme"],[m,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[w,H],[m,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[w,H],[m,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[w,"LG"],[m,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[w,"LG"],[m,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[w,"Lenovo"],[m,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[w,"Nokia"],[m,v]],[/(pixel c)\b/i],[p,[w,U],[m,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[w,U],[m,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[w,D],[m,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[w,D],[m,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[w,"OnePlus"],[m,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[w,S],[m,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[w,S],[m,v]],[/(playbook);[-\w\),; ]+(rim)/i],[p,w,[m,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[w,P],[m,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[w,T],[m,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[w,T],[m,v]],[/(nexus 9)/i],[p,[w,"HTC"],[m,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[p,/_/g," "],[m,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[w,"Acer"],[m,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[w,"Meizu"],[m,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,p,[m,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,p,[m,_]],[/(surface duo)/i],[p,[w,N],[m,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[w,"Fairphone"],[m,v]],[/(u304aa)/i],[p,[w,"AT&T"],[m,v]],[/\bsie-(\w*)/i],[p,[w,"Siemens"],[m,v]],[/\b(rct\w+) b/i],[p,[w,"RCA"],[m,_]],[/\b(venue[\d ]{2,7}) b/i],[p,[w,"Dell"],[m,_]],[/\b(q(?:mv|ta)\w+) b/i],[p,[w,"Verizon"],[m,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[w,"Barnes & Noble"],[m,_]],[/\b(tm\d{3}\w+) b/i],[p,[w,"NuVision"],[m,_]],[/\b(k88) b/i],[p,[w,"ZTE"],[m,_]],[/\b(nx\d{3}j) b/i],[p,[w,"ZTE"],[m,v]],[/\b(gen\d{3}) b.+49h/i],[p,[w,"Swiss"],[m,v]],[/\b(zur\d{3}) b/i],[p,[w,"Swiss"],[m,_]],[/\b((zeki)?tb.*\b) b/i],[p,[w,"Zeki"],[m,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],p,[m,_]],[/\b(ns-?\w{0,9}) b/i],[p,[w,"Insignia"],[m,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[w,"NextBook"],[m,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],p,[m,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],p,[m,v]],[/\b(ph-1) /i],[p,[w,"Essential"],[m,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[w,"Envizen"],[m,_]],[/\b(trio[-\w\. ]+) b/i],[p,[w,"MachSpeed"],[m,_]],[/\btu_(1491) b/i],[p,[w,"Rotor"],[m,_]],[/(shield[\w ]+) b/i],[p,[w,"Nvidia"],[m,_]],[/(sprint) (\w+)/i],[w,p,[m,v]],[/(kin\.[onetw]{3}
vendor: 4,352 bytes, line 32
32)/i],[[p,/\./g," "],[w,N],[m,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[w,W],[m,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[w,W],[m,v]],[/smart-tv.+(samsung)/i],[w,[m,k]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[w,$],[m,k]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,"LG"],[m,k]],[/(apple) ?tv/i],[w,[p,x+" TV"],[m,k]],[/crkey/i],[[p,R+"cast"],[w,U],[m,k]],[/droid.+aft(\w)( bui|\))/i],[p,[w,S],[m,k]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[w,L],[m,k]],[/(bravia[\w ]+)( bui|\))/i],[p,[w,D],[m,k]],[/(mitv-\w{5}) bui/i],[p,[w,M],[m,k]],[/Hbbtv.*(technisat) (.*);/i],[w,p,[m,k]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[w,G],[p,G],[m,k]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,k]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,p,[m,b]],[/droid.+; (shield) bui/i],[p,[w,"Nvidia"],[m,b]],[/(playstation [345portablevi]+)/i],[p,[w,D],[m,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[w,N],[m,b]],[/((pebble))app/i],[w,p,[m,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[w,x],[m,A]],[/droid.+; (glass) \d/i],[p,[w,U],[m,A]],[/droid.+; (wt63?0{2,3})\)/i],[p,[w,W],[m,A]],[/(quest( 2| pro)?)/i],[p,[w,K],[m,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[m,E]],[/(aeobc)\b/i],[p,[w,S],[m,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[p,[m,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[m,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,v]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[f,[y,Z,Y]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,"Windows"],[y,Z,Y]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,F],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,y],[/\(bb(10);/i],[y,[f,P]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,J],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},ee=function(e,t){if(typeof e===u&&(t=e,e=s),!(this instanceof ee))return new ee(e,t).getResult();var r=typeof a!==l&&a.navigator?a.navigator:s,n=e||(r&&r.userAgent?r.userAgent:""),i=r&&r.userAgentData?r.userAgentData:s,o=t?q(Q,t):Q,b=r&&r.userAgent==n;return this.getBrowser=function(){var e,t={};
32return t[f]=s,t[y]=s,X.call(t,n,o.browser),t[h]=typeof(e=t[y])===d?e.replace(/[^\d\.]/g,"").split(".")[0]:s,b&&r&&r.brave&&typeof r.brave.isBrave==c&&(t[f]="Brave"),t},this.getCPU=function(){var e={};return e[g]=s,X.call(e,n,o.cpu),e},this.getDevice=function(){var e={};return e[w]=s,e[p]=s,e[m]=s,X.call(e,n,o.device),b&&!e[m]&&i&&i.mobile&&(e[m]=v),b&&"Macintosh"==e[p]&&r&&typeof r.standalone!==l&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[p]="iPad",e[m]=_),e},this.getEngine=function(){var e={};return e[f]=s,e[y]=s,X.call(e,n,o.engine),e},this.getOS=function(){var e={};return e[f]=s,e[y]=s,X.call(e,n,o.os),b&&!e[f]&&i&&"Unknown"!=i.platform&&(e[f]=i.platform.replace(/chrome os/i,J).replace(/macos/i,F)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===d&&e.length>350?G(e,350):e,this},this.setUA(n),this};ee.VERSION="1.0.35",ee.BROWSER=B([f,y,h]),ee.CPU=B([g]),ee.DEVICE=B([p,w,m,b,v,k,_,A,E]),ee.ENGINE=ee.OS=B([f,y]),typeof o!==l?(i.exports&&(o=i.exports=ee),o.UAParser=ee):r.amdO?void 0!==(n=(function(){return ee}).call(t,r,t,e))&&(e.exports=n):typeof a!==l&&(a.UAParser=ee);var et=typeof a!==l&&(a.jQuery||a.Zepto);if(et&&!et.ua){var er=new ee;et.ua=er.getResult(),et.ua.get=function(){return er.getUA()},et.ua.set=function(e){er.setUA(e);var t=er.getResult();for(var r in t)et.ua[r]=t[r]}}}("object"==typeof window?window:this)}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},n=!0;try{i[e].call(r.exports,r,r.exports,a),n=!1}finally{n&&delete o[e]}return r.exports}a.ab="//";var s=a(226);e.exports=s})()},24732:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return i}});class r extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
33  
34  export function middleware(request, event) {
35    return NextResponse.redirect('/new-location')
36  }
37  
38  Read more: https://nextjs.org/docs/messages/middleware-new-signature
39  `)}}class n extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`.
40  Read more: https://nextjs.org/docs/messages/middleware-request-page
41  `)}}class i extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
42  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
43  `)}}},13061:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ImageResponse:function(){return n.ImageResponse},NextRequest:function(){return i.NextRequest},NextResponse:function(){return o.NextResponse},URLPattern:function(){return s.URLPattern},userAgent:function(){return a.userAgent},userAgentFromString:function(){return a.userAgentFromString}});let n=r(36971),i=r(53744),o=r(55818),a=r(1989),s=r(802)},96755:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextURL",{enumerable:!0,get:function(){return u}});let n=r(70301),i=r(22077),o=r(51104),a=r(5754),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(e,t){return new URL(String(e).replace(s,"localhost"),t&&String(t).replace(s,"localhost"))}let l=Symbol("NextURLInternal");class u{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[l]={url:c(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,i,s;let c=(0,a.getNextPathnameInfo)(this[l].url.pathname,{nextConfig:this[l].options.nextConfig,parseData:!0,i18nProvider:this[l].options.i18nProvider}),u=(0,o.getHostname)(this[l].url,this[l].options.headers);this[l].domainLocale=this[l].options.i18nProvider?this[l].options.i18nProvider.detectDomainLocale(u):(0,n.detectDomainLocale)(null==(t=this[l].options.nextConfig)?void 0:null==(e=t.i18n)?void 0:e.domains,u);let d=(null==(r=this[l].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[l].options.nextConfig)?void 0:null==(i=s.i18n)?void 0:i.defaultLocale);this[l].url.pathname=c.pathname,this[l].defaultLocale=d,this[l].basePath=c.basePath??"",this[l].buildId=c.buildId,this[l].locale=c.locale??d,this[l].trailingSlash=c.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[l].basePath,buildId:this[l].buildId,defaultLocale:this[l].options.forceLocale?void 0:this[l].defaultLocale,locale:this[l].locale,pathname:this[l].url.pathname,trailingSlash:this[l].trailingSlash})}formatSearch(){return this[l].url.search}get buildId(){return this[l].buildId}set buildId(e){this[l].buildId=e}get locale(){return this[l].locale??""}set locale(e){var t,r;if(!this[l].locale||!(null==(r=this[l].options.nextConfig)?void 0:null==(t=r.i18n)?void 0:t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[l].locale=e}get defaultLocale(){return this[l].defaultLocale}get domainLocale(){return this[l].domainLocale}get searchParams(){return this[l].url.searchParams}get host(){return this[l].url.host}set host(e){this[l].url.host=e}get hostname(){return this[l].url.hostname}set hostname(e){this[l].url.hostname=e}get port(){return this[l].url.port}set port(e){this[l].url.port=e}get protocol(){return this[l].url.protocol}set protocol(e){this[l].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[l].url=c(e),this.analyze()}get origin(){return this[l].url.origin}get pathname(){return this[l].url.pathname}set pathname(e){this[l].url.pathname=e}get hash(){return this[l].url.hash}set hash(e){this[l].url.hash=e}get search(){return this[l].url.search}set search(e){this[l].url.search=e}get password(){return this[l].url.password}set password(e){this[l].url.password=e}get username(){return this[l].url.username}set username(e){this[l].url.username=e}get basePath(){return this[l].basePath}set basePath(e){this[l].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new u(String(this),this[l].options)}}},70365:function(e,t,r){"use strict";
43Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return i}});let n=r(84396);class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,i);let o=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==a)return n.ReflectAdapter.get(t,a,i)},set(t,r,i,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,i,o);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);return n.ReflectAdapter.set(t,s??r,i,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},3115:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return a},RequestCookiesAdapter:function(){return s},appendMutableCookies:function(){return u},getModifiedCookieValues:function(){return l}});let n=r(66153),i=r(84396),o=r(9313);class a extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options")}static callable(){throw new a}}class s{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return a.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}}let c=Symbol.for("next.mutated.cookies");function l(e){let t=e[c];return t&&Array.isArray(t)&&0!==t.length?t:[]}function u(e,t){let r=l(t);if(0===r.length)return!1;let i=new n.ResponseCookies(e),o=i.getAll();for(let e of r)i.set(e);for(let e of o)i.set(e);return!0}class d{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let a=[],s=new Set,l=()=>{let e=o.staticGenerationAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=!0),a=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of a){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}};return new Proxy(r,{get(e,t,r){switch(t){case c:return a;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{e.delete(...t)}finally{l()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t)}finally{l()}};default:return i.ReflectAdapter.get(e,t,r)}}})}}},66153:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies}});let n=r(40169)},36971:function(e,t){"use strict";function r(){throw Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}
43Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageResponse",{enumerable:!0,get:function(){return r}})},53744:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERNALS:function(){return s},NextRequest:function(){return c}});let n=r(96755),i=r(11552),o=r(24732),a=r(66153),s=Symbol("internal request");class c extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),e instanceof Request?super(e,t):super(r,t);let o=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[s]={cookies:new a.RequestCookies(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:o,url:o.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[s].cookies}get geo(){return this[s].geo}get ip(){return this[s].ip}get nextUrl(){return this[s].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[s].url}}},55818:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextResponse",{enumerable:!0,get:function(){return l}});let n=r(96755),i=r(11552),o=r(66153),a=Symbol("internal response"),s=new Set([301,302,303,307,308]);function c(e,t){var r;if(null==e?void 0:null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class l extends Response{constructor(e,t={}){super(e,t),this[a]={cookies:new o.ResponseCookies(this.headers),url:t.url?new n.NextURL(t.url,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[a].cookies}static json(e,t){let r=Response.json(e,t);return new l(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!s.has(r))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let n="object"==typeof t?t:{},o=new Headers(null==n?void 0:n.headers);return o.set("Location",(0,i.validateURL)(e)),new l(null,{...n,headers:o,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,i.validateURL)(e)),c(t,r),new l(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),c(e,t),new l(null,{...e,headers:t})}}},802:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"URLPattern",{enumerable:!0,get:function(){return r}});let r="undefined"==typeof URLPattern?void 0:URLPattern},1989:function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isBot:function(){return o},userAgent:function(){return s},userAgentFromString:function(){return a}});let i=(n=r(78431))&&n.__esModule?n:{default:n};function o(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|Skype
43UriPreview|ia_archiver/i.test(e)}function a(e){return{...(0,i.default)(e),isBot:void 0!==e&&o(e)}}function s({headers:e}){return a(e.get("user-agent")||void 0)}},11552:function(e,t){"use strict";function r(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function n(e){var t,r,n,i,o,a=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}function i(e){let t={},r=[];if(e)for(let[i,o]of e.entries())"set-cookie"===i.toLowerCase()?(r.push(...n(o)),t[i]=1===r.length?r[0]:r):t[i]=o;return t}function o(e){try{return String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fromNodeOutgoingHttpHeaders:function(){return r},splitCookiesString:function(){return n},toNodeOutgoingHttpHeaders:function(){return i},validateURL:function(){return o}})},51104:function(e,t){"use strict";function r(e,t){let r;if((null==t?void 0:t.host)&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getHostname",{enumerable:!0,get:function(){return r}})},70301:function(e,t){"use strict";function r(e,t,r){if(e)for(let o of(r&&(r=r.toLowerCase()),e)){var n,i;if(t===(null==(n=o.domain)?void 0:n.split(":",1)[0].toLowerCase())||r===o.defaultLocale.toLowerCase()||(null==(i=o.locales)?void 0:i.some(e=>e.toLowerCase()===r)))return o}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}})},65070:function(e,t){"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},92568:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return o}});let n=r(62357),i=r(9911);function o(e,t,r,o){if(!t||t===r)return e;let a=e.toLowerCase();return!o&&((0,i.pathHasPrefix)(a,"/api")||(0,i.pathHasPrefix)(a,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},49662:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return i}});let n=r(55467);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:o}=(0,n.parsePath)(e);return""+r+t+i+o}},22077:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});let n=r(44497),i=r(62357),o=r(49662),a=r(92568);function s(e){let t=(0,a.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,o.addPathSuffix)((0,i.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,i.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,o.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},5754:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return a}});let n=r(65070),i=r(50501),o=r(9911);function a(e,t){var r,a;let{basePath:s,i18n:c,trailingSlash:l}=null!=(r=t.nextConfig)?r:{},u={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):l};
43s&&(0,o.pathHasPrefix)(u.pathname,s)&&(u.pathname=(0,i.removePathPrefix)(u.pathname,s),u.basePath=s);let d=u.pathname;if(u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){let e=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),r=e[0];u.buildId=r,d="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(u.pathname=d)}if(c){let e=t.i18nProvider?t.i18nProvider.analyze(u.pathname):(0,n.normalizeLocalePath)(u.pathname,c.locales);u.locale=e.detectedLocale,u.pathname=null!=(a=e.pathname)?a:u.pathname,!e.detectedLocale&&u.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(d):(0,n.normalizeLocalePath)(d,c.locales)).detectedLocale&&(u.locale=e.detectedLocale)}return u}},50501:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return i}});let n=r(9911);function i(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},54578:function(e,t,r){"use strict";function n(e){return{id:"kakao",name:"Kakao",type:"oauth",authorization:"https://kauth.kakao.com/oauth/authorize?scope",token:"https://kauth.kakao.com/oauth/token",userinfo:"https://kapi.kakao.com/v2/user/me",client:{token_endpoint_auth_method:"client_secret_post"},profile:e=>({id:e.id.toString(),name:e.kakao_account?.profile?.nickname,email:e.kakao_account?.email,image:e.kakao_account?.profile?.profile_image_url}),options:e}}r.d(t,{Z:function(){return n}})},10306:function(e,t,r){"use strict";function n(e){return{createUser:({id:t,...r})=>e.user.create({data:r}),getUser:t=>e.user.findUnique({where:{id:t}}),getUserByEmail:t=>e.user.findUnique({where:{email:t}}),async getUserByAccount(t){let r=await e.account.findUnique({where:{provider_providerAccountId:t},select:{user:!0}});return r?.user??null},updateUser:({id:t,...r})=>e.user.update({where:{id:t},data:r}),deleteUser:t=>e.user.delete({where:{id:t}}),linkAccount:t=>e.account.create({data:t}),unlinkAccount:t=>e.account.delete({where:{provider_providerAccountId:t}}),async getSessionAndUser(t){let r=await e.session.findUnique({where:{sessionToken:t},include:{user:!0}});if(!r)return null;let{user:n,...i}=r;return{user:n,session:i}},createSession:t=>e.session.create({data:t}),updateSession:t=>e.session.update({where:{sessionToken:t.sessionToken},data:t}),deleteSession:t=>e.session.delete({where:{sessionToken:t}}),async createVerificationToken(t){let r=await e.verificationToken.create({data:t});return r.id&&delete r.id,r},async useVerificationToken(t){try{let r=await e.verificationToken.delete({where:{identifier_token:t}});return r.id&&delete r.id,r}catch(e){if("P2025"===e.code)return null;throw e}},getAccount:async(t,r)=>e.account.findFirst({where:{providerAccountId:t,provider:r}}),createAuthenticator:async t=>e.authenticator.create({data:t}).then(i),async getAuthenticator(t){let r=await e.authenticator.findUnique({where:{credentialID:t}});return r?i(r):null},listAuthenticatorsByUserId:async t=>(await e.authenticator.findMany({where:{userId:t}})).map(i),updateAuthenticatorCounter:async(t,r)=>e.authenticator.update({where:{credentialID:t},data:{counter:r}}).then(i)}}function i(e){let{transports:t,id:r,user:n,...i}=e;return{...i,transports:t||void 0}}r.d(t,{N:function(){return n}})},4477:function(e,t,r){"use strict";let n,i,o,a;r.d(t,{Z:function(){return i$}});var s=function(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},c=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};function l(e){let t=e?"__Secure-":"";return{sessionToken:{name:`${t}authjs.session-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},callbackUrl:{name:`${t}authjs.callback-url`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},csrfToken:{name:`${e?"__Host-":""}authjs.csrf-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},pkceCodeVerifier:{name:`${t}authjs.pkce.code_verifier`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},state:{name:`${t}authjs.state`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},nonce:{name:`${t}authjs.nonce`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},webauthnChallenge:{name:`${t}authjs.challenge`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}}}}class u{constructor(e,t,r){if(tM.add(this),tW.set(this,{}),tK.set(this,void 0),tJ.set(this,void 0),s(this,tJ,r,"f"),s(this,tK,e,"f"),!t)return;let{name:n}=e;for(let[e,r]of Object.entries(t))e.startsWith(n)&&r&&(c(this,tW,"f")[e]=r)}get value(){return Object.keys(c(this,tW,"f")).sort((e,t)=>
43parseInt(e.split(".").pop()||"0")-parseInt(t.split(".").pop()||"0")).map(e=>c(this,tW,"f")[e]).join("")}chunk(e,t){let r=c(this,tM,"m",tq).call(this);for(let n of c(this,tM,"m",tF).call(this,{name:c(this,tK,"f").name,value:e,options:{...c(this,tK,"f").options,...t}}))r[n.name]=n;return Object.values(r)}clean(){return Object.values(c(this,tM,"m",tq).call(this))}}tW=new WeakMap,tK=new WeakMap,tJ=new WeakMap,tM=new WeakSet,tF=function(e){let t=Math.ceil(e.value.length/3936);if(1===t)return c(this,tW,"f")[e.name]=e.value,[e];let r=[];for(let n=0;n<t;n++){let t=`${e.name}.${n}`,i=e.value.substr(3936*n,3936);r.push({...e,name:t,value:i}),c(this,tW,"f")[t]=i}return c(this,tJ,"f").debug("CHUNKING_SESSION_COOKIE",{message:"Session cookie exceeds allowed 4096 bytes.",emptyCookieSize:160,valueSize:e.value.length,chunks:r.map(e=>e.value.length+160)}),r},tq=function(){let e={};for(let t in c(this,tW,"f"))delete c(this,tW,"f")?.[t],e[t]={name:t,value:"",options:{...c(this,tK,"f").options,maxAge:0}};return e};var d=r(18306);let h=!1;function p(e,t){try{return/^https?:/.test(new URL(e,e.startsWith("/")?t:void 0).protocol)}catch{return!1}}let f=!1,m=!1,w=!1,y=["createVerificationToken","useVerificationToken","getUserByEmail"],g=["createUser","getUser","getUserByEmail","getUserByAccount","updateUser","linkAccount","createSession","getSessionAndUser","updateSession","deleteSession"],b=["createUser","getUser","linkAccount","getAccount","getAuthenticator","createAuthenticator","listAuthenticatorsByUserId","updateAuthenticatorCounter"],v=()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw Error("unable to locate global object")};var _=async(e,t,r,n,i)=>{let{crypto:{subtle:o}}=v();return new Uint8Array(await o.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:n},await o.importKey("raw",t,"HKDF",!1,["deriveBits"]),i<<3))};function k(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}async function A(e,t,r,n,i){return _(function(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}(e),function(e){let t=k(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}(t),k(r,"salt"),function(e){let t=k(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}(n),function(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}(i,e))}var E=crypto;let S=e=>e instanceof CryptoKey,x=async(e,t)=>{let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await E.subtle.digest(r,t))},T=new TextEncoder,P=new TextDecoder;function C(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function R(e,t,r){if(t<0||t>=4294967296)throw RangeError(`value must be >= 0 and <= ${4294967296-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function O(e){let t=new Uint8Array(8);return R(t,Math.floor(e/4294967296),0),R(t,e%4294967296,4),t}function U(e){let t=new Uint8Array(4);return R(t,e),t}function I(e){return C(U(e.length),e)}async function N(e,t,r){let n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t<n;t++){let n=new Uint8Array(4+e.length+r.length);n.set(U(t+1)),n.set(e,4),n.set(r,4+e.length),i.set(await x("sha256",n),32*t)}return i.slice(0,t>>3)}let H=e=>{let t=e;"string"==typeof t&&(t=T.encode(t));let r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))},j=e=>H(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),$=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r},L=e=>{let t=e;t instanceof Uint8Array&&(t=P.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return $(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}};
43class D extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}D.code="ERR_JOSE_GENERIC";class M extends D{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=n,this.payload=t}}M.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class W extends D{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=n,this.payload=t}}W.code="ERR_JWT_EXPIRED";class K extends D{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}K.code="ERR_JOSE_ALG_NOT_ALLOWED";class J extends D{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}J.code="ERR_JOSE_NOT_SUPPORTED";class F extends D{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}}F.code="ERR_JWE_DECRYPTION_FAILED";class q extends D{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}q.code="ERR_JWE_INVALID";class B extends D{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}B.code="ERR_JWS_INVALID";class z extends D{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}z.code="ERR_JWT_INVALID";class V extends D{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}V.code="ERR_JWK_INVALID";class G extends D{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}G.code="ERR_JWKS_INVALID";class X extends D{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}}X.code="ERR_JWKS_NO_MATCHING_KEY";class Z extends D{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Z.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Y extends D{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}}Y.code="ERR_JWKS_TIMEOUT";class Q extends D{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function ee(e){if(!("object"==typeof e&&null!==e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}Q.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";let et=(e,t)=>{if("string"!=typeof e||!e)throw new V(`${t} missing or invalid`)};async function er(e,t){let r;if(!ee(e))throw TypeError("JWK must be an object");if(t??(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(e.kty){case"EC":et(e.crv,'"crv" (Curve) Parameter'),et(e.x,'"x" (X Coordinate) Parameter'),et(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":et(e.crv,'"crv" (Subtype of Key Pair) Parameter'),et(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":et(e.e,'"e" (Exponent) Parameter'),et(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":et(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new J('"kty" (Key Type) Parameter missing or unsupported')}let n=T.encode(JSON.stringify(r));return j(await x(t,n))}let en=Symbol();var ei=E.getRandomValues.bind(E);function eo(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new J(`Unsupported JWE Algorithm: ${e}`)}}var ea=e=>ei(new Uint8Array(eo(e)>>3)),es=(e,t)=>{if(t.length<<3!==eo(e))throw new q("Invalid Initialization Vector length")},ec=(e,t)=>{let r=e.byteLength<<3;if(r!==t)throw new q(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function el(e,t="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function eu(e,t){return e.name===t}function ed(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!eu(e.algorithm,"AES-GCM"))throw el("AES-GCM");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw el(r,"algorithm.length");break}
43case"A128KW":case"A192KW":case"A256KW":{if(!eu(e.algorithm,"AES-KW"))throw el("AES-KW");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw el(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw el("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!eu(e.algorithm,"PBKDF2"))throw el("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!eu(e.algorithm,"RSA-OAEP"))throw el("RSA-OAEP");let r=parseInt(t.slice(9),10)||1;if(parseInt(e.algorithm.hash.name.slice(4),10)!==r)throw el(`SHA-${r}`,"algorithm.hash");break}default:throw TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}(e,r)}function eh(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var ep=(e,...t)=>eh("Key must be ",e,...t);function ef(e,t,...r){return eh(`Key for the ${e} algorithm must be `,t,...r)}var em=e=>!!S(e)||e?.[Symbol.toStringTag]==="KeyObject";let ew=["CryptoKey"];async function ey(e,t,r,n,i){if(!(r instanceof Uint8Array))throw TypeError(ep(r,"Uint8Array"));let o=parseInt(e.slice(1,4),10),a=await E.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await E.subtle.importKey("raw",r.subarray(0,o>>3),{hash:`SHA-${o<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await E.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),l=C(i,n,c,O(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await E.subtle.sign("HMAC",s,l)).slice(0,o>>3)),iv:n}}async function eg(e,t,r,n,i){let o;r instanceof Uint8Array?o=await E.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(ed(r,e,"encrypt"),o=r);let a=new Uint8Array(await E.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s,iv:n}}let eb=async(e,t,r,n,i)=>{if(!S(r)&&!(r instanceof Uint8Array))throw TypeError(ep(r,...ew,"Uint8Array"));switch(n?es(e,n):n=ea(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&ec(r,parseInt(e.slice(-3),10)),ey(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&ec(r,parseInt(e.slice(1,4),10)),eg(e,t,r,n,i);default:throw new J("Unsupported JWE Content Encryption Algorithm")}};var ev=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function e_(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function ek(e,t,r){if(S(e))return ed(e,t,r),e;if(e instanceof Uint8Array)return E.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw TypeError(ep(e,...ew,"Uint8Array"))}let eA=async(e,t,r)=>{let n=await ek(t,e,"wrapKey");e_(n,e);let i=await E.subtle.importKey("raw",r,...ev);return new Uint8Array(await E.subtle.wrapKey("raw",i,n,"AES-KW"))},eE=async(e,t,r)=>{let n=await ek(t,e,"unwrapKey");e_(n,e);let i=await E.subtle.unwrapKey("raw",r,n,"AES-KW",...ev);return new Uint8Array(await E.subtle.exportKey("raw",i))};async function eS(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){let a;if(!S(e))throw TypeError(ep(e,...ew));if(ed(e,"ECDH"),!S(t))throw TypeError(ep(t,...ew));ed(t,"ECDH","deriveBits");let s=C(I(T.encode(r)),I(i),I(o),U(n));return a="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,N(new Uint8Array(await E.subtle.deriveBits({name:e.algorithm.name,public:e},t,a)),n,s)}async function ex(e){if(!S(e))throw TypeError(ep(e,...ew));return E.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function eT(e){if(!S(e))throw TypeError(ep(e,...ew));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function eP(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new q("PBES2 Salt Input must be 8 or more octets")}(e);let i=C(T.encode(t),new Uint8Array([0]),e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s=await function(e,t){if(e instanceof Uint8Array)return E.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(S(e))return ed(e,t,"deriveBits","deriveKey"),e;throw TypeError(ep(e,...ew,"Uint8Array"))}(n,t);if(s.usages.includes("deriveBits"))return new Uint8Array(await E.subtle.deriveBits(a,s,o));if(s.usages.includes("deriveKey"))return E.subtle.deriveKey(a,s,{length:o,name:"AES-KW"},!1,["wrapKey","unwrapKey"]);throw TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}let eC=async(e,t,r,n=2048,i=ei(new Uint8Array(16)))=>{let o=await eP(i,e,n,t);return{encryptedKey:await eA(e.slice(-6),o,r),p2c:n,p2s:j(i)}},eR=async(e,t,r,n,i)=>{let o=await eP(i,e,n,t);return eE(e.slice(-6),o,r)};function eO(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new J(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var eU=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e}
43 requires key modulusLength to be 2048 bits or larger`)}};let eI=async(e,t,r)=>{if(!S(t))throw TypeError(ep(t,...ew));if(ed(t,e,"encrypt","wrapKey"),eU(e,t),t.usages.includes("encrypt"))return new Uint8Array(await E.subtle.encrypt(eO(e),t,r));if(t.usages.includes("wrapKey")){let n=await E.subtle.importKey("raw",r,...ev);return new Uint8Array(await E.subtle.wrapKey("raw",n,t,eO(e)))}throw TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},eN=async(e,t,r)=>{if(!S(t))throw TypeError(ep(t,...ew));if(ed(t,e,"decrypt","unwrapKey"),eU(e,t),t.usages.includes("decrypt"))return new Uint8Array(await E.subtle.decrypt(eO(e),t,r));if(t.usages.includes("unwrapKey")){let n=await E.subtle.unwrapKey("raw",r,t,eO(e),...ev);return new Uint8Array(await E.subtle.exportKey("raw",n))}throw TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function eH(e){return ee(e)&&"string"==typeof e.kty}let ej=async e=>{if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new J('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new J('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new J('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new J('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),n=[t,e.ext??!1,e.key_ops??r],i={...e};return delete i.alg,delete i.use,E.subtle.importKey("jwk",i,...n)},e$=e=>L(e),eL=e=>e?.[Symbol.toStringTag]==="KeyObject",eD=async(e,t,r,n,i=!1)=>{let o=e.get(t);if(o?.[n])return o[n];let a=await ej({...r,alg:n});return i&&Object.freeze(t),o?o[n]=a:e.set(t,{[n]:a}),a};var eM=(e,t)=>{if(eL(e)){let r=e.export({format:"jwk"});return(delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k)?e$(r.k):(i||(i=new WeakMap),eD(i,e,r,t))}return eH(e)?e.k?L(e.k):(i||(i=new WeakMap),eD(i,e,e,t,!0)):e},eW=(e,t)=>{if(eL(e)){let r=e.export({format:"jwk"});return r.k?e$(r.k):(n||(n=new WeakMap),eD(n,e,r,t))}return eH(e)?e.k?L(e.k):(n||(n=new WeakMap),eD(n,e,e,t,!0)):e};function eK(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new J(`Unsupported JWE Algorithm: ${e}`)}}var eJ=e=>ei(new Uint8Array(eK(e)>>3));let eF=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:j(e)};if(!S(e))throw TypeError(ep(e,...ew,"Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:n,use:i,...o}=await E.subtle.exportKey("jwk",e);return o};async function eq(e){return eF(e)}let eB=e=>e?.[Symbol.toStringTag],ez=(e,t,r)=>{if(void 0!==t.use&&"sig"!==t.use)throw TypeError("Invalid key for this operation, when present its use must be sig");if(void 0!==t.key_ops&&t.key_ops.includes?.(r)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},eV=(e,t,r,n)=>{if(!(t instanceof Uint8Array)){if(n&&eH(t)){if(eH(t)&&"oct"===t.kty&&"string"==typeof t.k&&ez(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!em(t))throw TypeError(ef(e,t,...ew,"Uint8Array",n?"JSON Web Key":null));if("secret"!==t.type)throw TypeError(`${eB(t)} instances for symmetric algorithms must be of type "secret"`)}},eG=(e,t,r,n)=>{if(n&&eH(t))switch(r){case"sign":if("oct"!==t.kty&&"string"==typeof t.d&&ez(e,t,r))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"verify":if("oct"!==t.kty&&void 0===t.d&&ez(e,t,r))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!em(t))throw TypeError(ef(e,t,...ew,n?"JSON Web Key":null));if("secret"===t.type)throw TypeError(`${eB(t)} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${eB(t)} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${eB(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${eB(t)} instances for asymmetric algorithm verifying must be of type "public"`);
43if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${eB(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function eX(e,t,r,n){t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?eV(t,r,n,e):eG(t,r,n,e)}var eZ=eX.bind(void 0,!1);eX.bind(void 0,!0);var eY=(e,t)=>{if(!(e instanceof Uint8Array))throw TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw TypeError("Second argument must be a buffer");if(e.length!==t.length)throw TypeError("Input buffers must have the same length");let r=e.length,n=0,i=-1;for(;++i<r;)n|=e[i]^t[i];return 0===n};async function eQ(e,t,r,n,i,o){let a,s;if(!(t instanceof Uint8Array))throw TypeError(ep(t,"Uint8Array"));let c=parseInt(e.slice(1,4),10),l=await E.subtle.importKey("raw",t.subarray(c>>3),"AES-CBC",!1,["decrypt"]),u=await E.subtle.importKey("raw",t.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),d=C(o,n,r,O(o.length<<3)),h=new Uint8Array((await E.subtle.sign("HMAC",u,d)).slice(0,c>>3));try{a=eY(i,h)}catch{}if(!a)throw new F;
43try{s=new Uint8Array(await E.subtle.decrypt({iv:n,name:"AES-CBC"},l,r))}catch{}if(!s)throw new F;return s}async function e0(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await E.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(ed(t,e,"decrypt"),a=t);try{return new Uint8Array(await E.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,C(r,i)))}catch{throw new F}}let e1=async(e,t,r,n,i,o)=>{if(!S(t)&&!(t instanceof Uint8Array))throw TypeError(ep(t,...ew,"Uint8Array"));if(!n)throw new q("JWE Initialization Vector missing");if(!i)throw new q("JWE Authentication Tag missing");switch(es(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&ec(t,parseInt(e.slice(-3),10)),eQ(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&ec(t,parseInt(e.slice(1,4),10)),e0(e,t,r,n,i,o);default:throw new J("Unsupported JWE Content Encryption Algorithm")}};async function e2(e,t,r,n){let i=e.slice(0,7),o=await eb(i,r,t,n,new Uint8Array(0));return{encryptedKey:o.ciphertext,iv:j(o.iv),tag:j(o.tag)}}async function e5(e,t,r,n,i){return e1(e.slice(0,7),t,r,n,i,new Uint8Array(0))}async function e4(e,t,r,n,i={}){let o,a,s;switch(eZ(e,r,"encrypt"),r=await eM?.(r,e)||r,e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!eT(r))throw new J("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:c,apv:l}=i,{epk:u}=i;u||(u=(await ex(r)).privateKey);let{x:d,y:h,crv:p,kty:f}=await eq(u),m=await eS(r,u,"ECDH-ES"===e?t:e,"ECDH-ES"===e?eK(t):parseInt(e.slice(-5,-2),10),c,l);if(a={epk:{x:d,crv:p,kty:f}},"EC"===f&&(a.epk.y=h),c&&(a.apu=j(c)),l&&(a.apv=j(l)),"ECDH-ES"===e){s=m;break}s=n||eJ(t);let w=e.slice(-6);o=await eA(w,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||eJ(t),o=await eI(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||eJ(t);let{p2c:c,p2s:l}=i;({encryptedKey:o,...a}=await eC(e,r,s,c,l));break}case"A128KW":case"A192KW":case"A256KW":s=n||eJ(t),o=await eA(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||eJ(t);let{iv:c}=i;({encryptedKey:o,...a}=await e2(e,r,s,c));break}default:throw new J('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}var e6=(...e)=>{let t;let r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0},e3=function(e,t,r,n,i){let o;if(void 0!==i.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!o.has(a))throw new J(`Extension Header Parameter "${a}" is not recognized`);if(void 0===i[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(o.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)};class e8{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){let r,n,i,o,a;if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new q("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!e6(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new q("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let s={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(e3(q,new Map,t?.crit,this._protectedHeader,s),void 0!==s.zip)throw new J('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:c,enc:l}=s;if("string"!=typeof c||!c)throw new q('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof l||!l)throw new q('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(this._cek&&("dir"===c||"ECDH-ES"===c))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${c}`);{let i;({cek:n,encryptedKey:r,parameters:i}=await e4(c,l,e,this._cek,this._keyManagementParameters)),i&&(t&&en in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...i}:this.setUnprotectedHeader(i):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...i}:this.setProtectedHeader(i))}o=this._protectedHeader?T.encode(j(JSON.stringify(this._protectedHeader))):T.encode(""),this._aad?(a=j(this._aad),i=C(o,T.encode("."),T.encode(a))):i=o;let{ciphertext:u,tag:d,iv:h}
43=await eb(l,this._plaintext,n,this._iv,i),p={ciphertext:j(u)};return h&&(p.iv=j(h)),d&&(p.tag=j(d)),r&&(p.encrypted_key=j(r)),a&&(p.aad=a),this._protectedHeader&&(p.protected=P.decode(o)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}class e9{constructor(e){this._flattened=new e8(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}var e7=e=>Math.floor(e.getTime()/1e3);let te=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var tt=e=>{let t;let r=te.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*n);break;case"day":case"days":case"d":t=Math.round(86400*n);break;case"week":case"weeks":case"w":t=Math.round(604800*n);break;default:t=Math.round(31557600*n)}return"-"===r[1]||"ago"===r[4]?-t:t};function tr(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class tn{constructor(e={}){if(!ee(e))throw TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:tr("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:tr("setNotBefore",e7(e))}:this._payload={...this._payload,nbf:e7(new Date)+tt(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:tr("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:tr("setExpirationTime",e7(e))}:this._payload={...this._payload,exp:e7(new Date)+tt(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:e7(new Date)}:e instanceof Date?this._payload={...this._payload,iat:tr("setIssuedAt",e7(e))}:"string"==typeof e?this._payload={...this._payload,iat:tr("setIssuedAt",e7(new Date)+tt(e))}:this._payload={...this._payload,iat:tr("setIssuedAt",e)},this}}class ti extends tn{setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let r=new e9(T.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}async function to(e,t){if(!ee(e))throw TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return L(e.k);case"RSA":if(void 0!==e.oth)throw new J('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return ej({...e,alg:t});default:throw new J('Unsupported "kty" (Key Type) Parameter value')}}async function ta(e,t,r,n,i){switch(eZ(e,t,"decrypt"),t=await eW?.(t,e)||t,e){case"dir":if(void 0!==r)throw new q("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new q("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let i,o;if(!ee(n.epk))throw new q('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!eT(t))throw new J("ECDH with the provided key is not allowed or not supported by your javascript runtime");let a=await to(n.epk,e);if(void 0!==n.apu){if("string"!=typeof n.apu)throw new q('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=L(n.apu)}catch{throw new q("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new q('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{o=L(n.apv)}catch{throw new q("Failed to base64url decode the apv")}}let s=await eS(a,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?eK(n.enc):parseInt(e.slice(-5,-2),10),i,o);if("ECDH-ES"===e)return s;if(void 0===r)throw new q("JWE Encrypted Key missing");return eE(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new q("JWE Encrypted Key missing");return eN(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let o;if(void 0===r)throw new q("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new q('JOSE Header "p2c" (PBES2 Count) missing or invalid');let a=i?.maxPBES2Count||1e4;if(n.p2c>a)throw new q('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new q('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{o=L(n.p2s)}catch{throw new q("Failed to base64url decode the p2s")}return eR(e,t,r,n.p2c,o)}
43case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new q("JWE Encrypted Key missing");return eE(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let i,o;if(void 0===r)throw new q("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new q('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new q('JOSE Header "tag" (Authentication Tag) missing or invalid');try{i=L(n.iv)}catch{throw new q("Failed to base64url decode the iv")}try{o=L(n.tag)}catch{throw new q("Failed to base64url decode the tag")}return e5(e,t,r,i,o)}default:throw new J('Invalid or unsupported "alg" (JWE Algorithm) header value')}}var ts=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function tc(e,t,r){let n,i,o,a,s,c,l;if(!ee(e))throw new q("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new q("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new q("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new q("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new q("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new q("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new q("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new q("JWE AAD incorrect type");if(void 0!==e.header&&!ee(e.header))throw new q("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!ee(e.unprotected))throw new q("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=L(e.protected);n=JSON.parse(P.decode(t))}catch{throw new q("JWE Protected Header is invalid")}if(!e6(n,e.header,e.unprotected))throw new q("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let u={...n,...e.header,...e.unprotected};if(e3(q,new Map,r?.crit,n,u),void 0!==u.zip)throw new J('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:d,enc:h}=u;if("string"!=typeof d||!d)throw new q("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof h||!h)throw new q("missing JWE Encryption Algorithm (enc) in JWE Header");let p=r&&ts("keyManagementAlgorithms",r.keyManagementAlgorithms),f=r&&ts("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(p&&!p.has(d)||!p&&d.startsWith("PBES2"))throw new K('"alg" (Algorithm) Header Parameter value not allowed');if(f&&!f.has(h))throw new K('"enc" (Encryption Algorithm) Header Parameter value not allowed');if(void 0!==e.encrypted_key)try{i=L(e.encrypted_key)}catch{throw new q("Failed to base64url decode the encrypted_key")}let m=!1;"function"==typeof t&&(t=await t(n,e),m=!0);try{o=await ta(d,t,i,u,r)}catch(e){if(e instanceof TypeError||e instanceof q||e instanceof J)throw e;o=eJ(h)}if(void 0!==e.iv)try{a=L(e.iv)}catch{throw new q("Failed to base64url decode the iv")}if(void 0!==e.tag)try{s=L(e.tag)}catch{throw new q("Failed to base64url decode the tag")}let w=T.encode(e.protected??"");c=void 0!==e.aad?C(w,T.encode("."),T.encode(e.aad)):w;try{l=L(e.ciphertext)}catch{throw new q("Failed to base64url decode the ciphertext")}let y={plaintext:await e1(h,o,l,a,s,c)};if(void 0!==e.protected&&(y.protectedHeader=n),void 0!==e.aad)try{y.additionalAuthenticatedData=L(e.aad)}catch{throw new q("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(y.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(y.unprotectedHeader=e.header),m)?{...y,key:t}:y}async function tl(e,t,r){if(e instanceof Uint8Array&&(e=P.decode(e)),"string"!=typeof e)throw new q("Compact JWE must be a string or Uint8Array");let{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new q("Invalid Compact JWE");let l=await tc({ciphertext:a,iv:o||void 0,protected:n,tag:s||void 0,encrypted_key:i||void 0},t,r),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...u,key:l.key}:u}let tu=e=>e.toLowerCase().replace(/^application\//,""),td=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));var th=(e,t,r={})=>{let n,i;try{n=JSON.parse(P.decode(t))}catch{}if(!ee(n))throw new z("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o&&("string"!=typeof e.typ||tu(e.typ)!==tu(o)))throw new M('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:s,subject:c,audience:l,maxTokenAge:u}=r,d=[...a];for(let e of(void 0!==u&&d.push("iat"),void 0!==l&&d.push("aud"),void 0!==c&&d.push("sub"),void 0!==s&&d.push("iss"),new Set(d.reverse())))if(!(e in n))throw new M(`missing required "${e}" claim`,n,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new M('unexpected "iss" claim value',n,"iss","check_failed");if(c&&n.sub!==c)throw new M('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!td(n.aud,"string"==typeof l?[l]:l))throw new M('unexpected "aud" claim value',n,"aud","check_failed");switch(typeof r.clockTolerance){case"string":i=tt(r.clockTolerance);break;case"number":i=r.clockTolerance;break;case"undefined":i=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:h}=r,p=e7(h||new Date);if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new M('"iat" claim must be a number',n,"iat","invali
43d");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new M('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>p+i)throw new M('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new M('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=p-i)throw new W('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){let e=p-n.iat;if(e-i>("number"==typeof u?u:tt(u)))throw new W('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-i)throw new M('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n};async function tp(e,t,r){let n=await tl(e,t,r),i=th(n.protectedHeader,n.plaintext,r),{protectedHeader:o}=n;if(void 0!==o.iss&&o.iss!==i.iss)throw new M('replicated "iss" claim header parameter mismatch',i,"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new M('replicated "sub" claim header parameter mismatch',i,"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new M('replicated "aud" claim header parameter mismatch',i,"aud","mismatch");let a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:n.key}:a}var tf=r(41819);let tm=()=>Date.now()/1e3|0,tw="A256CBC-HS512";async function ty(e){let{token:t={},secret:r,maxAge:n=2592e3,salt:i}=e,o=Array.isArray(r)?r:[r],a=await tb(tw,o[0],i),s=await er({kty:"oct",k:j(a)},`sha${a.byteLength<<3}`);return await new ti(t).setProtectedHeader({alg:"dir",enc:tw,kid:s}).setIssuedAt().setExpirationTime(tm()+n).setJti(crypto.randomUUID()).encrypt(a)}async function tg(e){let{token:t,secret:r,salt:n}=e,i=Array.isArray(r)?r:[r];if(!t)return null;let{payload:o}=await tp(t,async({kid:e,enc:t})=>{for(let r of i){let i=await tb(t,r,n);if(void 0===e||e===await er({kty:"oct",k:j(i)},`sha${i.byteLength<<3}`))return i}throw Error("no matching decryption secret")},{clockTolerance:15,keyManagementAlgorithms:["dir"],contentEncryptionAlgorithms:[tw,"A256GCM"]});return o}async function tb(e,t,r){let n;switch(e){case"A256CBC-HS512":n=64;break;case"A256GCM":n=32;break;default:throw Error("Unsupported JWT Content Encryption Algorithm")}return await A("sha256",t,r,`Auth.js Generated Encryption Key (${r})`,n)}async function tv({options:e,paramValue:t,cookieValue:r}){let{url:n,callbacks:i}=e,o=n.origin;return t?o=await i.redirect({url:t,baseUrl:n.origin}):r&&(o=await i.redirect({url:r,baseUrl:n.origin})),{callbackUrl:o,callbackUrlCookie:o!==r?o:void 0}}let t_=["providers","session","csrf","signin","signout","callback","verify-request","error","webauthn-options"];async function tk(e){if(!("body"in e)||!e.body||"POST"!==e.method)return;let t=e.headers.get("content-type");return t?.includes("application/json")?await e.json():t?.includes("application/x-www-form-urlencoded")?Object.fromEntries(new URLSearchParams(await e.text())):void 0}async function tA(e,t){try{if("GET"!==e.method&&"POST"!==e.method)throw new d.D7("Only GET and POST requests are supported.");t.basePath??(t.basePath="/auth");let r=new URL(e.url),{action:n,providerId:i}=function(e,t){let r=e.match(RegExp(`^${t}(.+)`));if(null===r)throw new d.D7(`Cannot parse action at ${e}`);let[n,i]=r,o=i.replace(/^\//,"").split("/");if(1!==o.length&&2!==o.length)throw new d.D7(`Cannot parse action at ${e}`);let[a,s]=o;if(!t_.includes(a)||s&&!["signin","callback","webauthn-options"].includes(a))throw new d.D7(`Cannot parse action at ${e}`);return{action:a,providerId:s}}(r.pathname,t.basePath);return{url:r,action:n,providerId:i,method:e.method,headers:Object.fromEntries(e.headers),body:e.body?await tk(e):void 0,cookies:(0,tf.Q)(e.headers.get("cookie")??"")??{},error:r.searchParams.get("error")??void 0,query:Object.fromEntries(r.searchParams)}}catch(e){return e}}function tE(e){let t=new Headers(e.headers);e.cookies?.forEach(e=>{let{name:r,value:n,options:i}=e,o=tf.q(r,n,i);t.has("Set-Cookie")?t.append("Set-Cookie",o):t.set("Set-Cookie",o)});let r=e.body;"application/json"===t.get("content-type")?r=JSON.stringify(e.body):"application/x-www-form-urlencoded"===t.get("content-type")&&(r=new URLSearchParams(e.body).toString());let n=new Response(r,{headers:t,status:e.redirect?302:e.status??200});return e.redirect&&n.headers.set("Location",e.redirect),n}async function tS(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>e.toString(16).padStart(2,"0")).join("").toString()}function tx(e){let t=e=>("0"+e.toString(16)).slice(-2);return Array.from(crypto.getRandomValues(new Uint8Array(e))).reduce((e,r)=>e+t(r),"")}async function tT({options:e,cookieValue:t,isPost:r,bodyValue:n}){if(t){let[i,o]=t.split("|");if(o===await tS(`${i}${e.secret}`))return{csrfTokenVerified:r&&i===n,csrfToken:i}}let i=tx(32),o=await tS(`${i}${e.secret}`);return{cookie:`${i}|${o}`,csrfToken:i}}function tP(e,t){if(!t)throw new d.Rk(`CSRF token was missing during an action ${e}.`)}function tC(e){return e&&"object"==typeof e&&!Array.isArray(e)}function tR(e,...t){if(!t.length)return e;let r=t.shift();if(tC(e)&&tC(r))for(let t in r)tC(r[t])?(e[t]||Object.assign(e,{[t]:{}}),tR(e[t],r[t])):Object.assign(e,{[t]:r[t]});return tR(e,...t)}let tO=e=>tI({id:e.sub??e.id??crypto.randomUUID(),name:e.name??e.nickname??e.preferred_username,email:e.email,image:e.picture}),tU=e=>tI({access_token:e.access_token,id_token:e.id_token,refresh_token:e.refresh_token,expires_at:e.expires_at,scope:e.scope,token_type:e.token_type,session_state:e.session_state});function tI(e){let t={};for(let[r,n]of Object.entries(e))void 0!==n&&(t[r]=n);return t}function tN(e,t){if(!e&&t)return;
43if("string"==typeof e)return{url:new URL(e)};let r=new URL(e?.url??"https://authjs.dev");if(e?.params!=null)for(let[t,n]of Object.entries(e.params))"claims"===t&&(n=JSON.stringify(n)),r.searchParams.set(t,String(n));return{url:r,request:e?.request,conform:e?.conform}}let tH="\x1b[31m",tj="\x1b[0m",t$={error(e){let t=e instanceof d.l4?e.type:e.name;if(console.error(`${tH}[auth][error]${tj} ${t}: ${e.message}`),e.cause&&"object"==typeof e.cause&&"err"in e.cause&&e.cause.err instanceof Error){let{err:t,...r}=e.cause;console.error(`${tH}[auth][cause]${tj}:`,t.stack),r&&console.error(`${tH}[auth][details]${tj}:`,JSON.stringify(r,null,2))}else e.stack&&console.error(e.stack.replace(/.*/,"").substring(1))},warn(e){let t=`https://warnings.authjs.dev#${e}`;console.warn(`\x1b[33m[auth][warn][${e}]${tj}`,`Read more: ${t}`)},debug(e,t){console.log(`\x1b[90m[auth][debug]:${tj} ${e}`,JSON.stringify(t,null,2))}},tL={signIn:()=>!0,redirect:({url:e,baseUrl:t})=>e.startsWith("/")?`${t}${e}`:new URL(e).origin===t?e:t,session:({session:e})=>({user:{name:e.user?.name,email:e.user?.email,image:e.user?.image},expires:e.expires?.toISOString?.()??e.expires}),jwt:({token:e})=>e};async function tD({authOptions:e,providerId:t,action:r,url:n,cookies:i,callbackUrl:o,csrfToken:a,csrfDisabled:s,isPost:c}){var u;let{providers:h,provider:p}=function(e){let{providerId:t,options:r}=e,n=new URL(r.basePath??"/auth",e.url.origin),i=e.providers.map(e=>{let t="function"==typeof e?e():e,{options:i,...o}=t,a=i?.id??o.id,s=tR(o,i,{signinUrl:`${n}/signin/${a}`,callbackUrl:`${n}/callback/${a}`});return"oauth"===t.type||"oidc"===t.type?(s.redirectProxyUrl??(s.redirectProxyUrl=r.redirectProxyUrl),function(e){e.issuer&&(e.wellKnown??(e.wellKnown=`${e.issuer}/.well-known/openid-configuration`));let t=tN(e.authorization,e.issuer);t&&!t.url?.searchParams.has("scope")&&t.url.searchParams.set("scope","openid profile email");let r=tN(e.token,e.issuer),n=tN(e.userinfo,e.issuer),i=e.checks??["pkce"];return e.redirectProxyUrl&&(i.includes("state")||i.push("state"),e.redirectProxyUrl=`${e.redirectProxyUrl}/callback/${e.id}`),{...e,authorization:t,token:r,checks:i,userinfo:n,profile:e.profile??tO,account:e.account??tU}}(s)):s});return{providers:i,provider:i.find(({id:e})=>e===t)}}({providers:e.providers,url:n,providerId:t,options:e}),f=!1;if((p?.type==="oauth"||p?.type==="oidc")&&p.redirectProxyUrl)try{f=new URL(p.redirectProxyUrl).origin===n.origin}catch{throw TypeError(`redirectProxyUrl must be a valid URL. Received: ${p.redirectProxyUrl}`)}let m={debug:!1,pages:{},theme:{colorScheme:"auto",logo:"",brandColor:"",buttonText:""},...e,url:n,action:r,provider:p,cookies:tR(l(e.useSecureCookies??"https:"===n.protocol),e.cookies),providers:h,session:{strategy:e.adapter?"database":"jwt",maxAge:2592e3,updateAge:86400,generateSessionToken:()=>crypto.randomUUID(),...e.session},jwt:{secret:e.secret,maxAge:e.session?.maxAge??2592e3,encode:ty,decode:tg,...e.jwt},events:Object.keys(u=e.events??{}).reduce((e,t)=>(e[t]=async(...e)=>{try{let r=u[t];return await r(...e)}catch(e){t$.error(new d.xQ(e))}},e),{}),adapter:function(e,t){if(e)return Object.keys(e).reduce((r,n)=>(r[n]=async(...r)=>{try{t.debug(`adapter_${n}`,{args:r});let i=e[n];return await i(...r)}catch(r){let e=new d.dq(r);throw t.error(e),e}},r),{})}(e.adapter,t$),callbacks:{...tL,...e.callbacks},logger:t$,callbackUrl:n.origin,isOnRedirectProxy:f,experimental:{...e.experimental}},w=[];if(s)m.csrfTokenVerified=!0;else{let{csrfToken:e,cookie:t,csrfTokenVerified:r}=await tT({options:m,cookieValue:i?.[m.cookies.csrfToken.name],isPost:c,bodyValue:a});m.csrfToken=e,m.csrfTokenVerified=r,t&&w.push({name:m.cookies.csrfToken.name,value:t,options:m.cookies.csrfToken.options})}let{callbackUrl:y,callbackUrlCookie:g}=await tv({options:m,cookieValue:i?.[m.cookies.callbackUrl.name],paramValue:o});return m.callbackUrl=y,g&&w.push({name:m.cookies.callbackUrl.name,value:g,options:m.cookies.callbackUrl.options}),{options:m,cookies:w}}var tM,tW,tK,tJ,tF,tq,tB,tz,tV,tG,tX,tZ={},tY=[],tQ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function t0(e,t){for(var r in t)e[r]=t[r];return e}function t1(e){var t=e.parentNode;t&&t.removeChild(e)}function t2(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++tV:i};return null==i&&null!=tz.vnode&&tz.vnode(o),o}function t5(e){return e.children}function t4(e,t){this.props=e,this.context=t}function t6(e,t){if(null==t)return e.__?t6(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?t6(e):null}function t3(e){(!e.__d&&(e.__d=!0)&&tG.push(e)&&!t8.__r++||tX!==tz.debounceRendering)&&((tX=tz.debounceRendering)||setTimeout)(t8)}function t8(){for(var e;t8.__r=tG.length;)e=tG.sort(function(e,t){return e.__v.__b-t.__v.__b}),tG=[],e.some(function(e){var t,r,n,i,o;e.__d&&(i=(n=e.__v).__e,(o=e.__P)&&(t=[],(r=t0({},n)).__v=n.__v+1,ri(o,n,r,e.__n,void 0!==o.ownerSVGElement,null!=n.__h?[i]:null,t,null==i?t6(n):i,n.__h),function(e,t){tz.__c&&tz.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){tz.__e(e,t.__v)}})}(t,n),n.__e!=i&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)))})}function t9(e,t,r,n,i,o,a,s,c,l){var u,d,h,p,f,m,w,y=n&&n.__k||tY,g=y.length;for(r.__k=[],u=0;u<t.length;u++)if(null!=(p=r.__k[u]=null==(p=t[u])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?t2(null,p,null,
43null,p):Array.isArray(p)?t2(t5,{children:p},null,null,null):p.__b>0?t2(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=r,p.__b=r.__b+1,null===(h=y[u])||h&&p.key==h.key&&p.type===h.type)y[u]=void 0;else for(d=0;d<g;d++){if((h=y[d])&&p.key==h.key&&p.type===h.type){y[d]=void 0;break}h=null}ri(e,p,h=h||tZ,i,o,a,s,c,l),f=p.__e,(d=p.ref)&&h.ref!=d&&(w||(w=[]),h.ref&&w.push(h.ref,null,p),w.push(d,p.__c||f,p)),null!=f?(null==m&&(m=f),"function"==typeof p.type&&p.__k===h.__k?p.__d=c=function e(t,r,n){for(var i,o=t.__k,a=0;o&&a<o.length;a++)(i=o[a])&&(i.__=t,r="function"==typeof i.type?e(i,r,n):t7(n,i,i,o,i.__e,r));return r}(p,c,e):c=t7(e,p,h,y,f,c),"function"==typeof r.type&&(r.__d=c)):c&&h.__e==c&&c.parentNode!=e&&(c=t6(h))}for(r.__e=m,u=g;u--;)null!=y[u]&&function e(t,r,n){var i,o;if(tz.unmount&&tz.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||ro(i,null,r)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){tz.__e(e,r)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&e(i[o],r,n||"function"!=typeof t.type);n||null==t.__e||t1(t.__e),t.__=t.__e=t.__d=void 0}(y[u],y[u]);if(w)for(u=0;u<w.length;u++)ro(w[u],w[++u],w[++u])}function t7(e,t,r,n,i,o){var a,s,c;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==r||i!=o||null==i.parentNode)t:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,c=0;(s=s.nextSibling)&&c<n.length;c+=1)if(s==i)break t;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function re(e,t,r){"-"===t[0]?e.setProperty(t,r):e[t]=null==r?"":"number"!=typeof r||tQ.test(t)?r:r+"px"}function rt(e,t,r,n,i){var o;t:if("style"===t){if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||re(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||re(e.style,t,r[t])}}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase() in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n||e.addEventListener(t,o?rn:rr,o):e.removeEventListener(t,o?rn:rr,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==r?"":r;break t}catch(e){}"function"==typeof r||(null==r||!1===r&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,r))}}function rr(e){this.l[e.type+!1](tz.event?tz.event(e):e)}function rn(e){this.l[e.type+!0](tz.event?tz.event(e):e)}function ri(e,t,r,n,i,o,a,s,c){var l,u,d,h,p,f,m,w,y,g,b,v,_,k,A,E=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,s=t.__e=r.__e,t.__h=null,o=[s]),(l=tz.__b)&&l(t);try{t:if("function"==typeof E){if(w=t.props,y=(l=E.contextType)&&n[l.__c],g=l?y?y.props.value:l.__:n,r.__c?m=(u=t.__c=r.__c).__=u.__E:("prototype"in E&&E.prototype.render?t.__c=u=new E(w,g):(t.__c=u=new t4(w,g),u.constructor=E,u.render=ra),y&&y.sub(u),u.props=w,u.state||(u.state={}),u.context=g,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=t0({},u.__s)),t0(u.__s,E.getDerivedStateFromProps(w,u.__s))),h=u.props,p=u.state,d)null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==E.getDerivedStateFromProps&&w!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(w,g),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(w,u.__s,g)||t.__v===r.__v){for(u.props=w,u.state=u.__s,t.__v!==r.__v&&(u.__d=!1),u.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(w,u.__s,g),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(h,p,f)})}if(u.context=g,u.props=w,u.__v=t,u.__P=e,v=tz.__r,_=0,"prototype"in E&&E.prototype.render){for(u.state=u.__s,u.__d=!1,v&&v(t),l=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do u.__d=!1,v&&v(t),l=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++_<25);u.state=u.__s,null!=u.getChildContext&&(n=t0(t0({},n),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(h,p)),A=null!=l&&l.type===t5&&null==l.key?l.props.children:l,t9(e,Array.isArray(A)?A:[A],t,r,n,i,o,a,s,c),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,o,a,s){var c,l,u,d=r.props,h=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o){for(;f<o.length;f++)if((c=o[f])&&"setAttribute"in c==!!p&&(p?c.localName===p:3===c.nodeType)){e=c,o[f]=null;break}}if(null==e){if(null===p)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),o=null,s=!1}if(null===p)d===h||s&&e.data===h||(e.data=h);else{if(o=o&&tB.call(e.childNodes),l=(d=r.props||tZ).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||l)&&(u&&(l&&u.__html==l.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,r,n,i){var o;for(o in r)"children"===o||"key"===o||o in t||rt(e,o,null,r[o],n);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||r[o]===t[o]||rt(e,o,t[o],r[o],n)}(e,h,d,i,s),u)t.__k=[];else if(t9(e,Array.isArray(f=t.props.children)?f:[f],t,r,n,i&&"foreignObject"!==p,o,a,o?o[0]:r.__k&&t6(r,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&t1(o[f]);s||("value"in h&&void 0!==(f=h.value)&&(f!==e.value||"progress"===p&&!f||"option"===p&&f!==d.value)&&rt(e,"value",f,d.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==e.checked&&rt(e,"checked",f,d.checked,!1))}return e}(r.__e,t,r,n,i,o,a,c);(l=tz.diffed)&&l(t)}catch(e){t.__v=null,(c||null!=o)&&(t.__e=s,t.__h=!!c,o[o.indexOf(s)]=null),tz.__e(e,t,r)}}function ro(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){tz.__e(e,r)}}function ra(e,t,r){return this.constructor(e,r)}tB=tY.slice,tz={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},tV=0,t4.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=t0({},this.state),"function"==typeof e&&(e=e(t0({},r),this.props)),e&&t0(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),t3(this))},t4.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),t3(this))},t4.prototype.render=t5,tG=[],t8.__r=0;var rs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,rc=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,rl=/[\s\n\\/='"\0<>]/,ru=/^xlink:?./,rd=/["&<]/;function rh(e){if(!1===rd.test(e+=""))return e;for(var t=0,r=0,n="",i="";r<e.length;r++){switch(e.charCodeAt(r)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;default:continue}r!==t&&(n+=e.slice(t,r)),n+=i,t=r+1}return r!==t&&(n+=e.slice(t,r)),n}var rp=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"	"))},rf=function(e,t,r){return String(e).length>(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},rm={},rw=/([A-Z])/g;function ry(e){var t="";for(var r in e){var n=e[r];null!=n&&""!==n&&(t&&(t+=" "),t+="-"==r[0]?r:rm[r]||(rm[r]=r.replace(rw,"-$1").toLowerCase()),t="number"==typeof n&&!1===rs.test(r)?t+": "+n+"px;":t+": "+n+";")}return t||void 0}function rg(e,t){return Array.isArray(t)?t.reduce(rg,e):null!=t&&!1!==t&&e.push(t),e}function rb(){this.__d=!0}function rv(e,t){return{__v:e,context:t,props:e.props,setState:rb,forceUpdate:rb,__d:!0,__h:[]}}function r_(e,t){var r=e.contextType,n=r&&t[r.__c];return null!=r?n?n.props.value:r.__:t}var rk=[],rA={shallow:!0};rS.render=rS;var rE=[];function rS(e,t,r){t=t||{};var n,i=tz.__s;return tz.__s=!0,n=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?function e(t,r,n,i,o,a){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return rh(t);var s=n.pretty,c=s&&"string"==typeof s?s:"	";if(Array.isArray(t)){for(var l="",u=0;u<t.length;u++)s&&u>0&&(l+="\n"),l+=e(t[u],r,n,i,o,a);return l}var d,h=t.type,p=t.props,f=!1;if("function"==typeof h){if(f=!0,!n.shallow||!i&&!1!==n.renderRootComponent){if(h===t5){var m=[];return rg(m,t.props.children),e(m,r,n,!1!==n.shallowHighOrder,o,a)}var w,y=t.__c=rv(t,r);tz.__b&&tz.__b(t);var g=tz.__r;if(h.prototype&&"function"==typeof h.prototype.render){var b=r_(h,r);(y=t.__c=new h(p,b)).__v=t,y._dirty=y.__d=!0,y.props=p,null==y.state&&(y.state={}),null==y._nextState&&null==y.__s&&(y._nextState=y.__s=y.state),y.context=b,h.getDerivedStateFromProps?y.state=Object.assign({},y.state,h.getDerivedStateFromProps(y.props,y.state)):y.componentWillMount&&(y.componentWillMount(),y.state=y._nextState!==y.state?y._nextState:y.__s!==y.state?y.__s:y.state),g&&g(t),w=y.render(y.props,y.state,y.context)}else for(var v=r_(h,r),_=0;y.__d&&_++<25;)y.__d=!1,g&&g(t),w=h.call(t.__c,p,v);return y.getChildContext&&(r=Object.assign({},r,y.getChildContext())),tz.diffed&&tz.diffed(t),e(w,r,n,!1!==n.shallowHighOrder,o,a)}h=(d=h).displayName||d!==Function&&d.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=rk.length;n--;)if(rk[n]===e){r=n;break}r<0&&(r=rk.push(e)-1),t="UnnamedComponent"+r}return t}(d)}var k,A,E="<"+h;if(p){var S=Object.keys(p);n&&!0===n.sortAttributes&&S.sort();for(var x=0;x<S.length;x++){var T=S[x],P=p[T];if("children"!==T){if(!rl.test(T)&&(n&&n.allAttributes||"key"!==T&&"ref"!==T&&"__self"!==T&&"__source"!==T)){if("defaultValue"===T)T="value";else if("defaultChecked"===T)T="checked";else if("defaultSelected"===T)T="selected";else if("className"===T){if(void 0!==p.class)continue;T="class"}else o&&ru.test(T)&&(T=T.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===T){if(p.for)continue;T="for"}"style"===T&&P&&"object"==typeof P&&(P=ry(P)),"a"===T[0]&&"r"===T[1]&&"boolean"==typeof P&&(P=String(P));var C=n.attributeHook&&n.attributeHook(T,P,r,n,f);if(C||""===C)E+=C;else if("dangerouslySetInnerHTML"===T)A=P&&P.__html;else if("textarea"===h&&"value"===T)k=P;else if((P||0===P||""===P)&&"function"!=typeof P){if(!(!0!==P&&""!==P||(P=T,n&&n.xml))){E=E+" "+T;continue}if("value"===T){if("select"===h){a=P;continue}"option"===h&&a==P&&void 0===p.selected&&(E+=" selected")}E=E+" "+T+'="'+rh(P)+'"'}}}else k=P}}if(s){var R=E.replace(/\n\s*/," ");R===E||~R.indexOf("\n")?s&&~E.indexOf("\n")&&(E+="\n"):E=R}if(E+=">",rl.test(h))throw Error(h+" is not a valid HTML tag name in "+E);var O,U=rc.test(h)||n.voidElements&&n.voidElements.test(h),I=[];if(A)s&&rf(A)&&(A="\n"+c+rp(A,c)),E+=A;else if(null!=k&&rg(O=[],k).length){for(var N=s&&~E.indexOf("\n"),H=!1,j=0;j<O.length;j++){var $=O[j];if(null!=$&&!1!==$){var L=e($,r,n,!0,"svg"===h||"foreignObject"!==h&&o,a);if(s&&!N&&rf(L)&&(N=!0),L){if(s){var D=L.length>0&&"<"!=L[0];H&&D?I[I.length-1]+=L:I.push(L),H=D}else I.push(L)}}}if(s&&N)for(var M=I.length;M--;)I[M]="\n"+c+rp(I[M],c)}if(I.length||A)E+=I.join("");else if(n&&n.xml)return E.substring(0,E.length-1)+" />";return!U||O||A?(s&&~E.indexOf("\n")&&(E+="\n"),E=E+"</"+h+">"):E=E.replace(/>$/," />"),E}(e,t,r):function e(t,r,n,i){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return rh(t);if(rx(t)){for(var o="",a=0;a<t.length;a++)o+=e(t[a],r,n,i);return o}tz.__b&&tz.__b(t);var s=t.type,c=t.props;if("function"==typeof s){if(s===t5)return e(t.props.children,r,n,i);f=s.prototype&&"function"==typeof s.prototype.render?(l=r,d=r_(u=t.type,l),h=new u(t.props,d),t.__c=h,h.__v=t,h.__d=!0,h.props=t.props,null==h.state&&(h.state={}),null==h.__s&&(h.__s=h.state),h.context=d,u.getDerivedStateFromProps?h.state=rT({},h.state,u.getDerivedStateFromProps(h.props,h.state)):h.componentWillMount&&(h.c
43omponentWillMount(),h.state=h.__s!==h.state?h.__s:h.state),(p=tz.__r)&&p(t),h.render(h.props,h.state,h.context)):function(e,t){var r,n=rv(e,t),i=r_(e.type,t);e.__c=n;for(var o=tz.__r,a=0;n.__d&&a++<25;)n.__d=!1,o&&o(e),r=e.type.call(n,e.props,i);return r}(t,r);var l,u,d,h,p,f,m=t.__c;m.getChildContext&&(r=rT({},r,m.getChildContext()));var w=e(f,r,n,i);return tz.diffed&&tz.diffed(t),w}var y,g,b="<";if(b+=s,c)for(var v in y=c.children,c){var _,k,A,E=c[v];if(!("key"===v||"ref"===v||"__self"===v||"__source"===v||"children"===v||"className"===v&&"class"in c||"htmlFor"===v&&"for"in c||rl.test(v))){if(k=v="className"===(_=v)?"class":"htmlFor"===_?"for":"defaultValue"===_?"value":"defaultChecked"===_?"checked":"defaultSelected"===_?"selected":n&&ru.test(_)?_.toLowerCase().replace(/^xlink:?/,"xlink:"):_,A=E,E="style"===k&&null!=A&&"object"==typeof A?ry(A):"a"===k[0]&&"r"===k[1]&&"boolean"==typeof A?String(A):A,"dangerouslySetInnerHTML"===v)g=E&&E.__html;else if("textarea"===s&&"value"===v)y=E;else if((E||0===E||""===E)&&"function"!=typeof E){if(!0===E||""===E){E=v,b=b+" "+v;continue}if("value"===v){if("select"===s){i=E;continue}"option"!==s||i!=E||"selected"in c||(b+=" selected")}b=b+" "+v+'="'+rh(E)+'"'}}}var S=b;if(b+=">",rl.test(s))throw Error(s+" is not a valid HTML tag name in "+b);var x="",T=!1;if(g)x+=g,T=!0;else if("string"==typeof y)x+=rh(y),T=!0;else if(rx(y))for(var P=0;P<y.length;P++){var C=y[P];if(null!=C&&!1!==C){var R=e(C,r,"svg"===s||"foreignObject"!==s&&n,i);R&&(x+=R,T=!0)}}else if(null!=y&&!1!==y&&!0!==y){var O=e(y,r,"svg"===s||"foreignObject"!==s&&n,i);O&&(x+=O,T=!0)}if(tz.diffed&&tz.diffed(t),T)b+=x;else if(rc.test(s))return S+" />";return b+"</"+s+">"}(e,t,!1,void 0),tz.__c&&tz.__c(e,rE),tz.__s=i,rE.length=0,n}var rx=Array.isArray,rT=Object.assign;rS.shallowRender=function(e,t){return rS(e,t,rA)};var rP=0;function rC(e,t,r,n,i){var o,a,s={};
43for(a in t)"ref"==a?o=t[a]:s[a]=t[a];var c={type:e,props:s,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--rP,__source:i,__self:n};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===s[a]&&(s[a]=o[a]);return tz.vnode&&tz.vnode(c),c}async function rR(e,t){let r=window.SimpleWebAuthnBrowser;async function n(r){let n=new URL(`${e}/webauthn-options/${t}`);r&&n.searchParams.append("action",r),o().forEach(e=>{n.searchParams.append(e.name,e.value)});let i=await fetch(n);if(!i.ok){console.error("Failed to fetch options",i);return}return i.json()}function i(){let e=`#${t}-form`,r=document.querySelector(e);if(!r)throw Error(`Form '${e}' not found`);return r}function o(){return Array.from(i().querySelectorAll("input[data-form-field]"))}async function a(e,t){let r=i();if(e){let t=document.createElement("input");t.type="hidden",t.name="action",t.value=e,r.appendChild(t)}if(t){let e=document.createElement("input");e.type="hidden",e.name="data",e.value=JSON.stringify(t),r.appendChild(e)}return r.submit()}async function s(e,t){let n=await r.startAuthentication(e,t);return await a("authenticate",n)}async function c(e){o().forEach(e=>{if(e.required&&!e.value)throw Error(`Missing required field: ${e.name}`)});let t=await r.startRegistration(e);return await a("register",t)}async function l(){if(!r.browserSupportsWebAuthnAutofill())return;let e=await n("authenticate");if(!e){console.error("Failed to fetch option for autofill authentication");return}try{await s(e.options,!0)}catch(e){console.error(e)}}(async function(){let e=i();if(!r.browserSupportsWebAuthn()){e.style.display="none";return}e&&e.addEventListener("submit",async e=>{e.preventDefault();let t=await n(void 0);if(!t){console.error("Failed to fetch options for form submission");return}if("authenticate"===t.action)try{await s(t.options,!1)}catch(e){console.error(e)}else if("register"===t.action)try{await c(t.options)}catch(e){console.error(e)}})})(),l()}let rO={default:"Unable to sign in.",Signin:"Try signing in with a different account.",OAuthSignin:"Try signing in with a different account.",OAuthCallbackError:"Try signing in with a different account.",OAuthCreateAccount:"Try signing in with a different account.",EmailCreateAccount:"Try signing in with a different account.",Callback:"Try signing in with a different account.",OAuthAccountNotLinked:"To confirm your identity, sign in with the same account you used originally.",EmailSignin:"The e-mail could not be sent.",CredentialsSignin:"Sign in failed. Check the details you provided are correct.",SessionRequired:"Please sign in to access this page."};function rU(e,t=1){if(!e)return;3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let r=parseInt(e,16);return t=Math.min(Math.max(t,0),1),`rgba(${r>>16&255}, ${r>>8&255}, ${255&r}, ${t})`}var rI=`:root {
44  --border-width: 1px;
45  --border-radius: 0.5rem;
46  --color-error: #c94b4b;
47  --color-info: #157efb;
48  --color-info-hover: #0f6ddb;
49  --color-info-text: #fff;
50}
51
52.__next-auth-theme-auto,
53.__next-auth-theme-light {
54  --color-background: #ececec;
55  --color-background-hover: rgba(236, 236, 236, 0.8);
56  --color-background-card: #fff;
57  --color-text: #000;
58  --color-primary: #444;
59  --color-control-border: #bbb;
60  --color-button-active-background: #f9f9f9;
61  --color-button-active-border: #aaa;
62  --color-separator: #ccc;
63}
64
65.__next-auth-theme-dark {
66  --color-background: #161b22;
67  --color-background-hover: rgba(22, 27, 34, 0.8);
68  --color-background-card: #0d1117;
69  --color-text: #fff;
70  --color-primary: #ccc;
71  --color-control-border: #555;
72  --color-button-active-background: #060606;
73  --color-button-active-border: #666;
74  --color-separator: #444;
75}
76
77@media (prefers-color-scheme: dark) {
78  .__next-auth-theme-auto {
79    --color-background: #161b22;
80    --color-background-hover: rgba(22, 27, 34, 0.8);
81    --color-background-card: #0d1117;
82    --color-text: #fff;
83    --color-primary: #ccc;
84    --color-control-border: #555;
85    --color-button-active-background: #060606;
86    --color-button-active-border: #666;
87    --color-separator: #444;
88  }
89
90  button,
91  a.button {
92    color: var(--provider-dark-color, var(--color-primary));
93    background-color: var(--provider-dark-bg, var(--color-background));
94  }
95    :is(button,a.button):hover {
96      background-color: var(
97        --provider-dark-bg-hover,
98        var(--color-background-hover)
99      ) !important;
100    }
101  #provider-logo {
102    display: none !important;
103  }
104  #provider-logo-dark {
105    width: 25px;
106    display: block !important;
107  }
108}
109html {
110  box-sizing: border-box;
111}
112*,
113*:before,
114*:after {
115  box-sizing: inherit;
116  margin: 0;
117  padding: 0;
118}
119
120body {
121  background-color: var(--color-background);
122  margin: 0;
123  padding: 0;
124  font-family:
125    ui-sans-serif,
126    system-ui,
127    -apple-system,
128    BlinkMacSystemFont,
129    "Segoe UI",
130    Roboto,
131    "Helvetica Neue",
132    Arial,
133    "Noto Sans",
134    sans-serif,
135    "Apple Color Emoji",
136    "Segoe UI Emoji",
137    "Segoe UI Symbol",
138    "Noto Color Emoji";
139}
140
141h1 {
142  margin-bottom: 1.5rem;
143  padding: 0 1rem;
144  font-weight: 400;
145  color: var(--color-text);
146}
147
148p {
149  margin-bottom: 1.5rem;
150  padding: 0 1rem;
151  color: var(--color-text);
152}
153
154form {
155  margin: 0;
156  padding: 0;
157}
158
159label {
160  font-weight: 500;
161  text-align: left;
162  margin-bottom: 0.25rem;
163  display: block;
164  color: var(--color-text);
165}
166
167input[type] {
168  box-sizing: border-box;
169  display: block;
170  width: 100%;
171  padding: 0.5rem 1rem;
172  border: var(--border-width) solid var(--color-control-border);
173  background: var(--color-background-card);
174  font-size: 1rem;
175  border-radius: var(--border-radius);
176  color: var(--color-text);
177}
178
179input[type]:focus {
180    box-shadow: none;
181  }
182
183p {
184  font-size: 1.1rem;
185  line-height: 2rem;
186}
187
188a.button {
189  text-decoration: none;
190  line-height: 1rem;
191}
192
193a.button:link,
194  a.button:visited {
195    background-color: var(--color-background);
196    color: var(--color-primary);
197  }
198
199button span {
200  flex-grow: 1;
201}
202
203button,
204a.button {
205  padding: 0.75rem 1rem;
206  color: var(--provider-color, var(--color-primary));
207  background-color: var(--provider-bg);
208  font-size: 1.1rem;
209  min-height: 62px;
210  border-color: rgba(0, 0, 0, 0.1);
211  border-radius: var(--border-radius);
212  transition: all 0.1s ease-in-out;
213  font-weight: 500;
214  position: relative;
215  display: flex;
216  align-items: center;
217  justify-content: center;
218}
219
220:is(button,a.button):hover {
221    background-color: var(--provider-bg-hover, var(--color-background-hover));
222    cursor: pointer;
223  }
224
225:is(button,a.button):active {
226    cursor: pointer;
227  }
228
229:is(button,a.button) #provider-logo {
230    width: 25px;
231    display: block;
232  }
233
234:is(button,a.button) #provider-logo-dark {
235    display: none;
236  }
237
238#submitButton {
239  color: var(--button-text-color, var(--color-info-text));
240  background-color: var(--brand-color, var(--color-info));
241  width: 100%;
242}
243
244#submitButton:hover {
245    background-color: var(
246      --button-hover-bg,
247      var(--color-info-hover)
248    ) !important;
249  }
250
251a.site {
252  color: var(--color-primary);
253  text-decoration: none;
254  font-size: 1rem;
255  line-height: 2rem;
256}
257
258a.site:hover {
259    text-decoration: underline;
260  }
261
262.page {
263  position: absolute;
264  width: 100%;
265  height: 100%;
266  display: grid;
267  place-items: center;
268  margin: 0;
269  padding: 0;
270  box-sizing: border-box;
271}
272
273.page > div {
274    text-align: center;
275  }
276
277.error a.button {
278    padding-left: 2rem;
279    padding-right: 2rem;
280    margin-top: 0.5rem;
281  }
282
283.error .message {
284    margin-bottom: 1.5rem;
285  }
286
287.signin input[type="text"] {
288    margin-left: auto;
289    margin-right: auto;
290    display: block;
291  }
292
293.signin hr {
294    display: block;
295    border: 0;
296    border-top: 1px solid var(--color-separator);
297    margin: 2rem auto 1rem auto;
298    overflow: visible;
299  }
300
301.signin hr::before {
302      content: "or";
303      background: var(--color-background-card);
304      color: #888;
305      padding: 0 0.4rem;
306      position: relative;
307      top: -0.7rem;
308    }
309
310.signin .error {
311    background: #f5f5f5;
312    font-weight: 500;
313    border-radius: 0.3rem;
314    background: var(--color-error);
315  }
316
317.signin .error p {
318      text-align: left;
319      padding: 0.5rem 1rem;
320      font-size: 0.9rem;
321      line-height: 1.2rem;
322      color: var(--color-info-text);
323    }
324
325.signin > div,
326  .signin form {
327    display: block;
328  }
329
330.signin > div input[type], .signin form input[type] {
331      margin-bottom: 0.5rem;
332    }
333
334.signin > div button, .signin form button {
335      width: 100%;
336    }
337
338.signin .provider + .provider {
339    margin-top: 1rem;
340  }
341
342.logo {
343  display: inline-block;
344  max-width: 150px;
345  margin: 1.25rem 0;
346  max-height: 70px;
347}
348
349.card {
350  background-color: var(--color-background-card);
351  border-radius: 2rem;
352  padding: 1.25rem 2rem;
353}
354
355.card .header {
356    color: var(--color-primary);
357  }
358
359.section-header {
360  color: var(--color-text);
361}
362
363@media screen and (min-width: 450px) {
364  .card {
365    margin: 2rem 0;
366    width: 368px;
367  }
368}
369@media screen and (max-width: 450px) {
370  .card {
371    margin: 1rem 0;
372    width: 343px;
373  }
374}
375`;function rN({html:e,title:t,status:r,cookies:n,theme:i,headTags:o}){return{cookies:n,status:r,headers:{"Content-Type":"text/html"},body:`<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>${rI}</style><title>${t}</title>${o??""}</head><body class="__next-auth-theme-${i?.colorScheme??"auto"}"><div class="page">${rS(e)}</div></body></html>`}}function rH(e){let{url:t,theme:r,query:n,cookies:i,pages:o,providers:a}=e;return{csrf:(e,t,r)=>e?(t.logger.warn("csrf-disabled"),r.push({name:t.cookies.csrfToken.name,value:"",options:{...t.cookies.csrfToken.options,maxAge:0}}),{status:404,cookies:r}):{headers:{"Content-Type":"application/json"},body:{csrfToken:t.csrfToken},cookies:r},providers:e=>({headers:{"Content-Type":"application/json"},body:e.reduce((e,{id:t,name:r,type:n,signinUrl:i,callbackUrl:o})=>(e[t]={id:t,name:r,type:n,signinUrl:i,callbackUrl:o},e),{})}),signin(t,s){if(t)throw new d.D7("Unsupported action");if(o?.signIn){let t=`${o.signIn}${o.signIn.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:e.callbackUrl??"/"})}`;return s&&(t=`${t}&${new URLSearchParams({error:s})}`),{redirect:t,cookies:i}}let c=a?.find(e=>"webauthn"===e.type&&e.enableConditionalUI&&!!e.simpleWebAuthnBrowserVersion),l="";if(c){let{simpleWebAuthnBrowserVersion:e}=c;l=`<script src="https://unpkg.com/@simplewebauthn/browser@${e}/dist/bundle/index.umd.min.js" crossorigin="anonymous"></script>`}return rN({cookies:i,theme:r,html:function(e){let{csrfToken:t,providers:r=[],callbackUrl:n,theme:i,email:o,error:a}=e;"undefined"!=typeof document&&i?.brandColor&&document.documentElement.style.setProperty("--brand-color",i.brandColor),"undefined"!=typeof document&&i?.buttonText&&document.documentElement.style.setProperty("--button-text-color",i.buttonText);let s=a&&(rO[a]??rO.default),c="https://authjs.dev/img/providers",l=r.find(e=>"webauthn"===e.type&&e.enableConditionalUI)?.id;return rC("div",{className:"signin",children:[i?.brandColor&&rC("style",{dangerouslySetInnerHTML:{__html:`:root {--brand-color: ${i.brandColor}}`}}),i?.buttonText&&rC("style",{dangerouslySetInnerHTML:{__html:`
376        :root {
377          --button-text-color: ${i.buttonText}
378        }
379      `}}),rC("div",{className:"card",children:[s&&rC("div",{className:"error",children:rC("p",{children:s})}),i?.logo&&rC("img",{src:i.logo,alt:"Logo",className:"logo"}),r.map((e,i)=>{let a,s,l,u,d,h;return("oauth"===e.type||"oidc"===e.type)&&({bg:a="",text:s="",logo:l="",bgDark:d=a,textDark:h=s,logoDark:u=""}=e.style??{},l=l.startsWith("/")?c+l:l,(u=u.startsWith("/")?c+u:u||l)||(u=l)),rC("div",{className:"provider",children:["oauth"===e.type||"oidc"===e.type?rC("form",{action:e.signinUrl,method:"POST",children:[rC("input",{type:"hidden",name:"csrfToken",value:t}),n&&rC("input",{type:"hidden",name:"callbackUrl",value:n}),rC("button",{type:"submit",className:"button",style:{"--provider-bg":a,"--provider-dark-bg":d,"--provider-color":s,"--provider-dark-color":h,"--provider-bg-hover":rU(a,.8),"--provider-dark-bg-hover":rU(d,.8)},tabIndex:0,children:[l&&rC("img",{loading:"lazy",height:24,width:24,id:"provider-logo",src:l}),u&&rC("img",{loading:"lazy",height:24,width:24,id:"provider-logo-dark",src:u}),rC("span",{children:["Sign in with ",e.name]})]})]}):null,("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&i>
3790&&"email"!==r[i-1].type&&"credentials"!==r[i-1].type&&"webauthn"!==r[i-1].type&&rC("hr",{}),"email"===e.type&&rC("form",{action:e.signinUrl,method:"POST",children:[rC("input",{type:"hidden",name:"csrfToken",value:t}),rC("label",{className:"section-header",htmlFor:`input-email-for-${e.id}-provider`,children:"Email"}),rC("input",{id:`input-email-for-${e.id}-provider`,autoFocus:!0,type:"email",name:"email",value:o,placeholder:"[email protected]",required:!0}),rC("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"credentials"===e.type&&rC("form",{action:e.callbackUrl,method:"POST",children:[rC("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.credentials).map(t=>rC("div",{children:[rC("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.credentials[t].label??t}),rC("input",{name:t,id:`input-${t}-for-${e.id}-provider`,type:e.credentials[t].type??"text",placeholder:e.credentials[t].placeholder??"",...e.credentials[t]})]},`input-group-${e.id}`)),rC("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"webauthn"===e.type&&rC("form",{action:e.callbackUrl,method:"POST",id:`${e.id}-form`,children:[rC("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.formFields).map(t=>rC("div",{children:[rC("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.formFields[t].label??t}),rC("input",{name:t,"data-form-field":!0,id:`input-${t}-for-${e.id}-provider`,type:e.formFields[t].type??"text",placeholder:e.formFields[t].placeholder??"",...e.formFields[t]})]},`input-group-${e.id}`)),rC("button",{id:`submitButton-${e.id}`,type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&i+1<r.length&&rC("hr",{})]},e.id)})]}),l&&rC(t5,{children:rC("script",{dangerouslySetInnerHTML:{__html:`
380const currentURL = window.location.href;
381const authURL = currentURL.substring(0, currentURL.lastIndexOf('/'));
382(${rR})(authURL, "${l}");
383`}})})]})}({csrfToken:e.csrfToken,providers:e.providers?.filter(e=>["email","oauth","oidc"].includes(e.type)||"credentials"===e.type&&e.credentials||"webauthn"===e.type&&e.formFields||!1),callbackUrl:e.callbackUrl,theme:e.theme,error:s,...n}),title:"Sign In",headTags:l})},signout:()=>o?.signOut?{redirect:o.signOut,cookies:i}:rN({cookies:i,theme:r,html:function(e){let{url:t,csrfToken:r,theme:n}=e;return rC("div",{className:"signout",children:[n?.brandColor&&rC("style",{dangerouslySetInnerHTML:{__html:`
384        :root {
385          --brand-color: ${n.brandColor}
386        }
387      `}}),n?.buttonText&&rC("style",{dangerouslySetInnerHTML:{__html:`
388        :root {
389          --button-text-color: ${n.buttonText}
390        }
391      `}}),rC("div",{className:"card",children:[n?.logo&&rC("img",{src:n.logo,alt:"Logo",className:"logo"}),rC("h1",{children:"Signout"}),rC("p",{children:"Are you sure you want to sign out?"}),rC("form",{action:t?.toString(),method:"POST",children:[rC("input",{type:"hidden",name:"csrfToken",value:r}),rC("button",{id:"submitButton",type:"submit",children:"Sign out"})]})]})]})}({csrfToken:e.csrfToken,url:t,theme:r}),title:"Sign Out"}),verifyRequest:e=>o?.verifyRequest?{redirect:o.verifyRequest,cookies:i}:rN({cookies:i,theme:r,html:function(e){let{url:t,theme:r}=e;return rC("div",{className:"verify-request",children:[r.brandColor&&rC("style",{dangerouslySetInnerHTML:{__html:`
392        :root {
393          --brand-color: ${r.brandColor}
394        }
395      `}}),rC("div",{className:"card",children:[r.logo&&rC("img",{src:r.logo,alt:"Logo",className:"logo"}),rC("h1",{children:"Check your email"}),rC("p",{children:"A sign in link has been sent to your email address."}),rC("p",{children:rC("a",{className:"site",href:t.origin,children:t.host})})]})]})}({url:t,theme:r,...e}),title:"Verify Request"}),error:e=>o?.error?{redirect:`${o.error}${o.error.includes("?")?"&":"?"}error=${e}`,cookies:i}:rN({cookies:i,theme:r,...function(e){let{url:t,error:r="default",theme:n}=e,i=`${t}/signin`,o={default:{status:200,heading:"Error",message:rC("p",{children:rC("a",{className:"site",href:t?.origin,children:t?.host})})},Configuration:{status:500,heading:"Server error",message:rC("div",{children:[rC("p",{children:"There is a problem with the server configuration."}),rC("p",{children:"Check the server logs for more information."})]})},AccessDenied:{status:403,heading:"Access Denied",message:rC("div",{children:[rC("p",{children:"You do not have permission to sign in."}),rC("p",{children:rC("a",{className:"button",href:i,children:"Sign in"})})]})},Verification:{status:403,heading:"Unable to sign in",message:rC("div",{children:[rC("p",{children:"The sign in link is no longer valid."}),rC("p",{children:"It may have been used already or it may have expired."})]}),signin:rC("a",{className:"button",href:i,children:"Sign in"})}},{status:a,heading:s,message:c,signin:l}=o[r]??o.default;return{status:a,html:rC("div",{className:"error",children:[n?.brandColor&&rC("style",{dangerouslySetInnerHTML:{__html:`
396        :root {
397          --brand-color: ${n?.brandColor}
398        }
399      `}}),rC("div",{className:"card",children:[n?.logo&&rC("img",{src:n?.logo,alt:"Logo",className:"logo"}),rC("h1",{children:s}),rC("div",{className:"message",children:c}),l]})]})}}({url:t,theme:r,error:e}),title:"Error"})}}function rj(e,t=Date.now()){return new Date(t+1e3*e)}async function r$(e,t,r,n){if(!r?.providerAccountId||!r.type)throw Error("Missing or invalid provider account");if(!["email","oauth","oidc","webauthn"].includes(r.type))throw Error("Provider not supported");let{adapter:i,jwt:o,events:a,session:{strategy:s,generateSessionToken:c}}=n;
399if(!i)return{user:t,account:r};let l=r,{createUser:u,updateUser:h,getUser:p,getUserByAccount:f,getUserByEmail:m,linkAccount:w,createSession:y,getSessionAndUser:g,deleteSession:b}=i,v=null,_=null,k=!1,A="jwt"===s;if(e){if(A)try{let t=n.cookies.sessionToken.name;(v=await o.decode({...o,token:e,salt:t}))&&"sub"in v&&v.sub&&(_=await p(v.sub))}catch{}else{let t=await g(e);t&&(v=t.session,_=t.user)}}if("email"===l.type){let r=await m(t.email);return r?(_?.id!==r.id&&!A&&e&&await b(e),_=await h({id:r.id,emailVerified:new Date}),await a.updateUser?.({user:_})):(_=await u({...t,emailVerified:new Date}),await a.createUser?.({user:_}),k=!0),{session:v=A?{}:await y({sessionToken:c(),userId:_.id,expires:rj(n.session.maxAge)}),user:_,isNewUser:k}}if("webauthn"===l.type){let e=await f({providerAccountId:l.providerAccountId,provider:l.provider});if(e){if(_){if(e.id===_.id){let e={...l,userId:_.id};return{session:v,user:_,isNewUser:k,account:e}}throw new d.FW("The account is already associated with another user",{provider:l.provider})}v=A?{}:await y({sessionToken:c(),userId:e.id,expires:rj(n.session.maxAge)});let t={...l,userId:e.id};return{session:v,user:e,isNewUser:k,account:t}}{if(_){await w({...l,userId:_.id}),await a.linkAccount?.({user:_,account:l,profile:t});let e={...l,userId:_.id};return{session:v,user:_,isNewUser:k,account:e}}if(t.email?await m(t.email):null)throw new d.FW("Another account already exists with the same e-mail address",{provider:l.provider});_=await u({...t}),await a.createUser?.({user:_}),await w({...l,userId:_.id}),await a.linkAccount?.({user:_,account:l,profile:t}),v=A?{}:await y({sessionToken:c(),userId:_.id,expires:rj(n.session.maxAge)});let e={...l,userId:_.id};return{session:v,user:_,isNewUser:!0,account:e}}}let E=await f({providerAccountId:l.providerAccountId,provider:l.provider});if(E){if(_){if(E.id===_.id)return{session:v,user:_,isNewUser:k};throw new d.Xw("The account is already associated with another user",{provider:l.provider})}return{session:v=A?{}:await y({sessionToken:c(),userId:E.id,expires:rj(n.session.maxAge)}),user:E,isNewUser:k}}{let{provider:e}=n,{type:r,provider:i,providerAccountId:o,userId:s,...h}=l;if(l=Object.assign(e.account(h)??{},{providerAccountId:o,provider:i,type:r,userId:s}),_)return await w({...l,userId:_.id}),await a.linkAccount?.({user:_,account:l,profile:t}),{session:v,user:_,isNewUser:k};let p=t.email?await m(t.email):null;if(p){let e=n.provider;if(e?.allowDangerousEmailAccountLinking)_=p;else throw new d.Xw("Another account already exists with the same e-mail address",{provider:l.provider})}else _=await u({...t,emailVerified:null});return await a.createUser?.({user:_}),await w({...l,userId:_.id}),await a.linkAccount?.({user:_,account:l,profile:t}),{session:v=A?{}:await y({sessionToken:c(),userId:_.id,expires:rj(n.session.maxAge)}),user:_,isNewUser:!0}}}function rL(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(o="oauth4webapi/v2.17.0");let rD=Symbol(),rM=Symbol(),rW=Symbol(),rK=Symbol(),rJ=Symbol();Symbol();let rF=Symbol(),rq=new TextEncoder,rB=new TextDecoder;function rz(e){return"string"==typeof e?rq.encode(e):rB.decode(e)}function rV(e){return"string"==typeof e?function(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}catch(e){throw new rY("The input to be decoded is not correctly encoded.",{cause:e})}}(e):function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));let t=[];for(let r=0;r<e.byteLength;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}(e)}class rG{constructor(e){this.cache=new Map,this._cache=new Map,this.maxSize=e}get(e){let t=this.cache.get(e);return t||((t=this._cache.get(e))?(this.update(e,t),t):void 0)}has(e){return this.cache.has(e)||this._cache.has(e)}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this.update(e,t),this}delete(e){return this.cache.has(e)?this.cache.delete(e):!!this._cache.has(e)&&this._cache.delete(e)}update(e,t){this.cache.set(e,t),this.cache.size>=this.maxSize&&(this._cache=this.cache,this.cache=new Map)}}
399class rX extends Error{constructor(e){super(e??"operation not supported"),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class rZ extends Error{constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}let rY=rZ,rQ=new rG(100);function r0(e){return e instanceof CryptoKey}function r1(e){return r0(e)&&"private"===e.type}function r2(e){try{let t=e.headers.get("dpop-nonce");t&&rQ.set(new URL(e.url).origin,t)}catch{}return e}function r5(e){return!(null===e||"object"!=typeof e||Array.isArray(e))}function r4(e){rL(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e);if(o&&!t.has("user-agent")&&t.set("user-agent",o),t.has("authorization"))throw TypeError('"options.headers" must not include the "authorization" header name');if(t.has("dpop"))throw TypeError('"options.headers" must not include the "dpop" header name');return t}function r6(e){if("function"==typeof e&&(e=e()),!(e instanceof AbortSignal))throw TypeError('"options.signal" must return or be an instance of AbortSignal');return e}async function r3(e,t){if(!(e instanceof URL))throw TypeError('"issuerIdentifier" must be an instance of URL');if("https:"!==e.protocol&&"http:"!==e.protocol)throw TypeError('"issuer.protocol" must be "https:" or "http:"');let r=new URL(e.href);switch(t?.algorithm){case void 0:case"oidc":r.pathname=`${r.pathname}/.well-known/openid-configuration`.replace("//","/");break;case"oauth2":"/"===r.pathname?r.pathname=".well-known/oauth-authorization-server":r.pathname=`.well-known/oauth-authorization-server/${r.pathname}`.replace("//","/");break;default:throw TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"')}let n=r4(t?.headers);return n.set("accept","application/json"),(t?.[rW]||fetch)(r.href,{headers:Object.fromEntries(n.entries()),method:"GET",redirect:"manual",signal:t?.signal?r6(t.signal):null}).then(r2)}function r8(e){return"string"==typeof e&&0!==e.length}async function r9(e,t){let r;if(!(e instanceof URL))throw TypeError('"expectedIssuer" must be an instance of URL');if(!rL(t,Response))throw TypeError('"response" must be an instance of Response');if(200!==t.status)throw new rY('"response" is not a conform Authorization Server Metadata response');nM(t);try{r=await t.json()}catch(e){throw new rY('failed to parse "response" body as JSON',{cause:e})}if(!r5(r))throw new rY('"response" body must be a top level object');if(!r8(r.issuer))throw new rY('"response" body "issuer" property must be a non-empty string');if(new URL(r.issuer).href!==e.href)throw new rY('"response" body "issuer" does not match "expectedIssuer"');return r}function r7(){return rV(crypto.getRandomValues(new Uint8Array(32)))}async function ne(e){if(!r8(e))throw TypeError('"codeVerifier" must be a non-empty string');return rV(await crypto.subtle.digest("SHA-256",rz(e)))}function nt(e){return encodeURIComponent(e).replace(/%20/g,"+")}function nr(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new rX("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new rX("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new rX("unsupported EcKeyAlgorithm namedCurve")}}(e);
399case"Ed25519":case"Ed448":return"EdDSA";default:throw new rX("unsupported CryptoKey algorithm name")}}function nn(e){let t=e?.[rD];return"number"==typeof t&&Number.isFinite(t)?t:0}function ni(e){let t=e?.[rM];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function no(){return Math.floor(Date.now()/1e3)}async function na(e,t,r,n,i){let o={alg:nr(r),kid:n},a=function(e,t){let r=no()+nn(t);return{jti:r7(),aud:[e.issuer,e.token_endpoint],exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}(e,t);return i?.(o,a),np(o,a,r)}function ns(e){if("object"!=typeof e||null===e)throw TypeError('"as" must be an object');if(!r8(e.issuer))throw TypeError('"as.issuer" property must be a non-empty string');return!0}function nc(e){if("object"!=typeof e||null===e)throw TypeError('"client" must be an object');if(!r8(e.client_id))throw TypeError('"client.client_id" property must be a non-empty string');return!0}function nl(e){if(!r8(e))throw TypeError('"client.client_secret" property must be a non-empty string');return e}function nu(e,t){if(void 0!==t)throw TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`)}function nd(e,t){if(void 0!==t)throw TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`)}async function nh(e,t,r,n,i){switch(r.delete("client_secret"),r.delete("client_assertion_type"),r.delete("client_assertion"),t.token_endpoint_auth_method){case void 0:case"client_secret_basic":nu("client_secret_basic",i),n.set("authorization",function(e,t){let r=nt(e),n=nt(t),i=btoa(`${r}:${n}`);return`Basic ${i}`}(t.client_id,nl(t.client_secret)));break;case"client_secret_post":nu("client_secret_post",i),r.set("client_id",t.client_id),r.set("client_secret",nl(t.client_secret));break;case"private_key_jwt":{if(nd("private_key_jwt",t.client_secret),void 0===i)throw TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');let{key:n,kid:o,modifyAssertion:a}=function(e){if(e instanceof CryptoKey)return{key:e};if(!(e?.key instanceof CryptoKey))return{};if(void 0!==e.kid&&!r8(e.kid))throw TypeError('"kid" must be a non-empty string');return{key:e.key,kid:e.kid,modifyAssertion:e[rK]}}(i);if(!r1(n))throw TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');r.set("client_id",t.client_id),r.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.set("client_assertion",await na(e,t,n,o,a));break}case"tls_client_auth":case"self_signed_tls_client_auth":case"none":nd(t.token_endpoint_auth_method,t.client_secret),nu(t.token_endpoint_auth_method,i),r.set("client_id",t.client_id);break;default:throw new rX("unsupported client token_endpoint_auth_method")}}async function np(e,t,r){if(!r.usages.includes("sign"))throw TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');let n=`${rV(rz(JSON.stringify(e)))}.${rV(rz(JSON.stringify(t)))}`,i=rV(await crypto.subtle.sign(nJ(r),r,rz(n)));return`${n}.${i}`}async function nf(e,t,r,n,i,o){let{privateKey:a,publicKey:s,nonce:c=rQ.get(r.origin)}=t;if(!r1(a))throw TypeError('"DPoP.privateKey" must be a private CryptoKey');if(!(r0(s)&&"public"===s.type))throw TypeError('"DPoP.publicKey" must be a public CryptoKey');if(void 0!==c&&!r8(c))throw TypeError('"DPoP.nonce" must be a non-empty string or undefined');if(!s.extractable)throw TypeError('"DPoP.publicKey.extractable" must be true');let l=no()+i,u={alg:nr(a),typ:"dpop+jwt",jwk:await nw(s)},d={iat:l,jti:r7(),htm:n,nonce:c,htu:`${r.origin}${r.pathname}`,ath:o?rV(await crypto.subtle.digest("SHA-256",rz(o))):void 0};t[rK]?.(u,d),e.set("dpop",await np(u,d,a))}async function nm(e){let{kty:t,e:r,n,x:i,y:o,crv:s}=await crypto.subtle.exportKey("jwk",e),c={kty:t,e:r,n,x:i,y:o,crv:s};return a.set(e,c),c}async function nw(e){return a||(a=new WeakMap),a.get(e)||nm(e)}function ny(e,t,r){if("string"!=typeof e){if(r)throw TypeError(`"as.mtls_endpoint_aliases.${t}" must be a string`);throw TypeError(`"as.${t}" must be a string`)}return new URL(e)}function ng(e,t,r=!1){return r&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?ny(e.mtls_endpoint_aliases[t],t,r):ny(e[t],t,r)}function nb(e,t){return!!(e.use_mtls_endpoint_aliases||t?.[rF])}function nv(e){return!("object"!=typeof e||Array.isArray(e))&&null!==e&&void 0!==e.error}let n_=/((?:,|, )?[0-9a-zA-Z!#$%&'*+-.^_`|~]+=)/,nk=/(?:^|, ?)([0-9a-zA-Z!#$%&'*+\-.^_`|~]+)(?=$|[ ,])/g;async function nA(e,t,r,n,i,o){if(!r8(e))throw TypeError('"accessToken" must be a non-empty string');
399if(!(r instanceof URL))throw TypeError('"url" must be an instance of URL');return n=r4(n),o?.DPoP===void 0?n.set("authorization",`Bearer ${e}`):(await nf(n,o.DPoP,r,t.toUpperCase(),nn({[rD]:o?.[rD]}),e),n.set("authorization",`DPoP ${e}`)),(o?.[rW]||fetch)(r.href,{body:i,headers:Object.fromEntries(n.entries()),method:t,redirect:"manual",signal:o?.signal?r6(o.signal):null}).then(r2)}async function nE(e,t,r,n){ns(e),nc(t);let i=ng(e,"userinfo_endpoint",nb(t,n)),o=r4(n?.headers);return t.userinfo_signed_response_alg?o.set("accept","application/jwt"):(o.set("accept","application/json"),o.append("accept","application/jwt")),nA(r,"GET",i,o,null,{...n,[rD]:nn(t)})}async function nS(e,t,r,n,i,o,a){return await nh(e,t,i,o,a?.clientPrivateKey),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(a?.[rW]||fetch)(n.href,{body:i,headers:Object.fromEntries(o.entries()),method:r,redirect:"manual",signal:a?.signal?r6(a.signal):null}).then(r2)}async function nx(e,t,r,n,i){let o=ng(e,"token_endpoint",nb(t,i));n.set("grant_type",r);let a=r4(i?.headers);return a.set("accept","application/json"),i?.DPoP!==void 0&&await nf(a,i.DPoP,o,"POST",nn(t)),nS(e,t,"POST",o,n,a,i)}Symbol();let nT=new WeakMap;function nP(e){if(!e.id_token)return;let t=nT.get(e);if(!t)throw TypeError('"ref" was already garbage collected or did not resolve from the proper sources');return t[0]}async function nC(e,t,r,n=!1,i=!1){let o;if(ns(e),nc(t),!rL(r,Response))throw TypeError('"response" must be an instance of Response');if(200!==r.status){let e;if(e=await nW(r))return e;throw new rY('"response" is not a conform Token Endpoint response')}nM(r);try{o=await r.json()}catch(e){throw new rY('failed to parse "response" body as JSON',{cause:e})}if(!r5(o))throw new rY('"response" body must be a top level object');if(!r8(o.access_token))throw new rY('"response" body "access_token" property must be a non-empty string');if(!r8(o.token_type))throw new rY('"response" body "token_type" property must be a non-empty string');if(o.token_type=o.token_type.toLowerCase(),"dpop"!==o.token_type&&"bearer"!==o.token_type)throw new rX("unsupported `token_type` value");if(void 0!==o.expires_in&&("number"!=typeof o.expires_in||o.expires_in<=0))throw new rY('"response" body "expires_in" property must be a positive number');if(!i&&void 0!==o.refresh_token&&!r8(o.refresh_token))throw new rY('"response" body "refresh_token" property must be a non-empty string');if(void 0!==o.scope&&"string"!=typeof o.scope)throw new rY('"response" body "scope" property must be a string');if(!n){if(void 0!==o.id_token&&!r8(o.id_token))throw new rY('"response" body "id_token" property must be a non-empty string');if(o.id_token){let{claims:r,jwt:n}=await nB(o.id_token,nz.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported),nF,nn(t),ni(t),t[rJ]).then(nH.bind(void 0,["aud","exp","iat","iss","sub"])).then(nO.bind(void 0,e.issuer)).then(nR.bind(void 0,t.client_id));if(Array.isArray(r.aud)&&1!==r.aud.length){if(void 0===r.azp)throw new rY('ID Token "aud" (audience) claim includes additional untrusted audiences');if(r.azp!==t.client_id)throw new rY('unexpected ID Token "azp" (authorized party) claim value')}if(void 0!==r.auth_time&&(!Number.isFinite(r.auth_time)||1!==Math.sign(r.auth_time)))throw new rY('ID Token "auth_time" (authentication time) must be a positive number');nT.set(o,[r,n])}}return o}function nR(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw new rY('unexpected JWT "aud" (audience) claim value')}else if(t.claims.aud!==e)throw new rY('unexpected JWT "aud" (audience) claim value');return t}function nO(e,t){if(t.claims.iss!==e)throw new rY('unexpected JWT "iss" (issuer) claim value');return t}new WeakMap;let nU=new WeakSet;async function nI(e,t,r,n,i,o){if(ns(e),nc(t),!nU.has(r))throw TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');if(!r8(n))throw TypeError('"redirectUri" must be a non-empty string');if(!r8(i))throw TypeError('"codeVerifier" must be a non-empty string');let a=nV(r,"code");if(!a)throw new rY('no authorization code in "callbackParameters"');let s=new URLSearchParams(o?.additionalParameters);
399return s.set("redirect_uri",n),s.set("code_verifier",i),s.set("code",a),nx(e,t,"authorization_code",s,o)}let nN={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation"};function nH(e,t){for(let r of e)if(void 0===t.claims[r])throw new rY(`JWT "${r}" (${nN[r]}) claim missing`);return t}let nj=Symbol(),n$=Symbol();async function nL(e,t,r,n,i){let o=await nC(e,t,r);if(nv(o))return o;if(!r8(o.id_token))throw new rY('"response" body "id_token" property must be a non-empty string');i??(i=t.default_max_age??n$);let a=nP(o);if((t.require_auth_time||i!==n$)&&void 0===a.auth_time)throw new rY('ID Token "auth_time" (authentication time) claim missing');if(i!==n$){if("number"!=typeof i||i<0)throw TypeError('"maxAge" must be a non-negative number');let e=no()+nn(t),r=ni(t);if(a.auth_time+i<e-r)throw new rY("too much time has elapsed since the last End-User authentication")}switch(n){case void 0:case nj:if(void 0!==a.nonce)throw new rY('unexpected ID Token "nonce" claim value');break;default:if(!r8(n))throw TypeError('"expectedNonce" must be a non-empty string');if(void 0===a.nonce)throw new rY('ID Token "nonce" claim missing');if(a.nonce!==n)throw new rY('unexpected ID Token "nonce" claim value')}return o}async function nD(e,t,r){let n=await nC(e,t,r,!0);if(nv(n))return n;if(void 0!==n.id_token){if("string"==typeof n.id_token&&n.id_token.length)throw new rY("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");delete n.id_token}return n}function nM(e){if(e.bodyUsed)throw TypeError('"response" body has been used already')}async function nW(e){if(e.status>399&&e.status<500){nM(e);try{let t=await e.json();if(r5(t)&&"string"==typeof t.error&&t.error.length)return void 0!==t.error_description&&"string"!=typeof t.error_description&&delete t.error_description,void 0!==t.error_uri&&"string"!=typeof t.error_uri&&delete t.error_uri,void 0!==t.algs&&"string"!=typeof t.algs&&delete t.algs,void 0!==t.scope&&"string"!=typeof t.scope&&delete t.scope,t}catch{}}}function nK(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new rY(`${e.name} modulusLength must be at least 2048 bits`)}function nJ(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:function(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new rX}}(e.algorithm.namedCurve)};case"RSA-PSS":switch(nK(e.algorithm),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new rX}case"RSASSA-PKCS1-v1_5":return nK(e.algorithm),e.algorithm.name;case"Ed448":case"Ed25519":return e.algorithm.name}throw new rX}let nF=Symbol();async function nq(e,t,r,n){let i=`${e}.${t}`;if(!await crypto.subtle.verify(nJ(r),r,n,rz(i)))throw new rY("JWT signature verification failed")}async function nB(e,t,r,n,i,o){let a,s,c,{0:l,1:u,2:d,length:h}=e.split(".");if(5===h){if(void 0!==o)e=await o(e),{0:l,1:u,2:d,length:h}=e.split(".");else throw new rX("JWE structure JWTs are not supported")}if(3!==h)throw new rY("Invalid JWT");try{a=JSON.parse(rz(rV(l)))}catch(e){throw new rY("failed to parse JWT Header body as base64url encoded JSON",{cause:e})}if(!r5(a))throw new rY("JWT Header must be a top level object");if(t(a),void 0!==a.crit)throw new rY('unexpected JWT "crit" header parameter');let p=rV(d);r!==nF&&(s=await r(a),await nq(l,u,s,p));try{c=JSON.parse(rz(rV(u)))}catch(e){throw new rY("failed to parse JWT Payload body as base64url encoded JSON",{cause:e})}if(!r5(c))throw new rY("JWT Payload must be a top level object");let f=no()+n;if(void 0!==c.exp){if("number"!=typeof c.exp)throw new rY('unexpected JWT "exp" (expiration time) claim type');if(c.exp<=f-i)throw new rY('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()')}if(void 0!==c.iat&&"number"!=typeof c.iat)throw new rY('unexpected JWT "iat" (issued at) claim type');if(void 0!==c.iss&&"string"!=typeof c.iss)throw new rY('unexpected JWT "iss" (issuer) claim type');if(void 0!==c.nbf){if("number"!=typeof c.nbf)throw new rY('unexpected JWT "nbf" (not before) claim type');if(c.nbf>f+i)throw new rY('unexpected JWT "nbf" (not before) claim value, timestamp is > now()')}if(void 0!==c.aud&&"string"!=typeof c.aud&&!Array.isArray(c.aud))throw new rY('unexpected JWT "aud" (audience) claim type');return{header:a,claims:c,signature:p,key:s,jwt:e}}function nz(e,t,r){if(void 0!==e){if(r.alg!==e)throw new rY('unexpected JWT "alg" header parameter');return}if(Array.isArray(t)){if(!t.includes(r.alg))throw new rY('unexpected JWT "alg" header parameter');return}if("RS256"!==r.alg)throw new rY('unexpected JWT "alg" header parameter')}function nV(e,t){let{0:r,length:n}=e.getAll(t);if(n>1)throw new rY(`"${t}" parameter must be provided only once`);return r}let nG=Symbol(),nX=Symbol();async function nZ(e,t,r,n,i){let{cookies:o,logger:a}=n;a.debug(`CREATE_${e.toUpperCase()}`,{value:t,maxAge:r});let s=new Date;s.setTime(s.getTime()+1e3*r);let c={value:t};"state"===e&&i&&(c.data=i);let l=o[e].name;return{name:l,value:await ty({...n.jwt,maxAge:r,token:c,salt:l}),options:{...o[e].options,expires:s}}}let nY={async create(e){let t=r7(),r=await ne(t);return{cookie:await nZ("pkceCodeVerifier",t,900,e),value:r}},async use(e,t,r){let{provider:n}=r;if(!n?.checks?.includes("pkce"))return;let i=e?.[r.cookies.pkceCodeVerifier.name];if(!i)throw new d.gS("PKCE code_verifier cookie was missing.");let o=await tg({...r.jwt,token:i,salt:r.cookies.pkceCodeVerifier.name});if(!o?.value)throw new d.gS("PKCE code_verifier value could not be parsed.");return t.push({name:r.cookies.pkceCodeVerifier.name,value:"",options:{...r.co
399okies.pkceCodeVerifier.options,maxAge:0}}),o.value}};function nQ(e){try{let t=new TextDecoder;return JSON.parse(t.decode(L(e)))}catch{}}let n0={async create(e,t){let{provider:r}=e;if(!r.checks.includes("state")){if(t)throw new d.gS("State data was provided but the provider is not configured to use state.");return}let n=j(JSON.stringify({...t,random:r7()}));return{cookie:await nZ("state",n,900,e,t),value:n}},async use(e,t,r,n){let{provider:i}=r;if(!i.checks.includes("state"))return;let o=e?.[r.cookies.state.name];if(!o)throw new d.gS("State cookie was missing.");let a=await tg({...r.jwt,token:o,salt:r.cookies.state.name});if(!a?.value)throw new d.gS("State (cookie) value could not be parsed.");let s=nQ(a.value);if(!s)throw new d.gS("State (encoded) value could not be parsed.");if(s.random!==n)throw new d.gS(`Random state values did not match. Expected: ${s.random}. Got: ${n}`);return t.push({name:r.cookies.state.name,value:"",options:{...r.cookies.state.options,maxAge:0}}),a.value}},n1={async create(e){if(!e.provider.checks.includes("nonce"))return;let t=r7();return{cookie:await nZ("nonce",t,900,e),value:t}},async use(e,t,r){let{provider:n}=r;if(!n?.checks?.includes("nonce"))return;let i=e?.[r.cookies.nonce.name];if(!i)throw new d.gS("Nonce cookie was missing.");let o=await tg({...r.jwt,token:i,salt:r.cookies.nonce.name});if(!o?.value)throw new d.gS("Nonce value could not be parsed.");return t.push({name:r.cookies.nonce.name,value:"",options:{...r.cookies.nonce.options,maxAge:0}}),o.value}},n2={create:async(e,t,r)=>({cookie:await nZ("webauthnChallenge",JSON.stringify({challenge:t,registerData:r}),900,e)}),async use(e,t,r){let n=t?.[e.cookies.webauthnChallenge.name];if(!n)throw new d.gS("Challenge cookie missing.");let i=await tg({...e.jwt,token:n,salt:e.cookies.webauthnChallenge.name});if(!i?.value)throw new d.gS("Challenge value could not be parsed.");let o={name:e.cookies.webauthnChallenge.name,value:"",options:{...e.cookies.webauthnChallenge.options,maxAge:0}};return r.push(o),JSON.parse(i.value)}};async function n5(e,t,r,n){let i,o,a;let{logger:s,provider:c}=r,{token:l,userinfo:u}=c;if(l?.url&&"authjs.dev"!==l.url.host||u?.url&&"authjs.dev"!==u.url.host)i={issuer:c.issuer??"https://authjs.dev",token_endpoint:l?.url.toString(),userinfo_endpoint:u?.url.toString()};else{let e=new URL(c.issuer),t=await r3(e),r=await r9(e,t);if(!r.token_endpoint)throw TypeError("TODO: Authorization server did not provide a token endpoint.");if(!r.userinfo_endpoint)throw TypeError("TODO: Authorization server did not provide a userinfo endpoint.");i=r}let h={client_id:c.clientId,client_secret:c.clientSecret,...c.client},p=[],f=await n0.use(t,p,r,n),m=function(e,t,r,n){var i;if(ns(e),nc(t),r instanceof URL&&(r=r.searchParams),!(r instanceof URLSearchParams))throw TypeError('"parameters" must be an instance of URLSearchParams, or URL');if(nV(r,"response"))throw new rY('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');let o=nV(r,"iss"),a=nV(r,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw new rY('response parameter "iss" (issuer) missing');if(o&&o!==e.issuer)throw new rY('unexpected "iss" (issuer) response parameter value');switch(n){case void 0:case nX:if(void 0!==a)throw new rY('unexpected "state" response parameter encountered');break;case nG:break;default:if(!r8(n))throw new rY('"expectedState" must be a non-empty string');if(void 0===a)throw new rY('response parameter "state" missing');if(a!==n)throw new rY('unexpected "state" response parameter value')}let s=nV(r,"error");if(s)return{error:s,error_description:nV(r,"error_description"),error_uri:nV(r,"error_uri")};let c=nV(r,"id_token"),l=nV(r,"token");if(void 0!==c||void 0!==l)throw new rX("implicit and hybrid flows are not supported");return i=new URLSearchParams(r),nU.add(i),i}(i,h,new URLSearchParams(e),c.checks.includes("state")?f:nG);if(nv(m)){let e={providerId:c.id,...m};throw s.debug("OAuthCallbackError",e),new d.iV("OAuth Provider returned an error",e)}let w=await nY.use(t,p,r),y=c.callbackUrl;!r.isOnRedirectProxy&&c.redirectProxyUrl&&(y=c.redirectProxyUrl);let g=await nI(i,h,m,y,w??"auth");if(c.token?.conform&&(g=await c.token.conform(g.clone())??g),o=function(e){if(!rL(e,Response))throw TypeError('"response" must be an instance of Response');let t=e.headers.get("www-authenticate");if(null===t)return;let r=[];for(let{1:e,index:n}of t.matchAll(nk))r.push([e,n]);if(r.length)return r.map(([e,r],n,i)=>{let o=i[n+1];return function(e,t){let r=t.split(n_).slice(1);if(!r.length)return{scheme:e.toLowerCase(),parameters:{}};r[r.length-1]=r[r.length-1].replace(/,$/,"");let n={};for(let e=1;e<r.length;e+=2){var i;let t=e;if('"'===r[t][0])for(;'"'!==r[t].slice(-1)&&++e<r.length;)r[t]+=r[e];n[r[t-1].replace(/^(?:, ?)|=$/g,"").toLowerCase()]=(i=r[t]).length>=2&&'"'===i[0]&&'"'===i[i.length-1]?i.slice(1,-1):i}return{scheme:e.toLowerCase(),parameters:n}}(e,o?t.slice(r,o[1]):t.slice(r))})}(g)){for(let e of o)console.log("challenge",e);throw Error("TODO: Handle www-authenticate challenges as needed")}let b={};if("oidc"===c.type){let e=await n1.use(t,p,r),n=await nL(i,h,g,e??nj);if(nv(n))throw console.log("error",n),Error("TODO: Handle OIDC response body error");b=nP(n),a=n}else{if(nv(a=await nD(i,h,g)))throw console.log("error",a),Error("TODO: Handle OAuth 2.0 response body error");
399if(u?.request){let e=await u.request({tokens:a,provider:c});e instanceof Object&&(b=e)}else if(u?.url){let e=await nE(i,h,a.access_token);b=await e.json()}else throw TypeError("No userinfo endpoint configured")}return a.expires_in&&(a.expires_at=Math.floor(Date.now()/1e3)+Number(a.expires_in)),{...await n4(b,c,a,s),profile:b,cookies:p}}async function n4(e,t,r,n){try{let n=await t.profile(e,r);return{user:{...n,id:crypto.randomUUID(),email:n.email?.toLowerCase()},account:{...r,provider:t.id,type:t.type,providerAccountId:n.id??crypto.randomUUID()}}}catch(r){n.debug("getProfile error details",e),n.error(new d.X0(r,{provider:t.id}))}}var n6=r(93638).Buffer;async function n3(e,t,r,n){let i=await it(e,t,r),{cookie:o}=await n2.create(e,i.challenge,r);return{status:200,cookies:[...n??[],o],body:{action:"register",options:i},headers:{"Content-Type":"application/json"}}}async function n8(e,t,r,n){let i=await ie(e,t,r),{cookie:o}=await n2.create(e,i.challenge);return{status:200,cookies:[...n??[],o],body:{action:"authenticate",options:i},headers:{"Content-Type":"application/json"}}}async function n9(e,t,r){let n;let{adapter:i,provider:o}=e,a=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!a||"object"!=typeof a||!("id"in a)||"string"!=typeof a.id)throw new d.l4("Invalid WebAuthn Authentication response.");let s=io(ii(a.id)),c=await i.getAuthenticator(s);if(!c)throw new d.l4(`WebAuthn authenticator not found in database: ${JSON.stringify({credentialID:s})}`);let{challenge:l}=await n2.use(e,t.cookies,r);try{let r=o.getRelayingParty(e,t);n=await o.simpleWebAuthn.verifyAuthenticationResponse({...o.verifyAuthenticationOptions,expectedChallenge:l,response:a,authenticator:{...c,credentialDeviceType:c.credentialDeviceType,transports:ia(c.transports),credentialID:ii(c.credentialID),credentialPublicKey:ii(c.credentialPublicKey)},expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new d.vV(e)}let{verified:u,authenticationInfo:h}=n;if(!u)throw new d.vV("WebAuthn authentication response could not be verified.");try{let{newCounter:e}=h;await i.updateAuthenticatorCounter(c.credentialID,e)}catch(e){throw new d.dq(`Failed to update authenticator counter. This may cause future authentication attempts to fail. ${JSON.stringify({credentialID:s,oldCounter:c.counter,newCounter:h.newCounter})}`,e)}let p=await i.getAccount(c.providerAccountId,o.id);if(!p)throw new d.l4(`WebAuthn account not found in database: ${JSON.stringify({credentialID:s,providerAccountId:c.providerAccountId})}`);let f=await i.getUser(p.userId);if(!f)throw new d.l4(`WebAuthn user not found in database: ${JSON.stringify({credentialID:s,providerAccountId:c.providerAccountId,userID:p.userId})}`);return{account:p,user:f}}async function n7(e,t,r){var n;let i;let{provider:o}=e,a=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!a||"object"!=typeof a||!("id"in a)||"string"!=typeof a.id)throw new d.l4("Invalid WebAuthn Registration response.");let{challenge:s,registerData:c}=await n2.use(e,t.cookies,r);if(!c)throw new d.l4("Missing user registration data in WebAuthn challenge cookie.");try{let r=o.getRelayingParty(e,t);i=await o.simpleWebAuthn.verifyRegistrationResponse({...o.verifyRegistrationOptions,expectedChallenge:s,response:a,expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new d.vV(e)}if(!i.verified||!i.registrationInfo)throw new d.vV("WebAuthn registration response could not be verified.");let l={providerAccountId:io(i.registrationInfo.credentialID),provider:e.provider.id,type:o.type},u={providerAccountId:l.providerAccountId,counter:i.registrationInfo.counter,credentialID:io(i.registrationInfo.credentialID),credentialPublicKey:io(i.registrationInfo.credentialPublicKey),credentialBackedUp:i.registrationInfo.credentialBackedUp,credentialDeviceType:i.registrationInfo.credentialDeviceType,transports:(n=a.response.transports,n?.join(","))};return{user:c,account:l,authenticator:u}}async function ie(e,t,r){let{provider:n,adapter:i}=e,o=r&&r.id?await i.listAuthenticatorsByUserId(r.id):null,a=n.getRelayingParty(e,t);return await n.simpleWebAuthn.generateAuthenticationOptions({...n.authenticationOptions,rpID:a.id,allowCredentials:o?.map(e=>({id:ii(e.credentialID),type:"public-key",transports:ia(e.transports)}))})}async function it(e,t,r){let{provider:n,adapter:i}=e,o=r.id?await i.listAuthenticatorsByUserId(r.id):null,a=tx(32),s=n.getRelayingParty(e,t);return await n.simpleWebAuthn.generateRegistrationOptions({...n.registrationOptions,userID:a,userName:r.email,userDisplayName:r.name??void 0,rpID:s.id,rpName:s.name,excludeCredentials:o?.map(e=>({id:ii(e.credentialID),type:"public-key",transports:ia(e.transports)}))})}function ir(e){let{provider:t,adapter:r}=e;if(!r)throw new d.Xp("An adapter is required for the WebAuthn provider");if(!t||"webauthn"!==t.type)throw new d.Ab("Provider must be WebAuthn");return{...e,provider:t,adapter:r}}function ii(e){return new Uint8Array(n6.from(e,"base64"))}function io(e){return n6.from(e).toString("base64")}function ia(e){return e?e.split(","):void 0}async function is(e,t,r,n){if(!t.provider)throw new d.Ab("Callback route called without provider");let{query:i,body:o,method:a,headers:s}=e,{provider:c,adapter:l,url:u,callbackUrl:h,pages:p,jwt:f,events:m,callbacks:w,session:{strategy:y,maxAge:g},logger:b}=t,v="jwt"===y;try{if("oauth"===c.type||"oidc"===c.type){let o;let{proxyRedirect:a,randomState:s}=function(e,t,r){let n,i;if(t.redirectProxyUrl&&!e?.state)throw new d.gS("Missing state in query, but required for redirect proxy");let o=nQ(e?.state);if(n=o?.random,r){if(!o?.origin)return{randomState:n};i=`${o.origin}?${new URLSearchParams(e)}`}return{randomState:n,proxyRedirect:i}}(i,c,t.isOnRedirectProxy);if(a)return b.debug("proxy redirect",{proxyRedirect:a,randomState:s}),{redirect:a};let y=await n5(i,e.cookies,t,s);y.cookies.length&&n.push(...y.cookies),b.debug("authorization result",y);let{user:_,account:k,profile:A}=y;if(!_||!k||!A)return{redirect:`${u}/signin`,cookies:n};if(l){let{getUserByAccount:e}=l;o=await e({providerAccountId:k.providerAccountId,provider:c.id})}let E=await ic({user:o??_,account:k,profile:A},t);if(E)return{redirect:E,cookies:n};let{user:S,session:x,isNewUser:T}=await r$(r.value,_,k,t);
399if(v){let e={name:S.name,email:S.email,picture:S.image,sub:S.id?.toString()},i=await w.jwt({token:e,user:S,account:k,profile:A,isNewUser:T,trigger:T?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,o=await f.encode({...f,token:i,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*g);let s=r.chunk(o,{expires:a});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:x.sessionToken,options:{...t.cookies.sessionToken.options,expires:x.expires}});if(await m.signIn?.({user:S,account:k,profile:A,isNewUser:T}),T&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:h})}`,cookies:n};return{redirect:h,cookies:n}}if("email"===c.type){let e=i?.token,o=i?.email;if(!e||!o){let t=TypeError("Missing token or email. The sign-in URL was manually opened without token/identifier or the link was not sent correctly in the email.",{cause:{hasToken:!!e,hasEmail:!!o}});throw t.name="Configuration",t}let a=c.secret??t.secret,s=await l.useVerificationToken({identifier:o,token:await tS(`${e}${a}`)}),u=!!s,y=s?s.expires.valueOf()<Date.now():void 0;if(!u||y)throw new d.GX({hasInvite:u,expired:y});let b=await l.getUserByEmail(o)??{id:crypto.randomUUID(),email:o,emailVerified:null},_={providerAccountId:b.email,userId:b.id,type:"email",provider:c.id},k=await ic({user:b,account:_},t);if(k)return{redirect:k,cookies:n};let{user:A,session:E,isNewUser:S}=await r$(r.value,b,_,t);if(v){let e={name:A.name,email:A.email,picture:A.image,sub:A.id?.toString()},i=await w.jwt({token:e,user:A,account:_,isNewUser:S,trigger:S?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,o=await f.encode({...f,token:i,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*g);let s=r.chunk(o,{expires:a});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:E.sessionToken,options:{...t.cookies.sessionToken.options,expires:E.expires}});if(await m.signIn?.({user:A,account:_,isNewUser:S}),S&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:h})}`,cookies:n};return{redirect:h,cookies:n}}if("credentials"===c.type&&"POST"===a){let e=o??{};Object.entries(i??{}).forEach(([e,t])=>u.searchParams.set(e,t));let l=await c.authorize(e,new Request(u,{headers:s,method:a,body:JSON.stringify(o)})),p=l&&{...l,id:l?.id?.toString()??crypto.randomUUID()};if(!p)throw new d.UC;let y={providerAccountId:p.id,type:"credentials",provider:c.id},b=await ic({user:p,account:y,credentials:e},t);if(b)return{redirect:b,cookies:n};let v={name:p.name,email:p.email,picture:p.image,sub:p.id},_=await w.jwt({token:v,user:p,account:y,isNewUser:!1,trigger:"signIn"});if(null===_)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,i=await f.encode({...f,token:_,salt:e}),o=new Date;o.setTime(o.getTime()+1e3*g);let a=r.chunk(i,{expires:o});n.push(...a)}return await m.signIn?.({user:p,account:y}),{redirect:h,cookies:n}}if("webauthn"===c.type&&"POST"===a){let i,o,a;let s=e.body?.action;if("string"!=typeof s||"authenticate"!==s&&"register"!==s)throw new d.l4("Invalid action parameter");let c=ir(t);switch(s){case"authenticate":{let t=await n9(c,e,n);i=t.user,o=t.account;break}case"register":{let r=await n7(t,e,n);i=r.user,o=r.account,a=r.authenticator}}await ic({user:i,account:o},t);let{user:l,isNewUser:u,session:y,account:b}=await r$(r.value,i,o,t);if(!b)throw new d.l4("Error creating or finding account");if(a&&l.id&&await c.adapter.createAuthenticator({...a,userId:l.id}),v){let e={name:l.name,email:l.email,picture:l.image,sub:l.id?.toString()},i=await w.jwt({token:e,user:l,account:b,isNewUser:u,trigger:u?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,o=await f.encode({...f,token:i,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*g);let s=r.chunk(o,{expires:a});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:y.sessionToken,options:{...t.cookies.sessionToken.options,expires:y.expires}});if(await m.signIn?.({user:l,account:b,isNewUser:u}),u&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:h})}`,cookies:n};return{redirect:h,cookies:n}}throw new d.Ab(`Callback for provider type (${c.type}) is not supported`)}catch(t){if(t instanceof d.l4)throw t;let e=new d.Ng(t,{provider:c.id});throw b.debug("callback route error details",{method:a,query:i,body:o}),e}}async function ic(e,t){let r;let{signIn:n,redirect:i}=t.callbacks;try{r=await n(e)}catch(e){if(e instanceof d.l4)throw e;throw new d.NX(e)}if(!r)throw new d.NX("AccessDenied");if("string"==typeof r)return await i({url:r,baseUrl:t.url.origin})}async function il(e,t,r,n,i){let{adapter:o,jwt:a,events:s,callbacks:c,logger:l,session:{strategy:u,maxAge:h}}=e,p={body:null,headers:{"Content-Type":"application/json"},cookies:r},f=t.value;if(!f)return p;if("jwt"===u){try{let r=e.cookies.sessionToken.name,o=await a.decode({...a,token:f,salt:r});if(!o)throw Error("Invalid JWT");let l=await c.jwt({token:o,...n&&{trigger:"update"},session:i}),u=rj(h);if(null!==l){let e={user:{name:l.name,email:l.email,image:l.picture},expires:u.toISOString()},n=await c.session({session:e,token:l});p.body=n;let i=await a.encode({...a,token:l,salt:r}),o=t.chunk(i,{expires:u});p.cookies?.push(...o),await s.session?.({session:n,token:l})}else p.cookies?.push(...t.clean())}catch(e){l.error(new d.xo(e)),p.cookies?.push(...t.clean())}return p}try{let{getSessionAndUser:r,deleteSession:a,updateSession:l}=o,u=await r(f);if(u&&u.session.expires.valueOf()<Date.now()&&(await a(f),u=null),u){let{user:t,session:r}=u,o=e.session.updateAge,a=r.expires.valueOf()-1e3*h+1e3*o,d=rj(h);a<=Date.now()&&await l({sessionToken:f,expires:d});let m=await c.session({session:{...r,user:t},user:t,newSession:i,...n?{trigger:"update"}:{}});p.body=m,p.cookies?.push({name:e.cookies.sessionToken.name,value:f,options:{...e.cookies.sessionToken.options,expires:d}}),await s.session?.({session:m})}else f&&p.cookies?.push(...t.clean())}catch(e){l.error(new d.li(e))}return p}async function iu(e,t){let r,n;let{logger:i,provider:o}=t,a=o.authorization?.url;if(!a||"authjs.dev"===a.host){let e=new URL(o.issuer),t=await r3(e),r=await r9(e,t);if(!r.authorization_endpoint)throw TypeError("Authorization server did not provide an authorization endpoint.");a=new URL(r.authorization_endpoint)}let s=a.searchParams,c=o.callbackUrl;!t.isOnRedirectProxy&&o.redirectProxyUrl&&(c=o.redirectProxyUrl,n={origin:o.callbackUrl},i.debug("using redirect proxy",{redirect_uri:c,data:n}));let l=Object.assign({response_type:"code",client_id:o.clientId,redirect_uri:c,...o.authorization?.params},Object.fromEntries(o.authorization?.url.searchParams??[]),e);for(let e in l)s.set(e,l[e]);let u=[],d=await n0.create(t,n);if(d&&(s.set("state",d.value),u.push(d.cookie)),o.checks?.includes("pkce")){if(r&&!r.code_challenge_methods_supported?.includes("S256"))"oidc"===o.type&&(o.checks=["nonce"]);else{let{value:e,cookie:r}=await nY.create(t);
399s.set("code_challenge",e),s.set("code_challenge_method","S256"),u.push(r)}}let h=await n1.create(t);return h&&(s.set("nonce",h.value),u.push(h.cookie)),"oidc"!==o.type||a.searchParams.has("scope")||a.searchParams.set("scope","openid profile email"),i.debug("authorization url is ready",{url:a,cookies:u,provider:o}),{redirect:a.toString(),cookies:u}}async function id(e,t){let r;let{body:n}=e,{provider:i,callbacks:o,adapter:a}=t,s=(i.normalizeIdentifier??function(e){if(!e)throw Error("Missing email from request body.");let[t,r]=e.toLowerCase().trim().split("@");return r=r.split(",")[0],`${t}@${r}`})(n?.email),c={id:crypto.randomUUID(),email:s,emailVerified:null},l=await a.getUserByEmail(s)??c,u={providerAccountId:s,userId:l.id,type:"email",provider:i.id};try{r=await o.signIn({user:l,account:u,email:{verificationRequest:!0}})}catch(e){throw new d.NX(e)}if(!r)throw new d.NX("AccessDenied");if("string"==typeof r)return{redirect:await o.redirect({url:r,baseUrl:t.url.origin})};let{callbackUrl:h,theme:p}=t,f=await i.generateVerificationToken?.()??tx(32),m=new Date(Date.now()+(i.maxAge??86400)*1e3),w=i.secret??t.secret,y=new URL(t.basePath,t.url.origin),g=i.sendVerificationRequest({identifier:s,token:f,expires:m,url:`${y}/callback/${i.id}?${new URLSearchParams({callbackUrl:h,token:f,email:s})}`,provider:i,theme:p,request:new Request(e.url,{headers:e.headers,method:e.method,body:"POST"===e.method?JSON.stringify(e.body??{}):void 0})}),b=a.createVerificationToken?.({identifier:s,token:await tS(`${f}${w}`),expires:m});return await Promise.all([g,b]),{redirect:`${y}/verify-request?${new URLSearchParams({provider:i.id,type:i.type})}`}}async function ih(e,t,r){let n=`${r.url.origin}${r.basePath}/signin`;if(!r.provider)return{redirect:n,cookies:t};switch(r.provider.type){case"oauth":case"oidc":{let{redirect:n,cookies:i}=await iu(e.query,r);return i&&t.push(...i),{redirect:n,cookies:t}}case"email":return{...await id(e,r),cookies:t};default:return{redirect:n,cookies:t}}}async function ip(e,t,r){let{jwt:n,events:i,callbackUrl:o,logger:a,session:s}=r,c=t.value;if(!c)return{redirect:o,cookies:e};try{if("jwt"===s.strategy){let e=r.cookies.sessionToken.name,t=await n.decode({...n,token:c,salt:e});await i.signOut?.({token:t})}else{let e=await r.adapter?.deleteSession(c);await i.signOut?.({session:e})}}catch(e){a.error(new d.V1(e))}return e.push(...t.clean()),{redirect:o,cookies:e}}async function im(e,t){let{adapter:r,jwt:n,session:{strategy:i}}=e,o=t.value;if(!o)return null;if("jwt"===i){let t=e.cookies.sessionToken.name,r=await n.decode({...n,token:o,salt:t});if(r&&r.sub)return{id:r.sub,name:r.name,email:r.email,image:r.picture}}else{let e=await r?.getSessionAndUser(o);if(e)return e.user}return null}async function iw(e,t,r,n){let i=ir(t),{provider:o}=i,{action:a}=e.query??{};if("register"!==a&&"authenticate"!==a&&void 0!==a)return{status:400,body:{error:"Invalid action"},cookies:n,headers:{"Content-Type":"application/json"}};let s=await im(t,r),c=s?{user:s,exists:!0}:await o.getUserInfo(t,e),l=c?.user;switch(function(e,t,r){let{user:n,exists:i=!1}=r??{};switch(e){case"authenticate":return"authenticate";case"register":if(n&&t===i)return"register";break;case void 0:if(!t){if(!n||i)return"authenticate";return"register"}}return null}(a,!!s,c)){case"authenticate":return n8(i,e,l,n);case"register":if("string"==typeof l?.email)return n3(i,e,l,n);default:return{status:400,body:{error:"Invalid request"},cookies:n,headers:{"Content-Type":"application/json"}}}}async function iy(e,t){let{action:r,providerId:n,error:i,method:o}=e,a=t.skipCSRFCheck===ig,{options:s,cookies:c}=await tD({authOptions:t,action:r,providerId:n,url:e.url,callbackUrl:e.body?.callbackUrl??e.query?.callbackUrl,csrfToken:e.body?.csrfToken,cookies:e.cookies,isPost:"POST"===o,csrfDisabled:a}),l=new u(s.cookies.sessionToken,e.cookies,s.logger);if("GET"===o){let t=rH({...s,query:e.query,cookies:c});switch(r){case"callback":return await is(e,s,l,c);case"csrf":return t.csrf(a,s,c);case"error":return t.error(i);case"providers":return t.providers(s.providers);case"session":return await il(s,l,c);case"signin":return t.signin(n,i);case"signout":return t.signout();case"verify-request":return t.verifyRequest();case"webauthn-options":return await iw(e,s,l,c)}}else{let{csrfTokenVerified:t}=s;switch(r){case"callback":return"credentials"===s.provider.type&&tP(r,t),await is(e,s,l,c);case"session":return tP(r,t),await il(s,l,c,!0,e.body?.data);case"signin":return tP(r,t),await ih(e,c,s);case"signout":return tP(r,t),await ip(c,l,s)}}throw new d.D7(`Cannot handle action: ${r}`)}let ig=Symbol("skip-csrf-check"),ib=Symbol("return-type-raw");async function iv(e,t){let r;!function(e={},t){t||(t$.debug=()=>{}),e.error&&(t$.error=e.error),e.warn&&(t$.warn=e.warn),e.debug&&(t$.debug=e.debug)}(t.logger,t.debug);let n=await tA(e,t);if(n instanceof Error)return t$.error(n),Response.json(`Error: This action with HTTP ${e.method} is not supported.`,{status:400});let i=function(e,t){let{url:r}=e,n=[];if(!h&&t.debug&&n.push("debug-enabled"),!t.trustHost)return new d.kA(`Host must be trusted. URL was: ${e.url}`);if(!t.secret)return new d.yv("Please define a `secret`.");let i=e.query?.callbackUrl;if(i&&!p(i,r.origin))return new d.k7(`Invalid callback URL. Received: ${i}`);let{callbackUrl:o}=l(t.useSecureCookies??"https:"===r.protocol),a=e.cookies?.[t.cookies?.callbackUrl?.name??o.name];if(a&&!p(a,r.origin))return new d.k7(`Invalid callback URL. Received: ${a}`);let s=!1;for(let e of t.providers){let t="function"==typeof e?e():e;if(("oauth"===t.type||"oidc"===t.type)&&!(t.issuer??t.options?.issuer)){let e;let{authorization:r,token:n,userinfo:i}=t;if("string"==typeof r||r?.url?"string"==typeof n||n?.url?"string"==typeof i||i?.url||(e="userinfo"):e="token":e="authorization",e)return new d.Hi(`Provider "${t.id}" is missing both \`issuer\` and \`${e}\` endpoint config. At least one of them is required.`)}if("credentials"===t.type)f=!0;else if("email"===t.type)m=!0;else if("webauthn"===t.type){var c;if(w=!0,t.simpleWebAuthnBrowserVersion&&(c=t.simpleWebAuthnBrowserVersion,!/^v\d+(?:\.\d+){0,2}$/.test(c)))return new d.l4(`Invalid provider config for "${t.id}": simpleWebAuthnBrowserVersion "${t.simpleWebAuthnBrowserVersion}" must be a valid semver string.`);if(t.enableConditionalUI){if(s)return new d.j7("Multiple webauthn providers have 'enableConditionalUI' set to True. Only one provider can have this option enabled at a time.");if(s=!0,!Object.values(t.formFields).some(e=>e.autocomplete&&e.autocomplete.toString().indexOf("webauthn")>-1))return new d.BX(`Provider "${t.id}" has 'enableConditionalUI' set to True, but none of its formFields have 'webauthn' in their autocomplete param.`)}}}if(f){let e=t.session?.strategy==="database",r=!t.providers.some(e=>
399"credentials"!==("function"==typeof e?e():e).type);if(e&&r)return new d.lA("Signing in with credentials only supported if JWT strategy is enabled");if(t.providers.some(e=>{let t="function"==typeof e?e():e;return"credentials"===t.type&&!t.authorize}))return new d.yQ("Must define an authorize() handler to use credentials authentication provider")}let{adapter:u,session:v}=t,_=[];if(m||v?.strategy==="database"||!v?.strategy&&u){if(m){if(!u)return new d.Xp("Email login requires an adapter.");_.push(...y)}else{if(!u)return new d.Xp("Database session requires an adapter.");_.push(...g)}}if(w){if(!t.experimental?.enableWebAuthn)return new d.dw("WebAuthn is an experimental feature. To enable it, set `experimental.enableWebAuthn` to `true` in your config.");if(n.push("experimental-webauthn"),!u)return new d.Xp("WebAuthn requires an adapter.");_.push(...b)}if(u){let e=_.filter(e=>!(e in u));if(e.length)return new d.xP(`Required adapter methods were missing: ${e.join(", ")}`)}return h||(h=!0),n}(n,t);if(Array.isArray(i))i.forEach(t$.warn);else if(i instanceof Error){if(t$.error(i),!["signin","signout","error","verify-request"].includes(n.action)||"GET"!==n.method)return Response.json({message:"There was a problem with the server configuration. Check the server logs for more information."},{status:500});let{pages:e,theme:r}=t,o=e?.error&&n.url.searchParams.get("callbackUrl")?.startsWith(e.error);return!e?.error||o?(o&&t$.error(new d.Mq(`The error page ${e?.error} should not require authentication`)),tE(rH({theme:r}).error("Configuration"))):Response.redirect(`${e.error}?error=Configuration`)}let o=e.headers?.has("X-Auth-Return-Redirect"),a=t.raw===ib;try{let e=await iy(n,t);if(a)return e;r=await tE(e)}catch(h){t$.error(h);let r=h instanceof d.l4;if(r&&a&&!o)throw h;if("POST"===e.method&&"session"===n.action)return Response.json(null,{status:400});let i=r?h.type:"Configuration",s=r&&h.kind||"error",c=new URLSearchParams({error:i}),l=t.pages?.[s]??`${t.basePath}/${s.toLowerCase()}`,u=`${n.url.origin}${l}?${c}`;if(o)return Response.json({url:u});return Response.redirect(u)}let s=r.headers.get("Location");return o&&s?Response.json({url:s},{headers:r.headers}):r}var i_=r(13061),ik=r(40568);function iA(e){let t=ik.env.AUTH_URL??ik.env.NEXTAUTH_URL;if(!t)return e;let{origin:r}=new URL(t),{href:n,origin:i}=e.nextUrl;return new i_.NextRequest(n.replace(i,r),e)}function iE(e){try{e.secret??(e.secret=ik.env.AUTH_SECRET??ik.env.NEXTAUTH_SECRET);let t=ik.env.AUTH_URL??ik.env.NEXTAUTH_URL;if(!t)return;let{pathname:r}=new URL(t);if("/"===r)return;e.basePath||(e.basePath=r)}catch{}finally{e.basePath||(e.basePath="/api/auth"),function(e,t){try{let r=e.AUTH_URL;r&&!t.basePath&&(t.basePath=new URL(r).pathname)}catch{}finally{t.basePath??(t.basePath="/auth")}if(!t.secret?.length){t.secret=[];let r=e.AUTH_SECRET;for(let n of(r&&t.secret.push(r),[1,2,3])){let r=e[`AUTH_SECRET_${n}`];r&&t.secret.unshift(r)}}t.redirectProxyUrl??(t.redirectProxyUrl=e.AUTH_REDIRECT_PROXY_URL),t.trustHost??(t.trustHost=!!(e.AUTH_URL??e.AUTH_TRUST_HOST??e.VERCEL??e.CF_PAGES??"production"!==e.NODE_ENV)),t.providers=t.providers.map(t=>{let r="function"==typeof t?t({}):t,n=r.id.toUpperCase();return"oauth"===r.type||"oidc"===r.type?(r.clientId??(r.clientId=e[`AUTH_${n}_ID`]),r.clientSecret??(r.clientSecret=e[`AUTH_${n}_SECRET`]),"oidc"===r.type&&(r.issuer??(r.issuer=e[`AUTH_${n}_ISSUER`]))):"email"===r.type&&(r.apiKey??(r.apiKey=e[`AUTH_${n}_KEY`])),r})}(ik.env,e)}}var iS=r(22440),ix=r(83663),iT=r(40568);async function iP(e,t={},r,n){let i=new Headers((0,iS.headers)()),{redirect:o=!0,redirectTo:a,...s}=t instanceof FormData?Object.fromEntries(t):t,c=a?.toString()??i.get("Referer")??"/",l=iO("signin",i,n.basePath);if(!e)return l.searchParams.append("callbackUrl",c),o&&(0,ix.redirect)(l.toString()),l.toString();let u=`${l}/${e}?${new URLSearchParams(r)}`,d={};for(let t of n.providers){let{options:r,...n}="function"==typeof t?t():t,i=r?.id??n.id;if(i===e){d={id:i,type:r?.type??n.type};break}}if(!d.id){let e=`${l}?${new URLSearchParams({callbackUrl:c})}`;return o&&(0,ix.redirect)(e),e}"credentials"===d.type&&(u=u.replace("signin","callback")),i.set("Content-Type","application/x-www-form-urlencoded");
399let h=new Request(u,{method:"POST",headers:i,body:new URLSearchParams({...s,callbackUrl:c})}),p=await iv(h,{...n,raw:ib,skipCSRFCheck:ig});for(let e of p?.cookies??[])(0,iS.cookies)().set(e.name,e.value,e.options);return o?(0,ix.redirect)(p.redirect):p.redirect}async function iC(e,t){let r=new Headers((0,iS.headers)());r.set("Content-Type","application/x-www-form-urlencoded");let n=iO("signout",r,t.basePath),i=new URLSearchParams({callbackUrl:e?.redirectTo??r.get("Referer")??"/"}),o=new Request(n,{method:"POST",headers:r,body:i}),a=await iv(o,{...t,raw:ib,skipCSRFCheck:ig});for(let e of a?.cookies??[])(0,iS.cookies)().set(e.name,e.value,e.options);return e?.redirect??!0?(0,ix.redirect)(a.redirect):a}async function iR(e,t){let r=new Headers((0,iS.headers)());r.set("Content-Type","application/json");let n=new Request(iO("session",r,t.basePath),{method:"POST",headers:r,body:JSON.stringify({data:e})}),i=await iv(n,{...t,raw:ib,skipCSRFCheck:ig});for(let e of i?.cookies??[])(0,iS.cookies)().set(e.name,e.value,e.options);return i.body}function iO(e,t,r){let n=iT.env.AUTH_URL??iT.env.NEXTAUTH_URL;if(n){let{origin:t,pathname:r}=new URL(n),i=r.endsWith("/")?"":"/";return new URL(`${t}${r}${i}${e}`)}let i=t.get("x-forwarded-host")??t.get("host"),o="http"===t.get("x-forwarded-proto")?"http":"https",{origin:a,pathname:s}=new URL(r,`${o}://${i}`),c=s.endsWith("/")?"":"/";return new URL(`${a}${s}${c}${e}`)}async function iU(e,t){return iv(new Request(iO("session",e,t.basePath),{headers:{cookie:e.get("cookie")??""}}),{...t,callbacks:{...t.callbacks,async session(...e){let r=await t.callbacks?.session?.(...e)??{...e[0].session,expires:e[0].session.expires?.toISOString?.()??e[0].session.expires};return{user:e[0].user??e[0].token,...r}}}})}function iI(e){return"function"==typeof e}function iN(e,t){return"function"==typeof e?(...r)=>{if(!r.length){let r=(0,iS.headers)(),n=e(void 0);return t?.(n),iU(r,n).then(e=>e.json())}if(r[0]instanceof Request){let n=r[0],i=r[1],o=e(n);return t?.(o),iH([n,i],o)}if(iI(r[0])){let t=r[0];return async(...r)=>iH(r,e(r[0]),t)}let n="req"in r[0]?r[0].req:r[0],i="res"in r[0]?r[0].res:r[1],o=e(n);return t?.(o),iU(new Headers(n.headers),o).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())i.headers.append("set-cookie",t);return t})}:(...t)=>{if(!t.length)return iU((0,iS.headers)(),e).then(e=>e.json());if(t[0]instanceof Request)return iH([t[0],t[1]],e);if(iI(t[0])){let r=t[0];return async(...t)=>iH(t,e,r).then(e=>(console.log(Object.fromEntries(e.headers)),e))}let r="req"in t[0]?t[0].req:t[0],n="res"in t[0]?t[0].res:t[1];return iU(new Headers(r.headers),e).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())n.headers.append("set-cookie",t);return t})}}async function iH(e,t,r){let n=iA(e[0]),i=await iU(n.headers,t),o=await i.json(),a=!0;t.callbacks?.authorized&&(a=await t.callbacks.authorized({request:n,auth:o}));let s=i_.NextResponse.next?.();if(a instanceof Response){s=a;let e=a.headers.get("Location"),{pathname:r}=n.nextUrl;e&&function(e,t,r){let n=t.replace(`${e}/`,""),i=Object.values(r.pages??{});return(ij.has(n)||i.includes(t))&&t===e}(r,new URL(e).pathname,t)&&(a=!0)}else if(r)n.auth=o,s=await r(n,e[1])??i_.NextResponse.next();else if(!a){let e=t.pages?.signIn??`${t.basePath}/signin`;if(n.nextUrl.pathname!==e){let t=n.nextUrl.clone();t.pathname=e,t.searchParams.set("callbackUrl",n.nextUrl.href),s=i_.NextResponse.redirect(t)}}let c=new Response(s?.body,s);for(let e of i.headers.getSetCookie())c.headers.append("set-cookie",e);return console.log(Object.fromEntries(c.headers)),console.log(Object.fromEntries(s.headers)),c}let ij=new Set(["providers","session","csrf","signin","signout","callback","verify-request","error"]);function i$(e){if("function"==typeof e){let t=t=>{let r=e(t);return iE(r),iv(iA(t),r)};return{handlers:{GET:t,POST:t},auth:iN(e,e=>iE(e)),signIn:(t,r,n)=>{let i=e(void 0);return iE(i),iP(t,r,n,i)},signOut:t=>{let r=e(void 0);return iE(r),iC(t,r)},unstable_update:t=>{let r=e(void 0);return iE(r),iR(t,r)}}}iE(e);let t=t=>iv(iA(t),e);return{handlers:{GET:t,POST:t},auth:iN(e),signIn:(t,r,n)=>iP(t,r,n,e),signOut:t=>iC(t,e),unstable_update:t=>iR(t,e)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.